When we did accessibility test through W3C HTML validation tool, it generated the error as below:

screenshot

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> ?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cjc414 created an issue. See original summary.

mstef’s picture

This 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?

cjc414’s picture

Hi 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.

ducktape’s picture

This 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.

ducktape’s picture

Status: Active » Needs review
ducktape’s picture

Version: 8.x-1.2 » 8.x-1.x-dev
FileSize
1016 bytes

Fixed notice, that breaks the tests. Also switched to dev version.

mpp’s picture

Status: Needs review » Reviewed & tested by the community

rtbc

mstef’s picture

Status: Reviewed & tested by the community » Fixed

  • mstef committed 757fcf1 on 8.x-1.x authored by ducktape
    Issue #3061080 by ducktape, cjc414: antibot-no-js.html.twig does not...
mstef’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.