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

Unified Diff: LayoutTests/fast/css/font-face-css-change-while-loading.html

Issue 321403003: Notify font loads via FontLoader (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | « no previous file | LayoutTests/fast/css/font-face-css-change-while-loading-expected.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css/font-face-css-change-while-loading.html
diff --git a/LayoutTests/fast/css/font-face-css-change-while-loading.html b/LayoutTests/fast/css/font-face-css-change-while-loading.html
new file mode 100644
index 0000000000000000000000000000000000000000..bb985543bcd4bb0cbed11f464d4edb8f86f802d8
--- /dev/null
+++ b/LayoutTests/fast/css/font-face-css-change-while-loading.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<style id="sheet">
+@font-face {
+ font-family: myahem;
+ src: url(../../resources/Ahem.ttf);
+}
+</style>
+<script>
+if (window.testRunner)
+ window.testRunner.waitUntilDone();
+
+function getDocumentFontFaces() {
+ var faces = [];
+ document.fonts.forEach(function(face) { faces.push(face); });
+ return faces;
+}
+
+function runTest() {
+ var face = getDocumentFontFaces()[0];
+
+ document.getElementById("t").style.fontFamily = "myahem";
+ document.body.offsetTop; // force recalc and start loading font.
+
+ var newStyle = document.createElement("style");
+ newStyle.innerHTML = "#dummy { color: red; }";
+ var referenceNode = document.getElementById("sheet");
+ referenceNode.parentNode.insertBefore(newStyle, referenceNode);
+
+ face.loaded.then(finish);
+}
+
+function finish() {
+ if (window.testRunner)
+ window.testRunner.notifyDone();
+}
+
+onload = function() {
+ setTimeout(runTest, 0);
+}
+</script>
+<p>You should see a black rectangle below.</p>
+<div id="t">FAIL</div>
« no previous file with comments | « no previous file | LayoutTests/fast/css/font-face-css-change-while-loading-expected.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698