Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed an issue with <link rel="stylesheet" type="totally/fake">. WebK…

…it loads it, other browsers do not. Added tests.
  • Loading branch information...
commit 317b706c4245dfb0c9f73f2df6e34562d51d4145 1 parent e2d8239
@sorccu authored
View
6 js/cufon.js
@@ -256,7 +256,13 @@ var Cufon = (function() {
var links = elementsByTagName('link'), styles = elementsByTagName('style');
+ var checkTypes = {
+ '': 1,
+ 'text/css': 1
+ };
+
function isContainerReady(el) {
+ if (!checkTypes[el.type.toLowerCase()]) return true;
return el.disabled || isSheetReady(el.sheet, el.media || 'screen');
}
View
2  tests/cssready/index.html
@@ -183,6 +183,7 @@
'link-altstylesheet-simple-print/',
'link-stylesheet-simple-fake/',
'link-altstylesheet-simple-fake/',
+ 'link-stylesheet-goodrelbadtype/',
'link-stylesheet-disabled/',
'link-stylesheet-slow/',
'link-stylesheet-slow-print/',
@@ -201,6 +202,7 @@
'style-simple/',
'style-simple-print/',
'style-simple-fake/',
+ 'style-badtype/',
'style-import/',
'style-import-print/',
'style-import-fake/',
View
31 tests/cssready/link-stylesheet-goodrelbadtype/index.html
@@ -0,0 +1,31 @@
+<!doctype html>
+
+<html>
+
+ <head>
+
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+ <link rel="stylesheet" type="totally/fake" href="style.css" media="all" />
+
+ <script src="../../../js/cufon.js" type="text/javascript"></script>
+
+ <script type="text/javascript">
+
+ (function(test) {
+
+ Cufon.CSS.ready(function() {
+ test.success();
+ });
+
+ })(parent.testRunner.registerTest('<link rel="stylesheet" type="totally/fake"> with a simple and short style sheet'));
+
+ </script>
+
+ </head>
+
+ <body>
+
+ </body>
+
+</html>
View
6 tests/cssready/link-stylesheet-goodrelbadtype/style.css
@@ -0,0 +1,6 @@
+body {
+ border: 0;
+ margin: 0;
+ padding: 0;
+ width: 100px;
+}
View
40 tests/cssready/style-badtype/index.html
@@ -0,0 +1,40 @@
+<!doctype html>
+
+<html>
+
+ <head>
+
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+ <style type="totally/fake">
+
+ body {
+ border: 0;
+ margin: 0;
+ padding: 0;
+ width: 100px;
+ }
+
+ </style>
+
+ <script src="../../../js/cufon.js" type="text/javascript"></script>
+
+ <script type="text/javascript">
+
+ (function(test) {
+
+ Cufon.CSS.ready(function() {
+ test.success();
+ });
+
+ })(parent.testRunner.registerTest('<style type="totally/fake"> with simple CSS'));
+
+ </script>
+
+ </head>
+
+ <body>
+
+ </body>
+
+</html>
Please sign in to comment.
Something went wrong with that request. Please try again.