Open Bug 1639587 Opened 5 years ago Updated 5 years ago

Forward-deleting empty paragraph keeps a linebreak in designMode=true

Categories

(Core :: DOM: Editor, defect)

defect

Tracking

()

People

(Reporter: saschanaz, Unassigned)

References

(Depends on 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

Attached file paragraph-deletion2.html (obsolete) —
  1. Open the attachment
  2. Put the caret at the end of the first paragraph
  3. Press Delete button to delete in forward direction

Expected: The last paragraph should disappear
Actual: It keeps a linebreak that never disappears by forward deletion

Summary: Forward-deleting empty paragraph keeps a linebreak → Forward-deleting empty paragraph keeps a linebreak in contenteditable
Attachment #9150462 - Attachment is obsolete: true

This somehow does not repro with contenteditable but only with designMode. Contenteditable shows another bug that undoing introduces duplicated paragraphs, though.

Summary: Forward-deleting empty paragraph keeps a linebreak in contenteditable → Forward-deleting empty paragraph keeps a linebreak in designMode=true
Depends on: 1639594
Assignee: nobody → krosylight
Severity: -- → S3

Modifying HTMLEditor::IsVisibleBRElement to consider a lonely <br> inside a block as visible fixes this.

But the function looks like a duplicate of nsLayoutUtils::IsInvisibleBreak, do we have a reason not to call it instead?

Flags: needinfo?(masayuki)

Probably, it's duplicated for that editor won't be broken by layout team's changes. As you know, editor module does not have enough automated tests even though its functions are really complicated (especially before WPT comes into the tree). So, the isolation must have been important for this reason.

And also, nsLayoutUtils::IsInvisibleBreak() refers layout information. It returns correct and actual state, but it may require latest layout information. For example, immediately after inserting a <br> element, it returns different result unless you flush pending notifications. If we did it, perhaps, execCommand speed would become slower and some benchmark score might become worse. So, I think that we should keep current style unless the difference of them causes actual problem.

Flags: needinfo?(masayuki)

Haven't been working on it, unassigning myself...

Assignee: krosylight → nobody
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: