| 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 2121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3447 | 3451 |
| 3448 void LayoutObject::setMayNeedPaintInvalidation() | 3452 void LayoutObject::setMayNeedPaintInvalidation() |
| 3449 { | 3453 { |
| 3450 if (mayNeedPaintInvalidation()) | 3454 if (mayNeedPaintInvalidation()) |
| 3451 return; | 3455 return; |
| 3452 m_bitfields.setMayNeedPaintInvalidation(true); | 3456 m_bitfields.setMayNeedPaintInvalidation(true); |
| 3453 markAncestorsForPaintInvalidation(); | 3457 markAncestorsForPaintInvalidation(); |
| 3454 frameView()->scheduleVisualUpdateForPaintInvalidationIfNeeded(); | 3458 frameView()->scheduleVisualUpdateForPaintInvalidationIfNeeded(); |
| 3455 } | 3459 } |
| 3456 | 3460 |
| 3461 void LayoutObject::setMayNeedPaintInvalidationSubtree() |
| 3462 { |
| 3463 if (mayNeedPaintInvalidationSubtree()) |
| 3464 return; |
| 3465 m_bitfields.setMayNeedPaintInvalidationSubtree(true); |
| 3466 setMayNeedPaintInvalidation(); |
| 3467 } |
| 3468 |
| 3457 void LayoutObject::clearPaintInvalidationFlags(const PaintInvalidationState& pai
ntInvalidationState) | 3469 void LayoutObject::clearPaintInvalidationFlags(const PaintInvalidationState& pai
ntInvalidationState) |
| 3458 { | 3470 { |
| 3459 // paintInvalidationStateIsDirty should be kept in sync with the | 3471 // paintInvalidationStateIsDirty should be kept in sync with the |
| 3460 // booleans that are cleared below. | 3472 // booleans that are cleared below. |
| 3461 ASSERT(!shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState()
|| paintInvalidationStateIsDirty()); | 3473 ASSERT(!shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState()
|| paintInvalidationStateIsDirty()); |
| 3462 clearShouldDoFullPaintInvalidation(); | 3474 clearShouldDoFullPaintInvalidation(); |
| 3463 m_bitfields.setChildShouldCheckForPaintInvalidation(false); | 3475 m_bitfields.setChildShouldCheckForPaintInvalidation(false); |
| 3464 m_bitfields.setNeededLayoutBecauseOfChildren(false); | 3476 m_bitfields.setNeededLayoutBecauseOfChildren(false); |
| 3465 m_bitfields.setShouldInvalidateOverflowForPaint(false); | 3477 m_bitfields.setShouldInvalidateOverflowForPaint(false); |
| 3466 m_bitfields.setMayNeedPaintInvalidation(false); | 3478 m_bitfields.setMayNeedPaintInvalidation(false); |
| 3479 m_bitfields.setMayNeedPaintInvalidationSubtree(false); |
| 3467 m_bitfields.setShouldInvalidateSelection(false); | 3480 m_bitfields.setShouldInvalidateSelection(false); |
| 3468 } | 3481 } |
| 3469 | 3482 |
| 3470 bool LayoutObject::isAllowedToModifyLayoutTreeStructure(Document& document) | 3483 bool LayoutObject::isAllowedToModifyLayoutTreeStructure(Document& document) |
| 3471 { | 3484 { |
| 3472 return DeprecatedDisableModifyLayoutTreeStructureAsserts::canModifyLayoutTre
eStateInAnyState() | 3485 return DeprecatedDisableModifyLayoutTreeStructureAsserts::canModifyLayoutTre
eStateInAnyState() |
| 3473 || document.lifecycle().stateAllowsLayoutTreeMutations(); | 3486 || document.lifecycle().stateAllowsLayoutTreeMutations(); |
| 3474 } | 3487 } |
| 3475 | 3488 |
| 3476 DeprecatedDisableModifyLayoutTreeStructureAsserts::DeprecatedDisableModifyLayout
TreeStructureAsserts() | 3489 DeprecatedDisableModifyLayoutTreeStructureAsserts::DeprecatedDisableModifyLayout
TreeStructureAsserts() |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3689 const blink::LayoutObject* root = object1; | 3702 const blink::LayoutObject* root = object1; |
| 3690 while (root->parent()) | 3703 while (root->parent()) |
| 3691 root = root->parent(); | 3704 root = root->parent(); |
| 3692 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3705 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3693 } else { | 3706 } else { |
| 3694 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3707 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
| 3695 } | 3708 } |
| 3696 } | 3709 } |
| 3697 | 3710 |
| 3698 #endif | 3711 #endif |
| OLD | NEW |