Follow the specs/other UAs regarding <embed hidden> behaviour
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
People
(Reporter: mounir, Unassigned)
References
Details
(Keywords: parity-chrome, parity-safari)
Attachments
(1 file)
386 bytes,
text/html
|
Details |
We currently have a behaviour that could be made more standard (whether de-facto or by-spec), see bug 890516 comment 7. The HTML5 spec call for width: 0px, height: 0px and display: inline when hidden is set on <embed>.
Comment 1•6 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046 Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5. If you have questions, please contact :mdaly.
Comment 2•3 years ago
•
|
||
I couldn't find anything in html.css
so I guess the hidden attribute is implemented elsewhere. (I also didn't test other browsers though.)
Comment 3•3 years ago
|
||
It's implemented via attr mapping. See https://searchfox.org/mozilla-central/rev/f47a4b67643b3048ef9a2e2ac0c34edf6d1ebff3/dom/html/nsGenericHTMLElement.cpp#1195-1199
Note that <embed> already does weird things around the "hidden" attribute: it calls nsGenericHTMLElement::MapCommonAttributesIntoExceptHidden
so the "hidden" attribute is just a no-op for it right now, afaict. This bug is about making that attribute map to some styles, I guess?
(Also, HTMLEmbedElement::MapAttributesIntoRule
seems to be dead code?)
Updated•11 months ago
|
Comment 4•11 months ago
•
|
||
Here's a testcase. Interop here is pretty bad; Firefox, Chromium, and WebKit render this quite differently.
- Firefox renders all 4 embeds the same (with zero height and 100% auto-width, given that it's styled as
display:block
) - Chromium and WebKit don't render the first and third embeds at all (not even the border) -- i.e. no
src
attribute seems to make it effectivelydisplay:none
for them? -- and they render the second one using the standard replaced-element-fallback 300x150 sizing. - Chromium renders the 4th embed as 0x0
- WebKit renders the 4th embed as 300x150 (like the second); i.e. they have no special behavior for "hidden".
Chrome's devtools do show this style rule applying for the 3rd and 4th embed here (the embed hidden
parts of this testcase):
embed[Attributes Style] {
width: 0px;
height: 0px;
}
...which I think correspond to the html5 spec thing that Mounir was referencing.
Comment 5•8 months ago
|
||
WebKit 176 now passes the WPT html/semantics/embedded-content/the-embed-element/embed-hidden-attribute.html
Comment 6•7 months ago
|
||
Updated•1 month ago
|
Description
•