WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
152674
Elements with the "hidden" attribute still show up if "display: flex;"
https://bugs.webkit.org/show_bug.cgi?id=152674
Summary
Elements with the "hidden" attribute still show up if "display: flex;"
Devin Rousso
Reported
2016-01-03 16:26:47 PST
* STEPS TO REPRODUCE: 1. Enter the following into the snippet editor: <div style="display: flex; width: 50px; height: 50px; background-color: red;" hidden></div>
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2016-01-03 16:26:58 PST
<
rdar://problem/24034110
>
Joseph Pecoraro
Comment 2
2016-01-04 16:22:33 PST
I believe this is behaving correctly. We match Firefox and Chrome here. Web Inspector shows the style cascade being: inline style: display: flex html attributes: (from `hidden`) display: none user agent styles for `div`: display: block The HTML Attributes section could just as easily have been treated as a user agent style like that recommended in the HTML spec:
https://html.spec.whatwg.org/multipage/interaction.html#the-hidden-attribute
https://html.spec.whatwg.org/multipage/rendering.html#hiddenCSS
[hidden] { display: none; } In which case, the more-specific inline style of `display: flex` overrides it. User styles (page styles) can include their own styles to make the hidden attribute stronger... [hidden] { display: none !important; } ... but I think right now we are behaving as expected.
Devin Rousso
Comment 3
2016-01-04 16:25:09 PST
(In reply to
comment #2
)
> [hidden] { > display: none; > }
Alright, well this is what I used anyways so I guess it's fine. Just not at all what I expected. Applying "hidden" to an element should hide it from view (at least that's how I take it)...
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug