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) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
6 * All rights reserved. | 6 * All rights reserved. |
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 7 * Copyright (C) Research In Motion Limited 2010. 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 // Now remove the leftover anonymous block from the tree, and destroy it. | 404 // Now remove the leftover anonymous block from the tree, and destroy it. |
405 // We'll rip it out manually from the tree before destroying it, because we | 405 // We'll rip it out manually from the tree before destroying it, because we |
406 // don't want to trigger any tree adjustments with regards to anonymous blocks | 406 // don't want to trigger any tree adjustments with regards to anonymous blocks |
407 // (or any other kind of undesired chain-reaction). | 407 // (or any other kind of undesired chain-reaction). |
408 Children()->RemoveChildNode(this, child, false); | 408 Children()->RemoveChildNode(this, child, false); |
409 child->Destroy(); | 409 child->Destroy(); |
410 } | 410 } |
411 | 411 |
412 void LayoutBlock::UpdateAfterLayout() { | 412 void LayoutBlock::UpdateAfterLayout() { |
413 InvalidateStickyConstraints(); | 413 InvalidateStickyConstraints(); |
414 | 414 LayoutBox::UpdateAfterLayout(); |
415 // Update our scroll information if we're overflow:auto/scroll/hidden now that | |
416 // we know if we overflow or not. | |
417 if (HasOverflowClip()) | |
418 Layer()->GetScrollableArea()->UpdateAfterLayout(); | |
419 } | 415 } |
420 | 416 |
421 void LayoutBlock::UpdateLayout() { | 417 void LayoutBlock::UpdateLayout() { |
422 DCHECK(!GetScrollableArea() || GetScrollableArea()->GetScrollAnchor()); | 418 DCHECK(!GetScrollableArea() || GetScrollableArea()->GetScrollAnchor()); |
423 | 419 |
424 LayoutAnalyzer::Scope analyzer(*this); | 420 LayoutAnalyzer::Scope analyzer(*this); |
425 | 421 |
426 bool needs_scroll_anchoring = | 422 bool needs_scroll_anchoring = |
427 HasOverflowClip() && GetScrollableArea()->ShouldPerformScrollAnchoring(); | 423 HasOverflowClip() && GetScrollableArea()->ShouldPerformScrollAnchoring(); |
428 if (needs_scroll_anchoring) | 424 if (needs_scroll_anchoring) |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 // than the old code that called rightmostPosition and lowestPosition on | 679 // than the old code that called rightmostPosition and lowestPosition on |
684 // every relayout so it's not a regression. computeOverflow expects the | 680 // every relayout so it's not a regression. computeOverflow expects the |
685 // bottom edge before we clamp our height. Since this information isn't | 681 // bottom edge before we clamp our height. Since this information isn't |
686 // available during simplifiedLayout, we cache the value in m_overflow. | 682 // available during simplifiedLayout, we cache the value in m_overflow. |
687 LayoutUnit old_client_after_edge = HasOverflowModel() | 683 LayoutUnit old_client_after_edge = HasOverflowModel() |
688 ? overflow_->LayoutClientAfterEdge() | 684 ? overflow_->LayoutClientAfterEdge() |
689 : ClientLogicalBottom(); | 685 : ClientLogicalBottom(); |
690 ComputeOverflow(old_client_after_edge, true); | 686 ComputeOverflow(old_client_after_edge, true); |
691 } | 687 } |
692 | 688 |
693 UpdateLayerTransformAfterLayout(); | |
694 | |
695 UpdateAfterLayout(); | 689 UpdateAfterLayout(); |
696 | 690 |
697 ClearNeedsLayout(); | 691 ClearNeedsLayout(); |
698 | 692 |
699 if (LayoutAnalyzer* analyzer = GetFrameView()->GetLayoutAnalyzer()) | 693 if (LayoutAnalyzer* analyzer = GetFrameView()->GetLayoutAnalyzer()) |
700 analyzer->Increment(LayoutAnalyzer::kLayoutObjectsThatNeedSimplifiedLayout); | 694 analyzer->Increment(LayoutAnalyzer::kLayoutObjectsThatNeedSimplifiedLayout); |
701 | 695 |
702 return true; | 696 return true; |
703 } | 697 } |
704 | 698 |
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2206 bool LayoutBlock::HasDefiniteLogicalHeight() const { | 2200 bool LayoutBlock::HasDefiniteLogicalHeight() const { |
2207 return AvailableLogicalHeightForPercentageComputation() != LayoutUnit(-1); | 2201 return AvailableLogicalHeightForPercentageComputation() != LayoutUnit(-1); |
2208 } | 2202 } |
2209 | 2203 |
2210 bool LayoutBlock::NeedsPreferredWidthsRecalculation() const { | 2204 bool LayoutBlock::NeedsPreferredWidthsRecalculation() const { |
2211 return (HasRelativeLogicalHeight() && Style()->LogicalWidth().IsAuto()) || | 2205 return (HasRelativeLogicalHeight() && Style()->LogicalWidth().IsAuto()) || |
2212 LayoutBox::NeedsPreferredWidthsRecalculation(); | 2206 LayoutBox::NeedsPreferredWidthsRecalculation(); |
2213 } | 2207 } |
2214 | 2208 |
2215 } // namespace blink | 2209 } // namespace blink |
OLD | NEW |