Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Issue 14813025: Refactor viewport initialization logic out of WebViewImpl. (Closed)

Created:
7 years, 7 months ago by aelias_OOO_until_Jul13
Modified:
7 years, 7 months ago
CC:
blink-reviews, adamk+blink_chromium.org, eae+blinkwatch, abarth_chromum.org, kenneth.christiansen, wjmaclean, bokan, johnme, Rick Byers
Visibility:
Public.

Description

Refactor viewport initialization logic out of WebViewImpl. (Second commit attempt) This centralizes and brings some structure to viewport initialization, expressing it as a cascade of constraints expressed as ViewportAttributes objects. When any of the constraints changes, a dirty bit is set, and the page scale factor and fixed-layout size is recalculated on the next layout. This refactor mostly maintains existing behavior, but also includes two bugfixes (with new tests for them): 1. Page scale is now reset to minimum when the content width increases, even if it was reset in the past. 2. setIgnoreViewportTagMaximumScale now also ignores the minimum (I'll need to rename this WebKit API). NOTRY=true BUG=176998, 161695, 165688 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=151134

Patch Set 1 #

Patch Set 2 : Set limits in DumpRenderTree #

Patch Set 3 : Fix viewport tag tests #

Patch Set 4 : Fix more layout tests #

Patch Set 5 : Fix RTL tests #

Patch Set 6 : Hide content size constraints behind if enable_viewport #

Patch Set 7 : Add tests for new behavior #

Total comments: 38

Patch Set 8 : Address code review comments #

Total comments: 3

Patch Set 9 : Address comment on setInitialPageScaleFactorPermanently test #

Patch Set 10 : Another RTL test fix #

Total comments: 5

Patch Set 11 : Address Adam's code review comments #

Patch Set 12 : Attempt to fix Mac rubberband layout tests #

Patch Set 13 : Another try at fixing rubberband tests #

Patch Set 14 : Rebase to 150733 #

Patch Set 15 : Fix rubberbanding tests #

Patch Set 16 : Fix layoutAlgorithm failure by recalculating fixed-layout size on useWideViewport change #

Patch Set 17 : Rebase to 151012 #

Patch Set 18 : Rename initializeAtMinimumScale to loadWithOverviewMode #

Patch Set 19 : Fix webkit_unit_tests #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+652 lines, -404 lines) Patch
M LayoutTests/TestExpectations View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +10 lines, -0 lines 0 comments Download
D LayoutTests/fast/viewport/viewport-91.html View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -13 lines 0 comments Download
D LayoutTests/fast/viewport/viewport-91-expected.txt View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -2 lines 0 comments Download
M Source/WebKit/chromium/public/WebSettings.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +2 lines, -1 line 0 comments Download
M Source/WebKit/chromium/public/WebView.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +6 lines, -7 lines 0 comments Download
M Source/WebKit/chromium/src/ChromeClientImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -67 lines 0 comments Download
M Source/WebKit/chromium/src/WebSettingsImpl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +1 line, -5 lines 0 comments Download
M Source/WebKit/chromium/src/WebSettingsImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +3 lines, -5 lines 0 comments Download
M Source/WebKit/chromium/src/WebViewImpl.h View 1 2 3 4 5 6 7 8 9 10 14 15 16 7 chunks +8 lines, -18 lines 0 comments Download
M Source/WebKit/chromium/src/WebViewImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 16 chunks +110 lines, -154 lines 0 comments Download
M Source/WebKit/chromium/tests/WebFrameTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 13 chunks +92 lines, -29 lines 0 comments Download
M Source/WebKit/chromium/tests/data/no_scale_for_you.html View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
A Source/WebKit/chromium/tests/data/wide_document.html View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +5 lines, -0 lines 0 comments Download
M Source/core/dom/ViewportArguments.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +2 lines, -22 lines 0 comments Download
M Source/core/dom/ViewportArguments.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +9 lines, -46 lines 0 comments Download
M Source/core/page/Page.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +13 lines, -12 lines 0 comments Download
A + Source/core/page/PageScaleConstraints.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +16 lines, -18 lines 0 comments Download
A Source/core/page/PageScaleConstraints.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +101 lines, -0 lines 0 comments Download
A Source/core/page/PageScaleConstraintsSet.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +88 lines, -0 lines 0 comments Download
A Source/core/page/PageScaleConstraintsSet.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +146 lines, -0 lines 0 comments Download
M Source/core/page/Settings.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +8 lines, -0 lines 2 comments Download
M Source/core/page/Settings.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +23 lines, -0 lines 0 comments Download
M Source/core/testing/Internals.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +6 lines, -4 lines 0 comments Download

Messages

Total messages: 25 (0 generated)
aelias_OOO_until_Jul13
As several people have started to hack on viewport-tag related stuff, here's a refactor to ...
7 years, 7 months ago (2013-05-13 10:24:58 UTC) #1
kenneth.r.christiansen
https://codereview.chromium.org/14813025/diff/15001/Source/WebKit/chromium/src/ViewportAttributesManager.cpp File Source/WebKit/chromium/src/ViewportAttributesManager.cpp (right): https://codereview.chromium.org/14813025/diff/15001/Source/WebKit/chromium/src/ViewportAttributesManager.cpp#newcode37 Source/WebKit/chromium/src/ViewportAttributesManager.cpp:37: static const float defaultMaximumScale = 4.0f; doesn't iOS use ...
7 years, 7 months ago (2013-05-13 11:00:18 UTC) #2
mnaganov (inactive)
https://codereview.chromium.org/14813025/diff/15001/Source/WebKit/chromium/src/ViewportAttributesManager.cpp File Source/WebKit/chromium/src/ViewportAttributesManager.cpp (right): https://codereview.chromium.org/14813025/diff/15001/Source/WebKit/chromium/src/ViewportAttributesManager.cpp#newcode123 Source/WebKit/chromium/src/ViewportAttributesManager.cpp:123: if (arguments.deprecatedTargetDensityDPI == ViewportArguments::ValueLowDPI) On 2013/05/13 11:00:18, kenneth.r.christiansen wrote: ...
7 years, 7 months ago (2013-05-13 11:58:38 UTC) #3
dshwang
Great job! This patch dramatically reduces WebViewImpl. I leave some comments. btw, can I ask ...
7 years, 7 months ago (2013-05-13 12:38:00 UTC) #4
jamesr
On 2013/05/13 12:38:00, dshwang wrote: > Great job! This patch dramatically reduces WebViewImpl. > I ...
7 years, 7 months ago (2013-05-13 17:44:00 UTC) #5
aelias_OOO_until_Jul13
Thanks for the detailed look. > 1. Is it possible to test pinch zoom in ...
7 years, 7 months ago (2013-05-13 18:13:05 UTC) #6
abarth-chromium
https://codereview.chromium.org/14813025/diff/27001/Source/WebKit/chromium/src/WebViewImpl.h File Source/WebKit/chromium/src/WebViewImpl.h (left): https://codereview.chromium.org/14813025/diff/27001/Source/WebKit/chromium/src/WebViewImpl.h#oldcode737 Source/WebKit/chromium/src/WebViewImpl.h:737: bool m_pageScaleFactorIsSet; Thank you!!
7 years, 7 months ago (2013-05-13 18:22:24 UTC) #7
mnaganov (inactive)
Android-related parts LGTM % comment https://codereview.chromium.org/14813025/diff/27001/Source/WebKit/chromium/tests/WebFrameTest.cpp File Source/WebKit/chromium/tests/WebFrameTest.cpp (right): https://codereview.chromium.org/14813025/diff/27001/Source/WebKit/chromium/tests/WebFrameTest.cpp#newcode596 Source/WebKit/chromium/tests/WebFrameTest.cpp:596: EXPECT_EQ(minimumPageScaleFactor, m_webView->pageScaleFactor()); I'm a ...
7 years, 7 months ago (2013-05-14 09:31:23 UTC) #8
aelias_OOO_until_Jul13
Note that Chromium-side android_webview test package also all passes. https://codereview.chromium.org/14813025/diff/27001/Source/WebKit/chromium/tests/WebFrameTest.cpp File Source/WebKit/chromium/tests/WebFrameTest.cpp (right): https://codereview.chromium.org/14813025/diff/27001/Source/WebKit/chromium/tests/WebFrameTest.cpp#newcode596 Source/WebKit/chromium/tests/WebFrameTest.cpp:596: ...
7 years, 7 months ago (2013-05-14 21:39:52 UTC) #9
aelias_OOO_until_Jul13
Adam, could you take a look for OWNERS approval? I addressed the previous feedback.
7 years, 7 months ago (2013-05-20 18:04:41 UTC) #10
abarth-chromium
https://codereview.chromium.org/14813025/diff/39001/Source/WebKit/chromium/WebKit.gyp File Source/WebKit/chromium/WebKit.gyp (right): https://codereview.chromium.org/14813025/diff/39001/Source/WebKit/chromium/WebKit.gyp#newcode569 Source/WebKit/chromium/WebKit.gyp:569: 'src/ViewportAttributesManager.h', Please list alphabetically https://codereview.chromium.org/14813025/diff/39001/Source/WebKit/chromium/src/ViewportAttributesManager.h File Source/WebKit/chromium/src/ViewportAttributesManager.h (right): https://codereview.chromium.org/14813025/diff/39001/Source/WebKit/chromium/src/ViewportAttributesManager.h#newcode42 ...
7 years, 7 months ago (2013-05-20 18:22:25 UTC) #11
abarth-chromium
LGTM. I wanted to like this CL more, but there were some hairy parts that ...
7 years, 7 months ago (2013-05-20 18:25:53 UTC) #12
aelias_OOO_until_Jul13
OK, comments addressed; I'll land when the trybots look good. On 2013/05/20 18:25:53, abarth wrote: ...
7 years, 7 months ago (2013-05-21 00:51:46 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/aelias@chromium.org/14813025/69001
7 years, 7 months ago (2013-05-21 05:59:07 UTC) #14
commit-bot: I haz the power
Change committed as 150743
7 years, 7 months ago (2013-05-21 05:59:41 UTC) #15
rune
Was the removal of orientation intentional? It breaks compilation for ENABLE(CSS_DEVICE_ADAPTATION).
7 years, 7 months ago (2013-05-21 07:59:10 UTC) #16
rune
On 2013/05/21 07:59:10, rune wrote: > Was the removal of orientation intentional? It breaks compilation ...
7 years, 7 months ago (2013-05-21 08:36:43 UTC) #17
aelias_OOO_until_Jul13
Reopening as this got reverted in r150797 due to Android WebView test failures.
7 years, 7 months ago (2013-05-21 18:59:36 UTC) #18
mnaganov (inactive)
https://codereview.chromium.org/14813025/diff/88001/Source/core/page/Settings.h File Source/core/page/Settings.h (right): https://codereview.chromium.org/14813025/diff/88001/Source/core/page/Settings.h#newcode181 Source/core/page/Settings.h:181: bool m_useWideViewport : 1; You should also add them ...
7 years, 7 months ago (2013-05-24 09:26:37 UTC) #19
mnaganov (inactive)
https://codereview.chromium.org/14813025/diff/88001/Source/core/page/Settings.h File Source/core/page/Settings.h (right): https://codereview.chromium.org/14813025/diff/88001/Source/core/page/Settings.h#newcode181 Source/core/page/Settings.h:181: bool m_useWideViewport : 1; On 2013/05/24 09:26:38, Mikhail Naganov ...
7 years, 7 months ago (2013-05-24 09:29:26 UTC) #20
aelias_OOO_until_Jul13
Adam, I needed to add side effects to the useWideViewport and loadWithOverviewMode settings changes because ...
7 years, 7 months ago (2013-05-24 20:59:23 UTC) #21
abarth-chromium
Yeah.
7 years, 7 months ago (2013-05-24 21:01:50 UTC) #22
aelias_OOO_until_Jul13
Thanks. Layout test bots look as green as they'll get, relanding.
7 years, 7 months ago (2013-05-24 21:04:13 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/aelias@chromium.org/14813025/88001
7 years, 7 months ago (2013-05-24 21:04:28 UTC) #24
commit-bot: I haz the power
7 years, 7 months ago (2013-05-24 21:05:58 UTC) #25
Message was sent while issue was closed.
Change committed as 151134

Powered by Google App Engine
This is Rietveld 408576698