text-overflow: ellipsis is painted as solid bar with skia backend (missing w/ some other backends), if an element with position:fixed and background-color is in DOM before

RESOLVED FIXED in Firefox -esr52

Status

()

P3
normal
RESOLVED FIXED
2 years ago
a year ago

People

(Reporter: fr33k4t3k, Assigned: lsalzman)

Tracking

(Blocks: 1 bug, {regression, testcase})

40 Branch
mozilla55
regression, testcase
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox49 wontfix, firefox-esr45 wontfix, firefox50 wontfix, firefox51 wontfix, firefox52 wontfix, firefox-esr52 fixed, firefox53 wontfix, firefox54 wontfix, firefox55 fixed)

Details

(Whiteboard: [gfx-noted])

Attachments

(3 attachments)

(Reporter)

Description

2 years ago
Created attachment 8794180 [details]
bugzilla.png

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0
Build ID: 20160823121617

Steps to reproduce:

my basic code:

#fixed {
    position: fixed;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background-color: green;
}
#overflow {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    width: 100px;
}

<div id="fixed"></div>
<div id="overflow">abcdefghijklmnopqrstuvwxyz</div>


Actual results:

text gets cut, but no dots are displayed

Comment 1

2 years ago
Created attachment 8794239 [details]
1305036.html

Updated

2 years ago
Component: Untriaged → Layout
Product: Firefox → Core
The testcase works fine for me on Linux, in both v49 and Nightly.
(Reporter)

Comment 3

2 years ago
(In reply to Mats Palmgren (:mats) from comment #2)
> The testcase works fine for me on Linux, in both v49 and Nightly.
then it seems to be windows related; I tested on win10 with v48.0.0.2 and v50.0a2 and it doesn't work as expected.
I do see an issue on Linux, and I think it's a manifestation of the same underlying problem that's causing trouble on Windows.

Specifically, I see a soloid horizontal bar instead of an ellipsis.  Mozregression dates this to bug 1278957 (which switched us to using the skia backend on Linux).  I only see this horizontal-bar glitch with the specific conditions in this bug's testcase, too (position:fixed element, with background-color, in DOM before the ellipsis element).  If I vary any of those factors, I see a normal ellipsis.

So I suspect some version of this bug (no-ellipsis or bar-ellipsis) reproduces with an Azure backend of "direct2d1.1" (the preferred backend on windows) and skia (the new preferred backend on Linux), though not with cairo (the old preferred backend on Linux).  There might be another factor as well, if Mats really isn't seeing any issues on Linux, though.
Some kind of graphics / layers issue then?
Component: Layout → Graphics: Layers
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: text-overflow: ellipsis doesn't work if an element with position:fixed and background-color is in DOM before → text-overflow: ellipsis is painted as solid bar with skia backend (missing w/ other backends), if an element with position:fixed and background-color is in DOM before
Summary: text-overflow: ellipsis is painted as solid bar with skia backend (missing w/ other backends), if an element with position:fixed and background-color is in DOM before → text-overflow: ellipsis is painted as solid bar with skia backend (missing w/ some other backends), if an element with position:fixed and background-color is in DOM before

Comment 6

2 years ago
I see the issue only with HWA disabled on Win 7.

Comment 7

2 years ago
Regression range on Windows:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=35046df9df1f&tochange=70a113676b21

I think it's due to bug 1148855.
Blocks: 1148855
Keywords: regression
(Assignee)

Comment 9

2 years ago
Markus, can you take a look if this is related to bug 1148855 as Loic thinks?

Though, I can't reproduce this one on Linux with Skia or Cairo content with Nightly.
Has STR: --- → yes
Flags: needinfo?(mstange)
Keywords: testcase
Priority: -- → P3
Whiteboard: [gfx-noted]
status-firefox49: --- → affected
status-firefox50: --- → affected
status-firefox51: --- → affected
status-firefox52: --- → affected
Version: 50 Branch → 49 Branch
Too late to fix in 49.
status-firefox49: affected → wontfix
status-firefox50: affected → fix-optional
Version: 49 Branch → 40 Branch
(In reply to Lee Salzman [:lsalzman] from comment #9)
> Markus, can you take a look if this is related to bug 1148855 as Loic thinks?

Yes, I think Loic is right. If I turn on layer borders, I can see that we create a separate layer for the ellipsis item now. We wouldn't have done that before bug 1148855.

(If the page were horizontally scrollable to the left, then the ellipsis could conceivably overlap with the fixed layer, and apparently it's above the fixed layer in z-order, so we need to pull it out into a separate layer.)

> Though, I can't reproduce this one on Linux with Skia or Cairo content with
> Nightly.

I can't reproduce it on Mac either.
Flags: needinfo?(mstange)
While this is uncovered by the layerization change, it sounds like it is an underlying issue in graphics, only on some backends.  A good background task.
Assignee: nobody → lsalzman
status-firefox51: affected → wontfix
status-firefox52: affected → wontfix
status-firefox53: --- → fix-optional

Updated

2 years ago
Blocks: 1336680
(Assignee)

Comment 13

a year ago
Created attachment 8873600 [details] [diff] [review]
implement nsDisplayTextOverflowMarker::GetComponentAlphaBounds to handle ellipsis with subpixel AA

We were trying to render the ellipsis with subpixel AA into a BGRA surface. So when composited, this just showed up as a black (or transparent) mess in the places that should have been anti-aliased. This was because nsDisplayTextOverflowMarker, which was doing the drawing, did not implement GetComponentAlphaBounds.

If subpixel AA was not enabled, everything would seem to work, and thus that was why it was not reproducible in some configurations.
Attachment #8873600 - Flags: review?(mstange)
Attachment #8873600 - Flags: review?(mstange) → review+

Comment 14

a year ago
Pushed by lsalzman@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9f6c73141311
implement nsDisplayTextOverflowMarker::GetComponentAlphaBounds to handle ellipsis with subpixel AA. r=mstange
(Assignee)

Updated

a year ago
status-firefox54: --- → affected
status-firefox55: --- → affected
status-firefox-esr45: --- → affected
status-firefox-esr52: --- → affected
Component: Graphics: Layers → Layout: Text
OS: Unspecified → All
Hardware: Unspecified → All
status-firefox50: fix-optional → wontfix
status-firefox53: fix-optional → wontfix
status-firefox-esr45: affected → wontfix

Comment 15

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/9f6c73141311
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox55: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Wontfix for 54, since we are building the release candidate today.
status-firefox54: affected → wontfix
Given that ESR52 has a high number of Skia users, is this something we should consider backporting there?
Flags: needinfo?(lsalzman)
(Assignee)

Comment 18

a year ago
Comment on attachment 8873600 [details] [diff] [review]
implement nsDisplayTextOverflowMarker::GetComponentAlphaBounds to handle ellipsis with subpixel AA

[Approval Request Comment]
User impact if declined: Ellipsis fail to show up with text-overflow.
Fix Landed on Version: 55
Risk to taking this patch (and alternatives if risky): none
String or UUID changes made by this patch: none
Flags: needinfo?(lsalzman)
Attachment #8873600 - Flags: approval-mozilla-esr52?
Comment on attachment 8873600 [details] [diff] [review]
implement nsDisplayTextOverflowMarker::GetComponentAlphaBounds to handle ellipsis with subpixel AA

Per comment #17, ESR52 has a high number of Skia users. Let's uplift it to ESR52.3.
Attachment #8873600 - Flags: approval-mozilla-esr52? → approval-mozilla-esr52+

Comment 20

a year ago
bugherderuplift
https://hg.mozilla.org/releases/mozilla-esr52/rev/c42a348f2ed0
status-firefox-esr52: affected → fixed
You need to log in before you can comment on or make changes to this bug.