-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a test for document.fonts.ready timing assumptions #18489
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In #17219 (comment) a number of tests were found to depend on document.fonts.ready in this way, and it turns out it doesn't work in Safari with web fonts. Add a test to surface this problem more clearly.
As suspected, the test currently passes. https://bugs.webkit.org/show_bug.cgi?id=174030 should be linked when this test begins to fail due to no longer having Ahem as a system font. |
jgraham
approved these changes
Aug 16, 2019
natechapin
pushed a commit
to natechapin/wpt
that referenced
this pull request
Aug 23, 2019
…tests#18489) In web-platform-tests#17219 (comment) a number of tests were found to depend on document.fonts.ready in this way, and it turns out it doesn't work in Safari with web fonts. Add a test to surface this problem more clearly.
zdobersek
pushed a commit
to Igalia/webkit
that referenced
this pull request
Aug 30, 2019
https://bugs.webkit.org/show_bug.cgi?id=174030 <rdar://problem/33083550> Reviewed by Frédéric Wang. LayoutTests/imported/w3c: Test from web-platform-tests/wpt#18489. * web-platform-tests/fonts/ahem.css: Added. (@font-face): * web-platform-tests/infrastructure/assumptions/document-fonts-ready-expected.txt: Added. * web-platform-tests/infrastructure/assumptions/document-fonts-ready.html: Added. Source/WebCore: As described in https://drafts.csswg.org/css-font-loading/#font-face-set-ready, the ready promise is only fulfilled after layout operations complete and no additional font loads are necessary. This patch implements this by notifying the FontFaceSet created for the document when the document is finished loading. At that time, the promise will be resolved as soon as fonts are finished loading if any. Test: imported/w3c/web-platform-tests/infrastructure/assumptions/document-fonts-ready.html * css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::optionalFontFaceSet): * css/CSSFontSelector.h: * css/FontFaceSet.cpp: (WebCore::FontFaceSet::FontFaceSet): (WebCore::FontFaceSet::startedLoading): (WebCore::FontFaceSet::didFirstLayout): (WebCore::FontFaceSet::completedLoading): * css/FontFaceSet.h: * dom/Document.cpp: (WebCore::Document::implicitClose): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@249295 268f45cc-cd09-0410-ab3c-d52691b4dbfc
bertogg
pushed a commit
to Igalia/webkit
that referenced
this pull request
Sep 2, 2019
https://bugs.webkit.org/show_bug.cgi?id=174030 <rdar://problem/33083550> Reviewed by Frédéric Wang. LayoutTests/imported/w3c: Test from web-platform-tests/wpt#18489. * web-platform-tests/fonts/ahem.css: Added. (@font-face): * web-platform-tests/infrastructure/assumptions/document-fonts-ready-expected.txt: Added. * web-platform-tests/infrastructure/assumptions/document-fonts-ready.html: Added. Source/WebCore: As described in https://drafts.csswg.org/css-font-loading/#font-face-set-ready, the ready promise is only fulfilled after layout operations complete and no additional font loads are necessary. This patch implements this by notifying the FontFaceSet created for the document when the document is finished loading. At that time, the promise will be resolved as soon as fonts are finished loading if any. Test: imported/w3c/web-platform-tests/infrastructure/assumptions/document-fonts-ready.html * css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::optionalFontFaceSet): * css/CSSFontSelector.h: * css/FontFaceSet.cpp: (WebCore::FontFaceSet::FontFaceSet): (WebCore::FontFaceSet::startedLoading): (WebCore::FontFaceSet::didFirstLayout): (WebCore::FontFaceSet::completedLoading): * css/FontFaceSet.h: * dom/Document.cpp: (WebCore::Document::implicitClose): git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.26@249385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JonWBedard
pushed a commit
to WebKit/WebKit
that referenced
this pull request
Dec 1, 2022
https://bugs.webkit.org/show_bug.cgi?id=174030 <rdar://problem/33083550> Reviewed by Frédéric Wang. LayoutTests/imported/w3c: Test from web-platform-tests/wpt#18489. * web-platform-tests/fonts/ahem.css: Added. (@font-face): * web-platform-tests/infrastructure/assumptions/document-fonts-ready-expected.txt: Added. * web-platform-tests/infrastructure/assumptions/document-fonts-ready.html: Added. Source/WebCore: As described in https://drafts.csswg.org/css-font-loading/#font-face-set-ready, the ready promise is only fulfilled after layout operations complete and no additional font loads are necessary. This patch implements this by notifying the FontFaceSet created for the document when the document is finished loading. At that time, the promise will be resolved as soon as fonts are finished loading if any. Test: imported/w3c/web-platform-tests/infrastructure/assumptions/document-fonts-ready.html * css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::optionalFontFaceSet): * css/CSSFontSelector.h: * css/FontFaceSet.cpp: (WebCore::FontFaceSet::FontFaceSet): (WebCore::FontFaceSet::startedLoading): (WebCore::FontFaceSet::didFirstLayout): (WebCore::FontFaceSet::completedLoading): * css/FontFaceSet.h: * dom/Document.cpp: (WebCore::Document::implicitClose):
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #17219 (comment)
a number of tests were found to depend on document.fonts.ready in this
way, and it turns out it doesn't work in Safari with web fonts. Add a
test to surface this problem more clearly.