[289739,323933] WCAG 2.0/JIS support
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/IBlindProblem.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/IBlindProblem.java index 766a2a9..8dd1ff1 100644 --- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/IBlindProblem.java +++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/IBlindProblem.java
@@ -51,6 +51,6 @@ public static final int INVISIBLE_INTRAPAGE_LINK = 35; public static final int NO_VALUE_INPUT_BUTTON = 36; public static final int SEPARATE_DBCS_INPUT_VALUE = 37; - public static final int NUM_PROBLEMS = 38;// max id+1 - + public static final int WRONG_NBSP_ALT_IMG = 38; + public static final int NUM_PROBLEMS = 39;// max id+1 } \ No newline at end of file
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/VisualizeEngine.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/VisualizeEngine.java index 3fa474d..b6ccc5a 100644 --- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/VisualizeEngine.java +++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/engines/blind/html/VisualizeEngine.java
@@ -22,6 +22,7 @@ import java.util.Vector; import org.eclipse.actf.visualization.engines.blind.ParamBlind; +import org.eclipse.actf.visualization.engines.blind.TextCheckResult; import org.eclipse.actf.visualization.engines.blind.TextChecker; import org.eclipse.actf.visualization.engines.blind.html.ui.elementViewer.impl.VisualizeStyleInfo; import org.eclipse.actf.visualization.engines.blind.html.ui.elementViewer.impl.VisualizeStyleInfoManager; @@ -430,6 +431,7 @@ } } if (altNode != null) { + // TODO space separated input.setAttribute("value", altNode.getNodeValue()); } else { BlindProblem prob = new BlindProblem( @@ -457,9 +459,14 @@ prob = new BlindProblem( IBlindProblem.NO_VALUE_INPUT_BUTTON); } - } else if (textChecker.isSeparatedJapaneseChars(valueS)) { - prob = new BlindProblem( - IBlindProblem.SEPARATE_DBCS_INPUT_VALUE, valueS); + } else { + TextCheckResult result = textChecker.checkAlt(valueS); + if (result.equals(TextCheckResult.SPACE_SEPARATED) + || result + .equals(TextCheckResult.SPACE_SEPARATED_JP)) { + prob = new BlindProblem( + IBlindProblem.SEPARATE_DBCS_INPUT_VALUE, valueS); + } } if (prob != null) { Integer idObj = mapData.getIdOfNode(input);
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/ImgChecker.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/ImgChecker.java index a5b516a..bd2a435 100644 --- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/ImgChecker.java +++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/ImgChecker.java
@@ -14,6 +14,7 @@ import java.util.Map; import java.util.Vector; +import org.eclipse.actf.visualization.engines.blind.TextCheckResult; import org.eclipse.actf.visualization.engines.blind.TextChecker; import org.eclipse.actf.visualization.engines.blind.html.IBlindProblem; import org.eclipse.actf.visualization.engines.blind.html.VisualizeEngine; @@ -136,24 +137,15 @@ } } else { String alt = areaE.getAttribute(ALT); - if (alt.length() > 0) { - if (textChecker.isInappropriateAlt(alt)) { - prob = new BlindProblem( - IBlindProblem.WRONG_ALT_AREA, alt); + TextCheckResult result = textChecker.checkAlt(alt); - } else if (textChecker - .isSeparatedJapaneseChars(alt)) { - prob = new BlindProblem( - IBlindProblem.SEPARATE_DBCS_ALT_AREA, - alt); + // blank and inappropriate are moved to C_300.1 - } - - } else { - if (areaE.hasAttribute("href")) { - prob = new BlindProblem( - IBlindProblem.WRONG_ALT_AREA, alt); - } + if (result.equals(TextCheckResult.SPACE_SEPARATED) + || result + .equals(TextCheckResult.SPACE_SEPARATED_JP)) { + prob = new BlindProblem( + IBlindProblem.SEPARATE_DBCS_ALT_AREA, alt); } if (prob != null) { prob.setTargetNode(mapData.getOrigNode(areaE)); @@ -212,33 +204,27 @@ } else { altS = img.getAttribute(ALT); if (altS.length() > 0) { - if (textChecker.isInappropriateAlt(altS)) { + TextCheckResult result = textChecker.checkAlt(altS, + img.getAttribute(SRC)); + if (result.equals(TextCheckResult.NG_WORD) + || result.equals(TextCheckResult.IMG_EXT)) { // prob = new BlindProblem(IBlindProblem.WRONG_ALT_IMG, // altS); prob = new BlindProblem(IBlindProblem.ALERT_WRONG_ALT, altS); - } else if (textChecker.isSeparatedJapaneseChars(altS)) { + } else if (result.equals(TextCheckResult.SPACE_SEPARATED_JP)) { prob = new BlindProblem( IBlindProblem.SEPARATE_DBCS_ALT_IMG, altS); - } else { - switch (textChecker.checkInappropriateAlt(altS)) { - case 3: - prob = new BlindProblem(IBlindProblem.ALERT_SPELL_OUT, - altS); - break; - case 2: - prob = new BlindProblem(IBlindProblem.ALERT_WRONG_ALT, - altS); - // prob = new BlindProblem(IBlindProblem.WRONG_ALT_IMG, - // altS); - break; - case 1: - prob = new BlindProblem(IBlindProblem.ALERT_WRONG_ALT, - altS); - break; - case 0: - default: - break; - } + } else if (result.equals(TextCheckResult.SPACE_SEPARATED)) { + prob = new BlindProblem(IBlindProblem.ALERT_SPELL_OUT, altS); + } else if (result.equals(TextCheckResult.BLANK_NBSP)) { + prob = new BlindProblem(IBlindProblem.WRONG_NBSP_ALT_IMG, + altS); + } else if (!result.equals(TextCheckResult.OK)) { + // includes ASCII_ART, BLANK, SAME_AS_SRC etc. + prob = new BlindProblem(IBlindProblem.ALERT_WRONG_ALT, altS); + // prob = new + // BlindProblem(IBlindProblem.WRONG_ALT_IMG, + // altS); } } } @@ -272,32 +258,6 @@ * For new JIS * * @param img - */ - private void check_H67(Element img) { - System.out.println("----"); - System.out.println("check_H67"); - String src = img.getAttribute(SRC); - System.out.println("src = " + src + ", alt = [" + img.getAttribute(ALT) - + "]"); - System.out.println(isIgnoredByAT(img)); - - if (isIgnoredByAT(img)) { - String alt = img.getAttribute(ALT); // it must exist - if (alt.matches("[ ]+")) - System.out.println("warning: alt=\"\" is recommended"); - if (alt.matches("(\\u00A0)+")) - System.out - .println("error: cannot be used for null ALT purpose"); - if (img.hasAttribute("title") - && img.getAttribute("title").length() > 0) - System.out.println("error: title att exists in ignored img"); - } - } - - /** - * For new JIS - * - * @param img * @return */ private boolean isIgnoredByAT(Element img) {
diff --git a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/NodeInfoCreator.java b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/NodeInfoCreator.java index 85b8d14..0e6440e 100644 --- a/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/NodeInfoCreator.java +++ b/plugins/org.eclipse.actf.visualization.engines.blind.html/src/org/eclipse/actf/visualization/internal/engines/blind/html/util/NodeInfoCreator.java
@@ -135,12 +135,16 @@ // TODO consider ALT text ('['+alt+']') // check inappropritate text + if (textChecker.isSeparatedJapaneseChars(curText)) { - BlindProblem prob = new BlindProblem( - IBlindProblem.WRONG_TEXT, curText); - prob.setNode(p.getNode()); - prob.setTargetNode(mapData.getOrigNode(p.getNode())); - problems.add(prob); + String nodeName = p.getNode().getNodeName(); + if (!nodeName.matches("img|input|area")) {//already checked + BlindProblem prob = new BlindProblem( + IBlindProblem.WRONG_TEXT, curText); + prob.setNode(p.getNode()); + prob.setTargetNode(mapData.getOrigNode(p.getNode())); + problems.add(prob); + } } // check redundant texts @@ -270,7 +274,7 @@ } @SuppressWarnings("nls") - //TODO + // TODO public void createAdditionalNodeInfo(Document doc) { // create elementList // set node info ID
diff --git a/plugins/org.eclipse.actf.visualization.eval/resources/description_ja.properties b/plugins/org.eclipse.actf.visualization.eval/resources/description_ja.properties index 32f4909..cd75ab4 100644 --- a/plugins/org.eclipse.actf.visualization.eval/resources/description_ja.properties +++ b/plugins/org.eclipse.actf.visualization.eval/resources/description_ja.properties
@@ -30,17 +30,17 @@ B_23 = \u3088\u308a\u591a\u304f\u306e\u898b\u51fa\u3057\u3092\u63d0\u4f9b\u3059\u308b\u304b\u3001\u30da\u30fc\u30b8\u5185\u30ea\u30f3\u30af\u306e\u5229\u7528\u3092\u691c\u8a0e\u3057\u3066\u304f\u3060\u3055\u3044\u3000(\u3053\u306e\u30da\u30fc\u30b8\u306b\u306f\u898b\u51fa\u3057\u304c\u5b58\u5728\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u5230\u9054\u306b2\u5206\u4ee5\u4e0a\u5fc5\u8981\u306a\u30b3\u30f3\u30c6\u30f3\u30c4\u304c\u5b58\u5728\u3057\u3066\u3044\u307e\u3059) B_24 = \u3088\u308a\u591a\u304f\u306e\u30da\u30fc\u30b8\u5185\u30ea\u30f3\u30af\u30fb\u898b\u51fa\u3057\u306e\u5229\u7528\u3092\u8003\u616e\u3057\u3066\u304f\u3060\u3055\u3044\u3000(\u65e2\u306b\u30da\u30fc\u30b8\u5185\u30ea\u30f3\u30af\u30fb\u898b\u51fa\u3057\u304c\u7528\u3044\u3089\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u5230\u9054\u306b2\u5206\u4ee5\u4e0a\u5fc5\u8981\u306a\u30b3\u30f3\u30c6\u30f3\u30c4\u304c\u5b58\u5728\u3057\u3066\u3044\u307e\u3059) B_25 = \u3053\u306e\u30da\u30fc\u30b8\u5185\u30ea\u30f3\u30af"{0}"\u306b\u306f\u3001\u8aad\u307f\u4e0a\u3052\u53ef\u80fd\u306a\u60c5\u5831\u3068\u3057\u3066title\u5c5e\u6027\u306e\u307f\u304c\u5b58\u5728\u3057\u3066\u3044\u307e\u3059\u3002\u30ea\u30f3\u30af\u5185\u306b\u4f55\u3089\u304b\u306e\u30c6\u30ad\u30b9\u30c8\u60c5\u5831\u3092\u63d0\u4f9b\u3059\u308b\u3053\u3068\u3092\u691c\u8a0e\u3057\u3066\u304f\u3060\u3055\u3044 -B_26 = \u30b9\u30ad\u30c3\u30d7\u30ea\u30f3\u30af\u306f"\u672c\u6587\u3078\u306e\u79fb\u52d5"\u3001"\u672c\u6587\u3078\u306e\u30ea\u30f3\u30af"\u7b49\u306a\u308b\u3079\u304f\u7c21\u6613\u306a\u30c6\u30ad\u30b9\u30c8\u3092\u5229\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002"{0}"\u306f\u5c11\u3057\u5197\u9577\u3067\u3059 +B_26 = \u30b9\u30ad\u30c3\u30d7\u30ea\u30f3\u30af\u306f"\u672c\u6587\u3078\u306e\u79fb\u52d5"\u3001"\u672c\u6587\u3078\u306e\u30ea\u30f3\u30af"\u7b49\u306a\u308b\u3079\u304f\u7c21\u6613\u306a\u30c6\u30ad\u30b9\u30c8\u3092\u5229\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002"{0}"\u306f\u5c11\u3057\u5197\u9577\u3067\u3059\u3002 B_27 = "{0}"\u306f\u753b\u50cf\u306ealt\u5c5e\u6027\u3068\u3057\u3066\u4e0d\u9069\u5207\u306a\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\uff08\u3082\u3057\u652f\u63f4\u6280\u8853\u304c\u3053\u306e\u753b\u50cf\u3092\u7121\u8996\u3059\u308b\u3079\u304d\u5834\u5408\u306f\u3001alt=""\u3068\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\uff09 -B_29 = \u753b\u50cf\u306ealt\u5c5e\u6027\u201d{0}\u201d\u306f\u6587\u5b57\u9593\u306b\u7a7a\u767d\u3092\u542b\u3093\u3067\u3044\u308b\u305f\u3081\u3001\u97f3\u58f0\u3067\u6b63\u78ba\u306b\u8aad\u307f\u4e0a\u3052\u308b\u3053\u3068\u304c\u51fa\u6765\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059 -B_30 = \u753b\u50cf\u30dc\u30bf\u30f3\u306ealt\u5c5e\u6027\u201d{0}\u201d\u306f\u6587\u5b57\u9593\u306b\u7a7a\u767d\u3092\u542b\u3093\u3067\u3044\u308b\u305f\u3081\u3001\u97f3\u58f0\u3067\u6b63\u78ba\u306b\u8aad\u307f\u4e0a\u3052\u308b\u3053\u3068\u304c\u51fa\u6765\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059 -B_31 = area\u306ealt\u5c5e\u6027\u201d{0}\u201d\u306f\u6587\u5b57\u9593\u306b\u7a7a\u767d\u3092\u542b\u3093\u3067\u3044\u308b\u305f\u3081\u3001\u97f3\u58f0\u3067\u6b63\u78ba\u306b\u8aad\u307f\u4e0a\u3052\u308b\u3053\u3068\u304c\u51fa\u6765\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059 +B_29 = \u753b\u50cf\u306ealt\u5c5e\u6027\u201d{0}\u201d\u306f\u6587\u5b57\u9593\u306b\u7a7a\u767d\u3092\u542b\u3093\u3067\u3044\u308b\u305f\u3081\u3001\u97f3\u58f0\u3067\u6b63\u78ba\u306b\u8aad\u307f\u4e0a\u3052\u308b\u3053\u3068\u304c\u51fa\u6765\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 +B_30 = \u753b\u50cf\u30dc\u30bf\u30f3\u306ealt\u5c5e\u6027\u201d{0}\u201d\u306f\u6587\u5b57\u9593\u306b\u7a7a\u767d\u3092\u542b\u3093\u3067\u3044\u308b\u305f\u3081\u3001\u97f3\u58f0\u3067\u6b63\u78ba\u306b\u8aad\u307f\u4e0a\u3052\u308b\u3053\u3068\u304c\u51fa\u6765\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 +B_31 = area\u306ealt\u5c5e\u6027\u201d{0}\u201d\u306f\u6587\u5b57\u9593\u306b\u7a7a\u767d\u3092\u542b\u3093\u3067\u3044\u308b\u305f\u3081\u3001\u97f3\u58f0\u3067\u6b63\u78ba\u306b\u8aad\u307f\u4e0a\u3052\u308b\u3053\u3068\u304c\u51fa\u6765\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 B_33 = \u3053\u306e\u30da\u30fc\u30b8\u5185\u30ea\u30f3\u30af\u306f\u30b8\u30e3\u30f3\u30d7\u5148\u306e\u30a2\u30f3\u30ab\u30fc"{0}"\u304c\u5b58\u5728\u3057\u307e\u305b\u3093\uff0e\u30b8\u30e3\u30f3\u30d7\u5148\u306e\u30a2\u30f3\u30ab\u30fc\u3092\u633f\u5165\u3057\u3066\u304f\u3060\u3055\u3044 (\u30da\u30fc\u30b8\u306e\u5148\u982d\u3078\u306e\u30da\u30fc\u30b8\u5185\u30ea\u30f3\u30af\u3068\u3057\u3066\u52d5\u4f5c\u3059\u308b\u5834\u5408\u3082\u3042\u308a\u307e\u3059) B_34 = \u5358\u8a9e\u306e\u3064\u3065\u308a\u3092\u8a18\u8ff0\u3057\u305f\u3044\u5834\u5408\u4ee5\u5916\u306f\uff0c\u6587\u5b57\u3092\u7a7a\u767d\u3067\u533a\u5207\u3063\u3066\u8a18\u8ff0\u3059\u308b\u3053\u3068\u306f\u907f\u3051\u3066\u304f\u3060\u3055\u3044 (alt\u5c5e\u6027 "{0}") B_35 = \u30da\u30fc\u30b8\u5185\u30ea\u30f3\u30af\uff0c {0} \uff0c\u306f\u5229\u7528\u3067\u304d\u306a\u3044\u3068\u601d\u308f\u308c\u307e\u3059\uff0e\uff08display:none\u3084display:hidden\u306e\u4ee3\u308f\u308a\u306b\uff0c\u30ea\u30f3\u30af\u5185\u306balt\u5c5e\u6027\u3092\u4ed8\u3051\u305f\u5c0f\u3055\u306a\u753b\u50cf\u3092\u914d\u7f6e\u3059\u308b\u306a\u3069\u3057\u3066\u4e0b\u3055\u3044\uff09 -B_36 = \u30dc\u30bf\u30f3(input)\u306b\u306fvalue\u5c5e\u6027\u3092\u63d0\u4f9b\u3057\u3066\u304f\u3060\u3055\u3044 -B_37 = \u201d{0}\u201d\u30dc\u30bf\u30f3\uff08input\u306evalue\u5c5e\u6027\uff09\u306f\u6587\u5b57\u9593\u306b\u7a7a\u767d\u3092\u542b\u3093\u3067\u3044\u308b\u305f\u3081\u3001\u97f3\u58f0\u3067\u6b63\u78ba\u306b\u8aad\u307f\u4e0a\u3052\u308b\u3053\u3068\u304c\u51fa\u6765\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059 -B_38 = "{0}"\uff08 \u3092\u542b\u3080\u7a7a\u767d\u6587\u5b57\u306e\u307f\uff09\u306f\u753b\u50cf\u306ealt\u5c5e\u6027\u3068\u3057\u3066\u4e0d\u9069\u5207\u3067\u3059 ( \u3067\u8868\u3055\u308c\u308b\u6587\u5b57\u3092\u542b\u3093\u3067\u3044\u307e\u3059)\u3002(\u3082\u3057\u652f\u63f4\u6280\u8853\u304c\u3053\u306e\u753b\u50cf\u3092\u7121\u8996\u3059\u308b\u3079\u304d\u5834\u5408\u306f\u3001 alt="" \u3068\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044) +B_36 = \u30dc\u30bf\u30f3(input)\u306b\u306fvalue\u5c5e\u6027\u3092\u63d0\u4f9b\u3057\u3066\u304f\u3060\u3055\u3044 \u3002 +B_37 = \u201d{0}\u201d\u30dc\u30bf\u30f3\uff08input\u306evalue\u5c5e\u6027\uff09\u306f\u6587\u5b57\u9593\u306b\u7a7a\u767d\u3092\u542b\u3093\u3067\u3044\u308b\u305f\u3081\u3001\u97f3\u58f0\u3067\u6b63\u78ba\u306b\u8aad\u307f\u4e0a\u3052\u308b\u3053\u3068\u304c\u51fa\u6765\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 +B_38 = "{0}"\uff08 \u3092\u542b\u3080\u7a7a\u767d\u6587\u5b57\u306e\u307f\uff09\u306f\u753b\u50cf\u306ealt\u5c5e\u6027\u3068\u3057\u3066\u4e0d\u9069\u5207\u3067\u3059\u3002 ( \u3067\u8868\u3055\u308c\u308b\u6587\u5b57\u3092\u542b\u3093\u3067\u3044\u307e\u3059)\u3002(\u3082\u3057\u652f\u63f4\u6280\u8853\u304c\u3053\u306e\u753b\u50cf\u3092\u7121\u8996\u3059\u308b\u3079\u304d\u5834\u5408\u306f\u3001 alt="" \u3068\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044) C_1000.0 = \u3053\u306e\u30da\u30fc\u30b8\u306b\u306f\u8907\u6570\u306ebody\u8981\u7d20\u304c\u3042\u308b\u3088\u3046\u3067\u3059\uff0eHTML\u3092\u4fee\u6b63\u3057\u3066\u304f\u3060\u3055\u3044 C_1000.1 = body\u8981\u7d20\u306e\u4e2d\u306bhead\u8981\u7d20\u304c\u3042\u308b\u3088\u3046\u3067\u3059\uff0eHTML\u3092\u4fee\u6b63\u3057\u3066\u304f\u3060\u3055\u3044