Re: [csswg-drafts] [css-fonts] Drop bracket matching step from `@font-face` src: line parsing (#6340)

Thanks @jfkthame and @tabatkins for observations and clarifications. Of course, Jonathan, you're right that the data url scheme you're giving as an example does work. And it's also true that the CSS parsing operates on a token stream, not on a character stream.

What I looked at during my analysis for WebKit and Chrome were these bits of code for where a font face src descriptor is parsed:
ConsumeFontFaceSrc [Chrome](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/css/parser/at_rule_descriptor_parser.cc;l=140;drc=9de41c281bbe975c886fb14bc13b1df6c06f3864;bpv=1;bpt=1) and consumeFontFaceSrc in [WebKit](https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/css/parser/CSSPropertyParserWorkerSafe.cpp#L247)

In particular, the behavior of the parser here consuming and progressing to each next value comma-token by comma-token. But indeed while still inner component values such as `url()` can contain commas which are consumed in nested parsing functions called `consumeFontFaceSrcLocal` and `consumeFontFaceURI`. So my earlier description of first separating by commas is not quite accurate. 

With that clarified, I am still convinced that the prose for separating by bracket matching should be dropped as that's definitely not what's happening or needed.

Because @tabatkins provides this very useful reference, as an additional improvement to the current text, we may want to refer to ["5.3.10. Parse a comma-separated list of component values"](https://drafts.csswg.org/css-syntax/#parse-comma-separated-list-of-component-values) as the algorithm for parsing this value, assuming that it's fully applicable: In that respect, are url(...) and local(...) defined as function tokens?

-- 
GitHub Notification of comment by drott
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6340#issuecomment-853873175 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 3 June 2021 13:35:34 UTC