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

Unified Diff: third_party/WebKit/Source/core/layout/DepthOrderedLayoutObjectList.h

Issue 2348993002: Don't include LayoutObject.h from FrameView.h (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/DepthOrderedLayoutObjectList.h
diff --git a/third_party/WebKit/Source/core/layout/DepthOrderedLayoutObjectList.h b/third_party/WebKit/Source/core/layout/DepthOrderedLayoutObjectList.h
index 73ac77bf1c2b7b46f204e2f38f784d7679c2a3fb..e18cc1251a95fcab2c256b73c5048fff8ce63338 100644
--- a/third_party/WebKit/Source/core/layout/DepthOrderedLayoutObjectList.h
+++ b/third_party/WebKit/Source/core/layout/DepthOrderedLayoutObjectList.h
@@ -13,18 +13,20 @@ namespace blink {
class LayoutObject;
+// Put data inside a forward-declared struct, to avoid including LayoutObject.h here.
+struct DepthOrderedLayoutObjectListData;
+
class DepthOrderedLayoutObjectList {
public:
- DepthOrderedLayoutObjectList()
- {
- }
+ DepthOrderedLayoutObjectList();
+ ~DepthOrderedLayoutObjectList();
void add(LayoutObject&);
void remove(LayoutObject&);
void clear();
- int size() const { return m_objects.size(); }
- bool isEmpty() const { return m_objects.isEmpty(); }
+ int size() const;
+ bool isEmpty() const;
struct LayoutObjectWithDepth {
LayoutObjectWithDepth(LayoutObject* inObject)
@@ -54,18 +56,11 @@ public:
static unsigned determineDepth(LayoutObject*);
};
- const HashSet<LayoutObject*>& unordered() const { return m_objects; }
+ const HashSet<LayoutObject*>& unordered() const;
const Vector<LayoutObjectWithDepth>& ordered();
private:
- // LayoutObjects sorted by depth (deepest first). This structure is only
- // populated at the beginning of enumerations. See ordered().
- Vector<LayoutObjectWithDepth> m_orderedObjects;
-
- // Outside of layout, LayoutObjects can be added and removed as needed such
- // as when style was changed or destroyed. They're kept in this hashset to
- // keep those operations fast.
- HashSet<LayoutObject*> m_objects;
+ DepthOrderedLayoutObjectListData* m_data;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698