protected void processFrameset(final Element node, final Set<String> noframes,
final List<Result> errors, int level, Source source) {
if (HTMLElementName.FRAME.equals(node.getName().toLowerCase())) {
logger.debug("validateFrame");
// Criteria 2.1
final Attribute name = node.getAttributes().get("name");
if (name == null) {
Result ve = new Result(bundle.get(
"org.jahia.services.htmlvalidator.WAIValidator.2.1",
"Missing 'name' attribute for 'frame' element"), node.toString(),
node.toString(), bundle.get(
"org.jahia.services.htmlvalidator.WAIValidator.2.1.example", ""));
setPosition(node, source, ve);
errors.add(ve);
} else {
// Criteria 2.1 (Remarque)
final String nameValue = text2XMLEntityRef(name.getValue());
if (nameValue.indexOf(' ') > -1) {
Result ve = new Result(bundle.getFormatted(
"org.jahia.services.htmlvalidator.WAIValidator.2.1.2",
"Attribute 'name' cannot contain any white space",
new Object[]{nameValue}), node.toString(), node.toString(), bundle.get(
"org.jahia.services.htmlvalidator.WAIValidator.2.1.2.example", ""));
setPosition(node, source, ve);
errors.add(ve);
} else {
// Criteria 2.5
final Attribute title = node.getAttributes().get("title");
if (title == null) {
Result ve = new Result(bundle.getFormatted(
"org.jahia.services.htmlvalidator.WAIValidator.2.5",
"Missing 'title' attribute for 'frame' element",
new Object[]{nameValue}), node.toString(), node.toString(), bundle
.get("org.jahia.services.htmlvalidator.WAIValidator.2.5.example",
""));
setPosition(node, source, ve);
errors.add(ve);
}
}
// Criteria 2.10
final Attribute scrolling = node.getAttributes().get("scrolling");
if (scrolling != null && "no".equals(scrolling.getValue().toLowerCase())) {
Result ve = new Result(bundle.getFormatted(
"org.jahia.services.htmlvalidator.WAIValidator.2.10",
"Scrolling should be set to at least 'auto' for frame " + nameValue,
new Object[]{nameValue}), node.toString(), node.toString(), bundle.get(
"org.jahia.services.htmlvalidator.WAIValidator.2.10.example", ""));