Skip to content

Commit 566be05

Browse files
Divyansh Mangalchromium-wpt-export-bot
Divyansh Mangal
authored andcommitted
[SVG] Fix viewport calculation for uninstanced symbol elements.
The test svg-baseval-in-display-none.html verifies the behavior of the `baseVal` property for SVG elements, including the symbol element. It ensures that the `baseVal` properties of geometry elements inside the symbol element are correctly computed. To compute the correct `baseVal` properties, the viewport size is required when width and height are given in percentage format. However, in Chromium, the symbol element (as a viewport element) always returns an empty viewport size when computing baseVal properties. This results in the baseVal properties returning zero values. The spec[1] says either the `svg` element or a `symbol` element that is instanced by a `use` element establishes a new viewport. In the test, the `symbol` isn't instanced, so the expectation should be that the nearest ancestor `svg` provides the viewport. In this CL, we compute the viewport size for the `symbol` element provided by its nearest svg ancestor. [1] https://svgwg.org/svg2-draft/coords.html#EstablishingANewSVGViewport Bug: 41463219,41461114 Change-Id: Iac60cb45f1284db78c36a60c54e9dd9c341172ee Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6217852 Reviewed-by: Fredrik Söderquist <[email protected]> Commit-Queue: Divyansh Mangal <[email protected]> Cr-Commit-Position: refs/heads/main@{#1415367}
1 parent 075aea4 commit 566be05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

svg/geometry/svg-baseval-in-display-none.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545

4646
let tEmPercentage = async_test("With em and percentage");
4747
let tEmPercentageDone = tEmPercentage.step_func_done(() => {
48-
assertBaseVal(r1.width, 40, "r1.width");
49-
assertBaseVal(r1.height, 30, "r1.height");
48+
assertBaseVal(r1.width, 120, "r1.width");
49+
assertBaseVal(r1.height, 120, "r1.height");
5050

5151
assertBaseVal(r2.width, 120, "r2.width");
5252
assertBaseVal(r2.height, 120, "r2.height");

0 commit comments

Comments
 (0)