WebCore:
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Feb 2008 17:23:50 +0000 (17:23 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Feb 2008 17:23:50 +0000 (17:23 +0000)
        Reviewed by Geoff.

        - fix <rdar://problem/5715692> REGRESSION (r28570): JavaScript window.scrollTo()
          calls no longer accept 'undefined' values

        By default, we should accept non-numeric parameters and non-integral numbers for
        parameters that expect integers, without throwing exceptions.

        While creating the test for this, I ran into a couple minor bugs with the
        functions involved, and this patch fixes those too.

        Test: fast/dom/non-numeric-values-numeric-parameters.html

        * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
        (WebCore::JSHTMLOptionsCollection::add): Added. This function has unusual behavior
        when passed non-integral values for its second parameter, so it needs to be written
        by hand. I think that [Custom] is better here than inventing a new keyword.

        * bindings/scripts/CodeGeneratorJS.pm: Changed default for "long" and "unsigned long"
        to ignore errors rather than failing due to type differences. Also changed a couple
        functions to use hashes.

        * css/CSSStyleSheet.h:
        (WebCore::CSSStyleSheet::removeRule): Remove overload of removeRule without a second
        parameters. While we do allow this from JavaScript, it's not a true optional parameter,
        but rather just a case of "you can omit parameters and they are treated as undefined"
        combined with "undefined turns into 0 when passed to a function that takes an integer".
        * css/CSSStyleSheet.idl: Removed [Optional] on the index parameter for removeRule.
        This is not truly an optional parameter.

        * dom/ProgressEvent.cpp:
        (WebCore::ProgressEvent::initProgressEvent): Updated this function to match other
        DOM event init functions -- important to do nothing if this is called on the an
        already-dispatched event and we need to respect the bubble and cancelable arguments.
        Also removed initProgressEventNS. We don't support namespaced events, and if we add
        support, it should be across all event classes, not just ProgressEvent.
        * dom/ProgressEvent.h: Removed initProgressEventNS.
        * dom/ProgressEvent.idl: Ditto.

        * dom/Range.cpp:
        (WebCore::Range::createContextualFragment): Added a check for 0. This can happen
        if the passed-in start container is a node that's not an HTML element and also
        does not have a parent.

        * html/HTMLOptionsCollection.idl: Added the [Custom] attribute to add, since the
        rules for processing its parameters are unusual.

        * page/DOMSelection.cpp: Removed the version of setPosition that has only
        one parameter. The offset is not really optional.
        * page/DOMSelection.h: Ditto.
        * page/DOMSelection.idl: Removed the [Optional] keyword for the second parameter of
        setPosition. It's not a true optional parameter (see discussion of removeRule above).

        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::adjustWindowRect): Simplified logic for constraining the X
        and Y coordinates, in a way that makes them work even when the window coordinates
        are infinite. Also strengthened the assertion.

WebKitTools:

        Reviewed by Geoff.

        * Scripts/make-js-test-wrappers: Look at the whole LayoutTests tree, not just the fast
        and svg subdirectories. Added some more exceptions for the benefit of the fast/dom
        subdirectory.

LayoutTests:

        Reviewed by Geoff.

        - test for <rdar://problem/5715692> REGRESSION (r28570): JavaScript window.scrollTo() calls
          no longer accept 'undefined' values

        * fast/dom/non-numeric-values-numeric-parameters-expected.txt: Added.
        * fast/dom/non-numeric-values-numeric-parameters.html: Added.
        * fast/dom/resources/TEMPLATE.html: Copied from fast/dom/Element/resources/TEMPLATE.html.
        * fast/dom/resources/non-numeric-values-numeric-parameters.js: Added.

        * editing/selection/extend-expected.txt: Updated.
        * editing/selection/extend.html: Removed test that extend throws if passed only one parameter.
        There's no reason for us to be strict about this -- we generally treat missing parameters the
        same as if "undefined" had been passed with few exceptions.

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

23 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/selection/extend-expected.txt
LayoutTests/editing/selection/extend.html
LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/non-numeric-values-numeric-parameters.html [new file with mode: 0644]
LayoutTests/fast/dom/resources/TEMPLATE.html [new file with mode: 0644]
LayoutTests/fast/dom/resources/non-numeric-values-numeric-parameters.js [new file with mode: 0644]
WebCore/ChangeLog
WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
WebCore/bindings/scripts/CodeGeneratorJS.pm
WebCore/css/CSSStyleSheet.h
WebCore/css/CSSStyleSheet.idl
WebCore/dom/ProgressEvent.cpp
WebCore/dom/ProgressEvent.h
WebCore/dom/ProgressEvent.idl
WebCore/dom/Range.cpp
WebCore/html/HTMLOptionsCollection.idl
WebCore/page/DOMSelection.cpp
WebCore/page/DOMSelection.h
WebCore/page/DOMSelection.idl
WebCore/page/DOMWindow.cpp
WebKitTools/ChangeLog
WebKitTools/Scripts/make-js-test-wrappers

index f61de13..d6719bd 100644 (file)
@@ -1,3 +1,20 @@
+2008-02-04  Darin Adler  <darin@apple.com>
+
+        Reviewed by Geoff.
+
+        - test for <rdar://problem/5715692> REGRESSION (r28570): JavaScript window.scrollTo() calls
+          no longer accept 'undefined' values
+
+        * fast/dom/non-numeric-values-numeric-parameters-expected.txt: Added.
+        * fast/dom/non-numeric-values-numeric-parameters.html: Added.
+        * fast/dom/resources/TEMPLATE.html: Copied from fast/dom/Element/resources/TEMPLATE.html.
+        * fast/dom/resources/non-numeric-values-numeric-parameters.js: Added.
+
+        * editing/selection/extend-expected.txt: Updated.
+        * editing/selection/extend.html: Removed test that extend throws if passed only one parameter.
+        There's no reason for us to be strict about this -- we generally treat missing parameters the
+        same as if "undefined" had been passed with few exceptions.
+
 2008-02-03  Oliver Hunt  <oliver@apple.com>
 
         RS=Eric.
index 8acf2fd..0a45cfe 100644 (file)
@@ -5,5 +5,4 @@ Success: s.extend(span2.firstChild, -1) raised Error: INDEX_SIZE_ERR: DOM Except
 Success: window.getSelection() is b.
 Success: window.getSelection() is arbaz.
 Success: s.extend() raised Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-Success: s.extend(span3) raised Error: TYPE_MISMATCH_ERR: DOM Exception 17.
 Success: s.extend(null, 0) raised Error: TYPE_MISMATCH_ERR: DOM Exception 17.
index 57b86f3..311f15f 100644 (file)
@@ -56,7 +56,6 @@ s.extend(span3, 1);
 shouldBe('window.getSelection()', 'arbaz');
 
 shouldThrow('s.extend()');
-shouldThrow('s.extend(span3)');
 shouldThrow('s.extend(null, 0)');
 
 </script>
diff --git a/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt b/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt
new file mode 100644 (file)
index 0000000..68b5b67
--- /dev/null
@@ -0,0 +1,87 @@
+This tests the behavior of non-numeric values in contexts where the DOM has a numeric parameter.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS nonNumericPolicy('document.createTextNode("a").substringData(x, 0)') is 'any type allowed'
+PASS nonNumericPolicy('document.createTextNode("a").substringData(0, x)') is 'any type allowed'
+PASS nonNumericPolicy('document.createTextNode("a").insertData(x, "b")') is 'any type allowed'
+PASS nonNumericPolicy('document.createTextNode("a").deleteData(x, 0)') is 'any type allowed'
+PASS nonNumericPolicy('document.createTextNode("a").deleteData(0, x)') is 'any type allowed'
+PASS nonNumericPolicy('document.createTextNode("a").replaceData(x, 0, "b")') is 'any type allowed'
+PASS nonNumericPolicy('document.createTextNode("a").replaceData(0, x, "b")') is 'any type allowed'
+PASS nonNumericPolicy('createCSSMediaRule().insertRule(ruleText, x)') is 'any type allowed'
+PASS nonNumericPolicy('createCSSMediaRule().deleteRule(x)') is 'any type allowed'
+PASS nonNumericPolicy('createCSSRuleList().item(x)') is 'any type allowed'
+PASS nonNumericPolicy('createCSSStyleDeclaration().item(x)') is 'any type allowed'
+PASS nonNumericPolicy('createCSSStyleSheet().insertRule(ruleText, x)') is 'any type allowed'
+PASS nonNumericPolicy('createCSSStyleSheet().deleteRule(x)') is 'any type allowed'
+PASS nonNumericPolicy('createCSSStyleSheet().addRule(selector, styleText, x)') is 'any type allowed'
+PASS nonNumericPolicy('createCSSStyleSheet().removeRule(x)') is 'any type allowed'
+PASS nonNumericPolicy('createCSSValueList().item(x)') is 'any type allowed'
+PASS nonNumericPolicy('document.elementFromPoint(x, 0)') is 'any type allowed'
+PASS nonNumericPolicy('document.elementFromPoint(0, x)') is 'any type allowed'
+PASS nonNumericPolicy('document.body.scrollByLines(x)') is 'any type allowed'
+PASS nonNumericPolicy('document.body.scrollByPages(x)') is 'any type allowed'
+PASS nonNumericPolicy('document.body.scrollLeft = x') is 'any type allowed'
+PASS nonNumericPolicy('document.body.scrollTop = x') is 'any type allowed'
+PASS nonNumericPolicy('document.images.item(x)') is 'any type allowed'
+PASS nonNumericPolicy('document.createElement("input").setSelectionRange(x, 0)') is 'any type allowed'
+PASS nonNumericPolicy('document.createElement("input").setSelectionRange(0, x)') is 'any type allowed'
+PASS nonNumericPolicy('createHTMLOptionsCollection().add(document.createElement("option"), x)') is 'number or null allowed (or omitted, but not infinite)'
+PASS nonNumericPolicy('createHTMLOptionsCollection().remove(x)') is 'any type allowed'
+PASS nonNumericPolicy('createHTMLSelectElement().remove(x)') is 'any type allowed'
+PASS nonNumericPolicy('createHTMLSelectElement().item(x)') is 'any type allowed'
+PASS nonNumericPolicy('createHTMLTableElement().insertRow(x)') is 'any type allowed'
+PASS nonNumericPolicy('createHTMLTableElement().deleteRow(x)') is 'any type allowed'
+PASS nonNumericPolicy('createHTMLTableRowElement().insertCell(x)') is 'any type allowed'
+PASS nonNumericPolicy('createHTMLTableRowElement().deleteCell(x)') is 'any type allowed'
+PASS nonNumericPolicy('createHTMLTableSectionElement().insertRow(x)') is 'any type allowed'
+PASS nonNumericPolicy('createHTMLTableSectionElement().deleteRow(x)') is 'any type allowed'
+PASS nonNumericPolicy('document.createElement("textarea").setSelectionRange(x, 0)') is 'any type allowed'
+PASS nonNumericPolicy('document.createElement("textarea").setSelectionRange(0, x)') is 'any type allowed'
+PASS nonNumericPolicy('document.createEvent("KeyboardEvent").initKeyboardEvent("a", false, false, null, "b", x, false, false, false, false, false)') is 'any type allowed'
+PASS nonNumericPolicy('createMediaList().item(x)') is 'any type allowed'
+PASS nonNumericPolicy('document.createEvent("MouseEvent").initMouseEvent("a", false, false, null, x, 0, 0, 0, 0, false, false, false, false, 0, null)') is 'any type allowed'
+PASS nonNumericPolicy('document.createEvent("MouseEvent").initMouseEvent("a", false, false, null, 0, x, 0, 0, 0, false, false, false, false, 0, null)') is 'any type allowed'
+PASS nonNumericPolicy('document.createEvent("MouseEvent").initMouseEvent("a", false, false, null, 0, 0, x, 0, 0, false, false, false, false, 0, null)') is 'any type allowed'
+PASS nonNumericPolicy('document.createEvent("MouseEvent").initMouseEvent("a", false, false, null, 0, 0, 0, x, 0, false, false, false, false, 0, null)') is 'any type allowed'
+PASS nonNumericPolicy('document.createEvent("MouseEvent").initMouseEvent("a", false, false, null, 0, 0, 0, 0, x, false, false, false, false, 0, null)') is 'any type allowed'
+PASS nonNumericPolicy('document.createEvent("MouseEvent").initMouseEvent("a", false, false, null, 0, 0, 0, 0, 0, false, false, false, false, x, null)') is 'any type allowed'
+PASS nonNumericPolicy('document.body.attributes.item(x)') is 'any type allowed'
+PASS nonNumericPolicy('document.createNodeIterator(document, x, null, false)') is 'any type allowed'
+PASS nonNumericPolicy('document.getElementsByTagName("div").item(x)') is 'any type allowed'
+PASS nonNumericPolicy('document.createEvent("ProgressEvent").initProgressEvent("a", false, false, false, x, 0)') is 'any type allowed'
+PASS nonNumericPolicy('document.createEvent("ProgressEvent").initProgressEvent("a", false, false, false, 0, x)') is 'any type allowed'
+PASS nonNumericPolicy('document.createRange().setStart(document, x)') is 'any type allowed'
+PASS nonNumericPolicy('document.createRange().setEnd(document, x)') is 'any type allowed'
+PASS nonNumericPolicy('document.createRange().comparePoint(document, x)') is 'any type allowed'
+PASS nonNumericPolicy('document.createRange().isPointInRange(document, x)') is 'any type allowed'
+PASS nonNumericPolicy('getSelection().collapse(document, x)') is 'any type allowed'
+PASS nonNumericPolicy('getSelection().setBaseAndExtent(document, x, document, 0)') is 'any type allowed'
+PASS nonNumericPolicy('getSelection().setBaseAndExtent(document, 0, document, x)') is 'any type allowed'
+PASS nonNumericPolicy('getSelection().setPosition(document, x)') is 'any type allowed'
+PASS nonNumericPolicy('getSelection().extend(document, x)') is 'any type allowed'
+PASS nonNumericPolicy('getSelection().getRangeAt(x)') is 'any type allowed'
+PASS nonNumericPolicy('document.styleSheets.item(x)') is 'any type allowed'
+PASS nonNumericPolicy('document.createTextNode("a").splitText(x)') is 'any type allowed'
+PASS nonNumericPolicy('document.createTreeWalker(document, x, null, false)') is 'any type allowed'
+PASS nonNumericPolicy('document.createEvent("UIEvent").initUIEvent("a", false, false, null, x)') is 'any type allowed'
+PASS nonNumericPolicy('window.scrollBy(x, 0)') is 'any type allowed'
+PASS nonNumericPolicy('window.scrollBy(0, x)') is 'any type allowed'
+PASS nonNumericPolicy('window.scrollTo(x, 0)') is 'any type allowed'
+PASS nonNumericPolicy('window.scrollTo(0, x)') is 'any type allowed'
+PASS nonNumericPolicy('window.scroll(x, 0)') is 'any type allowed'
+PASS nonNumericPolicy('window.scroll(0, x)') is 'any type allowed'
+PASS nonNumericPolicy('window.moveBy(x, 0)') is 'any type allowed'
+PASS nonNumericPolicy('window.moveBy(0, x)') is 'any type allowed'
+PASS nonNumericPolicy('window.moveTo(x, 0)') is 'any type allowed'
+PASS nonNumericPolicy('window.moveTo(0, x)') is 'any type allowed'
+PASS nonNumericPolicy('window.resizeBy(x, 0)') is 'any type allowed'
+PASS nonNumericPolicy('window.resizeBy(0, x)') is 'any type allowed'
+PASS nonNumericPolicy('window.resizeTo(x, 0)') is 'any type allowed'
+PASS nonNumericPolicy('window.resizeTo(0, x)') is 'any type allowed'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/non-numeric-values-numeric-parameters.html b/LayoutTests/fast/dom/non-numeric-values-numeric-parameters.html
new file mode 100644 (file)
index 0000000..cf3d908
--- /dev/null
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="resources/non-numeric-values-numeric-parameters.js"></script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/resources/TEMPLATE.html b/LayoutTests/fast/dom/resources/TEMPLATE.html
new file mode 100644 (file)
index 0000000..1936e0d
--- /dev/null
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="YOUR_JS_FILE_HERE"></script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/resources/non-numeric-values-numeric-parameters.js b/LayoutTests/fast/dom/resources/non-numeric-values-numeric-parameters.js
new file mode 100644 (file)
index 0000000..60ec79e
--- /dev/null
@@ -0,0 +1,657 @@
+description(
+'This tests the behavior of non-numeric values in contexts where the DOM has a numeric parameter.'
+);
+
+function nonNumericPolicy(template)
+{
+    var x = 0;
+    try {
+        eval(template);
+    } catch (e) {
+        return e;
+    }
+
+    var nullAllowed = 1;
+    x = null;
+    try {
+        eval(template);
+    } catch (e) {
+        nullAllowed = 0;
+    }
+
+    var undefinedAllowed = 1;
+    x = undefined;
+    try {
+        eval(template);
+    } catch (e) {
+        undefinedAllowed = 0;
+    }
+
+    var stringAllowed = 1;
+    x = "string";
+    try {
+        eval(template);
+    } catch (e) {
+        stringAllowed = 0;
+    }
+
+    var documentAllowed = 1;
+    x = document;
+    try {
+        eval(template);
+    } catch (e) {
+        documentAllowed = 0;
+    }
+
+    var nonIntegerAllowed = 1;
+    x = 0.1;
+    try {
+        eval(template);
+    } catch (e) {
+        nonIntegerAllowed = 0;
+    }
+
+    var infinityAllowed = 1;
+    x = Infinity;
+    try {
+        eval(template);
+    } catch (e) {
+        infinityAllowed = 0;
+    }
+
+    var nanAllowed = 1;
+    x = NaN;
+    try {
+        eval(template);
+    } catch (e) {
+        NaNAllowed = 0;
+    }
+
+    var omitAllowed = -1; // means "not applicable"
+    var templateWithoutArg = template.replace(", x)", ")").replace("(x)", "()");
+    if (templateWithoutArg != template) {
+        omitAllowed = 1;
+        try {
+            eval(templateWithoutArg);
+        } catch(e) {
+            omitAllowed = 0;
+        }
+    }
+
+    var expectOmitAllowed = navigator.userAgent.match("Gecko/") != "Gecko/";
+
+    if (nullAllowed && undefinedAllowed && stringAllowed && documentAllowed && nonIntegerAllowed && infinityAllowed && nanAllowed) {
+        if (omitAllowed == -1 || omitAllowed == (expectOmitAllowed ? 1 : 0))
+            return "any type allowed";
+        if (omitAllowed == 1)
+            return "any type allowed (or omitted)";
+        if (omitAllowed == 0)
+            return "any type allowed (but not omitted)";
+    }
+    if (nullAllowed && !undefinedAllowed && !stringAllowed && !documentAllowed && nonIntegerAllowed && !infinityAllowed && nanAllowed && omitAllowed == 1)
+        return "number or null allowed (or omitted, but not infinite)";
+    return "mixed";
+}
+
+var selector = "a";
+var styleText = "font-size: smaller";
+var ruleText = selector + " { " + styleText + " }";
+
+var testElementContainer = document.createElement("div");
+document.body.appendChild(testElementContainer);
+
+function createCSSStyleSheet()
+{
+    return document.createElement("style").sheet;
+}
+
+function createFromMarkup(markup)
+{
+    var range = document.createRange();
+    var fragmentContainer = document.createElement("div");
+    range.selectNodeContents(fragmentContainer);
+    testElementContainer.appendChild(fragmentContainer);
+    var fragment = range.createContextualFragment(markup);
+    fragmentContainer.appendChild(fragment);
+    return fragmentContainer.firstChild;
+}
+
+function createCSSStyleSheet()
+{
+    return createFromMarkup("<style>" + ruleText + "</style>").sheet;
+}
+
+function createCSSRuleList()
+{
+    return createCSSStyleSheet().cssRules;
+}
+
+function createCSSStyleDeclaration()
+{
+    return createCSSRuleList().item(0).style;
+}
+
+function createCSSMediaRule()
+{
+    var rule = createFromMarkup("<style>@media screen { a { text-weight: bold } }</style>").sheet.cssRules.item(0);
+    rule.insertRule(ruleText, 0);
+    return rule;
+}
+
+function createCSSValueList()
+{
+    // FIXME: Not working in Firefox, not sure why.
+    return createFromMarkup("<style>a { font-family: b, c }</style>").sheet.cssRules.item(0).style.getPropertyCSSValue("font-family");
+}
+
+function createMediaList()
+{
+    return createCSSMediaRule().media;
+}
+
+function createHTMLSelectElement()
+{
+    var select = document.createElement("select");
+    select.options.add(document.createElement("option"));
+    return select;
+}
+
+function createHTMLOptionsCollection()
+{
+    return createHTMLSelectElement().options;
+}
+
+function createHTMLTableElement()
+{
+    var table = document.createElement("table");
+    table.insertRow(0);
+    return table;
+}
+
+function createHTMLTableSectionElement()
+{
+    var table = document.createElement("table");
+    table.insertRow(0);
+    return table.tBodies[0];
+}
+
+function createHTMLTableRowElement()
+{
+    var table = document.createElement("table");
+    var row = table.insertRow(0);
+    row.insertCell(0);
+    return row;
+}
+
+// CharacterData
+
+shouldBe("nonNumericPolicy('document.createTextNode(\"a\").substringData(x, 0)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.createTextNode(\"a\").substringData(0, x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.createTextNode(\"a\").insertData(x, \"b\")')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.createTextNode(\"a\").deleteData(x, 0)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.createTextNode(\"a\").deleteData(0, x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.createTextNode(\"a\").replaceData(x, 0, \"b\")')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.createTextNode(\"a\").replaceData(0, x, \"b\")')", "'any type allowed'");
+
+// CSSMediaRule
+
+shouldBe("nonNumericPolicy('createCSSMediaRule().insertRule(ruleText, x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('createCSSMediaRule().deleteRule(x)')", "'any type allowed'");
+
+// CSSRuleList
+
+shouldBe("nonNumericPolicy('createCSSRuleList().item(x)')", "'any type allowed'");
+
+// CSSStyleDeclaration
+
+shouldBe("nonNumericPolicy('createCSSStyleDeclaration().item(x)')", "'any type allowed'");
+
+// CSSStyleSheet
+
+shouldBe("nonNumericPolicy('createCSSStyleSheet().insertRule(ruleText, x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('createCSSStyleSheet().deleteRule(x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('createCSSStyleSheet().addRule(selector, styleText, x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('createCSSStyleSheet().removeRule(x)')", "'any type allowed'");
+
+// CSSValueList
+
+shouldBe("nonNumericPolicy('createCSSValueList().item(x)')", "'any type allowed'");
+
+// Document
+
+shouldBe("nonNumericPolicy('document.elementFromPoint(x, 0)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.elementFromPoint(0, x)')", "'any type allowed'");
+
+// Element
+
+shouldBe("nonNumericPolicy('document.body.scrollByLines(x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.body.scrollByPages(x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.body.scrollLeft = x')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.body.scrollTop = x')", "'any type allowed'");
+
+// History
+
+// Not tested: go.
+
+// HTMLCollection
+
+shouldBe("nonNumericPolicy('document.images.item(x)')", "'any type allowed'");
+
+// HTMLInputElement
+
+shouldBe("nonNumericPolicy('document.createElement(\"input\").setSelectionRange(x, 0)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.createElement(\"input\").setSelectionRange(0, x)')", "'any type allowed'");
+
+// HTMLOptionsCollection
+
+shouldBe("nonNumericPolicy('createHTMLOptionsCollection().add(document.createElement(\"option\"), x)')", "'number or null allowed (or omitted, but not infinite)'");
+shouldBe("nonNumericPolicy('createHTMLOptionsCollection().remove(x)')", "'any type allowed'");
+
+// HTMLSelectElement
+
+shouldBe("nonNumericPolicy('createHTMLSelectElement().remove(x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('createHTMLSelectElement().item(x)')", "'any type allowed'");
+
+// HTMLTableElement
+
+shouldBe("nonNumericPolicy('createHTMLTableElement().insertRow(x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('createHTMLTableElement().deleteRow(x)')", "'any type allowed'");
+
+// HTMLTableRowElement
+
+shouldBe("nonNumericPolicy('createHTMLTableRowElement().insertCell(x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('createHTMLTableRowElement().deleteCell(x)')", "'any type allowed'");
+
+// HTMLTableSectionElement
+
+shouldBe("nonNumericPolicy('createHTMLTableSectionElement().insertRow(x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('createHTMLTableSectionElement().deleteRow(x)')", "'any type allowed'");
+
+// HTMLInputElement
+
+shouldBe("nonNumericPolicy('document.createElement(\"textarea\").setSelectionRange(x, 0)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.createElement(\"textarea\").setSelectionRange(0, x)')", "'any type allowed'");
+
+// KeyboardEvent
+
+shouldBe("nonNumericPolicy('document.createEvent(\"KeyboardEvent\").initKeyboardEvent(\"a\", false, false, null, \"b\", x, false, false, false, false, false)')", "'any type allowed'");
+
+// MediaList
+
+shouldBe("nonNumericPolicy('createMediaList().item(x)')", "'any type allowed'");
+
+// MouseEvent
+
+shouldBe("nonNumericPolicy('document.createEvent(\"MouseEvent\").initMouseEvent(\"a\", false, false, null, x, 0, 0, 0, 0, false, false, false, false, 0, null)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.createEvent(\"MouseEvent\").initMouseEvent(\"a\", false, false, null, 0, x, 0, 0, 0, false, false, false, false, 0, null)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.createEvent(\"MouseEvent\").initMouseEvent(\"a\", false, false, null, 0, 0, x, 0, 0, false, false, false, false, 0, null)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.createEvent(\"MouseEvent\").initMouseEvent(\"a\", false, false, null, 0, 0, 0, x, 0, false, false, false, false, 0, null)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.createEvent(\"MouseEvent\").initMouseEvent(\"a\", false, false, null, 0, 0, 0, 0, x, false, false, false, false, 0, null)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.createEvent(\"MouseEvent\").initMouseEvent(\"a\", false, false, null, 0, 0, 0, 0, 0, false, false, false, false, x, null)')", "'any type allowed'");
+
+// NamedNodeMap
+
+shouldBe("nonNumericPolicy('document.body.attributes.item(x)')", "'any type allowed'");
+
+// NodeIterator
+
+shouldBe("nonNumericPolicy('document.createNodeIterator(document, x, null, false)')", "'any type allowed'");
+
+// NodeList
+
+shouldBe("nonNumericPolicy('document.getElementsByTagName(\"div\").item(x)')", "'any type allowed'");
+
+// ProgressEvent
+
+shouldBe("nonNumericPolicy('document.createEvent(\"ProgressEvent\").initProgressEvent(\"a\", false, false, false, x, 0)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.createEvent(\"ProgressEvent\").initProgressEvent(\"a\", false, false, false, 0, x)')", "'any type allowed'");
+
+// Range
+
+shouldBe("nonNumericPolicy('document.createRange().setStart(document, x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.createRange().setEnd(document, x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.createRange().comparePoint(document, x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.createRange().isPointInRange(document, x)')", "'any type allowed'");
+
+// Selection
+
+shouldBe("nonNumericPolicy('getSelection().collapse(document, x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('getSelection().setBaseAndExtent(document, x, document, 0)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('getSelection().setBaseAndExtent(document, 0, document, x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('getSelection().setPosition(document, x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('getSelection().extend(document, x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('getSelection().getRangeAt(x)')", "'any type allowed'");
+
+// SQLResultSetRowList
+
+// Not tested: item.
+
+// StyleSheetList
+
+shouldBe("nonNumericPolicy('document.styleSheets.item(x)')", "'any type allowed'");
+
+// Text
+
+shouldBe("nonNumericPolicy('document.createTextNode(\"a\").splitText(x)')", "'any type allowed'");
+
+// TimeRanges
+
+// Not tested: start, end.
+
+// TreeWalker
+
+shouldBe("nonNumericPolicy('document.createTreeWalker(document, x, null, false)')", "'any type allowed'");
+
+// UIEvent
+
+shouldBe("nonNumericPolicy('document.createEvent(\"UIEvent\").initUIEvent(\"a\", false, false, null, x)')", "'any type allowed'");
+
+// Window
+
+shouldBe("nonNumericPolicy('window.scrollBy(x, 0)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('window.scrollBy(0, x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('window.scrollTo(x, 0)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('window.scrollTo(0, x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('window.scroll(x, 0)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('window.scroll(0, x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('window.moveBy(x, 0)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('window.moveBy(0, x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('window.moveTo(x, 0)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('window.moveTo(0, x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('window.resizeBy(x, 0)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('window.resizeBy(0, x)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('window.resizeTo(x, 0)')", "'any type allowed'");
+shouldBe("nonNumericPolicy('window.resizeTo(0, x)')", "'any type allowed'");
+// Not tested: openDatabase.
+
+window.resizeTo(10000, 10000);
+document.body.removeChild(testElementContainer);
+
+var successfullyParsed = true;
+
+/*
+
+Here are other examples of numeric types in function parameters and settable attributes that we could test:
+
+../../../../WebCore/css/CSSPrimitiveValue.idl:                                          in float floatValue)
+../../../../WebCore/html/CanvasGradient.idl:        void addColorStop(in float offset, in DOMString color);
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        void scale(in float sx, in float sy);
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        void rotate(in float angle);
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        void translate(in float tx, in float ty);
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        CanvasGradient createLinearGradient(in float x0, in float y0, in float x1, in float y1);
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        CanvasGradient createRadialGradient(in float x0, in float y0, in float r0, in float x1, in float y1, in float r1);
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        void clearRect(in float x, in float y, in float width, in float height)
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        void fillRect(in float x, in float y, in float width, in float height)
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        void moveTo(in float x, in float y);
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        void lineTo(in float x, in float y);
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        void quadraticCurveTo(in float cpx, in float cpy, in float x, in float y);
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        void bezierCurveTo(in float cp1x, in float cp1y, in float cp2x, in float cp2y, in float x, in float y);
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        void arcTo(in float x1, in float y1, in float x2, in float y2, in float radius)
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        void rect(in float x, in float y, in float width, in float height)
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        void arc(in float x, in float y, in float radius, in float startAngle, in float endAngle, in boolean anticlockwise)
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        boolean isPointInPath(in float x, in float y);
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        void setAlpha(in float alpha);
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        void setLineWidth(in float width);
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        void setMiterLimit(in float limit);
+
+../../../../WebCore/html/HTMLAnchorElement.idl:        attribute long tabIndex;
+../../../../WebCore/html/HTMLAppletElement.idl:                 attribute [ConvertFromString] long hspace;
+../../../../WebCore/html/HTMLAppletElement.idl:                 attribute [ConvertFromString] long vspace;
+../../../../WebCore/html/HTMLAreaElement.idl:        attribute long tabIndex;
+../../../../WebCore/html/HTMLBaseFontElement.idl:        attribute long size;
+../../../../WebCore/html/HTMLBodyElement.idl:                 attribute long scrollLeft;
+../../../../WebCore/html/HTMLBodyElement.idl:                 attribute long scrollTop;
+../../../../WebCore/html/HTMLButtonElement.idl:                 attribute  long                 tabIndex;
+../../../../WebCore/html/HTMLCanvasElement.idl:        attribute long width;
+../../../../WebCore/html/HTMLCanvasElement.idl:        attribute long height;
+../../../../WebCore/html/HTMLEmbedElement.idl:                 attribute [ConvertFromString] long height;
+../../../../WebCore/html/HTMLEmbedElement.idl:                 attribute [ConvertFromString] long width;
+../../../../WebCore/html/HTMLImageElement.idl:                 attribute long height;
+../../../../WebCore/html/HTMLImageElement.idl:                 attribute long hspace;
+../../../../WebCore/html/HTMLImageElement.idl:                 attribute long vspace;
+../../../../WebCore/html/HTMLImageElement.idl:                 attribute long width;
+../../../../WebCore/html/HTMLInputElement.idl:                 attribute long            maxLength;
+../../../../WebCore/html/HTMLInputElement.idl:                 attribute unsigned long   size; // Changed string -> long as part of DOM level 2
+../../../../WebCore/html/HTMLInputElement.idl:                 attribute long            tabIndex;
+../../../../WebCore/html/HTMLInputElement.idl:                 attribute long            selectionStart;
+../../../../WebCore/html/HTMLInputElement.idl:                 attribute long            selectionEnd;
+../../../../WebCore/html/HTMLLIElement.idl:        attribute long value;    
+../../../../WebCore/html/HTMLMediaElement.idl:    attribute unsigned long playCount
+../../../../WebCore/html/HTMLMediaElement.idl:    attribute unsigned long currentLoop;
+../../../../WebCore/html/HTMLObjectElement.idl:                 attribute long            hspace;
+../../../../WebCore/html/HTMLObjectElement.idl:                 attribute long            tabIndex;
+../../../../WebCore/html/HTMLObjectElement.idl:                 attribute long            vspace;
+../../../../WebCore/html/HTMLOListElement.idl:        attribute long start;
+../../../../WebCore/html/HTMLOptionsCollection.idl:                 attribute long selectedIndex;
+../../../../WebCore/html/HTMLOptionsCollection.idl:                 attribute [Custom] unsigned long length
+../../../../WebCore/html/HTMLPreElement.idl:        attribute long width;
+../../../../WebCore/html/HTMLSelectElement.idl:                 attribute long            selectedIndex;
+../../../../WebCore/html/HTMLSelectElement.idl:                 attribute unsigned long   length
+../../../../WebCore/html/HTMLSelectElement.idl:                 attribute long            size;
+../../../../WebCore/html/HTMLSelectElement.idl:                 attribute long            tabIndex;
+../../../../WebCore/html/HTMLTableCellElement.idl:                 attribute long            colSpan;
+../../../../WebCore/html/HTMLTableCellElement.idl:                 attribute long            rowSpan;
+../../../../WebCore/html/HTMLTableColElement.idl:        attribute long            span;
+../../../../WebCore/html/HTMLTextAreaElement.idl:                 attribute  long                 cols;
+../../../../WebCore/html/HTMLTextAreaElement.idl:                 attribute  long                 rows;
+../../../../WebCore/html/HTMLTextAreaElement.idl:                 attribute  long                 tabIndex;
+../../../../WebCore/html/HTMLTextAreaElement.idl:                 attribute long selectionStart;
+../../../../WebCore/html/HTMLTextAreaElement.idl:                 attribute long selectionEnd;
+../../../../WebCore/html/HTMLVideoElement.idl:        attribute long width;
+../../../../WebCore/html/HTMLVideoElement.idl:        attribute long height;
+
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        attribute float globalAlpha;
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        attribute float lineWidth;
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        attribute float miterLimit;
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        attribute float shadowOffsetX;
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        attribute float shadowOffsetY;
+../../../../WebCore/html/CanvasRenderingContext2D.idl:        attribute float shadowBlur;
+../../../../WebCore/html/HTMLMediaElement.idl:    attribute float currentTime
+../../../../WebCore/html/HTMLMediaElement.idl:    attribute float defaultPlaybackRate 
+../../../../WebCore/html/HTMLMediaElement.idl:    attribute float playbackRate 
+../../../../WebCore/html/HTMLMediaElement.idl:    attribute float start;
+../../../../WebCore/html/HTMLMediaElement.idl:    attribute float end;
+../../../../WebCore/html/HTMLMediaElement.idl:    attribute float loopStart;
+../../../../WebCore/html/HTMLMediaElement.idl:    attribute float loopEnd;
+../../../../WebCore/html/HTMLMediaElement.idl:    attribute float volume 
+
+../../../../WebCore/svg/SVGAnimatedInteger.idl:                 attribute long baseVal
+../../../../WebCore/svg/SVGElementInstanceList.idl:        SVGElementInstance item(in unsigned long index);
+../../../../WebCore/svg/SVGFilterElement.idl:        void setFilterRes(in unsigned long filterResX, in unsigned long filterResY);
+../../../../WebCore/svg/SVGLengthList.idl:        SVGLength getItem(in unsigned long index)
+../../../../WebCore/svg/SVGLengthList.idl:        SVGLength insertItemBefore(in SVGLength item, in unsigned long index)
+../../../../WebCore/svg/SVGLengthList.idl:        SVGLength replaceItem(in SVGLength item, in unsigned long index)
+../../../../WebCore/svg/SVGLengthList.idl:        SVGLength removeItem(in unsigned long index)
+../../../../WebCore/svg/SVGNumberList.idl:        SVGNumber getItem(in unsigned long index)
+../../../../WebCore/svg/SVGNumberList.idl:        SVGNumber insertItemBefore(in SVGNumber item, in unsigned long index)
+../../../../WebCore/svg/SVGNumberList.idl:        SVGNumber replaceItem(in SVGNumber item, in unsigned long index)
+../../../../WebCore/svg/SVGNumberList.idl:        SVGNumber removeItem(in unsigned long index)
+../../../../WebCore/svg/SVGPathElement.idl:        unsigned long getPathSegAtLength(in float distance);
+../../../../WebCore/svg/SVGPathSegList.idl:        [Custom] SVGPathSeg getItem(in unsigned long index)
+../../../../WebCore/svg/SVGPathSegList.idl:        [Custom] SVGPathSeg insertItemBefore(in SVGPathSeg newItem, in unsigned long index)
+../../../../WebCore/svg/SVGPathSegList.idl:        [Custom] SVGPathSeg replaceItem(in SVGPathSeg newItem, in unsigned long index)
+../../../../WebCore/svg/SVGPathSegList.idl:        [Custom] SVGPathSeg removeItem(in unsigned long index)
+../../../../WebCore/svg/SVGPointList.idl:        [Custom] SVGPoint getItem(in unsigned long index)
+../../../../WebCore/svg/SVGPointList.idl:        [Custom] SVGPoint insertItemBefore(in SVGPoint item, in unsigned long index)
+../../../../WebCore/svg/SVGPointList.idl:        [Custom] SVGPoint replaceItem(in SVGPoint item, in unsigned long index)
+../../../../WebCore/svg/SVGPointList.idl:        [Custom] SVGPoint removeItem(in unsigned long index)
+../../../../WebCore/svg/SVGStringList.idl:        core::DOMString getItem(in unsigned long index)
+../../../../WebCore/svg/SVGStringList.idl:        core::DOMString insertItemBefore(in core::DOMString item, in unsigned long index)
+../../../../WebCore/svg/SVGStringList.idl:        core::DOMString replaceItem(in core::DOMString item, in unsigned long index)
+../../../../WebCore/svg/SVGStringList.idl:        core::DOMString removeItem(in unsigned long index)
+../../../../WebCore/svg/SVGSVGElement.idl:        unsigned long suspendRedraw(in unsigned long maxWaitMilliseconds);
+../../../../WebCore/svg/SVGSVGElement.idl:        void unsuspendRedraw(in unsigned long suspendHandleId)
+../../../../WebCore/svg/SVGTextContentElement.idl:        long getNumberOfChars();
+../../../../WebCore/svg/SVGTextContentElement.idl:        float getSubStringLength(in unsigned long offset, 
+../../../../WebCore/svg/SVGTextContentElement.idl:                                 in unsigned long length)
+../../../../WebCore/svg/SVGTextContentElement.idl:        SVGPoint getStartPositionOfChar(in unsigned long offset)
+../../../../WebCore/svg/SVGTextContentElement.idl:        SVGPoint getEndPositionOfChar(in unsigned long offset)
+../../../../WebCore/svg/SVGTextContentElement.idl:        SVGRect getExtentOfChar(in unsigned long offset)
+../../../../WebCore/svg/SVGTextContentElement.idl:        float getRotationOfChar(in unsigned long offset)
+../../../../WebCore/svg/SVGTextContentElement.idl:        long getCharNumAtPosition(in SVGPoint point);
+../../../../WebCore/svg/SVGTextContentElement.idl:        void selectSubString(in unsigned long offset, 
+../../../../WebCore/svg/SVGTextContentElement.idl:                             in unsigned long length)
+../../../../WebCore/svg/SVGTransformList.idl:        [Custom] SVGTransform getItem(in unsigned long index)
+../../../../WebCore/svg/SVGTransformList.idl:        [Custom] SVGTransform insertItemBefore(in SVGTransform item, in unsigned long index)
+../../../../WebCore/svg/SVGTransformList.idl:        [Custom] SVGTransform replaceItem(in SVGTransform item, in unsigned long index)
+../../../../WebCore/svg/SVGTransformList.idl:        [Custom] SVGTransform removeItem(in unsigned long index)
+../../../../WebCore/xml/XPathResult.idl:        Node snapshotItem(in unsigned long index)
+
+../../../../WebCore/svg/SVGAngle.idl:                                    in float valueInSpecifiedUnits);
+../../../../WebCore/svg/SVGAnimationElement.idl:        float getStartTime();
+../../../../WebCore/svg/SVGAnimationElement.idl:        float getCurrentTime();
+../../../../WebCore/svg/SVGAnimationElement.idl:        float getSimpleDuration()
+../../../../WebCore/svg/SVGFEGaussianBlurElement.idl:        void setStdDeviation(in float stdDeviationX, in float stdDeviationY);
+../../../../WebCore/svg/SVGLength.idl:                                    in float valueInSpecifiedUnits);
+../../../../WebCore/svg/SVGMatrix.idl:        [Custom] SVGMatrix translate(in float x, in float y);
+../../../../WebCore/svg/SVGMatrix.idl:        [Custom] SVGMatrix scale(in float scaleFactor);
+../../../../WebCore/svg/SVGMatrix.idl:        [Custom] SVGMatrix scaleNonUniform(in float scaleFactorX, in float scaleFactorY);
+../../../../WebCore/svg/SVGMatrix.idl:        [Custom] SVGMatrix rotate(in float angle);
+../../../../WebCore/svg/SVGMatrix.idl:        [Custom] SVGMatrix rotateFromVector(in float x, in float y)
+../../../../WebCore/svg/SVGMatrix.idl:        [Custom] SVGMatrix skewX(in float angle);
+../../../../WebCore/svg/SVGMatrix.idl:        [Custom] SVGMatrix skewY(in float angle);
+../../../../WebCore/svg/SVGNumber.idl:    interface [Conditional=SVG, PODType=float] SVGNumber {
+../../../../WebCore/svg/SVGPathElement.idl:        float getTotalLength();
+../../../../WebCore/svg/SVGPathElement.idl:        SVGPoint getPointAtLength(in float distance);
+../../../../WebCore/svg/SVGPathElement.idl:        unsigned long getPathSegAtLength(in float distance);
+../../../../WebCore/svg/SVGPathElement.idl:        SVGPathSegMovetoAbs createSVGPathSegMovetoAbs(in float x, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                      in float y);
+../../../../WebCore/svg/SVGPathElement.idl:        SVGPathSegMovetoRel createSVGPathSegMovetoRel(in float x, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                      in float y);
+../../../../WebCore/svg/SVGPathElement.idl:        SVGPathSegLinetoAbs createSVGPathSegLinetoAbs(in float x, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                      in float y);
+../../../../WebCore/svg/SVGPathElement.idl:        SVGPathSegLinetoRel createSVGPathSegLinetoRel(in float x, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                      in float y);
+../../../../WebCore/svg/SVGPathElement.idl:        SVGPathSegCurvetoCubicAbs createSVGPathSegCurvetoCubicAbs(in float x, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                  in float y, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                  in float x1, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                  in float y1, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                  in float x2, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                  in float y2);
+../../../../WebCore/svg/SVGPathElement.idl:        SVGPathSegCurvetoCubicRel createSVGPathSegCurvetoCubicRel(in float x, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                  in float y, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                  in float x1, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                  in float y1, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                  in float x2, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                  in float y2);
+../../../../WebCore/svg/SVGPathElement.idl:        SVGPathSegCurvetoQuadraticAbs createSVGPathSegCurvetoQuadraticAbs(in float x, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                          in float y, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                          in float x1, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                          in float y1);
+../../../../WebCore/svg/SVGPathElement.idl:        SVGPathSegCurvetoQuadraticRel createSVGPathSegCurvetoQuadraticRel(in float x, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                          in float y, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                          in float x1, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                          in float y1);
+../../../../WebCore/svg/SVGPathElement.idl:        SVGPathSegArcAbs createSVGPathSegArcAbs(in float x, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                in float y, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                in float r1, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                in float r2, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                in float angle, 
+../../../../WebCore/svg/SVGPathElement.idl:        SVGPathSegArcRel createSVGPathSegArcRel(in float x, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                in float y, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                in float r1, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                in float r2, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                in float angle, 
+../../../../WebCore/svg/SVGPathElement.idl:        SVGPathSegLinetoHorizontalAbs createSVGPathSegLinetoHorizontalAbs(in float x);
+../../../../WebCore/svg/SVGPathElement.idl:        SVGPathSegLinetoHorizontalRel createSVGPathSegLinetoHorizontalRel(in float x);
+../../../../WebCore/svg/SVGPathElement.idl:        SVGPathSegLinetoVerticalAbs createSVGPathSegLinetoVerticalAbs(in float y);
+../../../../WebCore/svg/SVGPathElement.idl:        SVGPathSegLinetoVerticalRel createSVGPathSegLinetoVerticalRel(in float y);
+../../../../WebCore/svg/SVGPathElement.idl:        SVGPathSegCurvetoCubicSmoothAbs createSVGPathSegCurvetoCubicSmoothAbs(in float x, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                              in float y, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                              in float x2, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                              in float y2);
+../../../../WebCore/svg/SVGPathElement.idl:        SVGPathSegCurvetoCubicSmoothRel createSVGPathSegCurvetoCubicSmoothRel(in float x, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                              in float y, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                              in float x2, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                              in float y2);
+../../../../WebCore/svg/SVGPathElement.idl:        SVGPathSegCurvetoQuadraticSmoothAbs createSVGPathSegCurvetoQuadraticSmoothAbs(in float x, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                                      in float y);
+../../../../WebCore/svg/SVGPathElement.idl:        SVGPathSegCurvetoQuadraticSmoothRel createSVGPathSegCurvetoQuadraticSmoothRel(in float x, 
+../../../../WebCore/svg/SVGPathElement.idl:                                                                                      in float y);
+../../../../WebCore/svg/SVGSVGElement.idl:        float getCurrentTime();
+../../../../WebCore/svg/SVGSVGElement.idl:        void setCurrentTime(in float seconds);
+../../../../WebCore/svg/SVGTextContentElement.idl:        float getComputedTextLength();
+../../../../WebCore/svg/SVGTextContentElement.idl:        float getSubStringLength(in unsigned long offset, 
+../../../../WebCore/svg/SVGTextContentElement.idl:        float getRotationOfChar(in unsigned long offset)
+../../../../WebCore/svg/SVGTransform.idl:        void setTranslate(in float tx, in float ty);
+../../../../WebCore/svg/SVGTransform.idl:        void setScale(in float sx, in float sy);
+../../../../WebCore/svg/SVGTransform.idl:        void setRotate(in float angle, in float cx, in float cy);
+../../../../WebCore/svg/SVGTransform.idl:        void setSkewX(in float angle);
+../../../../WebCore/svg/SVGTransform.idl:        void setSkewY(in float angle);
+
+../../../../WebCore/svg/SVGAngle.idl:                 attribute float          value;
+../../../../WebCore/svg/SVGAngle.idl:                 attribute float          valueInSpecifiedUnits;
+../../../../WebCore/svg/SVGAnimatedNumber.idl:                 attribute float baseVal
+../../../../WebCore/svg/SVGLength.idl:                 attribute float          value;
+../../../../WebCore/svg/SVGLength.idl:                 attribute float          valueInSpecifiedUnits;
+../../../../WebCore/svg/SVGNumber.idl:                 attribute float value
+../../../../WebCore/svg/SVGPathSegArcAbs.idl:                 attribute float   x
+../../../../WebCore/svg/SVGPathSegArcAbs.idl:                 attribute float   y
+../../../../WebCore/svg/SVGPathSegArcAbs.idl:                 attribute float   r1
+../../../../WebCore/svg/SVGPathSegArcAbs.idl:                 attribute float   r2
+../../../../WebCore/svg/SVGPathSegArcAbs.idl:                 attribute float   angle
+../../../../WebCore/svg/SVGPathSegArcRel.idl:                 attribute float   x
+../../../../WebCore/svg/SVGPathSegArcRel.idl:                 attribute float   y
+../../../../WebCore/svg/SVGPathSegArcRel.idl:                 attribute float   r1
+../../../../WebCore/svg/SVGPathSegArcRel.idl:                 attribute float   r2
+../../../../WebCore/svg/SVGPathSegArcRel.idl:                 attribute float   angle
+../../../../WebCore/svg/SVGPathSegCurvetoCubicAbs.idl:                 attribute float   x
+../../../../WebCore/svg/SVGPathSegCurvetoCubicAbs.idl:                 attribute float   y
+../../../../WebCore/svg/SVGPathSegCurvetoCubicAbs.idl:                 attribute float   x1
+../../../../WebCore/svg/SVGPathSegCurvetoCubicAbs.idl:                 attribute float   y1
+../../../../WebCore/svg/SVGPathSegCurvetoCubicAbs.idl:                 attribute float   x2
+../../../../WebCore/svg/SVGPathSegCurvetoCubicAbs.idl:                 attribute float   y2
+../../../../WebCore/svg/SVGPathSegCurvetoCubicRel.idl:                 attribute float   x
+../../../../WebCore/svg/SVGPathSegCurvetoCubicRel.idl:                 attribute float   y
+../../../../WebCore/svg/SVGPathSegCurvetoCubicRel.idl:                 attribute float   x1
+../../../../WebCore/svg/SVGPathSegCurvetoCubicRel.idl:                 attribute float   y1
+../../../../WebCore/svg/SVGPathSegCurvetoCubicRel.idl:                 attribute float   x2
+../../../../WebCore/svg/SVGPathSegCurvetoCubicRel.idl:                 attribute float   y2
+../../../../WebCore/svg/SVGPathSegCurvetoCubicSmoothAbs.idl:                 attribute float   x
+../../../../WebCore/svg/SVGPathSegCurvetoCubicSmoothAbs.idl:                 attribute float   y
+../../../../WebCore/svg/SVGPathSegCurvetoCubicSmoothAbs.idl:                 attribute float   x2
+../../../../WebCore/svg/SVGPathSegCurvetoCubicSmoothAbs.idl:                 attribute float   y2
+../../../../WebCore/svg/SVGPathSegCurvetoCubicSmoothRel.idl:                 attribute float   x
+../../../../WebCore/svg/SVGPathSegCurvetoCubicSmoothRel.idl:                 attribute float   y
+../../../../WebCore/svg/SVGPathSegCurvetoCubicSmoothRel.idl:                 attribute float   x2
+../../../../WebCore/svg/SVGPathSegCurvetoCubicSmoothRel.idl:                 attribute float   y2
+../../../../WebCore/svg/SVGPathSegCurvetoQuadraticAbs.idl:                 attribute float   x
+../../../../WebCore/svg/SVGPathSegCurvetoQuadraticAbs.idl:                 attribute float   y
+../../../../WebCore/svg/SVGPathSegCurvetoQuadraticAbs.idl:                 attribute float   x1
+../../../../WebCore/svg/SVGPathSegCurvetoQuadraticAbs.idl:                 attribute float   y1
+../../../../WebCore/svg/SVGPathSegCurvetoQuadraticRel.idl:                 attribute float   x
+../../../../WebCore/svg/SVGPathSegCurvetoQuadraticRel.idl:                 attribute float   y
+../../../../WebCore/svg/SVGPathSegCurvetoQuadraticRel.idl:                 attribute float   x1
+../../../../WebCore/svg/SVGPathSegCurvetoQuadraticRel.idl:                 attribute float   y1
+../../../../WebCore/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl:                 attribute float   x
+../../../../WebCore/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl:                 attribute float   y
+../../../../WebCore/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl:                 attribute float   x
+../../../../WebCore/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl:                 attribute float   y
+../../../../WebCore/svg/SVGPathSegLinetoAbs.idl:                 attribute float   x
+../../../../WebCore/svg/SVGPathSegLinetoAbs.idl:                 attribute float   y
+../../../../WebCore/svg/SVGPathSegLinetoHorizontalAbs.idl:                 attribute float   x
+../../../../WebCore/svg/SVGPathSegLinetoHorizontalRel.idl:                 attribute float   x
+../../../../WebCore/svg/SVGPathSegLinetoRel.idl:                 attribute float   x
+../../../../WebCore/svg/SVGPathSegLinetoRel.idl:                 attribute float   y
+../../../../WebCore/svg/SVGPathSegLinetoVerticalAbs.idl:                 attribute float   y
+../../../../WebCore/svg/SVGPathSegLinetoVerticalRel.idl:                 attribute float   y
+../../../../WebCore/svg/SVGPathSegMovetoAbs.idl:                 attribute float   x
+../../../../WebCore/svg/SVGPathSegMovetoAbs.idl:                 attribute float   y
+../../../../WebCore/svg/SVGPathSegMovetoRel.idl:                 attribute float   x
+../../../../WebCore/svg/SVGPathSegMovetoRel.idl:                 attribute float   y
+../../../../WebCore/svg/SVGPoint.idl:                 attribute float x
+../../../../WebCore/svg/SVGPoint.idl:                 attribute float y
+../../../../WebCore/svg/SVGRect.idl:                 attribute float x
+../../../../WebCore/svg/SVGRect.idl:                 attribute float y
+../../../../WebCore/svg/SVGRect.idl:                 attribute float width
+../../../../WebCore/svg/SVGRect.idl:                 attribute float height
+../../../../WebCore/svg/SVGSVGElement.idl:                 attribute float currentScale
+
+../../../../WebCore/svg/SVGMatrix.idl:        attribute double a;
+../../../../WebCore/svg/SVGMatrix.idl:        attribute double b;
+../../../../WebCore/svg/SVGMatrix.idl:        attribute double c;
+../../../../WebCore/svg/SVGMatrix.idl:        attribute double d;
+../../../../WebCore/svg/SVGMatrix.idl:        attribute double e;
+../../../../WebCore/svg/SVGMatrix.idl:        attribute double f;
+
+*/
index 4b46e61..3146197 100644 (file)
@@ -1,3 +1,63 @@
+2008-02-04  Darin Adler  <darin@apple.com>
+
+        Reviewed by Geoff.
+
+        - fix <rdar://problem/5715692> REGRESSION (r28570): JavaScript window.scrollTo()
+          calls no longer accept 'undefined' values
+
+        By default, we should accept non-numeric parameters and non-integral numbers for
+        parameters that expect integers, without throwing exceptions.
+
+        While creating the test for this, I ran into a couple minor bugs with the
+        functions involved, and this patch fixes those too.
+
+        Test: fast/dom/non-numeric-values-numeric-parameters.html
+
+        * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
+        (WebCore::JSHTMLOptionsCollection::add): Added. This function has unusual behavior
+        when passed non-integral values for its second parameter, so it needs to be written
+        by hand. I think that [Custom] is better here than inventing a new keyword.
+
+        * bindings/scripts/CodeGeneratorJS.pm: Changed default for "long" and "unsigned long"
+        to ignore errors rather than failing due to type differences. Also changed a couple
+        functions to use hashes.
+
+        * css/CSSStyleSheet.h:
+        (WebCore::CSSStyleSheet::removeRule): Remove overload of removeRule without a second
+        parameters. While we do allow this from JavaScript, it's not a true optional parameter,
+        but rather just a case of "you can omit parameters and they are treated as undefined"
+        combined with "undefined turns into 0 when passed to a function that takes an integer".
+        * css/CSSStyleSheet.idl: Removed [Optional] on the index parameter for removeRule.
+        This is not truly an optional parameter.
+
+        * dom/ProgressEvent.cpp:
+        (WebCore::ProgressEvent::initProgressEvent): Updated this function to match other
+        DOM event init functions -- important to do nothing if this is called on the an
+        already-dispatched event and we need to respect the bubble and cancelable arguments.
+        Also removed initProgressEventNS. We don't support namespaced events, and if we add
+        support, it should be across all event classes, not just ProgressEvent.
+        * dom/ProgressEvent.h: Removed initProgressEventNS.
+        * dom/ProgressEvent.idl: Ditto.
+
+        * dom/Range.cpp:
+        (WebCore::Range::createContextualFragment): Added a check for 0. This can happen
+        if the passed-in start container is a node that's not an HTML element and also
+        does not have a parent.
+
+        * html/HTMLOptionsCollection.idl: Added the [Custom] attribute to add, since the
+        rules for processing its parameters are unusual.
+
+        * page/DOMSelection.cpp: Removed the version of setPosition that has only
+        one parameter. The offset is not really optional.
+        * page/DOMSelection.h: Ditto.
+        * page/DOMSelection.idl: Removed the [Optional] keyword for the second parameter of
+        setPosition. It's not a true optional parameter (see discussion of removeRule above).
+
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::adjustWindowRect): Simplified logic for constraining the X
+        and Y coordinates, in a way that makes them work even when the window coordinates
+        are infinite. Also strengthened the assertion.
+
 2008-02-04  Alp Toker  <alp@atoker.com>
 
         Rubber-stamped by Mark Rowe.
