Add a Setting to make position:fixed form a new stacking context
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 May 2012 23:14:13 +0000 (23:14 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 May 2012 23:14:13 +0000 (23:14 +0000)
commitb44b134e3d35ea559ae5dc6b5bd4fbea7636d2d0
treebe6efac82f97ad51760b3501ebb094da0d17e09f
parentf81921f701db4f867903ed86441b5f28941d71bf
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 <jamesr@chromium.org> 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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@118263 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/block/positioning/fixed-position-stacking-context-expected.png [new file with mode: 0644]
LayoutTests/fast/block/positioning/fixed-position-stacking-context-expected.txt [new file with mode: 0644]
LayoutTests/fast/block/positioning/fixed-position-stacking-context.html [new file with mode: 0644]
LayoutTests/fast/block/positioning/fixed-position-stacking-context2-expected.png [new file with mode: 0644]
LayoutTests/fast/block/positioning/fixed-position-stacking-context2-expected.txt [new file with mode: 0644]
LayoutTests/fast/block/positioning/fixed-position-stacking-context2.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/InternalSettings.h
Source/WebCore/testing/InternalSettings.idl
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebSettings.h
Source/WebKit/chromium/src/WebSettingsImpl.cpp
Source/WebKit/chromium/src/WebSettingsImpl.h