Closed Bug 1305036 Opened 8 years ago Closed 7 years ago

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

Categories

(Core :: Layout: Text and Fonts, defect, P3)

40 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox49 --- wontfix
firefox-esr45 --- wontfix
firefox50 --- wontfix
firefox51 --- wontfix
firefox52 --- wontfix
firefox-esr52 --- fixed
firefox53 --- wontfix
firefox54 --- wontfix
firefox55 --- fixed

People

(Reporter: fr33k4t3k, Assigned: lsalzman)

References

(Blocks 1 open bug)

Details

(Keywords: regression, testcase, Whiteboard: [gfx-noted])

Attachments

(3 files)

Attached image 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
Attached file 1305036.html
Component: Untriaged → Layout
Product: Firefox → Core
The testcase works fine for me on Linux, in both v49 and Nightly.
(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
I see the issue only with HWA disabled on Win 7.
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]
Version: 50 Branch → 49 Branch
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.
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+
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
Component: Graphics: Layers → Layout: Text
OS: Unspecified → All
Hardware: Unspecified → All
https://hg.mozilla.org/mozilla-central/rev/9f6c73141311
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Wontfix for 54, since we are building the release candidate today.
Given that ESR52 has a high number of Skia users, is this something we should consider backporting there?
Flags: needinfo?(lsalzman)
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+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: