Changeset 34315 in webkit


Ignore:
Timestamp:
Jun 2, 2008 12:51:32 PM (16 years ago)
Author:
jchaffraix@webkit.org
Message:

WebCore:

2008-06-02 Julien Chaffraix <jchaffraix@webkit.org>

Reviewed by Darin.

Bug 18066: REGRESSION: createAttribute throws NAMESPACE_ERR exception
https://bugs.webkit.org/show_bug.cgi?id=18066

Test: fast/dom/createAttribute-exception.html

  • dom/Document.cpp: (WebCore::Document::createAttributeNS):
  • dom/Document.h: Add a bool parameter shouldIgnoreNamespaceChecks to createNamespaceNS() used by createAttribute() to bypass namespace checking.

LayoutTests:

2008-06-02 Julien Chaffraix <jchaffraix@webkit.org>

Reviewed by Darin.

Bug 18066: REGRESSION: createAttribute throws NAMESPACE_ERR exception
https://bugs.webkit.org/show_bug.cgi?id=18066

  • fast/dom/createAttribute-exception-expected.txt: Added.
  • fast/dom/createAttribute-exception.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r34312 r34315  
     12008-06-02  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Reviewed by Darin.
     4
     5        Bug 18066: REGRESSION: createAttribute throws NAMESPACE_ERR exception
     6        https://bugs.webkit.org/show_bug.cgi?id=18066
     7
     8        * fast/dom/createAttribute-exception-expected.txt: Added.
     9        * fast/dom/createAttribute-exception.html: Added.
     10
    1112008-06-02  Darin Adler  <darin@apple.com>
    212
  • trunk/WebCore/ChangeLog

    r34312 r34315  
     12008-06-02  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Reviewed by Darin.
     4
     5        Bug 18066: REGRESSION: createAttribute throws NAMESPACE_ERR exception
     6        https://bugs.webkit.org/show_bug.cgi?id=18066
     7
     8        Test: fast/dom/createAttribute-exception.html
     9
     10        * dom/Document.cpp:
     11        (WebCore::Document::createAttributeNS):
     12        * dom/Document.h: Add a bool parameter shouldIgnoreNamespaceChecks
     13        to createNamespaceNS() used by createAttribute() to bypass namespace
     14        checking.
     15
    1162008-06-02  Darin Adler  <darin@apple.com>
    217
  • trunk/WebCore/dom/Document.cpp

    r33577 r34315  
    36093609}
    36103610
    3611 PassRefPtr<Attr> Document::createAttributeNS(const String& namespaceURI, const String& qualifiedName, ExceptionCode& ec)
     3611PassRefPtr<Attr> Document::createAttributeNS(const String& namespaceURI, const String& qualifiedName, ExceptionCode& ec, bool shouldIgnoreNamespaceChecks)
    36123612{
    36133613    String prefix, localName;
     
    36163616
    36173617    QualifiedName qName(prefix, localName, namespaceURI);
    3618     if (hasPrefixNamespaceMismatch(qName)) {
     3618    if (!shouldIgnoreNamespaceChecks && hasPrefixNamespaceMismatch(qName)) {
    36193619        ec = NAMESPACE_ERR;
    36203620        return 0;
     
    36223622
    36233623    // Spec: DOM Level 2 Core: http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-DocCrAttrNS
    3624     if (qName.localName() == "xmlns" && qName.namespaceURI() != "http://www.w3.org/2000/xmlns/") {
     3624    if (!shouldIgnoreNamespaceChecks && qName.localName() == "xmlns" && qName.namespaceURI() != "http://www.w3.org/2000/xmlns/") {
    36253625        ec = NAMESPACE_ERR;
    36263626        return 0;
  • trunk/WebCore/dom/Document.h

    r33577 r34315  
    210210    PassRefPtr<CDATASection> createCDATASection(const String& data, ExceptionCode&);
    211211    PassRefPtr<ProcessingInstruction> createProcessingInstruction(const String& target, const String& data, ExceptionCode&);
    212     PassRefPtr<Attr> createAttribute(const String& name, ExceptionCode& ec) { return createAttributeNS(String(), name, ec); }
    213     PassRefPtr<Attr> createAttributeNS(const String& namespaceURI, const String& qualifiedName, ExceptionCode&);
     212    PassRefPtr<Attr> createAttribute(const String& name, ExceptionCode& ec) { return createAttributeNS(String(), name, ec, true); }
     213    PassRefPtr<Attr> createAttributeNS(const String& namespaceURI, const String& qualifiedName, ExceptionCode&, bool shouldIgnoreNamespaceChecks = false);
    214214    PassRefPtr<EntityReference> createEntityReference(const String& name, ExceptionCode&);
    215215    PassRefPtr<Node> importNode(Node* importedNode, bool deep, ExceptionCode&);
Note: See TracChangeset for help on using the changeset viewer.