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

Side by Side 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 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) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2009 Google Inc. All rights reserved. 8 * Copyright (C) 2009 Google Inc. All rights reserved.
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 3405 matching lines...) Expand 10 before | Expand all | Expand 10 after
3416 inline void LayoutObject::markAncestorsForPaintInvalidation() { 3416 inline void LayoutObject::markAncestorsForPaintInvalidation() {
3417 for (LayoutObject* parent = this->paintInvalidationParent(); 3417 for (LayoutObject* parent = this->paintInvalidationParent();
3418 parent && !parent->shouldCheckForPaintInvalidation(); 3418 parent && !parent->shouldCheckForPaintInvalidation();
3419 parent = parent->paintInvalidationParent()) 3419 parent = parent->paintInvalidationParent())
3420 parent->m_bitfields.setMayNeedPaintInvalidation(true); 3420 parent->m_bitfields.setMayNeedPaintInvalidation(true);
3421 } 3421 }
3422 3422
3423 inline void LayoutObject::setNeedsPaintOffsetAndVisualRectUpdate() { 3423 inline void LayoutObject::setNeedsPaintOffsetAndVisualRectUpdate() {
3424 if (needsPaintOffsetAndVisualRectUpdate()) 3424 if (needsPaintOffsetAndVisualRectUpdate())
3425 return; 3425 return;
3426 m_bitfields.setNeedsPaintOffsetAndVisualRectUpdate(true); 3426 for (auto* object = this;
3427 for (LayoutObject* parent = paintInvalidationParent(); 3427 object && !object->needsPaintOffsetAndVisualRectUpdate();
3428 parent && !parent->needsPaintOffsetAndVisualRectUpdate(); 3428 object = object->paintInvalidationParent()) {
3429 parent = parent->paintInvalidationParent()) 3429 object->m_bitfields.setNeedsPaintOffsetAndVisualRectUpdate(true);
3430 parent->m_bitfields.setNeedsPaintOffsetAndVisualRectUpdate(true); 3430
3431 // Focus ring is special because continuations affect shape of focus ring.
3432 // 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!
3433 if (!object->isAnonymous() || !object->isLayoutBlockFlow())
3434 continue;
3435 auto* blockFlow = toLayoutBlockFlow(object);
3436 if (!blockFlow->isAnonymousBlockContinuation())
3437 continue;
3438 if (auto* inlineElementContinuation =
3439 blockFlow->inlineElementContinuation()) {
3440 auto* startOfContinuations =
3441 inlineElementContinuation->node()->layoutObject();
3442 if (startOfContinuations &&
3443 startOfContinuations->styleRef().outlineStyleIsAuto())
3444 startOfContinuations->setMayNeedPaintInvalidation();
3445 }
3446 }
3431 } 3447 }
3432 3448
3433 void LayoutObject::setShouldInvalidateSelection() { 3449 void LayoutObject::setShouldInvalidateSelection() {
3434 if (!canUpdateSelectionOnRootLineBoxes()) 3450 if (!canUpdateSelectionOnRootLineBoxes())
3435 return; 3451 return;
3436 m_bitfields.setShouldInvalidateSelection(true); 3452 m_bitfields.setShouldInvalidateSelection(true);
3437 setMayNeedPaintInvalidation(); 3453 setMayNeedPaintInvalidation();
3438 frameView()->scheduleVisualUpdateForPaintInvalidationIfNeeded(); 3454 frameView()->scheduleVisualUpdateForPaintInvalidationIfNeeded();
3439 } 3455 }
3440 3456
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
3626 const blink::LayoutObject* root = object1; 3642 const blink::LayoutObject* root = object1;
3627 while (root->parent()) 3643 while (root->parent())
3628 root = root->parent(); 3644 root = root->parent();
3629 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3645 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3630 } else { 3646 } else {
3631 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3647 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3632 } 3648 }
3633 } 3649 }
3634 3650
3635 #endif 3651 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698