Bug 50363
| Summary: | display:none not being recognized with CSS3 + DOM Manipulation | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Aldo_MX <bugzilla-webkit> |
| Component: | CSS | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | Normal | CC: | andrew.fedoniouk, macpherson |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| URL: | unavailable | ||
Aldo_MX
I have in my CCS:
.selector
{
display: none;
}
.selector[data-attribute]
{
display: block;
}
<div id="container" style="height: 400px; overflow-x: auto; overflow-y: scroll;">
<div class="selector" data-attribute="1">Element 1</div>
<div class="selector" data-attribute="1">Element 2</div>
<div class="selector" data-attribute="1">Element 3</div>
... etc
</div>
When removing "data-attribute" via DOM Manipulation the div's are still showing until you move the container's scroll
It happens in the latest stable versions of Google Chrome and Safari.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Emil A Eklund
*** Bug 45130 has been marked as a duplicate of this bug. ***
Luke Macpherson
I can't reproduce this bug.
<style>
.x { display: none; }
.x[data-attribute] { display: block; }
</style>
<body onload='document.querySelectorAll(".x")[0].removeAttribute("data-attribute");'>
<div class="x" data-attribute="1">Element 1</div>
<div class="x" data-attribute="1">Element 2</div>
<div class="x" data-attribute="1">Element 3</div>
</body>
With this test I see Element 1 appear and then quickly disappear on the page has loaded.