Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Charts on sixcolors.com flicker when zooming in
https://bugs.webkit.org/show_bug.cgi?id=256620 rdar://108930635 Reviewed by Simon Fraser. Rearrange the logic of RenderBoxModelObject::decodingModeForImageDraw() such that we call isVisibleInViewport() at the end of this function. But there is only one exception to this. If the image has the attribute decoding="async" specified, then we have to make sure the image will not flicker. And to check that we have to call isVisibleInViewport(). Fix a subtle one-time-flickering we should not rely on the layer repaint count only because new layers can be created when pinch zoom the image. In addition to the repaint count, we can rely on a new flag called hasEverPaintedImages which can be stored in the NodeRareData. It is initialized to false and it is set to true when the image is drawn by its RenderObject. An image is allowed to be asynchronously decoded if layer repaint count is zero and the element's flag hasEverPaintedImages is false. The internal setting setLargeImageAsyncDecodingEnabledForTesting() will be renamed to setAsyncDecodingEnabledForTesting(). Its use will change to enable async image decoding for any image regardless of its size. * LayoutTests/fast/images/async-image-background-change.html: * LayoutTests/fast/images/async-image-background-image-repeated.html: * LayoutTests/fast/images/async-image-background-image.html: * LayoutTests/fast/images/async-image-body-background-image.html: * LayoutTests/fast/images/async-image-multiple-clients-repaint.html: * LayoutTests/fast/images/async-image-src-change.html: * LayoutTests/fast/images/decode-render-static-image.html: * LayoutTests/fast/images/decoding-attribute-async-small-image.html: * LayoutTests/fast/images/decoding-attribute-dynamic-async-small-image.html: * LayoutTests/fast/images/sprite-sheet-image-draw.html: * LayoutTests/http/tests/images/render-partial-image-load.html: * Source/WebCore/dom/Node.cpp: (WebCore::Node::hasEverPaintedImages const): (WebCore::Node::setHasEverPaintedImages): * Source/WebCore/dom/Node.h: * Source/WebCore/dom/NodeRareData.h: (WebCore::NodeRareData::hasEverPaintedImages const): (WebCore::NodeRareData::setHasEverPaintedImages): * Source/WebCore/platform/graphics/BitmapImage.h: * Source/WebCore/rendering/BackgroundPainter.cpp: (WebCore::BackgroundPainter::paintFillLayer): * Source/WebCore/rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::decodingModeForImageDraw const): * Source/WebCore/rendering/RenderImage.cpp: (WebCore::RenderImage::paintIntoRect): * Source/WebCore/rendering/RenderObject.h: * Source/WebCore/testing/Internals.cpp: (WebCore::Internals::setAsyncDecodingEnabledForTesting): (WebCore::Internals::setLargeImageAsyncDecodingEnabledForTesting): Deleted. * Source/WebCore/testing/Internals.h: * Source/WebCore/testing/Internals.idl: Canonical link: https://commits.webkit.org/265328@main
- Loading branch information
Showing
22 changed files
with
93 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters