Changeset 126127 in webkit
- Timestamp:
- Aug 20, 2012 8:22:06 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r126124 r126127 1 2012-08-20 Shinya Kawanaka <shinyak@chromium.org> 2 3 ShadowRoot.cloneNode() must always throw a DATA_CLONE_ERR exception. 4 https://bugs.webkit.org/show_bug.cgi?id=91704 5 6 Reviewed by Dimitri Glazkov. 7 8 * fast/dom/shadow/shadowroot-clonenode-expected.txt: Added. 9 * fast/dom/shadow/shadowroot-clonenode.html: Added. 10 1 11 2012-08-20 Kenneth Russell <kbr@google.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r126126 r126127 1 2012-08-20 Shinya Kawanaka <shinyak@chromium.org> 2 3 ShadowRoot.cloneNode() must always throw a DATA_CLONE_ERR exception. 4 https://bugs.webkit.org/show_bug.cgi?id=91704 5 6 Reviewed by Dimitri Glazkov. 7 8 According to the spec, ShadowRoot.cloneNode() should throw a DATA_CLONE_ERR exception. The existing implementation 9 returned null object instead. 10 11 We change the cloneNode() interface so that we can throw an exception from cloneNode(). 12 13 Test: fast/dom/shadow/shadowroot-clonenode.html 14 15 * dom/Attr.cpp: 16 (WebCore::Attr::cloneNode): 17 * dom/Attr.h: 18 * dom/CDATASection.cpp: 19 (WebCore::CDATASection::cloneNode): 20 * dom/CDATASection.h: 21 (CDATASection): 22 * dom/Comment.cpp: 23 (WebCore::Comment::cloneNode): 24 * dom/Comment.h: 25 (Comment): 26 * dom/Document.cpp: 27 (WebCore::Document::cloneNode): 28 * dom/Document.h: 29 (Document): 30 * dom/DocumentFragment.cpp: 31 (WebCore::DocumentFragment::cloneNode): 32 * dom/DocumentFragment.h: 33 (DocumentFragment): 34 * dom/DocumentType.cpp: 35 (WebCore::DocumentType::cloneNode): 36 * dom/DocumentType.h: 37 (DocumentType): 38 * dom/Element.cpp: 39 (WebCore::Element::cloneNode): 40 * dom/Element.h: 41 (Element): 42 * dom/EntityReference.cpp: 43 (WebCore::EntityReference::cloneNode): 44 * dom/EntityReference.h: 45 (EntityReference): 46 * dom/Node.h: 47 (Node): 48 (WebCore::Node::cloneNode): 49 * dom/Node.idl: 50 * dom/ProcessingInstruction.cpp: 51 (WebCore::ProcessingInstruction::cloneNode): 52 * dom/ProcessingInstruction.h: 53 (ProcessingInstruction): 54 * dom/ShadowRoot.cpp: 55 (WebCore::ShadowRoot::cloneNode): 56 * dom/ShadowRoot.h: 57 (ShadowRoot): 58 * dom/Text.cpp: 59 (WebCore::Text::cloneNode): 60 * dom/Text.h: 61 (Text): 62 1 63 2012-08-20 Kent Tamura <tkent@chromium.org> 2 64 -
trunk/Source/WebCore/dom/Attr.cpp
r122637 r126127 139 139 } 140 140 141 PassRefPtr<Node> Attr::cloneNode(bool /*deep*/ )141 PassRefPtr<Node> Attr::cloneNode(bool /*deep*/, ExceptionCode&) 142 142 { 143 143 RefPtr<Attr> clone = adoptRef(new Attr(document(), qualifiedName(), value())); -
trunk/Source/WebCore/dom/Attr.h
r117195 r126127 82 82 virtual String nodeValue() const OVERRIDE { return value(); } 83 83 virtual void setNodeValue(const String&, ExceptionCode&); 84 virtual PassRefPtr<Node> cloneNode(bool deep );84 virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&); 85 85 86 86 virtual bool isAttributeNode() const { return true; } -
trunk/Source/WebCore/dom/CDATASection.cpp
r83816 r126127 47 47 } 48 48 49 PassRefPtr<Node> CDATASection::cloneNode(bool /*deep*/ )49 PassRefPtr<Node> CDATASection::cloneNode(bool /*deep*/, ExceptionCode&) 50 50 { 51 51 return create(document(), data()); -
trunk/Source/WebCore/dom/CDATASection.h
r83816 r126127 37 37 virtual String nodeName() const; 38 38 virtual NodeType nodeType() const; 39 virtual PassRefPtr<Node> cloneNode(bool deep );39 virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&); 40 40 virtual bool childTypeAllowed(NodeType) const; 41 41 virtual PassRefPtr<Text> virtualCreate(const String&); -
trunk/Source/WebCore/dom/Comment.cpp
r113312 r126127 47 47 } 48 48 49 PassRefPtr<Node> Comment::cloneNode(bool /*deep*/ )49 PassRefPtr<Node> Comment::cloneNode(bool /*deep*/, ExceptionCode&) 50 50 { 51 51 return create(document(), data()); -
trunk/Source/WebCore/dom/Comment.h
r83816 r126127 37 37 virtual String nodeName() const; 38 38 virtual NodeType nodeType() const; 39 virtual PassRefPtr<Node> cloneNode(bool deep );39 virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&); 40 40 virtual bool childTypeAllowed(NodeType) const; 41 41 }; -
trunk/Source/WebCore/dom/Document.cpp
r126113 r126127 3286 3286 } 3287 3287 3288 PassRefPtr<Node> Document::cloneNode(bool /*deep*/ )3288 PassRefPtr<Node> Document::cloneNode(bool /*deep*/, ExceptionCode&) 3289 3289 { 3290 3290 // Spec says cloning Document nodes is "implementation dependent" -
trunk/Source/WebCore/dom/Document.h
r126113 r126127 1207 1207 virtual NodeType nodeType() const; 1208 1208 virtual bool childTypeAllowed(NodeType) const; 1209 virtual PassRefPtr<Node> cloneNode(bool deep );1209 virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&); 1210 1210 virtual bool canReplaceChild(Node* newChild, Node* oldChild); 1211 1211 -
trunk/Source/WebCore/dom/DocumentFragment.cpp
r106530 r126127 69 69 } 70 70 71 PassRefPtr<Node> DocumentFragment::cloneNode(bool deep )71 PassRefPtr<Node> DocumentFragment::cloneNode(bool deep, ExceptionCode&) 72 72 { 73 73 RefPtr<DocumentFragment> clone = create(document()); -
trunk/Source/WebCore/dom/DocumentFragment.h
r117731 r126127 45 45 private: 46 46 virtual NodeType nodeType() const; 47 virtual PassRefPtr<Node> cloneNode(bool deep );47 virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&); 48 48 virtual bool childTypeAllowed(NodeType) const; 49 49 }; -
trunk/Source/WebCore/dom/DocumentType.cpp
r118192 r126127 52 52 } 53 53 54 PassRefPtr<Node> DocumentType::cloneNode(bool /*deep*/ )54 PassRefPtr<Node> DocumentType::cloneNode(bool /*deep*/, ExceptionCode&) 55 55 { 56 56 return create(document(), m_name, m_publicId, m_systemId); -
trunk/Source/WebCore/dom/DocumentType.h
r118192 r126127 53 53 virtual String nodeName() const; 54 54 virtual NodeType nodeType() const; 55 virtual PassRefPtr<Node> cloneNode(bool deep );55 virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&); 56 56 57 57 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; -
trunk/Source/WebCore/dom/Element.cpp
r125951 r126127 177 177 DEFINE_VIRTUAL_ATTRIBUTE_EVENT_LISTENER(Element, load); 178 178 179 PassRefPtr<Node> Element::cloneNode(bool deep )179 PassRefPtr<Node> Element::cloneNode(bool deep, ExceptionCode&) 180 180 { 181 181 return deep ? cloneElementWithChildren() : cloneElementWithoutChildren(); -
trunk/Source/WebCore/dom/Element.h
r125009 r126127 502 502 // cloneNode is private so that non-virtual cloneElementWithChildren and cloneElementWithoutChildren 503 503 // are used instead. 504 virtual PassRefPtr<Node> cloneNode(bool deep );504 virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&); 505 505 virtual PassRefPtr<Element> cloneElementWithoutAttributesAndChildren(); 506 506 -
trunk/Source/WebCore/dom/EntityReference.cpp
r58914 r126127 47 47 } 48 48 49 PassRefPtr<Node> EntityReference::cloneNode(bool )49 PassRefPtr<Node> EntityReference::cloneNode(bool, ExceptionCode&) 50 50 { 51 51 return create(document(), m_entityName); -
trunk/Source/WebCore/dom/EntityReference.h
r47313 r126127 36 36 virtual String nodeName() const; 37 37 virtual NodeType nodeType() const; 38 virtual PassRefPtr<Node> cloneNode(bool deep );38 virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&); 39 39 40 40 String m_entityName; -
trunk/Source/WebCore/dom/Node.h
r124954 r126127 28 28 #include "EditingBoundary.h" 29 29 #include "EventTarget.h" 30 #include "ExceptionCodePlaceholder.h" 30 31 #include "KURLHash.h" 31 32 #include "LayoutTypes.h" … … 187 188 void remove(ExceptionCode&); 188 189 bool hasChildNodes() const { return firstChild(); } 189 virtual PassRefPtr<Node> cloneNode(bool deep) = 0; 190 virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&) = 0; 191 PassRefPtr<Node> cloneNode(bool deep) { return cloneNode(deep, ASSERT_NO_EXCEPTION); } 190 192 const AtomicString& localName() const { return virtualLocalName(); } 191 193 const AtomicString& namespaceURI() const { return virtualNamespaceURI(); } -
trunk/Source/WebCore/dom/Node.idl
r112424 r126127 80 80 81 81 boolean hasChildNodes(); 82 Node cloneNode(in [Optional=DefaultIsUndefined] boolean deep); 82 Node cloneNode(in [Optional=DefaultIsUndefined] boolean deep) 83 raises(DOMException); 84 83 85 void normalize(); 84 86 -
trunk/Source/WebCore/dom/ProcessingInstruction.cpp
r125805 r126127 98 98 } 99 99 100 PassRefPtr<Node> ProcessingInstruction::cloneNode(bool /*deep*/ )100 PassRefPtr<Node> ProcessingInstruction::cloneNode(bool /*deep*/, ExceptionCode&) 101 101 { 102 102 // FIXME: Is it a problem that this does not copy m_localHref? -
trunk/Source/WebCore/dom/ProcessingInstruction.h
r118963 r126127 61 61 virtual String nodeValue() const; 62 62 virtual void setNodeValue(const String&, ExceptionCode&); 63 virtual PassRefPtr<Node> cloneNode(bool deep );63 virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&); 64 64 virtual bool offsetInCharacters() const; 65 65 virtual int maxCharacterOffset() const; -
trunk/Source/WebCore/dom/ShadowRoot.cpp
r124027 r126127 140 140 } 141 141 142 PassRefPtr<Node> ShadowRoot::cloneNode(bool )142 PassRefPtr<Node> ShadowRoot::cloneNode(bool, ExceptionCode& ec) 143 143 { 144 144 // ShadowRoot should not be arbitrarily cloned. 145 ec = DATA_CLONE_ERR; 145 146 return 0; 146 147 } -
trunk/Source/WebCore/dom/ShadowRoot.h
r123451 r126127 98 98 virtual ~ShadowRoot(); 99 99 virtual String nodeName() const; 100 virtual PassRefPtr<Node> cloneNode(bool deep );100 virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&); 101 101 virtual bool childTypeAllowed(NodeType) const; 102 102 virtual void childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) OVERRIDE; -
trunk/Source/WebCore/dom/Text.cpp
r121123 r126127 185 185 } 186 186 187 PassRefPtr<Node> Text::cloneNode(bool /*deep*/ )187 PassRefPtr<Node> Text::cloneNode(bool /*deep*/, ExceptionCode&) 188 188 { 189 189 return create(document(), data()); -
trunk/Source/WebCore/dom/Text.h
r117242 r126127 59 59 virtual String nodeName() const; 60 60 virtual NodeType nodeType() const; 61 virtual PassRefPtr<Node> cloneNode(bool deep );61 virtual PassRefPtr<Node> cloneNode(bool deep, ExceptionCode&); 62 62 virtual bool rendererIsNeeded(const NodeRenderingContext&); 63 63 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
Note: See TracChangeset
for help on using the changeset viewer.