WebCore:
authorddkilzer <ddkilzer@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Jul 2006 15:35:24 +0000 (15:35 +0000)
committerddkilzer <ddkilzer@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Jul 2006 15:35:24 +0000 (15:35 +0000)
        Reviewed by Darin.

        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9717
          Replace IDL ConvertUndefinedToTrue parameter attribute with Optional attribute

        No test added because there is no change in functionality.

        * bindings/js/kjs_binding.cpp: Removed valueToBooleanTreatUndefinedAsTrue() method.
        * bindings/js/kjs_binding.h: Ditto.
        * bindings/scripts/CodeGeneratorJS.pm: Removed support for ConvertUndefinedToTrue parameter attribute.
        * dom/Element.h: Set default value to true for scrollIntoView() and scrollIntoViewIfNeeded() arguments.
        * dom/Element.idl: Replaced ConvertUndefinedToTrue attribute with Optional attribute.
          Fixed name of scrollIntoViewIfNeeded() argument to match implementation.
        * page/DOMWindow.idl: Replaced ConvertUndefinedToTrue attribute with Optional attribute.

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

WebCore/ChangeLog
WebCore/bindings/js/kjs_binding.cpp
WebCore/bindings/js/kjs_binding.h
WebCore/bindings/scripts/CodeGeneratorJS.pm
WebCore/dom/Element.h
WebCore/dom/Element.idl
WebCore/page/DOMWindow.idl

index df1ca4321b702399ae714f7af27878548304ca74..46feb047bfd031d669c0b0bd213bd354fab31370 100644 (file)
@@ -1,3 +1,20 @@
+2006-07-25  David Kilzer  <ddkilzer@kilzer.net>
+
+        Reviewed by Darin.
+
+        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9717
+          Replace IDL ConvertUndefinedToTrue parameter attribute with Optional attribute
+
+        No test added because there is no change in functionality.
+
+        * bindings/js/kjs_binding.cpp: Removed valueToBooleanTreatUndefinedAsTrue() method.
+        * bindings/js/kjs_binding.h: Ditto.
+        * bindings/scripts/CodeGeneratorJS.pm: Removed support for ConvertUndefinedToTrue parameter attribute.
+        * dom/Element.h: Set default value to true for scrollIntoView() and scrollIntoViewIfNeeded() arguments.
+        * dom/Element.idl: Replaced ConvertUndefinedToTrue attribute with Optional attribute.
+          Fixed name of scrollIntoViewIfNeeded() argument to match implementation.
+        * page/DOMWindow.idl: Replaced ConvertUndefinedToTrue attribute with Optional attribute.
+
 2006-07-24  Dan Waylonis  <waylonis@google.com>
 
         Reviewed and tweaked a bunch by Darin.
index 8ffe17721e72358b807f051fa8f07790b7c02193..7ac73f0093e6d8077658eed16b789e2a287fb8ce 100644 (file)
@@ -281,13 +281,6 @@ String valueToStringWithNullCheck(ExecState* exec, JSValue* val)
     return val->toString(exec);
 }
 
-bool valueToBooleanTreatUndefinedAsTrue(ExecState* exec, JSValue* val)
-{
-    if (val->isUndefined())
-        return true;
-    return val->toBoolean(exec);
-}
-
 static const char * const exceptionNames[] = {
     0,
     "INDEX_SIZE_ERR",
index e9e2e19bd06657f8bbd1baa0026454c1a346da84..5c6436533e22711160975149e8a0f374a9eb3b2d 100644 (file)
@@ -161,8 +161,6 @@ namespace KJS {
    */
   WebCore::String valueToStringWithNullCheck(ExecState* exec, JSValue* val);
 
-  bool valueToBooleanTreatUndefinedAsTrue(ExecState* exec, JSValue* val);
-
   template <typename T> inline JSValue* toJS(ExecState* exec, PassRefPtr<T> ptr) { return toJS(exec, ptr.get()); }
   
 } // namespace
index 30a18ad8416aa8ac87258764824e2eb1093a9a8a..50123fdebf31bda96e43d2f2a0301a88265cb9b0 100644 (file)
@@ -1024,12 +1024,7 @@ sub JSValueToNative
     my $type = $codeGenerator->StripModule($signature->type);
     
     if ($type eq "boolean") {
-        my $conv = $signature->extendedAttributes->{"ConvertUndefinedToTrue"};
-        if (defined $conv) {
-            return "valueToBooleanTreatUndefinedAsTrue(exec, $value)";
-        } else {
-            return "$value->toBoolean(exec)";
-        }
+        return "$value->toBoolean(exec)";
     } elsif ($type eq "unsigned long" or
              $type eq "long" or
              $type eq "unsigned short") {
index 7db354d1a74f3058f2eb2fe4731fb93a44f95e12..d4c2d810ec3a0d66b358cfb3423ecf1c5abd2e15 100644 (file)
@@ -65,8 +65,8 @@ public:
     void setAttribute(const String& name, const String& value, ExceptionCode&);
     void setAttributeNS(const String& namespaceURI, const String& qualifiedName, const String& value, ExceptionCode&);
 
-    void scrollIntoView (bool alignToTop);
-    void scrollIntoViewIfNeeded(bool centerIfNeeded);
+    void scrollIntoView (bool alignToTop = true);
+    void scrollIntoViewIfNeeded(bool centerIfNeeded = true);
 
     void scrollByUnits(int units, ScrollGranularity granularity);
     void scrollByLines(int lines);
index fd17f1d89669e4d0d8e0465a773d0d1a4e67d19d..789ccf7b7587e1f99fef3c992a49dff05a6e662f 100644 (file)
@@ -102,7 +102,7 @@ module core {
 
         void blur();
 
-        void scrollIntoView(in [ConvertUndefinedToTrue] boolean alignWithTop);
+        void scrollIntoView(in [Optional] boolean alignWithTop);
 
         // IE extensions
 
@@ -114,7 +114,7 @@ module core {
 
         // WebKit extensions
 
-        void scrollIntoViewIfNeeded(in [ConvertUndefinedToTrue] boolean alignWithTop);
+        void scrollIntoViewIfNeeded(in [Optional] boolean centerIfNeeded);
 
         void scrollByLines(in long lines);
 
index bf038c3bd307e48dd34c74f1bdf71b7e28ddaf55..5ea98c549df0931a5c74d873366a7173793abb2d 100644 (file)
@@ -38,7 +38,7 @@ module window {
         // WebKit extensions
         CSSRuleList getMatchedCSSRules(in Element elt,
                                        in DOMString pseudoElt,
-                                       in [ConvertUndefinedToTrue] boolean authorOnly);
+                                       in [Optional] boolean authorOnly);
         readonly attribute double devicePixelRatio;
         
         // Global constructors