Bug 250471

Summary: font-face src format doesn't consume range when garbage follows url()
Product: WebKit Reporter: Vitor Roriz <vitor.roriz>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: karlcow, mmaxfield, webkit-bug-importer
Priority: P2 Keywords: BrowserCompat, InRadar, WPTImpact
Version: Other   
Hardware: Unspecified   
OS: Unspecified   

Description Vitor Roriz 2023-01-11 12:34:31 PST
When webkit parses font-face src, if the component is a url, it first tries to parse a URL and then format().
It will just try to parse a second member after URL if such a member has a functionID equals CSSValueFormat.


This conflicts with the logic for parsing each component as comma delimited and the requirement that the src descriptor will only be valid if the whole range has been consumed by the end of its parsing.
This makes the following src descriptor in font-face to be invalidated, while it should be valid:
src: 'url("foo.ttf") dummy(xyzzy), url("bar.html")', valid: true }.

This is tested by the following wpt: https://wpt.fyi/results/css/css-fonts/parsing/font-face-src-format.html?label=experimental&label=master&aligned
Comment 1 Radar WebKit Bug Importer 2023-01-11 12:34:46 PST
<rdar://problem/104135235>
Comment 2 Vitor Roriz 2023-01-12 07:32:33 PST
Pull request: https://github.com/WebKit/WebKit/pull/8574
Comment 3 EWS 2023-01-13 06:24:03 PST
Committed 258870@main (ef82a019637b): <https://commits.webkit.org/258870@main>

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