Bug 1125767. CSS/SVG filters on an element should make it a containing block for fixed-pos and abs-pos descendants. r=mats
authorRobert O'Callahan <robert@ocallahan.org>
Mon, 09 Mar 2015 23:44:49 +1300
changeset 233197 78b229e43ce19861b47451b4e7284d9dcc65cd7d
parent 233196 b9951cca6d1f5094a8e5544336781415467fd566
child 233198 fd64e2d0cbee98a2fd8dec37452ca9e6b34470b6
push id56776
push userrocallahan@mozilla.com
push dateThu, 12 Mar 2015 03:26:13 +0000
treeherdermozilla-inbound@fd64e2d0cbee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1125767
milestone39.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 1125767. CSS/SVG filters on an element should make it a containing block for fixed-pos and abs-pos descendants. r=mats
layout/reftests/svg/filters/css-filters/containing-block-1-ref.html
layout/reftests/svg/filters/css-filters/containing-block-1.html
layout/reftests/svg/filters/css-filters/reftest.list
layout/style/nsStyleStructInlines.h
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/filters/css-filters/containing-block-1-ref.html
@@ -0,0 +1,5 @@
+<!DOCTYPE HTML>
+<body>
+<div style="position:absolute; left:150px; top:150px; width:200px; height:200px; background:lime;"></div>
+<div style="position:absolute; left:180px; top:180px; width:200px; height:200px; background:yellow;"></div>
+
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/filters/css-filters/containing-block-1.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<body style="margin:0">
+<div style="margin:100px; width:100px; height:100px; filter:opacity(1);">
+  <div style="position:absolute; left:50px; top:50px; width:200px; height:200px; background:lime;"></div>
+  <div style="position:fixed; left:80px; top:80px; width:200px; height:200px; background:yellow;"></div>
+</div>
--- a/layout/reftests/svg/filters/css-filters/reftest.list
+++ b/layout/reftests/svg/filters/css-filters/reftest.list
@@ -14,16 +14,17 @@ skip-if(d2d) pref(layers.acceleration.di
 == blur-zero-radius.html blur-zero-radius-ref.html
 == blur-zoomed-page.html blur-zoomed-page-ref.html
 == brightness.html brightness-ref.html
 == brightness-darken.html brightness-darken-ref.html
 == brightness-extreme.html brightness-extreme-ref.html
 == brightness-one.html brightness-one-ref.html
 == brightness-percent.html brightness-percent-ref.html
 == brightness-zero.html brightness-zero-ref.html
+== containing-block-1.html containing-block-1-ref.html
 == contrast.html contrast-ref.html
 == contrast-extreme.html contrast-extreme-ref.html
 == contrast-one.html contrast-one-ref.html
 == contrast-percent.html contrast-percent-ref.html
 == contrast-reduce.html contrast-reduce-ref.html
 == contrast-zero.html contrast-zero-ref.html
 == drop-shadow.html drop-shadow-ref.html
 == drop-shadow-default-color.html drop-shadow-default-color-ref.html
--- a/layout/style/nsStyleStructInlines.h
+++ b/layout/style/nsStyleStructInlines.h
@@ -35,17 +35,18 @@ nsStylePosition::HasTransform(const nsIF
 {
   NS_ASSERTION(aContextFrame->StylePosition() == this, "unexpected aContextFrame");
   return HasTransformStyle() && aContextFrame->IsFrameOfType(nsIFrame::eSupportsCSSTransforms);
 }
 
 bool
 nsStylePosition::IsFixedPosContainingBlock(const nsIFrame* aContextFrame) const
 {
-  return (HasTransform(aContextFrame) || HasPerspectiveStyle()) &&
+  return (HasTransform(aContextFrame) || HasPerspectiveStyle() ||
+          !aContextFrame->StyleSVGReset()->mFilters.IsEmpty()) &&
       !aContextFrame->IsSVGText();
 }
 
 bool
 nsStyleText::HasTextShadow() const
 {
   return mTextShadow;
 }