Title: [194296] branches/safari-601.1.46-branch/Source

Diff

Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (194295 => 194296)


--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog	2015-12-18 22:34:49 UTC (rev 194295)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog	2015-12-18 23:05:50 UTC (rev 194296)
@@ -1,3 +1,25 @@
+2015-12-18  Matthew Hanson  <matthew_han...@apple.com>
+
+        Merge r194206. rdar://problem/23824469
+
+    2015-12-16  Simon Fraser  <simon.fra...@apple.com>
+
+            ViewportConfiguration functions should return a bool to say if anything changed
+            https://bugs.webkit.org/show_bug.cgi?id=152353
+
+            Reviewed by Tim Horton.
+
+            Rather than callers all checking whether setting ViewportConfiguration values
+            changes state, have its functions return a bool if the values change.
+
+            * page/ViewportConfiguration.cpp:
+            (WebCore::ViewportConfiguration::setContentsSize):
+            (WebCore::ViewportConfiguration::setMinimumLayoutSize):
+            (WebCore::ViewportConfiguration::setViewportArguments):
+            (WebCore::ViewportConfiguration::setCanIgnoreScalingConstraints):
+            * page/ViewportConfiguration.h:
+            (WebCore::ViewportConfiguration::setCanIgnoreScalingConstraints): Deleted.
+
 2015-12-18  Babak Shafiei  <bshaf...@apple.com>
 
         Merge r192582.

Modified: branches/safari-601.1.46-branch/Source/WebCore/page/ViewportConfiguration.cpp (194295 => 194296)


--- branches/safari-601.1.46-branch/Source/WebCore/page/ViewportConfiguration.cpp	2015-12-18 22:34:49 UTC (rev 194295)
+++ branches/safari-601.1.46-branch/Source/WebCore/page/ViewportConfiguration.cpp	2015-12-18 23:05:50 UTC (rev 194296)
@@ -66,33 +66,46 @@
     updateConfiguration();
 }
 
-void ViewportConfiguration::setContentsSize(const IntSize& contentSize)
+bool ViewportConfiguration::setContentsSize(const IntSize& contentSize)
 {
     if (m_contentSize == contentSize)
-        return;
+        return false;
 
     m_contentSize = contentSize;
     updateConfiguration();
+    return true;
 }
 
-void ViewportConfiguration::setMinimumLayoutSize(const FloatSize& minimumLayoutSize)
+bool ViewportConfiguration::setMinimumLayoutSize(const FloatSize& minimumLayoutSize)
 {
     if (m_minimumLayoutSize == minimumLayoutSize)
-        return;
+        return false;
 
     m_minimumLayoutSize = minimumLayoutSize;
     updateConfiguration();
+    return true;
 }
 
-void ViewportConfiguration::setViewportArguments(const ViewportArguments& viewportArguments)
+bool ViewportConfiguration::setViewportArguments(const ViewportArguments& viewportArguments)
 {
     if (m_viewportArguments == viewportArguments)
-        return;
+        return false;
 
     m_viewportArguments = viewportArguments;
     updateConfiguration();
+    return true;
 }
 
