Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ Deprecated
Features added
--------------

* #11701: HTML Search: use of `<search>`_ tag. Browsers compatibility is
preserved through the ARIA ``role="search"``.
Patch by Bénédikt Tran.

.. _`<search>`: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/search

Bugs fixed
----------

Expand Down
6 changes: 3 additions & 3 deletions sphinx/themes/basic/searchbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
:license: BSD, see LICENSE for details.
#}
{%- if pagename != "search" and builder != "singlehtml" %}
<div id="searchbox" style="display: none" role="search">
<search role="search">
<h3 id="searchlabel">{{ _('Quick search') }}</h3>
<div class="searchformwrapper">
<form class="search" action="{{ pathto('search') }}" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />
<input type="submit" value="{{ _('Go') }}" />
</form>
</div>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
{%- endif %}
6 changes: 3 additions & 3 deletions sphinx/themes/basic/searchfield.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
:license: BSD, see LICENSE for details.
#}
{%- if pagename != "search" and builder != "singlehtml" %}
<div id="searchbox" style="display: none" role="search">
<search role="search">
<div class="searchformwrapper">
<form class="search" action="{{ pathto('search') }}" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" placeholder="Search"/>
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" placeholder="Search" />
<input type="submit" value="{{ _('Go') }}" />
</form>
</div>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
{%- endif %}