Title: [118263] trunk
Revision
118263
Author
[email protected]
Date
2012-05-23 16:14:13 -0700 (Wed, 23 May 2012)

Log Message

Add a Setting to make position:fixed form a new stacking context
https://bugs.webkit.org/show_bug.cgi?id=87186

Patch by James Robinson <[email protected]> on 2012-05-23
Reviewed by Adam Barth.

Source/WebCore:

position:fixed elements form a new stacking context in several mobile WebKit ports and in the Qt port always. To
be consistent across devices, we want to try turning it on everywhere. This will likely cause compatibility
issues, so we need a runtime setting in order to stage the change carefully.

Tests: fast/block/positioning/fixed-position-stacking-context.html
       fast/block/positioning/fixed-position-stacking-context2.html

* css/StyleResolver.cpp:
(WebCore::StyleResolver::collectMatchingRulesForList):
* page/Settings.cpp:
(WebCore::Settings::Settings):
* page/Settings.h:
(WebCore::Settings::setFixedPositionCreatesStackingContext):
(WebCore::Settings::fixedPositionCreatesStackingContext):
(Settings):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::InternalSettings):
(WebCore::InternalSettings::restoreTo):
(WebCore::InternalSettings::setFixedPositionCreatesStackingContext):
(WebCore):
* testing/InternalSettings.h:
(InternalSettings):
* testing/InternalSettings.idl:

Source/WebKit/chromium:

* public/WebSettings.h:
* src/WebSettingsImpl.cpp:
(WebKit::WebSettingsImpl::setFixedPositionCreatesStackingContext):
(WebKit):
* src/WebSettingsImpl.h:
(WebSettingsImpl):

LayoutTests:

Adds layout tests that confirm we don't creates stacking contexts for position:fixed by default, but we do when
the fixedPositionCreatesStackingContext Setting is true.

Qt and Blackberry will need different expectations since they set this via an #ifdef

* fast/block/positioning/fixed-position-stacking-context-expected.png: Added.
* fast/block/positioning/fixed-position-stacking-context-expected.txt: Added.
* fast/block/positioning/fixed-position-stacking-context.html: Added.
* fast/block/positioning/fixed-position-stacking-context2-expected.png: Added.
* fast/block/positioning/fixed-position-stacking-context2-expected.txt: Added.
* fast/block/positioning/fixed-position-stacking-context2.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (118262 => 118263)


--- trunk/LayoutTests/ChangeLog	2012-05-23 23:12:59 UTC (rev 118262)
+++ trunk/LayoutTests/ChangeLog	2012-05-23 23:14:13 UTC (rev 118263)
@@ -1,5 +1,24 @@
 2012-05-23  James Robinson  <[email protected]>
 
+        Add a Setting to make position:fixed form a new stacking context
+        https://bugs.webkit.org/show_bug.cgi?id=87186
+
+        Reviewed by Adam Barth.
+
+        Adds layout tests that confirm we don't creates stacking contexts for position:fixed by default, but we do when
+        the fixedPositionCreatesStackingContext Setting is true.
+
+        Qt and Blackberry will need different expectations since they set this via an #ifdef
+
+        * fast/block/positioning/fixed-position-stacking-context-expected.png: Added.
+        * fast/block/positioning/fixed-position-stacking-context-expected.txt: Added.
+        * fast/block/positioning/fixed-position-stacking-context.html: Added.
+        * fast/block/positioning/fixed-position-stacking-context2-expected.png: Added.
+        * fast/block/positioning/fixed-position-stacking-context2-expected.txt: Added.
+        * fast/block/positioning/fixed-position-stacking-context2.html: Added.
+
+2012-05-23  James Robinson  <[email protected]>
+
         [chromium] Turn ENABLE(OVERFLOW_SCROLLING) off for Chromium port
         https://bugs.webkit.org/show_bug.cgi?id=87177
 

Added: trunk/LayoutTests/fast/block/positioning/fixed-position-stacking-context-expected.png (0 => 118263)


