<?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>191581</bug_id>
          
          <creation_ts>2018-11-13 00:49:42 -0800</creation_ts>
          <short_desc>Hidden attribute does not apply to optgroup and option</short_desc>
          <delta_ts>2020-12-06 10:59:44 -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>Layout and Rendering</component>
          <version>Safari 12</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.13</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>69014</dup_id>
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=169039</see_also>
          <bug_file_loc>https://html.spec.whatwg.org/multipage/rendering.html#the-select-element-2</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Dev Eloper">develop</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>cdumez</cc>
    
    <cc>koivisto</cc>
    
    <cc>rniwa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1477939</commentid>
    <comment_count>0</comment_count>
    <who name="Dev Eloper">develop</who>
    <bug_when>2018-11-13 00:49:42 -0800</bug_when>
    <thetext>The spec defines[0] on all HTML elements (subclasses of HTMLElement), including optgroup (HTMLOptGroupElement) and option (HTMLOptionElement) a hidden attribute.
Unlike Firefox, Edge, and Chrome, Safari does not (visually) reflect the semantics of setting this attribute: &quot;User agents should not render elements that have the hidden attribute specified.&quot;
In the following demo, optgroup and option are visible in Safari: http://jsfiddle.net/c1nzxm8e/

[0] https://html.spec.whatwg.org/multipage/interaction.html#the-hidden-attribute</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1478004</commentid>
    <comment_count>1</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2018-11-13 08:57:32 -0800</bug_when>
    <thetext>Web Inspector properly reports that both the &lt;option&gt; and &lt;optgroup&gt; have &quot;display: none&quot; computed style, yet they are indeed visible :/

If I add &quot;hidden&quot; attribute the the &lt;select&gt; element then the &lt;select&gt; also becomes &quot;display: none&quot;, and then it becomes indeed hidden.

The issue is therefore specific to &lt;option&gt; and &lt;optgroup&gt; elements somehow. Also, I do not believe this is actually a DOM/HTML issue since the CSS style was properly set. This is more likely a CSS or rendering issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1478006</commentid>
    <comment_count>2</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2018-11-13 08:59:56 -0800</bug_when>
    <thetext>Both HTMLOptionElement and HTMLOptGroupElement have the following override:
bool rendererIsNeeded(const RenderStyle&amp;) final { return false; }

Not sure why they do not need a renderer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1478007</commentid>
    <comment_count>3</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2018-11-13 09:04:38 -0800</bug_when>
    <thetext>The default definition of rendererIsNeeded is:
bool Element::rendererIsNeeded(const RenderStyle&amp; style)
{
    return style.display() != DisplayType::None &amp;&amp; style.display() != DisplayType::Contents;
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1478010</commentid>
    <comment_count>4</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2018-11-13 09:09:10 -0800</bug_when>
    <thetext>This may also be relevant:
bool HTMLSelectElement::childShouldCreateRenderer(const Node&amp; child) const
{
    if (!HTMLFormControlElementWithState::childShouldCreateRenderer(child))
        return false;
#if !PLATFORM(IOS_FAMILY)
    if (!usesMenuList())
        return is&lt;HTMLOptionElement&gt;(child) || is&lt;HTMLOptGroupElement&gt;(child) || validationMessageShadowTreeContains(child);
#endif
    return validationMessageShadowTreeContains(child);
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1478018</commentid>
    <comment_count>5</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2018-11-13 09:18:16 -0800</bug_when>
    <thetext>See also bug 169039. Our &lt;option&gt; rendering seems wonky.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1478021</commentid>
    <comment_count>6</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2018-11-13 09:22:34 -0800</bug_when>
    <thetext>Relevant rendering code seems to be in void RenderListBox::updateFromElement().
It grabs text from options and optgroup elements without taking into consideration their visibility.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1478024</commentid>
    <comment_count>7</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2018-11-13 09:25:08 -0800</bug_when>
    <thetext>Moving to Layout &amp; Rendering. I do not think I am the right assignee.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1555441</commentid>
    <comment_count>8</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-07-24 11:36:42 -0700</bug_when>
    <thetext>&lt;rdar://problem/53505809&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1712334</commentid>
    <comment_count>9</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2020-12-06 10:59:44 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 69014 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>