New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
All of WET 4.0's logo SVGs are implemented in a manner that fails HTML validation #8276
Comments
@EricDunsworth great, thank for the background. Do you know what browser required to load SVG via an |
@duboisp Based on https://stackoverflow.com/questions/4476526/do-i-use-img-object-or-embed-for-svg-files, it seems like several years ago, browser support for SVGs referenced within I also stumbled upon https://developer.mozilla.org/en-US/docs/Web/SVG/SVG_as_an_Image, which states that Gecko implements several security restrictions on SVGs that are used as images (like when they're referenced via |
@EricDunsworth can you submit a PR and then I would create a working example for testing. |
@duboisp Yeah - that's my intent. Should have a PR open for this repo by COB or tomorrow depending on whether I run into any issues in my own testing. |
I was about to submit this issue this morning.. thanks for this. I will await your test before i implement your suggested fix. |
One thing to test is nested media queries in the SVG. We use one SVG that adapts on it's size to switch from the color to the black and white version. With that being said, the SVG themselves can probably be updated to reflect more modern SVG patterns. |
@LaurentGoderre Thanks for the heads up about the nested media queries. Looks like support for IE11 honours SVGs referenced via |
I believe I've come up with a viable way of dealing with the SVGs that have nested media queries. Adding something along the lines of I'll send out a PR once I figure out how best way to deal with the dimensions of |
* Fixes wet-boew#8276. * Adds a print CSS filter to change the logo's brightness to 0%: * Needed for Gecko, Blink and possibly Webkit due to their buggy handling of inline SVG media queries when the img element is used. When printing, they inherit screen-only queries and ignore print-only queries. * Prevents the fallback PNG logo from being coloured white when printing in browsers that support CSS filters. * Retains the SVG logo's inline screen media query to prevent issues in browsers that correctly handle them and lack support for CSS filters (i.e. Internet Explorer 10-11). * Restores the splash page's "wb-sppe" class (which was inadvertently removed in wet-boew#6113): * Allows the splash page's logo image to be specifically targeted by the print CSS filer. * Indirectly brings back wet-boew#5293's fix for the splash page logo's size in Internet Explorer 10-11.
* Fixes wet-boew#8276. * Adds a print CSS filter to change the logo's brightness to 0%: * Needed for Gecko, Blink and possibly Webkit due to their buggy handling of inline SVG media queries when the img element is used. When printing, they apply screen-only queries and ignore print-only queries. * Prevents the fallback PNG logo from being coloured white when printing in browsers that support CSS filters. * Retains the SVG logo's inline screen media query to prevent issues in browsers that correctly handle them and lack support for CSS filters (i.e. Internet Explorer 10-11). * Restores the splash page's "wb-sppe" class (which was inadvertently removed in wet-boew#6113): * Allows the splash page's logo image to be specifically targeted by the print CSS filer. * Indirectly brings back wet-boew#5293's fix for the splash page logo's size in Internet Explorer 10-11 (which also fixes the fallback PNG logo's size in all browsers).
Just sent out #8282. In the end, I wasn't able to figure out how to perfectly replicate the |
* Fixes wet-boew#8276. * Adds a print CSS filter to change the logo's brightness to 0%: * Needed for Gecko, Blink and possibly Webkit due to their buggy handling of inline SVG media queries when the img element is used. When printing, they apply screen-only queries and ignore print-only queries. * Prevents the fallback PNG logo from being coloured white when printing in browsers that support CSS filters. * Retains the SVG logo's inline screen media query to prevent issues in browsers that correctly handle them and lack support for CSS filters (i.e. Internet Explorer 10-11). * Restores the splash page's "wb-sppe" class (which was inadvertently removed in wet-boew#6113): * Allows the splash page's logo image to be specifically targeted by the print CSS filer. * Indirectly brings back wet-boew#5293's fix for the splash page logo's size in Internet Explorer 10-11 (which also fixes the fallback PNG logo's size in all browsers).
* Port of wet-boew/wet-boew#8287. * Related to wet-boew/wet-boew#8276. * Modifies SCSS to increase the bottom margins on the FIP images to replicate the empty space that was previously appearing below their object element containers.
* Port of wet-boew/wet-boew#8282. * Related to wet-boew/wet-boew#8276. * Modifies SCSS to increase the bottom margins on the FIP images to replicate the empty space that was previously appearing below their object element containers.
* Fixes wet-boew#8276. * Adds a print CSS filter to change the logo's brightness to 0%: * Needed for Gecko, Blink and possibly Webkit due to their buggy handling of inline SVG media queries when the img element is used. When printing, they apply screen-only queries and ignore print-only queries. * Prevents the fallback PNG logo from being coloured white when printing in browsers that support CSS filters. * Retains the SVG logo's inline screen media query to prevent issues in browsers that correctly handle them and lack support for CSS filters (i.e. Internet Explorer 10-11). * Restores the splash page's "wb-sppe" class (which was inadvertently removed in wet-boew#6113): * Allows the splash page's logo image to be specifically targeted by the print CSS filer. * Indirectly brings back wet-boew#5293's fix for the splash page logo's size in Internet Explorer 10-11 (which also fixes the fallback PNG logo's size in all browsers).
* Port of wet-boew/wet-boew#8282. * Related to wet-boew/wet-boew#8276. * Adds a CSS filter to change the wordmark SVG's colour to white in small view and under: * Needed for Gecko, Blink and possibly Webkit due to their buggy handling of inline SVG media queries when the img element is used. When printing, they apply screen-only queries and ignore print-only queries. * Modifies the wordmark SVG's inline media query to only change its colour to white in Internet Explorer 10-11: * Since IE10-11 correctly handle the aforementioned media queries but lack support for CSS filters, this is the most viable setup to make the wordmark render correctly in all of WET's supported browsers. * Modifies the theme's JavaScript logic to only toggle the fallback PNG images when switching between small and under/medium and over views. * Modifies SCSS to increase the bottom margins on the wordmark/signature images to replicate the empty space that was previously appearing below their object element containers.
* Port of wet-boew/wet-boew#8287. * Related to wet-boew/wet-boew#8276. * Removes the logo SVG's inline media query and promotes its former CSS styles be the default ones. * This theme's variant of the WET logo uses a black outline, so it's presentable as-is in any scenario.
* Port of wet-boew/wet-boew#8282. * Related to wet-boew/wet-boew#8276. * Removes the logo SVG's inline media query and promotes its former CSS styles be the default ones. * This theme's variant of the WET logo uses a black outline, so it's presentable as-is in any scenario.
* Port of wet-boew/wet-boew#8282. * Related to wet-boew/wet-boew#8276. * Removes the logo SVG's inline media query and promotes its former CSS styles to be the default ones. * This theme's variant of the WET logo uses a black outline, so it's presentable as-is in any scenario.
* Port of wet-boew/wet-boew#8282. * Related to wet-boew/wet-boew#8276. * Removes the logo SVG's inline media query and promotes its former CSS styles to be the default ones. * This theme's variant of the WET logo uses a black outline, so it's presentable as-is in any scenario.
* Port of wet-boew/wet-boew#8282. * Related to wet-boew/wet-boew#8276. * Adds a CSS filter to change the FIP SVG's colour to white in screen views: * Needed for Gecko, Blink and possibly Webkit due to their buggy handling of inline SVG media queries when the img element is used. When printing, they apply screen-only queries and ignore print-only queries. * Modifies the signature/wordmark SVGs' inline media queries to only change their colours to white in Internet Explorer 10-11 screen views. * Since IE10-11 correctly handle the aforementioned media queries but lack support for CSS filters, this is the most viable setup to make the signature/wordmark render correctly in all of WET's supported browsers. * Modifies SCSS to increase the bottom margins on the signature/wordmark images to replicate the empty space that was previously appearing below their object element containers.
* Port of wet-boew/wet-boew#8282. * Related to wet-boew/wet-boew#8276. * Adds a CSS filter to change the FIP SVG's colour to white in screen views: * Needed for Gecko, Blink and possibly Webkit due to their buggy handling of inline SVG media queries when the img element is used. When printing, they apply screen-only queries and ignore print-only queries. * Modifies the signature/wordmark SVGs' inline media queries to only change their colours to white in Internet Explorer 10-11 screen views: * Since IE10-11 correctly handle the aforementioned media queries but lack support for CSS filters, this is the most viable setup to make the signature/wordmark render correctly in all of WET's supported browsers. * Modifies SCSS to increase the bottom margins on the signature/wordmark images to replicate the empty space that was previously appearing below their object element containers.
* Port of wet-boew/wet-boew#8282. * Related to wet-boew/wet-boew#8276. * Adds a CSS filter to change the wordmark SVG's colour to white in small view and under: * Needed for Gecko, Blink and possibly Webkit due to their buggy handling of inline SVG media queries when the img element is used. When printing, they apply screen-only queries and ignore print-only queries. * Modifies the wordmark SVG's inline media query to only change its colour to white in Internet Explorer 10-11 small view and under. * Since IE10-11 correctly handle the aforementioned media queries but lack support for CSS filters, this is the most viable setup to make the wordmark render correctly in all of WET's supported browsers. * Modifies the theme's JavaScript logic to only toggle the fallback PNG images when switching between small and under/medium and over views. * Modifies SCSS to increase the bottom margins on the signature/wordmark images to replicate the empty space that was previously appearing below their object element containers.
* Port of wet-boew/wet-boew#8282. * Related to wet-boew/wet-boew#8276. * Adds a CSS filter to change the signature/wordmark SVGs' colours to white in screen views: * Needed for Gecko, Blink and possibly Webkit due to their buggy handling of inline SVG media queries when the img element is used. When printing, they apply screen-only queries and ignore print-only queries. * Prevents the fallback PNG logos from being coloured white when printing in browsers that support CSS filters. * Modifies the signature/wordmark SVGs' inline media queries to only change their colours to white in Internet Explorer 10-11 screen views: * Since IE10-11 correctly handle the aforementioned media queries but lack support for CSS filters, this is the most viable setup to make the signature/wordmark render correctly in all of WET's supported browsers. * Modifies SCSS to increase the bottom margins on the signature/wordmark images to replicate the empty space that was previously appearing below their object element containers. * Prevents the signature/wordmark SVGs from disappearing in Blink and possibly Webkit's print views in certain page templates.
* Fixes wet-boew#8276. * Adds a print CSS filter to change the logo's brightness to 0%: * Needed for Gecko, Blink and possibly Webkit due to their buggy handling of inline SVG media queries when the img element is used. When printing, they apply screen-only queries and ignore print-only queries. * Prevents the fallback PNG logo from being coloured white when printing in browsers that support CSS filters. * Retains the SVG logo's inline screen media query to prevent issues in browsers that correctly handle them and lack support for CSS filters (i.e. Internet Explorer 10-11). * Restores the splash page's "wb-sppe" class (which was inadvertently removed in wet-boew#6113): * Allows the splash page's logo image to be specifically targeted by the print CSS filer. * Indirectly brings back wet-boew#5293's fix for the splash page logo's size in Internet Explorer 10-11 (which also fixes the fallback PNG logo's size in all browsers).
A few days ago, validator/validator#422 was resolved. One of the commits that fixed it (validator/validator@1c02bc1) intentionally caused any elements containing
tabindex
attributes to trigger a validation error when situated within<a>
/<button>
elements.Based on my research, validator/validator@1c02bc1's behaviour is in line with the W3C's HTML spec:
a
element:So, what does this have to do with WET? It turns out that most of WET 4.0's themes use SVG site logos that are structured as links containing an
<object>
element with atabindex="-1"
attribute. In other words, WET is nesting interactive content (<object tabindex="-1">
) within other interactive content (<a>
), which goes against the HTML spec.As a result, the following error is now appearing when validating virtually any pages that use WET:
IMO the best way of fixing this would be to replace the
<object>
element with<img>
in WET's SVG images and remove thetabindex="-1"
attributes. I believe it should work fine in all modern browsers and retain compatibility with the SVG image replacer polyfill.@duboisp @LaurentGoderre @nschonni @pjackson28 @shawnthompson Any thoughts/concerns?
PS:
The reason a
tabindex="-1"
attribute was used on SVG<object>
elements in the first place was because of #1432 (which was fixed by wet-boew/wet-boew-legacy@cc8b81c). Without that attribute, all browsers attempt to set keyboard tabbing focus inside the<object>
element - which isn't desirable.The text was updated successfully, but these errors were encountered: