Closed Bug 1489392 Opened 6 years ago Closed 2 years ago

Update wpt to accept the non-normalized svg path at computed time

Categories

(Core :: CSS Transitions and Animations, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
112 Branch
Tracking Status
firefox112 --- fixed

People

(Reporter: boris, Assigned: boris)

References

(Blocks 2 open bugs, )

Details

Attachments

(2 files, 3 obsolete files)

Google guys agree to update this, so I will fix this bug soon.
I would like to move the normalization into parser, and it seems re-defining CoordPair makes us easier to reuse the macros.
This is about the spec issue: https://github.com/w3c/svgwg/issues/321. There are some benefits for SVG path and its animations if we could normalize it at computed time (or even earlier, at parser time). The computed value of SVG path is the same the specified value, and we have an agreement with Google chrome to do the normalization for both specified and computed values, so we move the normalization into the parser. Depends on D5903
The svg path string is always "absolute" coordinates now, so we could drop the absolute flag to save more memory. Depends on D5904
Attachment #9009254 - Attachment description: Bug 1489392 - Part 3: Drop IsAbsolute → Bug 1489392 - Part 3: Drop IsAbsolute enum
Comment on attachment 9009251 [details] Bug 1489392 - Part 1: Re-define CoordPair struct. Emilio Cobos Álvarez (:emilio) has approved the revision.
Attachment #9009251 - Flags: review+
Comment on attachment 9009253 [details] Bug 1489392 - Part 2: Normalize path string in parser Emilio Cobos Álvarez (:emilio) has approved the revision.
Attachment #9009253 - Flags: review+
Comment on attachment 9009254 [details] Bug 1489392 - Part 3: Simplify BuildPath Emilio Cobos Álvarez (:emilio) has approved the revision.
Attachment #9009254 - Flags: review+
svgwg still discuss this topic. I will hold these patches for a while.
Sorry, these patches should be updated. I thought Google chrome wants to make both specified and computed values normalized. Just checked their patchset 10 [1], and the wpt is updated as now only computed styles use absolute commands. In other words, the normalization should happens in `ToComputedValue` or `ToCss` for `computed::SVGPathData`. [1] https://chromium-review.googlesource.com/c/chromium/src/+/1215150
Depends on: 1489847
Attachment #9009254 - Attachment is obsolete: true
Attachment #9009253 - Attachment is obsolete: true
Attachment #9009254 - Attachment is obsolete: false
Attachment #9009254 - Attachment description: Bug 1489392 - Part 3: Drop IsAbsolute enum → Bug 1489392 - Part 3: Simplify BuildPath
According to https://github.com/w3c/svgwg/issues/321, we do normalization at computed time. That means the specified value still uses original coordinates, but the computed value always uses absolute coordinates. Depends on D5903
Comment on attachment 9010117 [details] Bug 1489392 - Part 2: Normalize svg path at computed time Brian Birtles (:birtles) has approved the revision.
Attachment #9010117 - Flags: review+
It seems AmeliaBR has the strong preference that we should do normalization only for intermediate values [1]. (In other words, keep the current implementation which does normalization at animation time.) [1] https://github.com/w3c/svgwg/issues/321#issuecomment-423257880
Blocks: 1742216
Severity: normal → S3
Attachment #9010117 - Attachment is obsolete: true
Attachment #9009254 - Attachment is obsolete: true
Summary: Normalize svg paths at computed time → Update wpt to accept the non-normalized svg path at computed time
Attachment #9009251 - Attachment description: Bug 1489392 - Part 1: Re-define CoordPair struct → Bug 1489392 - Part 1: Re-define CoordPair struct.

There is still no conclusion in https://github.com/w3c/svgwg/issues/321,
so we follow the option 3 in [1] for now:
Don't absolutize anywhere except when needed for animations.

[1] https://github.com/w3c/svgwg/issues/321#issuecomment-423309441

Note:

  1. Drop "offset-path-serialization.html" because we are doing the simliar
    thing in offset-path-computed.html and offset-path-parsing-valid.html.
  2. 'z' is serialized as Z because Z and z commands take no parameters,
    they have an identical effect.
    (https://www.w3.org/TR/SVG2/paths.html#PathDataClosePathCommand)

We could file a new bug for doing normalization once https://github.com/w3c/svgwg/issues/321 gets resolved.

Pushed by bchiou@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/13ce81b9b7a4 Part 1: Re-define CoordPair struct. r=emilio https://hg.mozilla.org/integration/autoland/rev/4ee091c23aa2 Part 2: Update wpt to accept non-normalized path string at computed time. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/38942 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch
Upstream PR merged by moz-wptsync-bot
Duplicate of this bug: 1742216
See Also: → 1891024
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: