[iOS WK2] Fix assertion in ViewportConfiguration::setDefaultConfiguration seen in...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Oct 2015 18:36:49 +0000 (18:36 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Oct 2015 18:36:49 +0000 (18:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=149959

Reviewed by Tim Horton.

When loading tests which set a flexible viewport, ViewportConfiguration::setDefaultConfiguration()
is called first with testingParameters() and then with webpageParameters(). This
would trigger the assertion that m_defaultConfiguration.initialScaleIsSet but
the new initial scale is zero.

The assertion seems wrong anyway; it's consulting m_defaultConfiguration.initialScaleIsSet
but defaultConfiguration.initialScale, so fix it to test defaultConfiguration.initialScaleIsSet.

* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::setDefaultConfiguration):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190810 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/page/ViewportConfiguration.cpp

index fadb53c..c4a327d 100644 (file)
@@ -1,3 +1,21 @@
+2015-10-09  Simon Fraser  <simon.fraser@apple.com>
+
+        [iOS WK2] Fix assertion in ViewportConfiguration::setDefaultConfiguration seen in testing
+        https://bugs.webkit.org/show_bug.cgi?id=149959
+
+        Reviewed by Tim Horton.
+
+        When loading tests which set a flexible viewport, ViewportConfiguration::setDefaultConfiguration()
+        is called first with testingParameters() and then with webpageParameters(). This
+        would trigger the assertion that m_defaultConfiguration.initialScaleIsSet but
+        the new initial scale is zero.
+        
+        The assertion seems wrong anyway; it's consulting m_defaultConfiguration.initialScaleIsSet
+        but defaultConfiguration.initialScale, so fix it to test defaultConfiguration.initialScaleIsSet.
+
+        * page/ViewportConfiguration.cpp:
+        (WebCore::ViewportConfiguration::setDefaultConfiguration):
+
 2015-10-09  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         Fix the !ENABLE(STREAM_API) build after r190794
index 8d3397f..0c411b4 100644 (file)
@@ -58,7 +58,7 @@ ViewportConfiguration::ViewportConfiguration()
 void ViewportConfiguration::setDefaultConfiguration(const ViewportConfiguration::Parameters& defaultConfiguration)
 {
     ASSERT(!constraintsAreAllRelative(m_configuration));
-    ASSERT(!m_defaultConfiguration.initialScaleIsSet || defaultConfiguration.initialScale > 0);
+    ASSERT(!defaultConfiguration.initialScaleIsSet || defaultConfiguration.initialScale > 0);
     ASSERT(defaultConfiguration.minimumScale > 0);
     ASSERT(defaultConfiguration.maximumScale >= defaultConfiguration.minimumScale);