Skip to content

Commit fb1e521

Browse files
authored
Use the new HTML <search> element (#11704)
1 parent 5730329 commit fb1e521

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

CHANGES.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ Deprecated
1717
Features added
1818
--------------
1919

20+
* #11701: HTML Search: Adopt the new `<search>`_ element.
21+
Patch by Bénédikt Tran.
22+
23+
.. _`<search>`: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/search
24+
2025
Bugs fixed
2126
----------
2227

sphinx/themes/agogo/layout.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ <h3>{{ _('Table of Contents') }}</h3>
3939
{{ toctree(includehidden=True) }}
4040
{%- endblock %}
4141
{%- block sidebarsearch %}
42-
<div role="search">
42+
<search role="search">
4343
<h3 style="margin-top: 1.5em;">{{ _('Search') }}</h3>
4444
<form class="search" action="{{ pathto('search') }}" method="get">
4545
<input type="text" name="q" />
4646
<input type="submit" value="{{ _('Go') }}" />
4747
</form>
48-
</div>
48+
</search>
4949
{%- endblock %}
5050
{% endmacro %}
5151

sphinx/themes/basic/searchbox.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
:license: BSD, see LICENSE for details.
99
#}
1010
{%- if pagename != "search" and builder != "singlehtml" %}
11-
<div id="searchbox" style="display: none" role="search">
11+
<search id="searchbox" style="display: none" role="search">
1212
<h3 id="searchlabel">{{ _('Quick search') }}</h3>
1313
<div class="searchformwrapper">
1414
<form class="search" action="{{ pathto('search') }}" method="get">
1515
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
1616
<input type="submit" value="{{ _('Go') }}" />
1717
</form>
1818
</div>
19-
</div>
19+
</search>
2020
<script>document.getElementById('searchbox').style.display = "block"</script>
2121
{%- endif %}

sphinx/themes/basic/searchfield.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
:license: BSD, see LICENSE for details.
1212
#}
1313
{%- if pagename != "search" and builder != "singlehtml" %}
14-
<div id="searchbox" style="display: none" role="search">
14+
<search id="searchbox" style="display: none" role="search">
1515
<div class="searchformwrapper">
1616
<form class="search" action="{{ pathto('search') }}" method="get">
1717
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" placeholder="Search"/>
1818
<input type="submit" value="{{ _('Go') }}" />
1919
</form>
2020
</div>
21-
</div>
21+
</search>
2222
<script>document.getElementById('searchbox').style.display = "block"</script>
2323
{%- endif %}

0 commit comments

Comments
 (0)