<?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>13859</bug_id>
          
          <creation_ts>2011-08-22 08:02:57 +0000</creation_ts>
          <short_desc>It seems href IDL attribute on base element doesn&apos;t reflect content attribute when there is more than one base element with &quot;href&quot;.</short_desc>
          <delta_ts>2011-10-25 02:01:29 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#the-base-element</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>csf178</cc>
    
    <cc>ian</cc>
    
    <cc>kennyluck</cc>
    
    <cc>mike</cc>
    
    <cc>Ms2ger</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>55565</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-08-22 08:02:57 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/
Multipage: http://www.whatwg.org/C#the-base-element
Complete: http://www.whatwg.org/c#the-base-element

Comment:
It seems href IDL attribute on base element doesn&apos;t reflect content attribute
when there is more than one base element with &quot;href&quot;. 

Posted from: 114.80.133.8 by csf178@163.com
User agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.41 Safari/535.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55566</commentid>
    <comment_count>1</comment_count>
    <who name="Shaofei Cheng">csf178</who>
    <bug_when>2011-08-22 08:12:23 +0000</bug_when>
    <thetext>Consider the following html:

&lt;!DOCTYPE html&gt;
&lt;html xmlns=&quot;  http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
    &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=GB2312&quot; /&gt;
    &lt;base id=&quot;a&quot; href=&quot;  http://www.baidu.com&quot; /&gt;
    &lt;base id=&quot;b&quot; href=&quot;  http://www.google.com&quot; /&gt;
    &lt;title&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
        alert([document.getElementById(&quot;a&quot;).href,document.getElementById(&quot;b&quot;).href]);
    &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;

According to the standard
&quot;The href IDL attribute, on getting, must return the page&apos;s document base URL&quot;

a.href and b.href should return the same value &quot; http://www.baidu.com&quot;. But this behavior is different from most implementations&apos;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55573</commentid>
    <comment_count>2</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2011-08-22 10:12:39 +0000</bug_when>
    <thetext>From code inspection, webkit reflects, and Gecko returns the content attribute, if it exists, and the page&apos;s document base URL otherwise.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57818</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-04 23:40:23 +0000</bug_when>
    <thetext>Opera seems to just reflect as well.

How important is Gecko&apos;s behaviour when there&apos;s no attribute?

Anyone know what IE does?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57845</commentid>
    <comment_count>4</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2011-10-05 13:04:11 +0000</bug_when>
    <thetext>http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1180

I get

log: http://software.hixie.ch/utilities/js/live-dom-viewer/foo
log: http://software.hixie.ch/utilities/js/live-dom-viewer/bar
log: 

with IE9 (and the same without a doctype), so seems like they reflect as well.

Ignore what I said before about Gecko, I don&apos;t actually understand what the code does. See &lt;https://bugzilla.mozilla.org/show_bug.cgi?id=600809&gt; for its behaviour, though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57846</commentid>
    <comment_count>5</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2011-10-05 14:27:25 +0000</bug_when>
    <thetext>&gt; I don&apos;t actually understand what the code does.

Gecko&apos;s code for .href on a &lt;base&gt; attribute is as follows:

1)  Try to create a valid URI using the document&apos;s current URI as the base URI
    and the value of the attribute as the uri reference.
2)  If this succeeeds,  return the result.
3)  If not, return the value of the attribute.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58028</commentid>
    <comment_count>6</comment_count>
    <who name="Shaofei Cheng">csf178</who>
    <bug_when>2011-10-11 03:25:25 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; &gt; I don&apos;t actually understand what the code does.
&gt; 
&gt; Gecko&apos;s code for .href on a &lt;base&gt; attribute is as follows:
&gt; 
&gt; 1)  Try to create a valid URI using the document&apos;s current URI as the base URI
&gt;     and the value of the attribute as the uri reference.
&gt; 2)  If this succeeeds,  return the result.
&gt; 3)  If not, return the value of the attribute.

I tried the HTML above in Firefox 7.0 and the two base element returns different value when get IDL attribute href.

It looks conflict with Boris&apos; comment?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58062</commentid>
    <comment_count>7</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2011-10-11 16:45:04 +0000</bug_when>
    <thetext>&gt; It looks conflict with Boris&apos; comment?

Only if you misunderstood my comment.  Step 1 from my comment would lead to different values for the HTML from comment 1, if that&apos;s what you were testing on.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58114</commentid>
    <comment_count>8</comment_count>
    <who name="Shaofei Cheng">csf178</who>
    <bug_when>2011-10-12 10:46:58 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; &gt; It looks conflict with Boris&apos; comment?
&gt; 
&gt; Only if you misunderstood my comment.  Step 1 from my comment would lead to
&gt; different values for the HTML from comment 1, if that&apos;s what you were testing
&gt; on.

Ah. Sorry, I misunderstand step 1. It should lead to different values.

I tried IE8&amp;#12289;Chrome and Firefox.

I set a relative URL to href and all the three browsers returned the resolved URL on getting.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58763</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-24 17:44:44 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: Ok, I went with just reflecting. This doesn&apos;t match Gecko in the case where the attribute is absent, but that doesn&apos;t seem necessary for compat since the other browsers don&apos;t do it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58764</commentid>
    <comment_count>10</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-10-24 17:45:16 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r6734.
Check-in comment: &lt;base&gt;.href reflects, apparently.
http://html5.org/tools/web-apps-tracker?from=6733&amp;to=6734</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>