Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Landed again the patches for cleaning bogus `<br>`s up when unnecessary

71 views
Skip to first unread message

Masayuki Nakano

unread,
Dec 15, 2024, 8:27:28 PM12/15/24
to dev-pl...@mozilla.org

Bug 1923251 is now fixed again. The patches clean up bogus `<br>` elements when they become unnecessary with inserting something before them. For example, when you create a new paragraph in `<div contenteditable="true">`, the paragraph has a `<br>` like `<div><br></div>`. The `<br>` is required to make the new paragraph height as one-line-height and allow to put caret in it.

However, the first landing caused a regression (Bug 1925635). When you delete per word immediately before a block boundary, new `<br>` should be inserted to make the collapsible white-space which was followed by the deleted word. However, it was not inserted and it looked like the white-space is also removed with the word. The `<br>` was inserted by the post processor of each edit, but touching it may lead regressions and needs to make the various conditions complicated. Therefore, I rewrote each deletion handler inserts `<br>` instead of the post processor.

So, you might see unexpected deletion of trailing white-space after deleting last things at end of paragraph but only in specific conditions. If you meet such regressions, please file a new bug within "DOM: Editor" of "Core" as soon as possible.

I'll start landing some other patches which depend on the landed patches after a couple of days. Then, it becomes harder to back out the patches even for serious cases.

Thanks in advance.

-- 
Masayuki Nakano <masa...@d-toybox.com>
Working on DOM, Events, editor and IME handling for Gecko

Andrew Overholt

unread,
Dec 18, 2024, 8:39:14 AM12/18/24
to Masayuki Nakano, dev-pl...@mozilla.org
Hi Masayuki,

This week I've been intermittently experiencing the unexpected deletion of trailing whitespace in Google Slides comments but I am having a hard time reproducing. When I can do so reliably, I'll file a bug with a testcase.

Thanks,

Andrew

--
You received this message because you are subscribed to the Google Groups "dev-pl...@mozilla.org" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dev-platform...@mozilla.org.
To view this discussion visit https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/d36f361b-7988-4d53-b972-645f5248d3b1%40d-toybox.com.

Andrew Overholt

unread,
Dec 18, 2024, 9:23:58 AM12/18/24
to Masayuki Nakano, dev-pl...@mozilla.org
I noticed a separate issue with Gmail which may be unrelated but I filed it anyway as https://bugzilla.mozilla.org/show_bug.cgi?id=1938110.

I'll keep trying to reliably reproduce the Google Slides comment issue that I've experienced.
Reply all
Reply to author
Forward
0 new messages