Skip to content
Permalink
Browse files
WebCore:
        Reviewed by Darin.

        Patch for http://bugs.webkit.org/show_bug.cgi?id=16637
        Acid3 expects ExeceptionCode constants to be defined on DOMException objects

        - Make DOMException a real JS object.

        Test: fast/dom/DOMException/prototype-object.html

        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:

        This is no longer needed as the autogenerated classes now includes the
        constructor.
        * bindings/js/JSDOMExceptionConstructor.cpp: Removed.
        * bindings/js/JSDOMExceptionConstructor.h: Removed.

        Create on demand and use the new class for DOMExceptions.
        * bindings/js/kjs_binding.cpp:
        (KJS::setDOMException):

        Remove no longer needed custom constructor getter.
        * bindings/js/kjs_window.cpp:
        (KJS::Window::getValueProperty):

        Don't expose DOMCoreException as the name of class by special casing
        the user visible class name to be DOMException.
        * bindings/scripts/CodeGeneratorJS.pm:

        The DOMException class/file needs to be named DOMCoreException because there is
        name conflict with one of the Objective-C bindings classes.  It should be renamed
        to DOMException when the Objective-C bindings are moved into WebKit.
        * dom/DOMCoreException.cpp: Added.
        (WebCore::DOMCoreException::DOMCoreException):
        (WebCore::DOMCoreException::toString):
        * dom/DOMCoreException.h: Added.
        (WebCore::DOMCoreException::):
        (WebCore::DOMCoreException::code):
        (WebCore::DOMCoreException::name):
        (WebCore::DOMCoreException::message):
        * dom/DOMCoreException.idl: Added.
        * page/DOMWindow.idl:

LayoutTests:

        Reviewed by Darin.

        Test for http://bugs.webkit.org/show_bug.cgi?id=16637
        Acid3 expects ExeceptionCode constants to be defined on DOMException objects

        * fast/dom/DOMException: Added.
        * fast/dom/DOMException/prototype-object-expected.txt: Added.
        * fast/dom/DOMException/prototype-object.html: Added.
        * fast/dom/DOMException/resources: Added.
        * fast/dom/DOMException/resources/prototype-object.js: Added.
        * fast/dom/Window/window-properties-expected.txt:
        * http/tests/xmlhttprequest/connection-error-sync-expected.txt:



Canonical link: https://commits.webkit.org/22897@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29058 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
weinig committed Jan 1, 2008
1 parent afa40c1 commit d68f26ec2aa2d35a2f7db3aa8993dcbf6ab20cf2
Showing 18 changed files with 395 additions and 183 deletions.
@@ -1,3 +1,18 @@
2007-12-31 Sam Weinig <sam@webkit.org>

Reviewed by Darin.

Test for http://bugs.webkit.org/show_bug.cgi?id=16637
Acid3 expects ExeceptionCode constants to be defined on DOMException objects

* fast/dom/DOMException: Added.
* fast/dom/DOMException/prototype-object-expected.txt: Added.
* fast/dom/DOMException/prototype-object.html: Added.
* fast/dom/DOMException/resources: Added.
* fast/dom/DOMException/resources/prototype-object.js: Added.
* fast/dom/Window/window-properties-expected.txt:
* http/tests/xmlhttprequest/connection-error-sync-expected.txt:

2007-12-31 Darin Adler <darin@apple.com>

* fast/dom/HTMLFormElement/elements-not-in-document-expected.txt: Updated results to expect success.
@@ -0,0 +1,16 @@
DOMException needs a real prototype: http://bugs.webkit.org/show_bug.cgi?id=16637

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


PASS e.toString() is "Error: HIERARCHY_REQUEST_ERR: DOM Exception 3"
PASS Object.prototype.toString.call(e) is "[object DOMException]"
PASS Object.prototype.toString.call(e.__proto__) is "[object DOMExceptionPrototype]"
PASS e.constructor.toString() is "[object DOMExceptionConstructor]"
PASS e.constructor is window.DOMException
PASS e.HIERARCHY_REQUEST_ERR is e.constructor.HIERARCHY_REQUEST_ERR
PASS e.HIERARCHY_REQUEST_ERR is 3
PASS successfullyParsed is true

TEST COMPLETE

@@ -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/prototype-object.js"></script>
<script src="../../js/resources/js-test-post.js"></script>
</body>
</html>
@@ -0,0 +1,19 @@
description("DOMException needs a real prototype: http://bugs.webkit.org/show_bug.cgi?id=16637")

var e;
try {
document.body.appendChild(document.documentElement);
// raises a HIERARCHY_REQUEST_ERR
} catch (err) {
e = err;
}

shouldBeEqualToString("e.toString()", "Error: HIERARCHY_REQUEST_ERR: DOM Exception 3");
shouldBeEqualToString("Object.prototype.toString.call(e)", "[object DOMException]");
shouldBeEqualToString("Object.prototype.toString.call(e.__proto__)", "[object DOMExceptionPrototype]");
shouldBeEqualToString("e.constructor.toString()", "[object DOMExceptionConstructor]");
shouldBe("e.constructor", "window.DOMException");
shouldBe("e.HIERARCHY_REQUEST_ERR", "e.constructor.HIERARCHY_REQUEST_ERR");
shouldBe("e.HIERARCHY_REQUEST_ERR", "3");

