Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp b/third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp |
| index 0af88ce7cbfc9e4f9584c6c62475cbb79e0f4add..87294efd1a6af8d8c583f3bf12bb108dd8822061 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp |
| @@ -31,6 +31,7 @@ |
| #include "core/layout/LayoutScrollbar.h" |
| #include "core/layout/LayoutScrollbarTheme.h" |
| #include "core/layout/LayoutView.h" |
| +#include "core/paint/PaintLayerScrollableArea.h" |
| #include "platform/LengthFunctions.h" |
| namespace blink { |
| @@ -179,24 +180,14 @@ void LayoutScrollbarPart::styleDidChange(StyleDifference diff, const ComputedSty |
| clearPositionedState(); |
| setFloating(false); |
| setHasOverflowClip(false); |
| - if (oldStyle && m_scrollbar && m_part != NoPart && (diff.needsPaintInvalidation() || diff.needsLayout())) |
| - m_scrollbar->theme()->invalidatePart(m_scrollbar, m_part); |
| + if (oldStyle && (diff.needsPaintInvalidation() || diff.needsLayout())) |
| + setNeedsPaintInvalidation(); |
| } |
| void LayoutScrollbarPart::imageChanged(WrappedImagePtr image, const IntRect* rect) |
| { |
| - if (m_scrollbar && m_part != NoPart) { |
| - m_scrollbar->theme()->invalidatePart(m_scrollbar, m_part); |
| - } else { |
| - if (FrameView* frameView = view()->frameView()) { |
| - if (frameView->isFrameViewScrollCorner(this)) { |
| - frameView->invalidateScrollCorner(frameView->scrollCornerRect()); |
| - return; |
| - } |
| - } |
| - |
| - LayoutBlock::imageChanged(image, rect); |
| - } |
| + setNeedsPaintInvalidation(); |
| + LayoutBlock::imageChanged(image, rect); |
| } |
| LayoutObject* LayoutScrollbarPart::layoutObjectOwningScrollbar() const |
| @@ -204,4 +195,24 @@ LayoutObject* LayoutScrollbarPart::layoutObjectOwningScrollbar() const |
| return (!m_scrollbar) ? nullptr : m_scrollbar->owningLayoutObject(); |
| } |
| +void LayoutScrollbarPart::setNeedsPaintInvalidation() |
| +{ |
| + if (m_scrollbar) { |
| + m_scrollbar->setNeedsPaintInvalidation(); |
| + return; |
| + } |
| + |
| + // This LayoutScrollbarPart is a scroll corner or a resizer. |
| + ASSERT(m_part == NoPart); |
| + if (FrameView* frameView = view()->frameView()) { |
| + if (frameView->isFrameViewScrollCorner(this)) { |
| + frameView->setScrollCornerNeedsPaintInvalidation(); |
|
chrishtr
2015/11/17 01:34:20
Why is the scroll corner special?
Xianzhu
2015/11/17 18:31:37
Though scroll corner is a LayoutScrollbarPart, its
|
| + return; |
| + } |
| + } |
| + |
| + // This LayoutScrollbarPart belongs to a PaintLayerScrollableArea. |
| + toLayoutBox(parent())->scrollableArea()->setScrollCornerNeedsPaintInvalidation(); |
| +} |
| + |
| } |