Bug 301858
| Summary: | Update <option> when descendants change | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Anne van Kesteren <annevk> |
| Component: | Forms | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | cdumez, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=301859 | ||
| Bug Depends on: | |||
| Bug Blocks: | 286642 | ||
Anne van Kesteren
We currently update the <option> element when its immediate children change, but to be fully correct we need to update it when descendants change. See this demo which requires HTMLEnhancedSelectParsingEnabled and should show "24" after clicking:
<p><select id=select>
<div>
<option>2<div id=evil>3</div></option>
</div>
<div>
<option>1</option>
</div>
</select>
<p><button onclick=evil.textContent='4'>Click</button>
This is not a critical issue, but would be nice to do correctly. Here's a sketch from rniwa on how to approach this:
> I think we want to add a new Node flag to identify any descendent of option. Something like StateFlag::HasOptionAsAncestor. Then we want to propagate this flag in insertedIntoAncestor and removedFromAncestor. See Element::updateEffectiveTextDirectionIfNeeded() for an example. Once this flag is properly updated, we want to add a [[unlikely]] if statement which notifies option in Element::childrenChanged.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/164396354>