| OLD | NEW |
| 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, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 void setIsCustomElement(); | 256 void setIsCustomElement(); |
| 257 | 257 |
| 258 virtual bool isMediaControlElement() const { return false; } | 258 virtual bool isMediaControlElement() const { return false; } |
| 259 virtual bool isMediaControls() const { return false; } | 259 virtual bool isMediaControls() const { return false; } |
| 260 virtual bool isWebVTTElement() const { return false; } | 260 virtual bool isWebVTTElement() const { return false; } |
| 261 bool isStyledElement() const { return getFlag(IsStyledElementFlag); } | 261 bool isStyledElement() const { return getFlag(IsStyledElementFlag); } |
| 262 virtual bool isAttributeNode() const { return false; } | 262 virtual bool isAttributeNode() const { return false; } |
| 263 virtual bool isCharacterDataNode() const { return false; } | 263 virtual bool isCharacterDataNode() const { return false; } |
| 264 virtual bool isFrameOwnerElement() const { return false; } | 264 virtual bool isFrameOwnerElement() const { return false; } |
| 265 virtual bool isPluginElement() const { return false; } | 265 virtual bool isPluginElement() const { return false; } |
| 266 virtual bool isInsertionPointNode() const { return false; } | |
| 267 | 266 |
| 268 bool isDocumentNode() const; | 267 bool isDocumentNode() const; |
| 269 bool isTreeScope() const { return treeScope()->rootNode() == this; } | 268 bool isTreeScope() const { return treeScope()->rootNode() == this; } |
| 270 bool isDocumentFragment() const { return getFlag(IsDocumentFragmentFlag); } | 269 bool isDocumentFragment() const { return getFlag(IsDocumentFragmentFlag); } |
| 271 bool isShadowRoot() const { return isDocumentFragment() && isTreeScope(); } | 270 bool isShadowRoot() const { return isDocumentFragment() && isTreeScope(); } |
| 272 bool isInsertionPoint() const { return getFlag(NeedsShadowTreeWalkerFlag) &&
isInsertionPointNode(); } | 271 bool isInsertionPoint() const { return getFlag(IsInsertionPointFlag); } |
| 273 | |
| 274 bool needsShadowTreeWalker() const; | |
| 275 bool needsShadowTreeWalkerSlow() const; | |
| 276 void setNeedsShadowTreeWalker() { setFlag(NeedsShadowTreeWalkerFlag); } | |
| 277 void resetNeedsShadowTreeWalker() { setFlag(needsShadowTreeWalkerSlow(), Nee
dsShadowTreeWalkerFlag); } | |
| 278 | 272 |
| 279 bool inNamedFlow() const { return getFlag(InNamedFlowFlag); } | 273 bool inNamedFlow() const { return getFlag(InNamedFlowFlag); } |
| 280 bool hasCustomStyleCallbacks() const { return getFlag(HasCustomStyleCallback
sFlag); } | 274 bool hasCustomStyleCallbacks() const { return getFlag(HasCustomStyleCallback
sFlag); } |
| 281 | 275 |
| 282 bool hasSyntheticAttrChildNodes() const { return getFlag(HasSyntheticAttrChi
ldNodesFlag); } | 276 bool hasSyntheticAttrChildNodes() const { return getFlag(HasSyntheticAttrChi
ldNodesFlag); } |
| 283 void setHasSyntheticAttrChildNodes(bool flag) { setFlag(flag, HasSyntheticAt
trChildNodesFlag); } | 277 void setHasSyntheticAttrChildNodes(bool flag) { setFlag(flag, HasSyntheticAt
trChildNodesFlag); } |
| 284 | 278 |
| 285 // If this node is in a shadow tree, returns its shadow host. Otherwise, ret
urns 0. | 279 // If this node is in a shadow tree, returns its shadow host. Otherwise, ret
urns 0. |
| 286 Element* shadowHost() const; | 280 Element* shadowHost() const; |
| 287 // If this node is in a shadow tree, returns its shadow host. Otherwise, ret
urns this. | 281 // If this node is in a shadow tree, returns its shadow host. Otherwise, ret
urns this. |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 SelfOrAncestorHasDirAutoFlag = 1 << 17, | 722 SelfOrAncestorHasDirAutoFlag = 1 << 17, |
| 729 | 723 |
| 730 HasNameOrIsEditingTextFlag = 1 << 18, | 724 HasNameOrIsEditingTextFlag = 1 << 18, |
| 731 | 725 |
| 732 InNamedFlowFlag = 1 << 19, | 726 InNamedFlowFlag = 1 << 19, |
| 733 HasSyntheticAttrChildNodesFlag = 1 << 20, | 727 HasSyntheticAttrChildNodesFlag = 1 << 20, |
| 734 HasCustomStyleCallbacksFlag = 1 << 21, | 728 HasCustomStyleCallbacksFlag = 1 << 21, |
| 735 HasScopedHTMLStyleChildFlag = 1 << 22, | 729 HasScopedHTMLStyleChildFlag = 1 << 22, |
| 736 HasEventTargetDataFlag = 1 << 23, | 730 HasEventTargetDataFlag = 1 << 23, |
| 737 V8CollectableDuringMinorGCFlag = 1 << 24, | 731 V8CollectableDuringMinorGCFlag = 1 << 24, |
| 738 NeedsShadowTreeWalkerFlag = 1 << 25, | 732 IsInsertionPointFlag = 1 << 25, |
| 739 IsInShadowTreeFlag = 1 << 26, | 733 IsInShadowTreeFlag = 1 << 26, |
| 740 IsCustomElement = 1 << 27, | 734 IsCustomElement = 1 << 27, |
| 741 | 735 |
| 742 DefaultNodeFlags = IsParsingChildrenFinishedFlag | 736 DefaultNodeFlags = IsParsingChildrenFinishedFlag |
| 743 }; | 737 }; |
| 744 | 738 |
| 745 // 4 bits remaining | 739 // 4 bits remaining |
| 746 | 740 |
| 747 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } | 741 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } |
| 748 void setFlag(bool f, NodeFlags mask) const { m_nodeFlags = (m_nodeFlags & ~m
ask) | (-(int32_t)f & mask); } | 742 void setFlag(bool f, NodeFlags mask) const { m_nodeFlags = (m_nodeFlags & ~m
ask) | (-(int32_t)f & mask); } |
| 749 void setFlag(NodeFlags mask) const { m_nodeFlags |= mask; } | 743 void setFlag(NodeFlags mask) const { m_nodeFlags |= mask; } |
| 750 void clearFlag(NodeFlags mask) const { m_nodeFlags &= ~mask; } | 744 void clearFlag(NodeFlags mask) const { m_nodeFlags &= ~mask; } |
| 751 | 745 |
| 752 protected: | 746 protected: |
| 753 enum ConstructionType { | 747 enum ConstructionType { |
| 754 CreateOther = DefaultNodeFlags, | 748 CreateOther = DefaultNodeFlags, |
| 755 CreateText = DefaultNodeFlags | IsTextFlag, | 749 CreateText = DefaultNodeFlags | IsTextFlag, |
| 756 CreateContainer = DefaultNodeFlags | IsContainerFlag, | 750 CreateContainer = DefaultNodeFlags | IsContainerFlag, |
| 757 CreateElement = CreateContainer | IsElementFlag, | 751 CreateElement = CreateContainer | IsElementFlag, |
| 758 CreatePseudoElement = CreateElement | InDocumentFlag | NeedsShadowTreeW
alkerFlag, | 752 CreatePseudoElement = CreateElement | InDocumentFlag, |
| 759 CreateShadowRoot = CreateContainer | IsDocumentFragmentFlag | NeedsShado
wTreeWalkerFlag | IsInShadowTreeFlag, | 753 CreateShadowRoot = CreateContainer | IsDocumentFragmentFlag | IsInShadow
TreeFlag, |
| 760 CreateDocumentFragment = CreateContainer | IsDocumentFragmentFlag, | 754 CreateDocumentFragment = CreateContainer | IsDocumentFragmentFlag, |
| 761 CreateStyledElement = CreateElement | IsStyledElementFlag, | 755 CreateStyledElement = CreateElement | IsStyledElementFlag, |
| 762 CreateHTMLElement = CreateStyledElement | IsHTMLFlag, | 756 CreateHTMLElement = CreateStyledElement | IsHTMLFlag, |
| 763 CreateSVGElement = CreateStyledElement | IsSVGFlag, | 757 CreateSVGElement = CreateStyledElement | IsSVGFlag, |
| 764 CreateDocument = CreateContainer | InDocumentFlag, | 758 CreateDocument = CreateContainer | InDocumentFlag, |
| 765 CreateInsertionPoint = CreateHTMLElement | NeedsShadowTreeWalkerFlag, | 759 CreateInsertionPoint = CreateHTMLElement | IsInsertionPointFlag, |
| 766 CreateEditingText = CreateText | HasNameOrIsEditingTextFlag, | 760 CreateEditingText = CreateText | HasNameOrIsEditingTextFlag, |
| 767 }; | 761 }; |
| 768 | 762 |
| 769 Node(TreeScope* treeScope, ConstructionType type) | 763 Node(TreeScope* treeScope, ConstructionType type) |
| 770 : m_nodeFlags(type) | 764 : m_nodeFlags(type) |
| 771 , m_parentOrShadowHostNode(0) | 765 , m_parentOrShadowHostNode(0) |
| 772 , m_treeScope(treeScope) | 766 , m_treeScope(treeScope) |
| 773 , m_previous(0) | 767 , m_previous(0) |
| 774 , m_next(0) | 768 , m_next(0) |
| 775 { | 769 { |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 925 | 919 |
| 926 } //namespace | 920 } //namespace |
| 927 | 921 |
| 928 #ifndef NDEBUG | 922 #ifndef NDEBUG |
| 929 // Outside the WebCore namespace for ease of invocation from gdb. | 923 // Outside the WebCore namespace for ease of invocation from gdb. |
| 930 void showTree(const WebCore::Node*); | 924 void showTree(const WebCore::Node*); |
| 931 void showNodePath(const WebCore::Node*); | 925 void showNodePath(const WebCore::Node*); |
| 932 #endif | 926 #endif |
| 933 | 927 |
| 934 #endif | 928 #endif |
| OLD | NEW |