Changeset 74406 in webkit


Ignore:
Timestamp:
Dec 21, 2010 1:55:53 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2010-12-21 Dominic Cooney <dominicc@google.com>

Reviewed by Adam Barth.

Rename Node::isShadowNode to isShadowRoot
https://bugs.webkit.org/show_bug.cgi?id=51060

The method gets whether the node is the root of a shadow tree;
renamed to reflect intent.

A simple rename--no new tests needed.

  • css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::initForStyleResolve): (WebCore::CSSStyleSelector::SelectorChecker::checkSelector):
  • dom/Node.cpp: (WebCore::Node::shadowTreeRootNode): (WebCore::Node::isInShadowTree): (WebCore::eventTargetRespectingSVGTargetRules): (WebCore::Node::getEventAncestors):
  • dom/Node.h: (WebCore::Node::isShadowRoot):
  • dom/Range.cpp: (WebCore::Range::checkNodeBA):
  • page/DragController.cpp: (WebCore::asFileInput):
  • page/EventHandler.cpp: (WebCore::EventHandler::handleMousePressEvent): (WebCore::EventHandler::dispatchMouseEvent):
  • rendering/RenderBlock.cpp: (WebCore::RenderBlock::hasLineIfEmpty):
  • rendering/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::attachInnerElement):
  • svg/SVGStyledElement.cpp: (WebCore::SVGStyledElement::title):
  • svg/SVGUseElement.cpp: (WebCore::ShadowTreeUpdateBlocker::while):
  • svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::insertedIntoDocument):
