Page MenuHomePhabricator

Vector 2022 body text doesn't use subpixel rendering (2024 edition)
Closed, ResolvedPublic

Description

Vector 2022 body text doesn't use subpixel rendering on Windows. This was previously fixed in T327460: Vector 2022 body text doesn't use subpixel rendering when TOC is pinned on Chromium but has recently regressed.

This makes the text at small sizes look significantly less crisp than it could be on standard-resolution displays.

Actual:

greyscale.png (1×1 px, 408 KB)

Expected: (after applying some hacks in CSS)
subpixel.png (1×1 px, 397 KB)

Note that these screenshots are only meaningful at 100% zoom.

Requirement

Ensure that the Vector 2022 skin uses subpixel rendering for body text on Windows, improving text clarity at small sizes, as this was previously fixed but has regressed.

BDD

Feature: Subpixel Rendering in Vector 2022

  Scenario: Ensure body text uses subpixel rendering
    Given the user is viewing a page in Vector 2022 on Windows
    When the page is displayed
    Then the body text should use subpixel rendering for better clarity at small sizes

Test Steps

Test Case 1: Verify Subpixel Rendering in Vector 2022 on Windows

  1. Open Vector 2022 skin on a Windows device.
  2. View the body text at small sizes.
  3. AC1: Confirm that the text uses subpixel rendering for improved clarity.

QA Results - PROD

ACStatusDetails
1T373066#10107564

Event Timeline

Change #1064499 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/skins/Vector@master] Fix workaround for `position: sticky` disabling subpixel rendering

https://gerrit.wikimedia.org/r/1064499

Jdlrobson subscribed.

Since the default font size is "standard" and this issue only impacts "small", marking as low priority Let me know if we've misunderstood this.

It impacts all font sizes, although the smaller the font, the more noticeable the poor text rendering is.

Jdlrobson raised the priority of this task from Low to Medium.Aug 26 2024, 6:16 PM

Change #1064499 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Fix workaround for `position: sticky` disabling subpixel rendering

https://gerrit.wikimedia.org/r/1064499

Edtadros subscribed.

Test Result - Beta

Status: ❓Need More Info
Environment: Beta
OS: Windows
Browser: Chrome
Device: PC
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Verify Subpixel Rendering in Vector 2022 on Windows

  1. Open Vector 2022 skin on a Windows device.
  2. View the body text at small sizes.
  3. AC1: Confirm that the text uses subpixel rendering for improved clarity.

@Jdlrobson, Verifying on Windows meant Browserstack for me, which isn't the greatest way to see something this subtle. I also did it on macOS natively but still wasn't sure. Is there a way that can be verified in DevTools?

OSBetaProd
macOS
screenshot 30.png (1×1 px, 715 KB)
screenshot 31.png (1×1 px, 699 KB)
Win11
screenshot 32.png (629×2 px, 772 KB)
screenshot 33.png (629×2 px, 765 KB)

Discussed in task sync. We are fine with moving this to sign off. Assuming we see no visible differences, we can call this a a pass.

Verifying on Windows meant Browserstack for me, which isn't the greatest way to see something this subtle.

Indeed, the video encoding artifacts will completely smoosh over the text rendering. It's really hard to test this without an actual Windows device and a physical screen you can look at (or take close-up photos of).

That said, your Windows screenshots look like it's working. The Beta screenshot has the color fringing that I'd expect to see when using subpixel text rendering (although it's extra weird due to the video encoding artifacts). It helps to zoom in a lot:

Beta
image.png (167×1 px, 18 KB)
Prod
image.png (145×1 px, 18 KB)

I also did it on macOS natively but still wasn't sure.

macOS doesn't enable subpixel rendering because Apple doesn't make cheap devices with low resolution displays, so they never needed it to make text look nice.

Is there a way that can be verified in DevTools?

I realized I don't know and I went on quite a journey to find out.

It seems the answer is: no, you can't tell anywhere in DevTools whether a bit of text is rendering using subpixel rendering or not; but you can tell how the page is divided into layers to be painted, and this is what determines whether subpixel rendering is used.

You will need to enable the "Rendering" tab, and then on that tab enable "Layer borders". This will draw a bunch of orange borders on the page, indicating which fragments are painted as separate layers:

image.png (1×1 px, 282 KB)
image.png (1×1 px, 283 KB)

The internet says that the root layer will always have subpixel rendering enabled, while the other layers may or may not have it depending on unpredictable factors (here's one somewhat outdated article that says so: https://web.dev/articles/antialiasing-101#cutting_to_the_chase). And in these screenshots, you can see that the article content is no longer on a separate layer, and it now has subpixel text rendering.

As a bonus, getting rid of these extra layers is probably good for performance. The "Rendering" tab also lets you enable "Frame Rendering Stats", and when I did that, they said that the new version uses less GPU memory (the numbers varied as I used the page, but they were consistently lower on the beta cluster version).

image.png (1×1 px, 287 KB)
image.png (1×1 px, 288 KB)

There is also the "3D View" tab, which tries to show the layers "stacked" in 3D instead of just drawing some borders, and lets you manipulate the view as if you were Tom Cruise in Minority Report. I found this view difficult to read and navigate and it crashed several times as I tried using it, but it is quite neat when it works.

image.png (1×1 px, 431 KB)
image.png (1×1 px, 444 KB)

Test Result - PROD

Status: ✅ PASS
Environment: PROD
OS: Windows 11
Browser: Chrome 128
Device: PC
Emulated Device: BrowserStack

Test Artifact(s):

Test Steps

Test Case 1: Verify Subpixel Rendering in Vector 2022 on Windows

  1. Open Vector 2022 skin on a Windows device.
  2. View the body text at small sizes.
  3. AC1: Confirm that the text uses subpixel rendering for improved clarity.

UPDATE: Pass via T373066#10113773

Small Text** 100% Zoom500% ZoomLayer BoardersFrame Renders Stats also3D view
2024-08-30_13-12-43.png (768×1 px, 944 KB)
2024-08-30_14-16-01.png (926×2 px, 1 MB)
2024-08-30_13-13-23.png (907×2 px, 605 KB)
2024-08-30_13-31-07.png (1×1 px, 1 MB)
2024-08-30_13-28-47.png (1×1 px, 1 MB)
2024-08-30_13-45-57.png (1×1 px, 648 KB)

❓ AC1: Confirm that the text uses subpixel rendering for improved clarity.

Confirmed in standup this is OK

Jdrewniak closed this task as Resolved.EditedSep 9 2024, 2:18 PM

@matmarex thanks for going to great lengths to inspect this fix, and for uncovering my favourite superfluous and nearly extinct browser feature (seriously this is the only reason I keep Microsoft Edge installed on a Mac)

There is also the "3D View" tab, which tries to show the layers "stacked" in 3D instead of just drawing some borders, and lets you manipulate the view as if you were Tom Cruise in Minority Report. I found this view difficult to read and navigate and it crashed several times as I tried using it, but it is quite neat when it works.