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

Unified Diff: LayoutTests/resources/ahem.js

Issue 1212523003: [Temporary] Another ahem try (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/resources/ahem.js
diff --git a/LayoutTests/resources/ahem.js b/LayoutTests/resources/ahem.js
index 156b248d3b85f30a11b9c3159cd05bb99618e81e..7f38423bf5ad13569349c0c09b561edd31143d8f 100644
--- a/LayoutTests/resources/ahem.js
+++ b/LayoutTests/resources/ahem.js
@@ -1,14 +1,13 @@
-// A test using Ahem font includes this file to ensure that the
-// font is loaded before window.onload fires and test finishes.
-// Note: this doesn't work if the test doesn't contain any visible
-// element with 'font-family: Ahem' style.
+// This file is included by tests using Ahem font to ensure that the font is
+// loaded before window.onload fires and the test finishes.
+// Note: this doesn't work if the test doesn't contain any visible element with
+// 'font-family: Ahem' style.
(function() {
var scripts = document.getElementsByTagName('script');
- var src = scripts[scripts.length - 1].src;
- var lastSlash = src.lastIndexOf('/');
- var relativePath = src.substr(0, lastSlash);
+ var scriptSrc = scripts[scripts.length - 1].src;
+ var relativePath = scriptSrc.substr(0, scriptSrc.lastIndexOf('/'));
- window.addEventListener('DOMContentLoad', function() {
+ window.addEventListener('DOMContentLoaded', function() {
var style = document.createElement('style');
style.appendChild(document.createTextNode(
'@font-face { font-family: Ahem; src: url(' + relativePath + '/Ahem.ttf'));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698