<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>23968</bug_id>
          
          <creation_ts>2013-12-03 12:10:00 +0000</creation_ts>
          <short_desc>Reference the URL spec</short_desc>
          <delta_ts>2013-12-20 14:41:47 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>CSS</product>
          <component>Values and Units</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://www.w3.org/Bugs/Public/show_bug.cgi?id=24148</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>24089</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Pieters">zcorpan</reporter>
          <assigned_to name="Tab Atkins Jr.">jackalmage</assigned_to>
          <cc>annevk</cc>
    
    <cc>fantasai.bugs</cc>
    
    <cc>howcome</cc>
          
          <qa_contact>public-css-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>97031</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-12-03 12:10:00 +0000</bug_when>
    <thetext>CSS references RFC 3986 for processing of URLs, which leaves questions unanswered such as which character encoding to use for the query part. We should reference http://url.spec.whatwg.org/ . (I think the query encoding should be utf-8 for URLs in CSS.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97038</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-12-03 13:34:29 +0000</bug_when>
    <thetext>Yes, you should use the URL parser with just input and a base, not with anything else. You don&apos;t need to mention you set it to utf-8 as that will be implied.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97054</commentid>
    <comment_count>2</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2013-12-03 16:07:44 +0000</bug_when>
    <thetext>Ah cool, yeah.  We only referenced the RFC because there was literally nothing better.  I&apos;ll update the ref soonish.

By the time URLs need to be derefed, they&apos;re already a sequence of codepoints.  Decoding happened back in CSS parsing.  That fine, Anne?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97074</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-12-03 20:53:54 +0000</bug_when>
    <thetext>Yes. The encoding override argument is not about that, but you don&apos;t need to worry about that argument anyway. The input to the URL parser is a string and a base URL.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97612</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-12-13 22:10:19 +0000</bug_when>
    <thetext>Hmm, it seems Blink/Gecko/IE11 use the document&apos;s encoding, at least for background-image. Presto uses utf-8.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97613</commentid>
    <comment_count>5</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-12-13 22:20:14 +0000</bug_when>
    <thetext>(I have only tested &lt;style&gt; so far.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97656</commentid>
    <comment_count>6</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-12-16 12:54:35 +0000</bug_when>
    <thetext>Results for &lt;link&gt;

Gecko: document&apos;s encoding
Blink: style sheet&apos;s encoding
Presto: utf-8
IE: not tested</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97657</commentid>
    <comment_count>7</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-12-16 13:14:20 +0000</bug_when>
    <thetext>I think for CSS we could get away with utf-8-only given how rarely query strings occur there. Also given the diversity in implementations. Could you try Safari as well? It does different things for URLs from Blink.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97658</commentid>
    <comment_count>8</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-12-16 13:38:40 +0000</bug_when>
    <thetext>(In reply to Anne from comment #7)
&gt; I think for CSS we could get away with utf-8-only given how rarely query
&gt; strings occur there.

Do you have data on that?

&gt; Also given the diversity in implementations. Could you
&gt; try Safari as well? It does different things for URLs from Blink.

Safari 6.0.5 (8536.30.1) uses the style sheet&apos;s encoding for &lt;link&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97660</commentid>
    <comment_count>9</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-12-16 13:49:37 +0000</bug_when>
    <thetext>No data. But the reason we have the quirk in HTML is because of &lt;form&gt;.

Are your tests public?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97683</commentid>
    <comment_count>10</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2013-12-16 18:19:34 +0000</bug_when>
    <thetext>(In reply to Simon Pieters from comment #8)
&gt; (In reply to Anne from comment #7)
&gt; &gt; I think for CSS we could get away with utf-8-only given how rarely query
&gt; &gt; strings occur there.
&gt; 
&gt; Do you have data on that?

Given that currently url() is only usable for importing stylesheets and including images, it seems likely that Anne is correct.  Anecdotally, the main use of query strings on stylesheets is to cache-bust (and then the contents are irrelevant), and query strings on images are only for dynamically-generated ones, which are rare, or database keys, which are nearly always ASCII.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97701</commentid>
    <comment_count>11</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-12-16 22:43:28 +0000</bug_when>
    <thetext>(In reply to Tab Atkins Jr. from comment #10)

&gt; Given that currently url() is only usable for importing stylesheets and
&gt; including images,

and font files...

&gt; it seems likely that Anne is correct.  Anecdotally, the
&gt; main use of query strings on stylesheets is to cache-bust (and then the
&gt; contents are irrelevant), and query strings on images are only for
&gt; dynamically-generated ones, which are rare, or database keys, which are
&gt; nearly always ASCII.

This seems reasonable, but it&apos;s not data. :-P

(In reply to Anne from comment #9)
&gt; No data. But the reason we have the quirk in HTML is because of &lt;form&gt;.

I thought it was required for at least &lt;a href&gt; also, but yeah.

&gt; Are your tests public?

https://github.com/w3c/web-platform-tests/pull/444

It turns out that:
in Presto, @import uses the document&apos;s encoding.
in Blink, @import uses utf-8.
in Gecko, &lt;style&gt; uses utf-8. (I get a different result now than in comment 4. Not sure why.)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>