Changeset 199871 in webkit
- Timestamp:
- Apr 21, 2016, 11:19:41 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 2 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r199862 r199871 1 2016-04-21 Chris Dumez <cdumez@apple.com> 2 3 Drop [UsePointersEvenForNonNullableObjectArguments] from Document 4 https://bugs.webkit.org/show_bug.cgi?id=156881 5 6 Reviewed by Darin Adler. 7 8 Add test cases for cases where the type of the exception being thrown 9 has changed. 10 11 * fast/dom/Document/adoptNode-null-expected.txt: Added. 12 * fast/dom/Document/adoptNode-null.html: Added. 13 * fast/dom/Document/importNode-null-expected.txt: Added. 14 * fast/dom/Document/importNode-null.html: Added. 15 * fast/dom/importNode-null-expected.txt: Removed. 16 * fast/dom/importNode-null.html: Removed. 17 1 18 2016-04-21 Dean Jackson <dino@apple.com> 2 19 -
trunk/LayoutTests/imported/w3c/ChangeLog
r199825 r199871 1 2016-04-21 Chris Dumez <cdumez@apple.com> 2 3 Drop [UsePointersEvenForNonNullableObjectArguments] from Document 4 https://bugs.webkit.org/show_bug.cgi?id=156881 5 6 Reviewed by Darin Adler. 7 8 Rebaseline now that more checks are passing. 9 10 * web-platform-tests/dom/interfaces-expected.txt: 11 * web-platform-tests/html/dom/interfaces-expected.txt: 12 1 13 2016-04-21 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt
r197162 r199871 263 263 FAIL Document interface: operation createComment(DOMString) assert_equals: property has wrong .length expected 1 but got 0 264 264 FAIL Document interface: operation createProcessingInstruction(DOMString,DOMString) assert_equals: property has wrong .length expected 2 but got 0 265 FAIL Document interface: operation importNode(Node,boolean) assert_equals: property has wrong .length expected 1 but got 0 266 FAIL Document interface: operation adoptNode(Node) assert_equals: property has wrong .length expected 1 but got 0 265 PASS Document interface: operation importNode(Node,boolean) 266 PASS Document interface: operation adoptNode(Node) 267 267 FAIL Document interface: operation createAttribute(DOMString) assert_equals: property has wrong .length expected 1 but got 0 268 268 FAIL Document interface: operation createAttributeNS(DOMString,DOMString) assert_equals: property has wrong .length expected 2 but got 0 … … 332 332 }" did not throw 333 333 PASS Document interface: xmlDoc must inherit property "importNode" with the proper type (20) 334 FAIL Document interface: calling importNode(Node,boolean) on xmlDoc with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 335 fn.apply(obj, args); 336 }" threw object "Error: NotSupportedError: DOM Exception 9" ("NotSupportedError") expected object "TypeError" ("TypeError") 334 PASS Document interface: calling importNode(Node,boolean) on xmlDoc with too few arguments must throw TypeError 337 335 PASS Document interface: xmlDoc must inherit property "adoptNode" with the proper type (21) 338 FAIL Document interface: calling adoptNode(Node) on xmlDoc with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 339 fn.apply(obj, args); 340 }" threw object "Error: NotSupportedError: DOM Exception 9" ("NotSupportedError") expected object "TypeError" ("TypeError") 336 PASS Document interface: calling adoptNode(Node) on xmlDoc with too few arguments must throw TypeError 341 337 PASS Document interface: xmlDoc must inherit property "createAttribute" with the proper type (22) 342 338 FAIL Document interface: calling createAttribute(DOMString) on xmlDoc with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt
r199650 r199871 168 168 }" did not throw 169 169 PASS Document interface: iframe.contentDocument must inherit property "importNode" with the proper type (20) 170 FAIL Document interface: calling importNode(Node,boolean) on iframe.contentDocument with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 171 fn.apply(obj, args); 172 }" threw object "Error: NotSupportedError: DOM Exception 9" ("NotSupportedError") expected object "TypeError" ("TypeError") 170 PASS Document interface: calling importNode(Node,boolean) on iframe.contentDocument with too few arguments must throw TypeError 173 171 PASS Document interface: iframe.contentDocument must inherit property "adoptNode" with the proper type (21) 174 FAIL Document interface: calling adoptNode(Node) on iframe.contentDocument with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 175 fn.apply(obj, args); 176 }" threw object "Error: NotSupportedError: DOM Exception 9" ("NotSupportedError") expected object "TypeError" ("TypeError") 172 PASS Document interface: calling adoptNode(Node) on iframe.contentDocument with too few arguments must throw TypeError 177 173 PASS Document interface: iframe.contentDocument must inherit property "createAttribute" with the proper type (22) 178 174 FAIL Document interface: calling createAttribute(DOMString) on iframe.contentDocument with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { … … 483 479 }" did not throw 484 480 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "importNode" with the proper type (20) 485 FAIL Document interface: calling importNode(Node,boolean) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 486 fn.apply(obj, args); 487 }" threw object "Error: NotSupportedError: DOM Exception 9" ("NotSupportedError") expected object "TypeError" ("TypeError") 481 PASS Document interface: calling importNode(Node,boolean) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError 488 482 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "adoptNode" with the proper type (21) 489 FAIL Document interface: calling adoptNode(Node) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 490 fn.apply(obj, args); 491 }" threw object "Error: NotSupportedError: DOM Exception 9" ("NotSupportedError") expected object "TypeError" ("TypeError") 483 PASS Document interface: calling adoptNode(Node) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError 492 484 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "createAttribute" with the proper type (22) 493 485 FAIL Document interface: calling createAttribute(DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { -
trunk/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt
r199650 r199871 168 168 }" did not throw 169 169 PASS Document interface: iframe.contentDocument must inherit property "importNode" with the proper type (20) 170 FAIL Document interface: calling importNode(Node,boolean) on iframe.contentDocument with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 171 fn.apply(obj, args); 172 }" threw object "Error: NotSupportedError: DOM Exception 9" ("NotSupportedError") expected object "TypeError" ("TypeError") 170 PASS Document interface: calling importNode(Node,boolean) on iframe.contentDocument with too few arguments must throw TypeError 173 171 PASS Document interface: iframe.contentDocument must inherit property "adoptNode" with the proper type (21) 174 FAIL Document interface: calling adoptNode(Node) on iframe.contentDocument with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 175 fn.apply(obj, args); 176 }" threw object "Error: NotSupportedError: DOM Exception 9" ("NotSupportedError") expected object "TypeError" ("TypeError") 172 PASS Document interface: calling adoptNode(Node) on iframe.contentDocument with too few arguments must throw TypeError 177 173 PASS Document interface: iframe.contentDocument must inherit property "createAttribute" with the proper type (22) 178 174 FAIL Document interface: calling createAttribute(DOMString) on iframe.contentDocument with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { … … 483 479 }" did not throw 484 480 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "importNode" with the proper type (20) 485 FAIL Document interface: calling importNode(Node,boolean) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 486 fn.apply(obj, args); 487 }" threw object "Error: NotSupportedError: DOM Exception 9" ("NotSupportedError") expected object "TypeError" ("TypeError") 481 PASS Document interface: calling importNode(Node,boolean) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError 488 482 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "adoptNode" with the proper type (21) 489 FAIL Document interface: calling adoptNode(Node) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 490 fn.apply(obj, args); 491 }" threw object "Error: NotSupportedError: DOM Exception 9" ("NotSupportedError") expected object "TypeError" ("TypeError") 483 PASS Document interface: calling adoptNode(Node) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError 492 484 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "createAttribute" with the proper type (22) 493 485 FAIL Document interface: calling createAttribute(DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { -
trunk/Source/WebCore/ChangeLog
r199869 r199871 1 2016-04-21 Chris Dumez <cdumez@apple.com> 2 3 Drop [UsePointersEvenForNonNullableObjectArguments] from Document 4 https://bugs.webkit.org/show_bug.cgi?id=156881 5 6 Reviewed by Darin Adler. 7 8 Drop [UsePointersEvenForNonNullableObjectArguments] from Document. There 9 is no major Web-exposed behavior change but the type of the exception 10 being thrown when passing null or not enough parameters has changed for 11 some of the API (It is now always a TypeError as per the Web IDL 12 specification). 13 14 Tests: fast/dom/Document/adoptNode-null.html 15 fast/dom/Document/importNode-null.html 16 17 * dom/ContainerNode.cpp: 18 (WebCore::ContainerNode::takeAllChildrenFrom): 19 (WebCore::ContainerNode::parserInsertBefore): 20 (WebCore::ContainerNode::parserAppendChild): 21 * dom/Document.cpp: 22 (WebCore::Document::importNode): 23 (WebCore::Document::adoptNode): 24 (WebCore::Document::createNodeIterator): 25 (WebCore::Document::createTreeWalker): 26 (WebCore::Document::setBodyOrFrameset): 27 (WebCore::Document::hasValidNamespaceForElements): Deleted. 28 (WebCore::Document::scheduleForcedStyleRecalc): Deleted. 29 (WebCore::Document::scheduleStyleRecalc): Deleted. 30 (WebCore::Document::unscheduleStyleRecalc): Deleted. 31 (WebCore::Document::hasPendingStyleRecalc): Deleted. 32 (WebCore::Document::hasPendingForcedStyleRecalc): Deleted. 33 (WebCore::Document::recalcStyle): Deleted. 34 (WebCore::Document::explicitClose): Deleted. 35 * dom/Document.h: 36 (WebCore::Document::importNode): 37 * dom/Document.idl: 38 * dom/NodeIterator.cpp: 39 (WebCore::NodeIterator::NodeIterator): 40 * dom/NodeIterator.h: 41 (WebCore::NodeIterator::create): 42 1 43 2016-04-21 Frederic Wang <fwang@igalia.com> 2 44 -
trunk/Source/WebCore/dom/ContainerNode.cpp
r199056 r199871 131 131 132 132 // FIXME: We need a no mutation event version of adoptNode. 133 RefPtr<Node> adoptedChild = document().adoptNode( &child.get(), ASSERT_NO_EXCEPTION);133 RefPtr<Node> adoptedChild = document().adoptNode(child, ASSERT_NO_EXCEPTION); 134 134 parserAppendChild(*adoptedChild); 135 135 // FIXME: Together with adoptNode above, the tree scope might get updated recursively twice … … 377 377 378 378 if (&document() != &newChild->document()) 379 document().adoptNode(newChild .ptr(), ASSERT_NO_EXCEPTION);379 document().adoptNode(newChild, ASSERT_NO_EXCEPTION); 380 380 381 381 insertBeforeCommon(nextChild, newChild); … … 719 719 720 720 if (&document() != &newChild->document()) 721 document().adoptNode(newChild .ptr(), ASSERT_NO_EXCEPTION);721 document().adoptNode(newChild, ASSERT_NO_EXCEPTION); 722 722 723 723 { -
trunk/Source/WebCore/dom/Document.cpp
r199835 r199871 993 993 } 994 994 995 RefPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionCode& ec) 996 { 997 if (!importedNode) { 998 ec = NOT_SUPPORTED_ERR; 999 return nullptr; 1000 } 1001 1002 switch (importedNode->nodeType()) { 995 RefPtr<Node> Document::importNode(Node& nodeToImport, bool deep, ExceptionCode& ec) 996 { 997 switch (nodeToImport.nodeType()) { 1003 998 case DOCUMENT_FRAGMENT_NODE: 1004 if ( importedNode->isShadowRoot())999 if (nodeToImport.isShadowRoot()) 1005 1000 break; 1006 1001 FALLTHROUGH; … … 1010 1005 case PROCESSING_INSTRUCTION_NODE: 1011 1006 case COMMENT_NODE: 1012 return importedNode->cloneNodeInternal(document(), deep ? CloningOperation::Everything : CloningOperation::OnlySelf);1007 return nodeToImport.cloneNodeInternal(document(), deep ? CloningOperation::Everything : CloningOperation::OnlySelf); 1013 1008 1014 1009 case ATTRIBUTE_NODE: 1015 1010 // FIXME: This will "Attr::normalize" child nodes of Attr. 1016 return Attr::create(*this, QualifiedName(nullAtom, downcast<Attr>( *importedNode).name(), nullAtom), downcast<Attr>(*importedNode).value());1011 return Attr::create(*this, QualifiedName(nullAtom, downcast<Attr>(nodeToImport).name(), nullAtom), downcast<Attr>(nodeToImport).value()); 1017 1012 1018 1013 case DOCUMENT_NODE: // Can't import a document into another document. … … 1026 1021 1027 1022 1028 RefPtr<Node> Document::adoptNode(Node* source, ExceptionCode& ec) 1029 { 1030 if (!source) { 1031 ec = NOT_SUPPORTED_ERR; 1032 return nullptr; 1033 } 1034 1023 RefPtr<Node> Document::adoptNode(Node& source, ExceptionCode& ec) 1024 { 1035 1025 EventQueueScope scope; 1036 1026 1037 switch (source ->nodeType()) {1027 switch (source.nodeType()) { 1038 1028 case DOCUMENT_NODE: 1039 1029 ec = NOT_SUPPORTED_ERR; 1040 1030 return nullptr; 1041 1031 case ATTRIBUTE_NODE: { 1042 Attr& attr = downcast<Attr>(*source);1032 auto& attr = downcast<Attr>(source); 1043 1033 if (attr.ownerElement()) 1044 1034 attr.ownerElement()->removeAttributeNode(&attr, ec); … … 1046 1036 } 1047 1037 default: 1048 if (source ->isShadowRoot()) {1038 if (source.isShadowRoot()) { 1049 1039 // ShadowRoot cannot disconnect itself from the host node. 1050 1040 ec = HIERARCHY_REQUEST_ERR; 1051 1041 return nullptr; 1052 1042 } 1053 if (is<HTMLFrameOwnerElement>( *source)) {1054 HTMLFrameOwnerElement& frameOwnerElement = downcast<HTMLFrameOwnerElement>(*source);1043 if (is<HTMLFrameOwnerElement>(source)) { 1044 auto& frameOwnerElement = downcast<HTMLFrameOwnerElement>(source); 1055 1045 if (frame() && frame()->tree().isDescendantOf(frameOwnerElement.contentFrame())) { 1056 1046 ec = HIERARCHY_REQUEST_ERR; … … 1058 1048 } 1059 1049 } 1060 if (source ->parentNode()) {1061 source ->parentNode()->removeChild(*source, ec);1050 if (source.parentNode()) { 1051 source.parentNode()->removeChild(source, ec); 1062 1052 if (ec) 1063 1053 return nullptr; … … 1065 1055 } 1066 1056 1067 adoptIfNeeded( source);1068 1069 return source;1057 adoptIfNeeded(&source); 1058 1059 return &source; 1070 1060 } 1071 1061 … … 1779 1769 } 1780 1770 1781 RefPtr<NodeIterator> Document::createNodeIterator(Node* root, unsigned long whatToShow, RefPtr<NodeFilter>&& filter, bool, ExceptionCode& ec) 1782 { 1783 return createNodeIterator(root, whatToShow, WTFMove(filter), ec); 1784 } 1785 1786 RefPtr<NodeIterator> Document::createNodeIterator(Node* root, unsigned long whatToShow, RefPtr<NodeFilter>&& filter, ExceptionCode& ec) 1787 { 1788 if (!root) { 1789 ec = TypeError; 1790 return nullptr; 1791 } 1771 Ref<NodeIterator> Document::createNodeIterator(Node& root, unsigned long whatToShow, RefPtr<NodeFilter>&& filter, bool) 1772 { 1792 1773 return NodeIterator::create(root, whatToShow, WTFMove(filter)); 1793 1774 } 1794 1775 1795 RefPtr<NodeIterator> Document::createNodeIterator(Node* root, unsigned long whatToShow, ExceptionCode& ec) 1796 { 1797 return createNodeIterator(root, whatToShow, nullptr, ec); 1798 } 1799 1800 RefPtr<NodeIterator> Document::createNodeIterator(Node* root, ExceptionCode& ec) 1801 { 1802 return createNodeIterator(root, 0xFFFFFFFF, nullptr, ec); 1803 } 1804 1805 RefPtr<TreeWalker> Document::createTreeWalker(Node* root, unsigned long whatToShow, RefPtr<NodeFilter>&& filter, bool, ExceptionCode& ec) 1806 { 1807 return createTreeWalker(root, whatToShow, WTFMove(filter), ec); 1808 } 1809 1810 RefPtr<TreeWalker> Document::createTreeWalker(Node* root, unsigned long whatToShow, RefPtr<NodeFilter>&& filter, ExceptionCode& ec) 1811 { 1812 if (!root) { 1813 ec = TypeError; 1814 return nullptr; 1815 } 1816 return TreeWalker::create(*root, whatToShow, WTFMove(filter)); 1817 } 1818 1819 RefPtr<TreeWalker> Document::createTreeWalker(Node* root, unsigned long whatToShow, ExceptionCode& ec) 1820 { 1821 return createTreeWalker(root, whatToShow, nullptr, ec); 1822 } 1823 1824 RefPtr<TreeWalker> Document::createTreeWalker(Node* root, ExceptionCode& ec) 1825 { 1826 return createTreeWalker(root, 0xFFFFFFFF, nullptr, ec); 1776 Ref<TreeWalker> Document::createTreeWalker(Node& root, unsigned long whatToShow, RefPtr<NodeFilter>&& filter, bool) 1777 { 1778 return TreeWalker::create(root, whatToShow, WTFMove(filter)); 1827 1779 } 1828 1780 … … 2681 2633 if (&newBody->document() != this) { 2682 2634 ec = 0; 2683 RefPtr<Node> node = importNode( newBody.get(), true, ec);2635 RefPtr<Node> node = importNode(*newBody, true, ec); 2684 2636 if (ec) 2685 2637 return; -
trunk/Source/WebCore/dom/Document.h
r199835 r199871 389 389 RefPtr<Attr> createAttributeNS(const String& namespaceURI, const String& qualifiedName, ExceptionCode&, bool shouldIgnoreNamespaceChecks = false); 390 390 RefPtr<EntityReference> createEntityReference(const String& name, ExceptionCode&); 391 RefPtr<Node> importNode(Node * importedNode, ExceptionCode& ec) { return importNode(importedNode, false, ec); }392 RefPtr<Node> importNode(Node * importedNode, bool deep, ExceptionCode&);391 RefPtr<Node> importNode(Node& nodeToImport, ExceptionCode& ec) { return importNode(nodeToImport, false, ec); } 392 RefPtr<Node> importNode(Node& nodeToImport, bool deep, ExceptionCode&); 393 393 WEBCORE_EXPORT RefPtr<Element> createElementNS(const String& namespaceURI, const String& qualifiedName, ExceptionCode&); 394 394 WEBCORE_EXPORT Ref<Element> createElement(const QualifiedName&, bool createdByParser); … … 459 459 bool isTimerThrottlingEnabled() const { return m_isTimerThrottlingEnabled; } 460 460 461 RefPtr<Node> adoptNode(Node *source, ExceptionCode&);461 RefPtr<Node> adoptNode(Node& source, ExceptionCode&); 462 462 463 463 Ref<HTMLCollection> images(); … … 549 549 WEBCORE_EXPORT Ref<Range> createRange(); 550 550 551 RefPtr<NodeIterator> createNodeIterator(Node* root, unsigned long whatToShow, RefPtr<NodeFilter>&&, bool, ExceptionCode&); // For ObjC bindings. 552 RefPtr<NodeIterator> createNodeIterator(Node* root, unsigned long whatToShow, RefPtr<NodeFilter>&&, ExceptionCode&); 553 RefPtr<NodeIterator> createNodeIterator(Node* root, unsigned long whatToShow, ExceptionCode&); 554 RefPtr<NodeIterator> createNodeIterator(Node* root, ExceptionCode&); 555 556 RefPtr<TreeWalker> createTreeWalker(Node* root, unsigned long whatToShow, RefPtr<NodeFilter>&&, bool, ExceptionCode&); // For ObjC bindings. 557 RefPtr<TreeWalker> createTreeWalker(Node* root, unsigned long whatToShow, RefPtr<NodeFilter>&&, ExceptionCode&); 558 RefPtr<TreeWalker> createTreeWalker(Node* root, unsigned long whatToShow, ExceptionCode&); 559 RefPtr<TreeWalker> createTreeWalker(Node* root, ExceptionCode&); 551 // The last bool parameter is for ObjC bindings. 552 Ref<NodeIterator> createNodeIterator(Node& root, unsigned long whatToShow = 0xFFFFFFFF, RefPtr<NodeFilter>&& = nullptr, bool = false); 553 554 // The last bool parameter is for ObjC bindings. 555 Ref<TreeWalker> createTreeWalker(Node& root, unsigned long whatToShow = 0xFFFFFFFF, RefPtr<NodeFilter>&& = nullptr, bool = false); 560 556 561 557 // Special support for editing -
trunk/Source/WebCore/dom/Document.idl
r199264 r199871 23 23 ConstructorCallWith=ScriptExecutionContext, 24 24 CustomToJSObject, 25 UsePointersEvenForNonNullableObjectArguments,26 25 JSCustomHeader, 27 26 JSGenerateToNativeObject, … … 30 29 31 30 // DOM Level 1 Core 32 readonly attribute DocumentType doctype;31 readonly attribute DocumentType? doctype; 33 32 readonly attribute DOMImplementation implementation; 34 readonly attribute Element documentElement;33 readonly attribute Element? documentElement; 35 34 36 35 [NewObject, RaisesException, ImplementedAs=createElementForBindings] Element createElement(DOMString tagName); … … 55 54 // Introduced in DOM Level 2: 56 55 57 [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Node importNode([Default=Undefined] optional Node importedNode, 58 optional boolean deep); 56 [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Node importNode(Node importedNode, optional boolean deep); 59 57 60 58 // FIXME: 'qualifiedName' should not have [TreatNullAs=EmptyString]. … … 80 78 [SetterRaisesException] attribute boolean xmlStandalone; 81 79 82 [RaisesException] Node adoptNode([Default=Undefined] optionalNode source);80 [RaisesException] Node adoptNode(Node source); 83 81 84 82 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C || defined(LANGUAGE_GOBJECT) && LANGUAGE_GOBJECT … … 103 101 104 102 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C || defined(LANGUAGE_GOBJECT) && LANGUAGE_GOBJECT 105 [ObjCLegacyUnnamedParameters , RaisesException] NodeIterator createNodeIterator(Node root,103 [ObjCLegacyUnnamedParameters] NodeIterator createNodeIterator(Node root, 106 104 optional unsigned long whatToShow = 0xFFFFFFFF, 107 105 optional NodeFilter? filter, 108 106 optional boolean expandEntityReferences); 109 [ObjCLegacyUnnamedParameters , RaisesException] TreeWalker createTreeWalker(Node root,107 [ObjCLegacyUnnamedParameters] TreeWalker createTreeWalker(Node root, 110 108 optional unsigned long whatToShow = 0xFFFFFFFF, 111 109 optional NodeFilter? filter, 112 110 optional boolean expandEntityReferences); 113 111 #else 114 [ RaisesException,NewObject] NodeIterator createNodeIterator(Node root,112 [NewObject] NodeIterator createNodeIterator(Node root, 115 113 optional unsigned long whatToShow = 0xFFFFFFFF, 116 114 optional NodeFilter? filter); 117 [ RaisesException,NewObject] TreeWalker createTreeWalker(Node root,115 [NewObject] TreeWalker createTreeWalker(Node root, 118 116 optional unsigned long whatToShow = 0xFFFFFFFF, 119 117 optional NodeFilter? filter); … … 130 128 // DOM Level 2 Style (DocumentCSS interface) 131 129 132 [ObjCLegacyUnnamedParameters] CSSStyleDeclaration getOverrideStyle([Default=Undefined] optional Element element,130 [ObjCLegacyUnnamedParameters] CSSStyleDeclaration getOverrideStyle([Default=Undefined] optional Element? element, 133 131 [Default=Undefined] optional DOMString pseudoElement); 134 132 … … 137 135 // DOM Level 3 XPath (XPathEvaluator interface) 138 136 [ObjCLegacyUnnamedParameters, RaisesException] XPathExpression createExpression([Default=Undefined] optional DOMString expression, 139 [Default=Undefined] optional XPathNSResolver resolver);140 XPathNSResolver createNSResolver(Node nodeResolver);137 [Default=Undefined] optional XPathNSResolver? resolver); 138 XPathNSResolver createNSResolver(Node? nodeResolver); 141 139 [ObjCLegacyUnnamedParameters, RaisesException] XPathResult evaluate([Default=Undefined] optional DOMString expression, 142 [Default=Undefined] optional Node contextNode,143 [Default=Undefined] optional XPathNSResolver resolver,140 [Default=Undefined] optional Node? contextNode, 141 [Default=Undefined] optional XPathNSResolver? resolver, 144 142 [Default=Undefined] optional unsigned short type, 145 [Default=Undefined] optional XPathResult inResult);143 [Default=Undefined] optional XPathResult? inResult); 146 144 147 145 // Common extensions … … 180 178 [TreatNullAs=EmptyString, GetterRaisesException, SetterRaisesException] attribute DOMString cookie; 181 179 182 [SetterRaisesException, ImplementedAs=bodyOrFrameset, StrictTypeChecking] attribute HTMLElement body;183 184 readonly attribute HTMLHeadElement head;180 [SetterRaisesException, ImplementedAs=bodyOrFrameset, StrictTypeChecking] attribute HTMLElement? body; 181 182 readonly attribute HTMLHeadElement? head; 185 183 readonly attribute HTMLCollection images; 186 184 readonly attribute HTMLCollection applets; … … 228 226 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C 229 227 // DOM Level 2 Style Interface 230 [ObjCLegacyUnnamedParameters, ObjCUseDefaultView] CSSStyleDeclaration getComputedStyle(Element element,228 [ObjCLegacyUnnamedParameters, ObjCUseDefaultView] CSSStyleDeclaration getComputedStyle(Element? element, 231 229 DOMString pseudoElement); 232 230 233 231 // WebKit extension 234 232 // FIXME: remove the first version once optional is implemented for Objective-C. 235 [ObjCUseDefaultView] CSSRuleList getMatchedCSSRules(Element element,233 [ObjCUseDefaultView] CSSRuleList getMatchedCSSRules(Element? element, 236 234 DOMString pseudoElement); 237 [ObjCUseDefaultView] CSSRuleList getMatchedCSSRules(Element element,235 [ObjCUseDefaultView] CSSRuleList getMatchedCSSRules(Element? element, 238 236 DOMString pseudoElement, 239 237 optional boolean authorOnly); … … 252 250 #endif 253 251 254 readonly attribute Element activeElement;252 readonly attribute Element? activeElement; 255 253 boolean hasFocus(); 256 254 … … 266 264 // W3C version 267 265 readonly attribute boolean webkitFullscreenEnabled; 268 readonly attribute Element webkitFullscreenElement;266 readonly attribute Element? webkitFullscreenElement; 269 267 void webkitExitFullscreen(); 270 268 #endif 271 269 272 270 [Conditional=POINTER_LOCK] void exitPointerLock(); 273 [Conditional=POINTER_LOCK] readonly attribute Element pointerLockElement;271 [Conditional=POINTER_LOCK] readonly attribute Element? pointerLockElement; 274 272 275 273 [Conditional=CSS_REGIONS] DOMNamedFlowCollection webkitGetNamedFlows(); … … 282 280 #include <WebKitAdditions/DocumentIOS.idl> 283 281 #elif defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS 284 [NewObject, RaisesException] Touch createTouch([Default=Undefined] optional DOMWindow window,285 [Default=Undefined] optional EventTarget target,282 [NewObject, RaisesException] Touch createTouch([Default=Undefined] optional DOMWindow? window, 283 [Default=Undefined] optional EventTarget? target, 286 284 [Default=Undefined] optional long identifier, 287 285 [Default=Undefined] optional long pageX, … … 306 304 307 305 // currentscript API: http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#dom-document-currentscript 308 readonly attribute HTMLScriptElement currentScript;306 readonly attribute HTMLScriptElement? currentScript; 309 307 310 308 // http://www.w3.org/TR/2014/WD-dom-20140204/#dom-document-origin … … 312 310 313 311 // http://dev.w3.org/csswg/cssom-view/#dom-document-scrollingelement 314 readonly attribute Element scrollingElement;312 readonly attribute Element? scrollingElement; 315 313 316 314 -
trunk/Source/WebCore/dom/NodeIterator.cpp
r195524 r199871 77 77 } 78 78 79 NodeIterator::NodeIterator(Node *rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& filter)80 : NodeIteratorBase( *rootNode, whatToShow, WTFMove(filter))79 NodeIterator::NodeIterator(Node& rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& filter) 80 : NodeIteratorBase(rootNode, whatToShow, WTFMove(filter)) 81 81 , m_referenceNode(root(), true) 82 82 { -
trunk/Source/WebCore/dom/NodeIterator.h
r195927 r199871 37 37 class NodeIterator : public ScriptWrappable, public RefCounted<NodeIterator>, public NodeIteratorBase { 38 38 public: 39 static Ref<NodeIterator> create(Node *rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& filter)39 static Ref<NodeIterator> create(Node& rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& filter) 40 40 { 41 41 return adoptRef(*new NodeIterator(rootNode, whatToShow, WTFMove(filter))); … … 54 54 55 55 private: 56 NodeIterator(Node *, unsigned long whatToShow, RefPtr<NodeFilter>&&);56 NodeIterator(Node&, unsigned long whatToShow, RefPtr<NodeFilter>&&); 57 57 58 58 struct NodePointer {
Note:
See TracChangeset
for help on using the changeset viewer.