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

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

Issue 265703012: Separate repaint and layout requirements of StyleDifference (Step 4) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 // Returns the object containing this one. Can be different from parent for positioned elements. 626 // Returns the object containing this one. Can be different from parent for positioned elements.
627 // If repaintContainer and repaintContainerSkipped are not null, on return * repaintContainerSkipped 627 // If repaintContainer and repaintContainerSkipped are not null, on return * repaintContainerSkipped
628 // is true if the renderer returned is an ancestor of repaintContainer. 628 // is true if the renderer returned is an ancestor of repaintContainer.
629 RenderObject* container(const RenderLayerModelObject* repaintContainer = 0, bool* repaintContainerSkipped = 0) const; 629 RenderObject* container(const RenderLayerModelObject* repaintContainer = 0, bool* repaintContainerSkipped = 0) const;
630 630
631 virtual RenderObject* hoverAncestor() const { return parent(); } 631 virtual RenderObject* hoverAncestor() const { return parent(); }
632 632
633 Element* offsetParent() const; 633 Element* offsetParent() const;
634 634
635 void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObjec t* newRoot = 0, SubtreeLayoutScope* = 0); 635 void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObjec t* newRoot = 0, SubtreeLayoutScope* = 0);
636 void setNeedsLayoutWithoutForcingFullRepaint(MarkingBehavior = MarkContainin gBlockChain, SubtreeLayoutScope* = 0);
Julien - ping for review 2014/05/12 15:08:46 This function is not used outside RenderObject so
Xianzhu 2014/05/12 21:31:51 We will need this function (in new opting-in-repai
636 void setNeedsLayout(MarkingBehavior = MarkContainingBlockChain, SubtreeLayou tScope* = 0); 637 void setNeedsLayout(MarkingBehavior = MarkContainingBlockChain, SubtreeLayou tScope* = 0);
637 void clearNeedsLayout(); 638 void clearNeedsLayout();
638 void setChildNeedsLayout(MarkingBehavior = MarkContainingBlockChain, Subtree LayoutScope* = 0); 639 void setChildNeedsLayout(MarkingBehavior = MarkContainingBlockChain, Subtree LayoutScope* = 0);
639 void setNeedsPositionedMovementLayout(); 640 void setNeedsPositionedMovementLayout();
640 void setPreferredLogicalWidthsDirty(MarkingBehavior = MarkContainingBlockCha in); 641 void setPreferredLogicalWidthsDirty(MarkingBehavior = MarkContainingBlockCha in);
641 void clearPreferredLogicalWidthsDirty(); 642 void clearPreferredLogicalWidthsDirty();
642 void invalidateContainerPreferredLogicalWidths(); 643 void invalidateContainerPreferredLogicalWidths();
643 644
644 void setNeedsLayoutAndPrefWidthsRecalc() 645 void setNeedsLayoutAndPrefWidthsRecalc()
645 { 646 {
646 setNeedsLayout(); 647 setNeedsLayout();
647 setPreferredLogicalWidthsDirty(); 648 setPreferredLogicalWidthsDirty();
648 } 649 }
650 void setNeedsLayoutAndPrefWidthsRecalcWithoutForcingFullRepaint()
Julien - ping for review 2014/05/12 15:08:46 I think we should make this the default, not an op
Xianzhu 2014/05/12 21:31:51 Done.
651 {
652 setNeedsLayoutWithoutForcingFullRepaint();
653 setPreferredLogicalWidthsDirty();
654 }
649 655
650 void setPositionState(EPosition position) 656 void setPositionState(EPosition position)
651 { 657 {
652 ASSERT((position != AbsolutePosition && position != FixedPosition) || is Box()); 658 ASSERT((position != AbsolutePosition && position != FixedPosition) || is Box());
653 m_bitfields.setPositionedState(position); 659 m_bitfields.setPositionedState(position);
654 } 660 }
655 void clearPositionedState() { m_bitfields.clearPositionedState(); } 661 void clearPositionedState() { m_bitfields.clearPositionedState(); }
656 662
657 void setFloating(bool isFloating) { m_bitfields.setFloating(isFloating); } 663 void setFloating(bool isFloating) { m_bitfields.setFloating(isFloating); }
658 void setInline(bool isInline) { m_bitfields.setIsInline(isInline); } 664 void setInline(bool isInline) { m_bitfields.setIsInline(isInline); }
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
1287 if (isText() && !isBR()) 1293 if (isText() && !isBR())
1288 return false; 1294 return false;
1289 return true; 1295 return true;
1290 } 1296 }
1291 1297
1292 inline bool RenderObject::isBeforeOrAfterContent() const 1298 inline bool RenderObject::isBeforeOrAfterContent() const
1293 { 1299 {
1294 return isBeforeContent() || isAfterContent(); 1300 return isBeforeContent() || isAfterContent();
1295 } 1301 }
1296 1302
1297 inline void RenderObject::setNeedsLayout(MarkingBehavior markParents, SubtreeLay outScope* layouter) 1303 inline void RenderObject::setNeedsLayoutWithoutForcingFullRepaint(MarkingBehavio r markParents, SubtreeLayoutScope* layouter)
1298 { 1304 {
1299 ASSERT(!isSetNeedsLayoutForbidden()); 1305 ASSERT(!isSetNeedsLayoutForbidden());
1300 bool alreadyNeededLayout = m_bitfields.selfNeedsLayout(); 1306 bool alreadyNeededLayout = m_bitfields.selfNeedsLayout();
1301 setSelfNeedsLayout(true); 1307 setSelfNeedsLayout(true);
1302 if (!alreadyNeededLayout) { 1308 if (!alreadyNeededLayout) {
1303 if (markParents == MarkContainingBlockChain && (!layouter || layouter->r oot() != this)) 1309 if (markParents == MarkContainingBlockChain && (!layouter || layouter->r oot() != this))
1304 markContainingBlocksForLayout(true, 0, layouter); 1310 markContainingBlocksForLayout(true, 0, layouter);
1305 } 1311 }
1306 } 1312 }
1307 1313
1314 inline void RenderObject::setNeedsLayout(MarkingBehavior markParents, SubtreeLay outScope* layouter)
1315 {
1316 setNeedsLayoutWithoutForcingFullRepaint(markParents, layouter);
1317 setShouldDoFullRepaintAfterLayout(true);
1318 }
Julien - ping for review 2014/05/07 00:24:32 For me, this bit is total madness: we *don't* want
Xianzhu 2014/05/07 00:39:22 Could you give more details about how this CL chan
Julien - ping for review 2014/05/08 21:03:49 We have 2 ways to generate invalidations: incremen
Xianzhu 2014/05/08 21:52:55 Incremental invalidation is only possible when the
Julien - ping for review 2014/05/12 15:08:46 OK, I see your point. It makes an assumption in th
1319
1308 inline void RenderObject::clearNeedsLayout() 1320 inline void RenderObject::clearNeedsLayout()
1309 { 1321 {
1310 if (!shouldDoFullRepaintAfterLayout())
1311 setShouldDoFullRepaintAfterLayout(selfNeedsLayout());
1312 if (needsPositionedMovementLayoutOnly()) 1322 if (needsPositionedMovementLayoutOnly())
1313 setOnlyNeededPositionedMovementLayout(true); 1323 setOnlyNeededPositionedMovementLayout(true);
1314 setLayoutDidGetCalled(true); 1324 setLayoutDidGetCalled(true);
1315 setSelfNeedsLayout(false); 1325 setSelfNeedsLayout(false);
1316 setEverHadLayout(true); 1326 setEverHadLayout(true);
1317 setPosChildNeedsLayout(false); 1327 setPosChildNeedsLayout(false);
1318 setNeedsSimplifiedNormalFlowLayout(false); 1328 setNeedsSimplifiedNormalFlowLayout(false);
1319 setNormalChildNeedsLayout(false); 1329 setNormalChildNeedsLayout(false);
1320 setNeedsPositionedMovementLayout(false); 1330 setNeedsPositionedMovementLayout(false);
1321 setAncestorLineBoxDirty(false); 1331 setAncestorLineBoxDirty(false);
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 void showTree(const WebCore::RenderObject*); 1452 void showTree(const WebCore::RenderObject*);
1443 void showLineTree(const WebCore::RenderObject*); 1453 void showLineTree(const WebCore::RenderObject*);
1444 void showRenderTree(const WebCore::RenderObject* object1); 1454 void showRenderTree(const WebCore::RenderObject* object1);
1445 // We don't make object2 an optional parameter so that showRenderTree 1455 // We don't make object2 an optional parameter so that showRenderTree
1446 // can be called from gdb easily. 1456 // can be called from gdb easily.
1447 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO bject* object2); 1457 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO bject* object2);
1448 1458
1449 #endif 1459 #endif
1450 1460
1451 #endif // RenderObject_h 1461 #endif // RenderObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698