-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fonts: Store web fonts in the per-Layout
FontContext
This moves mangement of web fonts to the per-Layout `FontContext`, preventing web fonts from being available in different Documents. Fixes #12920. Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
- Loading branch information
1 parent
76a4828
commit 13d894d
Showing
5 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
css/css-fonts/downloadable-font-scoped-to-document-ref.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
|
||
<html> | ||
<head> | ||
<title>CSS fonts: Web fonts loaded in a document are not available in other documents</title> | ||
<link rel="author" title="Martin Robinson" href="mrobinson@igalia.com"> | ||
<link rel="author" title="Mukilan Thiyagarajan" href="mukilan@igalia.com"> | ||
</head> | ||
|
||
<body> | ||
<p>Test passes if Ahem is only used in the first iframe.</p> | ||
<iframe src="support/iframe-using-ahem-as-web-font.html"></iframe> | ||
<iframe src="support/iframe-without-web-font.html"></iframe> | ||
</body> | ||
|
||
</html> | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
|
||
<html class="reftest-wait"> | ||
<head> | ||
<title>CSS fonts: Web fonts loaded in a document are not available in other documents</title> | ||
<link rel="author" title="Martin Robinson" href="mrobinson@igalia.com"> | ||
<link rel="author" title="Mukilan Thiyagarajan" href="mukilan@igalia.com"> | ||
<link rel="match" href="downloadable-font-scoped-to-document-ref.html"> | ||
<link rel="help" href="https://drafts.csswg.org/css-fonts/#font-face-rule"> | ||
</head> | ||
|
||
<body> | ||
<p>Test passes if Ahem is only used in the first iframe.</p> | ||
<iframe id="iframe1" src="support/iframe-using-ahem-as-web-font.html"></iframe> | ||
<iframe id="iframe2" src=""></iframe> | ||
|
||
<script> | ||
// Delay the loading of the second iframe to make it more likely that the font | ||
// has loaded properly into the first iframe. | ||
iframe1.onload = () => { | ||
iframe2.src ="support/iframe-missing-font-face-rule.html"; | ||
document.documentElement.classList.remove('reftest-wait'); | ||
}; | ||
</script> | ||
</body> | ||
|
||
</html> | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<!DOCTYPE html> | ||
<div style="font-size: 30px; font-family: CustomFontFamily">Hello!</div> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!DOCTYPE html> | ||
<style> | ||
@font-face { | ||
font-family: CustomFontFamily; | ||
src: url(/fonts/Ahem.ttf); | ||
} | ||
</style> | ||
<div style="font-size: 30px; font-family: CustomFontFamily">Hello!</div> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<!DOCTYPE html> | ||
<div style="font-size: 30px;">Hello!</div> |