<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - User Agent style sheet should include !important directive when defining display:none on [hidden] attribute selector"
href="https://bugs.webkit.org/show_bug.cgi?id=152883">152883</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>User Agent style sheet should include !important directive when defining display:none on [hidden] attribute selector
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>Product</th>
<td>WebKit
</td>
</tr>
<tr>
<th>Version</th>
<td>Safari 9
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>OS</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>Normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P2
</td>
</tr>
<tr>
<th>Component</th>
<td>CSS
</td>
</tr>
<tr>
<th>Assignee</th>
<td>webkit-unassigned@lists.webkit.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>jcraig@apple.com
</td>
</tr></table>
<p>
<div>
<pre>User Agent style sheet should include !important directive when defining display:none on [hidden] attribute selector...
WebKit uses the WHATWG spec recommendation for display:none on html:*[hidden]
<span class="quote">> [hidden], area, base, basefont, datalist, head, link, menu[type=context i], meta,
> noembed, noframes, param, rp, script, source, style, template, track, title {
> display: none;
> }</span >
<a href="https://html.spec.whatwg.org/multipage/rendering.html#hiddenCSS">https://html.spec.whatwg.org/multipage/rendering.html#hiddenCSS</a>
...but as specified, the behavior of @hidden is too easy to accidentally override.
<div hidden> example </div>
Even a simple element selector negates the usefulness of the @hidden API and causes the element to be displayed.
div { display: block; }
And the API no longer works on any element matching an author defined display rule.
el.hidden = true; // Does nothing.
I believe the solution is to change the user agent CSS (and the ultimately the HTML specs) to include this rule block:
[hidden] {
display: none !important;
}
This way the @hidden API leverages a higher specificity than all common CSS selectors.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>