| 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-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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 void unregisterMutationObserver(MutationObserverRegistration*); | 565 void unregisterMutationObserver(MutationObserverRegistration*); |
| 566 void registerTransientMutationObserver(MutationObserverRegistration*); | 566 void registerTransientMutationObserver(MutationObserverRegistration*); |
| 567 void unregisterTransientMutationObserver(MutationObserverRegistration*); | 567 void unregisterTransientMutationObserver(MutationObserverRegistration*); |
| 568 void notifyMutationObserversNodeWillDetach(); | 568 void notifyMutationObserversNodeWillDetach(); |
| 569 | 569 |
| 570 PassRefPtr<StaticNodeList> getDestinationInsertionPoints(); | 570 PassRefPtr<StaticNodeList> getDestinationInsertionPoints(); |
| 571 | 571 |
| 572 void setAlreadySpellChecked(bool flag) { setFlag(flag, AlreadySpellCheckedFl
ag); } | 572 void setAlreadySpellChecked(bool flag) { setFlag(flag, AlreadySpellCheckedFl
ag); } |
| 573 bool isAlreadySpellChecked() { return getFlag(AlreadySpellCheckedFlag); } | 573 bool isAlreadySpellChecked() { return getFlag(AlreadySpellCheckedFlag); } |
| 574 | 574 |
| 575 bool isFinishedParsingChildren() const { return getFlag(IsFinishedParsingChi
ldrenFlag); } | |
| 576 | |
| 577 virtual void trace(Visitor*) override; | 575 virtual void trace(Visitor*) override; |
| 578 | 576 |
| 579 unsigned lengthOfContents() const; | 577 unsigned lengthOfContents() const; |
| 580 | 578 |
| 581 virtual v8::Handle<v8::Object> wrap(v8::Handle<v8::Object> creationContext,
v8::Isolate*) override; | 579 virtual v8::Handle<v8::Object> wrap(v8::Handle<v8::Object> creationContext,
v8::Isolate*) override; |
| 582 | 580 |
| 583 private: | 581 private: |
| 584 enum NodeFlags { | 582 enum NodeFlags { |
| 585 HasRareDataFlag = 1, | 583 HasRareDataFlag = 1, |
| 586 | 584 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 598 IsLinkFlag = 1 << 8, | 596 IsLinkFlag = 1 << 8, |
| 599 | 597 |
| 600 // Changes based on :hover, :active and :focus state. | 598 // Changes based on :hover, :active and :focus state. |
| 601 IsUserActionElementFlag = 1 << 9, | 599 IsUserActionElementFlag = 1 << 9, |
| 602 | 600 |
| 603 // Tree state flags. These change when the element is added/removed | 601 // Tree state flags. These change when the element is added/removed |
| 604 // from a DOM tree. | 602 // from a DOM tree. |
| 605 InDocumentFlag = 1 << 10, | 603 InDocumentFlag = 1 << 10, |
| 606 IsInShadowTreeFlag = 1 << 11, | 604 IsInShadowTreeFlag = 1 << 11, |
| 607 | 605 |
| 608 // Set by the parser when the children are done parsing. | |
| 609 IsFinishedParsingChildrenFlag = 1 << 12, | |
| 610 | |
| 611 // Flags related to recalcStyle. | 606 // Flags related to recalcStyle. |
| 612 | 607 |
| 613 // FIXME(sky): Flag 13 is free. | 608 // FIXME(sky): Flags 12 and 13 are free. |
| 614 | 609 |
| 615 HasCustomStyleCallbacksFlag = 1 << 14, | 610 HasCustomStyleCallbacksFlag = 1 << 14, |
| 616 ChildNeedsStyleInvalidationFlag = 1 << 15, | 611 ChildNeedsStyleInvalidationFlag = 1 << 15, |
| 617 NeedsStyleInvalidationFlag = 1 << 16, | 612 NeedsStyleInvalidationFlag = 1 << 16, |
| 618 ChildNeedsDistributionRecalcFlag = 1 << 17, | 613 ChildNeedsDistributionRecalcFlag = 1 << 17, |
| 619 ChildNeedsStyleRecalcFlag = 1 << 18, | 614 ChildNeedsStyleRecalcFlag = 1 << 18, |
| 620 StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift
+ 1), | 615 StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift
+ 1), |
| 621 | 616 |
| 622 CustomElementFlag = 1 << 21, | 617 CustomElementFlag = 1 << 21, |
| 623 CustomElementUpgradedFlag = 1 << 22, | 618 CustomElementUpgradedFlag = 1 << 22, |
| 624 | 619 |
| 625 IsEditingTextFlag = 1 << 23, | 620 IsEditingTextFlag = 1 << 23, |
| 626 HasWeakReferencesFlag = 1 << 24, | 621 HasWeakReferencesFlag = 1 << 24, |
| 627 V8CollectableDuringMinorGCFlag = 1 << 25, | 622 V8CollectableDuringMinorGCFlag = 1 << 25, |
| 628 HasEventTargetDataFlag = 1 << 26, | 623 HasEventTargetDataFlag = 1 << 26, |
| 629 AlreadySpellCheckedFlag = 1 << 27, | 624 AlreadySpellCheckedFlag = 1 << 27, |
| 630 | 625 |
| 631 DefaultNodeFlags = IsFinishedParsingChildrenFlag | ChildNeedsStyleRecalc
Flag | NeedsReattachStyleChange | 626 DefaultNodeFlags = ChildNeedsStyleRecalcFlag | NeedsReattachStyleChange |
| 632 }; | 627 }; |
| 633 | 628 |
| 634 // 5 bits remaining. | 629 // 6 bits remaining. |
| 635 | 630 |
| 636 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } | 631 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } |
| 637 void setFlag(bool f, NodeFlags mask) { m_nodeFlags = (m_nodeFlags & ~mask) |
(-(int32_t)f & mask); } | 632 void setFlag(bool f, NodeFlags mask) { m_nodeFlags = (m_nodeFlags & ~mask) |
(-(int32_t)f & mask); } |
| 638 void setFlag(NodeFlags mask) { m_nodeFlags |= mask; } | 633 void setFlag(NodeFlags mask) { m_nodeFlags |= mask; } |
| 639 void clearFlag(NodeFlags mask) { m_nodeFlags &= ~mask; } | 634 void clearFlag(NodeFlags mask) { m_nodeFlags &= ~mask; } |
| 640 | 635 |
| 641 protected: | 636 protected: |
| 642 enum ConstructionType { | 637 enum ConstructionType { |
| 643 CreateOther = DefaultNodeFlags, | 638 CreateOther = DefaultNodeFlags, |
| 644 CreateText = DefaultNodeFlags | IsTextFlag, | 639 CreateText = DefaultNodeFlags | IsTextFlag, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 | 671 |
| 677 void setTreeScope(TreeScope* scope) { m_treeScope = scope; } | 672 void setTreeScope(TreeScope* scope) { m_treeScope = scope; } |
| 678 | 673 |
| 679 // isTreeScopeInitialized() can be false | 674 // isTreeScopeInitialized() can be false |
| 680 // - in the destruction of Document or ShadowRoot where m_treeScope is set t
o null or | 675 // - in the destruction of Document or ShadowRoot where m_treeScope is set t
o null or |
| 681 // - in the Node constructor called by these two classes where m_treeScope i
s set by TreeScope ctor. | 676 // - in the Node constructor called by these two classes where m_treeScope i
s set by TreeScope ctor. |
| 682 bool isTreeScopeInitialized() const { return m_treeScope; } | 677 bool isTreeScopeInitialized() const { return m_treeScope; } |
| 683 | 678 |
| 684 void markAncestorsWithChildNeedsStyleRecalc(); | 679 void markAncestorsWithChildNeedsStyleRecalc(); |
| 685 | 680 |
| 686 void setIsFinishedParsingChildren(bool value) { setFlag(value, IsFinishedPar
singChildrenFlag); } | |
| 687 | |
| 688 private: | 681 private: |
| 689 friend class TreeShared<Node>; | 682 friend class TreeShared<Node>; |
| 690 friend class WeakNodeMap; | 683 friend class WeakNodeMap; |
| 691 | 684 |
| 692 unsigned styledSubtreeSize() const; | 685 unsigned styledSubtreeSize() const; |
| 693 | 686 |
| 694 #if !ENABLE(OILPAN) | 687 #if !ENABLE(OILPAN) |
| 695 void removedLastRef(); | 688 void removedLastRef(); |
| 696 #endif | 689 #endif |
| 697 bool hasTreeSharedParent() const { return !!parentOrShadowHostNode(); } | 690 bool hasTreeSharedParent() const { return !!parentOrShadowHostNode(); } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 } // namespace blink | 792 } // namespace blink |
| 800 | 793 |
| 801 #ifndef NDEBUG | 794 #ifndef NDEBUG |
| 802 // Outside the WebCore namespace for ease of invocation from gdb. | 795 // Outside the WebCore namespace for ease of invocation from gdb. |
| 803 void showNode(const blink::Node*); | 796 void showNode(const blink::Node*); |
| 804 void showTree(const blink::Node*); | 797 void showTree(const blink::Node*); |
| 805 void showNodePath(const blink::Node*); | 798 void showNodePath(const blink::Node*); |
| 806 #endif | 799 #endif |
| 807 | 800 |
| 808 #endif // Node_h | 801 #endif // Node_h |
| OLD | NEW |