Title: [171352] trunk/Source/WebKit2
Revision
171352
Author
benja...@webkit.org
Date
2014-07-22 12:25:45 -0700 (Tue, 22 Jul 2014)

Log Message

[iOS][WK2] UI helpers that zoom on an element ignore the viewport's allowsUserScaling
https://bugs.webkit.org/show_bug.cgi?id=135140
<rdar://problem/17754921>

Patch by Benjamin Poulain <bpoul...@apple.com> on 2014-07-22
Reviewed by Tim Horton.

UIScrollView makes a difference between min/max zoom and allowUserScaling. To express that,
everything is set up on the LayerTransaction.

For zooming related helpers (find on page, double tap to zoom, etc), the min and max zoom
should be the actual min/max for the current page state.

This patch split the two explicitely.
For layer transactions, the values are taken from the viewport configuration directly.
For everything else, we should use minimumPageScaleFactor/maximumPageScaleFactor. Those two methods
have been updated to take into account allowsUserScaling.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::willCommitLayerTree):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::minimumPageScaleFactor):
(WebKit::WebPage::maximumPageScaleFactor):
(WebKit::WebPage::getAssistedNodeInformation):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (171351 => 171352)


--- trunk/Source/WebKit2/ChangeLog	2014-07-22 18:35:32 UTC (rev 171351)
+++ trunk/Source/WebKit2/ChangeLog	2014-07-22 19:25:45 UTC (rev 171352)
@@ -1,3 +1,29 @@
+2014-07-22  Benjamin Poulain  <bpoul...@apple.com>
+
+        [iOS][WK2] UI helpers that zoom on an element ignore the viewport's allowsUserScaling
+        https://bugs.webkit.org/show_bug.cgi?id=135140
+        <rdar://problem/17754921>
+
+        Reviewed by Tim Horton.
+
+        UIScrollView makes a difference between min/max zoom and allowUserScaling. To express that,
+        everything is set up on the LayerTransaction.
+
+        For zooming related helpers (find on page, double tap to zoom, etc), the min and max zoom
+        should be the actual min/max for the current page state.
+
+        This patch split the two explicitely.
+        For layer transactions, the values are taken from the viewport configuration directly.
+        For everything else, we should use minimumPageScaleFactor/maximumPageScaleFactor. Those two methods
+        have been updated to take into account allowsUserScaling.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::willCommitLayerTree):
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::minimumPageScaleFactor):
+        (WebKit::WebPage::maximumPageScaleFactor):
+        (WebKit::WebPage::getAssistedNodeInformation):
+
 2014-07-22  Shivakumar JM  <shiva...@samsung.com>
 
         Web Inspector: Fix unused parameter build warning

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (171351 => 171352)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2014-07-22 18:35:32 UTC (rev 171351)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2014-07-22 19:25:45 UTC (rev 171352)
@@ -2865,8 +2865,8 @@
     layerTransaction.setPageExtendedBackgroundColor(corePage()->pageExtendedBackgroundColor());
 #if PLATFORM(IOS)
     layerTransaction.setScaleWasSetByUIProcess(scaleWasSetByUIProcess());
-    layerTransaction.setMinimumScaleFactor(minimumPageScaleFactor());
-    layerTransaction.setMaximumScaleFactor(maximumPageScaleFactor());
+    layerTransaction.setMinimumScaleFactor(m_viewportConfiguration.minimumScale());
+    layerTransaction.setMaximumScaleFactor(m_viewportConfiguration.maximumScale());
     layerTransaction.setAllowsUserScaling(allowsUserScaling());
 #endif
 }

Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (171351 => 171352)


--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2014-07-22 18:35:32 UTC (rev 171351)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2014-07-22 19:25:45 UTC (rev 171352)
@@ -251,11 +251,15 @@
 
 double WebPage::minimumPageScaleFactor() const
 {
+    if (!m_viewportConfiguration.allowsUserScaling())
+        return m_page->pageScaleFactor();
     return m_viewportConfiguration.minimumScale();
 }
 
 double WebPage::maximumPageScaleFactor() const
 {
+    if (!m_viewportConfiguration.allowsUserScaling())
+        return m_page->pageScaleFactor();
     return m_viewportConfiguration.maximumScale();
 }
 
@@ -2024,8 +2028,8 @@
     } else
         information.elementRect = IntRect();
 
-    information.minimumScaleFactor = m_viewportConfiguration.minimumScale();
-    information.maximumScaleFactor = m_viewportConfiguration.maximumScale();
+    information.minimumScaleFactor = minimumPageScaleFactor();
+    information.maximumScaleFactor = maximumPageScaleFactor();
     information.allowsUserScaling = m_viewportConfiguration.allowsUserScaling();
     information.hasNextNode = hasFocusableElement(m_assistedNode.get(), m_page.get(), true);
     information.hasPreviousNode = hasFocusableElement(m_assistedNode.get(), m_page.get(), false);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to