Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 522 }; | 522 }; |
| 523 bool hasBoxDecorations() const { return m_bitfields.boxDecorationState() != NoBoxDecorations; } | 523 bool hasBoxDecorations() const { return m_bitfields.boxDecorationState() != NoBoxDecorations; } |
| 524 bool backgroundIsKnownToBeObscured(); | 524 bool backgroundIsKnownToBeObscured(); |
| 525 bool borderImageIsLoadedAndCanBeRendered() const; | 525 bool borderImageIsLoadedAndCanBeRendered() const; |
| 526 bool mustRepaintBackgroundOrBorder() const; | 526 bool mustRepaintBackgroundOrBorder() const; |
| 527 bool hasBackground() const { return style()->hasBackground(); } | 527 bool hasBackground() const { return style()->hasBackground(); } |
| 528 bool hasEntirelyFixedBackground() const; | 528 bool hasEntirelyFixedBackground() const; |
| 529 | 529 |
| 530 bool needsLayout() const | 530 bool needsLayout() const |
| 531 { | 531 { |
| 532 return m_bitfields.selfNeedsLayout() || m_bitfields.normalChildNeedsLayo ut() || m_bitfields.posChildNeedsLayout() | 532 return m_bitfields.selfNeedsLayout() |
| 533 || m_bitfields.needsSimplifiedNormalFlowLayout() || m_bitfields.need sPositionedMovementLayout(); | 533 || m_bitfields.normalChildNeedsLayout() |
| 534 || m_bitfields.posChildNeedsLayout() | |
| 535 || m_bitfields.needsSimplifiedNormalFlowLayout() | |
| 536 || m_bitfields.needsPositionedMovementLayout() | |
| 537 || m_bitfields.needsResizeLayout(); | |
| 534 } | 538 } |
| 535 | 539 |
| 536 bool selfNeedsLayout() const { return m_bitfields.selfNeedsLayout(); } | 540 bool selfNeedsLayout() const { return m_bitfields.selfNeedsLayout(); } |
| 537 bool needsPositionedMovementLayout() const { return m_bitfields.needsPositio nedMovementLayout(); } | 541 bool needsPositionedMovementLayout() const { return m_bitfields.needsPositio nedMovementLayout(); } |
| 538 bool needsPositionedMovementLayoutOnly() const | 542 bool needsPositionedMovementLayoutOnly() const |
| 539 { | 543 { |
| 540 return m_bitfields.needsPositionedMovementLayout() && !m_bitfields.selfN eedsLayout() && !m_bitfields.normalChildNeedsLayout() | 544 return m_bitfields.needsPositionedMovementLayout() |
| 541 && !m_bitfields.posChildNeedsLayout() && !m_bitfields.needsSimplifie dNormalFlowLayout(); | 545 && !m_bitfields.selfNeedsLayout() |
| 546 && !m_bitfields.normalChildNeedsLayout() | |
| 547 && !m_bitfields.posChildNeedsLayout() | |
| 548 && !m_bitfields.needsSimplifiedNormalFlowLayout() | |
| 549 && !m_bitfields.needsResizeLayout(); | |
| 542 } | 550 } |
| 543 | 551 |
| 544 bool posChildNeedsLayout() const { return m_bitfields.posChildNeedsLayout(); } | 552 bool posChildNeedsLayout() const { return m_bitfields.posChildNeedsLayout(); } |
| 545 bool needsSimplifiedNormalFlowLayout() const { return m_bitfields.needsSimpl ifiedNormalFlowLayout(); } | 553 bool needsSimplifiedNormalFlowLayout() const { return m_bitfields.needsSimpl ifiedNormalFlowLayout(); } |
| 546 bool normalChildNeedsLayout() const { return m_bitfields.normalChildNeedsLay out(); } | 554 bool normalChildNeedsLayout() const { return m_bitfields.normalChildNeedsLay out(); } |
| 547 | 555 |
| 556 bool needsResizeLayout() const { return m_bitfields.needsResizeLayout(); } | |
| 557 bool needsResizeLayoutOnly() const | |
| 558 { | |
| 559 return m_bitfields.needsResizeLayout() | |
| 560 && !m_bitfields.selfNeedsLayout() | |
| 561 && !m_bitfields.normalChildNeedsLayout() | |
| 562 && !m_bitfields.posChildNeedsLayout() | |
| 563 && !m_bitfields.needsSimplifiedNormalFlowLayout() | |
| 564 && !m_bitfields.needsPositionedMovementLayout(); | |
| 565 } | |
| 566 | |
| 548 bool preferredLogicalWidthsDirty() const { return m_bitfields.preferredLogic alWidthsDirty(); } | 567 bool preferredLogicalWidthsDirty() const { return m_bitfields.preferredLogic alWidthsDirty(); } |
| 549 | 568 |
| 550 bool isSelectionBorder() const; | 569 bool isSelectionBorder() const; |
| 551 | 570 |
| 552 bool hasClip() const { return isOutOfFlowPositioned() && style()->hasClip(); } | 571 bool hasClip() const { return isOutOfFlowPositioned() && style()->hasClip(); } |
| 553 bool hasOverflowClip() const { return m_bitfields.hasOverflowClip(); } | 572 bool hasOverflowClip() const { return m_bitfields.hasOverflowClip(); } |
| 554 bool hasClipOrOverflowClip() const { return hasClip() || hasOverflowClip(); } | 573 bool hasClipOrOverflowClip() const { return hasClip() || hasOverflowClip(); } |
| 555 | 574 |
| 556 bool hasTransform() const { return m_bitfields.hasTransform(); } | 575 bool hasTransform() const { return m_bitfields.hasTransform(); } |
| 557 bool hasMask() const { return style() && style()->hasMask(); } | 576 bool hasMask() const { return style() && style()->hasMask(); } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 609 virtual RenderObject* hoverAncestor() const { return parent(); } | 628 virtual RenderObject* hoverAncestor() const { return parent(); } |
| 610 | 629 |
| 611 Element* offsetParent() const; | 630 Element* offsetParent() const; |
| 612 | 631 |
| 613 void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObjec t* newRoot = 0, SubtreeLayoutScope* = 0); | 632 void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObjec t* newRoot = 0, SubtreeLayoutScope* = 0); |
| 614 void setNeedsLayout(MarkingBehavior = MarkContainingBlockChain, SubtreeLayou tScope* = 0); | 633 void setNeedsLayout(MarkingBehavior = MarkContainingBlockChain, SubtreeLayou tScope* = 0); |
| 615 void clearNeedsLayout(); | 634 void clearNeedsLayout(); |
| 616 void setChildNeedsLayout(MarkingBehavior = MarkContainingBlockChain, Subtree LayoutScope* = 0); | 635 void setChildNeedsLayout(MarkingBehavior = MarkContainingBlockChain, Subtree LayoutScope* = 0); |
| 617 void setNeedsPositionedMovementLayout(); | 636 void setNeedsPositionedMovementLayout(); |
| 618 void setNeedsSimplifiedNormalFlowLayout(); | 637 void setNeedsSimplifiedNormalFlowLayout(); |
| 638 void setNeedsResizeLayout(); | |
| 619 void setPreferredLogicalWidthsDirty(MarkingBehavior = MarkContainingBlockCha in); | 639 void setPreferredLogicalWidthsDirty(MarkingBehavior = MarkContainingBlockCha in); |
| 620 void clearPreferredLogicalWidthsDirty(); | 640 void clearPreferredLogicalWidthsDirty(); |
| 621 void invalidateContainerPreferredLogicalWidths(); | 641 void invalidateContainerPreferredLogicalWidths(); |
| 622 | 642 |
| 623 void setNeedsLayoutAndPrefWidthsRecalc() | 643 void setNeedsLayoutAndPrefWidthsRecalc() |
| 624 { | 644 { |
| 625 setNeedsLayout(); | 645 setNeedsLayout(); |
| 626 setPreferredLogicalWidthsDirty(); | 646 setPreferredLogicalWidthsDirty(); |
| 627 } | 647 } |
| 628 | 648 |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1108 // Holding the layout bits until after repaint would remove the need | 1128 // Holding the layout bits until after repaint would remove the need |
| 1109 // for this flag. | 1129 // for this flag. |
| 1110 , m_shouldDoFullRepaintAfterLayout(false) | 1130 , m_shouldDoFullRepaintAfterLayout(false) |
| 1111 , m_shouldRepaintOverflow(false) | 1131 , m_shouldRepaintOverflow(false) |
| 1112 , m_shouldDoFullRepaintIfSelfPaintingLayer(false) | 1132 , m_shouldDoFullRepaintIfSelfPaintingLayer(false) |
| 1113 , m_onlyNeededPositionedMovementLayout(false) | 1133 , m_onlyNeededPositionedMovementLayout(false) |
| 1114 , m_needsPositionedMovementLayout(false) | 1134 , m_needsPositionedMovementLayout(false) |
| 1115 , m_normalChildNeedsLayout(false) | 1135 , m_normalChildNeedsLayout(false) |
| 1116 , m_posChildNeedsLayout(false) | 1136 , m_posChildNeedsLayout(false) |
| 1117 , m_needsSimplifiedNormalFlowLayout(false) | 1137 , m_needsSimplifiedNormalFlowLayout(false) |
| 1138 , m_needsResizeLayout(false) | |
| 1118 , m_preferredLogicalWidthsDirty(false) | 1139 , m_preferredLogicalWidthsDirty(false) |
| 1119 , m_floating(false) | 1140 , m_floating(false) |
| 1120 , m_isAnonymous(!node) | 1141 , m_isAnonymous(!node) |
| 1121 , m_isText(false) | 1142 , m_isText(false) |
| 1122 , m_isBox(false) | 1143 , m_isBox(false) |
| 1123 , m_isInline(true) | 1144 , m_isInline(true) |
| 1124 , m_isReplaced(false) | 1145 , m_isReplaced(false) |
| 1125 , m_horizontalWritingMode(true) | 1146 , m_horizontalWritingMode(true) |
| 1126 , m_isDragging(false) | 1147 , m_isDragging(false) |
| 1127 , m_hasLayer(false) | 1148 , m_hasLayer(false) |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 1145 // 32 bits have been used in the first word, and 5 in the second. | 1166 // 32 bits have been used in the first word, and 5 in the second. |
| 1146 ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout); | 1167 ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout); |
| 1147 ADD_BOOLEAN_BITFIELD(shouldDoFullRepaintAfterLayout, ShouldDoFullRepaint AfterLayout); | 1168 ADD_BOOLEAN_BITFIELD(shouldDoFullRepaintAfterLayout, ShouldDoFullRepaint AfterLayout); |
| 1148 ADD_BOOLEAN_BITFIELD(shouldRepaintOverflow, ShouldRepaintOverflow); | 1169 ADD_BOOLEAN_BITFIELD(shouldRepaintOverflow, ShouldRepaintOverflow); |
| 1149 ADD_BOOLEAN_BITFIELD(shouldDoFullRepaintIfSelfPaintingLayer, ShouldDoFul lRepaintIfSelfPaintingLayer); | 1170 ADD_BOOLEAN_BITFIELD(shouldDoFullRepaintIfSelfPaintingLayer, ShouldDoFul lRepaintIfSelfPaintingLayer); |
| 1150 ADD_BOOLEAN_BITFIELD(onlyNeededPositionedMovementLayout, OnlyNeededPosit ionedMovementLayout); | 1171 ADD_BOOLEAN_BITFIELD(onlyNeededPositionedMovementLayout, OnlyNeededPosit ionedMovementLayout); |
| 1151 ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovem entLayout); | 1172 ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovem entLayout); |
| 1152 ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout); | 1173 ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout); |
| 1153 ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout); | 1174 ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout); |
| 1154 ADD_BOOLEAN_BITFIELD(needsSimplifiedNormalFlowLayout, NeedsSimplifiedNor malFlowLayout); | 1175 ADD_BOOLEAN_BITFIELD(needsSimplifiedNormalFlowLayout, NeedsSimplifiedNor malFlowLayout); |
| 1176 ADD_BOOLEAN_BITFIELD(needsResizeLayout, NeedsResizeLayout); | |
|
eseidel
2014/04/01 18:25:19
Presumably we have space for this otherwise the Ke
| |
| 1155 ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, PreferredLogicalWidths Dirty); | 1177 ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, PreferredLogicalWidths Dirty); |
| 1156 ADD_BOOLEAN_BITFIELD(floating, Floating); | 1178 ADD_BOOLEAN_BITFIELD(floating, Floating); |
| 1157 | 1179 |
| 1158 ADD_BOOLEAN_BITFIELD(isAnonymous, IsAnonymous); | 1180 ADD_BOOLEAN_BITFIELD(isAnonymous, IsAnonymous); |
| 1159 ADD_BOOLEAN_BITFIELD(isText, IsText); | 1181 ADD_BOOLEAN_BITFIELD(isText, IsText); |
| 1160 ADD_BOOLEAN_BITFIELD(isBox, IsBox); | 1182 ADD_BOOLEAN_BITFIELD(isBox, IsBox); |
| 1161 ADD_BOOLEAN_BITFIELD(isInline, IsInline); | 1183 ADD_BOOLEAN_BITFIELD(isInline, IsInline); |
| 1162 ADD_BOOLEAN_BITFIELD(isReplaced, IsReplaced); | 1184 ADD_BOOLEAN_BITFIELD(isReplaced, IsReplaced); |
| 1163 ADD_BOOLEAN_BITFIELD(horizontalWritingMode, HorizontalWritingMode); | 1185 ADD_BOOLEAN_BITFIELD(horizontalWritingMode, HorizontalWritingMode); |
| 1164 ADD_BOOLEAN_BITFIELD(isDragging, IsDragging); | 1186 ADD_BOOLEAN_BITFIELD(isDragging, IsDragging); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1212 | 1234 |
| 1213 #undef ADD_BOOLEAN_BITFIELD | 1235 #undef ADD_BOOLEAN_BITFIELD |
| 1214 | 1236 |
| 1215 RenderObjectBitfields m_bitfields; | 1237 RenderObjectBitfields m_bitfields; |
| 1216 | 1238 |
| 1217 void setSelfNeedsLayout(bool b) { m_bitfields.setSelfNeedsLayout(b); } | 1239 void setSelfNeedsLayout(bool b) { m_bitfields.setSelfNeedsLayout(b); } |
| 1218 void setNeedsPositionedMovementLayout(bool b) { m_bitfields.setNeedsPosition edMovementLayout(b); } | 1240 void setNeedsPositionedMovementLayout(bool b) { m_bitfields.setNeedsPosition edMovementLayout(b); } |
| 1219 void setNormalChildNeedsLayout(bool b) { m_bitfields.setNormalChildNeedsLayo ut(b); } | 1241 void setNormalChildNeedsLayout(bool b) { m_bitfields.setNormalChildNeedsLayo ut(b); } |
| 1220 void setPosChildNeedsLayout(bool b) { m_bitfields.setPosChildNeedsLayout(b); } | 1242 void setPosChildNeedsLayout(bool b) { m_bitfields.setPosChildNeedsLayout(b); } |
| 1221 void setNeedsSimplifiedNormalFlowLayout(bool b) { m_bitfields.setNeedsSimpli fiedNormalFlowLayout(b); } | 1243 void setNeedsSimplifiedNormalFlowLayout(bool b) { m_bitfields.setNeedsSimpli fiedNormalFlowLayout(b); } |
| 1244 void setNeedsResizeLayoutBit(bool b) { m_bitfields.setNeedsResizeLayout(b); } | |
| 1222 void setIsDragging(bool b) { m_bitfields.setIsDragging(b); } | 1245 void setIsDragging(bool b) { m_bitfields.setIsDragging(b); } |
| 1223 void setEverHadLayout(bool b) { m_bitfields.setEverHadLayout(b); } | 1246 void setEverHadLayout(bool b) { m_bitfields.setEverHadLayout(b); } |
| 1224 void setShouldRepaintOverflow(bool b) { m_bitfields.setShouldRepaintOverflow (b); } | 1247 void setShouldRepaintOverflow(bool b) { m_bitfields.setShouldRepaintOverflow (b); } |
| 1225 | 1248 |
| 1226 private: | 1249 private: |
| 1227 // Store state between styleWillChange and styleDidChange | 1250 // Store state between styleWillChange and styleDidChange |
| 1228 static bool s_affectsParentBlock; | 1251 static bool s_affectsParentBlock; |
| 1229 | 1252 |
| 1230 LayoutRect m_oldRepaintRect; | 1253 LayoutRect m_oldRepaintRect; |
| 1231 LayoutRect m_newRepaintRect; | 1254 LayoutRect m_newRepaintRect; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1283 } | 1306 } |
| 1284 | 1307 |
| 1285 inline void RenderObject::clearNeedsLayout() | 1308 inline void RenderObject::clearNeedsLayout() |
| 1286 { | 1309 { |
| 1287 setSelfNeedsLayout(false); | 1310 setSelfNeedsLayout(false); |
| 1288 setEverHadLayout(true); | 1311 setEverHadLayout(true); |
| 1289 setPosChildNeedsLayout(false); | 1312 setPosChildNeedsLayout(false); |
| 1290 setNeedsSimplifiedNormalFlowLayout(false); | 1313 setNeedsSimplifiedNormalFlowLayout(false); |
| 1291 setNormalChildNeedsLayout(false); | 1314 setNormalChildNeedsLayout(false); |
| 1292 setNeedsPositionedMovementLayout(false); | 1315 setNeedsPositionedMovementLayout(false); |
| 1316 setNeedsResizeLayoutBit(false); | |
| 1293 setAncestorLineBoxDirty(false); | 1317 setAncestorLineBoxDirty(false); |
| 1294 #ifndef NDEBUG | 1318 #ifndef NDEBUG |
| 1295 checkBlockPositionedObjectsNeedLayout(); | 1319 checkBlockPositionedObjectsNeedLayout(); |
| 1296 #endif | 1320 #endif |
| 1297 } | 1321 } |
| 1298 | 1322 |
| 1299 inline void RenderObject::setChildNeedsLayout(MarkingBehavior markParents, Subtr eeLayoutScope* layouter) | 1323 inline void RenderObject::setChildNeedsLayout(MarkingBehavior markParents, Subtr eeLayoutScope* layouter) |
| 1300 { | 1324 { |
| 1301 ASSERT(!isSetNeedsLayoutForbidden()); | 1325 ASSERT(!isSetNeedsLayoutForbidden()); |
| 1302 bool alreadyNeededLayout = normalChildNeedsLayout(); | 1326 bool alreadyNeededLayout = normalChildNeedsLayout(); |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 1323 bool alreadyNeededLayout = needsSimplifiedNormalFlowLayout(); | 1347 bool alreadyNeededLayout = needsSimplifiedNormalFlowLayout(); |
| 1324 setNeedsSimplifiedNormalFlowLayout(true); | 1348 setNeedsSimplifiedNormalFlowLayout(true); |
| 1325 ASSERT(!isSetNeedsLayoutForbidden()); | 1349 ASSERT(!isSetNeedsLayoutForbidden()); |
| 1326 if (!alreadyNeededLayout) { | 1350 if (!alreadyNeededLayout) { |
| 1327 markContainingBlocksForLayout(); | 1351 markContainingBlocksForLayout(); |
| 1328 if (hasLayer()) | 1352 if (hasLayer()) |
| 1329 setLayerNeedsFullRepaint(); | 1353 setLayerNeedsFullRepaint(); |
| 1330 } | 1354 } |
| 1331 } | 1355 } |
| 1332 | 1356 |
| 1357 inline void RenderObject::setNeedsResizeLayout() | |
| 1358 { | |
| 1359 bool alreadyNeededLayout = needsResizeLayout(); | |
| 1360 setNeedsResizeLayoutBit(true); | |
| 1361 ASSERT(!isSetNeedsLayoutForbidden()); | |
| 1362 if (!alreadyNeededLayout) | |
| 1363 markContainingBlocksForLayout(); | |
| 1364 } | |
| 1365 | |
| 1333 inline bool RenderObject::preservesNewline() const | 1366 inline bool RenderObject::preservesNewline() const |
| 1334 { | 1367 { |
| 1335 if (isSVGInlineText()) | 1368 if (isSVGInlineText()) |
| 1336 return false; | 1369 return false; |
| 1337 | 1370 |
| 1338 return style()->preserveNewline(); | 1371 return style()->preserveNewline(); |
| 1339 } | 1372 } |
| 1340 | 1373 |
| 1341 inline bool RenderObject::layerCreationAllowedForSubtree() const | 1374 inline bool RenderObject::layerCreationAllowedForSubtree() const |
| 1342 { | 1375 { |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1426 void showTree(const WebCore::RenderObject*); | 1459 void showTree(const WebCore::RenderObject*); |
| 1427 void showLineTree(const WebCore::RenderObject*); | 1460 void showLineTree(const WebCore::RenderObject*); |
| 1428 void showRenderTree(const WebCore::RenderObject* object1); | 1461 void showRenderTree(const WebCore::RenderObject* object1); |
| 1429 // We don't make object2 an optional parameter so that showRenderTree | 1462 // We don't make object2 an optional parameter so that showRenderTree |
| 1430 // can be called from gdb easily. | 1463 // can be called from gdb easily. |
| 1431 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO bject* object2); | 1464 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO bject* object2); |
| 1432 | 1465 |
| 1433 #endif | 1466 #endif |
| 1434 | 1467 |
| 1435 #endif // RenderObject_h | 1468 #endif // RenderObject_h |
| OLD | NEW |