From 7c122dc10c19dc44d173ac5a9df63387da910f40 Mon Sep 17 00:00:00 2001 From: Sereza7 Date: Fri, 12 Jan 2024 16:09:15 +0100 Subject: [PATCH 1/2] XWIKI-21772: Admin section: make user directory pass webstandard tests * Fixed the input label validation to allow another standard HTML way to link the label to its input. Note: This allowed the user directory to pass webstandard tests properly, but did not fix other pages (at least not completely) --- .../xwiki/validator/HTML5DutchWebGuidelinesValidator.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xwiki-platform-tools/xwiki-platform-tool-standards-validator/src/main/java/org/xwiki/validator/HTML5DutchWebGuidelinesValidator.java b/xwiki-platform-tools/xwiki-platform-tool-standards-validator/src/main/java/org/xwiki/validator/HTML5DutchWebGuidelinesValidator.java index 71d1719e92aa..cd8dd938c709 100644 --- a/xwiki-platform-tools/xwiki-platform-tool-standards-validator/src/main/java/org/xwiki/validator/HTML5DutchWebGuidelinesValidator.java +++ b/xwiki-platform-tools/xwiki-platform-tool-standards-validator/src/main/java/org/xwiki/validator/HTML5DutchWebGuidelinesValidator.java @@ -1160,12 +1160,16 @@ public void validateRpd13s1() if (id != null) { // Looking for the label associated to the input. boolean hasLabel = false; - for (Element label : getElement(ELEM_BODY).getElementsByTag("label")) { + String labelTagName = "label"; + for (Element label : getElement(ELEM_BODY).getElementsByTag(labelTagName)) { if (id.equals(label.attr("for"))) { hasLabel = true; break; } } + // From MDN webdocs: Alternatively, you can nest the directly inside the