Changeset 141524 in webkit


Ignore:
Timestamp:
Jan 31, 2013 7:17:19 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Rename from parentOrHost* to parentOrShadowHost* in Node.h.
https://bugs.webkit.org/show_bug.cgi?id=108308

Source/WebCore:

Patch by Changhun Kang <temoochin@company100.net> on 2013-01-31
Reviewed by Dimitri Glazkov.

No new tests. No change in behavior.

Source/WebKit2:

Patch by Changhun Kang <temoochin@company100.net> on 2013-01-31
Reviewed by Dimitri Glazkov.

Location:
trunk/Source
Files:
43 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r141523 r141524  
     12013-01-31  Changhun Kang  <temoochin@company100.net>
     2
     3        Rename from parentOrHost* to parentOrShadowHost* in Node.h.
     4        https://bugs.webkit.org/show_bug.cgi?id=108308
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        No new tests. No change in behavior.
     9
    1102013-01-31  Alec Flett  <alecflett@chromium.org>
    211
  • trunk/Source/WebCore/bindings/js/JSDOMBinding.h

    r140194 r141524  
    219219            return node->document();
    220220
    221         while (node->parentOrHostNode())
    222             node = node->parentOrHostNode();
     221        while (node->parentOrShadowHostNode())
     222            node = node->parentOrShadowHostNode();
    223223        return node;
    224224    }
  • trunk/Source/WebCore/bindings/v8/V8GCController.cpp

    r141390 r141524  
    173173    }
    174174
    175     while (Node* parent = node->parentOrHostNode())
     175    while (Node* parent = node->parentOrShadowHostNode())
    176176        node = parent;
    177177
  • trunk/Source/WebCore/css/SelectorFilter.cpp

    r140371 r141524  
    5454{
    5555    ASSERT(m_ancestorIdentifierFilter);
    56     ASSERT(m_parentStack.isEmpty() || m_parentStack.last().element == parent->parentOrHostElement());
    57     ASSERT(!m_parentStack.isEmpty() || !parent->parentOrHostElement());
     56    ASSERT(m_parentStack.isEmpty() || m_parentStack.last().element == parent->parentOrShadowHostElement());
     57    ASSERT(!m_parentStack.isEmpty() || !parent->parentOrShadowHostElement());
    5858    m_parentStack.append(ParentStackFrame(parent));
    5959    ParentStackFrame& parentFrame = m_parentStack.last();
     
    8888    m_ancestorIdentifierFilter = adoptPtr(new BloomFilter<bloomFilterKeyBits>);
    8989    // Fast version if parent is a root element:
    90     if (!parent->parentOrHostNode()) {
     90    if (!parent->parentOrShadowHostNode()) {
    9191        pushParentStackFrame(parent);
    9292        return;
     
    9494    // Otherwise climb up the tree.
    9595    Vector<Element*, 30> ancestors;
    96     for (Element* ancestor = parent; ancestor; ancestor = ancestor->parentOrHostElement())
     96    for (Element* ancestor = parent; ancestor; ancestor = ancestor->parentOrShadowHostElement())
    9797        ancestors.append(ancestor);
    9898    for (size_t n = ancestors.size(); n; --n)
     
    105105    // We may get invoked for some random elements in some wacky cases during style resolve.
    106106    // Pause maintaining the stack in this case.
    107     if (m_parentStack.last().element != parent->parentOrHostElement())
     107    if (m_parentStack.last().element != parent->parentOrShadowHostElement())
    108108        return;
    109109    pushParentStackFrame(parent);
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r141480 r141524  
    408408void StyleResolver::pushParentElement(Element* parent)
    409409{
    410     const ContainerNode* parentsParent = parent->parentOrHostElement();
     410    const ContainerNode* parentsParent = parent->parentOrShadowHostElement();
    411411
    412412    // We are not always invoked consistently. For example, script execution can cause us to enter
     
    421421    // Note: We mustn't skip ShadowRoot nodes for the scope stack.
    422422    if (m_scopeResolver)
    423         m_scopeResolver->push(parent, parent->parentOrHostNode());
     423        m_scopeResolver->push(parent, parent->parentOrShadowHostNode());
    424424}
    425425
  • trunk/Source/WebCore/css/StyleScopeResolver.cpp

    r139590 r141524  
    102102    m_stack.shrink(0);
    103103    int authorStyleBoundsIndex = 0;
    104     for (const ContainerNode* scope = parent; scope; scope = scope->parentOrHostNode()) {
     104    for (const ContainerNode* scope = parent; scope; scope = scope->parentOrShadowHostNode()) {
    105105        RuleSet* ruleSet = ruleSetFor(scope);
    106106        if (ruleSet)
     
    148148        if (scope->isShadowRoot() && !toShadowRoot(scope)->applyAuthorStyles())
    149149            --m_stackParentBoundsIndex;
    150         m_stackParent = scope->parentOrHostNode();
     150        m_stackParent = scope->parentOrShadowHostNode();
    151151    }
    152152}
  • trunk/Source/WebCore/dom/Attr.cpp

    r134322 r141524  
    8282        // This does everything appendChild() would do in this situation (assuming m_ignoreChildrenChanged was set),
    8383        // but much more efficiently.
    84         textNode->setParentOrHostNode(this);
     84        textNode->setParentOrShadowHostNode(this);
    8585        setFirstChild(textNode.get());
    8686        setLastChild(textNode.get());
  • trunk/Source/WebCore/dom/ComposedShadowTreeWalker.cpp

    r139325 r141524  
    227227{
    228228    if (node->isPseudoElement())
    229         return node->parentOrHostNode();
     229        return node->parentOrShadowHostNode();
    230230
    231231    if (!canCrossUpperBoundary() && node->isShadowRoot()) {
  • trunk/Source/WebCore/dom/ContainerNode.cpp

    r141327 r141524  
    237237    // Check that this node is not "floating".
    238238    // If it is, it can be deleted as a side effect of sending mutation events.
    239     ASSERT(refCount() || parentOrHostNode());
     239    ASSERT(refCount() || parentOrShadowHostNode());
    240240
    241241    RefPtr<Node> protect(this);
     
    320320        m_firstChild = newChild;
    321321    }
    322     newChild->setParentOrHostNode(this);
     322    newChild->setParentOrShadowHostNode(this);
    323323    newChild->setPreviousSibling(prev);
    324324    newChild->setNextSibling(nextChild);
     
    353353    // Check that this node is not "floating".
    354354    // If it is, it can be deleted as a side effect of sending mutation events.
    355     ASSERT(refCount() || parentOrHostNode());
     355    ASSERT(refCount() || parentOrShadowHostNode());
    356356
    357357    RefPtr<Node> protect(this);
     
    475475    // Check that this node is not "floating".
    476476    // If it is, it can be deleted as a side effect of sending mutation events.
    477     ASSERT(refCount() || parentOrHostNode());
     477    ASSERT(refCount() || parentOrShadowHostNode());
    478478
    479479    RefPtr<Node> protect(this);
     
    552552    oldChild->setPreviousSibling(0);
    553553    oldChild->setNextSibling(0);
    554     oldChild->setParentOrHostNode(0);
     554    oldChild->setParentOrShadowHostNode(0);
    555555
    556556    document()->adoptIfNeeded(oldChild);
     
    609609                n->setPreviousSibling(0);
    610610                n->setNextSibling(0);
    611                 n->setParentOrHostNode(0);
     611                n->setParentOrShadowHostNode(0);
    612612                document()->adoptIfNeeded(n.get());
    613613
     
    646646    // Check that this node is not "floating".
    647647    // If it is, it can be deleted as a side effect of sending mutation events.
    648     ASSERT(refCount() || parentOrHostNode());
     648    ASSERT(refCount() || parentOrShadowHostNode());
    649649
    650650    ec = 0;
  • trunk/Source/WebCore/dom/ContainerNode.h

    r141516 r141524  
    267267    if (getFlag(NeedsShadowTreeWalkerFlag))
    268268        return true;
    269     ContainerNode* parent = parentOrHostNode();
     269    ContainerNode* parent = parentOrShadowHostNode();
    270270    return parent && parent->getFlag(NeedsShadowTreeWalkerFlag);
    271271}
  • trunk/Source/WebCore/dom/ContainerNodeAlgorithms.h

    r140856 r141524  
    109109inline void appendChildToContainer(GenericNode* child, GenericNodeContainer* container)
    110110{
    111     child->setParentOrHostNode(container);
     111    child->setParentOrShadowHostNode(container);
    112112
    113113    GenericNode* lastChild = container->lastChild();
     
    165165            n->setPreviousSibling(0);
    166166            n->setNextSibling(0);
    167             n->setParentOrHostNode(0);
     167            n->setParentOrShadowHostNode(0);
    168168
    169169            if (!n->refCount()) {
  • trunk/Source/WebCore/dom/Document.cpp

    r141418 r141524  
    58535853    Node* newHoverNode = innerElementInDocument;
    58545854    while (newHoverNode && !newHoverNode->renderer())
    5855         newHoverNode = newHoverNode->parentOrHostNode();
     5855        newHoverNode = newHoverNode->parentOrShadowHostNode();
    58565856
    58575857    // Update our current hover node.
  • trunk/Source/WebCore/dom/Document.h

    r141418 r141524  
    15931593inline Node::Node(Document* document, ConstructionType type)
    15941594    : m_nodeFlags(type)
    1595     , m_parentOrHostNode(0)
     1595    , m_parentOrShadowHostNode(0)
    15961596    , m_treeScope(document)
    15971597    , m_previous(0)
  • trunk/Source/WebCore/dom/Element.cpp

    r141292 r141524  
    24612461bool Element::isSpellCheckingEnabled() const
    24622462{
    2463     for (const Element* element = this; element; element = element->parentOrHostElement()) {
     2463    for (const Element* element = this; element; element = element->parentOrShadowHostElement()) {
    24642464        switch (element->spellcheckAttributeState()) {
    24652465        case SpellcheckAttributeTrue:
  • trunk/Source/WebCore/dom/Element.h

    r141516 r141524  
    860860    if (insertionPoint->inDocument())
    861861        setFlag(InDocumentFlag);
    862     if (parentOrHostNode()->isInShadowTree())
     862    if (parentOrShadowHostNode()->isInShadowTree())
    863863        setFlag(IsInShadowTreeFlag);
    864864    return InsertionDone;
  • trunk/Source/WebCore/dom/ElementRareData.h

    r141132 r141524  
    257257    ASSERT(!element->previousSibling());
    258258
    259     element->setParentOrHostNode(0);
     259    element->setParentOrShadowHostNode(0);
    260260}
    261261
  • trunk/Source/WebCore/dom/ElementShadow.cpp

    r141313 r141524  
    3737    RefPtr<ShadowRoot> shadowRoot = ShadowRoot::create(shadowHost->document(), type);
    3838
    39     shadowRoot->setParentOrHostNode(shadowHost);
     39    shadowRoot->setParentOrShadowHostNode(shadowHost);
    4040    shadowRoot->setParentTreeScope(shadowHost->treeScope());
    4141    m_shadowRoots.push(shadowRoot.get());
     
    7070
    7171        m_shadowRoots.removeHead();
    72         oldRoot->setParentOrHostNode(0);
     72        oldRoot->setParentOrShadowHostNode(0);
    7373        oldRoot->setParentTreeScope(shadowHost->document());
    7474        oldRoot->setPrev(0);
  • trunk/Source/WebCore/dom/Node.cpp

    r140807 r141524  
    811811inline void Node::markAncestorsWithChildNeedsStyleRecalc()
    812812{
    813     for (ContainerNode* p = parentOrHostNode(); p && !p->childNeedsStyleRecalc(); p = p->parentOrHostNode())
     813    for (ContainerNode* p = parentOrShadowHostNode(); p && !p->childNeedsStyleRecalc(); p = p->parentOrShadowHostNode())
    814814        p->setChildNeedsStyleRecalc();
    815815
     
    10361036bool Node::containsIncludingShadowDOM(const Node* node) const
    10371037{
    1038     for (; node; node = node->parentOrHostNode()) {
     1038    for (; node; node = node->parentOrShadowHostNode()) {
    10391039        if (node == this)
    10401040            return true;
     
    10521052            node = static_cast<const TemplateContentDocumentFragment*>(node)->host();
    10531053        else
    1054             node = node->parentOrHostNode();
     1054            node = node->parentOrShadowHostNode();
    10551055    }
    10561056    return false;
     
    11971197RenderStyle* Node::virtualComputedStyle(PseudoId pseudoElementSpecifier)
    11981198{
    1199     return parentOrHostNode() ? parentOrHostNode()->computedStyle(pseudoElementSpecifier) : 0;
     1199    return parentOrShadowHostNode() ? parentOrShadowHostNode()->computedStyle(pseudoElementSpecifier) : 0;
    12001200}
    12011201
     
    12201220            return false;
    12211221    }
    1222     return parentOrHostNode() ? parentOrHostNode()->canStartSelection() : true;
     1222    return parentOrShadowHostNode() ? parentOrShadowHostNode()->canStartSelection() : true;
    12231223}
    12241224
     
    12651265}
    12661266
    1267 Element* Node::parentOrHostElement() const
    1268 {
    1269     ContainerNode* parent = parentOrHostNode();
     1267Element* Node::parentOrShadowHostElement() const
     1268{
     1269    ContainerNode* parent = parentOrShadowHostNode();
    12701270    if (!parent)
    12711271        return 0;
     
    19021902    Vector<const Node*, 16> chain;
    19031903    const Node* node = this;
    1904     while (node->parentOrHostNode()) {
     1904    while (node->parentOrShadowHostNode()) {
    19051905        chain.append(node);
    1906         node = node->parentOrHostNode();
     1906        node = node->parentOrShadowHostNode();
    19071907    }
    19081908    for (unsigned index = chain.size(); index > 0; --index) {
     
    19591959        StringBuilder indent;
    19601960        indent.append(baseIndent);
    1961         for (const Node* tmpNode = node; tmpNode && tmpNode != rootNode; tmpNode = tmpNode->parentOrHostNode())
     1961        for (const Node* tmpNode = node; tmpNode && tmpNode != rootNode; tmpNode = tmpNode->parentOrShadowHostNode())
    19621962            indent.append('\t');
    19631963        fprintf(stderr, "%s", indent.toString().utf8().data());
     
    19761976    const Node* rootNode;
    19771977    const Node* node = this;
    1978     while (node->parentOrHostNode() && !node->hasTagName(bodyTag))
    1979         node = node->parentOrHostNode();
     1978    while (node->parentOrShadowHostNode() && !node->hasTagName(bodyTag))
     1979        node = node->parentOrShadowHostNode();
    19801980    rootNode = node;
    19811981
     
    19981998}
    19991999
    2000 static ContainerNode* parentOrHostOrFrameOwner(const Node* node)
    2001 {
    2002     ContainerNode* parent = node->parentOrHostNode();
     2000static ContainerNode* parentOrShadowHostOrFrameOwner(const Node* node)
     2001{
     2002    ContainerNode* parent = node->parentOrShadowHostNode();
    20032003    if (!parent && node->document() && node->document()->frame())
    20042004        parent = node->document()->frame()->ownerElement();
     
    20282028{
    20292029    Node* rootNode = const_cast<Node*>(this);
    2030     while (parentOrHostOrFrameOwner(rootNode))
    2031         rootNode = parentOrHostOrFrameOwner(rootNode);
     2030    while (parentOrShadowHostOrFrameOwner(rootNode))
     2031        rootNode = parentOrShadowHostOrFrameOwner(rootNode);
    20322032    showSubTreeAcrossFrame(rootNode, this, "");
    20332033}
     
    20622062Node* Node::enclosingLinkEventParentOrSelf()
    20632063{
    2064     for (Node* node = this; node; node = node->parentOrHostNode()) {
     2064    for (Node* node = this; node; node = node->parentOrShadowHostNode()) {
    20652065        // For imagemaps, the enclosing link node is the associated area element not the image itself.
    20662066        // So we don't let images be the enclosingLinkNode, even though isLink sometimes returns true
     
    24912491        Node* startNode = this;
    24922492        while (startNode && !startNode->renderer())
    2493             startNode = startNode->parentOrHostNode();
     2493            startNode = startNode->parentOrShadowHostNode();
    24942494       
    24952495        if (startNode && startNode->renderer())
     
    25842584    MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM);
    25852585    ScriptWrappable::reportMemoryUsage(memoryObjectInfo);
    2586     info.addMember(m_parentOrHostNode);
     2586    info.addMember(m_parentOrShadowHostNode);
    25872587    info.addMember(m_treeScope);
    25882588    info.addMember(m_next);
     
    26282628        return;
    26292629
    2630     for (Node* node = parentOrHostNode(); node; node = node->parentOrHostNode())
     2630    for (Node* node = parentOrShadowHostNode(); node; node = node->parentOrShadowHostNode())
    26312631        node->decrementConnectedSubframeCount(count);
    26322632}
     
    26392639        return;
    26402640
    2641     for (Node* node = parentOrHostNode(); node; node = node->parentOrHostNode())
     2641    for (Node* node = parentOrShadowHostNode(); node; node = node->parentOrShadowHostNode())
    26422642        node->incrementConnectedSubframeCount(count);
    26432643}
  • trunk/Source/WebCore/dom/Node.h

    r140807 r141524  
    276276
    277277    // Node's parent, shadow tree host.
    278     // FIXME: These methods should be renamed parentOrShadowHost*
    279     ContainerNode* parentOrHostNode() const;
    280     Element* parentOrHostElement() const;
    281     void setParentOrHostNode(ContainerNode*);
     278    ContainerNode* parentOrShadowHostNode() const;
     279    Element* parentOrShadowHostElement() const;
     280    void setParentOrShadowHostNode(ContainerNode*);
    282281    Node* highestAncestor() const;
    283282
     
    779778
    780779    void removedLastRef();
    781     bool hasTreeSharedParent() const { return !!parentOrHostNode(); }
     780    bool hasTreeSharedParent() const { return !!parentOrShadowHostNode(); }
    782781
    783782    enum EditableLevel { Editable, RichlyEditable };
     
    813812
    814813    mutable uint32_t m_nodeFlags;
    815     ContainerNode* m_parentOrHostNode;
     814    ContainerNode* m_parentOrShadowHostNode;
    816815    TreeScope* m_treeScope;
    817816    Node* m_previous;
     
    849848}
    850849
    851 inline void Node::setParentOrHostNode(ContainerNode* parent)
     850inline void Node::setParentOrShadowHostNode(ContainerNode* parent)
    852851{
    853852    ASSERT(isMainThread());
    854     m_parentOrHostNode = parent;
     853    m_parentOrShadowHostNode = parent;
    855854}
    856855
    857 inline ContainerNode* Node::parentOrHostNode() const
     856inline ContainerNode* Node::parentOrShadowHostNode() const
    858857{
    859858    ASSERT(isMainThreadOrGCThread());
    860     return m_parentOrHostNode;
     859    return m_parentOrShadowHostNode;
    861860}
    862861
    863862inline ContainerNode* Node::parentNode() const
    864863{
    865     return isShadowRoot() ? 0 : parentOrHostNode();
     864    return isShadowRoot() ? 0 : parentOrShadowHostNode();
    866865}
    867866
     
    869868{
    870869    ASSERT(!isShadowRoot());
    871     return parentOrHostNode();
     870    return parentOrShadowHostNode();
    872871}
    873872
  • trunk/Source/WebCore/dom/PseudoElement.cpp

    r141119 r141524  
    5959{
    6060    ASSERT(pseudoId != NOPSEUDO);
    61     setParentOrHostNode(parent);
     61    setParentOrShadowHostNode(parent);
    6262    setHasCustomCallbacks();
    6363}
     
    6565PassRefPtr<RenderStyle> PseudoElement::customStyleForRenderer()
    6666{
    67     return parentOrHostElement()->renderer()->getCachedPseudoStyle(m_pseudoId);
     67    return parentOrShadowHostElement()->renderer()->getCachedPseudoStyle(m_pseudoId);
    6868}
    6969
  • trunk/Source/WebCore/dom/ShadowRoot.h

    r141516 r141524  
    6565    void setResetStyleInheritance(bool);
    6666
    67     Element* host() const { return toElement(parentOrHostNode()); }
     67    Element* host() const { return toElement(parentOrShadowHostNode()); }
    6868    ElementShadow* owner() const { return host() ? host()->shadow() : 0; }
    6969
  • trunk/Source/WebCore/dom/Text.cpp

    r137715 r141524  
    254254static bool isSVGText(Text* text)
    255255{
    256     Node* parentOrHostNode = text->parentOrHostNode();
    257     return parentOrHostNode->isSVGElement() && !parentOrHostNode->hasTagName(SVGNames::foreignObjectTag);
     256    Node* parentOrShadowHostNode = text->parentOrShadowHostNode();
     257    return parentOrShadowHostNode->isSVGElement() && !parentOrShadowHostNode->hasTagName(SVGNames::foreignObjectTag);
    258258}
    259259#endif
  • trunk/Source/WebCore/editing/FrameSelection.cpp

    r141243 r141524  
    18861886                return;
    18871887            }
    1888             target = target->parentOrHostNode();
     1888            target = target->parentOrShadowHostNode();
    18891889        }
    18901890        m_frame->document()->setFocusedNode(0);
  • trunk/Source/WebCore/editing/TextIterator.cpp

    r141196 r141524  
    178178{
    179179    unsigned depth = 0;
    180     for (Node* parent = node->parentOrHostNode(); parent; parent = parent->parentOrHostNode())
     180    for (Node* parent = node->parentOrShadowHostNode(); parent; parent = parent->parentOrShadowHostNode())
    181181        ++depth;
    182182    return depth;
     
    194194            return next;
    195195    }
    196     for (Node* node = rangeEndContainer; node; node = node->parentOrHostNode()) {
     196    for (Node* node = rangeEndContainer; node; node = node->parentOrShadowHostNode()) {
    197197        if (Node* next = node->nextSibling())
    198198            return next;
     
    232232    // Put the nodes in a vector so we can iterate in reverse order.
    233233    Vector<Node*, 100> ancestry;
    234     for (Node* parent = node->parentOrHostNode(); parent; parent = parent->parentOrHostNode())
     234    for (Node* parent = node->parentOrShadowHostNode(); parent; parent = parent->parentOrShadowHostNode())
    235235        ancestry.append(parent);
    236236
     
    428428            if (!next) {
    429429                bool pastEnd = NodeTraversal::next(m_node) == m_pastEndNode;
    430                 Node* parentNode = m_node->parentOrHostNode();
     430                Node* parentNode = m_node->parentOrShadowHostNode();
    431431                while (!next && parentNode) {
    432432                    if ((pastEnd && parentNode == m_endContainer) || m_endContainer->isDescendantOf(parentNode))
     
    435435                    m_node = parentNode;
    436436                    m_fullyClippedStack.pop();
    437                     parentNode = m_node->parentOrHostNode();
     437                    parentNode = m_node->parentOrShadowHostNode();
    438438                    if (haveRenderer)
    439439                        exitNode();
     
    12361236            // Exit all other containers.
    12371237            while (!m_node->previousSibling()) {
    1238                 if (!advanceRespectingRange(m_node->parentOrHostNode()))
     1238                if (!advanceRespectingRange(m_node->parentOrShadowHostNode()))
    12391239                    break;
    12401240                m_fullyClippedStack.pop();
  • trunk/Source/WebCore/html/HTMLFrameOwnerElement.cpp

    r140807 r141524  
    5959    m_contentFrame = frame;
    6060
    61     for (ContainerNode* node = this; node; node = node->parentOrHostNode())
     61    for (ContainerNode* node = this; node; node = node->parentOrShadowHostNode())
    6262        node->incrementConnectedSubframeCount();
    6363}
     
    7070    m_contentFrame = 0;
    7171
    72     for (ContainerNode* node = this; node; node = node->parentOrHostNode())
     72    for (ContainerNode* node = this; node; node = node->parentOrShadowHostNode())
    7373        node->decrementConnectedSubframeCount();
    7474}
  • trunk/Source/WebCore/html/HTMLFrameOwnerElement.h

    r141516 r141524  
    9494    static bool canLoadFrame(HTMLFrameOwnerElement* owner)
    9595    {
    96         for (Node* node = owner; node; node = node->parentOrHostNode()) {
     96        for (Node* node = owner; node; node = node->parentOrShadowHostNode()) {
    9797            if (disabledSubtreeRoots().contains(node))
    9898                return false;
  • trunk/Source/WebCore/html/HTMLStyleElement.cpp

    r137708 r141524  
    239239    // As written, such a stylesheet could style the host element, as well as children of the host.
    240240    // OTOH, this paves the way for a :bound-element implementation.
    241     ContainerNode* parentOrHost = parentOrHostNode();
    242     if (!parentOrHost || !parentOrHost->isElementNode())
     241    ContainerNode* parentOrShadowHost = parentOrShadowHostNode();
     242    if (!parentOrShadowHost || !parentOrShadowHost->isElementNode())
    243243        return 0;
    244244
    245     return toElement(parentOrHost);
     245    return toElement(parentOrShadowHost);
    246246}
    247247
  • trunk/Source/WebCore/html/MediaDocument.cpp

    r138285 r141524  
    154154{
    155155    while (node && !node->hasTagName(videoTag))
    156         node = node->parentOrHostNode();
     156        node = node->parentOrShadowHostNode();
    157157
    158158    return static_cast<HTMLVideoElement*>(node);
  • trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp

    r141436 r141524  
    803803    ancestors.append(node);
    804804    if (includeAncestors) {
    805         for (ContainerNode* ancestor = node->parentOrHostNode(); ancestor; ancestor = ancestor->parentOrHostNode())
     805        for (ContainerNode* ancestor = node->parentOrShadowHostNode(); ancestor; ancestor = ancestor->parentOrShadowHostNode())
    806806            ancestors.append(ancestor);
    807807    }
  • trunk/Source/WebCore/page/EventHandler.cpp

    r141394 r141524  
    22692269                break;
    22702270            }
    2271             node = node->parentOrHostNode();
     2271            node = node->parentOrShadowHostNode();
    22722272        }
    22732273
  • trunk/Source/WebCore/page/TouchAdjustment.cpp

    r136001 r141524  
    239239        Vector<Node*> visitedNodes;
    240240        Node* respondingNode = 0;
    241         for (Node* visitedNode = node; visitedNode; visitedNode = visitedNode->parentOrHostNode()) {
     241        for (Node* visitedNode = node; visitedNode; visitedNode = visitedNode->parentOrShadowHostNode()) {
    242242            // Check if we already have a result for a common ancestor from another candidate.
    243243            respondingNode = responderMap.get(visitedNode);
     
    249249                respondingNode = visitedNode;
    250250                // Continue the iteration to collect the ancestors of the responder, which we will need later.
    251                 for (visitedNode = visitedNode->parentOrHostNode(); visitedNode; visitedNode = visitedNode->parentOrHostNode()) {
     251                for (visitedNode = visitedNode->parentOrShadowHostNode(); visitedNode; visitedNode = visitedNode->parentOrShadowHostNode()) {
    252252                    HashSet<Node*>::AddResult addResult = ancestorsToRespondersSet.add(visitedNode);
    253253                    if (!addResult.isNewEntry)
     
    282282        if (candidate->isContentEditable()) {
    283283            Node* replacement = candidate;
    284             Node* parent = candidate->parentOrHostNode();
     284            Node* parent = candidate->parentOrShadowHostNode();
    285285            while (parent && parent->isContentEditable()) {
    286286                replacement = parent;
     
    290290                }
    291291                editableAncestors.add(replacement);
    292                 parent = parent->parentOrHostNode();
     292                parent = parent->parentOrShadowHostNode();
    293293            }
    294294            candidate = replacement;
  • trunk/Source/WebCore/rendering/HitTestResult.cpp

    r140541 r141524  
    269269{
    270270    if (n && n->isPseudoElement())
    271         n = n->parentOrHostNode();
     271        n = n->parentOrShadowHostNode();
    272272    m_innerNode = n;
    273273}
     
    276276{
    277277    if (n && n->isPseudoElement())
    278         n = n->parentOrHostNode();
     278        n = n->parentOrShadowHostNode();
    279279    m_innerNonSharedNode = n;
    280280}
  • trunk/Source/WebCore/rendering/RenderObject.h

    r140506 r141524  
    612612    // This is the same as node() except for renderers of :before and :after
    613613    // pseudo elements for which their parent node is returned.
    614     Node* generatingNode() const { return isPseudoElement() ? node()->parentOrHostNode() : node(); }
     614    Node* generatingNode() const { return isPseudoElement() ? node()->parentOrShadowHostNode() : node(); }
    615615
    616616    Document* document() const { return m_node->document(); }
  • trunk/Source/WebCore/rendering/RenderTreeAsText.cpp

    r138909 r141524  
    792792    Node* parent;
    793793    for (Node* n = node; n; n = parent) {
    794         parent = n->parentOrHostNode();
     794        parent = n->parentOrShadowHostNode();
    795795        if (n != node)
    796796            result.appendLiteral(" of ");
  • trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp

    r137847 r141524  
    141141            break;
    142142
    143         current = current->parentOrHostNode();
     143        current = current->parentOrShadowHostNode();
    144144    }
    145145}
  • trunk/Source/WebCore/svg/SVGElement.cpp

    r138823 r141524  
    122122    // for a <symbol> element or a cloned <svg> element in the referenced tree. In that case
    123123    // we're always an inner <svg> element.
    124     if (isInShadowTree() && parentOrHostElement() && parentOrHostElement()->isSVGElement())
     124    if (isInShadowTree() && parentOrShadowHostElement() && parentOrShadowHostElement()->isSVGElement())
    125125        return false;
    126126
     
    188188SVGSVGElement* SVGElement::ownerSVGElement() const
    189189{
    190     ContainerNode* n = parentOrHostNode();
     190    ContainerNode* n = parentOrShadowHostNode();
    191191    while (n) {
    192192        if (n->hasTagName(SVGNames::svgTag))
    193193            return static_cast<SVGSVGElement*>(n);
    194194
    195         n = n->parentOrHostNode();
     195        n = n->parentOrShadowHostNode();
    196196    }
    197197
     
    203203    // This function needs shadow tree support - as RenderSVGContainer uses this function
    204204    // to determine the "overflow" property. <use> on <symbol> wouldn't work otherwhise.
    205     ContainerNode* n = parentOrHostNode();
     205    ContainerNode* n = parentOrShadowHostNode();
    206206    while (n) {
    207207        if (n->hasTagName(SVGNames::svgTag) || n->hasTagName(SVGNames::imageTag) || n->hasTagName(SVGNames::symbolTag))
    208208            return static_cast<SVGElement*>(n);
    209209
    210         n = n->parentOrHostNode();
     210        n = n->parentOrShadowHostNode();
    211211    }
    212212
     
    442442        return true;
    443443
    444     for (element = element->parentOrHostElement(); element; element = element->parentOrHostElement()) {
     444    for (element = element->parentOrShadowHostElement(); element; element = element->parentOrShadowHostElement()) {
    445445        const EventListenerVector& entry = element->getEventListeners(eventNames().loadEvent);
    446446        for (size_t i = 0; i < entry.size(); ++i) {
     
    459459        RefPtr<Element> parent;
    460460        if (sendParentLoadEvents)
    461             parent = currentTarget->parentOrHostElement(); // save the next parent to dispatch too incase dispatching the event changes the tree
     461            parent = currentTarget->parentOrShadowHostElement(); // save the next parent to dispatch too incase dispatching the event changes the tree
    462462        if (hasLoadListener(currentTarget.get()))
    463463            currentTarget->dispatchEvent(Event::create(eventNames().loadEvent, false, false));
     
    586586
    587587    RenderStyle* style = 0;
    588     if (Element* parent = parentOrHostElement()) {
     588    if (Element* parent = parentOrShadowHostElement()) {
    589589        if (RenderObject* renderer = parent->renderer())
    590590            style = renderer->style();
     
    618618
    619619    RenderStyle* parentStyle = 0;
    620     if (Element* parent = parentOrHostElement()) {
     620    if (Element* parent = parentOrShadowHostElement()) {
    621621        if (RenderObject* renderer = parent->renderer())
    622622            parentStyle = renderer->style();
  • trunk/Source/WebCore/svg/SVGElementInstance.h

    r140784 r141524  
    4848    virtual ~SVGElementInstance();
    4949
    50     void setParentOrHostNode(SVGElementInstance* instance) { m_parentInstance = instance; }
     50    void setParentOrShadowHostNode(SVGElementInstance* instance) { m_parentInstance = instance; }
    5151
    5252    virtual const AtomicString& interfaceName() const;
  • trunk/Source/WebCore/svg/SVGForeignObjectElement.cpp

    r135069 r141524  
    154154    // Note that we currently do not support foreignObject instantiation via <use>, hence it is safe
    155155    // to use parentElement() here. If that changes, this method should be updated to use
    156     // parentOrHostElement() instead.
     156    // parentOrShadowHostElement() instead.
    157157    Element* ancestor = parentElement();
    158158    while (ancestor && ancestor->isSVGElement()) {
  • trunk/Source/WebCore/svg/SVGGElement.cpp

    r135069 r141524  
    113113    // Unlike SVGStyledElement::rendererIsNeeded(), we still create renderers, even if
    114114    // display is set to 'none' - which is special to SVG <g> container elements.
    115     return parentOrHostElement() && parentOrHostElement()->isSVGElement();
     115    return parentOrShadowHostElement() && parentOrShadowHostElement()->isSVGElement();
    116116}
    117117
  • trunk/Source/WebCore/svg/SVGLocatable.cpp

    r109097 r141524  
    4444{
    4545    ASSERT(element);
    46     for (Element* current = element->parentOrHostElement(); current; current = current->parentOrHostElement()) {
     46    for (Element* current = element->parentOrShadowHostElement(); current; current = current->parentOrShadowHostElement()) {
    4747        if (isViewportElement(current))
    4848            return static_cast<SVGElement*>(current);
     
    5656    ASSERT(element);
    5757    SVGElement* farthest = 0;
    58     for (Element* current = element->parentOrHostElement(); current; current = current->parentOrHostElement()) {
     58    for (Element* current = element->parentOrShadowHostElement(); current; current = current->parentOrShadowHostElement()) {
    5959        if (isViewportElement(current))
    6060            farthest = static_cast<SVGElement*>(current);
     
    8585
    8686    SVGElement* stopAtElement = mode == NearestViewportScope ? nearestViewportElement(element) : 0;
    87     for (Element* currentElement = element; currentElement; currentElement = currentElement->parentOrHostElement()) {
     87    for (Element* currentElement = element; currentElement; currentElement = currentElement->parentOrShadowHostElement()) {
    8888        if (!currentElement->isSVGElement())
    8989            break;
  • trunk/Source/WebCore/svg/SVGStyledElement.cpp

    r139457 r141524  
    123123    // with the SVG content. In general, the SVG user agent will include the unknown
    124124    // elements in the DOM but will otherwise ignore unknown elements.
    125     if (!parentOrHostElement() || parentOrHostElement()->isSVGElement())
     125    if (!parentOrShadowHostElement() || parentOrShadowHostElement()->isSVGElement())
    126126        return StyledElement::rendererIsNeeded(context);
    127127
  • trunk/Source/WebKit2/ChangeLog

    r141510 r141524  
     12013-01-31  Changhun Kang  <temoochin@company100.net>
     2
     3        Rename from parentOrHost* to parentOrShadowHost* in Node.h.
     4        https://bugs.webkit.org/show_bug.cgi?id=108308
     5
     6        Reviewed by Dimitri Glazkov.
     7
    182013-01-31  Anders Carlsson  <andersca@apple.com>
    29
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r141486 r141524  
    17691769        // Find the node to highlight. This is not the same as the node responding the tap gesture, because many
    17701770        // pages has a global click handler and we do not want to highlight the body.
    1771         for (Node* node = adjustedNode; node; node = node->parentOrHostNode()) {
     1771        for (Node* node = adjustedNode; node; node = node->parentOrShadowHostNode()) {
    17721772            if (node->isDocumentNode() || node->isFrameOwnerElement())
    17731773                break;
Note: See TracChangeset for help on using the changeset viewer.