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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2765763002: Fix inline focus ring paint invalidation on continuation change (Closed)
Patch Set: - Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
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 a09d8ad25d9c9d78267b03cd21a0d957732c71f1..f82bc7ba23000c87d41c12041598201115aef465 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -3423,11 +3423,27 @@ 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()) {
+ object->m_bitfields.setNeedsPaintOffsetAndVisualRectUpdate(true);
+
+ // Focus ring is special because continuations affect shape of focus ring.
+ // Mark the start object for paint invalidation if it has focus ring.
wkorman 2017/03/22 18:10:56 My core question was actually, what ends up taking
Xianzhu 2017/03/22 19:18:13 <span style="outline: auto"> ABC <div style="p
wkorman 2017/03/22 20:28:53 Ah, I see. Thank you for the explanation!
+ 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() {

Powered by Google App Engine
This is Rietveld 408576698