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 17 matching lines...) Expand all Loading... |
28 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 28 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
29 #include "core/CoreExport.h" | 29 #include "core/CoreExport.h" |
30 #include "core/dom/MutationObserver.h" | 30 #include "core/dom/MutationObserver.h" |
31 #include "core/dom/SimulatedClickOptions.h" | 31 #include "core/dom/SimulatedClickOptions.h" |
32 #include "core/dom/StyleChangeReason.h" | 32 #include "core/dom/StyleChangeReason.h" |
33 #include "core/dom/TreeScope.h" | 33 #include "core/dom/TreeScope.h" |
34 #include "core/dom/TreeShared.h" | 34 #include "core/dom/TreeShared.h" |
35 #include "core/editing/EditingBoundary.h" | 35 #include "core/editing/EditingBoundary.h" |
36 #include "core/events/EventTarget.h" | 36 #include "core/events/EventTarget.h" |
37 #include "core/inspector/InspectorCounters.h" | 37 #include "core/inspector/InspectorCounters.h" |
38 #include "core/layout/style/LayoutStyleConstants.h" | 38 #include "core/layout/style/ComputedStyleConstants.h" |
39 #include "platform/geometry/LayoutRect.h" | 39 #include "platform/geometry/LayoutRect.h" |
40 #include "platform/heap/Handle.h" | 40 #include "platform/heap/Handle.h" |
41 #include "platform/weborigin/KURLHash.h" | 41 #include "platform/weborigin/KURLHash.h" |
42 #include "wtf/Forward.h" | 42 #include "wtf/Forward.h" |
43 | 43 |
44 // This needs to be here because Document.h also depends on it. | 44 // This needs to be here because Document.h also depends on it. |
45 #define DUMP_NODE_STATISTICS 0 | 45 #define DUMP_NODE_STATISTICS 0 |
46 | 46 |
47 namespace blink { | 47 namespace blink { |
48 | 48 |
(...skipping 23 matching lines...) Expand all Loading... |
72 class PlatformGestureEvent; | 72 class PlatformGestureEvent; |
73 class PlatformKeyboardEvent; | 73 class PlatformKeyboardEvent; |
74 class PlatformMouseEvent; | 74 class PlatformMouseEvent; |
75 class PlatformWheelEvent; | 75 class PlatformWheelEvent; |
76 class QualifiedName; | 76 class QualifiedName; |
77 class RadioNodeList; | 77 class RadioNodeList; |
78 class RegisteredEventListener; | 78 class RegisteredEventListener; |
79 class LayoutBox; | 79 class LayoutBox; |
80 class LayoutBoxModelObject; | 80 class LayoutBoxModelObject; |
81 class LayoutObject; | 81 class LayoutObject; |
82 class LayoutStyle; | 82 class ComputedStyle; |
83 class SVGQualifiedName; | 83 class SVGQualifiedName; |
84 class ShadowRoot; | 84 class ShadowRoot; |
85 template <typename NodeType> class StaticNodeTypeList; | 85 template <typename NodeType> class StaticNodeTypeList; |
86 using StaticNodeList = StaticNodeTypeList<Node>; | 86 using StaticNodeList = StaticNodeTypeList<Node>; |
87 class TagCollection; | 87 class TagCollection; |
88 class Text; | 88 class Text; |
89 class TouchEvent; | 89 class TouchEvent; |
90 class WeakNodeMap; | 90 class WeakNodeMap; |
91 | 91 |
92 const int nodeStyleChangeShift = 19; | 92 const int nodeStyleChangeShift = 19; |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 m_data.m_rareData->setLayoutObject(layoutObject); | 513 m_data.m_rareData->setLayoutObject(layoutObject); |
514 else | 514 else |
515 m_data.m_layoutObject = layoutObject; | 515 m_data.m_layoutObject = layoutObject; |
516 } | 516 } |
517 | 517 |
518 // Use these two methods with caution. | 518 // Use these two methods with caution. |
519 LayoutBox* layoutBox() const; | 519 LayoutBox* layoutBox() const; |
520 LayoutBoxModelObject* layoutBoxModelObject() const; | 520 LayoutBoxModelObject* layoutBoxModelObject() const; |
521 | 521 |
522 struct AttachContext { | 522 struct AttachContext { |
523 LayoutStyle* resolvedStyle; | 523 ComputedStyle* resolvedStyle; |
524 bool performingReattach; | 524 bool performingReattach; |
525 | 525 |
526 AttachContext() : resolvedStyle(nullptr), performingReattach(false) { } | 526 AttachContext() : resolvedStyle(nullptr), performingReattach(false) { } |
527 }; | 527 }; |
528 | 528 |
529 // Attaches this node to the rendering tree. This calculates the style to be
applied to the node and creates an | 529 // Attaches this node to the rendering tree. This calculates the style to be
applied to the node and creates an |
530 // appropriate LayoutObject which will be inserted into the tree (except whe
n the style has display: none). This | 530 // appropriate LayoutObject which will be inserted into the tree (except whe
n the style has display: none). This |
531 // makes the node visible in the FrameView. | 531 // makes the node visible in the FrameView. |
532 virtual void attach(const AttachContext& = AttachContext()); | 532 virtual void attach(const AttachContext& = AttachContext()); |
533 | 533 |
534 // Detaches the node from the rendering tree, making it invisible in the ren
dered view. This method will remove | 534 // Detaches the node from the rendering tree, making it invisible in the ren
dered view. This method will remove |
535 // the node's rendering object from the rendering tree and delete it. | 535 // the node's rendering object from the rendering tree and delete it. |
536 virtual void detach(const AttachContext& = AttachContext()); | 536 virtual void detach(const AttachContext& = AttachContext()); |
537 | 537 |
538 #if ENABLE(ASSERT) | 538 #if ENABLE(ASSERT) |
539 bool inDetach() const; | 539 bool inDetach() const; |
540 #endif | 540 #endif |
541 | 541 |
542 void reattach(const AttachContext& = AttachContext()); | 542 void reattach(const AttachContext& = AttachContext()); |
543 void lazyReattachIfAttached(); | 543 void lazyReattachIfAttached(); |
544 | 544 |
545 // Returns true if recalcStyle should be called on the object, if there is s
uch a method (on Document and Element). | 545 // Returns true if recalcStyle should be called on the object, if there is s
uch a method (on Document and Element). |
546 bool shouldCallRecalcStyle(StyleRecalcChange); | 546 bool shouldCallRecalcStyle(StyleRecalcChange); |
547 | 547 |
548 // Wrapper for nodes that don't have a renderer, but still cache the style (
like HTMLOptionElement). | 548 // Wrapper for nodes that don't have a renderer, but still cache the style (
like HTMLOptionElement). |
549 LayoutStyle* mutableLayoutStyle() const; | 549 ComputedStyle* mutableComputedStyle() const; |
550 const LayoutStyle* layoutStyle() const; | 550 const ComputedStyle* computedStyle() const; |
551 const LayoutStyle* parentLayoutStyle() const; | 551 const ComputedStyle* parentComputedStyle() const; |
552 | 552 |
553 const LayoutStyle& layoutStyleRef() const; | 553 const ComputedStyle& computedStyleRef() const; |
554 | 554 |
555 const LayoutStyle* computedStyle(PseudoId pseudoElementSpecifier = NOPSEUDO)
{ return virtualComputedStyle(pseudoElementSpecifier); } | 555 const ComputedStyle* ensureComputedStyle(PseudoId pseudoElementSpecifier = N
OPSEUDO) { return virtualEnsureComputedStyle(pseudoElementSpecifier); } |
556 | 556 |
557 // -------------------------------------------------------------------------
---- | 557 // -------------------------------------------------------------------------
---- |
558 // Notification of document structure changes (see ContainerNode.h for more
notification methods) | 558 // Notification of document structure changes (see ContainerNode.h for more
notification methods) |
559 // | 559 // |
560 // At first, WebKit notifies the node that it has been inserted into the doc
ument. This is called during document parsing, and also | 560 // At first, WebKit notifies the node that it has been inserted into the doc
ument. This is called during document parsing, and also |
561 // 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. | 561 // 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. |
562 // This is similar to the DOMNodeInsertedIntoDocument DOM event, but does no
t require the overhead of event | 562 // This is similar to the DOMNodeInsertedIntoDocument DOM event, but does no
t require the overhead of event |
563 // dispatching. | 563 // dispatching. |
564 // | 564 // |
565 // WebKit notifies this callback regardless if the subtree of the node is a
document tree or a floating subtree. | 565 // WebKit notifies this callback regardless if the subtree of the node is a
document tree or a floating subtree. |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 bool hasEditableStyle(EditableLevel, UserSelectAllTreatment = UserSelectAllI
sAlwaysNonEditable) const; | 800 bool hasEditableStyle(EditableLevel, UserSelectAllTreatment = UserSelectAllI
sAlwaysNonEditable) const; |
801 bool isEditableToAccessibility(EditableLevel) const; | 801 bool isEditableToAccessibility(EditableLevel) const; |
802 | 802 |
803 bool isUserActionElementActive() const; | 803 bool isUserActionElementActive() const; |
804 bool isUserActionElementInActiveChain() const; | 804 bool isUserActionElementInActiveChain() const; |
805 bool isUserActionElementHovered() const; | 805 bool isUserActionElementHovered() const; |
806 bool isUserActionElementFocused() const; | 806 bool isUserActionElementFocused() const; |
807 | 807 |
808 void setStyleChange(StyleChangeType); | 808 void setStyleChange(StyleChangeType); |
809 | 809 |
810 virtual LayoutStyle* nonRendererStyle() const { return nullptr; } | 810 virtual ComputedStyle* nonLayoutObjectComputedStyle() const { return nullptr
; } |
811 | 811 |
812 virtual const LayoutStyle* virtualComputedStyle(PseudoId = NOPSEUDO); | 812 virtual const ComputedStyle* virtualEnsureComputedStyle(PseudoId = NOPSEUDO)
; |
813 | 813 |
814 void trackForDebugging(); | 814 void trackForDebugging(); |
815 | 815 |
816 WillBeHeapVector<OwnPtrWillBeMember<MutationObserverRegistration>>* mutation
ObserverRegistry(); | 816 WillBeHeapVector<OwnPtrWillBeMember<MutationObserverRegistration>>* mutation
ObserverRegistry(); |
817 WillBeHeapHashSet<RawPtrWillBeMember<MutationObserverRegistration>>* transie
ntMutationObserverRegistry(); | 817 WillBeHeapHashSet<RawPtrWillBeMember<MutationObserverRegistration>>* transie
ntMutationObserverRegistry(); |
818 | 818 |
819 uint32_t m_nodeFlags; | 819 uint32_t m_nodeFlags; |
820 RawPtrWillBeMember<ContainerNode> m_parentOrShadowHostNode; | 820 RawPtrWillBeMember<ContainerNode> m_parentOrShadowHostNode; |
821 RawPtrWillBeMember<TreeScope> m_treeScope; | 821 RawPtrWillBeMember<TreeScope> m_treeScope; |
822 RawPtrWillBeMember<Node> m_previous; | 822 RawPtrWillBeMember<Node> m_previous; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 } // namespace blink | 906 } // namespace blink |
907 | 907 |
908 #ifndef NDEBUG | 908 #ifndef NDEBUG |
909 // Outside the WebCore namespace for ease of invocation from gdb. | 909 // Outside the WebCore namespace for ease of invocation from gdb. |
910 void showNode(const blink::Node*); | 910 void showNode(const blink::Node*); |
911 void showTree(const blink::Node*); | 911 void showTree(const blink::Node*); |
912 void showNodePath(const blink::Node*); | 912 void showNodePath(const blink::Node*); |
913 #endif | 913 #endif |
914 | 914 |
915 #endif // Node_h | 915 #endif // Node_h |
OLD | NEW |