--- trunk/LayoutTests/fast/block/positioning/fixed-position-stacking-context-expected.png	                        (rev 0)
+++ trunk/LayoutTests/fast/block/positioning/fixed-position-stacking-context-expected.png	2012-05-23 23:14:13 UTC (rev 118263)
@@ -0,0 +1,7 @@
+\x89PNG
+
+
+IHDR X')tEXtchecksum778803df0a824ed8f2c7dfa07c56832eh\x9F\xBD\xAC
+\xB7IDATx\x9C\xED\xD8\xC1	\x80@A\xCF\xC45\xF35
+\x87R\xC1<\x9BY\xC7}\xF0\xD2\\xB3{\xF0\xE7\xEE#\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0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positioning/fixed-position-stacking-context-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/block/positioning/fixed-position-stacking-context-expected.txt	2012-05-23 23:14:13 UTC (rev 118263)
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x8
+  RenderBlock {HTML} at (0,0) size 800x8
+    RenderBody {BODY} at (8,8) size 784x0
+layer at (0,0) size 100x100
+  RenderBlock (positioned) {DIV} at (0,0) size 100x100
+layer at (0,0) size 100x100
+  RenderBlock (positioned) zI: 1 {DIV} at (0,0) size 100x100 [bgcolor=#FF0000]
+layer at (0,0) size 100x100
+  RenderBlock (positioned) zI: 1 {DIV} at (0,0) size 100x100 [bgcolor=#FF0000]
+layer at (0,0) size 100x100
+  RenderBlock (positioned) zI: 2 {DIV} at (0,0) size 100x100 [bgcolor=#008000]

Added: trunk/LayoutTests/fast/block/positioning/fixed-position-stacking-context.html (0 => 118263)


--- trunk/LayoutTests/fast/block/positioning/fixed-position-stacking-context.html	                        (rev 0)
+++ trunk/LayoutTests/fast/block/positioning/fixed-position-stacking-context.html	2012-05-23 23:14:13 UTC (rev 118263)
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<title>Fixed position elements do not establish stacking contexts by default</title>
+<style>
+div {
+    height: 100px;
+    width: 100px;
+    margin: 0;
+    padding: 0;
+    top: 0;
+    left: 0;
+    position:fixed;
+}
+
+.red {
+    position:fixed;
+    background: red;
+    z-index: 1;
+}
+
+.green {
+    position:fixed;
+    background: green;
+    z-index: 2;
+}
+</style>
+<div class="red"></div>
+<div class="container">
+  <div class="red"></div>
+  <div class="green"></div>
+</div>

Added: trunk/LayoutTests/fast/block/positioning/fixed-position-stacking-context2-expected.png (0 => 118263)


--- trunk/LayoutTests/fast/block/positioning/fixed-position-stacking-context2-expected.png	                        (rev 0)
+++ trunk/LayoutTests/fast/block/positioning/fixed-position-stacking-context2-expected.png	2012-05-23 23:14:13 UTC (rev 118263)
@@ -0,0 +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C4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4[#
+\xA9\xD6c\xF3IEND\xAEB`\x82
\ No newline at end of file

Added: trunk/LayoutTests/fast/block/positioning/fixed-position-stacking-context2-expected.txt (0 => 118263)


--- trunk/LayoutTests/fast/block/positioning/fixed-position-stacking-context2-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/block/positioning/fixed-position-stacking-context2-expected.txt	2012-05-23 23:14:13 UTC (rev 118263)
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x8
+  RenderBlock {HTML} at (0,0) size 800x8
+    RenderBody {BODY} at (8,8) size 784x0
+layer at (0,0) size 100x100
+  RenderBlock (positioned) {DIV} at (0,0) size 100x100
+layer at (0,0) size 100x100
+  RenderBlock (positioned) zI: 1 {DIV} at (0,0) size 100x100 [bgcolor=#008000]
+layer at (0,0) size 100x100
+  RenderBlock (positioned) zI: 2 {DIV} at (0,0) size 100x100 [bgcolor=#FF0000]
+layer at (0,0) size 100x100
+  RenderBlock (positioned) zI: 1 {DIV} at (0,0) size 100x100 [bgcolor=#008000]

Added: trunk/LayoutTests/fast/block/positioning/fixed-position-stacking-context2.html (0 => 118263)


--- trunk/LayoutTests/fast/block/positioning/fixed-position-stacking-context2.html	                        (rev 0)
+++ trunk/LayoutTests/fast/block/positioning/fixed-position-stacking-context2.html	2012-05-23 23:14:13 UTC (rev 118263)
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Fixed position elements do establish stacking contexts with setting enabled</title>
+<style>
+div {
+    height: 100px;
+    width: 100px;
+    margin: 0;
+    padding: 0;
+    top: 0;
+    left: 0;
+    position:fixed;
+}
+
+.green {
+    position:fixed;
+    background: green;
+    z-index: 1;
+}
+
+.red {
+    position:fixed;
+    background: red;
+    z-index: 2;
+}
+</style>
+<script>
+if ("internals" in window) {
+    window.internals.settings.setFixedPositionCreatesStackingContext(true);
+} else {
+    document.write("This test depends on the FixedPositionCreatesStackingContext setting being true, so run in DumpRenderTree or manually enable it");
+}
+</script>
+<div class="green"></div>
+<div class="container">
+  <div class="green"></div>
+  <div class="red"></div>
+</div>

Modified: trunk/Source/WebCore/ChangeLog (118262 => 118263)


--- trunk/Source/WebCore/ChangeLog	2012-05-23 23:12:59 UTC (rev 118262)
+++ trunk/Source/WebCore/ChangeLog	2012-05-23 23:14:13 UTC (rev 118263)
@@ -1,3 +1,34 @@
+2012-05-23  James Robinson  <[email protected]>
+
+        Add a Setting to make position:fixed form a new stacking context
+        https://bugs.webkit.org/show_bug.cgi?id=87186
+
+        Reviewed by Adam Barth.
+
+        position:fixed elements form a new stacking context in several mobile WebKit ports and in the Qt port always. To
+        be consistent across devices, we want to try turning it on everywhere. This will likely cause compatibility
+        issues, so we need a runtime setting in order to stage the change carefully.
+
+        Tests: fast/block/positioning/fixed-position-stacking-context.html
+               fast/block/positioning/fixed-position-stacking-context2.html
+
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::collectMatchingRulesForList):
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings):
+        * page/Settings.h:
+        (WebCore::Settings::setFixedPositionCreatesStackingContext):
+        (WebCore::Settings::fixedPositionCreatesStackingContext):
+        (Settings):
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::InternalSettings):
+        (WebCore::InternalSettings::restoreTo):
+        (WebCore::InternalSettings::setFixedPositionCreatesStackingContext):
+        (WebCore):
+        * testing/InternalSettings.h:
+        (InternalSettings):
+        * testing/InternalSettings.idl:
+
 2012-05-23  Michael Nordman  <[email protected]>
 
         [chromium] DomStorage events handling needs TLC (3)

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (118262 => 118263)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2012-05-23 23:12:59 UTC (rev 118262)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2012-05-23 23:14:13 UTC (rev 118263)
@@ -2047,6 +2047,8 @@
         || style->hasTransformRelatedProperty() || style->hasMask() || style->boxReflect() || style->hasFilter()
 #ifdef FIXED_POSITION_CREATES_STACKING_CONTEXT
         || style->position() == FixedPosition
+#else
+        || (style->position() == FixedPosition && e && e->document()->page()->settings()->fixedPositionCreatesStackingContext())
 #endif
 #if ENABLE(OVERFLOW_SCROLLING)
         // Touch overflow scrolling creates a stacking context.

Modified: trunk/Source/WebCore/page/Settings.cpp (118262 => 118263)


--- trunk/Source/WebCore/page/Settings.cpp	2012-05-23 23:12:59 UTC (rev 118262)
+++ trunk/Source/WebCore/page/Settings.cpp	2012-05-23 23:14:13 UTC (rev 118263)
@@ -268,6 +268,7 @@
     , m_wantsBalancedSetDefersLoadingBehavior(false)
     , m_requestAnimationFrameEnabled(true)
     , m_needsDidFinishLoadOrderQuirk(false)
+    , m_fixedPositionCreatesStackingContext(false)
     , m_loadsImagesAutomaticallyTimer(this, &Settings::loadsImagesAutomaticallyTimerFired)
     , m_incrementalRenderingSuppressionTimeoutInSeconds(defaultIncrementalRenderingSuppressionTimeoutInSeconds)
 {

Modified: trunk/Source/WebCore/page/Settings.h (118262 => 118263)


--- trunk/Source/WebCore/page/Settings.h	2012-05-23 23:12:59 UTC (rev 118262)
+++ trunk/Source/WebCore/page/Settings.h	2012-05-23 23:14:13 UTC (rev 118263)
@@ -570,6 +570,9 @@
         void setNeedsDidFinishLoadOrderQuirk(bool needsQuirk) { m_needsDidFinishLoadOrderQuirk = needsQuirk; }
         bool needsDidFinishLoadOrderQuirk() const { return m_needsDidFinishLoadOrderQuirk; }
 
+        void setFixedPositionCreatesStackingContext(bool creates) { m_fixedPositionCreatesStackingContext = creates; }
+        bool fixedPositionCreatesStackingContext() const { return m_fixedPositionCreatesStackingContext; }
+
 #if USE(JSC)
         static void setShouldRespectPriorityInCSSAttributeSetters(bool);
         static bool shouldRespectPriorityInCSSAttributeSetters();
@@ -738,6 +741,8 @@
         bool m_requestAnimationFrameEnabled : 1;
         bool m_needsDidFinishLoadOrderQuirk : 1;
 
+        bool m_fixedPositionCreatesStackingContext : 1;
+
         Timer<Settings> m_loadsImagesAutomaticallyTimer;
         void loadsImagesAutomaticallyTimerFired(Timer<Settings>*);
         

Modified: trunk/Source/WebCore/testing/InternalSettings.cpp (118262 => 118263)


--- trunk/Source/WebCore/testing/InternalSettings.cpp	2012-05-23 23:12:59 UTC (rev 118262)
+++ trunk/Source/WebCore/testing/InternalSettings.cpp	2012-05-23 23:14:13 UTC (rev 118263)
@@ -99,6 +99,7 @@
     , m_originalShadowDOMEnabled(RuntimeEnabledFeatures::shadowDOMEnabled())
 #endif
     , m_originalEditingBehavior(settings()->editingBehaviorType())
+    , m_originalFixedPositionCreatesStackingContext(settings()->fixedPositionCreatesStackingContext())
 {
 }
 
@@ -111,6 +112,7 @@
     RuntimeEnabledFeatures::setShadowDOMEnabled(m_originalShadowDOMEnabled);
 #endif
     settings->setEditingBehaviorType(m_originalEditingBehavior);
+    settings->setFixedPositionCreatesStackingContext(m_originalFixedPositionCreatesStackingContext);
 }
 
 Settings* InternalSettings::settings() const
@@ -344,4 +346,10 @@
         ec = SYNTAX_ERR;
 }
 
+void InternalSettings::setFixedPositionCreatesStackingContext(bool creates, ExceptionCode& ec)
+{
+    InternalSettingsGuardForFrameView();
+    settings()->setFixedPositionCreatesStackingContext(creates);
 }
+
+}

Modified: trunk/Source/WebCore/testing/InternalSettings.h (118262 => 118263)


--- trunk/Source/WebCore/testing/InternalSettings.h	2012-05-23 23:12:59 UTC (rev 118262)
+++ trunk/Source/WebCore/testing/InternalSettings.h	2012-05-23 23:14:13 UTC (rev 118263)
@@ -76,6 +76,7 @@
     void setCSSExclusionsEnabled(bool enabled, ExceptionCode&);
     void setMediaPlaybackRequiresUserGesture(bool, ExceptionCode&);
     void setEditingBehavior(const String&, ExceptionCode&);
+    void setFixedPositionCreatesStackingContext(bool, ExceptionCode&);
 
     void restoreTo(Settings*);
 
@@ -93,6 +94,7 @@
     bool m_originalShadowDOMEnabled;
 #endif
     EditingBehaviorType m_originalEditingBehavior;
+    bool m_originalFixedPositionCreatesStackingContext;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/testing/InternalSettings.idl (118262 => 118263)


--- trunk/Source/WebCore/testing/InternalSettings.idl	2012-05-23 23:12:59 UTC (rev 118262)
+++ trunk/Source/WebCore/testing/InternalSettings.idl	2012-05-23 23:14:13 UTC (rev 118263)
@@ -54,6 +54,7 @@
         void setCSSExclusionsEnabled(in boolean enabled) raises(DOMException);
         void setMediaPlaybackRequiresUserGesture(in boolean enabled) raises(DOMException);
         void setEditingBehavior(in DOMString behavior) raises(DOMException);
+        void setFixedPositionCreatesStackingContext(in boolean creates) raises(DOMException);
     };
 }
 

Modified: trunk/Source/WebKit/chromium/ChangeLog (118262 => 118263)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-05-23 23:12:59 UTC (rev 118262)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-05-23 23:14:13 UTC (rev 118263)
@@ -1,5 +1,19 @@
 2012-05-23  James Robinson  <[email protected]>
 
+        Add a Setting to make position:fixed form a new stacking context
+        https://bugs.webkit.org/show_bug.cgi?id=87186
+
+        Reviewed by Adam Barth.
+
+        * public/WebSettings.h:
+        * src/WebSettingsImpl.cpp:
+        (WebKit::WebSettingsImpl::setFixedPositionCreatesStackingContext):
+        (WebKit):
+        * src/WebSettingsImpl.h:
+        (WebSettingsImpl):
+
+2012-05-23  James Robinson  <[email protected]>
+
         [chromium] Turn ENABLE(OVERFLOW_SCROLLING) off for Chromium port
         https://bugs.webkit.org/show_bug.cgi?id=87177
 

Modified: trunk/Source/WebKit/chromium/public/WebSettings.h (118262 => 118263)


--- trunk/Source/WebKit/chromium/public/WebSettings.h	2012-05-23 23:12:59 UTC (rev 118262)
+++ trunk/Source/WebKit/chromium/public/WebSettings.h	2012-05-23 23:14:13 UTC (rev 118263)
@@ -151,6 +151,7 @@
     virtual bool viewportEnabled() const = 0;
     virtual void setDefaultTileSize(WebSize) = 0;
     virtual void setMaxUntiledLayerSize(WebSize) = 0;
+    virtual void setFixedPositionCreatesStackingContext(bool) = 0;
 
 
 protected:

Modified: trunk/Source/WebKit/chromium/src/WebSettingsImpl.cpp (118262 => 118263)


--- trunk/Source/WebKit/chromium/src/WebSettingsImpl.cpp	2012-05-23 23:12:59 UTC (rev 118262)
+++ trunk/Source/WebKit/chromium/src/WebSettingsImpl.cpp	2012-05-23 23:14:13 UTC (rev 118263)
@@ -586,6 +586,11 @@
     m_settings->setMediaPlaybackRequiresUserGesture(required);
 }
 
+void WebSettingsImpl::setFixedPositionCreatesStackingContext(bool creates)
+{
+    m_settings->setFixedPositionCreatesStackingContext(creates);
+}
+
 void WebSettingsImpl::setViewportEnabled(bool enabled)
 {
     m_viewportEnabled = enabled;

Modified: trunk/Source/WebKit/chromium/src/WebSettingsImpl.h (118262 => 118263)


--- trunk/Source/WebKit/chromium/src/WebSettingsImpl.h	2012-05-23 23:12:59 UTC (rev 118262)
+++ trunk/Source/WebKit/chromium/src/WebSettingsImpl.h	2012-05-23 23:14:13 UTC (rev 118263)
@@ -142,6 +142,7 @@
     virtual void setPerTilePaintingEnabled(bool);
     virtual void setPartialSwapEnabled(bool);
     virtual void setThreadedAnimationEnabled(bool);
+    virtual void setFixedPositionCreatesStackingContext(bool);
     virtual void setViewportEnabled(bool);
     virtual void setMediaPlaybackRequiresUserGesture(bool);
     virtual bool viewportEnabled() const { return m_viewportEnabled; }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to