[webkit-changes] [WebKit/WebKit] 8f042c: Charts on sixcolors.com flicker when zooming in
Said Abou-Hallawa
noreply at github.com
Tue Jun 20 11:17:07 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 8f042c727b90676c0a4f2910e26f4474ff08f6d2
https://github.com/WebKit/WebKit/commit/8f042c727b90676c0a4f2910e26f4474ff08f6d2
Author: Said Abou-Hallawa <said at apple.com>
Date: 2023-06-20 (Tue, 20 Jun 2023)
Changed paths:
M LayoutTests/fast/images/async-image-background-change.html
M LayoutTests/fast/images/async-image-background-image-repeated.html
M LayoutTests/fast/images/async-image-background-image.html
M LayoutTests/fast/images/async-image-body-background-image.html
M LayoutTests/fast/images/async-image-multiple-clients-repaint.html
M LayoutTests/fast/images/async-image-src-change.html
M LayoutTests/fast/images/decode-render-static-image.html
M LayoutTests/fast/images/decoding-attribute-async-small-image.html
M LayoutTests/fast/images/decoding-attribute-dynamic-async-small-image.html
M LayoutTests/fast/images/sprite-sheet-image-draw.html
M LayoutTests/http/tests/images/render-partial-image-load.html
M Source/WebCore/dom/Node.cpp
M Source/WebCore/dom/Node.h
M Source/WebCore/dom/NodeRareData.h
M Source/WebCore/platform/graphics/BitmapImage.h
M Source/WebCore/rendering/BackgroundPainter.cpp
M Source/WebCore/rendering/RenderBoxModelObject.cpp
M Source/WebCore/rendering/RenderImage.cpp
M Source/WebCore/rendering/RenderObject.h
M Source/WebCore/testing/Internals.cpp
M Source/WebCore/testing/Internals.h
M Source/WebCore/testing/Internals.idl
Log Message:
-----------
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
More information about the webkit-changes
mailing list