Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When we did accessibility test through W3C HTML validation tool, it generated the error as below:
Then I found the code is inside antibot-no-js.html.twig.
Just wondering can we put the style inside the <head>
element or .css file instead of <noscript>
?
Comment | File | Size | Author |
---|---|---|---|
#6 | 3061080-noscript-style.patch | 1016 bytes | ducktape |
| |||
#4 | 3061080-noscript-style.patch | 999 bytes | ducktape |
| |||
Selection_059.png | 37.41 KB | cjc414 |
Comments
Comment #2
mstef CreditAttribution: mstef at FFW commentedThis was added in #2934488: Do not modify the visual experience of the form for users with JavaScript. The problem was that we used to hide the form and show the warning message by default, then have JS remove it if the user is considered a non-bot. The problem was that on slower sites, you'd get a flash of the warning message, etc, right before the JS does what it needs to do. I moved it to a noscript to avoid it. Do you have any suggestions or a patch?
Comment #3
cjc414 CreditAttribution: cjc414 commentedHi mstef,
Thanks for your reply. I did some research and try to embed the css as a file while JS is not enabled, but it seems not working as expected. I will leave it for now as it is a minor issue regards to our requirement. Hope there will be a good solution for this later, otherwise I may look at this again in the future.
Comment #4
ducktape CreditAttribution: ducktape at District09 commentedThis patch moves the style to the head element, inside a noscript element. This makes the html valid and doesn't trigger a visual flash on slow devices.
Comment #5
ducktape CreditAttribution: ducktape at District09 commentedComment #6
ducktape CreditAttribution: ducktape at District09 commentedFixed notice, that breaks the tests. Also switched to dev version.
Comment #7
mpp CreditAttribution: mpp at AmeXio for District09 commentedrtbc
Comment #8
mstef CreditAttribution: mstef at FFW commentedComment #10
mstef CreditAttribution: mstef at FFW commented