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

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

Issue 2312383002: Make CaretBase a DisplayItemClient. (Closed)
Patch Set: 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 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 924
916 TrackedLayoutBoxListHashSet* positionedDescendants = gPositionedDescendantsM ap->get(container); 925 TrackedLayoutBoxListHashSet* positionedDescendants = gPositionedDescendantsM ap->get(container);
917 ASSERT(positionedDescendants && positionedDescendants->contains(o)); 926 ASSERT(positionedDescendants && positionedDescendants->contains(o));
918 positionedDescendants->remove(o); 927 positionedDescendants->remove(o);
919 if (positionedDescendants->isEmpty()) { 928 if (positionedDescendants->isEmpty()) {
920 gPositionedDescendantsMap->remove(container); 929 gPositionedDescendantsMap->remove(container);
921 container->m_hasPositionedObjects = false; 930 container->m_hasPositionedObjects = false;
922 } 931 }
923 } 932 }
924 933
934 PaintInvalidationReason LayoutBlock::invalidatePaintIfNeeded(const PaintInvalida tionState& paintInvalidationState)
935 {
936 PaintInvalidationReason reason = LayoutBox::invalidatePaintIfNeeded(paintInv alidationState);
937 if (reason != PaintInvalidationNone)
938 invalidateCaret();
939 return reason;
940 }
941
925 void LayoutBlock::removePositionedObjects(LayoutBlock* o, ContainingBlockState c ontainingBlockState) 942 void LayoutBlock::removePositionedObjects(LayoutBlock* o, ContainingBlockState c ontainingBlockState)
926 { 943 {
927 TrackedLayoutBoxListHashSet* positionedDescendants = positionedObjects(); 944 TrackedLayoutBoxListHashSet* positionedDescendants = positionedObjects();
928 if (!positionedDescendants) 945 if (!positionedDescendants)
929 return; 946 return;
930 947
931 Vector<LayoutBox*, 16> deadObjects; 948 Vector<LayoutBox*, 16> deadObjects;
932 for (auto* positionedObject : *positionedDescendants) { 949 for (auto* positionedObject : *positionedDescendants) {
933 if (!o || (positionedObject->isDescendantOf(o) && o != positionedObject) ) { 950 if (!o || (positionedObject->isDescendantOf(o) && o != positionedObject) ) {
934 if (containingBlockState == NewContainingBlock) { 951 if (containingBlockState == NewContainingBlock) {
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after
1871 for (TrackedLayoutBoxListHashSet::const_iterator it = positionedDescenda ntSet->begin(); it != end; ++it) { 1888 for (TrackedLayoutBoxListHashSet::const_iterator it = positionedDescenda ntSet->begin(); it != end; ++it) {
1872 LayoutBox* currBox = *it; 1889 LayoutBox* currBox = *it;
1873 ASSERT(!currBox->needsLayout()); 1890 ASSERT(!currBox->needsLayout());
1874 } 1891 }
1875 } 1892 }
1876 } 1893 }
1877 1894
1878 #endif 1895 #endif
1879 1896
1880 } // namespace blink 1897 } // 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