| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 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) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
| 7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 return !isTable(); | 296 return !isTable(); |
| 297 if (newChild->isTableSection()) | 297 if (newChild->isTableSection()) |
| 298 return !isTable(); | 298 return !isTable(); |
| 299 if (newChild->isTableRow()) | 299 if (newChild->isTableRow()) |
| 300 return !isTableSection(); | 300 return !isTableSection(); |
| 301 if (newChild->isTableCell()) | 301 if (newChild->isTableCell()) |
| 302 return !isTableRow(); | 302 return !isTableRow(); |
| 303 return false; | 303 return false; |
| 304 } | 304 } |
| 305 | 305 |
| 306 DISABLE_CFI_PERF |
| 306 void LayoutObject::addChild(LayoutObject* newChild, LayoutObject* beforeChild) | 307 void LayoutObject::addChild(LayoutObject* newChild, LayoutObject* beforeChild) |
| 307 { | 308 { |
| 308 ASSERT(isAllowedToModifyLayoutTreeStructure(document())); | 309 ASSERT(isAllowedToModifyLayoutTreeStructure(document())); |
| 309 | 310 |
| 310 LayoutObjectChildList* children = virtualChildren(); | 311 LayoutObjectChildList* children = virtualChildren(); |
| 311 ASSERT(children); | 312 ASSERT(children); |
| 312 if (!children) | 313 if (!children) |
| 313 return; | 314 return; |
| 314 | 315 |
| 315 if (requiresAnonymousTableWrappers(newChild)) { | 316 if (requiresAnonymousTableWrappers(newChild)) { |
| (...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1139 if (mayNeedPaintInvalidationSubtree()) | 1140 if (mayNeedPaintInvalidationSubtree()) |
| 1140 newPaintInvalidationState.setForceSubtreeInvalidationCheckingWithinConta
iner(); | 1141 newPaintInvalidationState.setForceSubtreeInvalidationCheckingWithinConta
iner(); |
| 1141 | 1142 |
| 1142 PaintInvalidationReason reason = invalidatePaintIfNeeded(newPaintInvalidatio
nState); | 1143 PaintInvalidationReason reason = invalidatePaintIfNeeded(newPaintInvalidatio
nState); |
| 1143 clearPaintInvalidationFlags(); | 1144 clearPaintInvalidationFlags(); |
| 1144 | 1145 |
| 1145 newPaintInvalidationState.updateForChildren(reason); | 1146 newPaintInvalidationState.updateForChildren(reason); |
| 1146 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); | 1147 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); |
| 1147 } | 1148 } |
| 1148 | 1149 |
| 1150 DISABLE_CFI_PERF |
| 1149 void LayoutObject::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationStat
e& childPaintInvalidationState) | 1151 void LayoutObject::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationStat
e& childPaintInvalidationState) |
| 1150 { | 1152 { |
| 1151 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) { | 1153 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) { |
| 1152 // Column spanners are invalidated through their placeholders. | 1154 // Column spanners are invalidated through their placeholders. |
| 1153 // See LayoutMultiColumnSpannerPlaceholder::invalidatePaintOfSubtreesIfN
eeded(). | 1155 // See LayoutMultiColumnSpannerPlaceholder::invalidatePaintOfSubtreesIfN
eeded(). |
| 1154 if (child->isColumnSpanAll()) | 1156 if (child->isColumnSpanAll()) |
| 1155 continue; | 1157 continue; |
| 1156 child->invalidateTreeIfNeeded(childPaintInvalidationState); | 1158 child->invalidateTreeIfNeeded(childPaintInvalidationState); |
| 1157 } | 1159 } |
| 1158 } | 1160 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 setPreviousPositionFromPaintInvalidationBacking(context.newLocation); | 1199 setPreviousPositionFromPaintInvalidationBacking(context.newLocation); |
| 1198 | 1200 |
| 1199 if (!shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() &&
paintInvalidationState.forcedSubtreeInvalidationRectUpdateWithinContainerOnly())
{ | 1201 if (!shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() &&
paintInvalidationState.forcedSubtreeInvalidationRectUpdateWithinContainerOnly())
{ |
| 1200 // We are done updating the paint invalidation rect. No other paint inva
lidation work to do for this object. | 1202 // We are done updating the paint invalidation rect. No other paint inva
lidation work to do for this object. |
| 1201 return PaintInvalidationNone; | 1203 return PaintInvalidationNone; |
| 1202 } | 1204 } |
| 1203 | 1205 |
| 1204 return invalidatePaintIfNeeded(context); | 1206 return invalidatePaintIfNeeded(context); |
| 1205 } | 1207 } |
| 1206 | 1208 |
| 1209 DISABLE_CFI_PERF |
| 1207 PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(const PaintInvalid
atorContext& context) const | 1210 PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(const PaintInvalid
atorContext& context) const |
| 1208 { | 1211 { |
| 1209 return ObjectPaintInvalidatorWithContext(*this, context).invalidatePaintIfNe
eded(); | 1212 return ObjectPaintInvalidatorWithContext(*this, context).invalidatePaintIfNe
eded(); |
| 1210 } | 1213 } |
| 1211 | 1214 |
| 1212 void LayoutObject::adjustInvalidationRectForCompositedScrolling(LayoutRect& rect
, const LayoutBoxModelObject& paintInvalidationContainer) const | 1215 void LayoutObject::adjustInvalidationRectForCompositedScrolling(LayoutRect& rect
, const LayoutBoxModelObject& paintInvalidationContainer) const |
| 1213 { | 1216 { |
| 1214 if (compositedScrollsWithRespectTo(paintInvalidationContainer)) { | 1217 if (compositedScrollsWithRespectTo(paintInvalidationContainer)) { |
| 1215 LayoutSize offset(-toLayoutBox(&paintInvalidationContainer)->scrolledCon
tentOffset()); | 1218 LayoutSize offset(-toLayoutBox(&paintInvalidationContainer)->scrolledCon
tentOffset()); |
| 1216 rect.move(offset); | 1219 rect.move(offset); |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1553 } | 1556 } |
| 1554 | 1557 |
| 1555 void LayoutObject::setNeedsOverflowRecalcAfterStyleChange() | 1558 void LayoutObject::setNeedsOverflowRecalcAfterStyleChange() |
| 1556 { | 1559 { |
| 1557 bool neededRecalc = needsOverflowRecalcAfterStyleChange(); | 1560 bool neededRecalc = needsOverflowRecalcAfterStyleChange(); |
| 1558 setSelfNeedsOverflowRecalcAfterStyleChange(); | 1561 setSelfNeedsOverflowRecalcAfterStyleChange(); |
| 1559 if (!neededRecalc) | 1562 if (!neededRecalc) |
| 1560 markAncestorsForOverflowRecalcIfNeeded(); | 1563 markAncestorsForOverflowRecalcIfNeeded(); |
| 1561 } | 1564 } |
| 1562 | 1565 |
| 1566 DISABLE_CFI_PERF |
| 1563 void LayoutObject::setStyle(PassRefPtr<ComputedStyle> style) | 1567 void LayoutObject::setStyle(PassRefPtr<ComputedStyle> style) |
| 1564 { | 1568 { |
| 1565 ASSERT(style); | 1569 ASSERT(style); |
| 1566 | 1570 |
| 1567 if (m_style == style) { | 1571 if (m_style == style) { |
| 1568 // We need to run through adjustStyleDifference() for iframes, plugins,
and canvas so | 1572 // We need to run through adjustStyleDifference() for iframes, plugins,
and canvas so |
| 1569 // style sharing is disabled for them. That should ensure that we never
hit this code path. | 1573 // style sharing is disabled for them. That should ensure that we never
hit this code path. |
| 1570 ASSERT(!isLayoutIFrame() && !isEmbeddedObject() && !isCanvas()); | 1574 ASSERT(!isLayoutIFrame() && !isEmbeddedObject() && !isCanvas()); |
| 1571 return; | 1575 return; |
| 1572 } | 1576 } |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2397 m_style->boxReflect()->mask().image()->removeClient(this); | 2401 m_style->boxReflect()->mask().image()->removeClient(this); |
| 2398 | 2402 |
| 2399 removeShapeImageClient(m_style->shapeOutside()); | 2403 removeShapeImageClient(m_style->shapeOutside()); |
| 2400 removeCursorImageClient(m_style->cursors()); | 2404 removeCursorImageClient(m_style->cursors()); |
| 2401 } | 2405 } |
| 2402 | 2406 |
| 2403 if (frameView()) | 2407 if (frameView()) |
| 2404 setIsBackgroundAttachmentFixedObject(false); | 2408 setIsBackgroundAttachmentFixedObject(false); |
| 2405 } | 2409 } |
| 2406 | 2410 |
| 2411 DISABLE_CFI_PERF |
| 2407 void LayoutObject::insertedIntoTree() | 2412 void LayoutObject::insertedIntoTree() |
| 2408 { | 2413 { |
| 2409 // FIXME: We should ASSERT(isRooted()) here but generated content makes some
out-of-order insertion. | 2414 // FIXME: We should ASSERT(isRooted()) here but generated content makes some
out-of-order insertion. |
| 2410 | 2415 |
| 2411 // Keep our layer hierarchy updated. Optimize for the common case where we d
on't have any children | 2416 // Keep our layer hierarchy updated. Optimize for the common case where we d
on't have any children |
| 2412 // and don't have a layer attached to ourselves. | 2417 // and don't have a layer attached to ourselves. |
| 2413 PaintLayer* layer = nullptr; | 2418 PaintLayer* layer = nullptr; |
| 2414 if (slowFirstChild() || hasLayer()) { | 2419 if (slowFirstChild() || hasLayer()) { |
| 2415 layer = parent()->enclosingLayer(); | 2420 layer = parent()->enclosingLayer(); |
| 2416 addLayers(layer); | 2421 addLayers(layer); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2569 | 2574 |
| 2570 // WARNING: |this| is deleted here. | 2575 // WARNING: |this| is deleted here. |
| 2571 } | 2576 } |
| 2572 | 2577 |
| 2573 void LayoutObject::destroy() | 2578 void LayoutObject::destroy() |
| 2574 { | 2579 { |
| 2575 willBeDestroyed(); | 2580 willBeDestroyed(); |
| 2576 delete this; | 2581 delete this; |
| 2577 } | 2582 } |
| 2578 | 2583 |
| 2584 DISABLE_CFI_PERF |
| 2579 void LayoutObject::removeShapeImageClient(ShapeValue* shapeValue) | 2585 void LayoutObject::removeShapeImageClient(ShapeValue* shapeValue) |
| 2580 { | 2586 { |
| 2581 if (!shapeValue) | 2587 if (!shapeValue) |
| 2582 return; | 2588 return; |
| 2583 if (StyleImage* shapeImage = shapeValue->image()) | 2589 if (StyleImage* shapeImage = shapeValue->image()) |
| 2584 shapeImage->removeClient(this); | 2590 shapeImage->removeClient(this); |
| 2585 } | 2591 } |
| 2586 | 2592 |
| 2587 void LayoutObject::removeCursorImageClient(const CursorList* cursorList) | 2593 void LayoutObject::removeCursorImageClient(const CursorList* cursorList) |
| 2588 { | 2594 { |
| (...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3269 const blink::LayoutObject* root = object1; | 3275 const blink::LayoutObject* root = object1; |
| 3270 while (root->parent()) | 3276 while (root->parent()) |
| 3271 root = root->parent(); | 3277 root = root->parent(); |
| 3272 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3278 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3273 } else { | 3279 } else { |
| 3274 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3280 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
| 3275 } | 3281 } |
| 3276 } | 3282 } |
| 3277 | 3283 |
| 3278 #endif | 3284 #endif |
| OLD | NEW |