Changeset 199871 in webkit


Ignore:
Timestamp:
Apr 21, 2016, 11:19:41 PM (9 years ago)
Author:
Chris Dumez
Message:

Drop [UsePointersEvenForNonNullableObjectArguments] from Document
https://bugs.webkit.org/show_bug.cgi?id=156881

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

  • web-platform-tests/dom/interfaces-expected.txt:
  • web-platform-tests/html/dom/interfaces-expected.txt:

Source/WebCore:

Drop [UsePointersEvenForNonNullableObjectArguments] from Document. There
is no major Web-exposed behavior change but the type of the exception
being thrown when passing null or not enough parameters has changed for
some of the API (It is now always a TypeError as per the Web IDL
specification).

Tests: fast/dom/Document/adoptNode-null.html

fast/dom/Document/importNode-null.html

  • dom/ContainerNode.cpp:

(WebCore::ContainerNode::takeAllChildrenFrom):
(WebCore::ContainerNode::parserInsertBefore):
(WebCore::ContainerNode::parserAppendChild):

  • dom/Document.cpp:

(WebCore::Document::importNode):
(WebCore::Document::adoptNode):
(WebCore::Document::createNodeIterator):
(WebCore::Document::createTreeWalker):
(WebCore::Document::setBodyOrFrameset):
(WebCore::Document::hasValidNamespaceForElements): Deleted.
(WebCore::Document::scheduleForcedStyleRecalc): Deleted.
(WebCore::Document::scheduleStyleRecalc): Deleted.
(WebCore::Document::unscheduleStyleRecalc): Deleted.
(WebCore::Document::hasPendingStyleRecalc): Deleted.
(WebCore::Document::hasPendingForcedStyleRecalc): Deleted.
(WebCore::Document::recalcStyle): Deleted.
(WebCore::Document::explicitClose): Deleted.

  • dom/Document.h:

(WebCore::Document::importNode):

  • dom/Document.idl:
  • dom/NodeIterator.cpp:

(WebCore::NodeIterator::NodeIterator):

  • dom/NodeIterator.h:

(WebCore::NodeIterator::create):

LayoutTests:

Add test cases for cases where the type of the exception being thrown
has changed.

  • fast/dom/Document/adoptNode-null-expected.txt: Added.
  • fast/dom/Document/adoptNode-null.html: Added.
  • fast/dom/Document/importNode-null-expected.txt: Added.
  • fast/dom/Document/importNode-null.html: Added.
  • fast/dom/importNode-null-expected.txt: Removed.
  • fast/dom/importNode-null.html: Removed.