var successfullyParsed = true;
@@ -268,6 +268,41 @@ window.Comment.prototype [printed above as window.CharacterData.prototype]
window.Counter [object CounterConstructor]
window.Counter.prototype [object CounterPrototype]
window.DOMException [object DOMExceptionConstructor]
window.DOMException.DOMSTRING_SIZE_ERR [number]
window.DOMException.HIERARCHY_REQUEST_ERR [number]
window.DOMException.INDEX_SIZE_ERR [number]
window.DOMException.INUSE_ATTRIBUTE_ERR [number]
window.DOMException.INVALID_ACCESS_ERR [number]
window.DOMException.INVALID_CHARACTER_ERR [number]
window.DOMException.INVALID_MODIFICATION_ERR [number]
window.DOMException.INVALID_STATE_ERR [number]
window.DOMException.NAMESPACE_ERR [number]
window.DOMException.NOT_FOUND_ERR [number]
window.DOMException.NOT_SUPPORTED_ERR [number]
window.DOMException.NO_DATA_ALLOWED_ERR [number]
window.DOMException.NO_MODIFICATION_ALLOWED_ERR [number]
window.DOMException.SYNTAX_ERR [number]
window.DOMException.TYPE_MISMATCH_ERR [number]
window.DOMException.VALIDATION_ERR [number]
window.DOMException.WRONG_DOCUMENT_ERR [number]
window.DOMException.prototype [object DOMExceptionPrototype]
window.DOMException.prototype.DOMSTRING_SIZE_ERR [number]
window.DOMException.prototype.HIERARCHY_REQUEST_ERR [number]
window.DOMException.prototype.INDEX_SIZE_ERR [number]
window.DOMException.prototype.INUSE_ATTRIBUTE_ERR [number]
window.DOMException.prototype.INVALID_ACCESS_ERR [number]
window.DOMException.prototype.INVALID_CHARACTER_ERR [number]
window.DOMException.prototype.INVALID_MODIFICATION_ERR [number]
window.DOMException.prototype.INVALID_STATE_ERR [number]
window.DOMException.prototype.NAMESPACE_ERR [number]
window.DOMException.prototype.NOT_FOUND_ERR [number]
window.DOMException.prototype.NOT_SUPPORTED_ERR [number]
window.DOMException.prototype.NO_DATA_ALLOWED_ERR [number]
window.DOMException.prototype.NO_MODIFICATION_ALLOWED_ERR [number]
window.DOMException.prototype.SYNTAX_ERR [number]
window.DOMException.prototype.TYPE_MISMATCH_ERR [number]
window.DOMException.prototype.VALIDATION_ERR [number]
window.DOMException.prototype.WRONG_DOCUMENT_ERR [number]
window.DOMImplementation [object DOMImplementationConstructor]
window.DOMImplementation.prototype [object DOMImplementationPrototype]
window.DOMImplementation.prototype.createCSSStyleSheet [function]
@@ -1,3 +1,3 @@
Test the behavior of a sync XMLHttpRequest that encounters an infinite redirection loop.

Exception Error; code=101; number=undefined (0); message='NETWORK_ERR: XMLHttpRequest Exception 101'
Exception NETWORK_ERR; code=101; number=undefined (0); message='NETWORK_ERR: XMLHttpRequest Exception 101'
@@ -1,3 +1,48 @@
2007-12-31 Sam Weinig <sam@webkit.org>

Reviewed by Darin.

Patch for http://bugs.webkit.org/show_bug.cgi?id=16637
Acid3 expects ExeceptionCode constants to be defined on DOMException objects

- Make DOMException a real JS object.

Test: fast/dom/DOMException/prototype-object.html

* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:

This is no longer needed as the autogenerated classes now includes the
constructor.
* bindings/js/JSDOMExceptionConstructor.cpp: Removed.
* bindings/js/JSDOMExceptionConstructor.h: Removed.

Create on demand and use the new class for DOMExceptions.
* bindings/js/kjs_binding.cpp:
(KJS::setDOMException):

Remove no longer needed custom constructor getter.
* bindings/js/kjs_window.cpp:
(KJS::Window::getValueProperty):

Don't expose DOMCoreException as the name of class by special casing
the user visible class name to be DOMException.
* bindings/scripts/CodeGeneratorJS.pm:

The DOMException class/file needs to be named DOMCoreException because there is
name conflict with one of the Objective-C bindings classes. It should be renamed
to DOMException when the Objective-C bindings are moved into WebKit.
* dom/DOMCoreException.cpp: Added.
(WebCore::DOMCoreException::DOMCoreException):
(WebCore::DOMCoreException::toString):
* dom/DOMCoreException.h: Added.
(WebCore::DOMCoreException::):
(WebCore::DOMCoreException::code):
(WebCore::DOMCoreException::name):
(WebCore::DOMCoreException::message):
* dom/DOMCoreException.idl: Added.
* page/DOMWindow.idl:

2007-12-31 Sam Weinig <sam@webkit.org>

Re-enable querySelector and querySelectorAll and touch the necessary files to not
@@ -332,12 +332,13 @@ all : \
JSConsole.h \
JSCounter.h \
JSCSSStyleDeclaration.h \
JSDatabase.h \
JSDOMCoreException.h \
JSDOMExceptionConstructor.lut.h \
JSDOMImplementation.h \
JSDOMParser.h \
JSDOMSelection.h \
JSDOMWindow.h \
JSDatabase.h \
JSDocument.h \
JSDocumentFragment.h \
JSDocumentType.h \

0 comments on commit d68f26e

Please sign in to comment.