Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc598ff0

Browse files
Add the <search> element
Closes#5811.Co-authored-by: Scott O'Hara <scottaohara@users.noreply.github.com>
1 parentdbe5f6c commitc598ff0

File tree

2 files changed

+158
-28
lines changed

2 files changed

+158
-28
lines changed

‎images/content-venn.svg‎

Lines changed: 1 addition & 0 deletions
Loading

‎source‎

Lines changed: 157 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12178,6 +12178,7 @@ console.assert(image.height === 200);</code></pre>
1217812178
<li><code>s</code></li>
1217912179
<li><code>samp</code></li>
1218012180
<li><code>script</code></li>
12181+
<li><code>search</code></li>
1218112182
<li><code>section</code></li>
1218212183
<li><code>select</code></li>
1218312184
<li><code>slot</code></li>
@@ -12473,6 +12474,7 @@ https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%
1247312474
<li><code>ruby</code></li>
1247412475
<li><code>s</code></li>
1247512476
<li><code>samp</code></li>
12477+
<li><code>search</code></li>
1247612478
<li><code>section</code></li>
1247712479
<li><code>select</code></li>
1247812480
<li><code>small</code></li>
@@ -20944,6 +20946,115 @@ included with Exhibit B.
2094420946
</div>
2094520947

2094620948

20949+
<h4>The <dfn element><code>search</code></dfn> element</h4>
20950+
20951+
<dl class="element">
20952+
<dt><span data-x="concept-element-categories">Categories</span>:</dt>
20953+
<dd><span>Flow content</span>.</dd>
20954+
<dd><span>Palpable content</span>.</dd>
20955+
<dt><span data-x="concept-element-contexts">Contexts in which this element can be used</span>:</dt>
20956+
<dd>Where <span>flow content</span> is expected.</dd>
20957+
<dt><span data-x="concept-element-content-model">Content model</span>:</dt>
20958+
<dd><span>Flow content</span>.</dd>
20959+
<dt><span data-x="concept-element-attributes">Content attributes</span>:</dt>
20960+
<dd><span>Global attributes</span></dd>
20961+
<dt><span data-x="concept-element-accessibility-considerations">Accessibility considerations</span>:</dt>
20962+
<dd><a href="https://w3c.github.io/html-aria/#el-search">For authors</a>.</dd>
20963+
<dd><a href="https://w3c.github.io/html-aam/#el-search">For implementers</a>.</dd>
20964+
<dt><span data-x="concept-element-dom">DOM interface</span>:</dt>
20965+
<dd>Uses <code>HTMLElement</code>.</dd>
20966+
</dl>
20967+
20968+
<p>The <code>search</code> element <span>represents</span> a part of a document or application
20969+
that contains a set of form controls or other content related to performing a search or filtering
20970+
operation. This could be a search of the web site or application; a way of searching or filtering
20971+
search results on the current web page; or a global or Internet-wide search function.</p>
20972+
20973+
<p class="note">It's not appropriate to use the <code>search</code> element just for presenting
20974+
search results, though suggestions and links as part of "quick search" results can be
20975+
included as part of a search feature. Rather, a returned web page of search results would instead
20976+
be expected to be presented as part of the main content of that web page.</p>
20977+
20978+
<div class="example">
20979+
<p>In the following example, the author is including a search form within the
20980+
<code>header</code> of the web page:</p>
20981+
20982+
<pre><code class="html">&lt;header>
20983+
&lt;h1>&lt;a href="/">My fancy blog&lt;/a>&lt;/h1>
20984+
...
20985+
&lt;search>
20986+
&lt;form action="search.php">
20987+
&lt;label for="query">Find an article&lt;/label>
20988+
&lt;input id="query" name="q" type="search">
20989+
&lt;button type="submit">Go!&lt;/button>
20990+
&lt;/form>
20991+
&lt;/search>
20992+
&lt;/header></code></pre>
20993+
</div>
20994+
20995+
<div class="example">
20996+
<p>In this example, the author has implemented their web application's search functionality
20997+
entirely with JavaScript. There is no use of the <code>form</code> element to perform
20998+
server-side submission, but the containing <code>search</code> element semantically identifies
20999+
the purpose of the descendant content as representing search capabilities.</p>
21000+
21001+
<pre><code class="html">&lt;search>
21002+
&lt;label>
21003+
Find and filter your query
21004+
&lt;input type="search" id="query">
21005+
&lt;/label>
21006+
&lt;label>
21007+
&lt;input type="checkbox" id="exact-only">
21008+
Exact matches only
21009+
&lt;/label>
21010+
21011+
&lt;section>
21012+
&lt;h3>Results found:&lt;/h3>
21013+
&lt;ul id="results">
21014+
&lt;li>
21015+
&lt;p>&lt;a href="services/consulting">Consulting services&lt;/a>&lt;/p>
21016+
&lt;p>
21017+
Find out how can we help you improve your business with our integrated consultants, Bob and Bob.
21018+
&lt;/p>
21019+
&lt;/li>
21020+
...
21021+
&lt;/ul>
21022+
&lt;!--
21023+
when a query returns or filters out all results
21024+
render the no results message here
21025+
-->
21026+
&lt;output id="no-results">&lt;/output>
21027+
&lt;/section>
21028+
&lt;/search></code></pre>
21029+
</div>
21030+
21031+
<div class="example">
21032+
<p>In the following example, the page has two search features. The first is located in the web page's
21033+
<code>header</code> and serves as a global mechanism to search the web site's content. Its purpose is
21034+
indicated by its specified <code>title</code> attribute. The second is included as part of the main content
21035+
of the page, as it represents a mechanism to search and filter the content of the current page. It contains
21036+
a heading to indicate its purpose.</p>
21037+
21038+
<pre><code class="html">&lt;body>
21039+
&lt;header>
21040+
...
21041+
&lt;search title="Website">
21042+
...
21043+
&lt;/search>
21044+
&lt;/header>
21045+
&lt;main>
21046+
&lt;h1>Hotels near your location&lt;/h1>
21047+
&lt;search>
21048+
&lt;h2>Filter results&lt;/h2>
21049+
...
21050+
&lt;/search>
21051+
&lt;article>
21052+
&lt;!-- search result content -->
21053+
&lt;/article>
21054+
&lt;/main>
21055+
&lt;/body></code></pre>
21056+
</div>
21057+
2094721058

2094821059
<h4>The <dfn element><code>div</code></dfn> element</h4>
2094921060

@@ -112539,12 +112650,13 @@ dictionary <dfn dictionary>StorageEventInit</dfn> : <span>EventInit</span> {
112539112650
<!-- </p> -->
112540112651
<p>A <code>p</code> element's <span data-x="syntax-end-tag">end tag</span> may be omitted if the
112541112652
<code>p</code> element is immediately followed by an <code>address</code>, <code>article</code>,
112542-
<code>aside</code>, <code>blockquote</code>, <code>details</code>, <code>div</code>, <code>dl</code>,
112543-
<code>fieldset</code>, <code>figcaption</code>, <code>figure</code>, <code>footer</code>, <code>form</code>, <code>h1</code>, <code>h2</code>,
112544-
<code>h3</code>, <code>h4</code>, <code>h5</code>, <code>h6</code>, <code>header</code>,
112545-
<code>hgroup</code>, <code>hr</code>, <code>main</code>, <code>menu</code>, <code>nav</code>,
112546-
<code>ol</code>, <code>p</code>, <code>pre</code>, <code>section</code>, <code>table</code>, or
112547-
<code>ul</code> element, or if there is no more content in the parent element and the parent
112653+
<code>aside</code>, <code>blockquote</code>, <code>details</code>, <code>div</code>,
112654+
<code>dl</code>, <code>fieldset</code>, <code>figcaption</code>, <code>figure</code>,
112655+
<code>footer</code>, <code>form</code>, <code>h1</code>, <code>h2</code>, <code>h3</code>,
112656+
<code>h4</code>, <code>h5</code>, <code>h6</code>, <code>header</code>, <code>hgroup</code>,
112657+
<code>hr</code>, <code>main</code>, <code>menu</code>, <code>nav</code>, <code>ol</code>,
112658+
<code>p</code>, <code>pre</code>, <code>search</code>, <code>section</code>, <code>table</code>,
112659+
or <code>ul</code> element, or if there is no more content in the parent element and the parent
112548112660
element is an <span data-x="HTML elements">HTML element</span> that is not an <code>a</code>,
112549112661
<code>audio</code>, <code>del</code>, <code>ins</code>, <code>map</code>, <code>noscript</code>,
112550112662
or <code>video</code> element, or an <span>autonomous custom element</span>.</p>
@@ -114826,23 +114938,23 @@ dictionary <dfn dictionary>StorageEventInit</dfn> : <span>EventInit</span> {
114826114938
<code>figure</code>, <code>footer</code>, <code>form</code>, <code>frame</code>,
114827114939
<code>frameset</code>, <code>h1</code>, <code>h2</code>, <code>h3</code>, <code>h4</code>,
114828114940
<code>h5</code>, <code>h6</code>, <code>head</code>, <code>header</code>, <code>hgroup</code>,
114829-
<code>hr</code>, <code>html</code>, <code>iframe</code>, <!-- <code>image</code>, (commented out
114830-
because this isn't an element that can end up on the stack, so it doesn't matter) -->
114941+
<code>hr</code>, <code>html</code>, <code>iframe</code>, <!-- <code>image</code>, (commented
114942+
outbecause this isn't an element that can end up on the stack, so it doesn't matter) -->
114831114943
<code>img</code>, <code>input</code>, <code>keygen</code>, <code>li</code>, <code>link</code>,
114832114944
<code>listing</code>, <code>main</code>, <code>marquee</code>, <code>menu</code>,
114833114945
<code>meta</code>, <code>nav</code>, <code>noembed</code>, <code>noframes</code>,
114834-
<code>noscript</code>, <code>object</code>, <code>ol</code>, <code>p</code>, <code>param</code>,
114835-
<code>plaintext</code>, <code>pre</code>, <code>script</code>, <code>section</code>,
114836-
<code>select</code>, <code>source</code>, <code>style</code>, <code>summary</code>,
114837-
<code>table</code>, <code>tbody</code>, <code>td</code>, <code>template</code>,
114838-
<code>textarea</code>, <code>tfoot</code>, <code>th</code>, <code>thead</code>,
114839-
<code>title</code>, <code>tr</code>, <code>track</code>, <code>ul</code>, <code>wbr</code>,
114840-
<code>xmp</code>; <span>MathML <code>mi</code></span>, <span>MathML <code>mo</code></span>,
114841-
<span>MathML <code>mn</code></span>, <span>MathML <code>ms</code></span>, <span>MathML
114842-
<code>mtext</code></span>,and<span>MathML <code>annotation-xml</code></span>; and <span>SVG
114843-
<code>foreignObject</code></span>,<span>SVG <code>desc</code></span>, and <span>SVG
114844-
<code>title</code></span>.</p> <!-- we could actually put all non-HTML elements in this list, I
114845-
think -->
114946+
<code>noscript</code>, <code>object</code>, <code>ol</code>, <code>p</code>,
114947+
<code>param</code>, <code>plaintext</code>, <code>pre</code>, <code>script</code>,
114948+
<code>search</code>, <code>section</code>, <code>select</code>, <code>source</code>,
114949+
<code>style</code>, <code>summary</code>, <code>table</code>, <code>tbody</code>,
114950+
<code>td</code>, <code>template</code>, <code>textarea</code>, <code>tfoot</code>,
114951+
<code>th</code>, <code>thead</code>, <code>title</code>, <code>tr</code>, <code>track</code>,
114952+
<code>ul</code>, <code>wbr</code>, <code>xmp</code>; <span>MathML <code>mi</code></span>,
114953+
<span>MathML <code>mo</code></span>, <span>MathML <code>mn</code></span>, <span>MathML
114954+
<code>ms</code></span>, <span>MathML <code>mtext</code></span>, and <span>MathML
114955+
<code>annotation-xml</code></span>; and<span>SVG <code>foreignObject</code></span>, <span>SVG
114956+
<code>desc</code></span>, and <span>SVG <code>title</code></span>.</p> <!-- we could actually
114957+
put all non-HTML elements in this list, Ithink -->
114846114958

114847114959
<p class="note">An <code data-x="">image</code> start tag token is handled by the tree builder,
114848114960
but it is not in this list because it is not an element; it gets turned into an <code>img</code>
@@ -118955,7 +119067,7 @@ document.body.appendChild(text);
118955119067
<!-- the normal ones -->
118956119068
<dt>A start tag whose tag name is one of: "address", "article", "aside", "blockquote", "center",
118957119069
"details", "dialog", "dir", "div", "dl", "fieldset", "figcaption", "figure", "footer", "header",
118958-
"hgroup", "main", "menu", "nav", "ol", "p", "section", "summary", "ul"</dt>
119070+
"hgroup", "main", "menu", "nav", "ol", "p", "search", "section", "summary", "ul"</dt>
118959119071
<dd>
118960119072
<!-- As of May 2008 this doesn't match any browser exactly, but is as close to what IE does as I
118961119073
can get without doing the non-tree DOM nonsense, and thus should actually afford better
@@ -119187,8 +119299,8 @@ document.body.appendChild(text);
119187119299
<!-- the normal ones -->
119188119300
<dt>An end tag whose tag name is one of: "address", "article", "aside", "blockquote", "button",
119189119301
"center", "details", "dialog", "dir", "div", "dl", "fieldset", "figcaption", "figure", "footer",
119190-
"header", "hgroup", "listing", "main", "menu", "nav", "ol", "pre", "section", "summary",
119191-
"ul"</dt>
119302+
"header", "hgroup", "listing", "main", "menu", "nav", "ol", "pre", "search", "section",
119303+
"summary", "ul"</dt>
119192119304
<dd>
119193119305
<p>If the <span>stack of open elements</span> does not <span data-x="has an element in
119194119306
scope">have an element in scope</span> that is an <span data-x="HTML elements">HTML
@@ -123429,7 +123541,7 @@ html, body { display: block; }</code></pre>
123429123541
<pre><code class="css">@namespace url(http://www.w3.org/1999/xhtml);
123430123542

123431123543
address, blockquote, center, dialog, div, figure, figcaption, footer, form,
123432-
header, hr, legend, listing, main, p, plaintext, pre, xmp {
123544+
header, hr, legend, listing, main, p, plaintext, pre,search,xmp {
123433123545
display: block;<!-- see also unicode-bidi: isolate rules-->
123434123546
}
123435123547

@@ -123731,8 +123843,8 @@ br[clear=all i], br[clear=both i] { clear: both; }</code></pre>
123731123843

123732123844
address, blockquote, center, div, figure, figcaption, footer, form, header, hr,
123733123845
legend, listing, main, p, plaintext, pre, summary, xmp, article, aside, h1, h2,
123734-
h3, h4, h5, h6, hgroup, nav, section, table, caption, colgroup, col, thead,
123735-
tbody, tfoot, tr, td, th, dir, dd, dl, dt, menu, ol, ul, li, bdi, output,
123846+
h3, h4, h5, h6, hgroup, nav, section,search,table, caption, colgroup, col,
123847+
thead,tbody, tfoot, tr, td, th, dir, dd, dl, dt, menu, ol, ul, li, bdi, output,
123736123848
[dir=ltr i], [dir=rtl i], [dir=auto i] {
123737123849
unicode-bidi: isolate; <!-- anything that's similar to display:block, plus <bdi>, <output>, and dir="" -->
123738123850
}
@@ -123768,8 +123880,8 @@ input[dir=auto i]:is([type=search i], [type=tel i], [type=url i],
123768123880

123769123881
address, blockquote, center, div, figure, figcaption, footer, form, header, hr,
123770123882
legend, listing, main, p, plaintext, pre, summary, xmp, article, aside, h1, h2,
123771-
h3, h4, h5, h6, hgroup, nav, section, table, caption, colgroup, col, thead,
123772-
tbody, tfoot, tr, td, th, dir, dd, dl, dt, menu, ol, ul, li, [dir=ltr i],
123883+
h3, h4, h5, h6, hgroup, nav, section,search,table, caption, colgroup, col,
123884+
thead,tbody, tfoot, tr, td, th, dir, dd, dl, dt, menu, ol, ul, li, [dir=ltr i],
123773123885
[dir=rtl i], [dir=auto i], *|* {
123774123886
unicode-bidi: bidi-override;
123775123887
}
@@ -129631,6 +129743,17 @@ interface <dfn interface>External</dfn> {
129631129743
<td><code>HTMLScriptElement</code></td>
129632129744
</tr>
129633129745

129746+
<tr>
129747+
<th><code>search</code></th>
129748+
<td>Container for search controls</td>
129749+
<td><span data-x="Flow content">flow</span>;
129750+
<span data-x="Palpable content">palpable</span></td>
129751+
<td><span data-x="Flow content">flow</span></td>
129752+
<td><span data-x="Flow content">flow</span></td>
129753+
<td><span data-x="global attributes">globals</span></td>
129754+
<td><code>HTMLElement</code></td>
129755+
</tr>
129756+
129634129757
<tr>
129635129758
<th><code>section</code></th>
129636129759
<td>Generic document or application section</td>
@@ -130172,6 +130295,7 @@ interface <dfn interface>External</dfn> {
130172130295
<code>s</code>;
130173130296
<code>samp</code>;
130174130297
<code>script</code>;
130298+
<code>search</code>;
130175130299
<code>section</code>;
130176130300
<code>select</code>;
130177130301
<code>slot</code>;
@@ -130452,6 +130576,7 @@ interface <dfn interface>External</dfn> {
130452130576
<code>ruby</code>;
130453130577
<code>s</code>;
130454130578
<code>samp</code>;
130579+
<code>search</code>;
130455130580
<code>section</code>;
130456130581
<code>select</code>;
130457130582
<code>small</code>;
@@ -132378,6 +132503,10 @@ interface <dfn interface>External</dfn> {
132378132503
<td> <code>samp</code>
132379132504
<td> <code>HTMLElement</code>
132380132505

132506+
<tr>
132507+
<td> <code>search</code>
132508+
<td> <code>HTMLElement</code>
132509+
132381132510
<tr>
132382132511
<td> <code>script</code>
132383132512
<td> <code>HTMLScriptElement</code> : <code>HTMLElement</code>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp