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

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

Issue 2501833002: Fix bug of animated table col/section/row background (Closed)
Patch Set: - Created 4 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/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index f36b66cb19de939b00e1e070f36a93ac26ba091b..8078959bc4702a2b667680fcda1b765f864911c7 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -1685,10 +1685,12 @@ void LayoutBox::imageChanged(WrappedImagePtr image, const IntRect*) {
layer->image()->cachedImage() &&
layer->image()->cachedImage()->getImage() &&
layer->image()->cachedImage()->getImage()->maybeAnimated();
- if (maybeAnimated)
+ if (maybeAnimated) {
setMayNeedPaintInvalidationAnimatedBackgroundImage();
- else
+ } else {
setShouldDoFullPaintInvalidation();
+ setBackgroundChangedSinceLastPaintInvalidation();
+ }
break;
}
}
@@ -1755,6 +1757,27 @@ bool LayoutBox::intersectsVisibleViewport() const {
layoutView->frameView()->getScrollableArea()->visibleContentRect()));
}
+void LayoutBox::ensureIsReadyForPaintInvalidation() {
+ LayoutBoxModelObject::ensureIsReadyForPaintInvalidation();
+
+ if (mayNeedPaintInvalidationAnimatedBackgroundImage() &&
+ !backgroundIsKnownToBeObscured())
+ setShouldDoFullPaintInvalidation(PaintInvalidationDelayedFull);
+
+ if (fullPaintInvalidationReason() != PaintInvalidationDelayedFull ||
+ !intersectsVisibleViewport())
+ return;
+
+ // Do regular full paint invalidation if the object with
+ // PaintInvalidationDelayedFull is onscreen.
+ if (intersectsVisibleViewport()) {
+ // Conservatively assume the delayed paint invalidation was caused by
+ // background image change.
+ setBackgroundChangedSinceLastPaintInvalidation();
+ setShouldDoFullPaintInvalidation(PaintInvalidationFull);
+ }
+}
+
PaintInvalidationReason LayoutBox::invalidatePaintIfNeeded(
const PaintInvalidationState& paintInvalidationState) {
if (hasBoxDecorationBackground()
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698