<?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>26338</bug_id>
          
          <creation_ts>2014-07-15 18:28:53 +0000</creation_ts>
          <short_desc>Limit query encoding override to http/https</short_desc>
          <delta_ts>2015-06-17 15:33:01 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>URL</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Sapin">simon.sapin</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>mike</cc>
    
    <cc>rubys</cc>
    
    <cc>simon.sapin</cc>
          
          <qa_contact>sideshowbarker+urlspec</qa_contact>

      

      

      <flag name="needinfo"
          id="36"
          type_id="3"
          status="?"
          setter="annevk"
          requestee="simon.sapin"
    />

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>108953</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Sapin">simon.sapin</who>
    <bug_when>2014-07-15 18:28:53 +0000</bug_when>
    <thetext>The spec currently says, in the query state of the URL parser:

&gt; If url&apos;s relative flag is unset or url&apos;s scheme is either &quot;ws&quot; or &quot;wss&quot;, set encoding override to utf-8.

The relative flag is only set of &quot;ftp&quot;, &quot;file&quot;, &quot;gopher&quot;, &quot;http&quot;, &quot;https&quot;, &quot;ws&quot;, and &quot;wss&quot; schemes. The query does not apply to &quot;ftp&quot;, &quot;file&quot;, or &quot;gopher&quot;. This leaves only &quot;http&quot; and &quot;https&quot; schemes where the encoding override is relevant.

Rather than adding all future relative schemes to the blacklist for this quirk, I suggest whitelisting. Change the quoted text to:

&gt; If url&apos;s scheme is neither &quot;http&quot; nor &quot;https&quot;, set encoding override to utf-8.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109362</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-07-28 13:27:34 +0000</bug_when>
    <thetext>Why does query not apply to those schemes? You can submit forms within file URLs for instance.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109369</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Sapin">simon.sapin</who>
    <bug_when>2014-07-28 14:43:41 +0000</bug_when>
    <thetext>You can, but the query string is not transmitted over the wire for the server-side to process. Or, for the file scheme, there isn’t any server-side software that could process the query string.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109370</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-07-28 14:46:21 +0000</bug_when>
    <thetext>Isn&apos;t client-side equally affected?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109375</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Sapin">simon.sapin</who>
    <bug_when>2014-07-28 15:12:07 +0000</bug_when>
    <thetext>decodeURIComponent() always uses UTF-8, so using any other character encoding for percent-encoding seems more likely to cause mojibake when the query string is used on the client-side.

http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109378</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-07-28 15:25:34 +0000</bug_when>
    <thetext>Sure, but what about compatibility? Or are you saying this is how it works today?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117892</commentid>
    <comment_count>6</comment_count>
    <who name="admin">fbi_alkhayal_81</who>
    <bug_when>2015-02-13 16:08:31 +0000</bug_when>
    <thetext>// ==UserScript==
// @name          Travian UI treak
// @namespace     http://userstyles.org
// @description	  Travian UI treak with T3B ML&amp;CN
// @author        gogonkt
// @homepage      http://userstyles.org/styles/30248
// @include       http://travian.tw/*
// @include       https://travian.tw/*
// @include       http://*.travian.tw/*
// @include       https://*.travian.tw/*
// @run-at        document-start
// ==/UserScript==
(function() {
var css = &quot;#side_navi{\n   width: 120px !important;\n   float: right !important;}\n\n#side_info{\n   width: 380px !important;}\n\n#tasklisttable_wrapper{\n  padding: 0px !important;\n  top: 535px !important; left: 30px !important; position: fixed !important;}\n\ntable&gt;caption,#tasklisttable&gt;tbody{\n  display: none !important;}\n\n#res{\n  left: 0px !important;}\n\n#mid{\n  background: none !important;}\n\ntable tbody td{\n  padding-left: 0px !important;}&quot;;
if (typeof GM_addStyle != &quot;undefined&quot;) {
	GM_addStyle(css);
} else if (typeof PRO_addStyle != &quot;undefined&quot;) {
	PRO_addStyle(css);
} else if (typeof addStyle != &quot;undefined&quot;) {
	addStyle(css);
} else {
	var node = document.createElement(&quot;style&quot;);
	node.type = &quot;text/css&quot;;
	node.appendChild(document.createTextNode(css));
	var heads = document.getElementsByTagName(&quot;head&quot;);
	if (heads.length &gt; 0) {
		heads[0].appendChild(node); 
	} else {
		// no head yet, stick it whereever
		document.documentElement.appendChild(node);
	}
}
})();</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121199</commentid>
    <comment_count>7</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-06-17 15:33:01 +0000</bug_when>
    <thetext>This is now restricted to a whitelist, the special URLs minus ws/wss.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>