Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Side by Side Diff: third_party/WebKit/Source/core/dom/Node.h

Issue 2149893003: Rename Node::inShadowIncludingDocument() to Node::isConnected() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004-2011, 2014 Apple Inc. All rights reserved. 5 * Copyright (C) 2004-2011, 2014 Apple Inc. All rights reserved.
6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 } 469 }
470 470
471 TreeScope& containingTreeScope() const 471 TreeScope& containingTreeScope() const
472 { 472 {
473 DCHECK(isInTreeScope()); 473 DCHECK(isInTreeScope());
474 return *m_treeScope; 474 return *m_treeScope;
475 } 475 }
476 476
477 bool inActiveDocument() const; 477 bool inActiveDocument() const;
478 478
479 // Returns true if this node is associated with a shadow-including document and is in its associated document's 479 // Returns true if this node is connected to a document, false otherwise.
480 // node tree, false otherwise. 480 // If you are looking for inDocument() or inShadowIncludingDocument(), they were removed. Use isConnected() instead.
tkent 2016/07/14 08:21:09 I don't think this line is necessary. Also, I wan
hayato 2016/07/14 08:47:12 Done. Since the definition of "connected" is "An
481 bool inShadowIncludingDocument() const 481 bool isConnected() const
482 { 482 {
483 return getFlag(InDocumentFlag); 483 return getFlag(IsConnectedFlag);
484 } 484 }
485 bool isInShadowTree() const { return getFlag(IsInShadowTreeFlag); } 485 bool isInShadowTree() const { return getFlag(IsInShadowTreeFlag); }
486 bool isInTreeScope() const { return getFlag(static_cast<NodeFlags>(InDocumen tFlag | IsInShadowTreeFlag)); } 486 bool isInTreeScope() const { return getFlag(static_cast<NodeFlags>(IsConnect edFlag | IsInShadowTreeFlag)); }
487 487
488 ElementShadow* parentElementShadow() const; 488 ElementShadow* parentElementShadow() const;
489 bool isInV1ShadowTree() const; 489 bool isInV1ShadowTree() const;
490 bool isInV0ShadowTree() const; 490 bool isInV0ShadowTree() const;
491 bool isChildOfV1ShadowHost() const; 491 bool isChildOfV1ShadowHost() const;
492 bool isChildOfV0ShadowHost() const; 492 bool isChildOfV0ShadowHost() const;
493 ShadowRoot* v1ShadowRootOfParent() const; 493 ShadowRoot* v1ShadowRootOfParent() const;
494 494
495 bool isDocumentTypeNode() const { return getNodeType() == DOCUMENT_TYPE_NODE ; } 495 bool isDocumentTypeNode() const { return getNodeType() == DOCUMENT_TYPE_NODE ; }
496 virtual bool childTypeAllowed(NodeType) const { return false; } 496 virtual bool childTypeAllowed(NodeType) const { return false; }
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 564
565 // ------------------------------------------------------------------------- ---- 565 // ------------------------------------------------------------------------- ----
566 // Notification of document structure changes (see ContainerNode.h for more notification methods) 566 // Notification of document structure changes (see ContainerNode.h for more notification methods)
567 // 567 //
568 // At first, WebKit notifies the node that it has been inserted into the doc ument. This is called during document parsing, and also 568 // At first, WebKit notifies the node that it has been inserted into the doc ument. This is called during document parsing, and also
569 // when a node is added through the DOM methods insertBefore(), appendChild( ) or replaceChild(). The call happens _after_ the node has been added to the tre e. 569 // when a node is added through the DOM methods insertBefore(), appendChild( ) or replaceChild(). The call happens _after_ the node has been added to the tre e.
570 // This is similar to the DOMNodeInsertedIntoDocument DOM event, but does no t require the overhead of event 570 // This is similar to the DOMNodeInsertedIntoDocument DOM event, but does no t require the overhead of event
571 // dispatching. 571 // dispatching.
572 // 572 //
573 // WebKit notifies this callback regardless if the subtree of the node is a document tree or a floating subtree. 573 // WebKit notifies this callback regardless if the subtree of the node is a document tree or a floating subtree.
574 // Implementation can determine the type of subtree by seeing insertionPoint ->inShadowIncludingDocument(). 574 // Implementation can determine the type of subtree by seeing insertionPoint ->isConnected().
575 // For a performance reason, notifications are delivered only to ContainerNo de subclasses if the insertionPoint is out of document. 575 // For a performance reason, notifications are delivered only to ContainerNo de subclasses if the insertionPoint is out of document.
576 // 576 //
577 // There are another callback named didNotifySubtreeInsertionsToDocument(), which is called after all the descendant is notified, 577 // There are another callback named didNotifySubtreeInsertionsToDocument(), which is called after all the descendant is notified,
578 // if this node was inserted into the document tree. Only a few subclasses a ctually need this. To utilize this, the node should 578 // if this node was inserted into the document tree. Only a few subclasses a ctually need this. To utilize this, the node should
579 // return InsertionShouldCallDidNotifySubtreeInsertions from insertedInto(). 579 // return InsertionShouldCallDidNotifySubtreeInsertions from insertedInto().
580 // 580 //
581 enum InsertionNotificationRequest { 581 enum InsertionNotificationRequest {
582 InsertionDone, 582 InsertionDone,
583 InsertionShouldCallDidNotifySubtreeInsertions 583 InsertionShouldCallDidNotifySubtreeInsertions
584 }; 584 };
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 703
704 // Changes based on if the element should be treated like a link, 704 // Changes based on if the element should be treated like a link,
705 // ex. When setting the href attribute on an <a>. 705 // ex. When setting the href attribute on an <a>.
706 IsLinkFlag = 1 << 8, 706 IsLinkFlag = 1 << 8,
707 707
708 // Changes based on :hover, :active and :focus state. 708 // Changes based on :hover, :active and :focus state.
709 IsUserActionElementFlag = 1 << 9, 709 IsUserActionElementFlag = 1 << 9,
710 710
711 // Tree state flags. These change when the element is added/removed 711 // Tree state flags. These change when the element is added/removed
712 // from a DOM tree. 712 // from a DOM tree.
713 InDocumentFlag = 1 << 10, 713 IsConnectedFlag = 1 << 10,
714 IsInShadowTreeFlag = 1 << 11, 714 IsInShadowTreeFlag = 1 << 11,
715 715
716 // Set by the parser when the children are done parsing. 716 // Set by the parser when the children are done parsing.
717 IsFinishedParsingChildrenFlag = 1 << 12, 717 IsFinishedParsingChildrenFlag = 1 << 12,
718 718
719 // Flags related to recalcStyle. 719 // Flags related to recalcStyle.
720 SVGFilterNeedsLayerUpdateFlag = 1 << 13, 720 SVGFilterNeedsLayerUpdateFlag = 1 << 13,
721 HasCustomStyleCallbacksFlag = 1 << 14, 721 HasCustomStyleCallbacksFlag = 1 << 14,
722 ChildNeedsStyleInvalidationFlag = 1 << 15, 722 ChildNeedsStyleInvalidationFlag = 1 << 15,
723 NeedsStyleInvalidationFlag = 1 << 16, 723 NeedsStyleInvalidationFlag = 1 << 16,
(...skipping 26 matching lines...) Expand all
750 protected: 750 protected:
751 enum ConstructionType { 751 enum ConstructionType {
752 CreateOther = DefaultNodeFlags, 752 CreateOther = DefaultNodeFlags,
753 CreateText = DefaultNodeFlags | IsTextFlag, 753 CreateText = DefaultNodeFlags | IsTextFlag,
754 CreateContainer = DefaultNodeFlags | ChildNeedsStyleRecalcFlag | IsConta inerFlag, 754 CreateContainer = DefaultNodeFlags | ChildNeedsStyleRecalcFlag | IsConta inerFlag,
755 CreateElement = CreateContainer | IsElementFlag, 755 CreateElement = CreateContainer | IsElementFlag,
756 CreateShadowRoot = CreateContainer | IsDocumentFragmentFlag | IsInShadow TreeFlag, 756 CreateShadowRoot = CreateContainer | IsDocumentFragmentFlag | IsInShadow TreeFlag,
757 CreateDocumentFragment = CreateContainer | IsDocumentFragmentFlag, 757 CreateDocumentFragment = CreateContainer | IsDocumentFragmentFlag,
758 CreateHTMLElement = CreateElement | IsHTMLFlag, 758 CreateHTMLElement = CreateElement | IsHTMLFlag,
759 CreateSVGElement = CreateElement | IsSVGFlag, 759 CreateSVGElement = CreateElement | IsSVGFlag,
760 CreateDocument = CreateContainer | InDocumentFlag, 760 CreateDocument = CreateContainer | IsConnectedFlag,
761 CreateInsertionPoint = CreateHTMLElement | IsInsertionPointFlag, 761 CreateInsertionPoint = CreateHTMLElement | IsInsertionPointFlag,
762 CreateEditingText = CreateText | HasNameOrIsEditingTextFlag, 762 CreateEditingText = CreateText | HasNameOrIsEditingTextFlag,
763 }; 763 };
764 764
765 Node(TreeScope*, ConstructionType); 765 Node(TreeScope*, ConstructionType);
766 766
767 virtual void didMoveToNewDocument(Document& oldDocument); 767 virtual void didMoveToNewDocument(Document& oldDocument);
768 768
769 void addedEventListener(const AtomicString& eventType, RegisteredEventListen er&) override; 769 void addedEventListener(const AtomicString& eventType, RegisteredEventListen er&) override;
770 void removedEventListener(const AtomicString& eventType, const RegisteredEve ntListener&) override; 770 void removedEventListener(const AtomicString& eventType, const RegisteredEve ntListener&) override;
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 } // namespace blink 922 } // namespace blink
923 923
924 #ifndef NDEBUG 924 #ifndef NDEBUG
925 // Outside the WebCore namespace for ease of invocation from gdb. 925 // Outside the WebCore namespace for ease of invocation from gdb.
926 void showNode(const blink::Node*); 926 void showNode(const blink::Node*);
927 void showTree(const blink::Node*); 927 void showTree(const blink::Node*);
928 void showNodePath(const blink::Node*); 928 void showNodePath(const blink::Node*);
929 #endif 929 #endif
930 930
931 #endif // Node_h 931 #endif // Node_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698