Bug 929591 - Blending fails if parent stacking context has text
authorRik Cabanier <cabanier@adobe.com>
Tue, 22 Oct 2013 13:31:00 +0100
changeset 166708 607ec7f406d0ecd26f0f284ec4a044688c3a7d8d
parent 166707 782fbf61cd597d59b98197bdc1bc6d0d3c90c22e
child 166709 b9c7369eb6159db08f0239e934e4a9b1f581af89
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs929591
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 929591 - Blending fails if parent stacking context has text
layout/base/nsDisplayList.cpp
layout/reftests/css-blending/blend-difference-stacking-ref.html
layout/reftests/css-blending/blend-difference-stacking.html
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -3244,19 +3244,24 @@ nsDisplayBlendContainer::~nsDisplayBlend
 }
 #endif
 
 // nsDisplayBlendContainer uses layers for rendering
 already_AddRefed<Layer>
 nsDisplayBlendContainer::BuildLayer(nsDisplayListBuilder* aBuilder,
                                     LayerManager* aManager,
                                     const ContainerParameters& aContainerParameters) {
+  // turn off anti-aliasing in the parent stacking context because it changes
+  // how the group is initialized.
+  ContainerParameters newContainerParameters = aContainerParameters;
+  newContainerParameters.mDisableSubpixelAntialiasingInDescendants = true;
+
   nsRefPtr<Layer> container = aManager->GetLayerBuilder()->
   BuildContainerLayerFor(aBuilder, aManager, mFrame, this, mList,
-                         aContainerParameters, nullptr);
+                         newContainerParameters, nullptr);
   if (!container) {
     return nullptr;
   }
   
   container->SetForceIsolatedGroup(true);
   return container.forget();
 }
 
--- a/layout/reftests/css-blending/blend-difference-stacking-ref.html
+++ b/layout/reftests/css-blending/blend-difference-stacking-ref.html
@@ -5,16 +5,26 @@
 <html>
 <style>
 #a {
   background-color: rgb(0,255,0);
   width: 200px;
   height: 210px;
 }
 #b {
-  width: 100px;
-  height: 100px;
-  background-color: rgb(0,0,0);
+  position: absolute;
+  top:80px;
+  filter:url(#f);
 }
 </style>
+  <svg height="0">
+    <filter id="f">
+      <feColorMatrix values="1 1 1 0 0
+                             1 1 1 0 0
+                             1 1 1 0 0
+                             0 0 0 1 0"/>
+
+    </filter>
+   </svg>
 <div id="a">
+<div id="b">.</div>
 </div>
 </html>
--- a/layout/reftests/css-blending/blend-difference-stacking.html
+++ b/layout/reftests/css-blending/blend-difference-stacking.html
@@ -14,17 +14,17 @@
 .c {
   width: 100px;
   height: 100px;
   mix-blend-mode: difference;
 }
 #d {
   z-index: 1;
   position: absolute;
-  top:110px;
+  top:80px;
 }
 </style>
 <div id="b" class="a">
-  <div id="d">
+  <div id="d">.
     <div class="a c"></div>
   </div>
 </div>
 </html>