Open Bug 486879 Opened 16 years ago Updated 2 years ago

text in custom <scale> thumb jiggles around

Categories

(Core :: XUL, defect)

x86
macOS
defect

Tracking

()

People

(Reporter: Dolske, Unassigned)

References

Details

Attachments

(1 file)

Found while implementing bug 475318, which adds a custom thumb to a XUL <scale> for the HTML5 video controls. On OS X, the timestamp (which is just a <label>) jiggles around inside the thumb while video is playing... The thumb itself is moving right in 1-pixel increments, but the text seems to be shifting by sub-pixel increments. The next effect is that text jiggles, as makes fuzzy sub-pixel position changes but the thumb hasn't moved yet. This is most obvious on longer videos, where the timestamp is changing but the thumb only moves now and then. For example, any of the recorded sessions on http://air.mozilla.com/. dbaron mentioned that OS X is infamous for doing sub-pixel text positioning (and causing reftest headaches as a result). This might not be a problem on OS X or Linux (but I wasn't watching as closely there).
does adding style="text-rendering: geometricPrecision;" to the label help?
Attached patch Partial fix?Splinter Review
This seems to fix part of the problem, by making nsSliderFrame.cpp snap the thumb to a pixel boundary. It's applied on top of Patch v.3 from bug 475318. But it's ugly, because I don't really know layout bits. :) The videocontrols.css/.xml changes mask over a couple of other behavours, so I suspect there might be multiple bugs here: * With only the nsSliderFrame.cpp change, the whole thumb bounces left and right by 1 pixel as the video plays. My patch is basically doing a floor() snap, but it's acting like something else is expecting a round() snap and invalidation is awry. Changing the thumb width to an odd value (in videocontrols.css) seems to avoid the problem. Not sure if this is a real bug, or my patch is just wrong. * With the .cpp and .css change, the text still bounces left and right by 1 (or 1/2?) pixel within the thumb, apparently even when the value isn't changed. Another invalidation issue, maybe? I sometimes get a bunch of "WARNING: converted background area should not be empty: file /Users/dolske-bulk/build/mozilla-central/layout/base/nsCSSRendering.cpp, line 1475" console spewage, not sure if that's related.
Bah, meant to add on the last point: the XBL change masks that problem, but obviously isn't a good fix. :) It's just enough to show that when the scrubber thumb's text is a static "0:00:00", it moves with the thumb as expected.
(In reply to comment #1) > does adding style="text-rendering: geometricPrecision;" to the label help? Nope, no change. I should also note this bug's effect is most obvious when the thumb makes a 1-pixel shift, but the text does not. The sub-pixel crawl isn't as noticeable as the text not jumping with the thumb.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: