Title: [112999] trunk/LayoutTests
- Revision
- 112999
- Author
- [email protected]
- Date
- 2012-04-03 02:08:01 -0700 (Tue, 03 Apr 2012)
Log Message
Fallback fonts should be used while a web font is being loaded
https://bugs.webkit.org/show_bug.cgi?id=76684
Reviewed by Ojan Vafai.
Add the test which should have been submitted with r112489.
* http/tests/webfont/fallback-font-while-loading-expected.txt: Added.
* http/tests/webfont/fallback-font-while-loading.html: Added.
* http/tests/webfont/slow-ahem-loading.cgi: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (112998 => 112999)
--- trunk/LayoutTests/ChangeLog 2012-04-03 08:53:49 UTC (rev 112998)
+++ trunk/LayoutTests/ChangeLog 2012-04-03 09:08:01 UTC (rev 112999)
@@ -1,3 +1,16 @@
+2012-04-03 Kenichi Ishibashi <[email protected]>
+
+ Fallback fonts should be used while a web font is being loaded
+ https://bugs.webkit.org/show_bug.cgi?id=76684
+
+ Reviewed by Ojan Vafai.
+
+ Add the test which should have been submitted with r112489.
+
+ * http/tests/webfont/fallback-font-while-loading-expected.txt: Added.
+ * http/tests/webfont/fallback-font-while-loading.html: Added.
+ * http/tests/webfont/slow-ahem-loading.cgi: Added.
+
2012-04-03 Alexander Pavlov <[email protected]>
Unreviewed, disable inspector/styles/override-screen-size.html on platforms other than Chromium.
Added: trunk/LayoutTests/http/tests/webfont/fallback-font-while-loading-expected.txt (0 => 112999)
--- trunk/LayoutTests/http/tests/webfont/fallback-font-while-loading-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/webfont/fallback-font-while-loading-expected.txt 2012-04-03 09:08:01 UTC (rev 112999)
@@ -0,0 +1,7 @@
+This test checks that the fallback font is used for layout while a webfont is loading.
+
+Target:
+A text to be measured.
+Reference:
+A text to be measured.
+PASS: The width of target text and reference text is the same.
Added: trunk/LayoutTests/http/tests/webfont/fallback-font-while-loading.html (0 => 112999)
--- trunk/LayoutTests/http/tests/webfont/fallback-font-while-loading.html (rev 0)
+++ trunk/LayoutTests/http/tests/webfont/fallback-font-while-loading.html 2012-04-03 09:08:01 UTC (rev 112999)
@@ -0,0 +1,36 @@
+<style>
+@font-face {
+ font-family: webfont;
+ src: url(slow-ahem-loading.cgi);
+}
+</style>
+<p>
+This test checks that the fallback font is used for layout while a webfont is loading.
+</p>
+Target:
+<div>
+<span id="target" style="font-family: webfont, Arial;">A text to be measured.</span>
+</div>
+Reference:
+<div>
+<span id="reference" style="font-family: Arial;">A text to be measured.</span>
+</div>
+<div id="result"></div>
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+}
+
+function checkSize() {
+ var targetWidth = document.getElementById('target').offsetWidth;
+ var referenceWidth = document.getElementById('reference').offsetWidth;
+ var result = document.getElementById('result');
+ if (targetWidth == referenceWidth)
+ result.innerText = 'PASS: The width of target text and reference text is the same.';
+ else
+ result.innerText = 'FAIL: The width of target text and reference text is different: ' + targetWidth + ' != ' + referenceWidth;
+}
+
+checkSize();
+</script>
Added: trunk/LayoutTests/http/tests/webfont/slow-ahem-loading.cgi (0 => 112999)
--- trunk/LayoutTests/http/tests/webfont/slow-ahem-loading.cgi (rev 0)
+++ trunk/LayoutTests/http/tests/webfont/slow-ahem-loading.cgi 2012-04-03 09:08:01 UTC (rev 112999)
@@ -0,0 +1,8 @@
+#!/usr/bin/perl -w
+
+print "Content-type: application/octet-stream\n";
+print "Cache-control: no-cache, no-store\n\n";
+sleep(1);
+open FH, "<../../../resources/Ahem.ttf" or die;
+while (<FH>) { print; }
+close FH;
Property changes on: trunk/LayoutTests/http/tests/webfont/slow-ahem-loading.cgi
___________________________________________________________________
Added: svn:executable
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes