Fix font face resolution when renderer is blocked [chromium/src : main]

0 views
Skip to first unread message

Stefan Zager (Gerrit)

unread,
Aug 19, 2025, 7:27:28 PMAug 19
to Shelley Vohr, Nate Chapin, AyeAye, Rune Lillesveen, Chromium LUCI CQ, Mason Freed, Alexis Menard, chromium...@chromium.org, loading...@chromium.org, roblia...@chromium.org, sky+...@chromium.org, gavinp...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org
Attention needed from Shelley Vohr

Stefan Zager added 1 comment

Patchset-level comments
File-level comment, Patchset 6 (Latest):
Stefan Zager . resolved

The failing test looks unrelated to your change; I think it is caused by:

https://chromium-review.googlesource.com/c/chromium/src/+/6533918

I will reach out to the author

Open in Gerrit

Related details

Attention is currently required from:
  • Shelley Vohr
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I350711f16e16d30b6e6c6cb9f12162a5b5a4ab73
Gerrit-Change-Number: 5584820
Gerrit-PatchSet: 6
Gerrit-Owner: Shelley Vohr <shelle...@gmail.com>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Reviewer: Shelley Vohr <shelle...@gmail.com>
Gerrit-Reviewer: Stefan Zager <sza...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-CC: Rune Lillesveen <fut...@chromium.org>
Gerrit-Attention: Shelley Vohr <shelle...@gmail.com>
Gerrit-Comment-Date: Tue, 19 Aug 2025 23:27:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Stefan Zager (Gerrit)

unread,
Aug 19, 2025, 7:51:48 PMAug 19
to Shelley Vohr, Nate Chapin, AyeAye, Rune Lillesveen, Chromium LUCI CQ, Mason Freed, Alexis Menard, chromium...@chromium.org, loading...@chromium.org, roblia...@chromium.org, sky+...@chromium.org, gavinp...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org
Attention needed from Shelley Vohr

Stefan Zager added 1 comment

Patchset-level comments
Stefan Zager . resolved

The failing test looks unrelated to your change; I think it is caused by:

https://chromium-review.googlesource.com/c/chromium/src/+/6533918

I will reach out to the author

Gerrit-Comment-Date: Tue, 19 Aug 2025 23:51:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Stefan Zager <sza...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Stefan Zager (Gerrit)

unread,
Aug 20, 2025, 7:34:36 PMAug 20
to Shelley Vohr, Nate Chapin, AyeAye, Rune Lillesveen, Chromium LUCI CQ, Mason Freed, Alexis Menard, chromium...@chromium.org, loading...@chromium.org, roblia...@chromium.org, sky+...@chromium.org, gavinp...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org
Attention needed from Shelley Vohr

Stefan Zager added 1 comment

Patchset-level comments
Gerrit-Comment-Date: Wed, 20 Aug 2025 23:34:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Stefan Zager (Gerrit)

unread,
Aug 21, 2025, 1:10:39 PMAug 21
to Shelley Vohr, Nate Chapin, AyeAye, Rune Lillesveen, Chromium LUCI CQ, Mason Freed, Alexis Menard, chromium...@chromium.org, loading...@chromium.org, roblia...@chromium.org, sky+...@chromium.org, gavinp...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org
Attention needed from Shelley Vohr

Stefan Zager added 1 comment

Patchset-level comments
File-level comment, Patchset 7 (Latest):
Stefan Zager . resolved

The last failing test should be fixed now that this has landed:

https://chromium-review.googlesource.com/c/chromium/src/+/6869149

Open in Gerrit

Related details

Attention is currently required from:
  • Shelley Vohr
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I350711f16e16d30b6e6c6cb9f12162a5b5a4ab73
Gerrit-Change-Number: 5584820
Gerrit-PatchSet: 7
Gerrit-Owner: Shelley Vohr <shelle...@gmail.com>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Reviewer: Shelley Vohr <shelle...@gmail.com>
Gerrit-Reviewer: Stefan Zager <sza...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-CC: Rune Lillesveen <fut...@chromium.org>
Gerrit-Attention: Shelley Vohr <shelle...@gmail.com>
Gerrit-Comment-Date: Thu, 21 Aug 2025 17:10:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Stefan Zager (Gerrit)

