[webkit-changes] [WebKit/WebKit] 4e612c: font-relative units of svg elements don't take zoo...
Fujii Hironori
noreply at github.com
Thu Sep 26 13:27:26 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4e612c4d529b93a265a140b8937551b8bc794ffa
https://github.com/WebKit/WebKit/commit/4e612c4d529b93a265a140b8937551b8bc794ffa
Author: Fujii Hironori <Hironori.Fujii at sony.com>
Date: 2024-09-26 (Thu, 26 Sep 2024)
Changed paths:
M LayoutTests/platform/glib/svg/zoom/text/zoom-hixie-mixed-008-expected.txt
M LayoutTests/platform/glib/svg/zoom/text/zoom-hixie-mixed-009-expected.txt
M LayoutTests/platform/ios/svg/zoom/text/zoom-hixie-mixed-008-expected.txt
M LayoutTests/platform/ios/svg/zoom/text/zoom-hixie-mixed-009-expected.png
M LayoutTests/platform/ios/svg/zoom/text/zoom-hixie-mixed-009-expected.txt
M LayoutTests/platform/mac/svg/custom/foreign-object-skew-expected.png
M LayoutTests/platform/mac/svg/custom/foreign-object-skew-expected.txt
M LayoutTests/platform/mac/svg/zoom/text/zoom-hixie-mixed-008-expected.png
M LayoutTests/platform/mac/svg/zoom/text/zoom-hixie-mixed-008-expected.txt
M LayoutTests/platform/mac/svg/zoom/text/zoom-hixie-mixed-009-expected.png
M LayoutTests/platform/mac/svg/zoom/text/zoom-hixie-mixed-009-expected.txt
A LayoutTests/svg/zoom/page/em-and-font-size-expected.html
A LayoutTests/svg/zoom/page/em-and-font-size.html
A LayoutTests/svg/zoom/page/zoom-foreignObject-2-expected.html
A LayoutTests/svg/zoom/page/zoom-foreignObject-2.html
M LayoutTests/svg/zoom/text/zoom-hixie-mixed-008.xml
M LayoutTests/svg/zoom/text/zoom-hixie-mixed-009.xml
M Source/WebCore/css/svg.css
M Source/WebCore/style/StyleBuilderState.cpp
Log Message:
-----------
font-relative units of svg elements don't take zoom factors into account
https://bugs.webkit.org/show_bug.cgi?id=199236
Reviewed by Simon Fraser.
WebKit handles zoom factor (zoom property and page zoom) differently
for SVG. WebKit multiplies internal computed CSS length values by zoom
factors for HTML elements, but for SVG elements. WebKit scales SVG
differently for zooming. Thus, internal computed font-size is zoomed
for HTML elements, but unzoomed for a SVG elements.
However, CSS length values of the root SVG element of included SVG
documents should be zoomed. font-relative units of the svg elements
didn't take zoom factor into account because font-size of them were
unzoomed. It should be zoomed.
There was another problem. Assume there was a compound HTML document
included a SVG document that included another HTML document, and
font-size property was specified to a HTML element of the outer HTML
document, and a zoom factor was applied. The computed font-size of the
HTML element was zoomed. If it was inherited to elements of the inner
HTML document, the font size of the inner HTML was zoomed twice.
font-size property should be resolved at root elements of included
documents.
Before this change, WebKit inconsitently scales texts in HTML in SVG
for text zoom. If a font-size property was specified to a element of
parent SVG document, it was unzoomed. If it was specified to a element
of inner HTML document, it was zoomed. After this change, WebKit
consitetly scales texts in HTML for text zoom even if the HTML is
included in SVG and font-size property is inherited from the parent
SVG. This change needed rebaselining of expectations for some test
cases. And, some HTML in SVG documents would have text overwrap for
text zoom.
* LayoutTests/platform/glib/svg/zoom/text/zoom-hixie-mixed-008-expected.txt:
* LayoutTests/platform/glib/svg/zoom/text/zoom-hixie-mixed-009-expected.txt:
* LayoutTests/platform/ios/svg/zoom/text/zoom-hixie-mixed-008-expected.txt:
* LayoutTests/platform/ios/svg/zoom/text/zoom-hixie-mixed-009-expected.png:
* LayoutTests/platform/ios/svg/zoom/text/zoom-hixie-mixed-009-expected.txt:
* LayoutTests/platform/mac/svg/custom/foreign-object-skew-expected.png:
* LayoutTests/platform/mac/svg/custom/foreign-object-skew-expected.txt:
* LayoutTests/platform/mac/svg/zoom/text/zoom-hixie-mixed-008-expected.png:
* LayoutTests/platform/mac/svg/zoom/text/zoom-hixie-mixed-008-expected.txt:
* LayoutTests/platform/mac/svg/zoom/text/zoom-hixie-mixed-009-expected.png:
* LayoutTests/platform/mac/svg/zoom/text/zoom-hixie-mixed-009-expected.txt:
* LayoutTests/svg/zoom/page/em-and-font-size-expected.html: Added.
* LayoutTests/svg/zoom/page/em-and-font-size.html: Added.
* LayoutTests/svg/zoom/page/zoom-foreignObject-2-expected.html: Added.
* LayoutTests/svg/zoom/page/zoom-foreignObject-2.html: Added.
* LayoutTests/svg/zoom/text/zoom-hixie-mixed-008.xml:
* LayoutTests/svg/zoom/text/zoom-hixie-mixed-009.xml:
* Source/WebCore/css/svg.css:
(*|*:not(*) > svg, foreignObject > *|*:not(*)):
* Source/WebCore/style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::setFontSize):
Canonical link: https://commits.webkit.org/284310@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list