WebKit Bugzilla
Attachment 369203 Details for
Bug 197638
: _overrideViewportWithArguments does not work when called before loading
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-197638-20190506164336.patch (text/plain), 8.75 KB, created by
Tim Horton
on 2019-05-06 16:43:37 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Tim Horton
Created:
2019-05-06 16:43:37 PDT
Size:
8.75 KB
patch
obsolete
>Subversion Revision: 244966 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c6c1f7679f545d94a40166b2a4b7d364ff85b7b1..b514148cd61efaec1dd0046ab38db985b045076e 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2019-05-06 Tim Horton <timothy_horton@apple.com> >+ >+ _overrideViewportWithArguments does not work when called before loading >+ https://bugs.webkit.org/show_bug.cgi?id=197638 >+ <rdar://problem/50505111> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * dom/Document.cpp: >+ (WebCore::Document::viewportArguments const): >+ (WebCore::Document::updateViewportArguments): >+ (WebCore::Document::setOverrideViewportArguments): Deleted. >+ * dom/Document.h: >+ (WebCore::Document::viewportArguments const): Deleted. >+ * page/Page.cpp: >+ (WebCore::Page::setOverrideViewportArguments): >+ * page/Page.h: >+ (WebCore::Page::overrideViewportArguments const): >+ * page/ViewportConfiguration.cpp: >+ (WebCore::ViewportConfiguration::setViewportArguments): >+ Move overrideViewportArguments to Page, since it is view-global in the API. >+ > 2019-05-06 Zan Dobersek <zdobersek@igalia.com> > > [GLib] WebCore::MainThreadSharedTimer should use the appropriate GSource priority, name >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index c7fe70b3fbeb31c435e1db53999dde573ddfdab8..818ac69bb596c8976989e1e74225213efc7d649d 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,14 @@ >+2019-05-06 Tim Horton <timothy_horton@apple.com> >+ >+ _overrideViewportWithArguments does not work when called before loading >+ https://bugs.webkit.org/show_bug.cgi?id=197638 >+ <rdar://problem/50505111> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebProcess/WebPage/ios/WebPageIOS.mm: >+ (WebKit::WebPage::setOverrideViewportArguments): >+ > 2019-05-06 Wenson Hsieh <wenson_hsieh@apple.com> > > Introduce SPI to request modern compatibility mode but defer to site-specific quirks >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index 9136d9cf78c5c109605c39b54b0a0f6a3fd9c230..a5c289fb68d2dbf782c5b0015e44b3a786a6329e 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -3554,15 +3554,6 @@ void Document::dispatchDisabledAdaptationsDidChangeForMainFrame() > page()->chrome().dispatchDisabledAdaptationsDidChange(m_disabledAdaptations); > } > >-void Document::setOverrideViewportArguments(const Optional<ViewportArguments>& viewportArguments) >-{ >- if (viewportArguments == m_overrideViewportArguments) >- return; >- >- m_overrideViewportArguments = viewportArguments; >- updateViewportArguments(); >-} >- > void Document::processViewport(const String& features, ViewportArguments::Type origin) > { > ASSERT(!features.isNull()); >@@ -3583,6 +3574,14 @@ void Document::processViewport(const String& features, ViewportArguments::Type o > updateViewportArguments(); > } > >+ViewportArguments Document::viewportArguments() const >+{ >+ auto* page = this->page(); >+ if (!page) >+ return m_viewportArguments; >+ return page->overrideViewportArguments().valueOr(m_viewportArguments); >+} >+ > void Document::updateViewportArguments() > { > if (page() && frame()->isMainFrame()) { >diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h >index 941d5f5dbdf53ff042aad02301c256c6e62d0dc5..820401a5bd2eea1e44e901400b1fdb9aa501e670 100644 >--- a/Source/WebCore/dom/Document.h >+++ b/Source/WebCore/dom/Document.h >@@ -411,9 +411,7 @@ public: > void clearSelectorQueryCache(); > > void setViewportArguments(const ViewportArguments& viewportArguments) { m_viewportArguments = viewportArguments; } >- ViewportArguments viewportArguments() const { return m_overrideViewportArguments.valueOr(m_viewportArguments); } >- >- WEBCORE_EXPORT void setOverrideViewportArguments(const Optional<ViewportArguments>&); >+ WEBCORE_EXPORT ViewportArguments viewportArguments() const; > > OptionSet<DisabledAdaptations> disabledAdaptations() const { return m_disabledAdaptations; } > #ifndef NDEBUG >@@ -1827,7 +1825,6 @@ private: > Timer m_loadEventDelayTimer; > > ViewportArguments m_viewportArguments; >- Optional<ViewportArguments> m_overrideViewportArguments; > OptionSet<DisabledAdaptations> m_disabledAdaptations; > > DocumentTiming m_documentTiming; >diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp >index 067c341135314619b9f2330bf6995ade1d75406c..c9e7722e3410e09bbdba91725c5fbd4b8b31215d 100644 >--- a/Source/WebCore/page/Page.cpp >+++ b/Source/WebCore/page/Page.cpp >@@ -400,6 +400,16 @@ ViewportArguments Page::viewportArguments() const > return mainFrame().document() ? mainFrame().document()->viewportArguments() : ViewportArguments(); > } > >+void Page::setOverrideViewportArguments(const Optional<ViewportArguments>& viewportArguments) >+{ >+ if (viewportArguments == m_overrideViewportArguments) >+ return; >+ >+ m_overrideViewportArguments = viewportArguments; >+ if (auto* document = mainFrame().document()) >+ document->updateViewportArguments(); >+} >+ > ScrollingCoordinator* Page::scrollingCoordinator() > { > if (!m_scrollingCoordinator && m_settings->scrollingCoordinatorEnabled()) { >diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h >index 666144b2a038f3df374a1b5bfe8fae3ee052e714..fcf3f77590f6a69213c80c5b0e7b6269c31d9883 100644 >--- a/Source/WebCore/page/Page.h >+++ b/Source/WebCore/page/Page.h >@@ -193,6 +193,9 @@ public: > WEBCORE_EXPORT OptionSet<DisabledAdaptations> disabledAdaptations() const; > WEBCORE_EXPORT ViewportArguments viewportArguments() const; > >+ const Optional<ViewportArguments>& overrideViewportArguments() const { return m_overrideViewportArguments; } >+ WEBCORE_EXPORT void setOverrideViewportArguments(const Optional<ViewportArguments>&); >+ > static void refreshPlugins(bool reload); > WEBCORE_EXPORT PluginData& pluginData(); > void clearPluginData(); >@@ -978,6 +981,8 @@ private: > Optional<ApplicationManifest> m_applicationManifest; > #endif > >+ Optional<ViewportArguments> m_overrideViewportArguments; >+ > bool m_shouldEnableICECandidateFilteringByDefault { true }; > bool m_mediaPlaybackIsSuspended { false }; > bool m_mediaBufferingIsSuspended { false }; >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index 0af2392f9063603ff8b189aad40a489e8fec2bc7..c2db1f5b30b3c70e1993fe65d63e13581c2f8568 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -2829,8 +2829,7 @@ void WebPage::setDeviceOrientation(int32_t deviceOrientation) > > void WebPage::setOverrideViewportArguments(const Optional<WebCore::ViewportArguments>& arguments) > { >- if (auto* document = m_page->mainFrame().document()) >- document->setOverrideViewportArguments(arguments); >+ m_page->setOverrideViewportArguments(arguments); > } > > void WebPage::resetTextAutosizing() >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 806e0b1b8cae70cb16c736727c8602b758e4da26..3d6f10010c27348a73eca406d5ddb7ea42f451b9 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,14 @@ >+2019-05-06 Tim Horton <timothy_horton@apple.com> >+ >+ _overrideViewportWithArguments does not work when called before loading >+ https://bugs.webkit.org/show_bug.cgi?id=197638 >+ <rdar://problem/50505111> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestWebKitAPI/Tests/WebKitCocoa/OverrideViewportArguments.mm: >+ (TEST): >+ > 2019-05-04 Alex Christensen <achristensen@webkit.org> > > Revert r244953 and r244954 because they broke internal builds. >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/OverrideViewportArguments.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/OverrideViewportArguments.mm >index a976ebaed57cdc5a0afce47f1c3c1344d30134c2..b9de1f1d132555bc80e4f041b868de2d5caafc23 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/OverrideViewportArguments.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/OverrideViewportArguments.mm >@@ -75,6 +75,14 @@ TEST(WebKit, OverrideViewportArguments) > > setViewport(@{ @"width" : @"500", @"initial-scale": @"1", @"garbage": @"nonsense" }); > EXPECT_WK_STREQ("500", bodyWidth()); >+ >+ // Call overrideViewportWithArguments before loading anything in the >+ // view and ensure it is respected. >+ webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 20, 20)]); >+ setViewport(@{ @"width" : @"1000", @"initial-scale": @"1" }); >+ [webView synchronouslyLoadHTMLString:@"<meta name='viewport' content='initial-scale=1'><div id='divWithViewportUnits' style='width: 100vw;'></div>"]; >+ EXPECT_WK_STREQ("1000", bodyWidth()); >+ EXPECT_EQ(1., [webView scrollView].zoomScale); > } > > #endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197638
: 369203