Skip to content

<search> element #1569

Closed
Closed

Description

@zcorpan

URL of WHATWG spec or PR: web-platform-tests/wpt#39163

Describe the solution you'd like
Validate the search element as per html and html-aria (w3c/html-aria#401). Update the HTML parser.

Activity

  1. edent commented on Sep 23, 2023

    @edent

    The validator currently shows an error when using <section><search>

    Element search not allowed as child of element section in this context. (Suppressing further errors from this subtree.)
    Contexts in which element search may be used:
    ... Where flow content is expected.
    Content model for element section:
    ... Flow content.

    Which seems rather contradictory!

    (Search support has arrived in Safari 17)

  2. jribbens commented on Sep 26, 2023

    @jribbens

    @edent Haha I just came here to report this because of your blog.

    The following replicates the error - as far as I can see according to the HTML specification (as of right now) this is valid, but the validator complains.

    <!DOCTYPE html>
    <html lang=en><meta charset=utf-8><title>Search test</title>
    <section><h1>Search</h1><search>
    <form><label>Search<input name="q"></label></form>
    </search></section>
  3. what1s1ove commented on Apr 19, 2024

    @what1s1ove

    Hi everyone! Any news on this?

    I'm facing an issue with my CI setup that involves validating .html files. Due to this error, I'm unable to start using a new tag 🥲

  4. stephanboeni commented on Jun 20, 2024

    @stephanboeni

    The example from https://html.spec.whatwg.org/multipage/grouping-content.html#the-search-element throws an error.

    <!DOCTYPE html>
    <html lang="">
    <head>
    <title>Test</title>
    </head>
    <body>
    <header>
      <h1><a href="/">My fancy blog</a></h1>
      ...
      <search>
        <form action="search.php">
          <label for="query">Find an article</label>
          <input id="query" name="q" type="search">
          <button type="submit">Go!</button>
        </form>
      </search>
    </header>
    </body>
    </html>
    

    Element search not allowed as child of element header in this context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions