Closed Bug 1807829 Opened 1 year ago Closed 1 year ago

[Yahoo mail] Changing text size does not respect spacing

Categories

(Core :: DOM: Editor, defect, P2)

Desktop
Unspecified
defect

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox108 --- wontfix
firefox109 --- wontfix
firefox110 --- wontfix
firefox111 --- verified

People

(Reporter: oardelean, Assigned: masayuki)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

Attachments

(2 files)

Notes

  • This does not reproduce in Chrome. Please see the attached video for more clarity.

Found in

  • Nightly 110.0a1;

Affected versions

  • Nightly 110.0a1;
  • Firefox 108.0.1;
  • Firefox 109.0b7;

Tested platforms

  • macOS 12;
  • Ubuntu 22;
  • Windows 10;

Affected platforms

  • macOS 12;
  • Ubuntu 22;
  • Windows 10;

Unaffected platforms

  • N/A;

Preconditions

  • The user is signed in to yahoo mail with a valid account.

Steps to reproduce

  1. Open a new mail by clicking on the "Compose" button.
  2. From the text formatting options, select the “Huge” size.
  3. Type a few rows with the selected text size.
  4. Observe the spacing after each written row.
  5. From the text formatting options, select the “Tiny” size.
  6. Type a few rows with the selected text size.
  7. Observe the spacing after each written row.

Expected result

  • Spacing should reflect the text size.

Actual result

  • Spacing is not re-applied after changing the text size.

Regression range

  • Not a recent regression, will look for a regression range as soon as possible.
Severity: -- → S3
Has STR: --- → yes

In firefox, the editor insert font tag without remove previous font tag as follows:
<div dir="ltr" data-setdir="false"><font size="7"><font size="1">test</font></font></div>

However, in Edge(chrome):
<div dir="ltr" data-setdir="false"><font size="1">test</font></div>

Component: Graphics: Text → DOM: Editor

I tried searching for a regression range but it seems that I can reproduce the issue up until Nightly 71.0a1(build ID: 20190922213341).
I think it's safe to assume that this is not a regression.

I should check whether it's a bug of the web app or Gecko.

Flags: needinfo?(masayuki)
Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Flags: needinfo?(masayuki)
Priority: -- → P2

The problem in Yahoo mail is, when you apply new font size to:

<div><font size="7">{}<br></font></div>

then, when you type text, you'll get:

<div><font size="7"><font size="4">abc<br></font></font></div>

because HTMLEditor::CreateStyleForInsertText does not check ancestors to
apply new style to empty text node which is created by the method for
placeholder. Of course, the other browsers update the existing
<font size="7"> instead and we should follow it.

However, there are 3 problems:

  1. Our editor may adjust insertion point to nearest editable text node if caret
    in empty inline elements.
  2. Our editor supports increase/decrease font size which have been removed from
    Document.execCommand, but Thunderbird keeps using it, and that's implemented
    with an independent method.
  3. Our style editor code does not support applying style to collapsed selection.

Therefore, this patch does:

  1. keep create empty text node to apply new style at specific point.
  2. give up to use new path if there is preserved font size increment/decrement.
  3. separate HTMLEditor::SetInlinePropertiesAsSubAction and add new path for
    applying style to collapsed range.

Then, HTMLEditor::CreateStyleForInsertText can use
HTMLEditor::SetInlinePropertiesAsSubAction which supports handling new styles
with existing ancestors.

Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/dfd4ec691465
Make `HTMLEditor::CreateStyleForInsertText` use same logic as `HTMLEditor::SetInlinePropertiesAsSubAction` to apply new style r=m_kato
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/38005 for changes under testing/web-platform/tests
Upstream PR was closed without merging
Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/5bacd687fa98
Make `HTMLEditor::CreateStyleForInsertText` use same logic as `HTMLEditor::SetInlinePropertiesAsSubAction` to apply new style r=m_kato
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
Upstream PR merged by moz-wptsync-bot
Flags: needinfo?(masayuki)

The patch landed in nightly and beta is affected.
:masayuki, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox110 to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(masayuki)

Verified on Nightly 111.0a1(build ID: 20230119163652) on macOS 12, Ubuntu 22, Windows 10.

Regressions: 1852849
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: