Bug 103681 - non HTMLElement documentElement ignores display: none
Summary: non HTMLElement documentElement ignores display: none
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: HasReduction
Depends on: 103475
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-29 15:52 PST by Elliott Sprehn
Modified: 2012-11-30 16:15 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elliott Sprehn 2012-11-29 15:52:45 PST
If you replace the documentElement with a non-html element and then set it to display: none we ignore it.

ex.

<iframe id="doc"></iframe>

<script>
    var doc = document.getElementById('doc').contentDocument;
    var root = doc.implementation.createDocument().createElement('not-a-real-element');
    doc.replaceChild(root, doc.documentElement);
    root.appendChild(document.createElement('style')).textContent = 'not-a-real-element { display: none }';
    root.appendChild(document.createElement('p')).textContent = 'Should not be visible';
</script>
Comment 1 Elliott Sprehn 2012-11-29 16:07:40 PST
This is fixed by Bug 103475.