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

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

Issue 2306813004: Inline LayoutBlock::invalidateCaret and remove redundant needs-repaint on layer. (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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
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
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 ObjectPaintInvalidator(*this).slowSetPaintingLayerNeedsRepaint();
chrishtr 2016/09/02 21:26:53 On reflection I don't think we need line 932. If p
wkorman 2016/09/02 23:17:36 Done.
933 frame()->selection().setCaretRectNeedsUpdate();
934 frame()->selection().invalidateCaretRect(true);
935 }
942 return reason; 936 return reason;
943 } 937 }
944 938
945 void LayoutBlock::removePositionedObjects(LayoutBlock* o, ContainingBlockState c ontainingBlockState) 939 void LayoutBlock::removePositionedObjects(LayoutBlock* o, ContainingBlockState c ontainingBlockState)
946 { 940 {
947 TrackedLayoutBoxListHashSet* positionedDescendants = positionedObjects(); 941 TrackedLayoutBoxListHashSet* positionedDescendants = positionedObjects();
948 if (!positionedDescendants) 942 if (!positionedDescendants)
949 return; 943 return;
950 944
951 Vector<LayoutBox*, 16> deadObjects; 945 Vector<LayoutBox*, 16> deadObjects;
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after
1948 1942
1949 return availableHeight; 1943 return availableHeight;
1950 } 1944 }
1951 1945
1952 bool LayoutBlock::hasDefiniteLogicalHeight() const 1946 bool LayoutBlock::hasDefiniteLogicalHeight() const
1953 { 1947 {
1954 return availableLogicalHeightForPercentageComputation() != LayoutUnit(-1); 1948 return availableLogicalHeightForPercentageComputation() != LayoutUnit(-1);
1955 } 1949 }
1956 1950
1957 } // namespace blink 1951 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698