github web-platform-tests/wpt merge_pr_47173

latest releases: merge_pr_49470, epochs/three_hourly/2024-12-03_06H, epochs/six_hourly/2024-12-03_06H...
14 months ago

[Editing] Preserve style during content merge within heading elements.

When backspace is pressed at the beginning of content within a block
or if forward delete is pressed at the end of content within a block,
the content of the following block should get merged into the preceding
block, with styles preserved. However, when the content is enclosed
under heading tag, while the content merges, it loses it style. The
expected behavior would be to preserve the styles of content during
merge and not follow the preceding tag style.

The issue occurs when |HandleStyleSpansBeforeInsertion| gets called
and |FollowBlockElementStyle| is invoked which checks if the enclosing
tag is heading or pre or table or list and returns true if found which
in turn drops the styling. The fix retains the element's styling during
non-empty content merge when the backspace key or forward delete is
pressed by removing the check for heading tag explicitly.

The pre and li element content display similar issues during content
merge. Crbug [https://crbug.com/352038138] has been filed to investigate
fixing this issue for the pre element, and another crbug
[https://crbug.com/352610616] has been filed to investigate fixing
the li element's behavior. These were attempted to be fixed with this
change itself, but some tests failures occurred that require more
analysis.

The original CL that introduced the change where, irrespective of the
element having its own style, following the block element style was
enforced is https://codereview.chromium.org/2117663002.

Bug: 41496984
Change-Id: Id6f43aca260eae9d00996242eb3f1d4f24f064c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5623840
Reviewed-by: Siye Liu siliu@microsoft.com
Commit-Queue: Pranav Modi pranavmodi@microsoft.com
Reviewed-by: Sanket Joshi sajos@microsoft.com
Reviewed-by: Kent Tamura tkent@chromium.org
Cr-Commit-Position: refs/heads/main@{#1328669}

Don't miss a new wpt release

NewReleases is sending notifications on new releases.