Closed Bug 1808722 Opened 1 year ago Closed 1 year ago

[Gmail] Formatting is not respected after typing between 2 blocks of text with different styles

Categories

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

defect

Tracking

()

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

People

(Reporter: oardelean, Assigned: masayuki)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

Notes

  • Does not reproduce in Chrome. Please see the attached video for more details.
  • This reproduces with editor.join_split_direction.compatible_with_the_other_browsers with both true and false values.

Found in

  • Nightly 110.0a1;

Affected versions

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

Tested platforms

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

Affected platforms

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

Unaffected platforms

  • N/A;

Steps to reproduce

  1. Launch Firefox and go to https://mail.yahoo.com or https://mail.google.com.
  2. Log in with a valid account.
  3. Click on "Compose" to open up a new e-mail window.
  4. Write 2 phrases, each with different text size, color, etc.
  5. Merge the phrases on the same row by hitting Backspace.
  6. Type something between the two phrases.

Expected result

  • Formatting should be taken from the left text block.

Actual result

  • Formatting is taken from the right text block.

Regression range

  • Will look for one as soon as possible.
Severity: -- → S3
Has STR: --- → yes

I tried searching for a regression range but it seems that I can reproduce the issue up until Nightly 63.0a1(2018-07-07).
I think it's safe to assume that this is not a regression.

Gecko allows users to type both styles at the style boundary if caret is moved from either style. Therefore, this behavior is intentional at least when this is designed. (Instead, Blink does not allow users to put to start of following text node, therefore, the previous style is always used.)

In the editing API working group, this kind of Blink's limitation should be fixed because of this does not allow web apps to put caret with Selection API and user types in specific styled element. Therefore, we should be careful about that how they will fix this issue.

On the other hand, I do the operation in Word, I see same result as Blink. So, it may be worthwhile to change the caret position at joining the paragraphs to make the previous paragraph's style be preferred.

OS: Unspecified → All
Priority: -- → P3
Hardware: Unspecified → All

If the style differences are only font size and/or colors, I found a serious web-compat issue which is lost a font style. See bug 1811434.

The other browsers do not allow to type text into right hand inline element,
however, Gecko allows it depending on the cursor movement immediately before.
I think that Gecko's behavior is reasonable for users from point of view of
style editing. However, for providing consistent behavior between browsers,
we should collapse selection to end of left paragraph's text node when joining
paragraphs. Then, web apps do not need to arrange Selection for consistent
behavior between browsers and we can keep the Gecko's better style handling.

Depends on D167742

Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Summary: [Yahoo mail, Gmail] Formatting is not respected after typing between 2 blocks of text with different styles → [Yahoo mail][Gmail] Formatting is not respected after typing between 2 blocks of text with different styles
Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/3205795f498a
Make the delete handler of `HTMLEditor` collapse `Selection` to end of left block after joining blocks r=m_kato
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/38249 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
Upstream PR merged by moz-wptsync-bot

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)

Hello,
Gmail on the latest Nightly is working as expected (regarding this fix), but Yahoo still retains the formatting from the right block. Should I open a new issue for yahoo only?

Flags: needinfo?(masayuki)

(In reply to Ardelean Oana from comment #10)

Gmail on the latest Nightly is working as expected (regarding this fix), but Yahoo still retains the formatting from the right block. Should I open a new issue for yahoo only?

Oh? Yeah, please. And sorry for the mistake.

Flags: needinfo?(masayuki)
Summary: [Yahoo mail][Gmail] Formatting is not respected after typing between 2 blocks of text with different styles → [Gmail] Formatting is not respected after typing between 2 blocks of text with different styles

Verified as fixed on Nightly 111.0a1(build ID: 20230201215112) on macOS 12, Windows 10, Ubuntu 22.
I filled bug 1814337 for Yahoo.
Thank you.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: