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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 textAutosizer->record(this); | 219 textAutosizer->record(this); |
220 | 220 |
221 propagateStyleToAnonymousChildren(); | 221 propagateStyleToAnonymousChildren(); |
222 | 222 |
223 // It's possible for our border/padding to change, but for the overall logic
al width or height of the block to | 223 // It's possible for our border/padding to change, but for the overall logic
al width or height of the block to |
224 // end up being the same. We keep track of this change so in layoutBlock, we
can know to set relayoutChildren=true. | 224 // end up being the same. We keep track of this change so in layoutBlock, we
can know to set relayoutChildren=true. |
225 m_widthAvailableToChildrenChanged |= oldStyle && diff.needsFullLayout() && n
eedsLayout() && borderOrPaddingLogicalDimensionChanged(*oldStyle, newStyle, Logi
calWidth); | 225 m_widthAvailableToChildrenChanged |= oldStyle && diff.needsFullLayout() && n
eedsLayout() && borderOrPaddingLogicalDimensionChanged(*oldStyle, newStyle, Logi
calWidth); |
226 m_heightAvailableToChildrenChanged |= oldStyle && diff.needsFullLayout() &&
needsLayout() && borderOrPaddingLogicalDimensionChanged(*oldStyle, newStyle, Log
icalHeight); | 226 m_heightAvailableToChildrenChanged |= oldStyle && diff.needsFullLayout() &&
needsLayout() && borderOrPaddingLogicalDimensionChanged(*oldStyle, newStyle, Log
icalHeight); |
227 } | 227 } |
228 | 228 |
229 void LayoutBlock::invalidateCaret() const | |
230 { | |
231 if (hasCaret()) { | |
232 ObjectPaintInvalidator(*this).slowSetPaintingLayerNeedsRepaint(); | |
233 frame()->selection().setCaretRectNeedsUpdate(); | |
234 frame()->selection().invalidateCaretRect(true); | |
235 } | |
236 } | |
237 | |
238 void LayoutBlock::updateFromStyle() | 229 void LayoutBlock::updateFromStyle() |
239 { | 230 { |
240 LayoutBox::updateFromStyle(); | 231 LayoutBox::updateFromStyle(); |
241 | 232 |
242 bool shouldClipOverflow = !styleRef().isOverflowVisible() && allowsOverflowC
lip(); | 233 bool shouldClipOverflow = !styleRef().isOverflowVisible() && allowsOverflowC
lip(); |
243 if (shouldClipOverflow != hasOverflowClip()) { | 234 if (shouldClipOverflow != hasOverflowClip()) { |
244 if (!shouldClipOverflow) | 235 if (!shouldClipOverflow) |
245 getScrollableArea()->invalidateAllStickyConstraints(); | 236 getScrollableArea()->invalidateAllStickyConstraints(); |
246 setMayNeedPaintInvalidationSubtree(); | 237 setMayNeedPaintInvalidationSubtree(); |
247 } | 238 } |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
930 positionedDescendants->remove(o); | 921 positionedDescendants->remove(o); |
931 if (positionedDescendants->isEmpty()) { | 922 if (positionedDescendants->isEmpty()) { |
932 gPositionedDescendantsMap->remove(container); | 923 gPositionedDescendantsMap->remove(container); |
933 container->m_hasPositionedObjects = false; | 924 container->m_hasPositionedObjects = false; |
934 } | 925 } |
935 } | 926 } |
936 | 927 |
937 PaintInvalidationReason LayoutBlock::invalidatePaintIfNeeded(const PaintInvalida
tionState& paintInvalidationState) | 928 PaintInvalidationReason LayoutBlock::invalidatePaintIfNeeded(const PaintInvalida
tionState& paintInvalidationState) |
938 { | 929 { |
939 PaintInvalidationReason reason = LayoutBox::invalidatePaintIfNeeded(paintInv
alidationState); | 930 PaintInvalidationReason reason = LayoutBox::invalidatePaintIfNeeded(paintInv
alidationState); |
940 if (reason != PaintInvalidationNone) | 931 if (reason != PaintInvalidationNone && hasCaret()) { |
941 invalidateCaret(); | 932 frame()->selection().setCaretRectNeedsUpdate(); |
| 933 frame()->selection().invalidateCaretRect(true); |
| 934 } |
942 return reason; | 935 return reason; |
943 } | 936 } |
944 | 937 |
945 void LayoutBlock::removePositionedObjects(LayoutBlock* o, ContainingBlockState c
ontainingBlockState) | 938 void LayoutBlock::removePositionedObjects(LayoutBlock* o, ContainingBlockState c
ontainingBlockState) |
946 { | 939 { |
947 TrackedLayoutBoxListHashSet* positionedDescendants = positionedObjects(); | 940 TrackedLayoutBoxListHashSet* positionedDescendants = positionedObjects(); |
948 if (!positionedDescendants) | 941 if (!positionedDescendants) |
949 return; | 942 return; |
950 | 943 |
951 Vector<LayoutBox*, 16> deadObjects; | 944 Vector<LayoutBox*, 16> deadObjects; |
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1948 | 1941 |
1949 return availableHeight; | 1942 return availableHeight; |
1950 } | 1943 } |
1951 | 1944 |
1952 bool LayoutBlock::hasDefiniteLogicalHeight() const | 1945 bool LayoutBlock::hasDefiniteLogicalHeight() const |
1953 { | 1946 { |
1954 return availableLogicalHeightForPercentageComputation() != LayoutUnit(-1); | 1947 return availableLogicalHeightForPercentageComputation() != LayoutUnit(-1); |
1955 } | 1948 } |
1956 | 1949 |
1957 } // namespace blink | 1950 } // namespace blink |
OLD | NEW |