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

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

Issue 1649983003: Remove the forced layout in getComputedStyle for elements in Shadow DOM (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Look at ShadowRoots when walking up the tree in updateLayoutTreeForNodeIfNeeded. Created 4 years, 10 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 20 matching lines...) Expand all
31 #include "core/dom/Element.h" 31 #include "core/dom/Element.h"
32 #include "core/dom/shadow/InsertionPoint.h" 32 #include "core/dom/shadow/InsertionPoint.h"
33 33
34 namespace blink { 34 namespace blink {
35 35
36 class LayoutObject; 36 class LayoutObject;
37 37
38 namespace LayoutTreeBuilderTraversal { 38 namespace LayoutTreeBuilderTraversal {
39 39
40 class ParentDetails { 40 class ParentDetails {
41 STACK_ALLOCATED(); 41 STACK_ALLOCATED();
rune 2016/02/01 09:24:23 Is this also WTF_MAKE_NONCOPYABLE? Not that I thin
42 public: 42 public:
43 ParentDetails() 43 bool wasDistributedToInsertionPoint() const { return m_wasDistributedToInser tionPoint; }
44 : m_insertionPoint(nullptr) 44 void didTraverseInsertionPoint() { m_wasDistributedToInsertionPoint = true; }
45 { }
46 45
47 const InsertionPoint* insertionPoint() const { return m_insertionPoint; } 46 const ShadowRoot* shadowRoot() const { return m_shadowRoot; }
47 void didTraverseShadowRoot(const ShadowRoot* shadowRoot) { m_shadowRoot = sh adowRoot; }
48 48
49 void didTraverseInsertionPoint(const InsertionPoint*); 49 void reset()
50
51 bool operator==(const ParentDetails& other)
rune 2016/02/01 09:24:23 Are objects of this class ever being compared? Doe
52 { 50 {
53 return m_insertionPoint == other.m_insertionPoint; 51 m_wasDistributedToInsertionPoint = false;
52 m_shadowRoot = nullptr;
54 } 53 }
55 54
56 private: 55 private:
57 RawPtrWillBeMember<const InsertionPoint> m_insertionPoint; 56 bool m_wasDistributedToInsertionPoint = false;
57 RawPtrWillBeMember<const ShadowRoot> m_shadowRoot = nullptr;
58 }; 58 };
59 59
60 CORE_EXPORT ContainerNode* parent(const Node&, ParentDetails* = 0); 60 CORE_EXPORT ContainerNode* parent(const Node&, ParentDetails* = 0);
61 CORE_EXPORT Node* firstChild(const Node&); 61 CORE_EXPORT Node* firstChild(const Node&);
62 CORE_EXPORT Node* nextSibling(const Node&); 62 CORE_EXPORT Node* nextSibling(const Node&);
63 Node* previousSibling(const Node&); 63 Node* previousSibling(const Node&);
64 Node* previous(const Node&, const Node* stayWithin); 64 Node* previous(const Node&, const Node* stayWithin);
65 Node* next(const Node&, const Node* stayWithin); 65 Node* next(const Node&, const Node* stayWithin);
66 Node* nextSkippingChildren(const Node&, const Node* stayWithin); 66 Node* nextSkippingChildren(const Node&, const Node* stayWithin);
67 LayoutObject* nextSiblingLayoutObject(const Node&); 67 LayoutObject* nextSiblingLayoutObject(const Node&);
68 LayoutObject* previousSiblingLayoutObject(const Node&); 68 LayoutObject* previousSiblingLayoutObject(const Node&);
69 LayoutObject* nextInTopLayer(const Element&); 69 LayoutObject* nextInTopLayer(const Element&);
70 70
71 inline Element* parentElement(const Node& node) 71 inline Element* parentElement(const Node& node)
72 { 72 {
73 ContainerNode* found = parent(node); 73 ContainerNode* found = parent(node);
74 return found && found->isElementNode() ? toElement(found) : 0; 74 return found && found->isElementNode() ? toElement(found) : 0;
75 } 75 }
76 76
77 } // namespace LayoutTreeBuilderTraversal 77 } // namespace LayoutTreeBuilderTraversal
78 78
79 } // namespace blink 79 } // namespace blink
80 80
81 #endif 81 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698