Location:
trunk
Files:
4 added
2 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r199862 r199871  
     12016-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
    1182016-04-21  Dean Jackson  <dino@apple.com>
    219
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r199825 r199871  
     12016-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
    1132016-04-21  Youenn Fablet  <youenn.fablet@crf.canon.fr>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt

    r197162 r199871  
    263263FAIL Document interface: operation createComment(DOMString) assert_equals: property has wrong .length expected 1 but got 0
    264264FAIL 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
     265PASS Document interface: operation importNode(Node,boolean)
     266PASS Document interface: operation adoptNode(Node)
    267267FAIL Document interface: operation createAttribute(DOMString) assert_equals: property has wrong .length expected 1 but got 0
    268268FAIL Document interface: operation createAttributeNS(DOMString,DOMString) assert_equals: property has wrong .length expected 2 but got 0
     
    332332        }" did not throw
    333333PASS 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")
     334PASS Document interface: calling importNode(Node,boolean) on xmlDoc with too few arguments must throw TypeError
    337335PASS 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")
     336PASS Document interface: calling adoptNode(Node) on xmlDoc with too few arguments must throw TypeError
    341337PASS Document interface: xmlDoc must inherit property "createAttribute" with the proper type (22)
    342338FAIL 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  
    168168        }" did not throw
    169169PASS 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")
     170PASS Document interface: calling importNode(Node,boolean) on iframe.contentDocument with too few arguments must throw TypeError
    173171PASS 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")
     172PASS Document interface: calling adoptNode(Node) on iframe.contentDocument with too few arguments must throw TypeError
    177173PASS Document interface: iframe.contentDocument must inherit property "createAttribute" with the proper type (22)
    178174FAIL Document interface: calling createAttribute(DOMString) on iframe.contentDocument with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
     
    483479        }" did not throw
    484480PASS 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")
     481PASS Document interface: calling importNode(Node,boolean) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError
    488482PASS 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")
     483PASS Document interface: calling adoptNode(Node) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError
    492484PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "createAttribute" with the proper type (22)
    493485FAIL 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  
    168168        }" did not throw
    169169PASS 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")
     170PASS Document interface: calling importNode(Node,boolean) on iframe.contentDocument with too few arguments must throw TypeError
    173171PASS 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")
     172PASS Document interface: calling adoptNode(Node) on iframe.contentDocument with too few arguments must throw TypeError
    177173PASS Document interface: iframe.contentDocument must inherit property "createAttribute" with the proper type (22)
    178174FAIL Document interface: calling createAttribute(DOMString) on iframe.contentDocument with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
     
    483479        }" did not throw
    484480PASS 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")
     481PASS Document interface: calling importNode(Node,boolean) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError
    488482PASS 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")
     483PASS Document interface: calling adoptNode(Node) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError
    492484PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "createAttribute" with the proper type (22)
    493485FAIL 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  
     12016-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
    1432016-04-21  Frederic Wang  <fwang@igalia.com>
    244
  • trunk/Source/WebCore/dom/ContainerNode.cpp

    r199056 r199871  
    131131
    132132        // 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);
    134134        parserAppendChild(*adoptedChild);
    135135        // FIXME: Together with adoptNode above, the tree scope might get updated recursively twice
     
    377377
    378378    if (&document() != &newChild->document())
    379         document().adoptNode(newChild.ptr(), ASSERT_NO_EXCEPTION);
     379        document().adoptNode(newChild, ASSERT_NO_EXCEPTION);
    380380
    381381    insertBeforeCommon(nextChild, newChild);
     
    719719
    720720    if (&document() != &newChild->document())
    721         document().adoptNode(newChild.ptr(), ASSERT_NO_EXCEPTION);
     721        document().adoptNode(newChild, ASSERT_NO_EXCEPTION);
    722722
    723723    {
  • trunk/Source/WebCore/dom/Document.cpp

    r199835 r199871  
    993993}
    994994
    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()) {
     995RefPtr<Node> Document::importNode(Node& nodeToImport, bool deep, ExceptionCode& ec)
     996{
     997    switch (nodeToImport.nodeType()) {
    1003998    case DOCUMENT_FRAGMENT_NODE:
    1004         if (importedNode->isShadowRoot())
     999        if (nodeToImport.isShadowRoot())
    10051000            break;
    10061001        FALLTHROUGH;
     
    10101005    case PROCESSING_INSTRUCTION_NODE:
    10111006    case COMMENT_NODE:
    1012         return importedNode->cloneNodeInternal(document(), deep ? CloningOperation::Everything : CloningOperation::OnlySelf);
     1007        return nodeToImport.cloneNodeInternal(document(), deep ? CloningOperation::Everything : CloningOperation::OnlySelf);
    10131008
    10141009    case ATTRIBUTE_NODE:
    10151010        // 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());
    10171012
    10181013    case DOCUMENT_NODE: // Can't import a document into another document.
     
    10261021
    10271022
    1028 RefPtr<Node> Document::adoptNode(Node* source, ExceptionCode& ec)
    1029 {
    1030     if (!source) {
    1031         ec = NOT_SUPPORTED_ERR;
    1032         return nullptr;
    1033     }
    1034 
     1023RefPtr<Node> Document::adoptNode(Node& source, ExceptionCode& ec)
     1024{
    10351025    EventQueueScope scope;
    10361026
    1037     switch (source->nodeType()) {
     1027    switch (source.nodeType()) {
    10381028    case DOCUMENT_NODE:
    10391029        ec = NOT_SUPPORTED_ERR;
    10401030        return nullptr;
    10411031    case ATTRIBUTE_NODE: {                   
    1042         Attr& attr = downcast<Attr>(*source);
     1032        auto& attr = downcast<Attr>(source);
    10431033        if (attr.ownerElement())
    10441034            attr.ownerElement()->removeAttributeNode(&attr, ec);
     
    10461036    }       
    10471037    default:
    1048         if (source->isShadowRoot()) {
     1038        if (source.isShadowRoot()) {
    10491039            // ShadowRoot cannot disconnect itself from the host node.
    10501040            ec = HIERARCHY_REQUEST_ERR;
    10511041            return nullptr;
    10521042        }
    1053         if (is<HTMLFrameOwnerElement>(*source)) {
    1054             HTMLFrameOwnerElement& frameOwnerElement = downcast<HTMLFrameOwnerElement>(*source);
     1043        if (is<HTMLFrameOwnerElement>(source)) {
     1044            auto& frameOwnerElement = downcast<HTMLFrameOwnerElement>(source);
    10551045            if (frame() && frame()->tree().isDescendantOf(frameOwnerElement.contentFrame())) {
    10561046                ec = HIERARCHY_REQUEST_ERR;
     
    10581048            }
    10591049        }
    1060         if (source->parentNode()) {
    1061             source->parentNode()->removeChild(*source, ec);
     1050        if (source.parentNode()) {
     1051            source.parentNode()->removeChild(source, ec);
    10621052            if (ec)
    10631053                return nullptr;
     
    10651055    }
    10661056
    1067     adoptIfNeeded(source);
    1068 
    1069     return source;
     1057    adoptIfNeeded(&source);
     1058
     1059    return &source;
    10701060}
    10711061
     
    17791769}
    17801770
    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     }
     1771Ref<NodeIterator> Document::createNodeIterator(Node& root, unsigned long whatToShow, RefPtr<NodeFilter>&& filter, bool)
     1772{
    17921773    return NodeIterator::create(root, whatToShow, WTFMove(filter));
    17931774}
    17941775
    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);
     1776Ref<TreeWalker> Document::createTreeWalker(Node& root, unsigned long whatToShow, RefPtr<NodeFilter>&& filter, bool)
     1777{
     1778    return TreeWalker::create(root, whatToShow, WTFMove(filter));
    18271779}
    18281780
     
    26812633    if (&newBody->document() != this) {
    26822634        ec = 0;
    2683         RefPtr<Node> node = importNode(newBody.get(), true, ec);
     2635        RefPtr<Node> node = importNode(*newBody, true, ec);
    26842636        if (ec)
    26852637            return;
  • trunk/Source/WebCore/dom/Document.h

    r199835 r199871  
    389389    RefPtr<Attr> createAttributeNS(const String& namespaceURI, const String& qualifiedName, ExceptionCode&, bool shouldIgnoreNamespaceChecks = false);
    390390    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&);
    393393    WEBCORE_EXPORT RefPtr<Element> createElementNS(const String& namespaceURI, const String& qualifiedName, ExceptionCode&);
    394394    WEBCORE_EXPORT Ref<Element> createElement(const QualifiedName&, bool createdByParser);
     
    459459    bool isTimerThrottlingEnabled() const { return m_isTimerThrottlingEnabled; }
    460460
    461     RefPtr<Node> adoptNode(Node* source, ExceptionCode&);
     461    RefPtr<Node> adoptNode(Node& source, ExceptionCode&);
    462462
    463463    Ref<HTMLCollection> images();
     
    549549    WEBCORE_EXPORT Ref<Range> createRange();
    550550
    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);
    560556
    561557    // Special support for editing
  • trunk/Source/WebCore/dom/Document.idl

    r199264 r199871  
    2323    ConstructorCallWith=ScriptExecutionContext,
    2424    CustomToJSObject,
    25     UsePointersEvenForNonNullableObjectArguments,
    2625    JSCustomHeader,
    2726    JSGenerateToNativeObject,
     
    3029
    3130    // DOM Level 1 Core
    32     readonly attribute DocumentType doctype;
     31    readonly attribute DocumentType? doctype;
    3332    readonly attribute DOMImplementation implementation;
    34     readonly attribute Element documentElement;
     33    readonly attribute Element? documentElement;
    3534
    3635    [NewObject, RaisesException, ImplementedAs=createElementForBindings] Element createElement(DOMString tagName);
     
    5554    // Introduced in DOM Level 2:
    5655
    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);
    5957
    6058    // FIXME: 'qualifiedName' should not have [TreatNullAs=EmptyString].
     
    8078    [SetterRaisesException] attribute boolean xmlStandalone;
    8179
    82     [RaisesException] Node               adoptNode([Default=Undefined] optional Node source);
     80    [RaisesException] Node adoptNode(Node source);
    8381
    8482#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C || defined(LANGUAGE_GOBJECT) && LANGUAGE_GOBJECT
     
    103101
    104102#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,
    106104        optional unsigned long whatToShow = 0xFFFFFFFF,
    107105        optional NodeFilter? filter,
    108106        optional boolean expandEntityReferences);
    109     [ObjCLegacyUnnamedParameters, RaisesException] TreeWalker createTreeWalker(Node root,
     107    [ObjCLegacyUnnamedParameters] TreeWalker createTreeWalker(Node root,
    110108        optional unsigned long whatToShow = 0xFFFFFFFF,
    111109        optional NodeFilter? filter,
    112110        optional boolean expandEntityReferences);
    113111#else
    114     [RaisesException, NewObject] NodeIterator createNodeIterator(Node root,
     112    [NewObject] NodeIterator createNodeIterator(Node root,
    115113        optional unsigned long whatToShow = 0xFFFFFFFF,
    116114        optional NodeFilter? filter);
    117     [RaisesException, NewObject] TreeWalker createTreeWalker(Node root,
     115    [NewObject] TreeWalker createTreeWalker(Node root,
    118116        optional unsigned long whatToShow = 0xFFFFFFFF,
    119117        optional NodeFilter? filter);
     
    130128    // DOM Level 2 Style (DocumentCSS interface)
    131129
    132     [ObjCLegacyUnnamedParameters] CSSStyleDeclaration getOverrideStyle([Default=Undefined] optional Element element,
     130    [ObjCLegacyUnnamedParameters] CSSStyleDeclaration getOverrideStyle([Default=Undefined] optional Element? element,
    133131                                                        [Default=Undefined] optional DOMString pseudoElement);
    134132
     
    137135    // DOM Level 3 XPath (XPathEvaluator interface)
    138136    [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);
    141139    [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,
    144142                                                  [Default=Undefined] optional unsigned short type,
    145                                                   [Default=Undefined] optional XPathResult inResult);
     143                                                  [Default=Undefined] optional XPathResult? inResult);
    146144
    147145    // Common extensions
     
    180178    [TreatNullAs=EmptyString, GetterRaisesException, SetterRaisesException] attribute DOMString cookie;
    181179
    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;
    185183    readonly attribute HTMLCollection images;
    186184    readonly attribute HTMLCollection applets;
     
    228226#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
    229227    // DOM Level 2 Style Interface
    230     [ObjCLegacyUnnamedParameters, ObjCUseDefaultView] CSSStyleDeclaration getComputedStyle(Element element,
     228    [ObjCLegacyUnnamedParameters, ObjCUseDefaultView] CSSStyleDeclaration getComputedStyle(Element? element,
    231229                                                                  DOMString pseudoElement);
    232230
    233231    // WebKit extension
    234232    // FIXME: remove the first version once optional is implemented for Objective-C.
    235     [ObjCUseDefaultView] CSSRuleList getMatchedCSSRules(Element element,
     233    [ObjCUseDefaultView] CSSRuleList getMatchedCSSRules(Element? element,
    236234                                              DOMString pseudoElement);
    237     [ObjCUseDefaultView] CSSRuleList getMatchedCSSRules(Element element,
     235    [ObjCUseDefaultView] CSSRuleList getMatchedCSSRules(Element? element,
    238236                                              DOMString pseudoElement,
    239237                                              optional boolean authorOnly);
     
    252250#endif
    253251
    254     readonly attribute Element activeElement;
     252    readonly attribute Element? activeElement;
    255253    boolean hasFocus();
    256254
     
    266264    // W3C version
    267265    readonly attribute boolean webkitFullscreenEnabled;
    268     readonly attribute Element webkitFullscreenElement;
     266    readonly attribute Element? webkitFullscreenElement;
    269267    void webkitExitFullscreen();
    270268#endif
    271269
    272270    [Conditional=POINTER_LOCK] void exitPointerLock();
    273     [Conditional=POINTER_LOCK] readonly attribute Element pointerLockElement;
     271    [Conditional=POINTER_LOCK] readonly attribute Element? pointerLockElement;
    274272
    275273    [Conditional=CSS_REGIONS] DOMNamedFlowCollection webkitGetNamedFlows();
     
    282280#include <WebKitAdditions/DocumentIOS.idl>
    283281#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,
    286284                                                     [Default=Undefined] optional long identifier,
    287285                                                     [Default=Undefined] optional long pageX,
     
    306304
    307305    // 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;
    309307
    310308    // http://www.w3.org/TR/2014/WD-dom-20140204/#dom-document-origin
     
    312310
    313311    // http://dev.w3.org/csswg/cssom-view/#dom-document-scrollingelement
    314     readonly attribute Element scrollingElement;
     312    readonly attribute Element? scrollingElement;
    315313
    316314
  • trunk/Source/WebCore/dom/NodeIterator.cpp

    r195524 r199871  
    7777}
    7878
    79 NodeIterator::NodeIterator(Node* rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& filter)
    80     : NodeIteratorBase(*rootNode, whatToShow, WTFMove(filter))
     79NodeIterator::NodeIterator(Node& rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& filter)
     80    : NodeIteratorBase(rootNode, whatToShow, WTFMove(filter))
    8181    , m_referenceNode(root(), true)
    8282{
  • trunk/Source/WebCore/dom/NodeIterator.h

    r195927 r199871  
    3737    class NodeIterator : public ScriptWrappable, public RefCounted<NodeIterator>, public NodeIteratorBase {
    3838    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)
    4040        {
    4141            return adoptRef(*new NodeIterator(rootNode, whatToShow, WTFMove(filter)));
     
    5454
    5555    private:
    56         NodeIterator(Node*, unsigned long whatToShow, RefPtr<NodeFilter>&&);
     56        NodeIterator(Node&, unsigned long whatToShow, RefPtr<NodeFilter>&&);
    5757
    5858        struct NodePointer {
Note: See TracChangeset for help on using the changeset viewer.