+bool ViewportConfiguration::setCanIgnoreScalingConstraints(bool canIgnoreScalingConstraints)
+{
+    if (canIgnoreScalingConstraints == m_canIgnoreScalingConstraints)
+        return false;
+    
+    m_canIgnoreScalingConstraints = canIgnoreScalingConstraints;
+    updateConfiguration();
+    return true;
+}
+
 IntSize ViewportConfiguration::layoutSize() const
 {
     return IntSize(layoutWidth(), layoutHeight());

Modified: branches/safari-601.1.46-branch/Source/WebCore/page/ViewportConfiguration.h (194295 => 194296)


--- branches/safari-601.1.46-branch/Source/WebCore/page/ViewportConfiguration.h	2015-12-18 22:34:49 UTC (rev 194295)
+++ branches/safari-601.1.46-branch/Source/WebCore/page/ViewportConfiguration.h	2015-12-18 23:05:50 UTC (rev 194296)
@@ -71,15 +71,15 @@
     WEBCORE_EXPORT void setDefaultConfiguration(const Parameters&);
 
     const IntSize& contentsSize() const { return m_contentSize; }
-    WEBCORE_EXPORT void setContentsSize(const IntSize&);
+    WEBCORE_EXPORT bool setContentsSize(const IntSize&);
 
     const FloatSize& minimumLayoutSize() const { return m_minimumLayoutSize; }
-    WEBCORE_EXPORT void setMinimumLayoutSize(const FloatSize&);
+    WEBCORE_EXPORT bool setMinimumLayoutSize(const FloatSize&);
 
     const ViewportArguments& viewportArguments() const { return m_viewportArguments; }
-    WEBCORE_EXPORT void setViewportArguments(const ViewportArguments&);
+    WEBCORE_EXPORT bool setViewportArguments(const ViewportArguments&);
 
-    void setCanIgnoreScalingConstraints(bool canIgnoreScalingConstraints) { m_canIgnoreScalingConstraints = canIgnoreScalingConstraints; }
+    WEBCORE_EXPORT bool setCanIgnoreScalingConstraints(bool);
     void setForceAlwaysUserScalable(bool forceAlwaysUserScalable) { m_forceAlwaysUserScalable = forceAlwaysUserScalable; }
 
     WEBCORE_EXPORT IntSize layoutSize() const;

Modified: branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog (194295 => 194296)


--- branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog	2015-12-18 22:34:49 UTC (rev 194295)
+++ branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog	2015-12-18 23:05:50 UTC (rev 194296)
@@ -1,3 +1,24 @@
+2015-12-18  Matthew Hanson  <matthew_han...@apple.com>
+
+        Merge r194206. rdar://problem/23824469
+
+    2015-12-16  Simon Fraser  <simon.fra...@apple.com>
+
+            ViewportConfiguration functions should return a bool to say if anything changed
+            https://bugs.webkit.org/show_bug.cgi?id=152353
+
+            Reviewed by Tim Horton.
+
+            Rather than callers all checking whether setting ViewportConfiguration values
+            changes state, have its functions return a bool if the values change.
+
+            * WebProcess/WebPage/WebPage.cpp:
+            (WebKit::WebPage::mainFrameDidLayout):
+            (WebKit::WebPage::didCommitLoad):
+            * WebProcess/WebPage/ios/WebPageIOS.mm:
+            (WebKit::WebPage::viewportPropertiesDidChange):
+            (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
+
 2015-12-09  Matthew Hanson  <matthew_han...@apple.com>
 
         Merge r192712. rdar://problem/23814340

Modified: branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (194295 => 194296)


--- branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2015-12-18 22:34:49 UTC (rev 194295)
+++ branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2015-12-18 23:05:50 UTC (rev 194296)
@@ -3511,10 +3511,8 @@
 #if PLATFORM(IOS)
     if (FrameView* frameView = mainFrameView()) {
         IntSize newContentSize = frameView->contentsSizeRespectingOverflow();
-        if (m_viewportConfiguration.contentsSize() != newContentSize) {
-            m_viewportConfiguration.setContentsSize(newContentSize);
+        if (m_viewportConfiguration.setContentsSize(newContentSize))
             viewportConfigurationChanged();
-        }
     }
     m_findController.redraw();
 #endif
@@ -4648,9 +4646,16 @@
 
     resetViewportDefaultConfiguration(frame);
     const Frame* coreFrame = frame->coreFrame();
-    m_viewportConfiguration.setContentsSize(coreFrame->view()->contentsSize());
-    m_viewportConfiguration.setViewportArguments(coreFrame->document()->viewportArguments());
-    viewportConfigurationChanged();
+    
+    bool viewportChanged = false;
+    if (m_viewportConfiguration.setContentsSize(coreFrame->view()->contentsSize()))
+        viewportChanged = true;
+
+    if (m_viewportConfiguration.setViewportArguments(coreFrame->document()->viewportArguments()))
+        viewportChanged = true;
+
+    if (viewportChanged)
+        viewportConfigurationChanged();
 #endif
 
 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)

Modified: branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (194295 => 194296)


--- branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2015-12-18 22:34:49 UTC (rev 194295)
+++ branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2015-12-18 23:05:50 UTC (rev 194296)
@@ -230,11 +230,8 @@
 
 void WebPage::viewportPropertiesDidChange(const ViewportArguments& viewportArguments)
 {
-    if (m_viewportConfiguration.viewportArguments() == viewportArguments)
-        return;
-
-    m_viewportConfiguration.setViewportArguments(viewportArguments);
-    viewportConfigurationChanged();
+    if (m_viewportConfiguration.setViewportArguments(viewportArguments))
+        viewportConfigurationChanged();
 }
 
 void WebPage::didReceiveMobileDocType(bool isMobileDoctype)
@@ -2550,8 +2547,9 @@
 void WebPage::setViewportConfigurationMinimumLayoutSize(const FloatSize& size)
 {
     resetTextAutosizingBeforeLayoutIfNeeded(m_viewportConfiguration.minimumLayoutSize(), size);
-    m_viewportConfiguration.setMinimumLayoutSize(size);
-    viewportConfigurationChanged();
+    
+    if (m_viewportConfiguration.setMinimumLayoutSize(size))
+        viewportConfigurationChanged();
 }
 
 void WebPage::setMaximumUnobscuredSize(const FloatSize& maximumUnobscuredSize)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to