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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 RenderObject* lastChild() const 168 RenderObject* lastChild() const
169 { 169 {
170 if (const RenderObjectChildList* children = virtualChildren()) 170 if (const RenderObjectChildList* children = virtualChildren())
171 return children->lastChild(); 171 return children->lastChild();
172 return 0; 172 return 0;
173 } 173 }
174 174
175 virtual RenderObjectChildList* virtualChildren() { return 0; } 175 virtual RenderObjectChildList* virtualChildren() { return 0; }
176 virtual const RenderObjectChildList* virtualChildren() const { return 0; } 176 virtual const RenderObjectChildList* virtualChildren() const { return 0; }
177 177
178 // Introduce a non-recursive traversal algorithm for layout
179 enum Order { Pre, Post };
180 RenderObject* nextForLayout(Order& order, const RenderObject* stayWithin, bo ol skippingChildren) const;
181
178 RenderObject* nextInPreOrder() const; 182 RenderObject* nextInPreOrder() const;
179 RenderObject* nextInPreOrder(const RenderObject* stayWithin) const; 183 RenderObject* nextInPreOrder(const RenderObject* stayWithin) const;
180 RenderObject* nextInPreOrderAfterChildren() const; 184 RenderObject* nextInPreOrderAfterChildren() const;
181 RenderObject* nextInPreOrderAfterChildren(const RenderObject* stayWithin) co nst; 185 RenderObject* nextInPreOrderAfterChildren(const RenderObject* stayWithin) co nst;
182 RenderObject* previousInPreOrder() const; 186 RenderObject* previousInPreOrder() const;
183 RenderObject* previousInPreOrder(const RenderObject* stayWithin) const; 187 RenderObject* previousInPreOrder(const RenderObject* stayWithin) const;
184 RenderObject* childAt(unsigned) const; 188 RenderObject* childAt(unsigned) const;
185 189
186 RenderObject* lastLeafChild() const; 190 RenderObject* lastLeafChild() const;
187 191
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 662
659 void updateFillImages(const FillLayer*, const FillLayer*); 663 void updateFillImages(const FillLayer*, const FillLayer*);
660 void updateImage(StyleImage*, StyleImage*); 664 void updateImage(StyleImage*, StyleImage*);
661 void updateShapeImage(const ShapeValue*, const ShapeValue*); 665 void updateShapeImage(const ShapeValue*, const ShapeValue*);
662 666
663 virtual void paint(PaintInfo&, const LayoutPoint&); 667 virtual void paint(PaintInfo&, const LayoutPoint&);
664 668
665 // Subclasses must reimplement this method to compute the size and position 669 // Subclasses must reimplement this method to compute the size and position
666 // of this object and all its descendants. 670 // of this object and all its descendants.
667 virtual void layout() = 0; 671 virtual void layout() = 0;
672
673 // These are hooks into the non-recursive layout variation. Each subclass
674 // would override these methods and implement non-recursive layout.
675 virtual bool isNonRecursiveLayout() const { return false; }
676 // We have pre/post layout methods in order to facilitate work to be done
677 // before children are visited and after.
678 virtual void preLayout() { ASSERT_NOT_REACHED(); }
679 virtual void postLayout() { ASSERT_NOT_REACHED(); }
680
668 virtual bool updateImageLoadingPriorities() { return false; } 681 virtual bool updateImageLoadingPriorities() { return false; }
669 void setHasPendingResourceUpdate(bool hasPendingResourceUpdate) { m_bitfield s.setHasPendingResourceUpdate(hasPendingResourceUpdate); } 682 void setHasPendingResourceUpdate(bool hasPendingResourceUpdate) { m_bitfield s.setHasPendingResourceUpdate(hasPendingResourceUpdate); }
670 bool hasPendingResourceUpdate() const { return m_bitfields.hasPendingResourc eUpdate(); } 683 bool hasPendingResourceUpdate() const { return m_bitfields.hasPendingResourc eUpdate(); }
671 684
672 /* This function performs a layout only if one is needed. */ 685 /* This function performs a layout only if one is needed. */
673 void layoutIfNeeded() { if (needsLayout()) layout(); } 686 void layoutIfNeeded() { if (needsLayout()) layout(); }
674 687
675 void forceLayout(); 688 void forceLayout();
676 void forceChildLayout(); 689 void forceChildLayout();
677 690
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
1417 void showTree(const WebCore::RenderObject*); 1430 void showTree(const WebCore::RenderObject*);
1418 void showLineTree(const WebCore::RenderObject*); 1431 void showLineTree(const WebCore::RenderObject*);
1419 void showRenderTree(const WebCore::RenderObject* object1); 1432 void showRenderTree(const WebCore::RenderObject* object1);
1420 // We don't make object2 an optional parameter so that showRenderTree 1433 // We don't make object2 an optional parameter so that showRenderTree
1421 // can be called from gdb easily. 1434 // can be called from gdb easily.
1422 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO bject* object2); 1435 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO bject* object2);
1423 1436
1424 #endif 1437 #endif
1425 1438
1426 #endif // RenderObject_h 1439 #endif // RenderObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698