Changeset 190210 in webkit


Ignore:
Timestamp:
Sep 24, 2015 11:17:08 AM (9 years ago)
Author:
Chris Dumez
Message:

Drop XPATH_NAMESPACE_NODE from Node::NodeType enum
https://bugs.webkit.org/show_bug.cgi?id=149532

Reviewed by Ryosuke Niwa.

Drop XPATH_NAMESPACE_NODE from Node::NodeType enum as there is currently
no way to construct such Node in WebKit. This avoid having to handle this
Node type everywhere.

Source/WebCore:

  • bindings/gobject/WebKitDOMPrivate.cpp:

(WebKit::wrap): Deleted.

  • bindings/objc/DOM.mm:

(kitClass): Deleted.

  • dom/Document.cpp:

(WebCore::Document::importNode):
(WebCore::Document::adoptNode): Deleted.
(WebCore::Document::childTypeAllowed): Deleted.
(WebCore::Document::canAcceptChild): Deleted.

  • dom/Node.cpp:

(WebCore::Node::dumpStatistics): Deleted.
(WebCore::Node::textContent): Deleted.
(WebCore::Node::ancestorElement): Deleted.

  • dom/Node.h:
  • dom/Range.cpp:

(WebCore::Range::checkNodeWOffset):
(WebCore::lengthOfContentsInNode): Deleted.
(WebCore::Range::processContentsBetweenOffsets): Deleted.
(WebCore::Range::surroundContents): Deleted.

  • editing/MarkupAccumulator.cpp:

(WebCore::MarkupAccumulator::appendStartMarkup): Deleted.

  • xml/XPathFunctions.cpp:

(WebCore::XPath::expandedNameLocalPart): Deleted.

  • xml/XPathStep.cpp:

(WebCore::XPath::Step::nodesInAxis):
(WebCore::XPath::primaryNodeType): Deleted.

  • xml/XPathUtil.cpp:

(WebCore::XPath::stringValue): Deleted.
(WebCore::XPath::isValidContextNode): Deleted.

Source/WebKit2:

  • WebProcess/InjectedBundle/API/mac/WKDOMInternals.mm:

(WebKit::WKDOMNodeClass): Deleted.

Location:
trunk/Source
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r190209 r190210  
     12015-09-24  Chris Dumez  <cdumez@apple.com>
     2
     3        Drop XPATH_NAMESPACE_NODE from Node::NodeType enum
     4        https://bugs.webkit.org/show_bug.cgi?id=149532
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Drop XPATH_NAMESPACE_NODE from Node::NodeType enum as there is currently
     9        no way to construct such Node in WebKit. This avoid having to handle this
     10        Node type everywhere.
     11
     12        * bindings/gobject/WebKitDOMPrivate.cpp:
     13        (WebKit::wrap): Deleted.
     14        * bindings/objc/DOM.mm:
     15        (kitClass): Deleted.
     16        * dom/Document.cpp:
     17        (WebCore::Document::importNode):
     18        (WebCore::Document::adoptNode): Deleted.
     19        (WebCore::Document::childTypeAllowed): Deleted.
     20        (WebCore::Document::canAcceptChild): Deleted.
     21        * dom/Node.cpp:
     22        (WebCore::Node::dumpStatistics): Deleted.
     23        (WebCore::Node::textContent): Deleted.
     24        (WebCore::Node::ancestorElement): Deleted.
     25        * dom/Node.h:
     26        * dom/Range.cpp:
     27        (WebCore::Range::checkNodeWOffset):
     28        (WebCore::lengthOfContentsInNode): Deleted.
     29        (WebCore::Range::processContentsBetweenOffsets): Deleted.
     30        (WebCore::Range::surroundContents): Deleted.
     31        * editing/MarkupAccumulator.cpp:
     32        (WebCore::MarkupAccumulator::appendStartMarkup): Deleted.
     33        * xml/XPathFunctions.cpp:
     34        (WebCore::XPath::expandedNameLocalPart): Deleted.
     35        * xml/XPathStep.cpp:
     36        (WebCore::XPath::Step::nodesInAxis):
     37        (WebCore::XPath::primaryNodeType): Deleted.
     38        * xml/XPathUtil.cpp:
     39        (WebCore::XPath::stringValue): Deleted.
     40        (WebCore::XPath::isValidContextNode): Deleted.
     41
    1422015-09-24  David Hyatt  <hyatt@apple.com>
    243
  • trunk/Source/WebCore/bindings/gobject/WebKitDOMPrivate.cpp

    r190120 r190210  
    105105    case Node::DOCUMENT_FRAGMENT_NODE:
    106106        return WEBKIT_DOM_NODE(wrapDocumentFragment(static_cast<DocumentFragment*>(node)));
    107     case Node::XPATH_NAMESPACE_NODE:
    108         break;
    109107    }
    110108
  • trunk/Source/WebCore/bindings/objc/DOM.mm

    r190120 r190210  
    324324        case WebCore::Node::DOCUMENT_FRAGMENT_NODE:
    325325            return [DOMDocumentFragment class];
    326         case WebCore::Node::XPATH_NAMESPACE_NODE:
    327             // FIXME: Create an XPath objective C wrapper
    328             // See http://bugs.webkit.org/show_bug.cgi?id=8755
    329             return nil;
    330326    }
    331327    ASSERT_NOT_REACHED();
  • trunk/Source/WebCore/dom/Document.cpp

    r190169 r190210  
    953953    case DOCUMENT_TYPE_NODE: // FIXME: Support cloning a DocumentType node per DOM4.
    954954        break;
    955 
    956     case XPATH_NAMESPACE_NODE:
    957         ASSERT_NOT_REACHED(); // These two types of DOM nodes are not implemented.
    958         break;
    959     }
     955    }
     956
    960957    ec = NOT_SUPPORTED_ERR;
    961958    return nullptr;
     
    974971    switch (source->nodeType()) {
    975972    case DOCUMENT_NODE:
    976     case XPATH_NAMESPACE_NODE:
    977973        ec = NOT_SUPPORTED_ERR;
    978974        return nullptr;
     
    33453341    case DOCUMENT_NODE:
    33463342    case TEXT_NODE:
    3347     case XPATH_NAMESPACE_NODE:
    33483343        return false;
    33493344    case COMMENT_NODE:
     
    33723367    case DOCUMENT_NODE:
    33733368    case TEXT_NODE:
    3374     case XPATH_NAMESPACE_NODE:
    33753369        return false;
    33763370    case COMMENT_NODE:
  • trunk/Source/WebCore/dom/Node.cpp

    r190120 r190210  
    109109    size_t docTypeNodes = 0;
    110110    size_t fragmentNodes = 0;
    111     size_t xpathNSNodes = 0;
    112111    size_t shadowRootNodes = 0;
    113112
     
    191190                break;
    192191            }
    193             case XPATH_NAMESPACE_NODE: {
    194                 ++xpathNSNodes;
    195                 break;
    196             }
    197192        }
    198193    }
     
    212207    printf("  Number of DocumentType nodes: %zu\n", docTypeNodes);
    213208    printf("  Number of DocumentFragment nodes: %zu\n", fragmentNodes);
    214     printf("  Number of XPathNS nodes: %zu\n", xpathNSNodes);
    215209    printf("  Number of ShadowRoot nodes: %zu\n", shadowRootNodes);
    216210
     
    14171411    case Node::DOCUMENT_NODE:
    14181412    case Node::DOCUMENT_TYPE_NODE:
    1419     case Node::XPATH_NAMESPACE_NODE:
    14201413        break;
    14211414    }
     
    14511444        case DOCUMENT_NODE:
    14521445        case DOCUMENT_TYPE_NODE:
    1453         case XPATH_NAMESPACE_NODE:
    14541446            // Do nothing.
    14551447            return;
  • trunk/Source/WebCore/dom/Node.h

    r190120 r190210  
    131131        DOCUMENT_TYPE_NODE = 10,
    132132        DOCUMENT_FRAGMENT_NODE = 11,
    133         XPATH_NAMESPACE_NODE = 13,
    134133    };
    135134    enum DeprecatedNodeType {
  • trunk/Source/WebCore/dom/Range.cpp

    r190208 r190210  
    557557    // This switch statement must be consistent with that of Range::processContentsBetweenOffsets.
    558558    switch (node.nodeType()) {
    559     case Node::XPATH_NAMESPACE_NODE: // FIXME: Remove from NodeType as there is no way to construct such Node in WebKit.
    560559    case Node::DOCUMENT_TYPE_NODE:
    561560        return 0;
     
    728727    case Node::DOCUMENT_TYPE_NODE:
    729728    case Node::DOCUMENT_FRAGMENT_NODE:
    730     case Node::XPATH_NAMESPACE_NODE:
    731729        // FIXME: Should we assert that some nodes never appear here?
    732730        if (action == Extract || action == Clone) {
     
    10061004        case Node::DOCUMENT_FRAGMENT_NODE:
    10071005        case Node::DOCUMENT_NODE:
    1008         case Node::ELEMENT_NODE:
    1009         case Node::XPATH_NAMESPACE_NODE: {
     1006        case Node::ELEMENT_NODE: {
    10101007            if (!offset)
    10111008                return nullptr;
     
    11481145        case Node::PROCESSING_INSTRUCTION_NODE:
    11491146        case Node::TEXT_NODE:
    1150         case Node::XPATH_NAMESPACE_NODE:
    11511147            break;
    11521148    }
  • trunk/Source/WebCore/editing/MarkupAccumulator.cpp

    r190120 r190210  
    574574        break;
    575575    case Node::ATTRIBUTE_NODE:
    576     case Node::XPATH_NAMESPACE_NODE:
    577576        ASSERT_NOT_REACHED();
    578577        break;
  • trunk/Source/WebCore/xml/XPathFunctions.cpp

    r184566 r190210  
    361361static inline String expandedNameLocalPart(Node* node)
    362362{
    363     // The local part of an XPath expanded-name matches DOM local name for most node types, except for namespace nodes and processing instruction nodes.
    364     ASSERT(node->nodeType() != Node::XPATH_NAMESPACE_NODE); // Not supported yet.
    365363    if (is<ProcessingInstruction>(*node))
    366364        return downcast<ProcessingInstruction>(*node).target();
  • trunk/Source/WebCore/xml/XPathStep.cpp

    r184566 r190210  
    154154        case Step::AttributeAxis:
    155155            return Node::ATTRIBUTE_NODE;
    156         case Step::NamespaceAxis:
    157             return Node::XPATH_NAMESPACE_NODE;
    158156        default:
    159157            return Node::ELEMENT_NODE;
     
    286284        }
    287285        case FollowingSiblingAxis:
    288             if (context.nodeType() == Node::ATTRIBUTE_NODE || context.nodeType() == Node::XPATH_NAMESPACE_NODE)
     286            if (context.isAttributeNode())
    289287                return;
    290288            for (Node* node = context.nextSibling(); node; node = node->nextSibling()) {
     
    294292            return;
    295293        case PrecedingSiblingAxis:
    296             if (context.nodeType() == Node::ATTRIBUTE_NODE || context.nodeType() == Node::XPATH_NAMESPACE_NODE)
     294            if (context.isAttributeNode())
    297295                return;
    298296            for (Node* node = context.previousSibling(); node; node = node->previousSibling()) {
  • trunk/Source/WebCore/xml/XPathUtil.cpp

    r190120 r190210  
    4848        case Node::TEXT_NODE:
    4949        case Node::CDATA_SECTION_NODE:
    50         case Node::XPATH_NAMESPACE_NODE:
    5150            return node->nodeValue();
    5251        default:
     
    6867        case Node::ELEMENT_NODE:
    6968        case Node::PROCESSING_INSTRUCTION_NODE:
    70         case Node::XPATH_NAMESPACE_NODE:
    7169            return true;
    7270        case Node::DOCUMENT_FRAGMENT_NODE:
  • trunk/Source/WebKit2/ChangeLog

    r190201 r190210  
     12015-09-24  Chris Dumez  <cdumez@apple.com>
     2
     3        Drop XPATH_NAMESPACE_NODE from Node::NodeType enum
     4        https://bugs.webkit.org/show_bug.cgi?id=149532
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Drop XPATH_NAMESPACE_NODE from Node::NodeType enum as there is currently
     9        no way to construct such Node in WebKit. This avoid having to handle this
     10        Node type everywhere.
     11
     12        * WebProcess/InjectedBundle/API/mac/WKDOMInternals.mm:
     13        (WebKit::WKDOMNodeClass): Deleted.
     14
    1152015-09-24  Ryosuke Niwa  <rniwa@webkit.org>
    216
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMInternals.mm

    r190120 r190210  
    8181    case WebCore::Node::DOCUMENT_TYPE_NODE:
    8282    case WebCore::Node::DOCUMENT_FRAGMENT_NODE:
    83     case WebCore::Node::XPATH_NAMESPACE_NODE:
    8483        return [WKDOMNode class];
    8584    }
Note: See TracChangeset for help on using the changeset viewer.