Open Bug 1513170 Opened 6 years ago Updated 3 years ago

extremely wide tooltips (e.g. from "title" attribute) don't render at all, or cause graphical corruption

Categories

(Core :: Graphics, defect, P3)

Unspecified
macOS
defect

Tracking

()

Tracking Status
firefox66 --- affected

People

(Reporter: nchevobbe, Unassigned)

Details

**Steps to reproduce** 1. Go to `data:text/html,<meta charset=utf8><h1>Hello</h1><script>document.body.firstChild.setAttribute("title", "b".repeat(2500))</script>` 2. Hover the <h1> in the content page **Expected results** I do see a tooltip containing 2500 "b"s. **Actual results** No tooltip is displayed at all. Note that: - it might be size screen dependant (2400 was working fine on my laptop) - if I switch to "b ".repeat(2500) (or a lot more), it works fine. --- (Not sure this is the right component, feel free to move it elsewhere)
Is this a regression?
Not sure, I reproduce on 60 ESR
On my linux laptop, this testcase causes graphical corruption -- basically, my whole screen gets repainted on top of itself, shifted down below "Hello" as if this copy-of-my-screen were the tooltip. Or variants of that, with a bit of randomness thrown in. In a debug build, I get this output in my terminal: ======= [GFX3-]: Surface size too large (exceeds extent limit)! [GFX3-]: Surface size too large (exceeds extent limit)! Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Failed to allocate a surface due to invalid size (CDT) Size(42518,58) (t=47.6345) [GFX1-]: Failed to allocate a surface due to invalid size (CDT) Size(42518,58) [GFX3-]: Surface size too large (exceeds extent limit)! [Parent 16749, Main Thread] WARNING: No context when we have something to draw, resource exhaustion?: 'state.mRegionToDraw.IsEmpty()', file /scratch/work/builds/mozilla-inbound/mozilla/gfx/layers/basic/BasicPaintedLayer.cpp, line 201 =======
So this is probably closer to Graphics. (Not sure how easy it is to fallback gracefully and just truncate the content here, but that's probably what we should do.)
Component: Layout → Graphics
Summary: title without whitespace produces no tooltip if string long enough → extremely wide tooltips (e.g. from "title" attribute) don't render at all, or cause graphical corruption
Heh, this crashes gnome-shell for me.
I don't know how tooltips are displayed, but this sounds surface size related. This testcase is rough because 'b'.repeat(2500) makes one extra large word which can't be broken. If you change it to 'b '.repeat(2500), it displays just fine by breaking the word. Do we have something in layout which could force us to break the word here, or maybe just overflow the window size and have it be cut off?
Priority: -- → P3
I guess it's probably better be fixed in tooltip rather than graphics (or even better, both), since very long tooltip isn't going to be useful anyway. We probably should force a max width of screen size on tooltip. (Is this part of layout or toolkit or XUL?)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.