<?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>35256</bug_id>
          
          <creation_ts>2010-02-22 12:38:28 -0800</creation_ts>
          <short_desc>HTMLSelectElement::setSelectedIndexByUser() can trigger unnecessary JS when there is no change to the selected index</short_desc>
          <delta_ts>2010-02-22 14:43:42 -0800</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>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <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="John Sullivan">sullivan</reporter>
          <assigned_to name="John Sullivan">sullivan</assigned_to>
          <cc>eric</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>192561</commentid>
    <comment_count>0</comment_count>
    <who name="John Sullivan">sullivan</who>
    <bug_when>2010-02-22 12:38:28 -0800</bug_when>
    <thetext>This is a followup to &lt;http://trac.webkit.org/changeset/51602&gt;.

With that patch, HTMLSelectElement::setSelectedIndexByUser() is now triggered by Safari&apos;s forms autofill code. Some pages run JS that resets various form elements when the selected Country changes. As of 51602, that JS was being run even when there is no change to a pop-up element, which does no good and causes trouble for autofill.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>192567</commentid>
    <comment_count>1</comment_count>
      <attachid>49235</attachid>
    <who name="John Sullivan">sullivan</who>
    <bug_when>2010-02-22 12:46:45 -0800</bug_when>
    <thetext>Created attachment 49235
Patch to bail out of setSelectedIndexByUser when the new index matches the old one</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>192578</commentid>
    <comment_count>2</comment_count>
    <who name="John Sullivan">sullivan</who>
    <bug_when>2010-02-22 13:04:56 -0800</bug_when>
    <thetext>Fixed in &lt;http://trac.webkit.org/changeset/55101&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>192613</commentid>
    <comment_count>3</comment_count>
      <attachid>49235</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-02-22 14:06:42 -0800</bug_when>
    <thetext>Comment on attachment 49235
Patch to bail out of setSelectedIndexByUser when the new index matches the old one

Can&apos;t we write a manual test?  One which would simply alert() on the change?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>192614</commentid>
    <comment_count>4</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-02-22 14:06:57 -0800</bug_when>
    <thetext>:(  for lack of testing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>192645</commentid>
    <comment_count>5</comment_count>
    <who name="John Sullivan">sullivan</who>
    <bug_when>2010-02-22 14:43:42 -0800</bug_when>
    <thetext>A manual test would have to be dependent on a particular client, since setSelectedIndexByUser() is not called if the user brings up the pop-up menu and then dismisses it with the initially-selected item still selected. So that&apos;s more in the realm of testing the browser than testing WebCore, I think.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>49235</attachid>
            <date>2010-02-22 12:46:45 -0800</date>
            <delta_ts>2010-02-22 14:06:42 -0800</delta_ts>
            <desc>Patch to bail out of setSelectedIndexByUser when the new index matches the old one</desc>
            <filename>35256.txt</filename>
            <type>text/plain</type>
            <size>1377</size>
            <attacher name="John Sullivan">sullivan</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT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G1sL0hUTUxTZWxlY3RF
bGVtZW50LmNwcAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09Ci0tLSBXZWJDb3JlL2h0bWwvSFRNTFNlbGVjdEVsZW1lbnQu
Y3BwCShyZXZpc2lvbiA1NTAzNCkKKysrIFdlYkNvcmUvaHRtbC9IVE1MU2VsZWN0RWxlbWVudC5j
cHAJKHdvcmtpbmcgY29weSkKQEAgLTg3LDYgKzg3LDkgQEAgdm9pZCBIVE1MU2VsZWN0RWxlbWVu
dDo6c2V0U2VsZWN0ZWRJbmRleAogCiB2b2lkIEhUTUxTZWxlY3RFbGVtZW50OjpzZXRTZWxlY3Rl
ZEluZGV4QnlVc2VyKGludCBvcHRpb25JbmRleCwgYm9vbCBkZXNlbGVjdCwgYm9vbCBmaXJlT25D
aGFuZ2VOb3cpCiB7CisgICAgaWYgKG9wdGlvbkluZGV4ID09IHNlbGVjdGVkSW5kZXgoKSkKKyAg
ICAgICAgcmV0dXJuOworICAgIAogICAgIFNlbGVjdEVsZW1lbnQ6OnNldFNlbGVjdGVkSW5kZXgo
bV9kYXRhLCB0aGlzLCBvcHRpb25JbmRleCwgZGVzZWxlY3QsIGZpcmVPbkNoYW5nZU5vdywgdHJ1
ZSk7CiB9CiAK
</data>
<flag name="review"
          id="32034"
          type_id="1"
          status="+"
          setter="timothy"
    />
          </attachment>
      

    </bug>

</bugzilla>