Closed Bug 1679208 Opened 4 years ago Closed 4 years ago

Improve non-native theme with fractional scaling.

Categories

(Core :: Widget, defect)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(4 files)

This is a partial fix towards bug 1657191, which massively improves scrollbars and other form controls.

Partial because I think to be fully correct we need to change a couple other APIs that right now use int margins, which is more work.

This greatly improves non-native theme on Windows in presence of fractional DPI
(see bug 1657191).

This matches what the Windows native theme does, to my knowledge, see
ScaleForFrameDPI in nsNativeThemeWin.h.

However I think the right fix is to not make these LayoutDeviceInt* things but
LayoutDevice*.

That's a bigger fix, and fits well as a follow-up to this bug, so let's land
this in the meantime.

Assignee: nobody → emilio
Status: NEW → ASSIGNED

This doesn't hold with fractional scale values. Right now GTK truncates
the scale factor, Windows rounds, and non-native theme rounds as well.

With this native theme will propagate correctly the floating point
values.

I tried to not change behavior meaningfully in any of the other themes,
mostly to avoid risk. GTK and Windows can be trivially tweaked to
support fractional scale factors properly if we wanted to, but seems
better to not do that as part of this patch.

Depends on D98099

Keywords: leave-open
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/98e36a94b9e8 Improve non-native theme with fractional scaling. r=heycam https://hg.mozilla.org/integration/autoland/rev/03d5d86b5073 Use more strongly typed rects in nsNativeBasicTheme. r=heycam
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f79d16c80de6 Fix pre-existing unit confusion in gtk scrollbar painting. r=heycam
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3e90a3759639 Don't assume int return values in nsITheme. r=mstange

Backed out changeset 3e90a3759639 (bug 1679208) for scrollbars-no-margin.html failures.

Push with failure: https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&fromchange=20e9f56119c8cffc4ad0a1c3769d31f34822c05e&searchStr=windows%2C10%2Cx64%2Cwebrender%2Cdebug%2Cweb%2Cplatform%2Ctests%2Ctest-windows10-64-qr%2Fdebug-web-platform-tests-reftest-e10s%2Cwr4&tochange=18733ce7c875dc334b17e7c8f4289b4528a6dc75&selectedTaskRun=apWrVdD_QDyejHtOgdL9Ag.0

Backout link: https://hg.mozilla.org/integration/autoland/rev/18733ce7c875dc334b17e7c8f4289b4528a6dc75

Failure log: https://treeherder.mozilla.org/logviewer?job_id=323363533&repo=autoland&lineNumber=13156

[task 2020-12-02T23:00:44.739Z] 23:00:44     INFO - TEST-START | /css/css-multicol/multicol-rule-002.xht
[task 2020-12-02T23:00:44.749Z] 23:00:44     INFO - PID 6216 | 1606950044742	Marionette	INFO	Testing http://web-platform.test:8000/css/css-multicol/multicol-rule-002.xht == http://web-platform.test:8000/css/css-multicol/multicol-rule-ref.xht
[task 2020-12-02T23:00:44.780Z] 23:00:44     INFO - PID 6216 | [Parent 9324, IPDL Background] WARNING: Cannot record shutdown step, mConnection is nullptr: file /builds/worker/checkouts/gecko/dom/localstorage/ActorsParent.cpp:8039
[task 2020-12-02T23:00:44.799Z] 23:00:44     INFO - Got content assert count 1
[task 2020-12-02T23:00:44.800Z] 23:00:44     INFO - PID 6216 | [Child 7316, Main Thread] WARNING: '!CanSend() || !mManager || !mManager->CanSend()', file /builds/worker/checkouts/gecko/dom/ipc/jsactor/JSWindowActorChild.cpp:40
[task 2020-12-02T23:00:44.821Z] 23:00:44     INFO - TEST-UNEXPECTED-FAIL | /css/css-flexbox/scrollbars-no-margin.html | Testing http://web-platform.test:8000/css/css-flexbox/scrollbars-no-margin.html == http://web-platform.test:8000/css/css-flexbox/scrollbars-no-margin-ref.html
[task 2020-12-02T23:00:44.821Z] 23:00:44     INFO - Found 846 pixels different, maximum difference per channel 255
[task 2020-12-02T23:00:44.822Z] 23:00:44     INFO - REFTEST   IMAGE 1 (TEST): data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAA...
[task 2020-12-02T23:00:44.823Z] 23:00:44     INFO - REFTEST   IMAGE 2 (REFERENCE): data:image/png;base64,iVBORw0KGgoAA...
[task 2020-12-02T23:00:44.823Z] 23:00:44     INFO - TEST-INFO took 787ms
[task 2020-12-02T23:00:44.896Z] 23:00:44     INFO - PID 7796 | [GPU 4620, Compositor] WARNING: Possibly dropping task posted to updater thread: file /builds/worker/checkouts/gecko/gfx/layers/apz/src/APZUpdater.cpp:370
[task 2020-12-02T23:00:44.972Z] 23:00:44     INFO - PID 6216 | [Parent 9324, IPDL Background] WARNING: Cannot record shutdown step, mConnection is nullptr: file /builds/worker/checkouts/gecko/dom/localstorage/ActorsParent.cpp:8039
[task 2020-12-02T23:00:44.980Z] 23:00:44     INFO - PID 7796 | 1606950044975	Marionette	INFO	Stopped listening on port 51056
[task 2020-12-02T23:00:45.123Z] 23:00:45     INFO - PID 6216 | 1606950045122	Marionette	INFO	No differences allowed
[task 2020-12-02T23:00:45.125Z] 23:00:45     INFO - PID 7796 | [Child 2420, Main Thread] WARNING: '!CanSend() || !mManager || !mManager->CanSend()', file /builds/worker/checkouts/gecko/dom/ipc/jsactor/JSWindowActorChild.cpp:40
[task 2020-12-02T23:00:45.125Z] 23:00:45     INFO - PID 7796 | [Child 2420, Main Thread] WARNING: '!CanSend() || !mManager || !mManager->CanSend()', file /builds/worker/checkouts/gecko/dom/ipc/jsactor/JSWindowActorChild.cpp:40
[task 2020-12-02T23:00:45.152Z] 23:00:45     INFO - PID 7796 | [Child 2420, Main Thread] WARNING: '!CanSend() || !mManager || !mManager->CanSend()', file /builds/worker/checkouts/gecko/dom/ipc/jsactor/JSWindowActorChild.cpp:40
[task 2020-12-02T23:00:45.164Z] 23:00:45     INFO - PID 7796 | [Child 2420, Main Thread] WARNING: '!CanSend() || !mManager || !mManager->CanSend()', file /builds/worker/checkouts/gecko/dom/ipc/jsactor/JSWindowActorChild.cpp:40
[task 2020-12-02T23:00:45.166Z] 23:00:45     INFO - PID 7796 | [Child 2420, Main Thread] WARNING: '!CanSend() || !mManager || !mManager->CanSend()', file /builds/worker/checkouts/gecko/dom/ipc/jsactor/JSWindowActorChild.cpp:40
[task 2020-12-02T23:00:45.212Z] 23:00:45     INFO - TEST-PASS | /css/css-multicol/multicol-rule-002.xht | took 473ms
Flags: needinfo?(emilio)

Having integer LayoutDevice pixels is not ideal in some cases, but I don't have time to track all the windows snapping issues atm. So let's reconsider when non-native theme is enabled everywhere.

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Flags: needinfo?(emilio)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: