Bug 1843621 [wpt PR 41049] - [EditContext] Make EditContext editability inherited...
commit217080cafd65ac606a2f30abfebb99f4fae10275
authorDan Clark <daniec@microsoft.com>
Fri, 21 Jul 2023 09:26:45 +0000 (21 09:26 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Sat, 22 Jul 2023 01:44:08 +0000 (22 01:44 +0000)
tree238415a6f1b45e4eec210eb1bdcad10a84751e5c
parent3aebc4d634abf2e48a453ea12b85ccb8011c16e5
Bug 1843621 [wpt PR 41049] - [EditContext] Make EditContext editability inherited via UserModify, a=testonly

Automatic update from web-platform-tests
[EditContext] Make EditContext editability inherited via UserModify

The editability that nodes receive from having an associated EditContext
is currently not inherited. In `HasEditableLevel()` [1] the child
node's default value of EUserModify::kReadOnly will be used instead of
climbing the ancestor chain to find an EditContext on a parent node.

For `contenteditable`, the inheritability is implemented by having
`contenteditable` make the node have -webkit-user-modify:read-write
or read-write-plaintext-only, which is an inherited property. See
`HTMLElement::CollectStyleForPresentationAttribute` [2].

In this CL, we integrate EditContext into that approach. Since
the `editContext` property is not reflected in a content attribute,
it needs to be done a little differently: we use StyleAdjuster to
give the node UserModify if it has an associated EditContext, and
invalidate styles in the `editContext` setter to ensure that this
change is picked up.

[1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/editing_utilities.cc;l=182;drc=ecac3938ad3a8c0edd2d1a45c2f9c3c7a7a41c2b
[2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_element.cc;l=331;drc=6bfe7cd47b0de410cc4c90ffbc873ccfc870077d

Bug: 999184
Change-Id: I0599226120a2551a205262ee98342d749ed21d28
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4642263
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Dan Clark <daniec@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1170804}

--

wpt-commits: 404414b923c3a801a2d641d6d460e09f8384a658
wpt-pr: 41049
testing/web-platform/tests/editing/edit-context/edit-context-inheritability.tentative.html [new file with mode: 0644]