Intent to change: HTML editor respects CSS display property to consider inline vs. block

147 views
Skip to first unread message

Masayuki Nakano

unread,
Sep 26, 2023, 11:19:22 PM9/26/23
to dev-pl...@mozilla.org, Hsin-Yi Tsai, Makoto Kato, Jan-Niklas Jäschke

Summary: Make HTML editor respect CSS display property when it considers whether an element is "inline" or "block". The other browsers refer the style except when they handle specific commands such as "formatBlock", "removeFormat", "indent", "outdent", "insertOrderedList" and "insertUnorderedList" which we call "block level action". However, our editor always refers the HTML default style of the element. Therefore, for example, our editor cannot insert a new line properly if caret is in a `<p style="display:inline">` for example (the `<p>` element is duplicated instead of inserting `<br>` or splitting its parent "block"). This difference caused fixing bugs in the scope of Interop-2023.

This is a risky change. The patch adds a parameter how to consider "inline" vs. "block", but the number of callers is too many. Therefore, some callers may use wrong parameter value. Therefore, currently this is enabled only in nightly builds and early beta builds to collect feedback from the testers. (However, this changes the behavior of the tricky cases, therefore, web apps in the wild probably do not use actually.)

Bug: Bug 1851951 - Make `insertParagraph` and `delete`/`forwardDelete` should check the style when looking for a block ancestor

Specification: None

Platform coverage: All platforms

Preference: editor.block_inline_check.use_computed_style

Other browsers: Both of them use the new behavior

web-platform-tests: editing/other/insertparagraph-with-white-space-style.tentative.html

-- 
Masayuki Nakano <masa...@d-toybox.com>
Working on DOM, Events, editor and IME handling for Gecko
Reply all
Reply to author
Forward
0 new messages