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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1667 matching lines...) Expand 10 before | Expand all | Expand 10 after
1678 1678
1679 if (!isDocumentElement() && !backgroundStolenForBeingBody()) { 1679 if (!isDocumentElement() && !backgroundStolenForBeingBody()) {
1680 for (const FillLayer* layer = &styleRef().backgroundLayers(); layer; 1680 for (const FillLayer* layer = &styleRef().backgroundLayers(); layer;
1681 layer = layer->next()) { 1681 layer = layer->next()) {
1682 if (layer->image() && image == layer->image()->data()) { 1682 if (layer->image() && image == layer->image()->data()) {
1683 invalidateBackgroundObscurationStatus(); 1683 invalidateBackgroundObscurationStatus();
1684 bool maybeAnimated = 1684 bool maybeAnimated =
1685 layer->image()->cachedImage() && 1685 layer->image()->cachedImage() &&
1686 layer->image()->cachedImage()->getImage() && 1686 layer->image()->cachedImage()->getImage() &&
1687 layer->image()->cachedImage()->getImage()->maybeAnimated(); 1687 layer->image()->cachedImage()->getImage()->maybeAnimated();
1688 if (maybeAnimated) 1688 if (maybeAnimated) {
1689 setMayNeedPaintInvalidationAnimatedBackgroundImage(); 1689 setMayNeedPaintInvalidationAnimatedBackgroundImage();
1690 else 1690 } else {
1691 setShouldDoFullPaintInvalidation(); 1691 setShouldDoFullPaintInvalidation();
1692 setBackgroundChangedSinceLastPaintInvalidation();
1693 }
1692 break; 1694 break;
1693 } 1695 }
1694 } 1696 }
1695 } 1697 }
1696 1698
1697 ShapeValue* shapeOutsideValue = style()->shapeOutside(); 1699 ShapeValue* shapeOutsideValue = style()->shapeOutside();
1698 if (!frameView()->isInPerformLayout() && isFloating() && shapeOutsideValue && 1700 if (!frameView()->isInPerformLayout() && isFloating() && shapeOutsideValue &&
1699 shapeOutsideValue->image() && 1701 shapeOutsideValue->image() &&
1700 shapeOutsideValue->image()->data() == image) { 1702 shapeOutsideValue->image()->data() == image) {
1701 ShapeOutsideInfo& info = ShapeOutsideInfo::ensureInfo(*this); 1703 ShapeOutsideInfo& info = ShapeOutsideInfo::ensureInfo(*this);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1748 LayoutView* layoutView = view(); 1750 LayoutView* layoutView = view();
1749 while (!layoutView->frame()->ownerLayoutItem().isNull()) 1751 while (!layoutView->frame()->ownerLayoutItem().isNull())
1750 layoutView = 1752 layoutView =
1751 LayoutAPIShim::layoutObjectFrom(layoutView->frame()->ownerLayoutItem()) 1753 LayoutAPIShim::layoutObjectFrom(layoutView->frame()->ownerLayoutItem())
1752 ->view(); 1754 ->view();
1753 mapToVisualRectInAncestorSpace(layoutView, rect); 1755 mapToVisualRectInAncestorSpace(layoutView, rect);
1754 return rect.intersects(LayoutRect( 1756 return rect.intersects(LayoutRect(
1755 layoutView->frameView()->getScrollableArea()->visibleContentRect())); 1757 layoutView->frameView()->getScrollableArea()->visibleContentRect()));
1756 } 1758 }
1757 1759
1760 void LayoutBox::ensureIsReadyForPaintInvalidation() {
1761 LayoutBoxModelObject::ensureIsReadyForPaintInvalidation();
1762
1763 if (mayNeedPaintInvalidationAnimatedBackgroundImage() &&
1764 !backgroundIsKnownToBeObscured())
1765 setShouldDoFullPaintInvalidation(PaintInvalidationDelayedFull);
1766
1767 if (fullPaintInvalidationReason() != PaintInvalidationDelayedFull ||
1768 !intersectsVisibleViewport())
1769 return;
1770
1771 // Do regular full paint invalidation if the object with
1772 // PaintInvalidationDelayedFull is onscreen.
1773 if (intersectsVisibleViewport()) {
1774 // Conservatively assume the delayed paint invalidation was caused by
1775 // background image change.
1776 setBackgroundChangedSinceLastPaintInvalidation();
1777 setShouldDoFullPaintInvalidation(PaintInvalidationFull);
1778 }
1779 }
1780
1758 PaintInvalidationReason LayoutBox::invalidatePaintIfNeeded( 1781 PaintInvalidationReason LayoutBox::invalidatePaintIfNeeded(
1759 const PaintInvalidationState& paintInvalidationState) { 1782 const PaintInvalidationState& paintInvalidationState) {
1760 if (hasBoxDecorationBackground() 1783 if (hasBoxDecorationBackground()
1761 // We also paint overflow controls in background phase. 1784 // We also paint overflow controls in background phase.
1762 || (hasOverflowClip() && getScrollableArea()->hasOverflowControls())) { 1785 || (hasOverflowClip() && getScrollableArea()->hasOverflowControls())) {
1763 PaintLayer& layer = paintInvalidationState.paintingLayer(); 1786 PaintLayer& layer = paintInvalidationState.paintingLayer();
1764 if (layer.layoutObject() != this) 1787 if (layer.layoutObject() != this)
1765 layer.setNeedsPaintPhaseDescendantBlockBackgrounds(); 1788 layer.setNeedsPaintPhaseDescendantBlockBackgrounds();
1766 } 1789 }
1767 1790
(...skipping 3876 matching lines...) Expand 10 before | Expand all | Expand 10 after
5644 LayoutRect rect = frameRect(); 5667 LayoutRect rect = frameRect();
5645 5668
5646 LayoutBlock* block = containingBlock(); 5669 LayoutBlock* block = containingBlock();
5647 if (block) 5670 if (block)
5648 block->adjustChildDebugRect(rect); 5671 block->adjustChildDebugRect(rect);
5649 5672
5650 return rect; 5673 return rect;
5651 } 5674 }
5652 5675
5653 } // namespace blink 5676 } // namespace blink
OLDNEW
« 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