Skip to content

Commit

Permalink
The <menu> element should act as the list owner of a list element
Browse files Browse the repository at this point in the history
According to the spec, `<menu>` element should act as the list owner.
https://html.spec.whatwg.org/#the-li-element
> If its parent element is an ol, ul, or menu element, then
> the element is an item of the parent element's list.
> Any element whose computed value of 'display' is 'list-item'
> has a list owner, which is determined as follows:
> If the element has an ol, ul, or menu ancestor, set
> ancestor to the closest such ancestor element.

This patch also modify the `<ol>` element in ref.html to `<menu>`
element. The visual effects of `<ol>` and `<menu>` are inconsistent.

Bug: 40781706
Change-Id: I2776ae7bec16a8b7a9005f19c92444d7be657ecb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5667497
Reviewed-by: Ian Kilpatrick <[email protected]>
Reviewed-by: Joey Arhar <[email protected]>
Commit-Queue: Peng Zhou <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1325899}
  • Loading branch information
zhoupeng authored and chromium-wpt-export-bot committed Jul 11, 2024
1 parent d1486d4 commit d90f52b
Showing 1 changed file with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
<meta charset="utf-8">
<title>list owner is calculated to be narest ancestor menu if it exists</title>
<link rel="author" title="Domenic Denicola" href="mailto:[email protected]">
<link rel="author" title="Peng Zhou" href="mailto:[email protected]">
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#ordinal-value">
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#list-owner">

<style>
li {
list-style-type: decimal;
}
</style>

<p>This test matches if the list displays similar to the following</p>

<pre>1. A
Expand All @@ -22,25 +29,25 @@

<hr>

<ol>
<menu>
<li value="1">A</li>
<li value="2">B</li>
<li value="3">C</li>
<li value="4">D</li>
<li value="5">E</li>
<ol>
<menu>
<li value="1">F</li>
<li value="2">G</li>
</ol>
</menu>
<li value="6">H</li>
<ol>
<menu>
<li value="1">I</li>
<li value="2">
J
<ol>
<menu>
<li value="1">K</li>
<li value="2">L</li>
</ol>
</menu>
</li>
</ol>
</ol>
</menu>
</menu>

0 comments on commit d90f52b

Please sign in to comment.