<?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>119291</bug_id>
          
          <creation_ts>2013-07-30 16:20:44 -0700</creation_ts>
          <short_desc>HTMLOptionElement::defaultSelected should affect selection state of other option elements</short_desc>
          <delta_ts>2023-06-14 14:53:18 -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>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>https://jsfiddle.net/oyukfm42/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BlinkMergeCandidate, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ryosuke Niwa">rniwa</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>jonlee</cc>
    
    <cc>tkent</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>913085</commentid>
    <comment_count>0</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2013-07-30 16:20:44 -0700</bug_when>
    <thetext>Consider merging https://chromium.googlesource.com/chromium/blink/+/e8f0337fdc86554b48cf81d7ed8c286f251d2405

According to the standard, we should set selectedness to true if defaultSelected
is set to true, and we should not set selectedness to false if defaultSelected
is set to false because the standard says nothing about it.

[1]
&gt; Whenever an option element&apos;s selected attribute is added, its selectedness
&gt; must be set to true.

When the selectedness of an option is udpated, other options&apos;s selectedness
should become false.

[2]
&gt; If the multiple attribute is absent, whenever an option element in the select
&gt; element&apos;s list of options has its selectedness set to true, and whenever an
&gt; option element with its selectedness set to true is added to the select
&gt; element&apos;s list of options, the user agent must set the selectedness of all the
&gt; other option elements in its list of options to false.

The old behavior doesn&apos;t match to the standard and any other browsers.
The new behavior matches to IE10 and the standard.

We need to update pseudoclass-update-checked-option.html because the
expected behavior of the test was incorrect.

[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#attr-option-selected
[2] http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#the-select-element</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1961538</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-06-14 04:56:27 -0700</bug_when>
    <thetext>We should do following rather than commit from Comment 0:

https://chromium.googlesource.com/chromium/src.git/+/4288626a69e2e6426555bb174a99e555e174f755

It make us pass linked test case in URL field, where we are failing following tests:

FAIL select1[2].defaultSelected = true; selectionMap(select1) should be 001. Was 101.
FAIL select1[1].defaultSelected = true; selectionMap(select1) should be 010. Was 111.
FAIL select1[1].defaultSelected = false; selectionMap(select1) should be 100. Was 101.
FAIL select1[2].selected = true;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1961539</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-06-14 04:59:14 -0700</bug_when>
    <thetext>(In reply to Ahmad Saleem from comment #1)
&gt; We should do following rather than commit from Comment 0:
&gt; 
&gt; https://chromium.googlesource.com/chromium/src.git/+/
&gt; 4288626a69e2e6426555bb174a99e555e174f755
&gt; 
&gt; It make us pass linked test case in URL field, where we are failing
&gt; following tests:
&gt; 
&gt; FAIL select1[2].defaultSelected = true; selectionMap(select1) should be 001.
&gt; Was 101.
&gt; FAIL select1[1].defaultSelected = true; selectionMap(select1) should be 010.
&gt; Was 111.
&gt; FAIL select1[1].defaultSelected = false; selectionMap(select1) should be
&gt; 100. Was 101.
&gt; FAIL select1[2].selected = true;

This needs to be done in following function (HTMLOptionElement::attributeChanged):

if (oldValue.isNull() != newValue.isNull())
            setSelected(!newValue.isNull());</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1961653</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-06-14 14:52:40 -0700</bug_when>
    <thetext>Committed 265167@main (efb64fda19d2): &lt;https://commits.webkit.org/265167@main&gt;

Reviewed commits have been landed. Closing PR #14955 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1961654</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-06-14 14:53:18 -0700</bug_when>
    <thetext>&lt;rdar://problem/110800420&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>