Bug 921716 - Don't paint column rules when element is visibility:hidden. r=sjohnson
authorCameron McCormack <cam@mcc.id.au>
Tue, 01 Oct 2013 11:30:06 +1000
changeset 149402 df6ac934dd989bfd9afe2b3e6c2672c099f5d8c2
parent 149401 f07fd38a69020032a9d8837625264f82c84dadc1
child 149403 71c3fc0820385bef18b05957301075d7a02ea7b6
push id25386
push useremorley@mozilla.com
push dateTue, 01 Oct 2013 09:29:22 +0000
treeherdermozilla-central@6856c45f3688 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssjohnson
bugs921716
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 921716 - Don't paint column rules when element is visibility:hidden. r=sjohnson
layout/generic/nsColumnSetFrame.cpp
layout/reftests/bugs/921716-1-ref.html
layout/reftests/bugs/921716-1.html
layout/reftests/bugs/reftest.list
--- a/layout/generic/nsColumnSetFrame.cpp
+++ b/layout/generic/nsColumnSetFrame.cpp
@@ -1034,20 +1034,22 @@ nsColumnSetFrame::Reflow(nsPresContext* 
 }
 
 void
 nsColumnSetFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                    const nsRect&           aDirtyRect,
                                    const nsDisplayListSet& aLists) {
   DisplayBorderBackgroundOutline(aBuilder, aLists);
 
-  aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
+  if (IsVisibleForPainting(aBuilder)) {
+    aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
       nsDisplayGenericOverflow(aBuilder, this, ::PaintColumnRule, "ColumnRule",
                                nsDisplayItem::TYPE_COLUMN_RULE));
-  
+  }
+
   // Our children won't have backgrounds so it doesn't matter where we put them.
   for (nsFrameList::Enumerator e(mFrames); !e.AtEnd(); e.Next()) {
     BuildDisplayListForChild(aBuilder, e.get(), aDirtyRect, aLists);
   }
 }
 
 NS_IMETHODIMP
 nsColumnSetFrame::AppendFrames(ChildListID     aListID,
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/921716-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<style>
+div {
+  -moz-column-count: 3;
+  -moz-column-gap: 8px;
+  width: 300px;
+}
+</style>
+<div>
+  <span>This is some content that is still shown within the columns.</span>
+</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/921716-1.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<style>
+div {
+  -moz-column-count: 3;
+  -moz-column-gap: 8px;
+  -moz-column-rule: thick solid red;
+  visibility: hidden;
+  width: 300px;
+  background-color: #fcc;
+}
+span {
+  visibility: visible;
+}
+</style>
+<div>
+  <span>This is some content that is still shown within the columns.</span>
+</div>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1771,8 +1771,9 @@ test-pref(layout.css.flexbox.enabled,tru
 == 883987-1e.html 883987-1-ref.html
 == 883987-1f.html 883987-1-ref.html
 == 890495-1.html 890495-1-ref.html
 == 894931-1.html 894931-1-ref.html
 == 897491-1.html 897491-1-ref.html
 == 897491-2.html 897491-2-ref.html
 fuzzy(1,10000) fuzzy-if(Android&&AndroidVersion>=15,5,10000) == 902330-1.html 902330-1-ref.html
 fuzzy-if(Android,8,400) == 906199-1.html 906199-1-ref.html
+== 921716-1.html 921716-1-ref.html