WindowFeatures.{x|y|width|height} are not initialized
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Mar 2014 17:36:57 +0000 (17:36 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Mar 2014 17:36:57 +0000 (17:36 +0000)
<http://webkit.org/b/130547>
<rdar://problem/16383151>

Reviewed by Darin Adler.

Based on a Blink patch in CRBug 342591 by zhaoqin.

* page/WindowFeatures.cpp:
(WebCore::WindowFeatures::WindowFeatures):
- Initialize x, y, width, height in String constructor.
- Move 'resizeable' variable to short-hand initialization since
  it is true in both cases.
- Use String::isEmpty() instead of checking its length.
* page/WindowFeatures.h:
(WebCore::WindowFeatures::WindowFeatures): Initialize x, y,
width, height in no-argument constructor.

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

Source/WebCore/ChangeLog
Source/WebCore/page/WindowFeatures.cpp
Source/WebCore/page/WindowFeatures.h

index 5d05f63d7cc3a3c3ea1959fbd1900560cf56fe60..1e09e9ca79b205f46ad019adaf3f5b83fc66b315 100644 (file)
@@ -1,3 +1,23 @@
+2014-03-21  David Kilzer  <ddkilzer@apple.com>
+
+        WindowFeatures.{x|y|width|height} are not initialized
+        <http://webkit.org/b/130547>
+        <rdar://problem/16383151>
+
+        Reviewed by Darin Adler.
+
+        Based on a Blink patch in CRBug 342591 by zhaoqin.
+
+        * page/WindowFeatures.cpp:
+        (WebCore::WindowFeatures::WindowFeatures):
+        - Initialize x, y, width, height in String constructor.
+        - Move 'resizeable' variable to short-hand initialization since
+          it is true in both cases.
+        - Use String::isEmpty() instead of checking its length.
+        * page/WindowFeatures.h:
+        (WebCore::WindowFeatures::WindowFeatures): Initialize x, y,
+        width, height in no-argument constructor.
+
 2014-03-21  Sergio Villar Senin  <svillar@igalia.com>
 
         Replace DEPRECATED_DEFINE_STATIC_LOCAL by static NeverDestroyed<T> in bridge/
index d93420161a103e0f35f7ec1330bdb855828c5213..0517bdb4a5de03a1eaf21ef05c3120912e817199 100644 (file)
@@ -37,10 +37,15 @@ static bool isWindowFeaturesSeparator(UChar c)
 }
 
 WindowFeatures::WindowFeatures(const String& features)
-    : xSet(false)
+    : x(0)
+    , xSet(false)
+    , y(0)
     , ySet(false)
+    , width(0)
     , widthSet(false)
+    , height(0)
     , heightSet(false)
+    , resizable(true)
     , fullscreen(false)
     , dialog(false)
 {
@@ -53,13 +58,12 @@ WindowFeatures::WindowFeatures(const String& features)
      We always allow a window to be resized, which is consistent with Firefox.
      */
 
-    if (features.length() == 0) {
+    if (features.isEmpty()) {
         menuBarVisible = true;
         statusBarVisible = true;
         toolBarVisible = true;
         locationBarVisible = true;
         scrollbarsVisible = true;
-        resizable = true;
         return;
     }
 
@@ -68,7 +72,6 @@ WindowFeatures::WindowFeatures(const String& features)
     toolBarVisible = false;
     locationBarVisible = false;
     scrollbarsVisible = false;
-    resizable = true;
 
     // Tread lightly in this code -- it was specifically designed to mimic Win IE's parsing behavior.
     int keyBegin, keyEnd;
index 1fceee555155a22d9438b1e27403d8da6e100e56..6c872e226a8ffc5b1f2a8aad75a2027164356a2b 100644 (file)
@@ -38,9 +38,13 @@ class FloatRect;
 
 struct WindowFeatures {
     WindowFeatures()
-        : xSet(false)
+        : x(0)
+        , xSet(false)
+        , y(0)
         , ySet(false)
+        , width(0)
         , widthSet(false)
+        , height(0)
         , heightSet(false)
         , menuBarVisible(true)
         , statusBarVisible(true)