Skip to content

Commit

Permalink
Reverting changes that made window.scroll properties relative to the …
Browse files Browse the repository at this point in the history
…layout viewport.

Reason for revert:
Broke a bunch of sites that relied on visual viewport coordinates
(see www.crbug.com/571297). Reverting temporary until a new api that provides visual
viewport coordinates is made available to developers.

Revert "Make window.scroll properties relative to the layout viewport by default."

This reverts commit f75faf5.

Revert "Remove plumbing for the inert-visual-viewport flag."

This reverts commit 58d42ae.

TBR=avi@chromium.org,kenrb@chromium.org
BUG=571297

Review URL: https://codereview.chromium.org/1712743002

Cr-Commit-Position: refs/heads/master@{#376742}
  • Loading branch information
ymalik authored and Commit bot committed Feb 22, 2016
1 parent c7580b2 commit 835268c
Show file tree
Hide file tree
Showing 23 changed files with 314 additions and 192 deletions.
6 changes: 6 additions & 0 deletions chrome/app/generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -5330,6 +5330,12 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION" desc="Description of the 'Ignore GPU blacklist' lab.">
Overrides the built-in software rendering list and enables GPU-acceleration on unsupported system configurations.
</message>
<message name="IDS_FLAGS_INERT_VISUAL_VIEWPORT_NAME" desc="Title of the flag to enable the inert visual viewport experiment.">
Inert visual viewport.
</message>
<message name="IDS_FLAGS_INERT_VISUAL_VIEWPORT_DESCRIPTION" desc="Description of the flag to enable the inert visual viewport experiment.">
Experiment to have all APIs reflect the layout viewport. This will make window.scroll properties relative to the layout viewport.
</message>
<message name="IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME" desc="Name of the 'Threaded compositing mode' lab.">
Threaded compositing
</message>
Expand Down
5 changes: 5 additions & 0 deletions chrome/browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1307,6 +1307,11 @@ const FeatureEntry kFeatureEntries[] = {
IDS_FLAGS_SETTINGS_WINDOW_DESCRIPTION, kOsDesktop,
ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSettingsWindow,
switches::kDisableSettingsWindow)},
{"inert-visual-viewport",
IDS_FLAGS_INERT_VISUAL_VIEWPORT_NAME,
IDS_FLAGS_INERT_VISUAL_VIEWPORT_DESCRIPTION,
kOsAll,
SINGLE_VALUE_TYPE(switches::kInertVisualViewport)},
#if defined(OS_MACOSX)
{"enable-save-password-bubble", IDS_FLAGS_SAVE_PASSWORD_BUBBLE_NAME,
IDS_FLAGS_SAVE_PASSWORD_BUBBLE_DESCRIPTION, kOsMac,
Expand Down
1 change: 1 addition & 0 deletions content/browser/renderer_host/render_process_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1478,6 +1478,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kForceDisplayList2dCanvas,
switches::kForceOverlayFullscreenVideo,
switches::kFullMemoryCrashReport,
switches::kInertVisualViewport,
switches::kIPCConnectionTimeout,
switches::kJavaScriptFlags,
switches::kLoggingLevel,
Expand Down
3 changes: 3 additions & 0 deletions content/browser/renderer_host/render_view_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,9 @@ WebPreferences RenderViewHostImpl::ComputeWebkitPrefs() {
atoi(command_line.GetSwitchValueASCII(
switches::kAcceleratedCanvas2dMSAASampleCount).c_str());

prefs.inert_visual_viewport =
command_line.HasSwitch(switches::kInertVisualViewport);

prefs.pinch_overlay_scrollbar_thickness = 10;
prefs.use_solid_color_scrollbars = ui::IsOverlayScrollbarEnabled();

Expand Down
1 change: 1 addition & 0 deletions content/public/common/common_param_traits_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(webaudio_enabled)
IPC_STRUCT_TRAITS_MEMBER(experimental_webgl_enabled)
IPC_STRUCT_TRAITS_MEMBER(pepper_3d_enabled)
IPC_STRUCT_TRAITS_MEMBER(inert_visual_viewport)
IPC_STRUCT_TRAITS_MEMBER(pinch_overlay_scrollbar_thickness)
IPC_STRUCT_TRAITS_MEMBER(use_solid_color_scrollbars)
IPC_STRUCT_TRAITS_MEMBER(flash_3d_enabled)
Expand Down
3 changes: 3 additions & 0 deletions content/public/common/content_switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,9 @@ const char kIgnoreCertificateErrors[] = "ignore-certificate-errors";
// Ignores GPU blacklist.
const char kIgnoreGpuBlacklist[] = "ignore-gpu-blacklist";

// Makes all APIs reflect the layout viewport.
const char kInertVisualViewport[] = "inert-visual-viewport";

// Run the GPU process as a thread in the browser process.
const char kInProcessGPU[] = "in-process-gpu";

Expand Down
1 change: 1 addition & 0 deletions content/public/common/content_switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ extern const char kGpuVendorID[];
CONTENT_EXPORT extern const char kHostResolverRules[];
CONTENT_EXPORT extern const char kIgnoreCertificateErrors[];
CONTENT_EXPORT extern const char kIgnoreGpuBlacklist[];
CONTENT_EXPORT extern const char kInertVisualViewport[];
CONTENT_EXPORT extern const char kInProcessGPU[];
CONTENT_EXPORT extern const char kIPCConnectionTimeout[];
CONTENT_EXPORT extern const char kJavaScriptFlags[];
Expand Down
1 change: 1 addition & 0 deletions content/public/common/web_preferences.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ WebPreferences::WebPreferences()
use_solid_color_scrollbars(false),
navigate_on_drag_drop(true),
v8_cache_options(V8_CACHE_OPTIONS_DEFAULT),
inert_visual_viewport(false),
cookie_enabled(true),
pepper_accelerated_video_decode_enabled(false),
animation_policy(IMAGE_ANIMATION_POLICY_ALLOWED),
Expand Down
1 change: 1 addition & 0 deletions content/public/common/web_preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ struct CONTENT_EXPORT WebPreferences {
bool use_solid_color_scrollbars;
bool navigate_on_drag_drop;
V8CacheOptions v8_cache_options;
bool inert_visual_viewport;

// This flags corresponds to a Page's Settings' setCookieEnabled state. It
// only controls whether or not the "document.cookie" field is properly
Expand Down
2 changes: 2 additions & 0 deletions content/renderer/render_view_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs,

settings->setSupportsMultipleWindows(prefs.supports_multiple_windows);

settings->setInertVisualViewport(prefs.inert_visual_viewport);

settings->setSmartInsertDeleteEnabled(prefs.smart_insert_delete_enabled);

settings->setSpatialNavigationEnabled(prefs.spatial_navigation_enabled);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,25 @@ This test makes sure the window properties related to the viewport remain correc
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


===Initial Scale===
===Unscaled===

PASS window.innerWidth is 1600
PASS window.innerHeight is 1200
PASS internals.visualViewportWidth() is 1600
PASS internals.visualViewportHeight() is 1200
PASS window.innerWidth is 800
PASS window.innerHeight is 600

===Pinch Zoom in to 2X===

PASS window.innerWidth is 1600
PASS window.innerHeight is 1200
PASS window.innerWidth is 400
PASS window.innerHeight is 300
PASS window.scrollX is 0
PASS window.scrollY is 0
PASS internals.visualViewportWidth() is 400
PASS internals.visualViewportHeight() is 300
===ScrollBy===
PASS window.scrollX is 100
PASS window.scrollY is 200
PASS internals.visualViewportScrollX() is 100
PASS internals.visualViewportScrollY() is 200
PASS window.scrollX is 400
PASS window.scrollY is 300
PASS internals.visualViewportScrollX() is 400
PASS internals.visualViewportScrollY() is 300
PASS window.scrollX is 10
PASS window.scrollY is 20
PASS window.scrollX is 1600
PASS window.scrollY is 1200
PASS window.scrollX is 0
PASS window.scrollY is 0
===ScrollTo===
PASS window.scrollX is 100
PASS window.scrollY is 200
PASS internals.visualViewportScrollX() is 100
PASS internals.visualViewportScrollY() is 200
PASS window.scrollX is 400
PASS window.scrollY is 300
PASS internals.visualViewportScrollX() is 400
PASS internals.visualViewportScrollY() is 300
PASS window.scrollX is 1600
PASS window.scrollY is 1200
PASS window.scrollX is 0
PASS window.scrollY is 0

Expand All @@ -47,30 +31,28 @@ PASS window.innerWidth is 1600
PASS window.innerHeight is 1200
PASS window.scrollX is 0
PASS window.scrollY is 0
PASS internals.visualViewportWidth() is 1600
PASS internals.visualViewportHeight() is 1200
===ScrollBy===
PASS window.scrollX is 100
PASS window.scrollY is 200
PASS internals.visualViewportScrollX() is 100
PASS internals.visualViewportScrollY() is 200
PASS window.scrollX is 10
PASS window.scrollY is 20
PASS window.scrollX is 400
PASS window.scrollY is 300
PASS internals.visualViewportScrollX() is 400
PASS internals.visualViewportScrollY() is 300
PASS window.scrollX is 0
PASS window.scrollY is 0
===ScrollTo===
PASS window.scrollX is 100
PASS window.scrollY is 200
PASS internals.visualViewportScrollX() is 100
PASS internals.visualViewportScrollY() is 200
PASS window.scrollX is 400
PASS window.scrollY is 300
PASS internals.visualViewportScrollX() is 400
PASS internals.visualViewportScrollY() is 300
PASS window.scrollX is 0
PASS window.scrollY is 0

===Test OnScroll===

PASS window.innerWidth is 800
PASS window.innerHeight is 600
PASS window.scrollX is 0
PASS window.scrollY is 0
PASS OnScroll called for scroll #1
PASS OnScroll called for scroll #2
PASS OnScroll called for scroll #3
PASS OnScroll called for scroll #4

PASS successfullyParsed is true

TEST COMPLETE
Expand Down
Loading

0 comments on commit 835268c

Please sign in to comment.