Reviewed by John Sullivan.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Aug 2005 17:12:16 +0000 (17:12 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Aug 2005 17:12:16 +0000 (17:12 +0000)
commit939e1116f3eef9193f89c6b2e38e1324ed0c187d
tree003f92e6a345ea1008b4c3b3f7d80ba689a08c51
parente82645bbd0c4decd1bffd2b643227738c0aa1f33
    Reviewed by John Sullivan.

        - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4551
          implement exceptions for a few XML-specific Document DOM functions

        * khtml/xml/dom_docimpl.h: Added exception codes to the three functions in question.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::createCDATASection): Added exception parameter. Give NOT_SUPPORTED_ERR if the
        document is an HTML document.
        (DocumentImpl::createProcessingInstruction): Added exception parameter. Give INVALID_CHARACTER_ERR
        if target's name is not valid, NOT_SUPPORTED_ERR if the document is an HTML document.
        (DocumentImpl::createEntityReference): Ditto, with entity's name.
        (DocumentImpl::importNode): Pass exception parameter in so we get exceptions in this case too.
        (DocumentImpl::isValidName): Added comment with the specification's rules for valid names.

        * khtml/ecma/kjs_dom.cpp: (KJS::DOMDocumentProtoFunc::callAsFunction): Translate exceptions now
        that the three functions have them.
        * kwq/DOM.mm:
        (-[DOMDocument createCDATASection:]): Ditto.
        (-[DOMDocument createProcessingInstruction::]): Ditto.
        (-[DOMDocument createEntityReference:]): Ditto.

        * khtml/xml/dom_textimpl.cpp: (CDATASectionImpl::cloneNode): Ignore exception. It can never happen
        since name is guaranteed to be valid and document is guaranteed to not be HTML document.

        * khtml/xml/xml_tokenizer.cpp:
        (khtml::XMLTokenizer::processingInstruction): Added code to handle exception.
        (khtml::XMLTokenizer::cdataBlock): Ditto.

        * layout-tests/dom/html/level1/core/documentinvalidcharacterexceptioncreateentref-expected.txt: Now succeeds.
        * layout-tests/dom/html/level1/core/documentinvalidcharacterexceptioncreateentref1-expected.txt: Ditto.
        * layout-tests/dom/html/level1/core/documentinvalidcharacterexceptioncreatepi-expected.txt: Ditto.
        * layout-tests/dom/html/level1/core/documentinvalidcharacterexceptioncreatepi1-expected.txt: Ditto.
        * layout-tests/dom/html/level1/core/hc_attrappendchild4-expected.txt: Ditto.
        * layout-tests/dom/html/level1/core/hc_attrgetvalue2-expected.txt: Ditto.
        * layout-tests/dom/html/level1/core/hc_attrinsertbefore5-expected.txt: Ditto.
        * layout-tests/dom/html/level1/core/hc_attrinsertbefore7-expected.txt: Ditto.
        * layout-tests/dom/html/level1/core/hc_nodevalue03-expected.txt: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@10321 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreateentref-expected.txt
LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreateentref1-expected.txt
LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreatepi-expected.txt
LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreatepi1-expected.txt
LayoutTests/dom/html/level1/core/hc_attrappendchild4-expected.txt
LayoutTests/dom/html/level1/core/hc_attrgetvalue2-expected.txt
LayoutTests/dom/html/level1/core/hc_attrinsertbefore5-expected.txt
LayoutTests/dom/html/level1/core/hc_attrinsertbefore7-expected.txt
LayoutTests/dom/html/level1/core/hc_nodevalue03-expected.txt
WebCore/ChangeLog-2005-12-19
WebCore/khtml/ecma/kjs_dom.cpp
WebCore/khtml/xml/dom_docimpl.cpp
WebCore/khtml/xml/dom_docimpl.h
WebCore/khtml/xml/dom_textimpl.cpp
WebCore/khtml/xml/xml_tokenizer.cpp
WebCore/kwq/DOM.mm