Closed Bug 1539527 Opened 5 months ago Closed 4 months ago

[wpt-sync] Sync PR 16069 - [Editing] Preserve inserted content's original style when inserted into an empty block

Categories

(Core :: Editor, enhancement, P4)

enhancement

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: wptsync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 16069 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/16069
Details from upstream follow.

Xiaocheng Hu <xiaochengh@chromium.org> wrote:

[Editing] Preserve inserted content's original style when inserted into an empty block

https://crrev.com/2072093002 introduced a behavior that, when content
is inserted into a block, the content's original style is removed to
match the block's style.

This results in a regression that the content's style is lost when the
block is empty and has nothing to match. Therefore, this patch preserves
the content's original style when the block is empty.

This also ensures style preservation when the insertion is an internal
operation of a higher level formatting command, e.g. outdent.

Note: this patch introduces a minor regression that, 'text-indent' CSS
property appears in a wrapper span after outdent command. This seems
harmless, though, as 'text-indent' applies only to block elements, so
the wrapper span doesn't have any effect in this case. This will be
cleaned up in a followup patch.

Bug: 818888
Change-Id: I2a6302cd5aa033339a8b857e3183dc5a2a261b4a

Reviewed-on: https://chromium-review.googlesource.com/1531683
WPT-Export-Revision: bff6afc549a6f05080dfa07aedf853836674454c

Component: web-platform-tests → Editor
Product: Testing → Core
Failed to get results from try push
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/mozilla-inbound/rev/adc7715f05d7
[wpt PR 16069] - [Editing] Preserve inserted content's original style when inserted into an empty block, a=testonly
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/mozilla-inbound/rev/32f73f4858c2
[wpt PR 16069] - [Editing] Preserve inserted content's original style when inserted into an empty block, a=testonly
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.