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

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 3404 matching lines...) Expand 10 before | Expand all | Expand 10 after
3415 inline void LayoutObject::markAncestorsForPaintInvalidation() { 3415 inline void LayoutObject::markAncestorsForPaintInvalidation() {
3416 for (LayoutObject* parent = this->paintInvalidationParent(); 3416 for (LayoutObject* parent = this->paintInvalidationParent();
3417 parent && !parent->shouldCheckForPaintInvalidation(); 3417 parent && !parent->shouldCheckForPaintInvalidation();
3418 parent = parent->paintInvalidationParent()) 3418 parent = parent->paintInvalidationParent())
3419 parent->m_bitfields.setMayNeedPaintInvalidation(true); 3419 parent->m_bitfields.setMayNeedPaintInvalidation(true);
3420 } 3420 }
3421 3421
3422 inline void LayoutObject::setNeedsPaintOffsetAndVisualRectUpdate() { 3422 inline void LayoutObject::setNeedsPaintOffsetAndVisualRectUpdate() {
3423 if (needsPaintOffsetAndVisualRectUpdate()) 3423 if (needsPaintOffsetAndVisualRectUpdate())
3424 return; 3424 return;
3425 m_bitfields.setNeedsPaintOffsetAndVisualRectUpdate(true); 3425 for (auto* object = this;
3426 for (LayoutObject* parent = paintInvalidationParent(); 3426 object && !object->needsPaintOffsetAndVisualRectUpdate();
3427 parent && !parent->needsPaintOffsetAndVisualRectUpdate(); 3427 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
3428 parent = parent->paintInvalidationParent()) 3428 object->m_bitfields.setNeedsPaintOffsetAndVisualRectUpdate(true);
3429 parent->m_bitfields.setNeedsPaintOffsetAndVisualRectUpdate(true); 3429
3430 // 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
3431 // of the continuation for paint invalidation if it has focus ring because
3432 // change of continuation may change the shape of the focus ring.
3433 if (!object->isAnonymous() || !object->isLayoutBlockFlow())
3434 continue;
3435 auto* blockFlow = toLayoutBlockFlow(object);
3436 if (!blockFlow->isAnonymousBlockContinuation())
3437 continue;
3438
3439 if (auto* inlineElementContinuation =
3440 blockFlow->inlineElementContinuation()) {
3441 auto* startOfContinuations =
3442 inlineElementContinuation->node()->layoutObject();
3443 if (startOfContinuations &&
3444 startOfContinuations->styleRef().outlineStyleIsAuto())
3445 startOfContinuations->setMayNeedPaintInvalidation();
3446 }
3447 }
3430 } 3448 }
3431 3449
3432 void LayoutObject::setShouldInvalidateSelection() { 3450 void LayoutObject::setShouldInvalidateSelection() {
3433 if (!canUpdateSelectionOnRootLineBoxes()) 3451 if (!canUpdateSelectionOnRootLineBoxes())
3434 return; 3452 return;
3435 m_bitfields.setShouldInvalidateSelection(true); 3453 m_bitfields.setShouldInvalidateSelection(true);
3436 setMayNeedPaintInvalidation(); 3454 setMayNeedPaintInvalidation();
3437 frameView()->scheduleVisualUpdateForPaintInvalidationIfNeeded(); 3455 frameView()->scheduleVisualUpdateForPaintInvalidationIfNeeded();
3438 } 3456 }
3439 3457
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
3625 const blink::LayoutObject* root = object1; 3643 const blink::LayoutObject* root = object1;
3626 while (root->parent()) 3644 while (root->parent())
3627 root = root->parent(); 3645 root = root->parent();
3628 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3646 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3629 } else { 3647 } else {
3630 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3648 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3631 } 3649 }
3632 } 3650 }
3633 3651
3634 #endif 3652 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698