| 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 // since those elements will never have class names, inline style, or other
things that | 258 // since those elements will never have class names, inline style, or other
things that |
| 259 // this apparently guards against. | 259 // this apparently guards against. |
| 260 bool isStyledElement() const { return isHTMLElement() || isSVGElement(); } | 260 bool isStyledElement() const { return isHTMLElement() || isSVGElement(); } |
| 261 | 261 |
| 262 bool isDocumentNode() const; | 262 bool isDocumentNode() const; |
| 263 bool isTreeScope() const { return &treeScope().rootNode() == this; } | 263 bool isTreeScope() const { return &treeScope().rootNode() == this; } |
| 264 bool isDocumentFragment() const { return getFlag(IsDocumentFragmentFlag); } | 264 bool isDocumentFragment() const { return getFlag(IsDocumentFragmentFlag); } |
| 265 bool isShadowRoot() const { return isDocumentFragment() && isTreeScope(); } | 265 bool isShadowRoot() const { return isDocumentFragment() && isTreeScope(); } |
| 266 bool isInsertionPoint() const { return getFlag(IsInsertionPointFlag); } | 266 bool isInsertionPoint() const { return getFlag(IsInsertionPointFlag); } |
| 267 | 267 |
| 268 bool inNamedFlow() const { return getFlag(InNamedFlowFlag); } | |
| 269 bool hasCustomStyleCallbacks() const { return getFlag(HasCustomStyleCallback
sFlag); } | 268 bool hasCustomStyleCallbacks() const { return getFlag(HasCustomStyleCallback
sFlag); } |
| 270 | 269 |
| 271 bool isRegisteredWithNamedFlow() const; | |
| 272 | |
| 273 bool hasSyntheticAttrChildNodes() const { return getFlag(HasSyntheticAttrChi
ldNodesFlag); } | 270 bool hasSyntheticAttrChildNodes() const { return getFlag(HasSyntheticAttrChi
ldNodesFlag); } |
| 274 void setHasSyntheticAttrChildNodes(bool flag) { setFlag(flag, HasSyntheticAt
trChildNodesFlag); } | 271 void setHasSyntheticAttrChildNodes(bool flag) { setFlag(flag, HasSyntheticAt
trChildNodesFlag); } |
| 275 | 272 |
| 276 // If this node is in a shadow tree, returns its shadow host. Otherwise, ret
urns 0. | 273 // If this node is in a shadow tree, returns its shadow host. Otherwise, ret
urns 0. |
| 277 Element* shadowHost() const; | 274 Element* shadowHost() const; |
| 278 // If this node is in a shadow tree, returns its shadow host. Otherwise, ret
urns this. | 275 // If this node is in a shadow tree, returns its shadow host. Otherwise, ret
urns this. |
| 279 // Deprecated. Should use shadowHost() and check the return value. | 276 // Deprecated. Should use shadowHost() and check the return value. |
| 280 Node* deprecatedShadowAncestorNode() const; | 277 Node* deprecatedShadowAncestorNode() const; |
| 281 ShadowRoot* containingShadowRoot() const; | 278 ShadowRoot* containingShadowRoot() const; |
| 282 ShadowRoot* youngestShadowRoot() const; | 279 ShadowRoot* youngestShadowRoot() const; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 void setChildNeedsDistributionRecalc() { setFlag(ChildNeedsDistributionReca
lc); } | 367 void setChildNeedsDistributionRecalc() { setFlag(ChildNeedsDistributionReca
lc); } |
| 371 void clearChildNeedsDistributionRecalc() { clearFlag(ChildNeedsDistribution
Recalc); } | 368 void clearChildNeedsDistributionRecalc() { clearFlag(ChildNeedsDistribution
Recalc); } |
| 372 void markAncestorsWithChildNeedsDistributionRecalc(); | 369 void markAncestorsWithChildNeedsDistributionRecalc(); |
| 373 | 370 |
| 374 void recalcDistribution(); | 371 void recalcDistribution(); |
| 375 | 372 |
| 376 bool shouldNotifyRendererWithIdenticalStyles() const { return getFlag(Notify
RendererWithIdenticalStyles); } | 373 bool shouldNotifyRendererWithIdenticalStyles() const { return getFlag(Notify
RendererWithIdenticalStyles); } |
| 377 | 374 |
| 378 void setIsLink(bool f); | 375 void setIsLink(bool f); |
| 379 | 376 |
| 380 void setInNamedFlow() { setFlag(InNamedFlowFlag); } | |
| 381 void clearInNamedFlow() { clearFlag(InNamedFlowFlag); } | |
| 382 | |
| 383 bool hasScopedHTMLStyleChild() const { return getFlag(HasScopedHTMLStyleChil
dFlag); } | 377 bool hasScopedHTMLStyleChild() const { return getFlag(HasScopedHTMLStyleChil
dFlag); } |
| 384 void setHasScopedHTMLStyleChild(bool flag) { setFlag(flag, HasScopedHTMLStyl
eChildFlag); } | 378 void setHasScopedHTMLStyleChild(bool flag) { setFlag(flag, HasScopedHTMLStyl
eChildFlag); } |
| 385 | 379 |
| 386 bool hasEventTargetData() const { return getFlag(HasEventTargetDataFlag); } | 380 bool hasEventTargetData() const { return getFlag(HasEventTargetDataFlag); } |
| 387 void setHasEventTargetData(bool flag) { setFlag(flag, HasEventTargetDataFlag
); } | 381 void setHasEventTargetData(bool flag) { setFlag(flag, HasEventTargetDataFlag
); } |
| 388 | 382 |
| 389 bool isV8CollectableDuringMinorGC() const { return getFlag(V8CollectableDuri
ngMinorGCFlag); } | 383 bool isV8CollectableDuringMinorGC() const { return getFlag(V8CollectableDuri
ngMinorGCFlag); } |
| 390 void markV8CollectableDuringMinorGC() { setFlag(true, V8CollectableDuringMin
orGCFlag); } | 384 void markV8CollectableDuringMinorGC() { setFlag(true, V8CollectableDuringMin
orGCFlag); } |
| 391 void clearV8CollectableDuringMinorGC() { setFlag(false, V8CollectableDuringM
inorGCFlag); } | 385 void clearV8CollectableDuringMinorGC() { setFlag(false, V8CollectableDuringM
inorGCFlag); } |
| 392 | 386 |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 IsFinishedParsingChildrenFlag = 1 << 12, // Element | 687 IsFinishedParsingChildrenFlag = 1 << 12, // Element |
| 694 | 688 |
| 695 AlreadySpellCheckedFlag = 1 << 13, | 689 AlreadySpellCheckedFlag = 1 << 13, |
| 696 | 690 |
| 697 StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift
+ 1), | 691 StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift
+ 1), |
| 698 | 692 |
| 699 SelfOrAncestorHasDirAutoFlag = 1 << 16, | 693 SelfOrAncestorHasDirAutoFlag = 1 << 16, |
| 700 | 694 |
| 701 HasNameOrIsEditingTextFlag = 1 << 17, | 695 HasNameOrIsEditingTextFlag = 1 << 17, |
| 702 | 696 |
| 703 InNamedFlowFlag = 1 << 18, | 697 HasSyntheticAttrChildNodesFlag = 1 << 18, |
| 704 HasSyntheticAttrChildNodesFlag = 1 << 19, | 698 HasCustomStyleCallbacksFlag = 1 << 19, |
| 705 HasCustomStyleCallbacksFlag = 1 << 20, | 699 HasScopedHTMLStyleChildFlag = 1 << 20, |
| 706 HasScopedHTMLStyleChildFlag = 1 << 21, | 700 HasEventTargetDataFlag = 1 << 21, |
| 707 HasEventTargetDataFlag = 1 << 22, | 701 V8CollectableDuringMinorGCFlag = 1 << 22, |
| 708 V8CollectableDuringMinorGCFlag = 1 << 23, | 702 IsInsertionPointFlag = 1 << 23, |
| 709 IsInsertionPointFlag = 1 << 24, | 703 IsInShadowTreeFlag = 1 << 24, |
| 710 IsInShadowTreeFlag = 1 << 25, | |
| 711 | 704 |
| 712 NotifyRendererWithIdenticalStyles = 1 << 26, | 705 NotifyRendererWithIdenticalStyles = 1 << 25, |
| 713 | 706 |
| 714 CustomElement = 1 << 27, | 707 CustomElement = 1 << 26, |
| 715 CustomElementUpgraded = 1 << 28, | 708 CustomElementUpgraded = 1 << 27, |
| 716 | 709 |
| 717 DefaultNodeFlags = IsFinishedParsingChildrenFlag | ChildNeedsStyleRecalc
Flag | NeedsReattachStyleChange | 710 DefaultNodeFlags = IsFinishedParsingChildrenFlag | ChildNeedsStyleRecalc
Flag | NeedsReattachStyleChange |
| 718 }; | 711 }; |
| 719 | 712 |
| 720 // 4 bits remaining. | 713 // 5 bits remaining. |
| 721 | 714 |
| 722 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } | 715 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } |
| 723 void setFlag(bool f, NodeFlags mask) const { m_nodeFlags = (m_nodeFlags & ~m
ask) | (-(int32_t)f & mask); } | 716 void setFlag(bool f, NodeFlags mask) const { m_nodeFlags = (m_nodeFlags & ~m
ask) | (-(int32_t)f & mask); } |
| 724 void setFlag(NodeFlags mask) const { m_nodeFlags |= mask; } | 717 void setFlag(NodeFlags mask) const { m_nodeFlags |= mask; } |
| 725 void clearFlag(NodeFlags mask) const { m_nodeFlags &= ~mask; } | 718 void clearFlag(NodeFlags mask) const { m_nodeFlags &= ~mask; } |
| 726 | 719 |
| 727 protected: | 720 protected: |
| 728 enum ConstructionType { | 721 enum ConstructionType { |
| 729 CreateOther = DefaultNodeFlags, | 722 CreateOther = DefaultNodeFlags, |
| 730 CreateText = DefaultNodeFlags | IsTextFlag, | 723 CreateText = DefaultNodeFlags | IsTextFlag, |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 | 895 |
| 903 } // namespace WebCore | 896 } // namespace WebCore |
| 904 | 897 |
| 905 #ifndef NDEBUG | 898 #ifndef NDEBUG |
| 906 // Outside the WebCore namespace for ease of invocation from gdb. | 899 // Outside the WebCore namespace for ease of invocation from gdb. |
| 907 void showTree(const WebCore::Node*); | 900 void showTree(const WebCore::Node*); |
| 908 void showNodePath(const WebCore::Node*); | 901 void showNodePath(const WebCore::Node*); |
| 909 #endif | 902 #endif |
| 910 | 903 |
| 911 #endif | 904 #endif |
| OLD | NEW |