Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| index f416e668c67ffe4f37794a691c548b49dd79aa5d..a5aa20c3bab26ab7af3ac419f99c1a1d231af3d2 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| @@ -3422,11 +3422,29 @@ inline void LayoutObject::markAncestorsForPaintInvalidation() { |
| inline void LayoutObject::setNeedsPaintOffsetAndVisualRectUpdate() { |
| if (needsPaintOffsetAndVisualRectUpdate()) |
| return; |
| - m_bitfields.setNeedsPaintOffsetAndVisualRectUpdate(true); |
| - for (LayoutObject* parent = paintInvalidationParent(); |
| - parent && !parent->needsPaintOffsetAndVisualRectUpdate(); |
| - parent = parent->paintInvalidationParent()) |
| - parent->m_bitfields.setNeedsPaintOffsetAndVisualRectUpdate(true); |
| + for (auto* object = this; |
| + object && !object->needsPaintOffsetAndVisualRectUpdate(); |
| + object = object->paintInvalidationParent()) { |
|
pdr.
2017/03/21 18:40:49
Do we need to invalidate both the object and its c
Xianzhu
2017/03/22 02:46:07
This special case is for focus ring only. Focus ri
|
| + object->m_bitfields.setNeedsPaintOffsetAndVisualRectUpdate(true); |
| + |
| + // If the object is an anonymous block continuation, mark the start object |
|
wkorman
2017/03/21 19:31:52
Wondered why we only have to mark the start object
Xianzhu
2017/03/22 02:46:07
Please see the reply to pdr@'s comment above.
Upd
|
| + // of the continuation for paint invalidation if it has focus ring because |
| + // change of continuation may change the shape of the focus ring. |
| + if (!object->isAnonymous() || !object->isLayoutBlockFlow()) |
| + continue; |
| + auto* blockFlow = toLayoutBlockFlow(object); |
| + if (!blockFlow->isAnonymousBlockContinuation()) |
| + continue; |
| + |
| + if (auto* inlineElementContinuation = |
| + blockFlow->inlineElementContinuation()) { |
| + auto* startOfContinuations = |
| + inlineElementContinuation->node()->layoutObject(); |
| + if (startOfContinuations && |
| + startOfContinuations->styleRef().outlineStyleIsAuto()) |
| + startOfContinuations->setMayNeedPaintInvalidation(); |
| + } |
| + } |
| } |
| void LayoutObject::setShouldInvalidateSelection() { |