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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp

Issue 1456953003: Revert of Calculate paint invalidation rect for scrollbars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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 87294efd1a6af8d8c583f3bf12bb108dd8822061..0af88ce7cbfc9e4f9584c6c62475cbb79e0f4add 100644
--- a/third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp
@@ -31,7 +31,6 @@
#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 {
@@ -180,14 +179,24 @@
clearPositionedState();
setFloating(false);
setHasOverflowClip(false);
- if (oldStyle && (diff.needsPaintInvalidation() || diff.needsLayout()))
- setNeedsPaintInvalidation();
+ if (oldStyle && m_scrollbar && m_part != NoPart && (diff.needsPaintInvalidation() || diff.needsLayout()))
+ m_scrollbar->theme()->invalidatePart(m_scrollbar, m_part);
}
void LayoutScrollbarPart::imageChanged(WrappedImagePtr image, const IntRect* rect)
{
- setNeedsPaintInvalidation();
- LayoutBlock::imageChanged(image, 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);
+ }
}
LayoutObject* LayoutScrollbarPart::layoutObjectOwningScrollbar() const
@@ -195,24 +204,4 @@
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();
- return;
- }
- }
-
- // This LayoutScrollbarPart belongs to a PaintLayerScrollableArea.
- toLayoutBox(parent())->scrollableArea()->setScrollCornerNeedsPaintInvalidation();
-}
-
-}
+}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutScrollbarPart.h ('k') | third_party/WebKit/Source/core/layout/LayoutTheme.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698