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

Side by Side Diff: LayoutTests/resources/ahem.js

Issue 1207173002: [Temporary] try resources/ahem.js (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // A test using Ahem font includes this file to ensure that the
2 // font is loaded before window.onload fires and test finishes.
3 // Note: this doesn't work if the test doesn't contain any visible
4 // element with 'font-family: Ahem' style.
5 (function() {
6 var scripts = document.getElementsByTagName('script');
7 var src = scripts[scripts.length - 1].src;
8 var lastSlash = src.lastIndexOf('/');
9 var relativePath = src.substr(0, lastSlash);
10
11 window.addEventListener('DOMContentLoad', function() {
12 var style = document.createElement('style');
13 style.appendChild(document.createTextNode(
14 '@font-face { font-family: Ahem; src: url(' + relativePath + '/Ahem.ttf')) ;
15 document.head.appendChild(style);
16 // Force a layout to start loading the font.
17 document.documentElement.offsetTop;
18 }, true);
19 }());
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698