Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LBSE] Fix SVGImage container size propagation #4995

Conversation

nikolaszimmermann
Copy link
Contributor

@nikolaszimmermann nikolaszimmermann commented Oct 4, 2022

3c9c020

[LBSE] Fix SVGImage container size propagation
https://bugs.webkit.org/show_bug.cgi?id=246034

Reviewed by Rob Buis.

Propagate container size in SVGImage also for RenderSVGRoot, not only LegacyRenderSVGRoot.
This requires to enable SVGImage to actually use LBSE for its documents, if the host document
has LBSE turned on.

This requires plumbing the 'layerBasedSVGEngineEnabled' flag from Settings (reachable via Document)
down to CachedImage / ImageObserver so that we can set the flag, if necessary, before constructing
the document from the network data. Otherwise SVGImage in LBSE will continue to use the legacy
SVG engine.

Update TestExpectations now that SVGImage uses LBSE as well.

* LayoutTests/platform/mac-monterey-wk2-lbse-text/TestExpectations:
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/as-background-image/svg-as-background-6-expected.png: Added.
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/as-image/svg-non-integer-scaled-image-expected.png: Added.
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/zoom/page/zoom-background-images-expected.png: Added.
* Source/WebCore/loader/cache/CachedImage.cpp:
(WebCore::CachedImage::load):
* Source/WebCore/loader/cache/CachedImage.h:
* Source/WebCore/platform/graphics/ImageObserver.h:
(WebCore::ImageObserver::layerBasedSVGEngineEnabled const):
* Source/WebCore/svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::setContainerSize):
(WebCore::SVGImage::containerSize const):
(WebCore::SVGImage::dataChanged):

Canonical link: https://commits.webkit.org/255625@main

e35a4bb

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe   πŸ›  πŸ§ͺ win
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-debug βœ… πŸ›  gtk βœ… πŸ›  wincairo
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ gtk-wk2
  πŸ§ͺ api-ios βœ… πŸ§ͺ api-mac ❌ πŸ§ͺ api-gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-wk1
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch βœ… πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  watch-sim βœ… πŸ§ͺ mac-wk2-stress

@nikolaszimmermann nikolaszimmermann self-assigned this Oct 4, 2022
@nikolaszimmermann nikolaszimmermann added SVG For bugs in the SVG implementation. WebKit Local Build labels Oct 4, 2022
@nikolaszimmermann
Copy link
Contributor Author

This needs a rebase once PR #4998 is in.

@nikolaszimmermann nikolaszimmermann force-pushed the eng/LBSE-Fix-SVGImage-container-size-propagation branch from 87ce771 to 2968f38 Compare October 5, 2022 10:29
@nikolaszimmermann nikolaszimmermann force-pushed the eng/LBSE-Fix-SVGImage-container-size-propagation branch from 2968f38 to e35a4bb Compare October 17, 2022 08:22
@nikolaszimmermann
Copy link
Contributor Author

Rebased. Can you have a look @rwlbuis?

Copy link
Contributor

@rwlbuis rwlbuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@nikolaszimmermann nikolaszimmermann added the merge-queue Applied to send a pull request to merge-queue label Oct 17, 2022
https://bugs.webkit.org/show_bug.cgi?id=246034

Reviewed by Rob Buis.

Propagate container size in SVGImage also for RenderSVGRoot, not only LegacyRenderSVGRoot.
This requires to enable SVGImage to actually use LBSE for its documents, if the host document
has LBSE turned on.

This requires plumbing the 'layerBasedSVGEngineEnabled' flag from Settings (reachable via Document)
down to CachedImage / ImageObserver so that we can set the flag, if necessary, before constructing
the document from the network data. Otherwise SVGImage in LBSE will continue to use the legacy
SVG engine.

Update TestExpectations now that SVGImage uses LBSE as well.

* LayoutTests/platform/mac-monterey-wk2-lbse-text/TestExpectations:
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/as-background-image/svg-as-background-6-expected.png: Added.
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/as-image/svg-non-integer-scaled-image-expected.png: Added.
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/zoom/page/zoom-background-images-expected.png: Added.
* Source/WebCore/loader/cache/CachedImage.cpp:
(WebCore::CachedImage::load):
* Source/WebCore/loader/cache/CachedImage.h:
* Source/WebCore/platform/graphics/ImageObserver.h:
(WebCore::ImageObserver::layerBasedSVGEngineEnabled const):
* Source/WebCore/svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::setContainerSize):
(WebCore::SVGImage::containerSize const):
(WebCore::SVGImage::dataChanged):

Canonical link: https://commits.webkit.org/255625@main
@webkit-early-warning-system webkit-early-warning-system force-pushed the eng/LBSE-Fix-SVGImage-container-size-propagation branch from e35a4bb to 3c9c020 Compare October 17, 2022 14:08
@webkit-commit-queue
Copy link
Collaborator

Committed 255625@main (3c9c020): https://commits.webkit.org/255625@main

Reviewed commits have been landed. Closing PR #4995 and removing active labels.

@webkit-early-warning-system webkit-early-warning-system merged commit 3c9c020 into WebKit:main Oct 17, 2022
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Oct 17, 2022
@nikolaszimmermann nikolaszimmermann deleted the eng/LBSE-Fix-SVGImage-container-size-propagation branch October 17, 2022 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SVG For bugs in the SVG implementation.
Projects
None yet
4 participants