Location:
trunk/WebCore
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r74404 r74406  
     12010-12-21  Dominic Cooney  <dominicc@google.com>
     2
     3        Reviewed by Adam Barth.
     4
     5        Rename Node::isShadowNode to isShadowRoot
     6        https://bugs.webkit.org/show_bug.cgi?id=51060
     7
     8        The method gets whether the node is the root of a shadow tree;
     9        renamed to reflect intent.
     10
     11        A simple rename--no new tests needed.
     12
     13        * css/CSSStyleSelector.cpp:
     14        (WebCore::CSSStyleSelector::initForStyleResolve):
     15        (WebCore::CSSStyleSelector::SelectorChecker::checkSelector):
     16        * dom/Node.cpp:
     17        (WebCore::Node::shadowTreeRootNode):
     18        (WebCore::Node::isInShadowTree):
     19        (WebCore::eventTargetRespectingSVGTargetRules):
     20        (WebCore::Node::getEventAncestors):
     21        * dom/Node.h:
     22        (WebCore::Node::isShadowRoot):
     23        * dom/Range.cpp:
     24        (WebCore::Range::checkNodeBA):
     25        * page/DragController.cpp:
     26        (WebCore::asFileInput):
     27        * page/EventHandler.cpp:
     28        (WebCore::EventHandler::handleMousePressEvent):
     29        (WebCore::EventHandler::dispatchMouseEvent):
     30        * rendering/RenderBlock.cpp:
     31        (WebCore::RenderBlock::hasLineIfEmpty):
     32        * rendering/TextControlInnerElements.cpp:
     33        (WebCore::TextControlInnerElement::attachInnerElement):
     34        * svg/SVGStyledElement.cpp:
     35        (WebCore::SVGStyledElement::title):
     36        * svg/SVGUseElement.cpp:
     37        (WebCore::ShadowTreeUpdateBlocker::while):
     38        * svg/animation/SVGSMILElement.cpp:
     39        (WebCore::SVGSMILElement::insertedIntoDocument):
     40
    1412010-12-20  Mahesh Kulkarni  <mahesh.kulkarni@nokia.com>
    242
  • trunk/WebCore/css/CSSStyleSelector.cpp

    r74049 r74406  
    762762
    763763#if ENABLE(SVG)
    764     if (!m_parentNode && e && e->isSVGElement() && e->isShadowNode())
     764    if (!m_parentNode && e && e->isSVGElement() && e->isShadowRoot())
    765765        m_parentNode = e->shadowParentNode();
    766766#endif
     
    18931893    // Spec: CSS2 selectors cannot be applied to the (conceptually) cloned DOM tree
    18941894    // because its contents are not part of the formal document structure.
    1895     if (e->isSVGElement() && e->isShadowNode())
     1895    if (e->isSVGElement() && e->isShadowRoot())
    18961896        return SelectorFailsCompletely;
    18971897#endif
  • trunk/WebCore/dom/Node.cpp

    r73690 r74406  
    14581458    Node* root = this;
    14591459    while (root) {
    1460         if (root->isShadowNode())
     1460        if (root->isShadowRoot())
    14611461            return root;
    14621462        root = root->parentNodeGuaranteedHostFree();
     
    14681468{
    14691469    for (Node* n = this; n; n = n->parentNode())
    1470         if (n->isShadowNode())
     1470        if (n->isShadowRoot())
    14711471            return true;
    14721472    return false;
     
    25232523    // as a deeply cloned child of the 'use' element, except that events are dispatched to the SVGElementInstance objects
    25242524    for (Node* n = referenceNode; n; n = n->parentNode()) {
    2525         if (!n->isShadowNode() || !n->isSVGElement())
     2525        if (!n->isShadowRoot() || !n->isSVGElement())
    25262526            continue;
    25272527
     
    25462546    bool shouldSkipNextAncestor = false;
    25472547    while (true) {
    2548         if (ancestor->isShadowNode()) {
     2548        if (ancestor->isShadowRoot()) {
    25492549            if (behavior == StayInsideShadowDOM)
    25502550                return;
     
    25602560#if ENABLE(SVG)
    25612561        // Skip SVGShadowTreeRootElement.
    2562         shouldSkipNextAncestor = ancestor->isSVGElement() && ancestor->isShadowNode();
     2562        shouldSkipNextAncestor = ancestor->isSVGElement() && ancestor->isShadowRoot();
    25632563        if (shouldSkipNextAncestor)
    25642564            continue;
  • trunk/WebCore/dom/Node.h

    r73690 r74406  
    206206    virtual bool isCharacterDataNode() const { return false; }
    207207    bool isDocumentNode() const;
    208     bool isShadowNode() const { return getFlag(IsShadowRootFlag); }
     208    bool isShadowRoot() const { return getFlag(IsShadowRootFlag); }
    209209    // FIXME: Eliminate all uses, fold into shadowHost.
    210210    ContainerNode* shadowParentNode() const;
  • trunk/WebCore/dom/Range.cpp

    r73818 r74406  
    11891189        case Node::TEXT_NODE:
    11901190        case Node::XPATH_NAMESPACE_NODE:
    1191             if (root->isShadowNode())
     1191            if (root->isShadowRoot())
    11921192                break;
    11931193            ec = RangeException::INVALID_NODE_TYPE_ERR;
  • trunk/WebCore/page/DragController.cpp

    r73276 r74406  
    256256    // In order to get around this problem we assume any non-FILE input element
    257257    // is this internal button, and try querying the shadow parent node.
    258     if (node->hasTagName(HTMLNames::inputTag) && node->isShadowNode() && !static_cast<HTMLInputElement*>(node)->isFileUpload())
     258    if (node->hasTagName(HTMLNames::inputTag) && node->isShadowRoot() && !static_cast<HTMLInputElement*>(node)->isFileUpload())
    259259        node = node->shadowParentNode();
    260260
  • trunk/WebCore/page/EventHandler.cpp

    r73952 r74406  
    13841384        // we'd like to EventHandler::handleMousePressEvent to pass the event to the widget and thus the
    13851385        // event target node can't still be the shadow node.
    1386         if (mev.targetNode()->isShadowNode() && mev.targetNode()->shadowParentNode()->hasTagName(inputTag)) {
     1386        if (mev.targetNode()->isShadowRoot() && mev.targetNode()->shadowParentNode()->hasTagName(inputTag)) {
    13871387            HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active);
    13881388            mev = m_frame->document()->prepareMouseEvent(request, documentPoint, mouseEvent);
     
    19141914                // will set a selection inside it, which will call setFocuseNodeIfNeeded.
    19151915                ExceptionCode ec = 0;
    1916                 Node* n = node->isShadowNode() ? node->shadowParentNode() : node;
     1916                Node* n = node->isShadowRoot() ? node->shadowParentNode() : node;
    19171917                if (m_frame->selection()->isRange()
    19181918                    && m_frame->selection()->toNormalizedRange()->compareNode(n, ec) == Range::NODE_INSIDE
  • trunk/WebCore/rendering/RenderBlock.cpp

    r74121 r74406  
    49024902        return true;
    49034903   
    4904     if (node()->isShadowNode() && (node()->shadowParentNode()->hasTagName(inputTag)))
     4904    if (node()->isShadowRoot() && (node()->shadowParentNode()->hasTagName(inputTag)))
    49054905        return true;
    49064906   
  • trunk/WebCore/rendering/TextControlInnerElements.cpp

    r73618 r74406  
    105105
    106106    // For elements not yet in shadow DOM, add the node to the DOM normally.
    107     if (!isShadowNode()) {
     107    if (!isShadowRoot()) {
    108108        // FIXME: This code seems very wrong.  Why are we magically adding |this| to the DOM here?
    109109        //        We shouldn't be calling parser API methods outside of the parser!
  • trunk/WebCore/svg/SVGStyledElement.cpp

    r73618 r74406  
    8181    Node* parent = const_cast<SVGStyledElement*>(this);
    8282    while (parent) {
    83         if (!parent->isShadowNode()) {
     83        if (!parent->isShadowRoot()) {
    8484            parent = parent->parentNodeGuaranteedHostFree();
    8585            continue;
  • trunk/WebCore/svg/SVGUseElement.cpp

    r73618 r74406  
    494494    ContainerNode* parent = parentNode();
    495495    while (parent) {
    496         if (parent->isShadowNode())
     496        if (parent->isShadowRoot())
    497497            return;
    498498
    499499        parent = parent->parentNodeGuaranteedHostFree();
    500500    }
    501  
     501
    502502    SVGElement* target = 0;
    503503    if (targetElement && targetElement->isSVGElement())
  • trunk/WebCore/svg/animation/SVGSMILElement.cpp

    r72259 r74406  
    149149    // Verify we are not in <use> instance tree.
    150150    for (ContainerNode* n = this; n; n = n->parentNode())
    151         ASSERT(!n->isShadowNode());
     151        ASSERT(!n->isShadowRoot());
    152152#endif
    153153    SVGSVGElement* owner = ownerSVGElement();
     
    962962
    963963#endif
    964 
Note: See TracChangeset for help on using the changeset viewer.