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

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 Created 7 years, 4 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 virtual FrameView* frameView() const;
esprehn 2013/08/23 20:47:27 frameView() should not be virtual
pdr. 2013/08/26 05:50:40 Done.
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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 StyleColor styleColor = color; 1071 StyleColor styleColor = color;
1067 for (const RenderObject* object = this; UNLIKELY(styleColor.isCurrentCol or()) && object && object->style(); object = object->parent()) 1072 for (const RenderObject* object = this; UNLIKELY(styleColor.isCurrentCol or()) && object && object->style(); object = object->parent())
1068 styleColor = object->style()->visitedDependentColor(CSSPropertyColor ); 1073 styleColor = object->style()->visitedDependentColor(CSSPropertyColor );
1069 return styleColor; 1074 return styleColor;
1070 } 1075 }
1071 1076
1072 void removeShapeImageClient(ShapeValue*); 1077 void removeShapeImageClient(ShapeValue*);
1073 1078
1074 #ifndef NDEBUG 1079 #ifndef NDEBUG
1075 void checkBlockPositionedObjectsNeedLayout(); 1080 void checkBlockPositionedObjectsNeedLayout();
1081 void checkNotInPartialLayout();
1076 #endif 1082 #endif
1077 1083
1078 RefPtr<RenderStyle> m_style; 1084 RefPtr<RenderStyle> m_style;
1079 1085
1080 Node* m_node; 1086 Node* m_node;
1081 1087
1082 RenderObject* m_parent; 1088 RenderObject* m_parent;
1083 RenderObject* m_previous; 1089 RenderObject* m_previous;
1084 RenderObject* m_next; 1090 RenderObject* m_next;
1085 1091
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 return true; 1242 return true;
1237 } 1243 }
1238 1244
1239 inline bool RenderObject::isBeforeOrAfterContent() const 1245 inline bool RenderObject::isBeforeOrAfterContent() const
1240 { 1246 {
1241 return isBeforeContent() || isAfterContent(); 1247 return isBeforeContent() || isAfterContent();
1242 } 1248 }
1243 1249
1244 inline void RenderObject::setNeedsLayout(MarkingBehavior markParents, SubtreeLay outScope* layouter) 1250 inline void RenderObject::setNeedsLayout(MarkingBehavior markParents, SubtreeLay outScope* layouter)
1245 { 1251 {
1252 #ifndef NDEBUG
1253 checkNotInPartialLayout();
1254 #endif
1246 ASSERT(!isSetNeedsLayoutForbidden()); 1255 ASSERT(!isSetNeedsLayoutForbidden());
1247 bool alreadyNeededLayout = m_bitfields.selfNeedsLayout(); 1256 bool alreadyNeededLayout = m_bitfields.selfNeedsLayout();
1248 setSelfNeedsLayout(true); 1257 setSelfNeedsLayout(true);
1249 if (!alreadyNeededLayout) { 1258 if (!alreadyNeededLayout) {
1250 if (markParents == MarkContainingBlockChain && (!layouter || layouter->r oot() != this)) 1259 if (markParents == MarkContainingBlockChain && (!layouter || layouter->r oot() != this))
1251 markContainingBlocksForLayout(true, 0, layouter); 1260 markContainingBlocksForLayout(true, 0, layouter);
1252 if (hasLayer()) 1261 if (hasLayer())
1253 setLayerNeedsFullRepaint(); 1262 setLayerNeedsFullRepaint();
1254 } 1263 }
1255 } 1264 }
1256 1265
1257 inline void RenderObject::clearNeedsLayout() 1266 inline void RenderObject::clearNeedsLayout()
1258 { 1267 {
1268 #ifndef NDEBUG
1269 checkNotInPartialLayout();
1270 #endif
1259 setSelfNeedsLayout(false); 1271 setSelfNeedsLayout(false);
1260 setEverHadLayout(true); 1272 setEverHadLayout(true);
1261 setPosChildNeedsLayout(false); 1273 setPosChildNeedsLayout(false);
1262 setNeedsSimplifiedNormalFlowLayout(false); 1274 setNeedsSimplifiedNormalFlowLayout(false);
1263 setNormalChildNeedsLayout(false); 1275 setNormalChildNeedsLayout(false);
1264 setNeedsPositionedMovementLayout(false); 1276 setNeedsPositionedMovementLayout(false);
1265 setAncestorLineBoxDirty(false); 1277 setAncestorLineBoxDirty(false);
1266 #ifndef NDEBUG 1278 #ifndef NDEBUG
1267 checkBlockPositionedObjectsNeedLayout(); 1279 checkBlockPositionedObjectsNeedLayout();
1268 #endif 1280 #endif
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 // Outside the WebCore namespace for ease of invocation from gdb. 1405 // Outside the WebCore namespace for ease of invocation from gdb.
1394 void showTree(const WebCore::RenderObject*); 1406 void showTree(const WebCore::RenderObject*);
1395 void showLineTree(const WebCore::RenderObject*); 1407 void showLineTree(const WebCore::RenderObject*);
1396 void showRenderTree(const WebCore::RenderObject* object1); 1408 void showRenderTree(const WebCore::RenderObject* object1);
1397 // We don't make object2 an optional parameter so that showRenderTree 1409 // We don't make object2 an optional parameter so that showRenderTree
1398 // can be called from gdb easily. 1410 // can be called from gdb easily.
1399 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO bject* object2); 1411 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO bject* object2);
1400 #endif 1412 #endif
1401 1413
1402 #endif // RenderObject_h 1414 #endif // RenderObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698