unread,
Sep 15, 2025, 7:16:48 PM (2 days ago) Sep 15
to Shelley Vohr, Nate Chapin, AyeAye, Rune Lillesveen, Chromium LUCI CQ, Mason Freed, Alexis Menard, chromium...@chromium.org, loading...@chromium.org, roblia...@chromium.org, sky+...@chromium.org, gavinp...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org
Attention needed from Rune Lillesveen and Shelley Vohr

Stefan Zager added 1 comment

File third_party/blink/renderer/core/css/font_face_set_document.cc
Line 165, Patchset 1: if (d->IsActive() && d->IsLoadCompleted() &&
Stefan Zager . resolved

Some of these conditions are incorrect in this context. For example, `!d->LoadEventStarted()` conflicts with:

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/css/font_face_set_document.cc;l=237-242;drc=8b6aaad8027390ce6b32d82d57328e93f34bb8e5;bpv=1;bpt=1

Also, this code is only scheduled to run after the document has completed a layout, so `DidFirstLayout()` cannot be `false`.

I think there's a simpler and more correct way to do this:

```
void FontFaceSetDocument::FireDoneEventIfPossible() {
Document* d = GetDocument();
if (!d || !d->View()) {
return;
}
  // FireDoneEventIfPossible gets scheduled via PostTask at the end of a
// successful style+layout update. An invalidation may have occurred in
// the interim, so update style and layout synchronously here.
d->UpdateStyleAndLayout(DocumentUpdateReason::kUnknown);
  // These values can change during style+layout update, so check them
// *after* the call to UpdateStyleAndLayout.
if (should_fire_loading_event_) {
return;
}
if (!ShouldSignalReady()) {
return;
}
  FireDoneEvent();
}
```

I *think* that should work.

It should be possible to write a unit test for this; adding futhark@ who might be able to help with that aspect.

Rune Lillesveen

Should be possible to create a wpt too, I think? Not sure I fully understand the issue, though. Is this an iframe only issue? Is it that the `ready` will not resolve in the iframe while the parent document is render-blocked, or is it just the iframe that is render-blocked?

Stefan Zager

Here's the electron bug:

https://github.com/electron/electron/issues/42284

Sounds like iframe only, which makes sense since only iframes throttle rendering.

I don't really know how electron works, but I can make an educated guess about the behavior of the test case in that bug...

The first call to `window.test()` adds an iframe in response to `DOMContentLoaded` in the top-level doc. At that point, the top-level window is hidden but also has not yet done the mandatory one rendering update after document load. When the mandatory update happens, it causes `document.fonts.ready` to resolve in both the top doc and the iframe.

The second call to `window.test()` happens while the top-level doc is shown, so rendering updates are happening and `document.fonts.ready` resolves as expected.

The third call to `window.test()` happens while the window is hidden and presumably rendering updates are paused. This is not render throttling as implemented in blink, because that code only affects cross-origin iframes, and the test case doesn't have cross-origin iframes. Rather, this is the suppression of main frame updates that occurs when an entire browser window is hidden; the implementation is in the browser process. This is where we get stuck, because the iframe will never do its initial rendering update. Previously, `document.fonts.ready` would still resolve because we do an opportunistic layout update during `Document::ImplicitClose()` in the iframe; but once the change mentioned in this CL's description landed we started suppressing the opportunistic initial layout, so we never schedule or run `FontFaceSetDocument::DidLayout`, which is where the promise gets resolved.

I'm not totally sure how to recreate this setup in a WPT, since we don't have access to electron API's like `window.hide()`. It *might* be possible to reproduce it using a cross-origin iframe moved outside the viewport to trigger render throttling. But in a unit test we can assert that the promise resolves in a microtask after `Document::ImplicitClose()` in the iframe, even if we don't run `UpdateLifecyclePhases`.

Stefan Zager

Actually, this probably doesn't require an iframe to reproduce in electron. You could probably do something like this instead:

```
var fonts = ['testfont1', 'testfont2', 'testfont3'];
window.test = async (str) => {
console.log('start', str);
let font = fonts.pop();
document.stylesheets[0].insertRule(`@font-face { font-family:"${font}"; src:url("path/to/${font}.woff2") }`);
document.stylesheets[0].insertRule(`div#${font} { font-family:"${font}" }`;
let div = document.createElement('div');
div.innerHTML = "Hello, world!";
div.id = font;
document.body.appendChild(div);
      console.log('before')
await iframe.contentWindow.document.fonts.ready;
console.log('after')
};
```

Not sure if this is easier or harder to make into a WPT (the font files need to exist).

Shelley Vohr

I might need some guidance for where to add the test/related files as I've not added a WPT before but i'm more than happy to have a go!

Stefan Zager

futhark@ -- this change lgtm, but I do think it needs a test. Is there an existing unit test suite that would be appropriate? I can help the author write the actual test.

Rune Lillesveen

When I said wpt, I thought "render blocking" meant the render blocking that happens because we're waiting for render blocking resources, but this is about render throttling? Then I don't know if you can do it with wpt. And I don't know what would be a suitable unit test framework for throttling.

Stefan Zager

I'll take a look this week and provide guidance for writing the test.

Shelley Vohr

Stefan Zager are you still able to provide some guidance here?

Shelley Vohr

hi @fut...@chromium.org @sza...@chromium.org - I’d still love to land this if possible so if you could point me to next steps for a test that'd be great.

Stefan Zager

Test added.

Open in Gerrit

Related details

Attention is currently required from:
  • Rune Lillesveen
  • Shelley Vohr
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I350711f16e16d30b6e6c6cb9f12162a5b5a4ab73
Gerrit-Change-Number: 5584820
Gerrit-PatchSet: 10
Gerrit-Owner: Shelley Vohr <shelle...@gmail.com>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Reviewer: Shelley Vohr <shelle...@gmail.com>
Gerrit-Reviewer: Stefan Zager <sza...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-CC: Rune Lillesveen <fut...@chromium.org>
Gerrit-Attention: Shelley Vohr <shelle...@gmail.com>
Gerrit-Attention: Rune Lillesveen <fut...@chromium.org>
Gerrit-Comment-Date: Mon, 15 Sep 2025 23:16:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Shelley Vohr <shelle...@gmail.com>
Comment-In-Reply-To: Rune Lillesveen <fut...@chromium.org>
Comment-In-Reply-To: Stefan Zager <sza...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Stefan Zager (Gerrit)

unread,
Sep 15, 2025, 7:30:26 PM (2 days ago) Sep 15
to Shelley Vohr, Nate Chapin, AyeAye, Rune Lillesveen, Chromium LUCI CQ, Mason Freed, Alexis Menard, chromium...@chromium.org, loading...@chromium.org, roblia...@chromium.org, sky+...@chromium.org, gavinp...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org
Attention needed from Rune Lillesveen and Shelley Vohr

Stefan Zager voted Code-Review+1

Code-Review+1
Gerrit-Comment-Date: Mon, 15 Sep 2025 23:30:16 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Rune Lillesveen (Gerrit)

unread,
Sep 16, 2025, 6:07:41 AM (yesterday) Sep 16
to Shelley Vohr, Stefan Zager, Rune Lillesveen, Nate Chapin, AyeAye, Chromium LUCI CQ, Mason Freed, Alexis Menard, chromium...@chromium.org, loading...@chromium.org, roblia...@chromium.org, sky+...@chromium.org, gavinp...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org
Attention needed from Shelley Vohr and Stefan Zager

Rune Lillesveen voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Shelley Vohr
  • Stefan Zager
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I350711f16e16d30b6e6c6cb9f12162a5b5a4ab73
Gerrit-Change-Number: 5584820
Gerrit-PatchSet: 12
Gerrit-Owner: Shelley Vohr <shelle...@gmail.com>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
Gerrit-Reviewer: Shelley Vohr <shelle...@gmail.com>
Gerrit-Reviewer: Stefan Zager <sza...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-Attention: Shelley Vohr <shelle...@gmail.com>
Gerrit-Attention: Stefan Zager <sza...@chromium.org>
Gerrit-Comment-Date: Tue, 16 Sep 2025 10:07:29 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Mason Freed (Gerrit)

unread,
Sep 16, 2025, 10:36:41 AM (yesterday) Sep 16
to Shelley Vohr, Stefan Zager, Rune Lillesveen, Nate Chapin, AyeAye, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, loading...@chromium.org, roblia...@chromium.org, sky+...@chromium.org, gavinp...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org
Attention needed from Shelley Vohr and Stefan Zager

Mason Freed voted and added 3 comments

Votes added by Mason Freed

Code-Review+1

3 comments

Patchset-level comments
File-level comment, Patchset 12 (Latest):
Mason Freed . resolved

LGTM! Just one nit.

File third_party/blink/renderer/core/css/font_face_set_document.cc
Line 145, Patchset 12 (Latest): Document* d = GetDocument();
Mason Freed . unresolved

I know this was already here, but `s/d/document`, please. Just `d` is a terrible variable name.

File third_party/blink/renderer/core/loader/render_blocking_resource_manager_test.cc
Line 871, Patchset 12 (Latest): FontReadyPromiseResolvesWhileRenderThrottled) {
Mason Freed . resolved

Nice test.

Open in Gerrit

Related details

Attention is currently required from:
  • Shelley Vohr
  • Stefan Zager
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I350711f16e16d30b6e6c6cb9f12162a5b5a4ab73
    Gerrit-Change-Number: 5584820
    Gerrit-PatchSet: 12
    Gerrit-Owner: Shelley Vohr <shelle...@gmail.com>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Reviewer: Shelley Vohr <shelle...@gmail.com>
    Gerrit-Reviewer: Stefan Zager <sza...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-Attention: Shelley Vohr <shelle...@gmail.com>
    Gerrit-Attention: Stefan Zager <sza...@chromium.org>
    Gerrit-Comment-Date: Tue, 16 Sep 2025 14:36:24 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Stefan Zager (Gerrit)

    unread,
    Sep 16, 2025, 1:32:36 PM (yesterday) Sep 16
    to Shelley Vohr, Mason Freed, Rune Lillesveen, Nate Chapin, AyeAye, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, loading...@chromium.org, roblia...@chromium.org, sky+...@chromium.org, gavinp...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org
    Attention needed from Shelley Vohr

    Stefan Zager voted and added 1 comment

    Votes added by Stefan Zager

    Code-Review+1

    1 comment

    File third_party/blink/renderer/core/css/font_face_set_document.cc
    Line 145, Patchset 12: Document* d = GetDocument();
    Mason Freed . resolved

    I know this was already here, but `s/d/document`, please. Just `d` is a terrible variable name.

    Stefan Zager

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Shelley Vohr
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I350711f16e16d30b6e6c6cb9f12162a5b5a4ab73
    Gerrit-Change-Number: 5584820
    Gerrit-PatchSet: 12
    Gerrit-Owner: Shelley Vohr <shelle...@gmail.com>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Reviewer: Shelley Vohr <shelle...@gmail.com>
    Gerrit-Reviewer: Stefan Zager <sza...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-Attention: Shelley Vohr <shelle...@gmail.com>
    Gerrit-Comment-Date: Tue, 16 Sep 2025 17:32:27 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
    satisfied_requirement
    open
    diffy

    Stefan Zager (Gerrit)

    unread,
    Sep 16, 2025, 1:32:47 PM (yesterday) Sep 16
    to Shelley Vohr, Mason Freed, Rune Lillesveen, Nate Chapin, AyeAye, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, loading...@chromium.org, roblia...@chromium.org, sky+...@chromium.org, gavinp...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org
    Attention needed from Shelley Vohr

    Stefan Zager voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Shelley Vohr
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I350711f16e16d30b6e6c6cb9f12162a5b5a4ab73
    Gerrit-Change-Number: 5584820
    Gerrit-PatchSet: 13
    Gerrit-Owner: Shelley Vohr <shelle...@gmail.com>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Reviewer: Shelley Vohr <shelle...@gmail.com>
    Gerrit-Reviewer: Stefan Zager <sza...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-Attention: Shelley Vohr <shelle...@gmail.com>
    Gerrit-Comment-Date: Tue, 16 Sep 2025 17:32:39 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    Sep 16, 2025, 3:51:14 PM (yesterday) Sep 16
    to Shelley Vohr, Stefan Zager, Mason Freed, Rune Lillesveen, Nate Chapin, AyeAye, Alexis Menard, chromium...@chromium.org, loading...@chromium.org, roblia...@chromium.org, sky+...@chromium.org, gavinp...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org

    Chromium LUCI CQ submitted the change with unreviewed changes

    Unreviewed changes

    12 is the latest approved patch-set.
    The change was submitted with unreviewed changes in the following files:

    ```
    The name of the file: third_party/blink/renderer/core/css/font_face_set_document.cc
    Insertions: 3, Deletions: 3.

    @@ -142,8 +142,8 @@
    }

    void FontFaceSetDocument::FireDoneEventIfPossible() {
    - Document* d = GetDocument();
    - if (!d || !d->View()) {
    + Document* document = GetDocument();
    + if (!document || !document->View()) {
    return;
    }

    @@ -154,7 +154,7 @@

    // FireDoneEventIfPossible gets scheduled via PostTask at the end of a
    // successful style+layout update. An invalidation may have occurred in
    // the interim, so update style and layout synchronously here.
    -  d->UpdateStyleAndLayout(DocumentUpdateReason::kUnknown);
    + document->UpdateStyleAndLayout(DocumentUpdateReason::kUnknown);


    // These values can change during style+layout update, so check them
    // *after* the call to UpdateStyleAndLayout.
    ```

    Change information

    Commit message:
    Fix font face resolution when renderer is blocked

    As a result of:

    https://chromium-review.googlesource.com/c/chromium/src/+/5290838

    ... the FontFaceSet promise in e.g. contentWindow.document.fonts.ready
    will never resolve while the renderer is blocked. This CL takes an
    approach similar to that taken in MediaQueryList in order to enable the
    promise to be resolved.

    Bug: chromium:324572951
    Change-Id: I350711f16e16d30b6e6c6cb9f12162a5b5a4ab73
    Reviewed-by: Stefan Zager <sza...@chromium.org>
    Reviewed-by: Rune Lillesveen <fut...@chromium.org>
    Commit-Queue: Stefan Zager <sza...@chromium.org>
    Reviewed-by: Mason Freed <mas...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1516217}
    Files:
    • M third_party/blink/renderer/core/css/font_face_set_document.cc
    • M third_party/blink/renderer/core/display_lock/display_lock_utilities_test.cc
    • M third_party/blink/renderer/core/loader/render_blocking_resource_manager_test.cc
    Change size: M
    Delta: 3 files changed, 97 insertions(+), 12 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Mason Freed, +1 by Stefan Zager, +1 by Rune Lillesveen
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I350711f16e16d30b6e6c6cb9f12162a5b5a4ab73
    Gerrit-Change-Number: 5584820
    Gerrit-PatchSet: 14
    Gerrit-Owner: Shelley Vohr <shelle...@gmail.com>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Reviewer: Shelley Vohr <shelle...@gmail.com>
    Gerrit-Reviewer: Stefan Zager <sza...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages