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

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

Issue 250773002: Reland "Recompute overflow after transform changes" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@build_hack
Patch Set: again... 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
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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 return m_bitfields.needsPositionedMovementLayout() && !m_bitfields.selfN eedsLayout() && !m_bitfields.normalChildNeedsLayout() 559 return m_bitfields.needsPositionedMovementLayout() && !m_bitfields.selfN eedsLayout() && !m_bitfields.normalChildNeedsLayout()
560 && !m_bitfields.posChildNeedsLayout() && !m_bitfields.needsSimplifie dNormalFlowLayout(); 560 && !m_bitfields.posChildNeedsLayout() && !m_bitfields.needsSimplifie dNormalFlowLayout();
561 } 561 }
562 562
563 bool posChildNeedsLayout() const { return m_bitfields.posChildNeedsLayout(); } 563 bool posChildNeedsLayout() const { return m_bitfields.posChildNeedsLayout(); }
564 bool needsSimplifiedNormalFlowLayout() const { return m_bitfields.needsSimpl ifiedNormalFlowLayout(); } 564 bool needsSimplifiedNormalFlowLayout() const { return m_bitfields.needsSimpl ifiedNormalFlowLayout(); }
565 bool normalChildNeedsLayout() const { return m_bitfields.normalChildNeedsLay out(); } 565 bool normalChildNeedsLayout() const { return m_bitfields.normalChildNeedsLay out(); }
566 566
567 bool preferredLogicalWidthsDirty() const { return m_bitfields.preferredLogic alWidthsDirty(); } 567 bool preferredLogicalWidthsDirty() const { return m_bitfields.preferredLogic alWidthsDirty(); }
568 568
569 bool needsOverflowRecalcAfterStyleChange() const { return m_bitfields.selfNe edsOverflowRecalcAfterStyleChange() || m_bitfields.childNeedsOverflowRecalcAfter StyleChange(); }
570 bool selfNeedsOverflowRecalcAfterStyleChange() const { return m_bitfields.se lfNeedsOverflowRecalcAfterStyleChange(); }
571 bool childNeedsOverflowRecalcAfterStyleChange() const { return m_bitfields.c hildNeedsOverflowRecalcAfterStyleChange(); }
572
569 bool isSelectionBorder() const; 573 bool isSelectionBorder() const;
570 574
571 bool hasClip() const { return isOutOfFlowPositioned() && style()->hasClip(); } 575 bool hasClip() const { return isOutOfFlowPositioned() && style()->hasClip(); }
572 bool hasOverflowClip() const { return m_bitfields.hasOverflowClip(); } 576 bool hasOverflowClip() const { return m_bitfields.hasOverflowClip(); }
573 bool hasClipOrOverflowClip() const { return hasClip() || hasOverflowClip(); } 577 bool hasClipOrOverflowClip() const { return hasClip() || hasOverflowClip(); }
574 578
575 bool hasTransform() const { return m_bitfields.hasTransform(); } 579 bool hasTransform() const { return m_bitfields.hasTransform(); }
576 bool hasMask() const { return style() && style()->hasMask(); } 580 bool hasMask() const { return style() && style()->hasMask(); }
577 bool hasClipPath() const { return style() && style()->clipPath(); } 581 bool hasClipPath() const { return style() && style()->clipPath(); }
578 bool hasHiddenBackface() const { return style() && style()->backfaceVisibili ty() == BackfaceVisibilityHidden; } 582 bool hasHiddenBackface() const { return style() && style()->backfaceVisibili ty() == BackfaceVisibilityHidden; }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 632
629 virtual RenderObject* hoverAncestor() const { return parent(); } 633 virtual RenderObject* hoverAncestor() const { return parent(); }
630 634
631 Element* offsetParent() const; 635 Element* offsetParent() const;
632 636
633 void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObjec t* newRoot = 0, SubtreeLayoutScope* = 0); 637 void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObjec t* newRoot = 0, SubtreeLayoutScope* = 0);
634 void setNeedsLayout(MarkingBehavior = MarkContainingBlockChain, SubtreeLayou tScope* = 0); 638 void setNeedsLayout(MarkingBehavior = MarkContainingBlockChain, SubtreeLayou tScope* = 0);
635 void clearNeedsLayout(); 639 void clearNeedsLayout();
636 void setChildNeedsLayout(MarkingBehavior = MarkContainingBlockChain, Subtree LayoutScope* = 0); 640 void setChildNeedsLayout(MarkingBehavior = MarkContainingBlockChain, Subtree LayoutScope* = 0);
637 void setNeedsPositionedMovementLayout(); 641 void setNeedsPositionedMovementLayout();
638 void setNeedsSimplifiedNormalFlowLayout();
639 void setPreferredLogicalWidthsDirty(MarkingBehavior = MarkContainingBlockCha in); 642 void setPreferredLogicalWidthsDirty(MarkingBehavior = MarkContainingBlockCha in);
640 void clearPreferredLogicalWidthsDirty(); 643 void clearPreferredLogicalWidthsDirty();
641 void invalidateContainerPreferredLogicalWidths(); 644 void invalidateContainerPreferredLogicalWidths();
642 645
643 void setNeedsLayoutAndPrefWidthsRecalc() 646 void setNeedsLayoutAndPrefWidthsRecalc()
644 { 647 {
645 setNeedsLayout(); 648 setNeedsLayout();
646 setPreferredLogicalWidthsDirty(); 649 setPreferredLogicalWidthsDirty();
647 } 650 }
648 651
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 1008
1006 void clearRepaintState(); 1009 void clearRepaintState();
1007 1010
1008 // layoutDidGetCalled indicates whether this render object was re-laid-out 1011 // layoutDidGetCalled indicates whether this render object was re-laid-out
1009 // since the last call to setLayoutDidGetCalled(false) on this object. 1012 // since the last call to setLayoutDidGetCalled(false) on this object.
1010 bool layoutDidGetCalled() { return m_bitfields.layoutDidGetCalled(); } 1013 bool layoutDidGetCalled() { return m_bitfields.layoutDidGetCalled(); }
1011 void setLayoutDidGetCalled(bool b) { m_bitfields.setLayoutDidGetCalled(b); } 1014 void setLayoutDidGetCalled(bool b) { m_bitfields.setLayoutDidGetCalled(b); }
1012 1015
1013 bool shouldDisableLayoutState() const { return hasColumns() || hasTransform( ) || hasReflection() || style()->isFlippedBlocksWritingMode(); } 1016 bool shouldDisableLayoutState() const { return hasColumns() || hasTransform( ) || hasReflection() || style()->isFlippedBlocksWritingMode(); }
1014 1017
1018 void setNeedsOverflowRecalcAfterStyleChange();
1019 void markContainingBlocksForOverflowRecalc();
1020
1015 protected: 1021 protected:
1016 inline bool layerCreationAllowedForSubtree() const; 1022 inline bool layerCreationAllowedForSubtree() const;
1017 1023
1018 // Overrides should call the superclass at the end. m_style will be 0 the fi rst time 1024 // Overrides should call the superclass at the end. m_style will be 0 the fi rst time
1019 // this function will be called. 1025 // this function will be called.
1020 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle); 1026 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle);
1021 // Overrides should call the superclass at the start. |oldStyle| will be 0 t he first 1027 // Overrides should call the superclass at the start. |oldStyle| will be 0 t he first
1022 // time this function is called. 1028 // time this function is called.
1023 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); 1029 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
1024 void propagateStyleToAnonymousChildren(bool blockChildrenOnly = false); 1030 void propagateStyleToAnonymousChildren(bool blockChildrenOnly = false);
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 , m_shouldDoFullRepaintAfterLayout(false) 1128 , m_shouldDoFullRepaintAfterLayout(false)
1123 , m_shouldRepaintOverflow(false) 1129 , m_shouldRepaintOverflow(false)
1124 , m_shouldDoFullRepaintIfSelfPaintingLayer(false) 1130 , m_shouldDoFullRepaintIfSelfPaintingLayer(false)
1125 , m_onlyNeededPositionedMovementLayout(false) 1131 , m_onlyNeededPositionedMovementLayout(false)
1126 , m_needsPositionedMovementLayout(false) 1132 , m_needsPositionedMovementLayout(false)
1127 , m_normalChildNeedsLayout(false) 1133 , m_normalChildNeedsLayout(false)
1128 , m_posChildNeedsLayout(false) 1134 , m_posChildNeedsLayout(false)
1129 , m_needsSimplifiedNormalFlowLayout(false) 1135 , m_needsSimplifiedNormalFlowLayout(false)
1130 , m_preferredLogicalWidthsDirty(false) 1136 , m_preferredLogicalWidthsDirty(false)
1131 , m_floating(false) 1137 , m_floating(false)
1138 , m_selfNeedsOverflowRecalcAfterStyleChange(false)
1139 , m_childNeedsOverflowRecalcAfterStyleChange(false)
1132 , m_isAnonymous(!node) 1140 , m_isAnonymous(!node)
1133 , m_isText(false) 1141 , m_isText(false)
1134 , m_isBox(false) 1142 , m_isBox(false)
1135 , m_isInline(true) 1143 , m_isInline(true)
1136 , m_isReplaced(false) 1144 , m_isReplaced(false)
1137 , m_horizontalWritingMode(true) 1145 , m_horizontalWritingMode(true)
1138 , m_isDragging(false) 1146 , m_isDragging(false)
1139 , m_hasLayer(false) 1147 , m_hasLayer(false)
1140 , m_hasOverflowClip(false) 1148 , m_hasOverflowClip(false)
1141 , m_hasTransform(false) 1149 , m_hasTransform(false)
(...skipping 17 matching lines...) Expand all
1159 ADD_BOOLEAN_BITFIELD(shouldDoFullRepaintAfterLayout, ShouldDoFullRepaint AfterLayout); 1167 ADD_BOOLEAN_BITFIELD(shouldDoFullRepaintAfterLayout, ShouldDoFullRepaint AfterLayout);
1160 ADD_BOOLEAN_BITFIELD(shouldRepaintOverflow, ShouldRepaintOverflow); 1168 ADD_BOOLEAN_BITFIELD(shouldRepaintOverflow, ShouldRepaintOverflow);
1161 ADD_BOOLEAN_BITFIELD(shouldDoFullRepaintIfSelfPaintingLayer, ShouldDoFul lRepaintIfSelfPaintingLayer); 1169 ADD_BOOLEAN_BITFIELD(shouldDoFullRepaintIfSelfPaintingLayer, ShouldDoFul lRepaintIfSelfPaintingLayer);
1162 ADD_BOOLEAN_BITFIELD(onlyNeededPositionedMovementLayout, OnlyNeededPosit ionedMovementLayout); 1170 ADD_BOOLEAN_BITFIELD(onlyNeededPositionedMovementLayout, OnlyNeededPosit ionedMovementLayout);
1163 ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovem entLayout); 1171 ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovem entLayout);
1164 ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout); 1172 ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout);
1165 ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout); 1173 ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout);
1166 ADD_BOOLEAN_BITFIELD(needsSimplifiedNormalFlowLayout, NeedsSimplifiedNor malFlowLayout); 1174 ADD_BOOLEAN_BITFIELD(needsSimplifiedNormalFlowLayout, NeedsSimplifiedNor malFlowLayout);
1167 ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, PreferredLogicalWidths Dirty); 1175 ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, PreferredLogicalWidths Dirty);
1168 ADD_BOOLEAN_BITFIELD(floating, Floating); 1176 ADD_BOOLEAN_BITFIELD(floating, Floating);
1177 ADD_BOOLEAN_BITFIELD(selfNeedsOverflowRecalcAfterStyleChange, SelfNeedsO verflowRecalcAfterStyleChange);
1178 ADD_BOOLEAN_BITFIELD(childNeedsOverflowRecalcAfterStyleChange, ChildNeed sOverflowRecalcAfterStyleChange);
1169 1179
1170 ADD_BOOLEAN_BITFIELD(isAnonymous, IsAnonymous); 1180 ADD_BOOLEAN_BITFIELD(isAnonymous, IsAnonymous);
1171 ADD_BOOLEAN_BITFIELD(isText, IsText); 1181 ADD_BOOLEAN_BITFIELD(isText, IsText);
1172 ADD_BOOLEAN_BITFIELD(isBox, IsBox); 1182 ADD_BOOLEAN_BITFIELD(isBox, IsBox);
1173 ADD_BOOLEAN_BITFIELD(isInline, IsInline); 1183 ADD_BOOLEAN_BITFIELD(isInline, IsInline);
1174 ADD_BOOLEAN_BITFIELD(isReplaced, IsReplaced); 1184 ADD_BOOLEAN_BITFIELD(isReplaced, IsReplaced);
1175 ADD_BOOLEAN_BITFIELD(horizontalWritingMode, HorizontalWritingMode); 1185 ADD_BOOLEAN_BITFIELD(horizontalWritingMode, HorizontalWritingMode);
1176 ADD_BOOLEAN_BITFIELD(isDragging, IsDragging); 1186 ADD_BOOLEAN_BITFIELD(isDragging, IsDragging);
1177 1187
1178 ADD_BOOLEAN_BITFIELD(hasLayer, HasLayer); 1188 ADD_BOOLEAN_BITFIELD(hasLayer, HasLayer);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 RenderObjectBitfields m_bitfields; 1237 RenderObjectBitfields m_bitfields;
1228 1238
1229 void setSelfNeedsLayout(bool b) { m_bitfields.setSelfNeedsLayout(b); } 1239 void setSelfNeedsLayout(bool b) { m_bitfields.setSelfNeedsLayout(b); }
1230 void setNeedsPositionedMovementLayout(bool b) { m_bitfields.setNeedsPosition edMovementLayout(b); } 1240 void setNeedsPositionedMovementLayout(bool b) { m_bitfields.setNeedsPosition edMovementLayout(b); }
1231 void setNormalChildNeedsLayout(bool b) { m_bitfields.setNormalChildNeedsLayo ut(b); } 1241 void setNormalChildNeedsLayout(bool b) { m_bitfields.setNormalChildNeedsLayo ut(b); }
1232 void setPosChildNeedsLayout(bool b) { m_bitfields.setPosChildNeedsLayout(b); } 1242 void setPosChildNeedsLayout(bool b) { m_bitfields.setPosChildNeedsLayout(b); }
1233 void setNeedsSimplifiedNormalFlowLayout(bool b) { m_bitfields.setNeedsSimpli fiedNormalFlowLayout(b); } 1243 void setNeedsSimplifiedNormalFlowLayout(bool b) { m_bitfields.setNeedsSimpli fiedNormalFlowLayout(b); }
1234 void setIsDragging(bool b) { m_bitfields.setIsDragging(b); } 1244 void setIsDragging(bool b) { m_bitfields.setIsDragging(b); }
1235 void setEverHadLayout(bool b) { m_bitfields.setEverHadLayout(b); } 1245 void setEverHadLayout(bool b) { m_bitfields.setEverHadLayout(b); }
1236 void setShouldRepaintOverflow(bool b) { m_bitfields.setShouldRepaintOverflow (b); } 1246 void setShouldRepaintOverflow(bool b) { m_bitfields.setShouldRepaintOverflow (b); }
1247 void setSelfNeedsOverflowRecalcAfterStyleChange(bool b) { m_bitfields.setSel fNeedsOverflowRecalcAfterStyleChange(b); }
1248 void setChildNeedsOverflowRecalcAfterStyleChange(bool b) { m_bitfields.setCh ildNeedsOverflowRecalcAfterStyleChange(b); }
1237 1249
1238 private: 1250 private:
1239 // Store state between styleWillChange and styleDidChange 1251 // Store state between styleWillChange and styleDidChange
1240 static bool s_affectsParentBlock; 1252 static bool s_affectsParentBlock;
1241 1253
1242 // This stores the repaint rect from the previous layout. 1254 // This stores the repaint rect from the previous layout.
1243 LayoutRect m_previousRepaintRect; 1255 LayoutRect m_previousRepaintRect;
1244 }; 1256 };
1245 1257
1246 // Allow equality comparisons of RenderObject's by reference or pointer, interch angeably. 1258 // Allow equality comparisons of RenderObject's by reference or pointer, interch angeably.
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
1328 bool alreadyNeededLayout = needsPositionedMovementLayout(); 1340 bool alreadyNeededLayout = needsPositionedMovementLayout();
1329 setNeedsPositionedMovementLayout(true); 1341 setNeedsPositionedMovementLayout(true);
1330 ASSERT(!isSetNeedsLayoutForbidden()); 1342 ASSERT(!isSetNeedsLayoutForbidden());
1331 if (!alreadyNeededLayout) { 1343 if (!alreadyNeededLayout) {
1332 markContainingBlocksForLayout(); 1344 markContainingBlocksForLayout();
1333 if (hasLayer()) 1345 if (hasLayer())
1334 setLayerNeedsFullRepaintForPositionedMovementLayout(); 1346 setLayerNeedsFullRepaintForPositionedMovementLayout();
1335 } 1347 }
1336 } 1348 }
1337 1349
1338 inline void RenderObject::setNeedsSimplifiedNormalFlowLayout()
1339 {
1340 bool alreadyNeededLayout = needsSimplifiedNormalFlowLayout();
1341 setNeedsSimplifiedNormalFlowLayout(true);
1342 ASSERT(!isSetNeedsLayoutForbidden());
1343 if (!alreadyNeededLayout) {
1344 markContainingBlocksForLayout();
1345 if (hasLayer())
1346 setLayerNeedsFullRepaint();
1347 }
1348 }
1349
1350 inline bool RenderObject::preservesNewline() const 1350 inline bool RenderObject::preservesNewline() const
1351 { 1351 {
1352 if (isSVGInlineText()) 1352 if (isSVGInlineText())
1353 return false; 1353 return false;
1354 1354
1355 return style()->preserveNewline(); 1355 return style()->preserveNewline();
1356 } 1356 }
1357 1357
1358 inline bool RenderObject::layerCreationAllowedForSubtree() const 1358 inline bool RenderObject::layerCreationAllowedForSubtree() const
1359 { 1359 {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 void showTree(const WebCore::RenderObject*); 1443 void showTree(const WebCore::RenderObject*);
1444 void showLineTree(const WebCore::RenderObject*); 1444 void showLineTree(const WebCore::RenderObject*);
1445 void showRenderTree(const WebCore::RenderObject* object1); 1445 void showRenderTree(const WebCore::RenderObject* object1);
1446 // We don't make object2 an optional parameter so that showRenderTree 1446 // We don't make object2 an optional parameter so that showRenderTree
1447 // can be called from gdb easily. 1447 // can be called from gdb easily.
1448 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO bject* object2); 1448 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO bject* object2);
1449 1449
1450 #endif 1450 #endif
1451 1451
1452 #endif // RenderObject_h 1452 #endif // RenderObject_h
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayerScrollableArea.cpp ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698