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 68baec2858e10ef18b15fd7e1892c1b891a5824f..1a67a0a4cace26d6a83e5f1f79085bbbd1c33244 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| @@ -1712,6 +1712,8 @@ void LayoutObject::setStyle(PassRefPtr<ComputedStyle> style) { |
| else if (diff.needsPaintInvalidationObject() || |
| updatedDiff.needsPaintInvalidationObject()) |
| setShouldDoFullPaintInvalidation(); |
| + else if (diff.needsPaintInvalidationSelection()) |
| + invalidatePaintForSelection(); |
| // Text nodes share style with their parents but the paint properties don't |
| // apply to them, hence the !isText() check. |
| @@ -3467,6 +3469,23 @@ LayoutRect LayoutObject::debugRect() const { |
| return rect; |
| } |
| +void LayoutObject::invalidatePaintForSelection() { |
| + LayoutBlock* block = |
| + isLayoutBlock() ? toLayoutBlock(this) : containingBlock(); |
|
mstensho (USE GERRIT)
2017/02/21 21:03:54
Even if you also explain it in the commit comment,
rune
2017/02/21 21:42:00
OK.
rune
2017/02/21 22:34:57
Done.
|
| + if (!block) |
| + return; |
| + if (!block->hasSelectedChildren()) |
| + return; |
| + for (LayoutObject* child = slowFirstChild(); child; |
|
mstensho (USE GERRIT)
2017/02/21 21:03:54
Likewise, I think it's worth mentioning right here
rune
2017/02/21 21:42:00
Acknowledged.
rune
2017/02/21 22:34:57
Done.
|
| + child = child->nextSibling()) { |
| + if (!child->canBeSelectionLeaf()) |
| + continue; |
| + if (child->getSelectionState() == SelectionNone) |
| + continue; |
| + child->setShouldInvalidateSelection(); |
| + } |
| +} |
| + |
| } // namespace blink |
| #ifndef NDEBUG |