Show
Ignore:
Timestamp:
02/12/07 15:24:15 (2 years ago)
Author:
andersca
Message:

LayoutTests:

Reviewed by Darin.

<rdar://problem/4846962>
Aperture: Aperture 1.5 - DOM exception occurs when exporting a web gallery

  • fast/dom/Document/replace-child-expected.txt: Added.
  • fast/dom/Document/replace-child.html: Added.

WebCore:

Reviewed by Darin.

<rdar://problem/4846962>
Aperture: Aperture 1.5 - DOM exception occurs when exporting a web gallery

  • dom/ContainerNode.cpp: (WebCore::ContainerNode::replaceChild): Call checkReplaceChild here.


  • dom/Document.cpp: (WebCore::Document::canReplaceChild):
  • dom/Document.h: Add implementation of canReplaceChild that makes sure that doing the replacement won't cause more than one element and document type node to end up in the document.


  • dom/Node.cpp: (WebCore::Node::canReplaceChild): Base implementation of canReplaceChild.


(WebCore::Node::checkReplaceChild):
New function that does what checAddChild does but calls canReplaceChild.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/dom/Node.h

    r19364 r19584  
    338338    virtual bool childAllowed(Node* newChild);          // Error-checking during parsing that checks the DTD 
    339339 
     340    void checkReplaceChild(Node* newChild, Node* oldChild, ExceptionCode&); 
     341    virtual bool canReplaceChild(Node* newChild, Node* oldChild); 
     342     
    340343    // Used to determine whether range offsets use characters or node indices. 
    341344    virtual bool offsetInCharacters() const;