<?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>296989</bug_id>
          
          <creation_ts>2025-08-06 01:51:46 -0700</creation_ts>
          <short_desc>madisoncity.k12.al.us: Search button is not working (Adds Quirks needsFormControlToBeMouseFocusable)</short_desc>
          <delta_ts>2025-12-09 14:01:03 -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>WebKit 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://www.madisoncity.k12.al.us/Page/11</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>22261</dependson>
    
    <dependson>193478</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Karl Dubost">karlcow</reporter>
          <assigned_to name="Karl Dubost">karlcow</assigned_to>
          <cc>cdumez</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2134649</commentid>
    <comment_count>0</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2025-08-06 01:51:46 -0700</bug_when>
    <thetext>This was initially reported on https://github.com/webcompat/web-bugs/issues/151961

1. Go to https://www.madisoncity.k12.al.us/Page/11
2. Click on the magnifier at the top right of the menu bar.

Results:
nothing

Expected:
a search form appears like in Firefox and Chrome.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2134650</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-08-06 01:54:22 -0700</bug_when>
    <thetext>&lt;rdar://problem/157639717&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2134651</commentid>
    <comment_count>2</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2025-08-06 01:59:17 -0700</bug_when>
    <thetext>```
&lt;div id=&quot;gb-search&quot; class=&quot;ui-clear&quot; data-search-icon-color=&quot;White&quot;&gt;
                      &lt;button id=&quot;gb-search-btn&quot; class=&quot;cs-btn-reset&quot; aria-controls=&quot;gb-search-form&quot; aria-label=&quot;Search&quot; aria-expanded=&quot;false&quot;&gt;&lt;span class=&quot;cs-ally-hidden&quot;&gt;Search&lt;/span&gt;&lt;/button&gt;
                      &lt;div id=&quot;gb-search-form-menu&quot; aria-hidden=&quot;true&quot;&gt;
                          &lt;form id=&quot;gb-search-form&quot;&gt;
                              &lt;div class=&quot;search-input-icon drt-aspire-icon-font&quot;&gt;&lt;/div&gt;
                              &lt;label for=&quot;gb-search-input&quot; class=&quot;cs-ally-hidden&quot;&gt;Search...&lt;/label&gt;		
                              &lt;input tabindex=&quot;-1&quot; type=&quot;text&quot; id=&quot;gb-search-input&quot; class=&quot;gb-search-input&quot; value=&quot;Search...&quot;&gt;
                              &lt;button tabindex=&quot;-1&quot; type=&quot;submit&quot; id=&quot;gb-submit-search&quot; class=&quot;cs-btn-reset&quot; aria-label=&quot;submit search&quot;&gt;&lt;span&gt;Go&lt;/span&gt;&lt;/button&gt;
                          &lt;/form&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
```

There are two events defined: focus and hover and they both call:



```
$(&quot;#gb-search #gb-search-btn&quot;).on(&quot;hover focus&quot;, function(e) {
            	//if(_this.AllyClick(e)) {
                	e.preventDefault();
                	if(!$(&quot;#gb-search-form-menu&quot;).hasClass(&quot;open&quot;)){
                    	$(&quot;#gb-search-input, #gb-submit-search&quot;).attr(&quot;tabindex&quot;,&quot;0&quot;);
                    	$(&quot;#gb-search-form-menu&quot;).addClass(&quot;open&quot;).attr(&quot;aria-hidden&quot;,&quot;false&quot;);
                        $(this).addClass(&quot;open&quot;).attr(&quot;aria-expanded&quot;,&quot;true&quot;);
                        	$(&quot;#gb-search-form #gb-search-input&quot;).focus();
                    } else {
                    	$(&quot;#gb-search-input, #gb-submit-search&quot;).attr(&quot;tabindex&quot;,&quot;-1&quot;);
                    	$(&quot;#gb-search-form-menu&quot;).removeClass(&quot;open&quot;).attr(&quot;aria-hidden&quot;,&quot;true&quot;);
                        $(this).removeClass(&quot;open&quot;).focus().attr(&quot;aria-expanded&quot;,&quot;false&quot;);
                    }
                //}
            });
        },
```

not sure why AllyClick has been put in comment. 

```
        &quot;AllyClick&quot;: function(event) {
            if(event.type == &quot;click&quot;) {
                return true;
            } else if(event.type == &quot;keydown&quot;) {
                if(event.keyCode == this.KeyCodes.space || event.keyCode == this.KeyCodes.enter) {
                    return true;
                }
            } else {
                return false;
            }
        },
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2136132</commentid>
    <comment_count>3</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2025-08-13 00:07:43 -0700</bug_when>
    <thetext>The website expects button to be focusable. 
While this is expected by the web platform, it is for now a choice for macOS platform convention to not follow this behavior. 

See previously:
Bug 22261
Bug 193478</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2136148</commentid>
    <comment_count>4</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2025-08-13 01:19:07 -0700</bug_when>
    <thetext>To note that if the site was just doing that 

```
            $(&quot;#gb-search #gb-search-btn&quot;).on(&quot;focus hover click&quot;, function(e) {
            	//if(_this.AllyClick(e)) {
                	e.preventDefault();
```

it would work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2136151</commentid>
    <comment_count>5</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2025-08-13 01:31:03 -0700</bug_when>
    <thetext>So it&apos;s not enough to add

https://searchfox.org/wubkat/rev/1880bd04e75e45ec48e76e3c61706f9514ab3d99/Source/WebCore/page/Quirks.cpp#174-183
```cpp
// ceac.state.gov https://bugs.webkit.org/show_bug.cgi?id=193478
// weather.com rdar://139689157
bool Quirks::needsFormControlToBeMouseFocusable() const
{
#if PLATFORM(MAC)
    return needsQuirks() &amp;&amp; m_quirksData.needsFormControlToBeMouseFocusableQuirk;
#else
    return false;
#endif // PLATFORM(MAC)
}
```

to solve the issue</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2136154</commentid>
    <comment_count>6</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2025-08-13 02:00:49 -0700</bug_when>
    <thetext>I was wondering if it was because the code has                     	
    $(&quot;#gb-search-input, #gb-submit-search&quot;).attr(&quot;tabindex&quot;,&quot;0&quot;);

and this part 

https://searchfox.org/wubkat/rev/1880bd04e75e45ec48e76e3c61706f9514ab3d99/Source/WebCore/html/HTMLFormControlElement.cpp#236-246
```cpp
bool HTMLFormControlElement::isMouseFocusable() const
{
#if (PLATFORM(GTK) || PLATFORM(WPE))
    return HTMLElement::isMouseFocusable();
#else
    // FIXME: We should remove the quirk once &lt;rdar://problem/47334655&gt; is fixed.
    if (!!tabIndexSetExplicitly() || document().quirks().needsFormControlToBeMouseFocusable())
        return HTMLElement::isMouseFocusable();
    return false;
#endif
}
```

but we are not reaching the code inside the if, so maybe there is something broken in the code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2136155</commentid>
    <comment_count>7</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2025-08-13 02:10:25 -0700</bug_when>
    <thetext>Oh… 
is it because 
   https://searchfox.org/wubkat/source/Source/WebCore/html/HTMLButtonElement.cpp 
has isMouseFocusable at all.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2136156</commentid>
    <comment_count>8</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2025-08-13 02:39:02 -0700</bug_when>
    <thetext>Ah no we correctly enter 
bool HTMLFormControlElement::isMouseFocusable() const {}
we do not pass the `if` for https://www.madisoncity.k12.al.us/Page/11
maybe my domain check is not correct.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2136159</commentid>
    <comment_count>9</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2025-08-13 03:04:23 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/49323</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2164586</commentid>
    <comment_count>10</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-12-09 14:01:01 -0800</bug_when>
    <thetext>Committed 304177@main (92a0e1480875): &lt;https://commits.webkit.org/304177@main&gt;

Reviewed commits have been landed. Closing PR #49323 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>