惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Security Latest
Security Latest
C
Cisco Blogs
P
Palo Alto Networks Blog
Know Your Adversary
Know Your Adversary
Project Zero
Project Zero
C
Cyber Attacks, Cyber Crime and Cyber Security
NISL@THU
NISL@THU
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Secure Thoughts
P
Privacy International News Feed
V
Vulnerabilities – Threatpost
D
Docker
Google Online Security Blog
Google Online Security Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Recent Announcements
Recent Announcements
T
The Exploit Database - CXSecurity.com
G
Google Developers Blog
Schneier on Security
Schneier on Security
小众软件
小众软件
爱范儿
爱范儿
GbyAI
GbyAI
J
Java Code Geeks
T
Tailwind CSS Blog
Cisco Talos Blog
Cisco Talos Blog
The Hacker News
The Hacker News
D
DataBreaches.Net
Blog — PlanetScale
Blog — PlanetScale
TaoSecurity Blog
TaoSecurity Blog
MyScale Blog
MyScale Blog
B
Blog RSS Feed
Cyberwarzone
Cyberwarzone
有赞技术团队
有赞技术团队
Martin Fowler
Martin Fowler
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Securelist
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Y
Y Combinator Blog
S
Schneier on Security
Latest news
Latest news
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 叶小钗
F
Fortinet All Blogs
M
MIT News - Artificial intelligence
PCI Perspectives
PCI Perspectives
V
V2EX
V2EX - 技术
V2EX - 技术
O
OpenAI News
W
WeLiveSecurity

Recent Commits to html:main

Mark <base> as Unsafe for sanitization · whatwg/html@c38efee Refactor fragment parsing algorithm to match implementations · whatwg/html@4c4c813 Serialize processing instructions with "?>" at the end Editorial: merge the text track concept into TextTrack Editorial: modernize TextTrack members Remove categories of select/optgroup/option element inner content ele… Editorial: reword 3 grammatically ambiguous sentences · whatwg/html@e481423 Editorial: modernize various dimension getters Editorial: modernize srcObject getter & setter · whatwg/html@e5749bd Fix URL comparison when processing internal resource links · whatwg/html@d86584e Editorial: update PropertyDescriptor [[Get]]/[[Set]] to [[Getter]]/[[… · whatwg/html@6441ae6 Meta: remove Twitter link · whatwg/html@5a226a2 Fix backwards test of element's dirty value flag · whatwg/html@4adc122 Support processing instructions in HTML · whatwg/html@320c05f Expose redirectCount for TAO opted-in navigation redirect chains · whatwg/html@b94ff88 Meta: improve PR Preview, part 2 · whatwg/html@8d80ce1 Meta: export Sanitizer/configure · whatwg/html@acc064b Meta: improve PR Preview · whatwg/html@3057476 Clarify step 4.3 of adoption agency algorithm · whatwg/html@9f50934 Editorial: spell roundtrip without hyphen · whatwg/html@c560a56 Meta: remove bogus files · whatwg/html@126aea6
Define option and optgroup rendering better · whatwg/html@ab99fc3
josepharhar · 2026-06-25 · via Recent Commits to html:main

@@ -57354,7 +57354,8 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {

5735457354

value, or through a <span data-x="option-command">menu command</span>, or through any other

5735557355

mechanism) by running the <span data-x="concept-select-pick">pick an option</span> algorithm given

5735657356

the <code>select</code> element, the <code>option</code> element, and if the

57357-

<span><code>select</code>'s <code>option</code>s are being rendered with base appearance</span>, a

57357+

<span data-x="select's options are being rendered with base appearance"><code>select</code>'s

57358+

contents are being rendered with base appearance</span>, a

5735857359

corresponding <code data-x="event-keydown">keydown</code> or <code

5735957360

data-x="event-mouseup">mouseup</code> event, otherwise null.</p>

5736057361

</div>

@@ -152792,12 +152793,45 @@ progress { appearance: auto; }</code></pre>

152792152793

<p>The <span>'::checkmark'</span> pseudo-element only applies to <code>option</code> elements

152793152794

which are <span data-x="option-base-appearance">being rendered with base appearance</span>.</p>

152794152795152795-

<p>An <code>optgroup</code> element is <span>expected</span> to be rendered by displaying the

152796-

element's <code data-x="attr-optgroup-label">label</code> attribute.</p>

152796+

<p>An <code>optgroup</code> element has an internal <span>shadow tree</span> with at least one

152797+

<code>slot</code> element.</p>

152798+152799+

<p>An <code>optgroup</code> element is <dfn data-x="optgroup-base-appearance">rendered with base

152800+

appearance</dfn> if it has a <span data-x="option element nearest ancestor select">nearest

152801+

ancestor <code>select</code></span> whose <span data-x="select's options are being rendered with

152802+

base appearance">contents are being rendered with base appearance</span>.</p>

152803+152804+

<p>If an <code>optgroup</code> element is not being <span

152805+

data-x="optgroup-base-appearance">rendered with base appearance</span>, then it is

152806+

<span>expected</span> to be rendered by displaying the element's <span

152807+

data-x="concept-optgroup-label">label</span> and children.</p>

152808+152809+

<p>If an <code>optgroup</code> element is being <span data-x="optgroup-base-appearance">rendered

152810+

with base appearance</span>, then it is <span>expected</span> to render with a <span>shadow

152811+

tree</span> that contains the following elements:</p>

152812+152813+

<ol>

152814+

<li><p>An <dfn>optgroup legend slot</dfn>, which is a <code>slot</code> element. It is appended

152815+

to the <code>optgroup</code>'s <span>shadow root</span> as the first child. It is

152816+

<span>expected</span> to take the first child element of the <code>optgroup</code> if the first

152817+

child element is a <code>legend</code> element.</p></li>

152818+152819+

<li><p>An <dfn>optgroup label element</dfn>, which is a <code>div</code> element. It is appended

152820+

to the <span>optgroup legend slot</span>. It is <span>expected</span> to contain a

152821+

<code>Text</code> node whose <span data-x="concept-cd-data">data</span> is the value of the

152822+

<code>optgroup</code>'s <code data-x="attr-optgroup-label">label</code> attribute, or the empty

152823+

string if the attribute is not present.</p></li>

152824+152825+

<li><p>An <dfn>optgroup contents slot</dfn>, which is a <code>slot</code> element. It is appended

152826+

to the <code>optgroup</code>'s <span>shadow root</span> after the <span>optgroup legend

152827+

slot</span>. It is <span>expected</span> to take all remaining child nodes of the

152828+

<code>optgroup</code> element.</p></li>

152829+

</ol>

152797152830152798152831

<div algorithm>

152799-

<p>To determine if a <dfn><code>select</code>'s <code>option</code>s are being rendered with base

152800-

appearance</dfn>, given a <code>select</code> element <var>select</var>:</p>

152832+

<p>To determine if a <dfn data-x="select's options are being rendered with base

152833+

appearance"><code>select</code>'s contents are being rendered with base appearance</dfn>, given a

152834+

<code>select</code> element <var>select</var>:</p>

152801152835152802152836

<ol>

152803152837

<li><p>If <var>select</var> is being rendered as a <span>list box</span> with <span>base

@@ -152812,18 +152846,45 @@ progress { appearance: auto; }</code></pre>

152812152846

</ol>

152813152847

</div>

152814152848152849+

<p>An <code>option</code> element has an internal <span>shadow tree</span> with a

152850+

<code>slot</code> element.</p>

152851+152815152852

<p>An <code>option</code> element is <dfn data-x="option-base-appearance">rendered with base

152816152853

appearance</dfn> if it has a <span data-x="option element nearest ancestor select">nearest

152817-

ancestor <code>select</code></span> and the <span><code>select</code>'s <code>option</code>s are

152818-

being rendered with base appearance</span>.</p>

152854+

ancestor <code>select</code></span> and the <span data-x="select's options are being rendered

152855+

with base appearance"><code>select</code>'s contents are being rendered with base

152856+

appearance</span>.</p>

152857+152858+

<p>If an <code>option</code> does not have a <span data-x="option element nearest ancestor

152859+

select">nearest ancestor <code>select</code></span>, then it is <span>expected</span> to render

152860+

its children.</p>

152861+152862+

<p>Otherwise, if an <code>option</code> element is not being <span

152863+

data-x="option-base-appearance">rendered with base appearance</span>, then it is

152864+

<span>expected</span> to be rendered by displaying the result of <span>collect option text</span>

152865+

given the <code>option</code> and true.</p>

152819152866152820-

<p>An <code>option</code> element is <span>expected</span> to be rendered by displaying the result

152821-

of <span>collect option text</span> given the <code>option</code> and true, indented under its

152822-

<code>optgroup</code> element if it has one. If the <code>option</code> <span

152823-

data-x="option-base-appearance">is being rendered with base appearance</span> and the

152824-

<code>option</code>'s <code data-x="attr-option-label">label</code> attribute is not set, then the

152825-

<code>option</code> is <span>expected</span> to render all of its children rather than by

152826-

displaying its <span data-x="concept-option-label">label</span>.</p>

152867+

<p>Otherwise, it is <span>expected</span> to render with a <span>shadow tree</span>

152868+

that contains the following elements:</p>

152869+152870+

<ol>

152871+

<li>

152872+

<p>An <dfn>option contents slot</dfn>, which is a <code>slot</code> element. It is appended to

152873+

the <code>option</code>'s <span>shadow root</span> as the first child.

152874+

If the <code>option</code> element has a <code data-x="attr-option-label">label</code>

152875+

attribute whose value is not the empty string, then the <span>option contents slot</span> is

152876+

<span>expected</span> to not take any nodes. Otherwise, it is <span>expected</span> to take all

152877+

child nodes of the <code>option</code> element.</p>

152878+152879+

<p class="note">When the <span>option contents slot</span> does not take any elements, the

152880+

<span>option label element</span> is rendered as fallback content.</p>

152881+

</li>

152882+152883+

<li><p>An <dfn>option label element</dfn>, which is a <code>span</code> element. It is appended

152884+

to the <span>option contents slot</span>. It is <span>expected</span> to contain a

152885+

<code>Text</code> node whose <span data-x="concept-cd-data">data</span> is the value of the

152886+

<code>option</code>'s <code data-x="attr-option-label">label</code> attribute.</p></li>

152887+

</ol>

152827152888152828152889

<p>Each sequence of one or more child <code>hr</code> element siblings may be rendered as a single

152829152890

separator.</p>

@@ -152861,6 +152922,17 @@ progress { appearance: auto; }</code></pre>

152861152922152862152923

</div>

152863152924152925+

<pre><code class="css">@namespace "http://www.w3.org/1999/xhtml";

152926+152927+

option {

152928+

display: block;

152929+

}

152930+152931+

optgroup {

152932+

display: block;

152933+

font-weight: bolder;

152934+

}</code></pre>

152935+152864152936

<p>The following styles are <span>expected</span> to apply to <code>select</code> elements when

152865152937

they are being rendered with <span>native appearance</span> or <span>primitive

152866152938

appearance</span>:</p>

@@ -153005,6 +153077,15 @@ select {

153005153077

block-size: calc(max(24px, 1lh) * attr(size type(&lt;integer>), 4));

153006153078

}</code></pre>

153007153079153080+

<p>The following styles are <span>expected</span> to apply to the <span>optgroup label

153081+

element</span>:</p>

153082+153083+

<ul>

153084+

<li><p><code data-x="" class="css">padding-inline: 0.5em</code></p></li>

153085+153086+

<li><p><code data-x="" class="css">min-block-size: 1lh</code></p></li>

153087+

</ul>

153088+153008153089

<div w-nodev>

153009153090153010153091

<h4>The <code>textarea</code> element</h4>