index 72689be..b0da9a7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -60,14 +60,35 @@ void JSHTMLOptionsCollection::setLength(ExecState* exec, JSValue* value)
     setDOMException(exec, ec);
 }
 
-void JSHTMLOptionsCollection::indexSetter(KJS::ExecState* exec, unsigned index, KJS::JSValue* value, int attr)
+void JSHTMLOptionsCollection::indexSetter(ExecState* exec, unsigned index, JSValue* value, int attr)
 {
     HTMLOptionsCollection* imp = static_cast<HTMLOptionsCollection*>(impl());
     HTMLSelectElement* base = static_cast<HTMLSelectElement*>(imp->base());
     selectIndexSetter(base, exec, index, value);
 }
 
-KJS::JSValue* JSHTMLOptionsCollection::remove(KJS::ExecState* exec, const KJS::List& args)
+JSValue* JSHTMLOptionsCollection::add(ExecState* exec, const List& args)
+{
+    HTMLOptionsCollection* imp = static_cast<HTMLOptionsCollection*>(impl());
+    HTMLOptionElement* option = toHTMLOptionElement(args[0]);
+    ExceptionCode ec = 0;
+    if (args.size() < 2)
+        imp->add(option, ec);
+    else {
+        bool ok;
+        int index = args[1]->toInt32(exec, ok);
+        if (exec->hadException())
+            return jsUndefined();
+        if (!ok)
+            ec = TYPE_MISMATCH_ERR;
+        else
+            imp->add(option, index, ec);
+    }
+    setDOMException(exec, ec);
+    return jsUndefined();
+}
+
+JSValue* JSHTMLOptionsCollection::remove(ExecState* exec, const List& args)
 {
     HTMLOptionsCollection* imp = static_cast<HTMLOptionsCollection*>(impl());
     JSHTMLSelectElement* base = static_cast<JSHTMLSelectElement*>(toJS(exec, imp->base()));
index 37e5740..0ac4efb 100644 (file)
@@ -1275,78 +1275,86 @@ sub GetNativeTypeFromSignature
     return GetNativeType($type);
 }
 
+my %nativeType = (
+    "AtomicString" => "AtomicString",
+    "CompareHow" => "Range::CompareHow",
+    "DOMString" => "String",
+    "EventTarget" => "EventTargetNode*",
+    "SVGLength" => "SVGLength",
+    "SVGMatrix" => "AffineTransform",
+    "SVGNumber" => "float",
+    "SVGPaintType" => "SVGPaint::SVGPaintType",
+    "SVGPoint" => "FloatPoint",
+    "SVGRect" => "FloatRect",
+    "SVGTransform" => "SVGTransform",
+    "boolean" => "bool",
+    "double" => "double",
+    "float" => "float",
+    "long" => "int",
+    "unsigned long" => "unsigned",
+    "unsigned short" => "unsigned short",
+);
+
 sub GetNativeType
 {
     my $type = shift;
 
-    return "unsigned" if $type eq "unsigned long";
-    return $type if $type eq "unsigned short" or $type eq "float" or $type eq "double" or $type eq "AtomicString";
-    return "bool" if $type eq "boolean";
-    return "int" if $type eq "long";
-    return "String" if $type eq "DOMString";
-    return "Range::CompareHow" if $type eq "CompareHow";
-    return "EventTargetNode*" if $type eq "EventTarget";
-    return "FloatRect" if $type eq "SVGRect";
-    return "FloatPoint" if $type eq "SVGPoint";
-    return "AffineTransform" if $type eq "SVGMatrix";
-    return "SVGTransform" if $type eq "SVGTransform";
-    return "SVGLength" if $type eq "SVGLength";
-    return "float" if $type eq "SVGNumber";
-    return "SVGPaint::SVGPaintType" if $type eq "SVGPaintType";
-
-    # Default, assume native type is a pointer with same type name as idl type
+    return $nativeType{$type} if exists $nativeType{$type};
+
+    # For all other types, the native type is a pointer with same type name as the IDL type.
     return "${type}*";
 }
 
+my %typeCanFailConversion = (
+    "AtomicString" => 0,
+    "Attr" => 1,
+    "CompareHow" => 0,
+    "DOMString" => 0,
+    "DOMWindow" => 0,
+    "DocumentType" => 0,
+    "Element" => 0,
+    "Event" => 0,
+    "EventListener" => 0,
+    "EventTarget" => 0,
+    "HTMLElement" => 0,
+    "HTMLOptionElement" => 0,
+    "Node" => 0,
+    "NodeFilter" => 0,
+    "Range" => 0,
+    "SQLResultSet" => 0,
+    "SVGAngle" => 0,
+    "SVGElement" => 0,
+    "SVGLength" => 0,
+    "SVGMatrix" => 0,
+    "SVGNumber" => 0,
+    "SVGPaintType" => 0,
+    "SVGPathSeg" => 0,
+    "SVGPoint" => 0,
+    "SVGRect" => 0,
+    "SVGTransform" => 0,
+    "VoidCallback" => 1,
+    "XPathEvaluator" => 0,
+    "XPathNSResolver" => 0,
+    "XPathResult" => 0,
+    "boolean" => 0,
+    "double" => 0,
+    "float" => 0,
+    "long" => 0,
+    "unsigned long" => 0,
+    "unsigned short" => 0,
+);
+
 sub TypeCanFailConversion
 {
     my $signature = shift;
 
     my $type = $codeGenerator->StripModule($signature->type);
 
-    # FIXME: convert to use a hash
-
-    return 0 if $type eq "boolean" or
-                $type eq "float" or
-                $type eq "double" or
-                $type eq "AtomicString" or
-                $type eq "DOMString" or
-                $type eq "Node" or
-                $type eq "Element" or
-                $type eq "DocumentType" or
-                $type eq "Event" or
-                $type eq "EventListener" or
-                $type eq "EventTarget" or
-                $type eq "Range" or
-                $type eq "NodeFilter" or
-                $type eq "DOMWindow" or
-                $type eq "SQLResultSet" or
-                $type eq "XPathEvaluator" or
-                $type eq "XPathNSResolver" or
-                $type eq "XPathResult" or
-                $type eq "SVGAngle" or
-                $type eq "SVGLength" or
-                $type eq "SVGNumber" or
-                $type eq "SVGPoint" or
-                $type eq "SVGTransform" or
-                $type eq "SVGPathSeg" or
-                $type eq "SVGMatrix" or
-                $type eq "SVGRect" or
-                $type eq "SVGElement" or
-                $type eq "HTMLElement" or
-                $type eq "HTMLOptionElement" or
-                $type eq "unsigned short" or # or can it?
-                $type eq "CompareHow" or # or can it?
-                $type eq "SVGPaintType"; # or can it?
-
-    return 1 if $type eq "VoidCallback";
-
-    if ($type eq "unsigned long" or $type eq "long" or $type eq "Attr") {
-        $implIncludes{"ExceptionCode.h"} = 1;
-        return 1;
-    }
-
-    die "Don't know whether a JS value can fail conversion to type $type."
+    $implIncludes{"ExceptionCode.h"} = 1 if $type eq "Attr";
+
+    return $typeCanFailConversion{$type} if exists $typeCanFailConversion{$type};
+
+    die "Don't know whether a JS value can fail conversion to type $type.";
 }
 
 sub JSValueToNative
index e30dbf3..30cbd2a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * (C) 1999-2003 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -56,7 +56,6 @@ public:
     int addRule(const String& selector, const String& style, int index, ExceptionCode&);
     int addRule(const String& selector, const String& style, ExceptionCode&);
     void removeRule(unsigned index, ExceptionCode& ec) { deleteRule(index, ec); }
-    void removeRule(ExceptionCode& ec) { deleteRule(0, ec); }
 
     void addNamespace(CSSParser*, const AtomicString& prefix, const AtomicString& uri);
     const AtomicString& determineNamespace(const AtomicString& prefix);
index 7f7d41a..dacaeb5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
  *
  * This library is free software; you can redistribute it and/or
@@ -41,7 +41,7 @@ module css {
                      in DOMString style,
                      in [Optional] unsigned long index)
             raises(DOMException);
-        void removeRule(in [Optional] unsigned long index)
+        void removeRule(in unsigned long index)
             raises(DOMException);
     };
 
index c57d8f4..99de500 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 #include "config.h"
 #include "ProgressEvent.h"
 
-#include "EventNames.h"
-
 namespace WebCore {
     
-using namespace EventNames;
-    
 ProgressEvent::ProgressEvent()
     : m_lengthComputable(false)
     , m_loaded(0)
@@ -48,30 +44,20 @@ ProgressEvent::ProgressEvent(const AtomicString& type, bool lengthComputable, un
 }
     
 void ProgressEvent::initProgressEvent(const AtomicString& typeArg, 
-                                      bool /*canBubbleArg*/,
-                                      bool /*cancelableArg*/,
+                                      bool canBubbleArg,
+                                      bool cancelableArg,
                                       bool lengthComputableArg,
                                       unsigned loadedArg,
                                       unsigned totalArg)
 {    
-    initEvent(typeArg, false, true);
-    m_lengthComputable = lengthComputableArg;
-    m_loaded = loadedArg;
-    m_total = totalArg;
-}
+    if (dispatched())
+        return;
+
+    initEvent(typeArg, canBubbleArg, cancelableArg);
 
-void ProgressEvent::initProgressEventNS(const AtomicString& /*namespaceURI*/,
-                                        const AtomicString& typeArg, 
-                                        bool /*canBubbleArg*/,
-                                        bool /*cancelableArg*/,
-                                        bool lengthComputableArg,
-                                        unsigned loadedArg,
-                                        unsigned totalArg)
-{
-    initEvent(typeArg, false, true);
     m_lengthComputable = lengthComputableArg;
     m_loaded = loadedArg;
-    m_total = lengthComputableArg ? totalArg : 0;
+    m_total = totalArg;
 }
 
 }
index 2bfe3eb..e215091 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -32,7 +32,6 @@ namespace WebCore {
     
     class ProgressEvent : public Event {
     public:
-
         ProgressEvent();
         ProgressEvent(const AtomicString& type, bool lengthComputable, unsigned loaded, unsigned total);
 
@@ -42,13 +41,6 @@ namespace WebCore {
                                bool lengthComputableArg,
                                unsigned loadedArg,
                                unsigned totalArg);
-        void initProgressEventNS(const AtomicString& namespaceURI,
-                                 const AtomicString& typeArg, 
-                                 bool canBubbleArg,
-                                 bool cancelableArg,
-                                 bool lengthComputableArg,
-                                 unsigned loadedArg,
-                                 unsigned totalArg);
         
         bool lengthComputable() const { return m_lengthComputable; }
         unsigned loaded() const { return m_loaded; }
index 4bc27c2..2db72af 100644 (file)
@@ -37,13 +37,6 @@ module events {
                                               in boolean       lengthComputableArg,
                                               in unsigned long loadedArg,
                                               in unsigned long totalArg);
-         void               initProgressEventNS(in DOMString namespaceURI,
-                                                in DOMString typeArg,
-                                                in boolean       canBubbleArg,
-                                                in boolean       cancelableArg,
-                                                in boolean       lengthComputableArg,
-                                                in unsigned long loadedArg,
-                                                in unsigned long totalArg);
     };
 
 }
index f997bf3..176c07b 100644 (file)
@@ -1131,8 +1131,7 @@ PassRefPtr<DocumentFragment> Range::createContextualFragment(const String &html,
     }
 
     Node* htmlElement = m_startContainer->isHTMLElement() ? m_startContainer.get() : m_startContainer->parentNode();
-    
-    if (!htmlElement->isHTMLElement()) {
+    if (!htmlElement || !htmlElement->isHTMLElement()) {
         ec = NOT_SUPPORTED_ERR;
         return 0;
     }
index 6f58765..226f3d7 100644 (file)
@@ -32,7 +32,7 @@ module html {
                  attribute [Custom] unsigned long length
                         setter raises (DOMException);
 
-        void add(in HTMLOptionElement option, in [Optional] unsigned long index)
+        [Custom] void add(in HTMLOptionElement option, in [Optional] unsigned long index)
              raises (DOMException);
         [Custom] void remove(in unsigned long index);
 
index 9088484..66b567a 100644 (file)
@@ -219,13 +219,6 @@ void DOMSelection::setPosition(Node* node, int offset, ExceptionCode& ec)
     m_frame->selectionController()->moveTo(VisiblePosition(node, offset, DOWNSTREAM));
 }
 
-void DOMSelection::setPosition(Node* node, ExceptionCode& ec)
-{
-    if (!m_frame)
-        return;
-    m_frame->selectionController()->moveTo(VisiblePosition(node, 0, DOWNSTREAM));
-}
-
 void DOMSelection::modify(const String& alterString, const String& directionString, const String& granularityString)
 {
     if (!m_frame)
index 1af372c..d4a579f 100644 (file)
@@ -59,7 +59,6 @@ namespace WebCore {
         String type() const;
         void setBaseAndExtent(Node* baseNode, int baseOffset, Node* extentNode, int extentOffset, ExceptionCode&);
         void setPosition(Node*, int offset, ExceptionCode&);
-        void setPosition(Node*, ExceptionCode&);
         void modify(const String& alter, const String& direction, const String& granularity);
 
         // Mozilla Selection Object API
index 84198dc..85d23bf 100644 (file)
@@ -52,7 +52,7 @@ module window {
         void empty();
         void setBaseAndExtent(in Node baseNode, in long baseOffset, in Node extentNode, in long extentOffset)
             raises(DOMException);
-        void setPosition(in Node node, in [Optional] long offset)
+        void setPosition(in Node node, in long offset)
             raises(DOMException);
         void modify(in DOMString alter, in DOMString direction, in DOMString granularity);
         void extend(in Node node, in long offset)
index 82585b6..78e95d2 100644 (file)
@@ -69,11 +69,17 @@ namespace WebCore {
 //    the screen rect.
 void DOMWindow::adjustWindowRect(const FloatRect& screen, FloatRect& window, const FloatRect& pendingChanges)
 {
-    // Make sure we're in a valid state before adjusting dimensions
-    ASSERT(!isnan(screen.x()) && !isnan(screen.y()) && !isnan(screen.width()) && !isnan(screen.height()) &&
-           !isnan(window.x()) && !isnan(window.y()) && !isnan(window.width()) && !isnan(window.height()));
+    // Make sure we're in a valid state before adjusting dimensions.
+    ASSERT(isfinite(screen.x()));
+    ASSERT(isfinite(screen.y()));
+    ASSERT(isfinite(screen.width()));
+    ASSERT(isfinite(screen.height()));
+    ASSERT(isfinite(window.x()));
+    ASSERT(isfinite(window.y()));
+    ASSERT(isfinite(window.width()));
+    ASSERT(isfinite(window.height()));
     
-    // Update window values if they are not NaN
+    // Update window values if new requested values are not NaN.
     if (!isnan(pendingChanges.x()))
         window.setX(pendingChanges.x());
     if (!isnan(pendingChanges.y()))
@@ -83,20 +89,13 @@ void DOMWindow::adjustWindowRect(const FloatRect& screen, FloatRect& window, con
     if (!isnan(pendingChanges.height()))
         window.setHeight(pendingChanges.height());
     
-    // Resize the window to between 100 and the screen width and height if it's
-    // outside of those ranges.
+    // Resize the window to between 100 and the screen width and height.
     window.setWidth(min(max(100.0f, window.width()), screen.width()));
     window.setHeight(min(max(100.0f, window.height()), screen.height()));
     
-    // Constrain the window to the top and left of the screen if it's left or
-    // above it.
-    window.setX(max(window.x(), screen.x()));
-    window.setY(max(window.y(), screen.y()));
-
-    // Constrain the window to the bottom and right of the screen if it's past
-    // the right or below it.
-    window.setX(window.x() - max(0.0f, window.right() - screen.width() - screen.x()));
-    window.setY(window.y() - max(0.0f, window.bottom() - screen.height() - screen.y()));
+    // Constrain the window position to the screen.
+    window.setX(max(screen.x(), min(window.x(), screen.right() - window.width())));
+    window.setY(max(screen.y(), min(window.y(), screen.bottom() - window.height())));
 }
 
 DOMWindow::DOMWindow(Frame* frame)
index 8a63d43..a00cd0e 100644 (file)
@@ -1,3 +1,11 @@
+2008-02-04  Darin Adler  <darin@apple.com>
+
+        Reviewed by Geoff.
+
+        * Scripts/make-js-test-wrappers: Look at the whole LayoutTests tree, not just the fast
+        and svg subdirectories. Added some more exceptions for the benefit of the fast/dom
+        subdirectory.
+
 2008-02-04  Adam Roben  <aroben@apple.com>
 
         Windows Apple-only build fix
index 8e72f3d..e89d156 100755 (executable)
@@ -40,7 +40,7 @@ use strict;
 
 chdirWebKit();
 
-my @templates = `find LayoutTests/fast LayoutTests/svg -name "TEMPLATE.html"`;
+my @templates = `find LayoutTests -name "TEMPLATE.html"`;
 
 for my $tfile (@templates) {
 
@@ -70,8 +70,16 @@ for my $tfile (@templates) {
     for my $file (@files) {
         chomp $file;
         next if $file =~ /js-test-.*\.js$/;
+        next if $file =~ m:resources/attr-case-sensitivity\.js$:;
+        next if $file =~ m:resources/frame-loading-via-document-write\.js$:;
         next if $file =~ m:resources/intersectsNode\.js$:;
+        next if $file =~ m:resources/script-element-gc\.js$:;
+        next if $file =~ m:resources/script-element-gc\.js$:;
+        next if $file =~ m:resources/script3\.js$:;
+        next if $file =~ m:resources/script4\.js$:;
+        next if $file =~ m:resources/script5\.js$:;
         next if $file =~ m:resources/select-options-remove\.js$:;
+        next if $file =~ m:resources/wrapper-identity-base\.js$:;
 
         my $html = $file;
         $html =~ s:resources/(.*)\.js:$1.html:;