Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlock.cpp

Issue 2293293003: Make CaretBase a DisplayItemClient. (Closed)
Patch Set: Fix unit test and disable failing test on SPv2. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
229 void LayoutBlock::updateFromStyle() 238 void LayoutBlock::updateFromStyle()
230 { 239 {
231 LayoutBox::updateFromStyle(); 240 LayoutBox::updateFromStyle();
232 241
233 bool shouldClipOverflow = !styleRef().isOverflowVisible() && allowsOverflowC lip(); 242 bool shouldClipOverflow = !styleRef().isOverflowVisible() && allowsOverflowC lip();
234 if (shouldClipOverflow != hasOverflowClip()) { 243 if (shouldClipOverflow != hasOverflowClip()) {
235 if (!shouldClipOverflow) 244 if (!shouldClipOverflow)
236 getScrollableArea()->invalidateAllStickyConstraints(); 245 getScrollableArea()->invalidateAllStickyConstraints();
237 setMayNeedPaintInvalidationSubtree(); 246 setMayNeedPaintInvalidationSubtree();
238 } 247 }
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 927
919 TrackedLayoutBoxListHashSet* positionedDescendants = gPositionedDescendantsM ap->get(container); 928 TrackedLayoutBoxListHashSet* positionedDescendants = gPositionedDescendantsM ap->get(container);
920 ASSERT(positionedDescendants && positionedDescendants->contains(o)); 929 ASSERT(positionedDescendants && positionedDescendants->contains(o));
921 positionedDescendants->remove(o); 930 positionedDescendants->remove(o);
922 if (positionedDescendants->isEmpty()) { 931 if (positionedDescendants->isEmpty()) {
923 gPositionedDescendantsMap->remove(container); 932 gPositionedDescendantsMap->remove(container);
924 container->m_hasPositionedObjects = false; 933 container->m_hasPositionedObjects = false;
925 } 934 }
926 } 935 }
927 936
937 PaintInvalidationReason LayoutBlock::invalidatePaintIfNeeded(const PaintInvalida tionState& paintInvalidationState)
938 {
939 PaintInvalidationReason reason = LayoutBox::invalidatePaintIfNeeded(paintInv alidationState);
940 if (reason != PaintInvalidationNone)
941 invalidateCaret();
942 return reason;
943 }
944
928 void LayoutBlock::removePositionedObjects(LayoutBlock* o, ContainingBlockState c ontainingBlockState) 945 void LayoutBlock::removePositionedObjects(LayoutBlock* o, ContainingBlockState c ontainingBlockState)
929 { 946 {
930 TrackedLayoutBoxListHashSet* positionedDescendants = positionedObjects(); 947 TrackedLayoutBoxListHashSet* positionedDescendants = positionedObjects();
931 if (!positionedDescendants) 948 if (!positionedDescendants)
932 return; 949 return;
933 950
934 Vector<LayoutBox*, 16> deadObjects; 951 Vector<LayoutBox*, 16> deadObjects;
935 for (auto* positionedObject : *positionedDescendants) { 952 for (auto* positionedObject : *positionedDescendants) {
936 if (!o || (positionedObject->isDescendantOf(o) && o != positionedObject) ) { 953 if (!o || (positionedObject->isDescendantOf(o) && o != positionedObject) ) {
937 if (containingBlockState == NewContainingBlock) { 954 if (containingBlockState == NewContainingBlock) {
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
1931 1948
1932 return availableHeight; 1949 return availableHeight;
1933 } 1950 }
1934 1951
1935 bool LayoutBlock::hasDefiniteLogicalHeight() const 1952 bool LayoutBlock::hasDefiniteLogicalHeight() const
1936 { 1953 {
1937 return availableLogicalHeightForPercentageComputation() != LayoutUnit(-1); 1954 return availableLogicalHeightForPercentageComputation() != LayoutUnit(-1);
1938 } 1955 }
1939 1956
1940 } // namespace blink 1957 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.h ('k') | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698