summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-24 23:42:10 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-24 23:42:10 +0000
commit96bcdc103539462861ecfc6f49fe5f136df72587 (patch)
treeaf1dfaa5e8f6e49af47ecbe3726b970815299cd4
parentf778e1cb8acee07de54b0c8f6b5c20caf0ff132b (diff)
downloadchromium_src-96bcdc103539462861ecfc6f49fe5f136df72587.zip
chromium_src-96bcdc103539462861ecfc6f49fe5f136df72587.tar.gz
chromium_src-96bcdc103539462861ecfc6f49fe5f136df72587.tar.bz2
Add flag to make all position:fixed elements create stacking contexts
BUG=129277 TEST=none Review URL: https://chromiumcodereview.appspot.com/10411083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138930 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/generated_resources.grd6
-rw-r--r--chrome/browser/about_flags.cc7
-rw-r--r--content/browser/web_contents/web_contents_impl.cc3
-rw-r--r--content/common/view_messages.h1
-rw-r--r--content/public/common/content_switches.cc2
-rw-r--r--content/public/common/content_switches.h1
-rw-r--r--webkit/glue/webpreferences.cc6
-rw-r--r--webkit/glue/webpreferences.h1
8 files changed, 26 insertions, 1 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 2574561..f0b2503 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -5432,6 +5432,12 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION" desc="Description for the flag to disable WebGL.">
Enabling this option prevents web applications from accessing the WebGL API.
</message>
+ <message name="IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME" desc="Name of the 'Fixed position creates stacking context' lab.">
+ Fixed position elements create stacking contexts.
+ </message>
+ <message name="IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION" desc="Description for the flag to make fixed position elements create stacking contexts.">
+ Enabling this option makes all fixed position elements create new CSS stacking contexts.
+ </message>
<message name="IDS_FLAGS_ENABLE_HTTP_PIPELINING_NAME" desc="Title for the flag to enable HTTP pipelining">
HTTP Pipelining
</message>
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 9f9f038f..da85977 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -245,6 +245,13 @@ const Experiment kExperiments[] = {
kOsAll,
SINGLE_VALUE_TYPE(switches::kEnableBrowserPlugin)
},
+ {
+ "fixed-position-creates-stacking-context",
+ IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME,
+ IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION,
+ kOsAll,
+ SINGLE_VALUE_TYPE(switches::kFixedPositionCreatesStackingContext)
+ },
// TODO(dspringer): When NaCl is on by default, remove this flag entry.
{
"enable-nacl", // FLAGS:RECORD_UMA
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index d61e9ee..f92f107 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -574,6 +574,9 @@ WebPreferences WebContentsImpl::GetWebkitPrefs(RenderViewHost* rvh,
prefs.apply_default_device_scale_factor_in_compositor = true;
}
+ prefs.fixed_position_creates_stacking_context =
+ command_line.HasSwitch(switches::kFixedPositionCreatesStackingContext);
+
content::GetContentClient()->browser()->OverrideWebkitPrefs(rvh, url, &prefs);
return prefs;
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index 04f8c0d..e85bda1 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -211,6 +211,7 @@ IPC_STRUCT_TRAITS_BEGIN(webkit_glue::WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(default_tile_height)
IPC_STRUCT_TRAITS_MEMBER(max_untiled_layer_width)
IPC_STRUCT_TRAITS_MEMBER(max_untiled_layer_height)
+ IPC_STRUCT_TRAITS_MEMBER(fixed_position_creates_stacking_context)
IPC_STRUCT_TRAITS_END()
IPC_STRUCT_TRAITS_BEGIN(WebMenuItem)
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc
index 882da97..1905c2c 100644
--- a/content/public/common/content_switches.cc
+++ b/content/public/common/content_switches.cc
@@ -644,4 +644,6 @@ const char kDefaultTileHeight[] = "default-tile-height";
const char kMaxUntiledLayerWidth[] = "max-untiled-layer-width";
const char kMaxUntiledLayerHeight[] = "max-untiled-layer-height";
+const char kFixedPositionCreatesStackingContext[]
+ = "fixed-position-creates-stacking-context";
} // namespace switches
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h
index 9eeaa36..31a1b11 100644
--- a/content/public/common/content_switches.h
+++ b/content/public/common/content_switches.h
@@ -187,6 +187,7 @@ extern const char kDefaultTileWidth[];
extern const char kDefaultTileHeight[];
extern const char kMaxUntiledLayerWidth[];
extern const char kMaxUntiledLayerHeight[];
+CONTENT_EXPORT extern const char kFixedPositionCreatesStackingContext[];
extern const char kEnableVisualWordMovement[];
diff --git a/webkit/glue/webpreferences.cc b/webkit/glue/webpreferences.cc
index 883da73..55740dc 100644
--- a/webkit/glue/webpreferences.cc
+++ b/webkit/glue/webpreferences.cc
@@ -110,7 +110,8 @@ WebPreferences::WebPreferences()
default_tile_width(256),
default_tile_height(256),
max_untiled_layer_width(512),
- max_untiled_layer_height(512) {
+ max_untiled_layer_height(512),
+ fixed_position_creates_stacking_context(false) {
standard_font_family_map[kCommonScript] =
ASCIIToUTF16("Times New Roman");
fixed_font_family_map[kCommonScript] =
@@ -373,6 +374,9 @@ void WebPreferences::Apply(WebView* web_view) const {
settings->setMaxUntiledLayerSize(
WebSize(max_untiled_layer_width, max_untiled_layer_height));
+ settings->setFixedPositionCreatesStackingContext(
+ fixed_position_creates_stacking_context);
+
WebNetworkStateNotifier::setOnLine(is_online);
}
diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h
index fd7c9cd..48c9881 100644
--- a/webkit/glue/webpreferences.h
+++ b/webkit/glue/webpreferences.h
@@ -127,6 +127,7 @@ struct WEBKIT_GLUE_EXPORT WebPreferences {
int default_tile_height;
int max_untiled_layer_width;
int max_untiled_layer_height;
+ bool fixed_position_creates_stacking_context;
// We try to keep the default values the same as the default values in
// chrome, except for the cases where it would require lots of extra work for