| 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 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1306 void LayoutObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInv
alidationState) | 1306 void LayoutObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInv
alidationState) |
| 1307 { | 1307 { |
| 1308 ASSERT(!needsLayout()); | 1308 ASSERT(!needsLayout()); |
| 1309 | 1309 |
| 1310 // If we didn't need paint invalidation then our children don't need as well
. | 1310 // If we didn't need paint invalidation then our children don't need as well
. |
| 1311 // Skip walking down the tree as everything should be fine below us. | 1311 // Skip walking down the tree as everything should be fine below us. |
| 1312 if (!shouldCheckForPaintInvalidation(paintInvalidationState)) | 1312 if (!shouldCheckForPaintInvalidation(paintInvalidationState)) |
| 1313 return; | 1313 return; |
| 1314 | 1314 |
| 1315 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th
is); | 1315 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th
is); |
| 1316 |
| 1317 if (mayNeedPaintInvalidationSubtree()) |
| 1318 newPaintInvalidationState.setForceSubtreeInvalidationCheckingWithinConta
iner(); |
| 1319 |
| 1316 PaintInvalidationReason reason = invalidatePaintIfNeeded(newPaintInvalidatio
nState); | 1320 PaintInvalidationReason reason = invalidatePaintIfNeeded(newPaintInvalidatio
nState); |
| 1317 clearPaintInvalidationFlags(newPaintInvalidationState); | 1321 clearPaintInvalidationFlags(newPaintInvalidationState); |
| 1318 | 1322 |
| 1319 newPaintInvalidationState.updateForChildren(reason); | 1323 newPaintInvalidationState.updateForChildren(reason); |
| 1320 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); | 1324 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); |
| 1321 } | 1325 } |
| 1322 | 1326 |
| 1323 void LayoutObject::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationStat
e& childPaintInvalidationState) | 1327 void LayoutObject::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationStat
e& childPaintInvalidationState) |
| 1324 { | 1328 { |
| 1325 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) { | 1329 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) { |
| (...skipping 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3444 | 3448 |
| 3445 void LayoutObject::setMayNeedPaintInvalidation() | 3449 void LayoutObject::setMayNeedPaintInvalidation() |
| 3446 { | 3450 { |
| 3447 if (mayNeedPaintInvalidation()) | 3451 if (mayNeedPaintInvalidation()) |
| 3448 return; | 3452 return; |
| 3449 m_bitfields.setMayNeedPaintInvalidation(true); | 3453 m_bitfields.setMayNeedPaintInvalidation(true); |
| 3450 markAncestorsForPaintInvalidation(); | 3454 markAncestorsForPaintInvalidation(); |
| 3451 frameView()->scheduleVisualUpdateForPaintInvalidationIfNeeded(); | 3455 frameView()->scheduleVisualUpdateForPaintInvalidationIfNeeded(); |
| 3452 } | 3456 } |
| 3453 | 3457 |
| 3458 void LayoutObject::setMayNeedPaintInvalidationSubtree() |
| 3459 { |
| 3460 if (mayNeedPaintInvalidationSubtree()) |
| 3461 return; |
| 3462 m_bitfields.setMayNeedPaintInvalidationSubtree(true); |
| 3463 setMayNeedPaintInvalidation(); |
| 3464 } |
| 3465 |
| 3454 void LayoutObject::clearPaintInvalidationFlags(const PaintInvalidationState& pai
ntInvalidationState) | 3466 void LayoutObject::clearPaintInvalidationFlags(const PaintInvalidationState& pai
ntInvalidationState) |
| 3455 { | 3467 { |
| 3456 // paintInvalidationStateIsDirty should be kept in sync with the | 3468 // paintInvalidationStateIsDirty should be kept in sync with the |
| 3457 // booleans that are cleared below. | 3469 // booleans that are cleared below. |
| 3458 ASSERT(!shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState()
|| paintInvalidationStateIsDirty()); | 3470 ASSERT(!shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState()
|| paintInvalidationStateIsDirty()); |
| 3459 clearShouldDoFullPaintInvalidation(); | 3471 clearShouldDoFullPaintInvalidation(); |
| 3460 m_bitfields.setChildShouldCheckForPaintInvalidation(false); | 3472 m_bitfields.setChildShouldCheckForPaintInvalidation(false); |
| 3461 m_bitfields.setNeededLayoutBecauseOfChildren(false); | 3473 m_bitfields.setNeededLayoutBecauseOfChildren(false); |
| 3462 m_bitfields.setShouldInvalidateOverflowForPaint(false); | 3474 m_bitfields.setShouldInvalidateOverflowForPaint(false); |
| 3463 m_bitfields.setMayNeedPaintInvalidation(false); | 3475 m_bitfields.setMayNeedPaintInvalidation(false); |
| 3476 m_bitfields.setMayNeedPaintInvalidationSubtree(false); |
| 3464 m_bitfields.setShouldInvalidateSelection(false); | 3477 m_bitfields.setShouldInvalidateSelection(false); |
| 3465 } | 3478 } |
| 3466 | 3479 |
| 3467 bool LayoutObject::isAllowedToModifyLayoutTreeStructure(Document& document) | 3480 bool LayoutObject::isAllowedToModifyLayoutTreeStructure(Document& document) |
| 3468 { | 3481 { |
| 3469 return DeprecatedDisableModifyLayoutTreeStructureAsserts::canModifyLayoutTre
eStateInAnyState() | 3482 return DeprecatedDisableModifyLayoutTreeStructureAsserts::canModifyLayoutTre
eStateInAnyState() |
| 3470 || document.lifecycle().stateAllowsLayoutTreeMutations(); | 3483 || document.lifecycle().stateAllowsLayoutTreeMutations(); |
| 3471 } | 3484 } |
| 3472 | 3485 |
| 3473 DeprecatedDisableModifyLayoutTreeStructureAsserts::DeprecatedDisableModifyLayout
TreeStructureAsserts() | 3486 DeprecatedDisableModifyLayoutTreeStructureAsserts::DeprecatedDisableModifyLayout
TreeStructureAsserts() |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3686 const blink::LayoutObject* root = object1; | 3699 const blink::LayoutObject* root = object1; |
| 3687 while (root->parent()) | 3700 while (root->parent()) |
| 3688 root = root->parent(); | 3701 root = root->parent(); |
| 3689 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3702 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3690 } else { | 3703 } else { |
| 3691 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3704 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
| 3692 } | 3705 } |
| 3693 } | 3706 } |
| 3694 | 3707 |
| 3695 #endif | 3708 #endif |
| OLD | NEW |