Fix setting display:none after a layout where the element was visible.

Prior to incremental layout, the code would remove the existing
construction result. However, with incremental layout the construction result
is cloned rather than removed. This change ensures that the previous
construction result is cleared when an element's display type
changes to none.
This commit is contained in:
Glenn Watson 2015-02-25 13:07:35 +10:00
parent cbc4b9520e
commit a2f1f12c96
4 changed files with 37 additions and 1 deletions

View file

@ -1170,8 +1170,9 @@ impl<'a> PostorderNodeMutTraversal for FlowConstructor<'a> {
// results of children.
(display::T::none, _, _) => {
for child in node.children() {
drop(child.swap_out_construction_result())
child.set_flow_construction_result(ConstructionResult::None);
}
node.set_flow_construction_result(ConstructionResult::None);
}
// Table items contribute table flow construction results.

View file

@ -251,3 +251,4 @@ fragment=top != ../html/acid2.html acid2_ref.html
== percentage_height_root.html percentage_height_root_ref.html
== canvas_transform_a.html canvas_transform_ref.html
!= text_decoration_smoke_a.html text_decoration_smoke_ref.html
== hide_after_create.html hide_after_create_ref.html

View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html class="reftest-wait">
<style type="text/css">
.hidden {
display: none;
}
body {
background-color: green;
}
iframe {
background-color: red;
border: 0;
}
</style>
<body>
<iframe id="iframe" src="about:blank"></iframe>
</body>
<script type="text/javascript">
window.onload = function() {
document.getElementById("iframe").classList.add("hidden");
document.documentElement.classList.remove("reftest-wait");
}
</script>
</html>

View file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<style type="text/css">
body {
background-color: green;
}
</style>
<body>
</body>
</html>