Closed Bug 1905904 Opened 1 year ago Closed 1 year ago

google.com - Can not insert more than 1 space char in the same focused area

Categories

(Core :: Layout: Form Controls, defect, P2)

Firefox 129
Desktop
Windows 10
defect

Tracking

()

VERIFIED FIXED
134 Branch
Tracking Status
firefox127 --- wontfix
firefox129 --- wontfix
firefox134 --- fixed

People

(Reporter: rbucata, Assigned: emilio)

References

()

Details

(Keywords: webcompat:contact-ready, webcompat:site-report, Whiteboard: [webcompat-source:product], [wptsync upstream][webcompat:sightline])

User Story

platform:windows,mac,linux
impact:annoyance-minor
configuration:general
affects:all
branch:release
diagnosis-team:dom

Attachments

(2 files)

Attached video 20240702_164833.mp4

Environment:
Operating system: Windows 10
Firefox version: Firefox 127.0.1 (release)/ Firefox Nightly 129.0a1 (2024-07-01)

Preconditions:

  • Clean profile

Steps to reproduce:

  1. Navigate to: https://www.google.com/search?as_st=y&as_q=Ahava+Tzeira+Young+Love+Lemon+Popsicle+7+1987+++++++++++++++++++++++++++++++++++++++++++dvd+cover&as_epq=&as_oq=&as_eq=&imgar=&imgcolor=&imgtype=&cr=&as_sitesearch=&as_filetype=&tbs=&udm=2
  2. Attempt to insert a space char between characters that already have a space char
  3. Observe

Expected Behavior:
The space character is introduced

Actual Behavior:
Nothing happens

Notes:

  • Reproducible on the latest Firefox Release and Nightly
  • Reproduces if a space char is already introduced or if you attempt to insert a second space char after you've already insert one
  • Reproducible regardless of the ETP setting
  • Works as expected using Chrome

Created from webcompat-user-report:9115a436-3f9f-41dd-b106-82a709fcb6f9

Severity: -- → S4
User Story: (updated)
Priority: -- → P2
User Story: (updated)

Happens with any google.com search string with spaces in it, or after you put one space on the end of a search string

Masayuki, do you mind triage this? I think this relates to editing code..

Flags: needinfo?(masayuki)

The <textarea> has white-space:pre-line or white-space:nowrap rule. Therefore, consecutive white-spaces are collapsed. On the other hand, I don't think that white-space-collapse style should be applied in <textarea> nor <input>. So, perhaps, we should specify the style to the anonymous <div> for TextEditor.

Severity: S4 → --
Component: Site Reports → Layout: Form Controls
Flags: needinfo?(masayuki)
Product: Web Compatibility → Core

Sounds like at least we could do an intervention, maybe requires a spec change to formalized it?

User Story: (updated)

Trying to fix this...

Assignee: nobody → masayuki
Status: NEW → ASSIGNED
User Story: (updated)

Hmm, I cannot fix this with updating forms.css because either white-space-collapse: preserve or white-space-collapse: breaks-spaces is valid in <textarea>. So, we need to make the layout module override the style of the anonymous <div>.

Assignee: masayuki → nobody
Status: ASSIGNED → NEW

The severity field is not set for this bug.
:tlouw, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(tlouw)

Emilio can you have a look at this one, please?

Flags: needinfo?(tlouw) → needinfo?(emilio)

So... Masayuki, is it correct that what you want to do is basically disallowing "white-space-collapse: collapse" on input / textareas?

If so, you can tweak it here: https://searchfox.org/mozilla-central/rev/964b8aa226c68bbf83c9ffc38984804734bb0de2/servo/components/style/style_adjuster.rs#575

But honestly I think our behavior is reasonable?

Flags: needinfo?(emilio) → needinfo?(masayuki)

Oh, thanks, I've not known the method which overrides the style conditionally.

TextEditor assumes that white-spaces are always preserved and it's reasonable for computing the values and requires to preserve white-spaces and NBSPs as inputted by the user or web app. Therefore, I believe that white-spaces should always be not collapsible and line breaks should always be preformatted in text controls.

On the other hand, we need to preserve the wrapping style which is specified to the text control. That's the reason why I couldn't fix this in forms.css. (At least, the latter is tested by WPT.)

Flags: needinfo?(masayuki)

I'm confused. I tried to tweak the style there, but it's unclear what you'd like the fix to be? I don't see why it needs to be conditional?

Flags: needinfo?(masayuki)
Assignee: nobody → emilio
Status: NEW → ASSIGNED

I think that white-space-collapse can be preserve and break-spaces (according to WPT result). Therefore, I think that if the computed value is break-spaces, preserve should not be set.

Flags: needinfo?(masayuki)
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/53711e5bca1a Always preserve collapsible spaces in text controls. r=masayuki
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/49022 for changes under testing/web-platform/tests
Whiteboard: [webcompat-source:product] → [webcompat-source:product], [wptsync upstream]
Pushed by emilio@crisal.io: https://hg.mozilla.org/integration/autoland/rev/abb00665b017 Remove a reftest that now expectedly fails.
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 134 Branch
Upstream PR merged by moz-wptsync-bot

Works as expected, thank you Emilio!

Status: RESOLVED → VERIFIED
Whiteboard: [webcompat-source:product], [wptsync upstream] → [webcompat-source:product], [wptsync upstream][webcompat:sightline]
Regressions: 1933626
No longer regressions: 1933626
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: