Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
| index 89b23b078658cced2b4731d5f485539a9a6f9bb3..0726a9cb3cb002b9d79f8302606d61afe9a8ded9 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
| @@ -2034,6 +2034,26 @@ bool LayoutBox::needsForcedBreakBefore(EBreak previousBreakAfterValue) const |
| return isForcedFragmentainerBreakValue(classABreakPointValue(previousBreakAfterValue)); |
| } |
| +bool LayoutBox::canSkipUnforcedPaintInvalidation() const |
|
chrishtr
2016/08/03 23:13:15
In what case are the conditions in this method dif
Xianzhu
2016/08/04 00:02:14
For now there is no other cases.
However, clip is
chrishtr
2016/08/04 00:57:47
Right. Then is it correct to say that this method
Xianzhu
2016/08/04 16:27:02
The name "doesNotAffectPaintedOutput" seems not cl
|
| +{ |
| + // In case scrollbars got repositioned (which will typically happen if the box got |
| + // resized), we cannot skip invalidation. |
| + if (hasNonCompositedScrollbars()) |
| + return false; |
| + |
| + // Cannot skip paint invalidation if the box has real things to paint. |
| + if (getSelectionState() != SelectionNone || hasBoxDecorationBackground() || styleRef().hasVisualOverflowingEffect()) |
| + return false; |
| + |
| + // If the box has clip, we need to repaint the changed part when the box got resized, |
|
chrishtr
2016/08/03 23:13:15
Changed part of children
chrishtr
2016/08/03 23:13:43
Meaning: it's the childrens' paint output that wou
Xianzhu
2016/08/04 00:02:14
Done.
(I think there is a bug about ancestor clip
|
| + // so cannot skip invalidation. |
| + // TODO(wangxianzhu): Paint invalidation for clip change will be different in spv2. |
| + if (hasClipRelatedProperty() || hasControlClip()) |
| + return false; |
| + |
| + return true; |
| +} |
| + |
| LayoutRect LayoutBox::localOverflowRectForPaintInvalidation() const |
| { |
| if (style()->visibility() != VISIBLE) |