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

Side by Side Diff: Source/core/rendering/RenderObject.h

Issue 18601002: Add infrastructure for partial layouts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address reviewer comments. Add PartialLayoutState and PartialLayoutDisabler Created 7 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 unified diff | Download patch | Annotate | Revision Log
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 class RenderInline; 60 class RenderInline;
61 class RenderBlock; 61 class RenderBlock;
62 class RenderFlowThread; 62 class RenderFlowThread;
63 class RenderGeometryMap; 63 class RenderGeometryMap;
64 class RenderLayer; 64 class RenderLayer;
65 class RenderLayerModelObject; 65 class RenderLayerModelObject;
66 class RenderNamedFlowThread; 66 class RenderNamedFlowThread;
67 class RenderSVGResourceContainer; 67 class RenderSVGResourceContainer;
68 class RenderTable; 68 class RenderTable;
69 class RenderTheme; 69 class RenderTheme;
70 class RenderView;
70 class TransformState; 71 class TransformState;
71 72
72 struct PaintInfo; 73 struct PaintInfo;
73 74
74 enum CursorDirective { 75 enum CursorDirective {
75 SetCursorBasedOnStyle, 76 SetCursorBasedOnStyle,
76 SetCursor, 77 SetCursor,
77 DoNotSetCursor 78 DoNotSetCursor
78 }; 79 };
79 80
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 inline bool preservesNewline() const; 583 inline bool preservesNewline() const;
583 584
584 // The pseudo element style can be cached or uncached. Use the cached metho d if the pseudo element doesn't respect 585 // The pseudo element style can be cached or uncached. Use the cached metho d if the pseudo element doesn't respect
585 // any pseudo classes (and therefore has no concept of changing state). 586 // any pseudo classes (and therefore has no concept of changing state).
586 RenderStyle* getCachedPseudoStyle(PseudoId, RenderStyle* parentStyle = 0) co nst; 587 RenderStyle* getCachedPseudoStyle(PseudoId, RenderStyle* parentStyle = 0) co nst;
587 PassRefPtr<RenderStyle> getUncachedPseudoStyle(const PseudoStyleRequest&, Re nderStyle* parentStyle = 0, RenderStyle* ownStyle = 0) const; 588 PassRefPtr<RenderStyle> getUncachedPseudoStyle(const PseudoStyleRequest&, Re nderStyle* parentStyle = 0, RenderStyle* ownStyle = 0) const;
588 589
589 virtual void updateDragState(bool dragOn); 590 virtual void updateDragState(bool dragOn);
590 591
591 RenderView* view() const { return document()->renderView(); }; 592 RenderView* view() const { return document()->renderView(); };
593 FrameView* frameView() const;
592 594
593 // Returns true if this renderer is rooted, and optionally returns the hosti ng view (the root of the hierarchy). 595 // Returns true if this renderer is rooted, and optionally returns the hosti ng view (the root of the hierarchy).
594 bool isRooted(RenderView** = 0) const; 596 bool isRooted(RenderView** = 0) const;
595 597
596 Node* node() const { return isAnonymous() ? 0 : m_node; } 598 Node* node() const { return isAnonymous() ? 0 : m_node; }
597 Node* nonPseudoNode() const { return isPseudoElement() ? 0 : node(); } 599 Node* nonPseudoNode() const { return isPseudoElement() ? 0 : node(); }
598 600
599 // FIXME: Why does RenderWidget need this? 601 // FIXME: Why does RenderWidget need this?
600 void clearNode() { m_node = 0; } 602 void clearNode() { m_node = 0; }
601 603
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 669
668 // Recursive function that computes the size and position of this object and all its descendants. 670 // Recursive function that computes the size and position of this object and all its descendants.
669 virtual void layout(); 671 virtual void layout();
670 672
671 /* This function performs a layout only if one is needed. */ 673 /* This function performs a layout only if one is needed. */
672 void layoutIfNeeded() { if (needsLayout()) layout(); } 674 void layoutIfNeeded() { if (needsLayout()) layout(); }
673 675
674 void forceLayout(); 676 void forceLayout();
675 void forceChildLayout(); 677 void forceChildLayout();
676 678
679 // True if we can abort layout, leaving a partially laid out tree.
680 virtual bool supportsPartialLayout() const { return false; }
681
677 // used for element state updates that cannot be fixed with a 682 // used for element state updates that cannot be fixed with a
678 // repaint and do not need a relayout 683 // repaint and do not need a relayout
679 virtual void updateFromElement() { } 684 virtual void updateFromElement() { }
680 685
681 virtual void addAnnotatedRegions(Vector<AnnotatedRegionValue>&); 686 virtual void addAnnotatedRegions(Vector<AnnotatedRegionValue>&);
682 void collectAnnotatedRegions(Vector<AnnotatedRegionValue>&); 687 void collectAnnotatedRegions(Vector<AnnotatedRegionValue>&);
683 688
684 bool isComposited() const; 689 bool isComposited() const;
685 690
686 bool hitTest(const HitTestRequest&, HitTestResult&, const HitTestLocation& l ocationInContainer, const LayoutPoint& accumulatedOffset, HitTestFilter = HitTes tAll); 691 bool hitTest(const HitTestRequest&, HitTestResult&, const HitTestLocation& l ocationInContainer, const LayoutPoint& accumulatedOffset, HitTestFilter = HitTes tAll);
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
1067 StyleColor styleColor = color; 1072 StyleColor styleColor = color;
1068 for (const RenderObject* object = this; UNLIKELY(styleColor.isCurrentCol or()) && object && object->style(); object = object->parent()) 1073 for (const RenderObject* object = this; UNLIKELY(styleColor.isCurrentCol or()) && object && object->style(); object = object->parent())
1069 styleColor = object->style()->visitedDependentColor(CSSPropertyColor ); 1074 styleColor = object->style()->visitedDependentColor(CSSPropertyColor );
1070 return styleColor; 1075 return styleColor;
1071 } 1076 }
1072 1077
1073 void removeShapeImageClient(ShapeValue*); 1078 void removeShapeImageClient(ShapeValue*);
1074 1079
1075 #ifndef NDEBUG 1080 #ifndef NDEBUG
1076 void checkBlockPositionedObjectsNeedLayout(); 1081 void checkBlockPositionedObjectsNeedLayout();
1082 void checkNotInPartialLayout();
1077 #endif 1083 #endif
1078 1084
1079 RefPtr<RenderStyle> m_style; 1085 RefPtr<RenderStyle> m_style;
1080 1086
1081 Node* m_node; 1087 Node* m_node;
1082 1088
1083 RenderObject* m_parent; 1089 RenderObject* m_parent;
1084 RenderObject* m_previous; 1090 RenderObject* m_previous;
1085 RenderObject* m_next; 1091 RenderObject* m_next;
1086 1092
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 return true; 1243 return true;
1238 } 1244 }
1239 1245
1240 inline bool RenderObject::isBeforeOrAfterContent() const 1246 inline bool RenderObject::isBeforeOrAfterContent() const
1241 { 1247 {
1242 return isBeforeContent() || isAfterContent(); 1248 return isBeforeContent() || isAfterContent();
1243 } 1249 }
1244 1250
1245 inline void RenderObject::setNeedsLayout(MarkingBehavior markParents, SubtreeLay outScope* layouter) 1251 inline void RenderObject::setNeedsLayout(MarkingBehavior markParents, SubtreeLay outScope* layouter)
1246 { 1252 {
1253 #ifndef NDEBUG
1254 checkNotInPartialLayout();
1255 #endif
1247 ASSERT(!isSetNeedsLayoutForbidden()); 1256 ASSERT(!isSetNeedsLayoutForbidden());
1248 bool alreadyNeededLayout = m_bitfields.selfNeedsLayout(); 1257 bool alreadyNeededLayout = m_bitfields.selfNeedsLayout();
1249 setSelfNeedsLayout(true); 1258 setSelfNeedsLayout(true);
1250 if (!alreadyNeededLayout) { 1259 if (!alreadyNeededLayout) {
1251 if (markParents == MarkContainingBlockChain && (!layouter || layouter->r oot() != this)) 1260 if (markParents == MarkContainingBlockChain && (!layouter || layouter->r oot() != this))
1252 markContainingBlocksForLayout(true, 0, layouter); 1261 markContainingBlocksForLayout(true, 0, layouter);
1253 if (hasLayer()) 1262 if (hasLayer())
1254 setLayerNeedsFullRepaint(); 1263 setLayerNeedsFullRepaint();
1255 } 1264 }
1256 } 1265 }
1257 1266
1258 inline void RenderObject::clearNeedsLayout() 1267 inline void RenderObject::clearNeedsLayout()
1259 { 1268 {
1269 #ifndef NDEBUG
1270 checkNotInPartialLayout();
1271 #endif
1260 setSelfNeedsLayout(false); 1272 setSelfNeedsLayout(false);
1261 setEverHadLayout(true); 1273 setEverHadLayout(true);
1262 setPosChildNeedsLayout(false); 1274 setPosChildNeedsLayout(false);
1263 setNeedsSimplifiedNormalFlowLayout(false); 1275 setNeedsSimplifiedNormalFlowLayout(false);
1264 setNormalChildNeedsLayout(false); 1276 setNormalChildNeedsLayout(false);
1265 setNeedsPositionedMovementLayout(false); 1277 setNeedsPositionedMovementLayout(false);
1266 setAncestorLineBoxDirty(false); 1278 setAncestorLineBoxDirty(false);
1267 #ifndef NDEBUG 1279 #ifndef NDEBUG
1268 checkBlockPositionedObjectsNeedLayout(); 1280 checkBlockPositionedObjectsNeedLayout();
1269 #endif 1281 #endif
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1394 // Outside the WebCore namespace for ease of invocation from gdb. 1406 // Outside the WebCore namespace for ease of invocation from gdb.
1395 void showTree(const WebCore::RenderObject*); 1407 void showTree(const WebCore::RenderObject*);
1396 void showLineTree(const WebCore::RenderObject*); 1408 void showLineTree(const WebCore::RenderObject*);
1397 void showRenderTree(const WebCore::RenderObject* object1); 1409 void showRenderTree(const WebCore::RenderObject* object1);
1398 // We don't make object2 an optional parameter so that showRenderTree 1410 // We don't make object2 an optional parameter so that showRenderTree
1399 // can be called from gdb easily. 1411 // can be called from gdb easily.
1400 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO bject* object2); 1412 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO bject* object2);
1401 #endif 1413 #endif
1402 1414
1403 #endif // RenderObject_h 1415 #endif // RenderObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698