2009-02-28 Dimitri Glazkov <dglazkov@chromium.org>
authordglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Mar 2009 04:27:50 +0000 (04:27 +0000)
committerdglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Mar 2009 04:27:50 +0000 (04:27 +0000)
        Reviewed by Darin Fisher.

        https://bugs.webkit.org/show_bug.cgi?id=24261
        Fix V8 custom binding scrubbing error.

        Test: fast/dom/CSSStyleDeclaration/css-properties-case-sensitive.html

        * WebCore.xcodeproj/project.pbxproj:
        * bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp:
        (WebCore::cssPropertyName):  Remove dubious checks, left over from
            incomplete conversion of parameter from pointer to pass-by-ref.
        (WebCore::NAMED_PROPERTY_GETTER): Initialize parameter.
        (WebCore::NAMED_PROPERTY_SETTER): Ditto.

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

WebCore/ChangeLog
WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp

index 833aec3..1161fe3 100644 (file)
@@ -1,3 +1,19 @@
+2009-02-28  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        https://bugs.webkit.org/show_bug.cgi?id=24261
+        Fix V8 custom binding scrubbing error.
+
+        Test: fast/dom/CSSStyleDeclaration/css-properties-case-sensitive.html
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp:
+        (WebCore::cssPropertyName):  Remove dubious checks, left over from
+            incomplete conversion of parameter from pointer to pass-by-ref.
+        (WebCore::NAMED_PROPERTY_GETTER): Initialize parameter.
+        (WebCore::NAMED_PROPERTY_SETTER): Ditto.
+
 2009-02-28  Xan Lopez  <xan@gnome.org>
 
         Reviewed by Holger Freyther.
index 7bef41d..c86f924 100644 (file)
@@ -88,8 +88,7 @@ static bool hasCSSPropertyNamePrefix(const String& propertyName, const char* pre
 // not the property name was prefixed with 'pos-' or 'pixel-'.
 static String cssPropertyName(const String& propertyName, bool& hadPixelOrPosPrefix)
 {
-    if (hadPixelOrPosPrefix)
-        hadPixelOrPosPrefix = false;
+    hadPixelOrPosPrefix = false;
 
     unsigned length = propertyName.length();
     if (!length)
@@ -104,20 +103,16 @@ static String cssPropertyName(const String& propertyName, bool& hadPixelOrPosPre
         i += 3;
     else if (hasCSSPropertyNamePrefix(propertyName, "pixel")) {
         i += 5;
-        if (hadPixelOrPosPrefix)
-            hadPixelOrPosPrefix = true;
+        hadPixelOrPosPrefix = true;
     } else if (hasCSSPropertyNamePrefix(propertyName, "pos")) {
         i += 3;
-        if (hadPixelOrPosPrefix)
-            hadPixelOrPosPrefix = true;
+        hadPixelOrPosPrefix = true;
     } else if (hasCSSPropertyNamePrefix(propertyName, "webkit")
             || hasCSSPropertyNamePrefix(propertyName, "khtml")
             || hasCSSPropertyNamePrefix(propertyName, "apple"))
         name.append('-');
-    else {
-        if (WTF::isASCIIUpper(propertyName[0]))
-            return String();
-    }
+    else if (WTF::isASCIIUpper(propertyName[0]))
+        return String();
 
     name.append(WTF::toASCIILower(propertyName[i++]));
 
@@ -144,7 +139,7 @@ NAMED_PROPERTY_GETTER(CSSStyleDeclaration)
     // Search the style declaration.
     CSSStyleDeclaration* imp = V8Proxy::ToNativeObject<CSSStyleDeclaration>(V8ClassIndex::CSSSTYLEDECLARATION, info.Holder());
 
-    bool hadPixelOrPosPrefix;
+    bool hadPixelOrPosPrefix = false;
     String propertyName = cssPropertyName(toWebCoreString(name), hadPixelOrPosPrefix);
 
     // Do not handle non-property names.
@@ -176,7 +171,7 @@ NAMED_PROPERTY_SETTER(CSSStyleDeclaration)
     INC_STATS("DOM.CSSStyleDeclaration.NamedPropertySetter");
     CSSStyleDeclaration* imp = V8Proxy::ToNativeObject<CSSStyleDeclaration>(V8ClassIndex::CSSSTYLEDECLARATION, info.Holder());
 
-    bool hadPixelOrPosPrefix;
+    bool hadPixelOrPosPrefix = false;
     String prop = cssPropertyName(toWebCoreString(name), hadPixelOrPosPrefix);
     if (!CSSStyleDeclaration::isPropertyName(prop))
         return notHandledByInterceptor();