Chromium Code Reviews| 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 2653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2664 } | 2664 } |
| 2665 | 2665 |
| 2666 if (isOutOfFlowPositioned() && parent()->childrenInline()) | 2666 if (isOutOfFlowPositioned() && parent()->childrenInline()) |
| 2667 parent()->dirtyLinesFromChangedChild(this); | 2667 parent()->dirtyLinesFromChangedChild(this); |
| 2668 | 2668 |
| 2669 removeFromLayoutFlowThread(); | 2669 removeFromLayoutFlowThread(); |
| 2670 | 2670 |
| 2671 // Update cached boundaries in SVG layoutObjects if a child is removed. | 2671 // Update cached boundaries in SVG layoutObjects if a child is removed. |
| 2672 if (parent()->isSVG()) | 2672 if (parent()->isSVG()) |
| 2673 parent()->setNeedsBoundariesUpdate(); | 2673 parent()->setNeedsBoundariesUpdate(); |
| 2674 | |
| 2675 clearScrollAnchorIfNeeded(); | |
| 2676 } | |
| 2677 | |
| 2678 void LayoutObject::clearScrollAnchorIfNeeded() const | |
| 2679 { | |
| 2680 if (!scrollAnchoringEnabled()) | |
| 2681 return; | |
| 2682 | |
| 2683 PaintLayer* layer = parent()->enclosingLayer(); | |
| 2684 | |
| 2685 // Walk up the layer tree to clear any scroll anchors that reference us. | |
| 2686 // TODO(skobes): Should this be a hash lookup or a data member instead? | |
|
ojan
2016/02/03 01:23:43
I was hoping this TODO would explicitly point out
| |
| 2687 while (layer) { | |
| 2688 if (PaintLayerScrollableArea* scrollableArea = layer->scrollableArea()) { | |
| 2689 ScrollAnchor& anchor = scrollableArea->scrollAnchor(); | |
| 2690 if (anchor.anchorObject() == this) | |
| 2691 anchor.clear(); | |
| 2692 } | |
| 2693 layer = layer->parent(); | |
| 2694 } | |
| 2695 if (FrameView* view = frameView()) { | |
| 2696 ScrollAnchor& anchor = view->scrollAnchor(); | |
| 2697 if (anchor.anchorObject() == this) | |
| 2698 anchor.clear(); | |
| 2699 } | |
| 2674 } | 2700 } |
| 2675 | 2701 |
| 2676 void LayoutObject::removeFromLayoutFlowThread() | 2702 void LayoutObject::removeFromLayoutFlowThread() |
| 2677 { | 2703 { |
| 2678 if (!isInsideFlowThread()) | 2704 if (!isInsideFlowThread()) |
| 2679 return; | 2705 return; |
| 2680 | 2706 |
| 2681 // Sometimes we remove the element from the flow, but it's not destroyed at that time. | 2707 // Sometimes we remove the element from the flow, but it's not destroyed at that time. |
| 2682 // It's only until later when we actually destroy it and remove all the chil dren from it. | 2708 // It's only until later when we actually destroy it and remove all the chil dren from it. |
| 2683 // Currently, that happens for firstLetter elements and list markers. | 2709 // Currently, that happens for firstLetter elements and list markers. |
| (...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3530 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 3556 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
| 3531 objectPaintPropertiesMap().set(this, paintProperties); | 3557 objectPaintPropertiesMap().set(this, paintProperties); |
| 3532 } | 3558 } |
| 3533 | 3559 |
| 3534 void LayoutObject::clearObjectPaintProperties() | 3560 void LayoutObject::clearObjectPaintProperties() |
| 3535 { | 3561 { |
| 3536 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 3562 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
| 3537 objectPaintPropertiesMap().remove(this); | 3563 objectPaintPropertiesMap().remove(this); |
| 3538 } | 3564 } |
| 3539 | 3565 |
| 3566 bool LayoutObject::scrollAnchoringEnabled() const | |
| 3567 { | |
| 3568 if (Settings* settings = document().settings()) | |
| 3569 return settings->scrollAnchoringEnabled(); | |
| 3570 return false; | |
| 3571 } | |
| 3572 | |
| 3540 } // namespace blink | 3573 } // namespace blink |
| 3541 | 3574 |
| 3542 #ifndef NDEBUG | 3575 #ifndef NDEBUG |
| 3543 | 3576 |
| 3544 void showTree(const blink::LayoutObject* object) | 3577 void showTree(const blink::LayoutObject* object) |
| 3545 { | 3578 { |
| 3546 if (object) | 3579 if (object) |
| 3547 object->showTreeForThis(); | 3580 object->showTreeForThis(); |
| 3548 else | 3581 else |
| 3549 fprintf(stderr, "Cannot showTree. Root is (nil)\n"); | 3582 fprintf(stderr, "Cannot showTree. Root is (nil)\n"); |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 3568 const blink::LayoutObject* root = object1; | 3601 const blink::LayoutObject* root = object1; |
| 3569 while (root->parent()) | 3602 while (root->parent()) |
| 3570 root = root->parent(); | 3603 root = root->parent(); |
| 3571 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3604 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3572 } else { | 3605 } else { |
| 3573 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3606 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
| 3574 } | 3607 } |
| 3575 } | 3608 } |
| 3576 | 3609 |
| 3577 #endif | 3610 #endif |
| OLD | NEW |