Re: [csswg-drafts] [css-values-3] Serialisation of empty url() undefined (#6447)

The CSS Working Group just discussed `Serialization of empty url()`, and agreed to the following:

* `RESOLVED: serialize as url("")`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> Topic: Serialization of empty url()<br>
&lt;fantasai> github: https://github.com/w3c/csswg-drafts/issues/6447<br>
&lt;fantasai> smfr: CSS Values talks about empty URLs and how we avoid normal behavior of resolving against stylesheet URL<br>
&lt;fantasai> smfr: empty treated as involved<br>
&lt;fantasai> smfr: and we introduced "about:invalid" as a URL<br>
&lt;fantasai> smfr: which is what Gecko serializes<br>
&lt;fantasai> smfr: ??? serializes the resolved URL which is wrong<br>
&lt;fantasai> smfr: but I think empty URLs serialize as such<br>
&lt;fantasai> TabAtkins: That was my intention, and I'm happy to adjust spec to make it clearer<br>
&lt;fantasai> smfr: Also do we serialize as url() or url("")<br>
&lt;fantasai> TabAtkins: I think completely empty URL, is that even valid?<br>
&lt;fantasai> fantasai: it is valid, just tested<br>
&lt;drott> fantasai: it is valid, i just tested<br>
&lt;fantasai> TabAtkins: That would be a serialization nobody uses<br>
&lt;fantasai> TabAtkins: so I lean toward url("") because at least one browser is doing that currently<br>
&lt;fantasai> emilio: Who?<br>
&lt;fantasai> TabAtkins: whoever is passing that test<br>
&lt;fantasai> emilio: smfr updated the test to use empty string<br>
&lt;fantasai> emilio: but Firefox serializes as about:invalid and I don't know what WebKit and Blink do<br>
&lt;smfr> https://wpt.fyi/results/css/css-values/urls/empty.html?label=experimental&amp;label=master&amp;aligned<br>
&lt;fantasai> TabAtkins: nevermind, nobody passes that<br>
&lt;fantasai> smfr: Test expect everything becomes quoted<br>
&lt;fantasai> TabAtkins: let me see if CSSOM specifies anything<br>
&lt;fantasai> TabAtkins: yes, CSSOM expects all URL functions to contain a string<br>
&lt;emilio> https://drafts.csswg.org/cssom/#serialize-a-url<br>
&lt;fantasai> TabAtkins: regardless of whether inputted with or without quotes<br>
&lt;TabAtkins> https://drafts.csswg.org/cssom/#serialize-a-url<br>
&lt;fantasai> TabAtkins: so for consistency, empty url() should also serialize with quotes<br>
&lt;fantasai> astearns: so proposed resolution is to make this test valid, using quoted empty string?<br>
&lt;fantasai> emilio: before we resolve, I wanted to make an argument for url()<br>
&lt;fantasai> emilio: if you consider invalid URL not a URL<br>
&lt;fantasai> emilio: but I'm fine<br>
&lt;fantasai> astearns: If you're fine with the explicitly quoted empty string, I think it makes much more sense, it's consistent<br>
&lt;fantasai> astearns: any objections?<br>
&lt;fantasai> RESOLVED: serialize as url("")<br>
&lt;TabAtkins> myles: I didn't quite catch it, but is your reasoning about wanting @else *before/alongside* font-supports() becuase of the "unknown value" issue making negation hard?<br>
&lt;lea> TabAtkins: am I reading your draft right that @else can also directly follow an @supports or @media, and not just an @if?<br>
&lt;TabAtkins> yes<br>
&lt;astearns> zakim, end meeting<br>
&lt;Zakim> As of this point the attendees have been jensimmons, rachelandrew, drott, Morgan, jfkthame, smfr, miriam, TYLin, chrishtr, cbiesinger, dandclark, alisonmaher, lea, dlibby, oriol,<br>
&lt;Zakim> ... TabAtkins, bkardell_, chris, dholbert, GameMaker, emilio, bradk<br>
&lt;Zakim> RRSAgent, please draft minutes v2<br>
&lt;RRSAgent> I have made the request to generate https://www.w3.org/2021/09/15-css-minutes.html Zakim<br>
&lt;Zakim> I am happy to have been of service, astearns; please remember to excuse RRSAgent.  Goodbye<br>
&lt;TabAtkins> I didn't want @if to be "the new conditional rule" replacing all the others<br>
&lt;TabAtkins> it's just needed to get else-chaining working properly when you're querying across feature sets<br>
&lt;myles> @TabAtkins: how would someone use @supports without @else to use a color font on a browser that supports it, but use a fallback font instead if the browser doesn't?<br>
&lt;TabAtkins> I said up above (in IRC, not on phone) - @supports doesn't use the unknown value. Unknown things are just false, so you can negate them normally.<br>
&lt;TabAtkins> Or I should say, *unrecognized* things are false, to avoid confusion. ^_^<br>
&lt;myles> @TabAtkins: so if the author says "@supports colorfonts { @font-face { colorfont } } @supports not colorfonts { @font-face { notcolorfont } }" you're saying that this will work?<br>
&lt;TabAtkins> yup<br>
&lt;TabAtkins> at least per spec!<br>
&lt;TabAtkins> (well, that exact syntax actually violates the grammar so both would be thrown out as invalid rules, but wrap those suckers in parens or turn them into functions and you're golden)<br>
&lt;lea> That's nice, I was going to suggest it actually<br>
&lt;lea> oh wait, you're replying to Myles, not me<br>
&lt;lea> reading higher up, comment still applies though, nice nice :)<br>
&lt;myles> @TabAtkins: yeah, when this topic first came up to the WG i asked if this was possible and the WG said no<br>
&lt;TabAtkins> Yeah, I think that's what prompted us to decide that @supports doesn't use the unknown bool<br>
&lt;TabAtkins> Because if a browser doesn't understand a syntax, it doesn't understand the feature (and the chance of disconnect when a specialized supports syntax is added well after a feature is implemented was considered not worth worrying about)<br>
&lt;myles> https://github.com/w3c/csswg-drafts/issues/6520#issuecomment-905712330<br>
&lt;TabAtkins> (I could be misremembering the ordering tho)<br>
&lt;myles> @TabAtkins: &lt;TabAtkins> myles: One question - if an author uses @supports, is there a way to say "else"? | &lt;TabAtkins> myles: If there's not a way to do that... @font-faces join together to form a family, rather than overriding<br>
&lt;TabAtkins> yeah, i misremembered during that meeting, sorry<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6447#issuecomment-920292893 using your GitHub account


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

Received on Wednesday, 15 September 2021 18:53:28 UTC