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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>178145</bug_id>
          
          <creation_ts>2017-10-10 14:32:10 -0700</creation_ts>
          <short_desc>Anchor targeting does not work right with javascript: URLs</short_desc>
          <delta_ts>2017-10-10 22:49:33 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>174891</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Boris Zbarsky">bzbarsky</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>annevk</cc>
    
    <cc>cdumez</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1358918</commentid>
    <comment_count>0</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2017-10-10 14:32:10 -0700</bug_when>
    <thetext>STEPS TO REPRODUCE:

1. Load the testcase.
2. Click the link.

EXPECTED RESULTS: The alert should say &quot;Should be about:blank: about:blank&quot;

ACTUAL RESULTS: The alert says: &quot;Should be about:blank: XXXX&quot; where XXXX is the actual url of the testcase page.

ADDITIONAL INFORMATION: The HTML spec is pretty clear on this: the target is used to find the right browsing context before any script gets run, and then it runs in the current window in the target browsing context.  Safari is running it in the wrong window.

Note, in particular, that this:

  &lt;a href=&quot;javascript:alert(location.href)&quot; target=&quot;_blank&quot;&gt;Click me&lt;/a&gt;

should open a new window and then run the JS in there, which Safari also doesn&apos;t do.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1358920</commentid>
    <comment_count>1</comment_count>
      <attachid>323352</attachid>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2017-10-10 14:32:38 -0700</bug_when>
    <thetext>Created attachment 323352
Testcase</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1359055</commentid>
    <comment_count>2</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2017-10-10 22:49:33 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 174891 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>323352</attachid>
            <date>2017-10-10 14:32:38 -0700</date>
            <delta_ts>2017-10-10 14:32:38 -0700</delta_ts>
            <desc>Testcase</desc>
            <filename>baz.html</filename>
            <type>text/html</type>
            <size>147</size>
            <attacher name="Boris Zbarsky">bzbarsky</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxpZnJhbWUgbmFtZT0idGFyZ2V0Ij48L2lmcmFtZT4KPGEgaHJlZj0i
amF2YXNjcmlwdDphbGVydCgnU2hvdWxkIGJlIGFib3V0OmJsYW5rOiAnICsgbG9jYXRpb24uaHJl
ZikiIHRhcmdldD0idGFyZ2V0Ij5DbGljayBtZTwvYT4K
</data>

          </attachment>
      

    </bug>

</bugzilla>