Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Unified Diff: third_party/WebKit/Source/core/css/FontFaceSet.cpp

Issue 2722493002: FontFaceSet.ready should not be resolved if there's pending layouts (Closed)
Patch Set: add comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/fontfaceset-ready.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/FontFaceSet.cpp
diff --git a/third_party/WebKit/Source/core/css/FontFaceSet.cpp b/third_party/WebKit/Source/core/css/FontFaceSet.cpp
index 96ffcdc598288ac96cd9518b653cd8754bce4c39..3edee024488abe236bd8981487482aec8865d5d1 100644
--- a/third_party/WebKit/Source/core/css/FontFaceSet.cpp
+++ b/third_party/WebKit/Source/core/css/FontFaceSet.cpp
@@ -243,6 +243,13 @@ void FontFaceSet::removeFromLoadingFonts(FontFace* fontFace) {
}
ScriptPromise FontFaceSet::ready(ScriptState* scriptState) {
+ if (m_ready->getState() != ReadyProperty::Pending) {
+ // |m_ready| is already resolved, but there may be pending stylesheet
+ // changes and/or layout operations that may cause another font loads.
+ // So synchronously update style and layout here.
+ // This may trigger font loads, and replace |m_ready| with a new Promise.
+ document()->updateStyleAndLayout();
+ }
return m_ready->promise(scriptState->world());
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/fontfaceset-ready.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698