Title: [120874] trunk/Source
Revision
120874
Author
[email protected]
Date
2012-06-20 15:35:33 -0700 (Wed, 20 Jun 2012)

Log Message

Add a != operator to ViewportArguments
https://bugs.webkit.org/show_bug.cgi?id=87505

Reviewed by Antonio Gomes.
Patch by Jacky Jiang  <[email protected]>

Source/WebCore:

Add a != operator to ViewportArguments for convenience.

* dom/ViewportArguments.h:
(ViewportArguments):
(WebCore::ViewportArguments::operator!=):

Source/WebKit/blackberry:

Use != operator of ViewportArguments.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::setLoadState):
(BlackBerry::WebKit::WebPagePrivate::setViewportSize):
* Api/WebViewportArguments.cpp:
(BlackBerry::WebKit::WebViewportArguments::operator!=):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (120873 => 120874)


--- trunk/Source/WebCore/ChangeLog	2012-06-20 22:25:12 UTC (rev 120873)
+++ trunk/Source/WebCore/ChangeLog	2012-06-20 22:35:33 UTC (rev 120874)
@@ -1,3 +1,17 @@
+2012-06-20  Jacky Jiang  <[email protected]>
+
+        Add a != operator to ViewportArguments
+        https://bugs.webkit.org/show_bug.cgi?id=87505
+
+        Reviewed by Antonio Gomes.
+        Patch by Jacky Jiang  <[email protected]>
+
+        Add a != operator to ViewportArguments for convenience.
+
+        * dom/ViewportArguments.h:
+        (ViewportArguments):
+        (WebCore::ViewportArguments::operator!=):
+
 2012-06-20  Ryosuke Niwa  <[email protected]>
 
         Let XCode have its own way.

Modified: trunk/Source/WebCore/dom/ViewportArguments.h (120873 => 120874)


--- trunk/Source/WebCore/dom/ViewportArguments.h	2012-06-20 22:25:12 UTC (rev 120873)
+++ trunk/Source/WebCore/dom/ViewportArguments.h	2012-06-20 22:35:33 UTC (rev 120874)
@@ -107,6 +107,11 @@
             && height == other.height
             && userScalable == other.userScalable;
     }
+
+    bool operator!=(const ViewportArguments& other) const
+    {
+        return !(*this == other);
+    }
 };
 
 ViewportAttributes computeViewportAttributes(ViewportArguments args, int desktopWidth, int deviceWidth, int deviceHeight, int deviceDPI, IntSize visibleViewport);

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (120873 => 120874)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-06-20 22:25:12 UTC (rev 120873)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-06-20 22:35:33 UTC (rev 120874)
@@ -980,7 +980,7 @@
             static ViewportArguments defaultViewportArguments;
             bool documentHasViewportArguments = false;
             FrameLoadType frameLoadType = FrameLoadTypeStandard;
-            if (m_mainFrame && m_mainFrame->document() && !(m_mainFrame->document()->viewportArguments() == defaultViewportArguments))
+            if (m_mainFrame && m_mainFrame->document() && m_mainFrame->document()->viewportArguments() != defaultViewportArguments)
                 documentHasViewportArguments = true;
             if (m_mainFrame && m_mainFrame->loader())
                 frameLoadType = m_mainFrame->loader()->loadType();
@@ -3668,7 +3668,7 @@
 
     // Recompute our virtual viewport.
     static ViewportArguments defaultViewportArguments;
-    if (!(m_viewportArguments == defaultViewportArguments)) {
+    if (m_viewportArguments != defaultViewportArguments) {
         // We may need to infer the width and height for the viewport with respect to the rotation.
         IntSize newVirtualViewport = recomputeVirtualViewportFromViewportArguments();
         ASSERT(!newVirtualViewport.isEmpty());

Modified: trunk/Source/WebKit/blackberry/Api/WebViewportArguments.cpp (120873 => 120874)


--- trunk/Source/WebKit/blackberry/Api/WebViewportArguments.cpp	2012-06-20 22:25:12 UTC (rev 120873)
+++ trunk/Source/WebKit/blackberry/Api/WebViewportArguments.cpp	2012-06-20 22:35:33 UTC (rev 120874)
@@ -111,7 +111,7 @@
 
 bool WebViewportArguments::operator!=(const WebViewportArguments& other)
 {
-    return !(*this == other);
+    return *d != *(other.d);
 }
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/blackberry/ChangeLog (120873 => 120874)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-06-20 22:25:12 UTC (rev 120873)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-06-20 22:35:33 UTC (rev 120874)
@@ -1,3 +1,19 @@
+2012-06-20  Jacky Jiang  <[email protected]>
+
+        Add a != operator to ViewportArguments
+        https://bugs.webkit.org/show_bug.cgi?id=87505
+
+        Reviewed by Antonio Gomes.
+        Patch by Jacky Jiang  <[email protected]>
+
+        Use != operator of ViewportArguments.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::setLoadState):
+        (BlackBerry::WebKit::WebPagePrivate::setViewportSize):
+        * Api/WebViewportArguments.cpp:
+        (BlackBerry::WebKit::WebViewportArguments::operator!=):
+
 2012-06-20  Christopher Hutten-Czapski  <[email protected]>
 
         [BlackBerry] Add an API to immediately enable cross-site XHR
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to