Skip to content

Commit

Permalink
Implement <search> element
Browse files Browse the repository at this point in the history
This was added to the HTML spec here:
whatwg/html#7320

I mostly based on this on the webkit patch:
WebKit/WebKit#13887

Bug: 1294294
Change-Id: Ia34836f7e5172d862a3a1f24f1e5cbcbb10e6a55
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4767222
Reviewed-by: Mason Freed <masonf@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1184358}
  • Loading branch information
josepharhar authored and Chromium LUCI CQ committed Aug 16, 2023
1 parent 3cfe684 commit 7a8a002
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 21 deletions.
5 changes: 5 additions & 0 deletions third_party/blink/renderer/core/html/html_tag_names.json5
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,11 @@
name: "script",
constructorNeedsCreateElementFlags: true,
},
{
name: "search",
interfaceName: "HTMLElement",
runtimeEnabled: "HTMLSearchElement",
},
{
name: "section",
interfaceName: "HTMLElement",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ void HTMLTreeBuilder::ProcessStartTagForInBody(AtomicHTMLToken* token) {
case HTMLTag::kNav:
case HTMLTag::kOl:
case HTMLTag::kP:
case HTMLTag::kSearch:
case HTMLTag::kSection:
case HTMLTag::kSummary:
case HTMLTag::kUl:
Expand Down Expand Up @@ -2032,6 +2033,7 @@ void HTMLTreeBuilder::ProcessEndTagForInBody(AtomicHTMLToken* token) {
case HTMLTag::kNav:
case HTMLTag::kOl:
case HTMLTag::kPre:
case HTMLTag::kSearch:
case HTMLTag::kSection:
case HTMLTag::kSummary:
case HTMLTag::kUl:
Expand Down
2 changes: 1 addition & 1 deletion third_party/blink/renderer/core/html/resources/html.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ div {
display: block
}

article, aside, footer, header, hgroup, main, nav, section {
article, aside, footer, header, hgroup, main, nav, search, section {
display: block
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1977,6 +1977,10 @@
name: "HTMLPopoverHint",
status: "experimental",
},
{
name: "HTMLSearchElement",
status: "experimental",
},
{
name: "HTMLSelectListElement",
status: "experimental",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
This is a testharness.js-based test.
FAIL <search> - display assert_equals: expected "block" but got "inline"
PASS <search> - display
PASS <search> - margin-top
PASS <search> - margin-right
PASS <search> - margin-bottom
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
This is a testharness.js-based test.
PASS Verify document.characterSet is ISO-8859-8
FAIL <search> - display assert_equals: expected "block" but got "inline"
PASS <search> - display
PASS <search> - margin-top
PASS <search> - margin-right
PASS <search> - margin-bottom
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,7 @@ html element script
property src
property text
property type
html element search
html element section
html element select
property add
Expand Down

0 comments on commit 7a8a002

Please sign in to comment.