Closed Bug 1343919 Opened 8 years ago Closed 3 years ago

KeyframeUtils seems to be using the wrong base URI

Categories

(Core :: DOM: Animation, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
103 Branch
Tracking Status
firefox54 --- wontfix
firefox103 --- fixed

People

(Reporter: bzbarsky, Assigned: emilio)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

It's using GetDocumentURI() for the base URI. That seems wrong. This code was added in bug 1245748.
Yeah, that seems wrong. I suspect I just copied the code added in bug 1208951 that does that same (except that it makes sense to use document URI in that bug since we're only parsing timing functions there).
Attached file Test case
Test case demonstrating the problem. On the upside, as far as I can tell, this only affects animations created using the API and only when using longhand properties and only for properties that take URIs (which we only recently only implemented).
I guess we'll need test cases for when we re-assign the target element to an element from another document and for when the base URI is updated (which we might not be able to fix in this bug since we're currently pretty bad at responding to changes in context).
In fact, in order to respond to dynamic changes, we might need to store these values as token streams and re-parse them before we produce computed values in UpdateProperties. So this might not be as trivial as just passing the document's base URI. Then again, if you animate an element in another document using JS, which base URI do you expect to be used? The spec doesn't say (yet) but I wonder what authors would expect. I'm guessing it should use the base URI of the target element.
Priority: -- → P3
Flags: needinfo?(emilio)

This is the only meaningful consumer of
ServoCSSParser::GetParsingEnvironment right now, but seems worth fixing
before other folks add more.

Assignee: nobody → emilio
Status: NEW → ASSIGNED

I didn't test the edge cases discussed above, but other browsers agree with our behavior in the tests I added, and our behavior in those is clearly wrong, so I think it's worth addressing.

Flags: needinfo?(emilio)
Blocks: 1772389
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/eb45c4f28c17 Fix base URI in KeyframeEffect. r=birtles
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/34311 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: