--- /dev/null
+layer at (0,0) size 785x1904
+ RenderView at (0,0) size 785x600
+layer at (0,0) size 785x1904
+ RenderBlock {HTML} at (0,0) size 785x1904
+ RenderBody {BODY} at (8,8) size 769x1888
+ RenderBlock (anonymous) at (0,0) size 769x18
+ RenderText {#text} at (0,0) size 79x18
+ text run at (0,0) width 79: "1 green box:"
+ RenderBlock {DIV} at (0,18) size 769x26 [border: (2px solid #008000)]
+ RenderBlock {DIV} at (2,2) size 765x22 [border: (2px solid #FF0000)]
+ RenderText {#text} at (2,2) size 35x18
+ text run at (2,2) width 35: "failed"
+ RenderBlock (anonymous) at (0,44) size 769x18
+ RenderText {#text} at (0,0) size 168x18
+ text run at (0,0) width 12: "2 "
+ text run at (12,0) width 156: "green box with word ok:"
+ RenderBlock {DIV} at (0,62) size 769x26 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (2,2) size 765x22 [border: (2px solid #008000)]
+ RenderText {#text} at (2,2) size 16x18
+ text run at (2,2) width 16: "ok"
+ RenderBlock (anonymous) at (0,88) size 769x18
+ RenderText {#text} at (0,0) size 168x18
+ text run at (0,0) width 168: "3 green box with word ok:"
+ RenderBlock (anonymous) at (0,106) size 769x90
+ RenderBR {BR} at (0,0) size 0x18
+ RenderBR {BR} at (0,18) size 0x18
+ RenderBR {BR} at (0,36) size 0x18
+ RenderBR {BR} at (0,54) size 0x18
+ RenderText {#text} at (0,72) size 168x18
+ text run at (0,72) width 168: "4 green box with word ok:"
+ RenderBlock (anonymous) at (0,196) size 769x90
+ RenderBR {BR} at (0,0) size 0x18
+ RenderBR {BR} at (0,18) size 0x18
+ RenderBR {BR} at (0,36) size 0x18
+ RenderBR {BR} at (0,54) size 0x18
+ RenderText {#text} at (0,72) size 168x18
+ text run at (0,72) width 168: "5 green box with word ok:"
+ RenderBlock (anonymous) at (0,286) size 769x90
+ RenderBR {BR} at (0,0) size 0x18
+ RenderBR {BR} at (0,18) size 0x18
+ RenderBR {BR} at (0,36) size 0x18
+ RenderBR {BR} at (0,54) size 0x18
+ RenderText {#text} at (0,72) size 168x18
+ text run at (0,72) width 168: "6 green box with word ok:"
+ RenderBlock (anonymous) at (0,376) size 769x90
+ RenderBR {BR} at (0,0) size 0x18
+ RenderBR {BR} at (0,18) size 0x18
+ RenderBR {BR} at (0,36) size 0x18
+ RenderBR {BR} at (0,54) size 0x18
+ RenderText {#text} at (0,72) size 168x18
+ text run at (0,72) width 168: "7 green box with word ok:"
+ RenderBlock (anonymous) at (0,466) size 769x90
+ RenderBR {BR} at (0,0) size 0x18
+ RenderBR {BR} at (0,18) size 0x18
+ RenderBR {BR} at (0,36) size 0x18
+ RenderBR {BR} at (0,54) size 0x18
+ RenderText {#text} at (0,72) size 215x18
+ text run at (0,72) width 215: "8 double green box with word ok:"
+ RenderBlock (anonymous) at (0,556) size 769x90
+ RenderBR {BR} at (0,0) size 0x18
+ RenderBR {BR} at (0,18) size 0x18
+ RenderBR {BR} at (0,36) size 0x18
+ RenderBR {BR} at (0,54) size 0x18
+ RenderText {#text} at (0,72) size 168x18
+ text run at (0,72) width 168: "9 green box with word ok:"
+ RenderBlock (anonymous) at (0,646) size 769x90
+ RenderBR {BR} at (0,0) size 0x18
+ RenderBR {BR} at (0,18) size 0x18
+ RenderBR {BR} at (0,36) size 0x18
+ RenderBR {BR} at (0,54) size 0x18
+ RenderText {#text} at (0,72) size 87x18
+ text run at (0,72) width 87: "10 green box:"
+ RenderBlock (anonymous) at (0,736) size 769x90
+ RenderBR {BR} at (0,0) size 0x18
+ RenderBR {BR} at (0,18) size 0x18
+ RenderBR {BR} at (0,36) size 0x18
+ RenderBR {BR} at (0,54) size 0x18
+ RenderText {#text} at (0,72) size 176x18
+ text run at (0,72) width 176: "11 green box with word ok:"
+ RenderBlock (anonymous) at (0,826) size 769x90
+ RenderBR {BR} at (0,0) size 0x18
+ RenderBR {BR} at (0,18) size 0x18
+ RenderBR {BR} at (0,36) size 0x18
+ RenderBR {BR} at (0,54) size 0x18
+ RenderText {#text} at (0,72) size 176x18
+ text run at (0,72) width 176: "12 green box with word ok:"
+ RenderBlock (anonymous) at (0,916) size 769x90
+ RenderBR {BR} at (0,0) size 0x18
+ RenderBR {BR} at (0,18) size 0x18
+ RenderBR {BR} at (0,36) size 0x18
+ RenderBR {BR} at (0,54) size 0x18
+ RenderText {#text} at (0,72) size 87x18
+ text run at (0,72) width 87: "13 green box:"
+ RenderBlock (anonymous) at (0,1006) size 769x90
+ RenderBR {BR} at (0,0) size 0x18
+ RenderBR {BR} at (0,18) size 0x18
+ RenderBR {BR} at (0,36) size 0x18
+ RenderBR {BR} at (0,54) size 0x18
+ RenderText {#text} at (0,72) size 176x18
+ text run at (0,72) width 176: "14 green box with word ok:"
+ RenderBlock (anonymous) at (0,1096) size 769x90
+ RenderBR {BR} at (0,0) size 0x18
+ RenderBR {BR} at (0,18) size 0x18
+ RenderBR {BR} at (0,36) size 0x18
+ RenderBR {BR} at (0,54) size 0x18
+ RenderText {#text} at (0,72) size 176x18
+ text run at (0,72) width 176: "15 green box with word ok:"
+ RenderBlock (anonymous) at (0,1186) size 769x90
+ RenderBR {BR} at (0,0) size 0x18
+ RenderBR {BR} at (0,18) size 0x18
+ RenderBR {BR} at (0,36) size 0x18
+ RenderBR {BR} at (0,54) size 0x18
+ RenderText {#text} at (0,72) size 176x18
+ text run at (0,72) width 176: "16 green box with word ok:"
+ RenderBlock (anonymous) at (0,1276) size 769x90
+ RenderBR {BR} at (0,0) size 0x18
+ RenderBR {BR} at (0,18) size 0x18
+ RenderBR {BR} at (0,36) size 0x18
+ RenderBR {BR} at (0,54) size 0x18
+ RenderText {#text} at (0,72) size 176x18
+ text run at (0,72) width 176: "17 green box with word ok:"
+ RenderBlock (anonymous) at (0,1366) size 769x90
+ RenderBR {BR} at (0,0) size 0x18
+ RenderBR {BR} at (0,18) size 0x18
+ RenderBR {BR} at (0,36) size 0x18
+ RenderBR {BR} at (0,54) size 0x18
+ RenderText {#text} at (0,72) size 176x18
+ text run at (0,72) width 176: "18 green box with word ok:"
+ RenderBlock (anonymous) at (0,1456) size 769x90
+ RenderBR {BR} at (0,0) size 0x18
+ RenderBR {BR} at (0,18) size 0x18
+ RenderBR {BR} at (0,36) size 0x18
+ RenderBR {BR} at (0,54) size 0x18
+ RenderText {#text} at (0,72) size 176x18
+ text run at (0,72) width 176: "19 green box with word ok:"
+ RenderBlock (anonymous) at (0,1546) size 769x90
+ RenderBR {BR} at (0,0) size 0x18
+ RenderBR {BR} at (0,18) size 0x18
+ RenderBR {BR} at (0,36) size 0x18
+ RenderBR {BR} at (0,54) size 0x18
+ RenderText {#text} at (0,72) size 87x18
+ text run at (0,72) width 87: "20 green box:"
+ RenderBlock (anonymous) at (0,1636) size 769x90
+ RenderBR {BR} at (0,0) size 0x18
+ RenderBR {BR} at (0,18) size 0x18
+ RenderBR {BR} at (0,36) size 0x18
+ RenderBR {BR} at (0,54) size 0x18
+ RenderText {#text} at (0,72) size 217x18
+ text run at (0,72) width 217: "21 two green boxes with word ok:"
+ RenderBlock (anonymous) at (0,1726) size 769x90
+ RenderBR {BR} at (0,0) size 0x18
+ RenderBR {BR} at (0,18) size 0x18
+ RenderBR {BR} at (0,36) size 0x18
+ RenderBR {BR} at (0,54) size 0x18
+ RenderText {#text} at (0,72) size 176x18
+ text run at (0,72) width 176: "22 green box with word ok:"
+ RenderBlock (anonymous) at (0,1816) size 769x72
+ RenderBR {BR} at (0,0) size 0x18
+ RenderBR {BR} at (0,18) size 0x18
+ RenderBR {BR} at (0,36) size 0x18
+ RenderBR {BR} at (0,54) size 0x18
+layer at (0,114) size 785x34
+ RenderBlock (positioned) {DIV} at (0,114) size 785x34 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (2,2) size 781x22 [border: (2px solid #008000)]
+ RenderText {#text} at (2,2) size 16x18
+ text run at (2,2) width 16: "ok"
+layer at (2,206) size 781x30
+ RenderBlock (positioned) {DIV} at (2,2) size 781x30 [border: (2px solid #008000)]
+ RenderText {#text} at (2,2) size 16x18
+ text run at (2,2) width 16: "ok"
+layer at (0,294) size 785x34
+ RenderBlock (positioned) {DIV} at (0,294) size 785x34 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (2,2) size 781x26 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (2,2) size 777x22 [border: (2px solid #008000)]
+ RenderText {#text} at (2,2) size 16x18
+ text run at (2,2) width 16: "ok"
+layer at (2,386) size 781x30
+ RenderBlock (positioned) {DIV} at (2,2) size 781x30 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (2,2) size 777x22 [border: (2px solid #008000)]
+ RenderText {#text} at (2,2) size 16x18
+ text run at (2,2) width 16: "ok"
+layer at (4,478) size 777x26
+ RenderBlock (positioned) {DIV} at (2,2) size 777x26 [border: (2px solid #008000)]
+ RenderText {#text} at (2,2) size 16x18
+ text run at (2,2) width 16: "ok"
+layer at (0,564) size 785x34
+ RenderBlock (positioned) {DIV} at (0,564) size 785x34 [border: (2px solid #008000)]
+layer at (4,568) size 777x26
+ RenderBlock (positioned) {DIV} at (2,2) size 777x26 [border: (2px solid #008000)]
+ RenderText {#text} at (2,2) size 16x18
+ text run at (2,2) width 16: "ok"
+layer at (2,746) size 781x30
+ RenderBlock (positioned) {DIV} at (2,2) size 781x30 [border: (2px solid #008000)]
+layer at (0,924) size 785x34
+ RenderBlock (positioned) {DIV} at (0,924) size 785x34 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (2,2) size 781x26 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (2,2) size 777x22 [border: (2px solid #008000)]
+ RenderText {#text} at (2,2) size 16x18
+ text run at (2,2) width 16: "ok"
+layer at (0,1014) size 785x34
+ RenderBlock (positioned) {DIV} at (0,1014) size 785x34 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (2,2) size 781x26 [border: (2px solid #008000)]
+ RenderBlock {DIV} at (2,2) size 777x22 [border: (2px solid #FF0000)]
+ RenderText {#text} at (2,2) size 35x18
+ text run at (2,2) width 35: "failed"
+layer at (0,1284) size 785x50
+ RenderBlock (positioned) {DIV} at (0,1284) size 785x34 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (2,2) size 781x48 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (2,2) size 777x22 [border: (2px solid #FF0000)]
+ RenderText {#text} at (2,2) size 20x18
+ text run at (2,2) width 20: "fail"
+ RenderBlock {DIV} at (2,24) size 777x22 [border: (2px solid #008000)]
+ RenderText {#text} at (2,2) size 16x18
+ text run at (2,2) width 16: "ok"
+layer at (0,1464) size 785x50
+ RenderBlock (positioned) {DIV} at (0,1464) size 785x34 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (2,2) size 781x48 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (2,2) size 777x22 [border: (2px solid #FF0000)]
+ RenderText {#text} at (2,2) size 20x18
+ text run at (2,2) width 20: "fail"
+ RenderBlock {DIV} at (2,24) size 777x22 [border: (2px solid #008000)]
+ RenderText {#text} at (2,2) size 16x18
+ text run at (2,2) width 16: "ok"
+layer at (0,1554) size 785x54
+ RenderBlock (positioned) {DIV} at (0,1554) size 785x34 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (2,2) size 781x26 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (2,2) size 777x22 [border: (2px solid #FF0000)]
+ RenderText {#text} at (2,2) size 20x18
+ text run at (2,2) width 20: "fail"
+ RenderBlock {DIV} at (2,28) size 781x26 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (2,2) size 777x22 [border: (2px solid #008000)]
+ RenderText {#text} at (2,2) size 16x18
+ text run at (2,2) width 16: "ok"
+layer at (0,1644) size 785x50
+ RenderBlock (positioned) {DIV} at (0,1644) size 785x34 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (2,2) size 781x48 [border: (2px solid #008000)]
+ RenderBlock {DIV} at (2,2) size 777x22 [border: (2px solid #FF0000)]
+ RenderText {#text} at (2,2) size 16x18
+ text run at (2,2) width 16: "ok"
+ RenderBlock {DIV} at (2,24) size 777x22 [border: (2px solid #008000)]
+ RenderText {#text} at (2,2) size 16x18
+ text run at (2,2) width 16: "ok"
+layer at (0,1734) size 785x54
+ RenderBlock (positioned) {DIV} at (0,1734) size 785x34 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (2,2) size 781x26 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (2,2) size 777x22 [border: (2px solid #008000)]
+ RenderText {#text} at (2,2) size 16x18
+ text run at (2,2) width 16: "ok"
+ RenderBlock {DIV} at (2,28) size 781x26 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (2,2) size 777x22 [border: (2px solid #008000)]
+ RenderText {#text} at (2,2) size 16x18
+ text run at (2,2) width 16: "ok"
+layer at (2,1826) size 781x30
+ RenderBlock (positioned) {DIV} at (2,2) size 781x30 [border: (2px solid #008000)]
+ RenderText {#text} at (2,2) size 16x18
+ text run at (2,2) width 16: "ok"
--- /dev/null
+<html>
+<style>
+.red { border: 2px solid red }
+.green { border: 2px solid green }
+.visible { visibility: visible}
+.invisible { visibility: hidden}
+//.invisible:hover { visibility: visible}
+.abstop { position: absolute; left:0; right:0; height:30px }
+.abs { position: absolute; left:0; right:0; top:0; bottom:0 }
+</style>
+
+<script>
+var node1;
+var node2;
+function dotest()
+{
+//9
+document.getElementById('9').style.setProperty('visibility','visible','');
+//10
+document.getElementById('10').style.setProperty('visibility','visible','');
+document.getElementById('10').style.setProperty('visibility','hidden','');
+//11
+document.getElementById('11').style.setProperty('visibility','visible','');
+//12
+document.getElementById('12').style.setProperty('visibility','hidden','');
+document.getElementById('12').style.setProperty('visibility','visible','');
+//13
+document.getElementById('13a').style.setProperty('visibility','hidden','');
+document.getElementById('13b').style.setProperty('visibility','hidden','');
+document.getElementById('13c').style.setProperty('visibility','hidden','');
+document.getElementById('13b').style.setProperty('visibility','visible','');
+//14
+node1 = document.createElement('div');
+node1.appendChild(document.createTextNode('ok'));
+document.getElementById('14').appendChild(node1);
+//15
+node2 = document.createElement('div');
+node2.setAttribute('class','invisible abs green');
+node2.appendChild(document.createTextNode('ok'));
+document.getElementById('15').appendChild(node2);
+node2.style.setProperty('visibility','visible','');
+document.getElementById('15').removeChild(node2);
+//16
+document.getElementById('16').style.setProperty('visibility','hidden','');
+//17
+document.getElementById('17').style.setProperty('visibility','visible','');
+//18
+document.getElementById('18a').style.setProperty('visibility','hidden','');
+//19
+document.getElementById('19a').style.setProperty('visibility','hidden','');
+//20
+document.getElementById('20a').style.setProperty('visibility','hidden','');
+//21
+document.getElementById('21a').style.setProperty('visibility','hidden','');
+//22
+document.getElementById('22').style.setProperty('visibility','visible','');
+
+setTimeout(dotest2,20);
+}
+
+function dotest2()
+{
+//14
+node1.style.setProperty('visibility','visible','');
+document.getElementById('14').removeChild(node1);
+document.getElementById('14').appendChild(node1);
+node1.setAttribute('class','green');
+//15
+document.getElementById('15').appendChild(node2);
+//18
+document.getElementById('18b').style.setProperty('visibility','visible','');
+//19
+document.getElementById('19b').style.setProperty('visibility','visible','');
+//20
+document.getElementById('20b').style.setProperty('visibility','visible','');
+document.getElementById('20b').style.setProperty('visibility','hidden','');
+//21
+document.getElementById('21b').style.setProperty('visibility','visible','');
+//22
+document.getElementById('22').style.setProperty('visibility','hidden','');
+}
+
+</script>
+</head>
+<body onload="setTimeout(dotest,20)">
+1 green box:
+<div class="visible green">
+<div class="invisible red">
+failed
+</div>
+</div>
+2 green box with word ok:
+<div class="invisible red">
+<div class="visible green">
+ok
+</div>
+</div>
+3 green box with word ok:
+<div class="invisible abstop red" >
+<div class="visible green">
+ok
+</div>
+</div>
+<br><br><br><br>
+4 green box with word ok:
+<div class="invisible abstop red" >
+<div class="visible abs green">
+ok
+</div>
+</div>
+<br><br><br><br>
+5 green box with word ok:
+<div class="invisible abstop red">
+<div class="invisible red">
+<div class="visible green">
+ok
+</div>
+</div>
+</div>
+<br><br><br><br>
+6 green box with word ok:
+<div class="invisible abstop red">
+<div class="invisible abs red">
+<div class="visible green">
+ok
+</div>
+</div>
+</div>
+<br><br><br><br>
+7 green box with word ok:
+<div class="invisible abstop red">
+<div class="invisible abs red">
+<div class="visible abs green">
+ok
+</div>
+</div>
+</div>
+<br><br><br><br>
+8 double green box with word ok:
+<div class="visible abstop green">
+<div class="invisible abs red">
+<div class="visible abs green">
+ok
+</div>
+</div>
+</div>
+<br><br><br><br>
+9 green box with word ok:
+<div class="invisible abstop red">
+<div class="invisible abs red">
+<div id="9" class="invisible abs green">
+ok
+</div>
+</div>
+</div>
+<br><br><br><br>
+10 green box:
+<div class="invisible abstop red">
+<div class="visible abs green">
+<div id="10" class="invisible abs red">
+failed
+</div>
+</div>
+</div>
+<br><br><br><br>
+11 green box with word ok:
+<div class="invisible abstop red">
+<div class="invisible red">
+<div id="11" class="invisible green">
+ok
+</div>
+</div>
+</div>
+<br><br><br><br>
+12 green box with word ok:
+<div class="invisible abstop red">
+<div class="invisible red">
+<div id="12" class="visible green">
+ok
+</div>
+</div>
+</div>
+<br><br><br><br>
+13 green box:
+<div id="13a" class="visible abstop red">
+<div id="13b" class="visible green">
+<div id="13c" class="visible red">
+failed
+</div>
+</div>
+</div>
+<br><br><br><br>
+14 green box with word ok:
+<div id="14" class="invisible abstop">
+</div>
+<br><br><br><br>
+15 green box with word ok:
+<div id="15" class="invisible abstop">
+</div>
+<br><br><br><br>
+16 green box with word ok:
+<div class="invisible abstop red">
+<div class="invisible red">
+<div id="16" class="visible red">
+fail
+</div>
+<div class="visible green">
+ok
+</div>
+</div>
+</div>
+<br><br><br><br>
+17 green box with word ok:
+<div class="invisible abstop red">
+<div class="invisible red">
+<div id="17" class="invisible green">
+ok
+</div>
+<div class="invisible red">
+fail
+</div>
+</div>
+</div>
+<br><br><br><br>
+18 green box with word ok:
+<div class="invisible abstop red">
+<div class="invisible red">
+<div id="18a" class="visible red">
+fail
+</div>
+<div id="18b" class="invisible green">
+ok
+</div>
+</div>
+</div>
+<br><br><br><br>
+19 green box with word ok:
+<div class="invisible abstop red">
+<div class="invisible red">
+<div id="19a" class="visible red">
+fail
+</div>
+</div>
+<div class="invisible red">
+<div id="19b" class="invisible green">
+ok
+</div>
+</div>
+</div>
+<br><br><br><br>
+20 green box:
+<div class="invisible abstop red">
+<div class="visible green">
+<div id="20a" class="visible red">
+ok
+</div>
+<div id="20b" class="invisible green">
+ok
+</div>
+</div>
+</div>
+<br><br><br><br>
+21 two green boxes with word ok:
+<div class="invisible abstop red">
+<div id="21a" class="visible red">
+<div class="visible green">
+ok
+</div>
+</div>
+<div class="invisible red">
+<div id="21b" class="invisible green">
+ok
+</div>
+</div>
+</div>
+<br><br><br><br>
+22 green box with word ok:
+<div id="22" class="invisible abstop red" >
+<div class="visible abs green">
+ok
+</div>
+</div>
+<br><br><br><br>
+</body>
+</html>
m_inOverflowRelayout(false),
m_repaintOverflowOnResize(false),
m_overflowStatusDirty(true),
+m_visibleContentStatusDirty( true ),
+m_hasVisibleContent( false ),
+m_visibleDescendantStatusDirty( false ),
+m_hasVisibleDescendant( false ),
m_marquee(0)
{
+ if (!object->firstChild() && object->style()) {
+ m_visibleContentStatusDirty = false;
+ m_hasVisibleContent = object->style()->visibility() == VISIBLE;
+ }
}
RenderLayer::~RenderLayer()
positionOverflowControls();
- // FIXME: Child object could override visibility.
- if (m_object->style()->visibility() == VISIBLE) {
+ updateVisibilityStatus();
+
+ if (m_hasVisibleContent) {
int x, y;
m_object->absolutePosition(x, y);
IntRect newRect, newFullRect;
m_marquee->updateMarqueePosition();
}
+void RenderLayer::setHasVisibleContent(bool b)
+{
+ if (m_hasVisibleContent == b && !m_visibleContentStatusDirty)
+ return;
+ m_visibleContentStatusDirty = false;
+ m_hasVisibleContent = b;
+ if (parent())
+ parent()->childVisibilityChanged(m_hasVisibleContent);
+}
+
+void RenderLayer::dirtyVisibleContentStatus()
+{
+ m_visibleContentStatusDirty = true;
+ if (parent())
+ parent()->dirtyVisibleDescendantStatus();
+}
+
+void RenderLayer::childVisibilityChanged(bool newVisibility)
+{
+ if (m_hasVisibleDescendant == newVisibility || m_visibleDescendantStatusDirty)
+ return;
+ if (newVisibility) {
+ RenderLayer* l = this;
+ while (l && !l->m_visibleDescendantStatusDirty && !l->m_hasVisibleDescendant) {
+ l->m_hasVisibleDescendant = true;
+ l = l->parent();
+ }
+ } else
+ dirtyVisibleDescendantStatus();
+}
+
+void RenderLayer::dirtyVisibleDescendantStatus()
+{
+ RenderLayer* l = this;
+ while (l && !l->m_visibleDescendantStatusDirty) {
+ l->m_visibleDescendantStatusDirty = true;
+ l = l->parent();
+ }
+}
+
+void RenderLayer::updateVisibilityStatus()
+{
+ if (m_visibleDescendantStatusDirty) {
+ m_hasVisibleDescendant = false;
+ for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) {
+ child->updateVisibilityStatus();
+ if (child->m_hasVisibleContent || child->m_hasVisibleDescendant) {
+ m_hasVisibleDescendant = true;
+ break;
+ }
+ }
+ m_visibleDescendantStatusDirty = false;
+ }
+
+ if (m_visibleContentStatusDirty) {
+ if (m_object->style()->visibility() == VISIBLE)
+ m_hasVisibleContent = true;
+ else {
+ // layer may be hidden but still have some visible content, check for this
+ m_hasVisibleContent = false;
+ RenderObject* r = m_object->firstChild();
+ while (r) {
+ if (r->style()->visibility() == VISIBLE) {
+ m_hasVisibleContent = true;
+ break;
+ }
+ if (r->firstChild() && !r->firstChild()->layer())
+ r = r->firstChild();
+ else if (r->nextSibling() && !r->nextSibling()->layer())
+ r = r->nextSibling();
+ else {
+ while (r && (!r->nextSibling() || r->nextSibling()->layer())) {
+ r = r->parent();
+ if (r==m_object)
+ r = 0;
+ }
+ if (r)
+ r = r->nextSibling();
+ }
+ }
+ }
+ m_visibleContentStatusDirty = false;
+ }
+}
+
void RenderLayer::updateLayerPosition()
{
// Clear our cached clip rect information.
if (stackingContext)
stackingContext->dirtyZOrderLists();
}
+
+ child->updateVisibilityStatus();
+ if (child->m_hasVisibleContent || child->m_hasVisibleDescendant)
+ childVisibilityChanged(true);
}
RenderLayer* RenderLayer::removeChild(RenderLayer* oldChild)
oldChild->setNextSibling(0);
oldChild->setParent(0);
+ oldChild->updateVisibilityStatus();
+ if (oldChild->m_hasVisibleContent || oldChild->m_hasVisibleDescendant)
+ childVisibilityChanged(false);
+
return oldChild;
}
{
if (!isStackingContext() || !m_zOrderListsDirty)
return;
-
+
for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
child->collectLayers(m_posZOrderList, m_negZOrderList);
void RenderLayer::collectLayers(Vector<RenderLayer*>*& posBuffer, Vector<RenderLayer*>*& negBuffer)
{
- // FIXME: A child render object or layer could override visibility. Don't remove this
- // optimization though until RenderObject's nodeAtPoint is patched to understand what to do
- // when visibility is overridden by a child.
- if (renderer()->style()->visibility() != VISIBLE)
- return;
-
+ updateVisibilityStatus();
+
// Overflow layers are just painted by their enclosing layers, so they don't get put in zorder lists.
- if (!isOverflowOnly()) {
+ if (m_hasVisibleContent && !isOverflowOnly()) {
// Determine which buffer the child should be in.
Vector<RenderLayer*>*& buffer = (zIndex() >= 0) ? posBuffer : negBuffer;
// Recur into our children to collect more layers, but only if we don't establish
// a stacking context.
- if (!isStackingContext())
+ if (m_hasVisibleDescendant && !isStackingContext())
for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
child->collectLayers(posBuffer, negBuffer);
}