<?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>24140</bug_id>
          
          <creation_ts>2009-02-24 14:58:04 -0800</creation_ts>
          <short_desc>REGRESSION: Safari input field value update via Javascript not rendered in UI</short_desc>
          <delta_ts>2009-03-12 10:40:37 -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>Layout and Rendering</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>24508</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, Regression</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ben Gummer">bengummer</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>110830</commentid>
    <comment_count>0</comment_count>
    <who name="Ben Gummer">bengummer</who>
    <bug_when>2009-02-24 14:58:04 -0800</bug_when>
    <thetext>Summary: 
When a text field in Safari 4 has a zero-length value AND has a non zero-length placeholder value, the first attempt to update the value of such a field (using Javascript) is not rendered in the browser UI.

Steps to Reproduce:
1. Create an HTML file containing a text field element with a zero-length value, such as &lt;input type=&quot;text&quot; value=&quot;&quot; placeholder=&quot;Placeholder&quot; id=&quot;test&quot;&gt;
2. Use Javascript to update the value of the text field element, such as document.getElementById(&apos;test&apos;).value = &quot;Javascript assigned value&quot;;
3. Notice that when the Javascript is run, the text field element still displays it&apos;s placeholder, and not the new value assigned using Javascript.
4. Run the Javascript a second time (without reloading the page).
5. Notice that the expected value is shown upon the second execution of the Javascript.

Expected Results:
When the Javascript is run for the first time, it is expected that the text field element will display the value assigned via Javascript.

Actual Results:
When the Javascript is run for the first time, the text field element continues to display it&apos;s placeholder value, instead of the new actual value assigned via Javascript. Executing the Javascript a second time causes the value changes to be rendered as expected.

Regression:
This problem only occurs when a text field element&apos;s &apos;placeholder&apos; attribute is set to a non-zero-length string, AND when the same text field element&apos;s &apos;value&apos; attribute is set to a zero-length string.

This problem does not occur in Safari 3.

Notes:
I have uploaded a demo script to demonstrate the problem (see http://pastie.org/399137.txt)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110831</commentid>
    <comment_count>1</comment_count>
      <attachid>27938</attachid>
    <who name="Ben Gummer">bengummer</who>
    <bug_when>2009-02-24 14:58:52 -0800</bug_when>
    <thetext>Created attachment 27938
A test script to reproduce the problem</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110957</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-02-25 08:29:37 -0800</bug_when>
    <thetext>Confirmed using  a local build of r41181.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113350</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-03-12 02:40:18 -0700</bug_when>
    <thetext>&lt;rdar://problem/6674177&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113413</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-03-12 10:40:37 -0700</bug_when>
    <thetext>Please cross-reference bugs when filing both here and in Radar.

*** This bug has been marked as a duplicate of 24508 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>27938</attachid>
            <date>2009-02-24 14:58:52 -0800</date>
            <delta_ts>2009-02-24 14:58:52 -0800</delta_ts>
            <desc>A test script to reproduce the problem</desc>
            <filename>TestBug.html</filename>
            <type>text/html</type>
            <size>948</size>
            <attacher name="Ben Gummer">bengummer</attacher>
            
              <data encoding="base64">PGh0bWw+Cgo8aGVhZD4KCTxzY3JpcHQ+CgkJZnVuY3Rpb24gdGVzdEJ1ZygpIHsKCQkJZG9jdW1l
bnQuZ2V0RWxlbWVudEJ5SWQoJ3Rlc3QnKS52YWx1ZSA9ICJKYXZhc2NyaXB0IGFzc2lnbmVkIHZh
bHVlIjsKCQkJdXBkYXRlTGVuZ3RoKCk7CgkJfQoJCQoJCWZ1bmN0aW9uIHVwZGF0ZUxlbmd0aCgp
IHsKCQkJZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ3ZhbHVlbGVuZ3RoJykuaW5uZXJIVE1MID0g
ZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ3Rlc3QnKS52YWx1ZS5sZW5ndGg7CgkJfQoJPC9zY3Jp
cHQ+CjwvaGVhZD4KCjxib2R5IG9ubG9hZD0iamF2YXNjcmlwdDp1cGRhdGVMZW5ndGgoKTsiPgoJ
PGlucHV0IHR5cGU9InRleHQiIHZhbHVlPSIiIHBsYWNlaG9sZGVyPSJQbGFjZWhvbGRlciIgaWQ9
InRlc3QiPiBGaWVsZCB2YWx1ZSBsZW5ndGggaXMgPHNwYW4gaWQ9InZhbHVlbGVuZ3RoIj48L3Nw
YW4+IGNoYXJhY3RlcnM8YnIvPgoJPGEgaHJlZj0iamF2YXNjcmlwdDp0ZXN0QnVnKCk7Ij5UZXN0
IEJ1ZzwvYT48cC8+CglUbyByZXByb2R1Y2U6Cgk8b2w+CgkJPGxpPkNsaWNrIG9uIHRoZSBsaW5r
IGFib3ZlLiBJdCB3aWxsIHVwZGF0ZSB0aGUgZmllbGQgdmFsdWUgdG8gJnF1b3Q7SmF2YXNjcmlw
dCBhc3NpZ25lZCB2YWx1ZSZxdW90Oy48L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