| 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.
All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
| 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 m_widthAvailableToChildrenChanged |= oldStyle && diff.needsFullLayout() && n
eedsLayout() && borderOrPaddingLogicalDimensionChanged(*oldStyle, newStyle, Logi
calWidth); | 358 m_widthAvailableToChildrenChanged |= oldStyle && diff.needsFullLayout() && n
eedsLayout() && borderOrPaddingLogicalDimensionChanged(*oldStyle, newStyle, Logi
calWidth); |
| 359 m_heightAvailableToChildrenChanged |= oldStyle && diff.needsFullLayout() &&
needsLayout() && borderOrPaddingLogicalDimensionChanged(*oldStyle, newStyle, Log
icalHeight); | 359 m_heightAvailableToChildrenChanged |= oldStyle && diff.needsFullLayout() &&
needsLayout() && borderOrPaddingLogicalDimensionChanged(*oldStyle, newStyle, Log
icalHeight); |
| 360 } | 360 } |
| 361 | 361 |
| 362 void LayoutBlock::updateFromStyle() | 362 void LayoutBlock::updateFromStyle() |
| 363 { | 363 { |
| 364 LayoutBox::updateFromStyle(); | 364 LayoutBox::updateFromStyle(); |
| 365 | 365 |
| 366 bool shouldClipOverflow = !styleRef().isOverflowVisible() && allowsOverflowC
lip(); | 366 bool shouldClipOverflow = !styleRef().isOverflowVisible() && allowsOverflowC
lip(); |
| 367 if (shouldClipOverflow != hasOverflowClip()) { | 367 if (shouldClipOverflow != hasOverflowClip()) { |
| 368 if (!shouldClipOverflow) | |
| 369 getScrollableArea()->invalidateAllStickyConstraints(); | |
| 370 | |
| 371 // FIXME: This shouldn't be required if we tracked the visual overflow | 368 // FIXME: This shouldn't be required if we tracked the visual overflow |
| 372 // generated by positioned children or self painting layers. crbug.com/3
45403 | 369 // generated by positioned children or self painting layers. crbug.com/3
45403 |
| 373 for (LayoutObject* child = firstChild(); child; child = child->nextSibli
ng()) | 370 for (LayoutObject* child = firstChild(); child; child = child->nextSibli
ng()) |
| 374 child->setMayNeedPaintInvalidation(); | 371 child->setMayNeedPaintInvalidation(); |
| 375 } | 372 } |
| 376 setHasOverflowClip(shouldClipOverflow); | 373 setHasOverflowClip(shouldClipOverflow); |
| 377 } | 374 } |
| 378 | 375 |
| 379 bool LayoutBlock::allowsOverflowClip() const | 376 bool LayoutBlock::allowsOverflowClip() const |
| 380 { | 377 { |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 876 | 873 |
| 877 for (auto* block : *infoSet) { | 874 for (auto* block : *infoSet) { |
| 878 if (block->hasOverflowClip()) { | 875 if (block->hasOverflowClip()) { |
| 879 childrenMarkedForRelayout |= block->layer()->getScrollableArea()
->updateAfterLayout(layoutScope); | 876 childrenMarkedForRelayout |= block->layer()->getScrollableArea()
->updateAfterLayout(layoutScope); |
| 880 } | 877 } |
| 881 } | 878 } |
| 882 } | 879 } |
| 883 return childrenMarkedForRelayout; | 880 return childrenMarkedForRelayout; |
| 884 } | 881 } |
| 885 | 882 |
| 886 void LayoutBlock::updateAfterLayout() | 883 void LayoutBlock::updateScrollInfoAfterLayout() |
| 887 { | 884 { |
| 888 invalidateStickyConstraints(); | |
| 889 | |
| 890 // Update our scroll information if we're overflow:auto/scroll/hidden now th
at we know if | |
| 891 // we overflow or not. | |
| 892 if (hasOverflowClip()) { | 885 if (hasOverflowClip()) { |
| 893 if (style()->isFlippedBlocksWritingMode()) { | 886 if (style()->isFlippedBlocksWritingMode()) { |
| 894 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=97937 | 887 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=97937 |
| 895 // Workaround for now. We cannot delay the scroll info for overflow | 888 // Workaround for now. We cannot delay the scroll info for overflow |
| 896 // for items with opposite writing directions, as the contents needs | 889 // for items with opposite writing directions, as the contents needs |
| 897 // to overflow in that direction | 890 // to overflow in that direction |
| 898 layer()->getScrollableArea()->updateAfterLayout(); | 891 layer()->getScrollableArea()->updateAfterLayout(); |
| 899 return; | 892 return; |
| 900 } | 893 } |
| 901 | 894 |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 // For now just always recompute overflow. This is no worse performance-
wise than the old code that called rightmostPosition and | 1117 // For now just always recompute overflow. This is no worse performance-
wise than the old code that called rightmostPosition and |
| 1125 // lowestPosition on every relayout so it's not a regression. | 1118 // lowestPosition on every relayout so it's not a regression. |
| 1126 // computeOverflow expects the bottom edge before we clamp our height. S
ince this information isn't available during | 1119 // computeOverflow expects the bottom edge before we clamp our height. S
ince this information isn't available during |
| 1127 // simplifiedLayout, we cache the value in m_overflow. | 1120 // simplifiedLayout, we cache the value in m_overflow. |
| 1128 LayoutUnit oldClientAfterEdge = hasOverflowModel() ? m_overflow->layoutC
lientAfterEdge() : clientLogicalBottom(); | 1121 LayoutUnit oldClientAfterEdge = hasOverflowModel() ? m_overflow->layoutC
lientAfterEdge() : clientLogicalBottom(); |
| 1129 computeOverflow(oldClientAfterEdge, true); | 1122 computeOverflow(oldClientAfterEdge, true); |
| 1130 } | 1123 } |
| 1131 | 1124 |
| 1132 updateLayerTransformAfterLayout(); | 1125 updateLayerTransformAfterLayout(); |
| 1133 | 1126 |
| 1134 updateAfterLayout(); | 1127 updateScrollInfoAfterLayout(); |
| 1135 | 1128 |
| 1136 clearNeedsLayout(); | 1129 clearNeedsLayout(); |
| 1137 | 1130 |
| 1138 if (LayoutAnalyzer* analyzer = frameView()->layoutAnalyzer()) | 1131 if (LayoutAnalyzer* analyzer = frameView()->layoutAnalyzer()) |
| 1139 analyzer->increment(LayoutAnalyzer::LayoutObjectsThatNeedSimplifiedLayou
t); | 1132 analyzer->increment(LayoutAnalyzer::LayoutObjectsThatNeedSimplifiedLayou
t); |
| 1140 | 1133 |
| 1141 return true; | 1134 return true; |
| 1142 } | 1135 } |
| 1143 | 1136 |
| 1144 void LayoutBlock::markFixedPositionObjectForLayoutIfNeeded(LayoutObject* child,
SubtreeLayoutScope& layoutScope) | 1137 void LayoutBlock::markFixedPositionObjectForLayoutIfNeeded(LayoutObject* child,
SubtreeLayoutScope& layoutScope) |
| (...skipping 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2873 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout
Object* obj) const | 2866 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout
Object* obj) const |
| 2874 { | 2867 { |
| 2875 showLayoutObject(); | 2868 showLayoutObject(); |
| 2876 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) | 2869 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) |
| 2877 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); | 2870 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); |
| 2878 } | 2871 } |
| 2879 | 2872 |
| 2880 #endif | 2873 #endif |
| 2881 | 2874 |
| 2882 } // namespace blink | 2875 } // namespace blink |
| OLD | NEW |