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

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

Issue 204843002: Reduce invalidation on children-needs-layout containers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 void setHasColumns(bool b = true) { m_bitfields.setHasColumns(b); } 400 void setHasColumns(bool b = true) { m_bitfields.setHasColumns(b); }
401 401
402 bool ancestorLineBoxDirty() const { return m_bitfields.ancestorLineBoxDirty( ); } 402 bool ancestorLineBoxDirty() const { return m_bitfields.ancestorLineBoxDirty( ); }
403 void setAncestorLineBoxDirty(bool value = true) 403 void setAncestorLineBoxDirty(bool value = true)
404 { 404 {
405 m_bitfields.setAncestorLineBoxDirty(value); 405 m_bitfields.setAncestorLineBoxDirty(value);
406 if (value) 406 if (value)
407 setNeedsLayout(); 407 setNeedsLayout();
408 } 408 }
409 409
410 bool hasNothingToPaint() const { return m_bitfields.hasNothingToPaint(); }
411 void setHasNothingToPaint(bool b) { return m_bitfields.setHasNothingToPaint( b); }
412
410 enum FlowThreadState { 413 enum FlowThreadState {
411 NotInsideFlowThread = 0, 414 NotInsideFlowThread = 0,
412 InsideOutOfFlowThread = 1, 415 InsideOutOfFlowThread = 1,
413 InsideInFlowThread = 2, 416 InsideInFlowThread = 2,
414 }; 417 };
415 418
416 void setFlowThreadStateIncludingDescendants(FlowThreadState); 419 void setFlowThreadStateIncludingDescendants(FlowThreadState);
417 420
418 FlowThreadState flowThreadState() const { return m_bitfields.flowThreadState (); } 421 FlowThreadState flowThreadState() const { return m_bitfields.flowThreadState (); }
419 void setFlowThreadState(FlowThreadState state) { m_bitfields.setFlowThreadSt ate(state); } 422 void setFlowThreadState(FlowThreadState state) { m_bitfields.setFlowThreadSt ate(state); }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 HasBoxDecorationsAndBackgroundIsKnownToBeObscured, 521 HasBoxDecorationsAndBackgroundIsKnownToBeObscured,
519 HasBoxDecorationsAndBackgroundMayBeVisible, 522 HasBoxDecorationsAndBackgroundMayBeVisible,
520 }; 523 };
521 bool hasBoxDecorations() const { return m_bitfields.boxDecorationState() != NoBoxDecorations; } 524 bool hasBoxDecorations() const { return m_bitfields.boxDecorationState() != NoBoxDecorations; }
522 bool backgroundIsKnownToBeObscured(); 525 bool backgroundIsKnownToBeObscured();
523 bool borderImageIsLoadedAndCanBeRendered() const; 526 bool borderImageIsLoadedAndCanBeRendered() const;
524 bool mustRepaintBackgroundOrBorder() const; 527 bool mustRepaintBackgroundOrBorder() const;
525 bool hasBackground() const { return style()->hasBackground(); } 528 bool hasBackground() const { return style()->hasBackground(); }
526 bool hasEntirelyFixedBackground() const; 529 bool hasEntirelyFixedBackground() const;
527 530
531 bool needsLayoutBecauseOfChildren() const { return needsLayout() && !selfNee dsLayout() && !needsPositionedMovementLayout() && !needsSimplifiedNormalFlowLayo ut(); }
532
528 bool needsLayout() const 533 bool needsLayout() const
529 { 534 {
530 return m_bitfields.selfNeedsLayout() || m_bitfields.normalChildNeedsLayo ut() || m_bitfields.posChildNeedsLayout() 535 return m_bitfields.selfNeedsLayout() || m_bitfields.normalChildNeedsLayo ut() || m_bitfields.posChildNeedsLayout()
531 || m_bitfields.needsSimplifiedNormalFlowLayout() || m_bitfields.need sPositionedMovementLayout(); 536 || m_bitfields.needsSimplifiedNormalFlowLayout() || m_bitfields.need sPositionedMovementLayout();
532 } 537 }
533 538
534 bool selfNeedsLayout() const { return m_bitfields.selfNeedsLayout(); } 539 bool selfNeedsLayout() const { return m_bitfields.selfNeedsLayout(); }
535 bool needsPositionedMovementLayout() const { return m_bitfields.needsPositio nedMovementLayout(); } 540 bool needsPositionedMovementLayout() const { return m_bitfields.needsPositio nedMovementLayout(); }
536 bool needsPositionedMovementLayoutOnly() const 541 bool needsPositionedMovementLayoutOnly() const
537 { 542 {
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 , m_isReplaced(false) 1122 , m_isReplaced(false)
1118 , m_horizontalWritingMode(true) 1123 , m_horizontalWritingMode(true)
1119 , m_isDragging(false) 1124 , m_isDragging(false)
1120 , m_hasLayer(false) 1125 , m_hasLayer(false)
1121 , m_hasOverflowClip(false) 1126 , m_hasOverflowClip(false)
1122 , m_hasTransform(false) 1127 , m_hasTransform(false)
1123 , m_hasReflection(false) 1128 , m_hasReflection(false)
1124 , m_hasCounterNodeMap(false) 1129 , m_hasCounterNodeMap(false)
1125 , m_everHadLayout(false) 1130 , m_everHadLayout(false)
1126 , m_ancestorLineBoxDirty(false) 1131 , m_ancestorLineBoxDirty(false)
1132 , m_hasNothingToPaint(false)
1127 , m_childrenInline(false) 1133 , m_childrenInline(false)
1128 , m_hasColumns(false) 1134 , m_hasColumns(false)
1129 , m_layoutDidGetCalled(false) 1135 , m_layoutDidGetCalled(false)
1130 , m_positionedState(IsStaticallyPositioned) 1136 , m_positionedState(IsStaticallyPositioned)
1131 , m_selectionState(SelectionNone) 1137 , m_selectionState(SelectionNone)
1132 , m_flowThreadState(NotInsideFlowThread) 1138 , m_flowThreadState(NotInsideFlowThread)
1133 , m_boxDecorationState(NoBoxDecorations) 1139 , m_boxDecorationState(NoBoxDecorations)
1134 , m_hasPendingResourceUpdate(false) 1140 , m_hasPendingResourceUpdate(false)
1135 { 1141 {
1136 } 1142 }
(...skipping 19 matching lines...) Expand all
1156 1162
1157 ADD_BOOLEAN_BITFIELD(hasLayer, HasLayer); 1163 ADD_BOOLEAN_BITFIELD(hasLayer, HasLayer);
1158 ADD_BOOLEAN_BITFIELD(hasOverflowClip, HasOverflowClip); // Set in the ca se of overflow:auto/scroll/hidden 1164 ADD_BOOLEAN_BITFIELD(hasOverflowClip, HasOverflowClip); // Set in the ca se of overflow:auto/scroll/hidden
1159 ADD_BOOLEAN_BITFIELD(hasTransform, HasTransform); 1165 ADD_BOOLEAN_BITFIELD(hasTransform, HasTransform);
1160 ADD_BOOLEAN_BITFIELD(hasReflection, HasReflection); 1166 ADD_BOOLEAN_BITFIELD(hasReflection, HasReflection);
1161 1167
1162 ADD_BOOLEAN_BITFIELD(hasCounterNodeMap, HasCounterNodeMap); 1168 ADD_BOOLEAN_BITFIELD(hasCounterNodeMap, HasCounterNodeMap);
1163 ADD_BOOLEAN_BITFIELD(everHadLayout, EverHadLayout); 1169 ADD_BOOLEAN_BITFIELD(everHadLayout, EverHadLayout);
1164 ADD_BOOLEAN_BITFIELD(ancestorLineBoxDirty, AncestorLineBoxDirty); 1170 ADD_BOOLEAN_BITFIELD(ancestorLineBoxDirty, AncestorLineBoxDirty);
1165 1171
1172 ADD_BOOLEAN_BITFIELD(hasNothingToPaint, HasNothingToPaint);
1173
1166 // from RenderBlock 1174 // from RenderBlock
1167 ADD_BOOLEAN_BITFIELD(childrenInline, ChildrenInline); 1175 ADD_BOOLEAN_BITFIELD(childrenInline, ChildrenInline);
1168 ADD_BOOLEAN_BITFIELD(hasColumns, HasColumns); 1176 ADD_BOOLEAN_BITFIELD(hasColumns, HasColumns);
1169 1177
1170 ADD_BOOLEAN_BITFIELD(layoutDidGetCalled, LayoutDidGetCalled); 1178 ADD_BOOLEAN_BITFIELD(layoutDidGetCalled, LayoutDidGetCalled);
1171 1179
1172 private: 1180 private:
1173 unsigned m_positionedState : 2; // PositionedState 1181 unsigned m_positionedState : 2; // PositionedState
1174 unsigned m_selectionState : 3; // SelectionState 1182 unsigned m_selectionState : 3; // SelectionState
1175 unsigned m_flowThreadState : 2; // FlowThreadState 1183 unsigned m_flowThreadState : 2; // FlowThreadState
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
1417 void showTree(const WebCore::RenderObject*); 1425 void showTree(const WebCore::RenderObject*);
1418 void showLineTree(const WebCore::RenderObject*); 1426 void showLineTree(const WebCore::RenderObject*);
1419 void showRenderTree(const WebCore::RenderObject* object1); 1427 void showRenderTree(const WebCore::RenderObject* object1);
1420 // We don't make object2 an optional parameter so that showRenderTree 1428 // We don't make object2 an optional parameter so that showRenderTree
1421 // can be called from gdb easily. 1429 // can be called from gdb easily.
1422 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO bject* object2); 1430 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO bject* object2);
1423 1431
1424 #endif 1432 #endif
1425 1433
1426 #endif // RenderObject_h 1434 #endif // RenderObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698