Closed Bug 1426068 Opened 6 years ago Closed 6 years ago

Disabling @-moz-document results in users being unable to enter line-breaks into YouTube comments

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
platform-rel --- ?
firefox-esr52 --- unaffected
firefox57 --- unaffected
firefox58 --- unaffected
firefox59 --- wontfix
firefox60 --- fixed
firefox61 --- fixed

People

(Reporter: denschub, Unassigned)

References

()

Details

(Keywords: regression, Whiteboard: [platform-rel-youtube][sitewait])

So, this is weird.

STR:

1. Open any YouTube video
2. Log in
3. Type a comment and try to add a line break

Expected result:

Line break is inserted.

Actual result:

Space is added, no line break. When submitting the comment, however, it will result in a line break being added.
This is fallout from bug 1035091, where we decided to no longer allow @-moz-document to be used. Toggling `layout.css.moz-document.content.enabled` makes the line breaks appear again.

Given it only affects 59 and since there is still a lot of time left in that train, we might be able to resolve this by doing outreach. I'll do some diagnosis on their CSS and see if I can come up with a solution for YouTube. Still, requesting tracking as a 59 regression, it's YouTube after all.
So, thanks for the YouTube folks for leaving the comment in.

> <style>
>   /*
>    * TODO(b/38247967): Firefox doesn't break line correctly when white-space is
>    * set to normal. Remove this hack once the variable is removed from
>    * paper-dropdown-menu's  mixin.
>    */
>   @-moz-document url-prefix() {
>     textarea {
>       --paper-input-container-input_-_white-space pre-wrap;
>     }
>   }
> </style>

Which is, indeed, true. For <textarea>s that have `white-space: normal;`, we display a space instead of a line break. Not too sure what we are supposed to do, though. Will continue looking into it...
This is bug 1386100, basically. Worth nothing that according to the spec, we are doing the right thing, while Chrome always behaves like `pre-wrap`, even if something different is set. Even `nowrap` does not alter the behavior in Chrome. I consider that an issue and will follow-up on the issue mentioned before.

As for YouTube, I don't really see why it is necessary to add `white-space: normal;` in the first place, but when reading the comment, this seems to have a framework issue linked to it, so maybe they simply cannot not set it. However, since Chrome behaves the same way anyway, I'd suggest adding `pre-wrap` for all browsers. If that's not an option, they have to come up with a different solution of serving CSS for Firefox only, but I doubt this is necessary here. This seems to be the only use of @-moz-document I could find, but it's probably worth generally highlighting that.

Adam, do you want to do the mailing with YouTube people or do you prefer me doing it? :)
Flags: needinfo?(astevenson)
See Also: → 1386100
This Is Just To Say

I have tracked
the bug 
that was not in
Firefox 59 

and which
you are probably
hoping
will be fixed by YouTube

Forgive me
but as a poet I really like line breaks and white space
so sweet
and so much like code
(In reply to Liz Henry (:lizzard) (needinfo? me) from comment #4)
> This Is Just To Say
> 
> I have tracked
> the bug 
> that was not in
> Firefox 59 
> 
> and which
> you are probably
> hoping
> will be fixed by YouTube
> 
> Forgive me
> but as a poet I really like line breaks and white space
> so sweet
> and so much like code

Lol :)

Just wanted to add that @-moz-document is not going to be disabled on late beta / release, so not sure if it needs tracking.
Flags: needinfo?(astevenson)
(In reply to Emilio Cobos Álvarez [:emilio] from comment #5)
> 
> Just wanted to add that @-moz-document is not going to be disabled on late
> beta / release, so not sure if it needs tracking.

But we're hoping for 59?
Flags: needinfo?(emilio)
Not necessarily, no, until all the relevant regressions are fixed.
Flags: needinfo?(emilio)
platform-rel: --- → ?
Whiteboard: [platform-rel-youtube]
Could we contact Youtube about this? I'd like to eventually disable @-moz-document on release, and this is the biggest blocker.

Maybe pointing them to bug 1386100 or https://github.com/whatwg/html/issues/3301 to see the state of affairs? This can definitely be fixed on their side.
Flags: needinfo?(overholt)
Adam, can you get in touch with YouTube about this please?
Flags: needinfo?(overholt) → needinfo?(astevenson)
Sure. Reaching out via our mailing list.
Flags: needinfo?(astevenson)
Whiteboard: [platform-rel-youtube] → [platform-rel-youtube][sitewait]
They are tracking internally (b/38247967) and have added this information to it.
This seems to be fixed now.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.