Skip to content

Commit f8711d9

Browse files
committed
Fixed failing tests in chrome. Chrome and FF3 pass. Opera 11 fails.
1 parent 3d9b69f commit f8711d9

File tree

36 files changed

+147
-99
lines changed

36 files changed

+147
-99
lines changed

scripts/uncompressed/history.html4.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@
3636
History.initHtml4.initialized = true;
3737
}
3838

39+
// ----------------------------------------------------------------------
40+
// Properties
41+
42+
/**
43+
* History.enabled
44+
* Is History enabled?
45+
*/
46+
History.enabled = true;
47+
48+
3949
// ----------------------------------------------------------------------
4050
// Hash Storage
4151

scripts/uncompressed/history.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,12 @@
234234
)
235235
};
236236

237+
/**
238+
* History.enabled
239+
* Is History enabled?
240+
*/
241+
History.enabled = !History.emulated.pushState;
242+
237243
/**
238244
* History.bugs
239245
* Which bugs are present
@@ -381,7 +387,7 @@
381387
History.getBasePageUrl = function(){
382388
// Create
383389
var basePageUrl = document.location.href.replace(/[#\?].*/,'').replace(/[^\/]+$/,function(part,index,string){
384-
return (/\./).test(part) ? '' : part;
390+
return (/[^\/]$/).test(part) ? '' : part;
385391
}).replace(/\/+$/,'')+'/';
386392

387393
// Return

tests.src/_header.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
$compress = array('uncompressed','compressed');
1919

2020
# Persist
21-
$persists = array('persistant','non-persistant');
21+
$persists = array('persistant','nonpersistant');
2222

2323
# Support
2424
$supports = array('html5','html4');

tests/compressed-html4-non-persistant-jquery.html renamed to tests/compressed-html4-nonpersistant-jquery.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
66
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
77
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
8-
<title>History.js Compressed HTML4 Non-persistant Jquery Test Suite</title>
8+
<title>History.js Compressed HTML4 Nonpersistant Jquery Test Suite</title>
99

1010
<!-- Check -->
1111
<script>
12-
if ( window.document.location.href !== "http://localhost/products/history.js/tests/compressed-html4-non-persistant-jquery.html" ) {
13-
window.document.location.href = "http://localhost/products/history.js/tests/compressed-html4-non-persistant-jquery.html";
12+
var test_url = "http://localhost/products/history.js/tests/compressed-html4-nonpersistant-jquery.html";
13+
if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
14+
window.document.location.href = test_url;
1415
}
1516
</script>
1617

@@ -23,7 +24,7 @@
2324
</head>
2425
<body>
2526
<!-- Elements -->
26-
<h1 id="qunit-header">History.js Compressed HTML4 Non-persistant Jquery Test Suite</h1>
27+
<h1 id="qunit-header">History.js Compressed HTML4 Nonpersistant Jquery Test Suite</h1>
2728
<h2 id="qunit-banner"></h2>
2829
<div id="qunit-testrunner-toolbar"></div>
2930
<h2 id="qunit-userAgent"></h2>

tests/compressed-html4-non-persistant-mootools.html renamed to tests/compressed-html4-nonpersistant-mootools.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
66
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
77
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
8-
<title>History.js Compressed HTML4 Non-persistant Mootools Test Suite</title>
8+
<title>History.js Compressed HTML4 Nonpersistant Mootools Test Suite</title>
99

1010
<!-- Check -->
1111
<script>
12-
if ( window.document.location.href !== "http://localhost/products/history.js/tests/compressed-html4-non-persistant-mootools.html" ) {
13-
window.document.location.href = "http://localhost/products/history.js/tests/compressed-html4-non-persistant-mootools.html";
12+
var test_url = "http://localhost/products/history.js/tests/compressed-html4-nonpersistant-mootools.html";
13+
if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
14+
window.document.location.href = test_url;
1415
}
1516
</script>
1617

@@ -23,7 +24,7 @@
2324
</head>
2425
<body>
2526
<!-- Elements -->
26-
<h1 id="qunit-header">History.js Compressed HTML4 Non-persistant Mootools Test Suite</h1>
27+
<h1 id="qunit-header">History.js Compressed HTML4 Nonpersistant Mootools Test Suite</h1>
2728
<h2 id="qunit-banner"></h2>
2829
<div id="qunit-testrunner-toolbar"></div>
2930
<h2 id="qunit-userAgent"></h2>

tests/compressed-html4-non-persistant-prototype.html renamed to tests/compressed-html4-nonpersistant-prototype.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
66
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
77
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
8-
<title>History.js Compressed HTML4 Non-persistant Prototype Test Suite</title>
8+
<title>History.js Compressed HTML4 Nonpersistant Prototype Test Suite</title>
99

1010
<!-- Check -->
1111
<script>
12-
if ( window.document.location.href !== "http://localhost/products/history.js/tests/compressed-html4-non-persistant-prototype.html" ) {
13-
window.document.location.href = "http://localhost/products/history.js/tests/compressed-html4-non-persistant-prototype.html";
12+
var test_url = "http://localhost/products/history.js/tests/compressed-html4-nonpersistant-prototype.html";
13+
if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
14+
window.document.location.href = test_url;
1415
}
1516
</script>
1617

@@ -23,7 +24,7 @@
2324
</head>
2425
<body>
2526
<!-- Elements -->
26-
<h1 id="qunit-header">History.js Compressed HTML4 Non-persistant Prototype Test Suite</h1>
27+
<h1 id="qunit-header">History.js Compressed HTML4 Nonpersistant Prototype Test Suite</h1>
2728
<h2 id="qunit-banner"></h2>
2829
<div id="qunit-testrunner-toolbar"></div>
2930
<h2 id="qunit-userAgent"></h2>

tests/compressed-html4-non-persistant-zepto.html renamed to tests/compressed-html4-nonpersistant-zepto.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
66
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
77
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
8-
<title>History.js Compressed HTML4 Non-persistant Zepto Test Suite</title>
8+
<title>History.js Compressed HTML4 Nonpersistant Zepto Test Suite</title>
99

1010
<!-- Check -->
1111
<script>
12-
if ( window.document.location.href !== "http://localhost/products/history.js/tests/compressed-html4-non-persistant-zepto.html" ) {
13-
window.document.location.href = "http://localhost/products/history.js/tests/compressed-html4-non-persistant-zepto.html";
12+
var test_url = "http://localhost/products/history.js/tests/compressed-html4-nonpersistant-zepto.html";
13+
if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
14+
window.document.location.href = test_url;
1415
}
1516
</script>
1617

@@ -23,7 +24,7 @@
2324
</head>
2425
<body>
2526
<!-- Elements -->
26-
<h1 id="qunit-header">History.js Compressed HTML4 Non-persistant Zepto Test Suite</h1>
27+
<h1 id="qunit-header">History.js Compressed HTML4 Nonpersistant Zepto Test Suite</h1>
2728
<h2 id="qunit-banner"></h2>
2829
<div id="qunit-testrunner-toolbar"></div>
2930
<h2 id="qunit-userAgent"></h2>

tests/compressed-html4-persistant-jquery.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010
<!-- Check -->
1111
<script>
12-
if ( window.document.location.href !== "http://localhost/products/history.js/tests/compressed-html4-persistant-jquery.html" ) {
13-
window.document.location.href = "http://localhost/products/history.js/tests/compressed-html4-persistant-jquery.html";
12+
var test_url = "http://localhost/products/history.js/tests/compressed-html4-persistant-jquery.html";
13+
if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
14+
window.document.location.href = test_url;
1415
}
1516
</script>
1617

tests/compressed-html4-persistant-mootools.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010
<!-- Check -->
1111
<script>
12-
if ( window.document.location.href !== "http://localhost/products/history.js/tests/compressed-html4-persistant-mootools.html" ) {
13-
window.document.location.href = "http://localhost/products/history.js/tests/compressed-html4-persistant-mootools.html";
12+
var test_url = "http://localhost/products/history.js/tests/compressed-html4-persistant-mootools.html";
13+
if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
14+
window.document.location.href = test_url;
1415
}
1516
</script>
1617

tests/compressed-html4-persistant-prototype.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010
<!-- Check -->
1111
<script>
12-
if ( window.document.location.href !== "http://localhost/products/history.js/tests/compressed-html4-persistant-prototype.html" ) {
13-
window.document.location.href = "http://localhost/products/history.js/tests/compressed-html4-persistant-prototype.html";
12+
var test_url = "http://localhost/products/history.js/tests/compressed-html4-persistant-prototype.html";
13+
if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
14+
window.document.location.href = test_url;
1415
}
1516
</script>
1617

tests/compressed-html4-persistant-zepto.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010
<!-- Check -->
1111
<script>
12-
if ( window.document.location.href !== "http://localhost/products/history.js/tests/compressed-html4-persistant-zepto.html" ) {
13-
window.document.location.href = "http://localhost/products/history.js/tests/compressed-html4-persistant-zepto.html";
12+
var test_url = "http://localhost/products/history.js/tests/compressed-html4-persistant-zepto.html";
13+
if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
14+
window.document.location.href = test_url;
1415
}
1516
</script>
1617

tests/compressed-html5-non-persistant-jquery.html renamed to tests/compressed-html5-nonpersistant-jquery.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
66
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
77
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
8-
<title>History.js Compressed HTML5 Non-persistant Jquery Test Suite</title>
8+
<title>History.js Compressed HTML5 Nonpersistant Jquery Test Suite</title>
99

1010
<!-- Check -->
1111
<script>
12-
if ( window.document.location.href !== "http://localhost/products/history.js/tests/compressed-html5-non-persistant-jquery.html" ) {
13-
window.document.location.href = "http://localhost/products/history.js/tests/compressed-html5-non-persistant-jquery.html";
12+
var test_url = "http://localhost/products/history.js/tests/compressed-html5-nonpersistant-jquery.html";
13+
if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
14+
window.document.location.href = test_url;
1415
}
1516
</script>
1617

@@ -23,7 +24,7 @@
2324
</head>
2425
<body>
2526
<!-- Elements -->
26-
<h1 id="qunit-header">History.js Compressed HTML5 Non-persistant Jquery Test Suite</h1>
27+
<h1 id="qunit-header">History.js Compressed HTML5 Nonpersistant Jquery Test Suite</h1>
2728
<h2 id="qunit-banner"></h2>
2829
<div id="qunit-testrunner-toolbar"></div>
2930
<h2 id="qunit-userAgent"></h2>

tests/compressed-html5-non-persistant-mootools.html renamed to tests/compressed-html5-nonpersistant-mootools.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
66
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
77
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
8-
<title>History.js Compressed HTML5 Non-persistant Mootools Test Suite</title>
8+
<title>History.js Compressed HTML5 Nonpersistant Mootools Test Suite</title>
99

1010
<!-- Check -->
1111
<script>
12-
if ( window.document.location.href !== "http://localhost/products/history.js/tests/compressed-html5-non-persistant-mootools.html" ) {
13-
window.document.location.href = "http://localhost/products/history.js/tests/compressed-html5-non-persistant-mootools.html";
12+
var test_url = "http://localhost/products/history.js/tests/compressed-html5-nonpersistant-mootools.html";
13+
if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
14+
window.document.location.href = test_url;
1415
}
1516
</script>
1617

@@ -23,7 +24,7 @@
2324
</head>
2425
<body>
2526
<!-- Elements -->
26-
<h1 id="qunit-header">History.js Compressed HTML5 Non-persistant Mootools Test Suite</h1>
27+
<h1 id="qunit-header">History.js Compressed HTML5 Nonpersistant Mootools Test Suite</h1>
2728
<h2 id="qunit-banner"></h2>
2829
<div id="qunit-testrunner-toolbar"></div>
2930
<h2 id="qunit-userAgent"></h2>

tests/compressed-html5-non-persistant-prototype.html renamed to tests/compressed-html5-nonpersistant-prototype.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
66
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
77
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
8-
<title>History.js Compressed HTML5 Non-persistant Prototype Test Suite</title>
8+
<title>History.js Compressed HTML5 Nonpersistant Prototype Test Suite</title>
99

1010
<!-- Check -->
1111
<script>
12-
if ( window.document.location.href !== "http://localhost/products/history.js/tests/compressed-html5-non-persistant-prototype.html" ) {
13-
window.document.location.href = "http://localhost/products/history.js/tests/compressed-html5-non-persistant-prototype.html";
12+
var test_url = "http://localhost/products/history.js/tests/compressed-html5-nonpersistant-prototype.html";
13+
if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
14+
window.document.location.href = test_url;
1415
}
1516
</script>
1617

@@ -23,7 +24,7 @@
2324
</head>
2425
<body>
2526
<!-- Elements -->
26-
<h1 id="qunit-header">History.js Compressed HTML5 Non-persistant Prototype Test Suite</h1>
27+
<h1 id="qunit-header">History.js Compressed HTML5 Nonpersistant Prototype Test Suite</h1>
2728
<h2 id="qunit-banner"></h2>
2829
<div id="qunit-testrunner-toolbar"></div>
2930
<h2 id="qunit-userAgent"></h2>

tests/compressed-html5-non-persistant-zepto.html renamed to tests/compressed-html5-nonpersistant-zepto.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" />
66
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" />
77
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
8-
<title>History.js Compressed HTML5 Non-persistant Zepto Test Suite</title>
8+
<title>History.js Compressed HTML5 Nonpersistant Zepto Test Suite</title>
99

1010
<!-- Check -->
1111
<script>
12-
if ( window.document.location.href !== "http://localhost/products/history.js/tests/compressed-html5-non-persistant-zepto.html" ) {
13-
window.document.location.href = "http://localhost/products/history.js/tests/compressed-html5-non-persistant-zepto.html";
12+
var test_url = "http://localhost/products/history.js/tests/compressed-html5-nonpersistant-zepto.html";
13+
if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
14+
window.document.location.href = test_url;
1415
}
1516
</script>
1617

@@ -23,7 +24,7 @@
2324
</head>
2425
<body>
2526
<!-- Elements -->
26-
<h1 id="qunit-header">History.js Compressed HTML5 Non-persistant Zepto Test Suite</h1>
27+
<h1 id="qunit-header">History.js Compressed HTML5 Nonpersistant Zepto Test Suite</h1>
2728
<h2 id="qunit-banner"></h2>
2829
<div id="qunit-testrunner-toolbar"></div>
2930
<h2 id="qunit-userAgent"></h2>

tests/compressed-html5-persistant-jquery.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010
<!-- Check -->
1111
<script>
12-
if ( window.document.location.href !== "http://localhost/products/history.js/tests/compressed-html5-persistant-jquery.html" ) {
13-
window.document.location.href = "http://localhost/products/history.js/tests/compressed-html5-persistant-jquery.html";
12+
var test_url = "http://localhost/products/history.js/tests/compressed-html5-persistant-jquery.html";
13+
if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
14+
window.document.location.href = test_url;
1415
}
1516
</script>
1617

tests/compressed-html5-persistant-mootools.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010
<!-- Check -->
1111
<script>
12-
if ( window.document.location.href !== "http://localhost/products/history.js/tests/compressed-html5-persistant-mootools.html" ) {
13-
window.document.location.href = "http://localhost/products/history.js/tests/compressed-html5-persistant-mootools.html";
12+
var test_url = "http://localhost/products/history.js/tests/compressed-html5-persistant-mootools.html";
13+
if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
14+
window.document.location.href = test_url;
1415
}
1516
</script>
1617

tests/compressed-html5-persistant-prototype.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010
<!-- Check -->
1111
<script>
12-
if ( window.document.location.href !== "http://localhost/products/history.js/tests/compressed-html5-persistant-prototype.html" ) {
13-
window.document.location.href = "http://localhost/products/history.js/tests/compressed-html5-persistant-prototype.html";
12+
var test_url = "http://localhost/products/history.js/tests/compressed-html5-persistant-prototype.html";
13+
if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
14+
window.document.location.href = test_url;
1415
}
1516
</script>
1617

tests/compressed-html5-persistant-zepto.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010
<!-- Check -->
1111
<script>
12-
if ( window.document.location.href !== "http://localhost/products/history.js/tests/compressed-html5-persistant-zepto.html" ) {
13-
window.document.location.href = "http://localhost/products/history.js/tests/compressed-html5-persistant-zepto.html";
12+
var test_url = "http://localhost/products/history.js/tests/compressed-html5-persistant-zepto.html";
13+
if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
14+
window.document.location.href = test_url;
1415
}
1516
</script>
1617

0 commit comments

Comments
 (0)