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