<?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>23461</bug_id>
          
          <creation_ts>2013-10-08 16:17:12 +0000</creation_ts>
          <short_desc>Strip leading slashes?</short_desc>
          <delta_ts>2014-01-13 18:23:06 +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="Erik Arvidsson">erik.arvidsson</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>mike</cc>
    
    <cc>santi</cc>
          
          <qa_contact>sideshowbarker+urlspec</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>94473</commentid>
    <comment_count>0</comment_count>
    <who name="Erik Arvidsson">erik.arvidsson</who>
    <bug_when>2013-10-08 16:17:12 +0000</bug_when>
    <thetext>Both WebKit/Blink and Gecko strip leading slashes when setting hostname. IE throws.

a = document.createElement(&apos;a&apos;);
a.href = &apos;http://abc.de:8080/path/name?search#hash&apos;
a.hostname = &apos;///xyz&apos;;
assert(a.href === &apos;http://xyz:8080/path/name?search#hash&apos;)

I&apos;m also fine throwing in cases like these but we should specify what the intended behavior is.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94752</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-10-15 12:32:49 +0000</bug_when>
    <thetext>So you parse using http://url.spec.whatwg.org/#hostname-state as override state. It will lead to &quot;host&quot; being the empty sequence which will lead to the host parser returning failure which means the parse operation will return failure. Which means host remains unchanged.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94753</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-10-15 12:35:06 +0000</bug_when>
    <thetext>Note that ignoring invalid values is consistent with eg:

a.hostname = &quot;a a&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94765</commentid>
    <comment_count>3</comment_count>
    <who name="Erik Arvidsson">erik.arvidsson</who>
    <bug_when>2013-10-15 14:22:37 +0000</bug_when>
    <thetext>In cases like these. Are we trying to spec what browsers do or what we want them to do?

If we are making changes I think I would prefer us to follow IE in these cases and throw instead of silently ignoring.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98282</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-01-11 16:53:52 +0000</bug_when>
    <thetext>I&apos;m not sure that specifying what IE does make sense. E.g. if I try

  a = document.createElement(&quot;a&quot;)
  a.href = &quot;http://example&quot;
  a.hostname = &quot;a:a&quot;

IE does not throw. But if I then read a.hostname it throws. Do we really want to define that? For most other cases we silently ignore errors. Starting to throw could cause more breakage in sites. Apple is typically extremely hesitant to switch from non-throwing to throwing as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98346</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-01-13 18:23:06 +0000</bug_when>
    <thetext>Ignore was fine in bug 23474 too.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>