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 2031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2042 return children_overflow_changed; | 2042 return children_overflow_changed; |
2043 } | 2043 } |
2044 | 2044 |
2045 bool LayoutBlock::RecalcOverflowAfterStyleChange() { | 2045 bool LayoutBlock::RecalcOverflowAfterStyleChange() { |
2046 DCHECK(NeedsOverflowRecalcAfterStyleChange()); | 2046 DCHECK(NeedsOverflowRecalcAfterStyleChange()); |
2047 | 2047 |
2048 bool children_overflow_changed = false; | 2048 bool children_overflow_changed = false; |
2049 if (ChildNeedsOverflowRecalcAfterStyleChange()) | 2049 if (ChildNeedsOverflowRecalcAfterStyleChange()) |
2050 children_overflow_changed = RecalcChildOverflowAfterStyleChange(); | 2050 children_overflow_changed = RecalcChildOverflowAfterStyleChange(); |
2051 | 2051 |
2052 if (!SelfNeedsOverflowRecalcAfterStyleChange() && !children_overflow_changed) | 2052 bool self_needs_overflow_recalc = SelfNeedsOverflowRecalcAfterStyleChange(); |
| 2053 if (!self_needs_overflow_recalc && !children_overflow_changed) |
2053 return false; | 2054 return false; |
2054 | 2055 |
2055 ClearSelfNeedsOverflowRecalcAfterStyleChange(); | 2056 ClearSelfNeedsOverflowRecalcAfterStyleChange(); |
2056 // If the current block needs layout, overflow will be recalculated during | 2057 // If the current block needs layout, overflow will be recalculated during |
2057 // layout time anyway. We can safely exit here. | 2058 // layout time anyway. We can safely exit here. |
2058 if (NeedsLayout()) | 2059 if (NeedsLayout()) |
2059 return false; | 2060 return false; |
2060 | 2061 |
2061 LayoutUnit old_client_after_edge = HasOverflowModel() | 2062 LayoutUnit old_client_after_edge = HasOverflowModel() |
2062 ? overflow_->LayoutClientAfterEdge() | 2063 ? overflow_->LayoutClientAfterEdge() |
2063 : ClientLogicalBottom(); | 2064 : ClientLogicalBottom(); |
2064 ComputeOverflow(old_client_after_edge, true); | 2065 ComputeOverflow(old_client_after_edge, true); |
2065 | 2066 |
2066 if (HasOverflowClip()) | 2067 if (HasOverflowClip()) |
2067 Layer()->GetScrollableArea()->UpdateAfterOverflowRecalc(); | 2068 Layer()->GetScrollableArea()->UpdateAfterOverflowRecalc(); |
2068 | 2069 |
2069 return !HasOverflowClip(); | 2070 return !HasOverflowClip() || self_needs_overflow_recalc; |
2070 } | 2071 } |
2071 | 2072 |
2072 // Called when a positioned object moves but doesn't necessarily change size. | 2073 // Called when a positioned object moves but doesn't necessarily change size. |
2073 // A simplified layout is attempted that just updates the object's position. | 2074 // A simplified layout is attempted that just updates the object's position. |
2074 // If the size does change, the object remains dirty. | 2075 // If the size does change, the object remains dirty. |
2075 bool LayoutBlock::TryLayoutDoingPositionedMovementOnly() { | 2076 bool LayoutBlock::TryLayoutDoingPositionedMovementOnly() { |
2076 LayoutUnit old_width = LogicalWidth(); | 2077 LayoutUnit old_width = LogicalWidth(); |
2077 LogicalExtentComputedValues computed_values; | 2078 LogicalExtentComputedValues computed_values; |
2078 LogicalExtentAfterUpdatingLogicalWidth(LogicalTop(), computed_values); | 2079 LogicalExtentAfterUpdatingLogicalWidth(LogicalTop(), computed_values); |
2079 // If we shrink to fit our width may have changed, so we still need full | 2080 // If we shrink to fit our width may have changed, so we still need full |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2195 bool LayoutBlock::HasDefiniteLogicalHeight() const { | 2196 bool LayoutBlock::HasDefiniteLogicalHeight() const { |
2196 return AvailableLogicalHeightForPercentageComputation() != LayoutUnit(-1); | 2197 return AvailableLogicalHeightForPercentageComputation() != LayoutUnit(-1); |
2197 } | 2198 } |
2198 | 2199 |
2199 bool LayoutBlock::NeedsPreferredWidthsRecalculation() const { | 2200 bool LayoutBlock::NeedsPreferredWidthsRecalculation() const { |
2200 return (HasRelativeLogicalHeight() && Style()->LogicalWidth().IsAuto()) || | 2201 return (HasRelativeLogicalHeight() && Style()->LogicalWidth().IsAuto()) || |
2201 LayoutBox::NeedsPreferredWidthsRecalculation(); | 2202 LayoutBox::NeedsPreferredWidthsRecalculation(); |
2202 } | 2203 } |
2203 | 2204 |
2204 } // namespace blink | 2205 } // namespace blink |
OLD | NEW |