<?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>11740</bug_id>
          
          <creation_ts>2006-12-01 19:25:36 -0800</creation_ts>
          <short_desc>Javascript generated mailto: link (on Form submit) does not work in Safari</short_desc>
          <delta_ts>2007-10-21 22:47:47 -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>Forms</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>http://www.digitalmars.com/contact.html</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="Alexei Svitkine">myrd</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ain</cc>
    
    <cc>ap</cc>
    
    <cc>ddkilzer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>43550</commentid>
    <comment_count>0</comment_count>
    <who name="Alexei Svitkine">myrd</who>
    <bug_when>2006-12-01 19:25:36 -0800</bug_when>
    <thetext>See: http://www.digitalmars.com/contact.html

The website uses the following code to generate a mailto: link equivalent (and to prevent spam):

&lt;SCRIPT LANGUAGE=&quot;javascript&quot;&gt;
&lt;!-- 
var Domain = &quot;digitalmars.c&quot;;
var Mailme = &quot;mai&quot; + &quot;lto:w&quot; + &quot;gmars7@&quot; + Domain + &quot;om&quot;;
document.write(&quot;&lt;FORM&gt;&quot;);
document.write(&quot;&lt;INPUT TYPE=\&quot;submit\&quot; VALUE=\&quot;Send email to Digital Mars\&quot; &quot;);
document.write(&quot;onClick=\&quot;parent.location=Mailme\&quot;&gt; &quot;);
document.write(&quot;&lt;/FORM&gt;&quot;);
// --&gt;
&lt;/SCRIPT&gt;

This code works fine in Firefox 2.0 (and other browsers), but fails in latest Tiger Safari, as well as nightly r17960.

This is a pretty important website (Digital Mars is the creator of the D programming language, a really good language that hasn&apos;t yet caught on: http://www.digitalmars.com/d/ ).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58876</commentid>
    <comment_count>1</comment_count>
    <who name="Ain Tohvri">ain</who>
    <bug_when>2007-10-19 17:21:43 -0700</bug_when>
    <thetext>What happens is that your form gets posted. You should remove the form tags at all or set the submit to return false, e.g.

&lt;SCRIPT LANGUAGE=&quot;javascript&quot;&gt;
var Domain = &quot;digitalmars.c&quot;;
var Mailme = &quot;mail&quot;+&quot;to:w&quot; + &quot;gmars7@&quot; + Domain + &quot;om&quot;;
var html = &quot;&lt;form onsubmit=&apos;return false;&apos;&gt;&lt;input type=&apos;submit&apos; value=&apos;send email&apos; onclick=&apos;javascript:document.location.href=\&quot;&quot;+Mailme+&quot;\&quot;&apos;&gt;&lt;/form&gt;&quot;;
document.write(html);
&lt;/SCRIPT&gt;

Also, you&apos;ll not get a valid code out of this with just plain-empty form tags which is not the case if you leave them out.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58880</commentid>
    <comment_count>2</comment_count>
    <who name="Alexei Svitkine">myrd</who>
    <bug_when>2007-10-19 18:13:04 -0700</bug_when>
    <thetext>But it works in other browsers. Which makes Safari the incompatible one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58902</commentid>
    <comment_count>3</comment_count>
    <who name="Ain Tohvri">ain</who>
    <bug_when>2007-10-20 03:55:45 -0700</bug_when>
    <thetext>I don&apos;t agree incompatibility. The latest Opera 9.24 behaves the very same way. And these are the first browsers to pass Acid2.

In my humble opinion this is the case of valid coding. It is programmatically proper to be precise and strict in respect to the open standards.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58903</commentid>
    <comment_count>4</comment_count>
    <who name="Ain Tohvri">ain</who>
    <bug_when>2007-10-20 04:04:31 -0700</bug_when>
    <thetext>By the W3C HTML 4.01 Specification:
- submit buttons: When activated, a submit button submits a form. A form may contain more than one submit button.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59083</commentid>
    <comment_count>5</comment_count>
      <attachid>16782</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2007-10-21 22:37:24 -0700</bug_when>
    <thetext>Created attachment 16782
test case (with javascript: URL)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59088</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2007-10-21 22:47:47 -0700</bug_when>
    <thetext>We certainly want to be compatible with IE and Firefox, and I actually don&apos;t think that this behavior is non-standard. Onclick fires before submitting the form, and javascript/mailto URLs can be loaded synchronously. After that, the form is submitted.

See also: bug 13011.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>16782</attachid>
            <date>2007-10-21 22:37:24 -0700</date>
            <delta_ts>2007-10-21 22:37:24 -0700</delta_ts>
            <desc>test case (with javascript: URL)</desc>
            <filename>11740.html</filename>
            <type>text/html</type>
            <size>218</size>
            <attacher name="Alexey Proskuryakov">ap</attacher>
            
              <data encoding="base64">PFNDUklQVD4KdmFyIHVybCA9ICJqYXZhc2NyaXB0OmFsZXJ0KCdTVUNDRVNTJykiOwpkb2N1bWVu
dC53cml0ZSgiPEZPUk0+Iik7CmRvY3VtZW50LndyaXRlKCI8SU5QVVQgVFlQRT0nc3VibWl0JyBW
QUxVRT0nQ2xpY2sgbWUgdG8gc2VlIGFuIGFsZXJ0JyBvbkNsaWNrPSdwYXJlbnQubG9jYXRpb249
dXJsJz4gIik7CmRvY3VtZW50LndyaXRlKCI8L0ZPUk0+Iik7CjwvU0NSSVBUPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>