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

Unified Diff: Source/core/rendering/RenderObject.h

Issue 166033009: *** FOR PROTOTYPE PURPOSES ONLY! NOT INTENDED FOR COMMIT! *** (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/RenderObject.h
diff --git a/Source/core/rendering/RenderObject.h b/Source/core/rendering/RenderObject.h
index c0de169ae7ec0f9b7a3895708c42166f0a5e6e09..cca2dc64ab6e00c2684f9fdc225c4c23572a7f6b 100644
--- a/Source/core/rendering/RenderObject.h
+++ b/Source/core/rendering/RenderObject.h
@@ -175,6 +175,10 @@ public:
virtual RenderObjectChildList* virtualChildren() { return 0; }
virtual const RenderObjectChildList* virtualChildren() const { return 0; }
+ // Introduce a non-recursive traversal algorithm for layout
+ enum Order { Pre, Post };
+ RenderObject* nextForLayout(Order& order, const RenderObject* stayWithin, bool skippingChildren) const;
+
RenderObject* nextInPreOrder() const;
RenderObject* nextInPreOrder(const RenderObject* stayWithin) const;
RenderObject* nextInPreOrderAfterChildren() const;
@@ -665,6 +669,15 @@ public:
// Subclasses must reimplement this method to compute the size and position
// of this object and all its descendants.
virtual void layout() = 0;
+
+ // These are hooks into the non-recursive layout variation. Each subclass
+ // would override these methods and implement non-recursive layout.
+ virtual bool isNonRecursiveLayout() const { return false; }
+ // We have pre/post layout methods in order to facilitate work to be done
+ // before children are visited and after.
+ virtual void preLayout() { ASSERT_NOT_REACHED(); }
+ virtual void postLayout() { ASSERT_NOT_REACHED(); }
+
virtual bool updateImageLoadingPriorities() { return false; }
void setHasPendingResourceUpdate(bool hasPendingResourceUpdate) { m_bitfields.setHasPendingResourceUpdate(hasPendingResourceUpdate); }
bool hasPendingResourceUpdate() const { return m_bitfields.hasPendingResourceUpdate(); }

Powered by Google App Engine
This is Rietveld 408576698