Skip to content

Commit

Permalink
indentation commit + fixes for image/script/etc lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
tmpvar committed Nov 22, 2010
1 parent 567d274 commit aa492e2
Show file tree
Hide file tree
Showing 9 changed files with 2,989 additions and 2,986 deletions.
16 changes: 5 additions & 11 deletions lib/jsdom/level2/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,15 @@ core.resourceLoader = {
});
},
resolve: function(document, path) {
if (path.charAt(0) == '/') {
if (['/','.'].indexOf(path.charAt(0)) !== -1) {
if (!document._documentRoot) {
throw new Error('document._documentRoot must be set to resolve absolute paths.');
}
return document._documentRoot + path;
}
if (document.URL) {
path = require('path').join(document._documentRoot, path);
} else if (document.URL) {
path = URL.resolve(document.URL, path);
}
return path.replace('file://', '');
return path.replace(/^file:/, '').replace(/^([\/]*)/, "/");
},
download: function(url, callback) {
var path = url.pathname + (url.search || ''),
Expand Down Expand Up @@ -1422,12 +1421,6 @@ define('HTMLFrameSetElement', {
]
});

/*
This is my shoddy attempt at frames. There are two problems here:
+ keeping the DOM free of BOM stuff (innerHTML, etc)
+ asynchronously loading the contents of the frame which should be fixable
using the test suite's 'checkInitialization' method
*/
define('HTMLFrameElement', {
tagName: 'FRAME',
proto: {
Expand Down Expand Up @@ -1467,6 +1460,7 @@ define('HTMLFrameElement', {

define('HTMLIFrameElement', {
tagName: 'IFRAME',
parentClass: core.HTMLFrameElement,
proto: {
_contentDocument : null,
get contentDocument() {
Expand Down

0 comments on commit aa492e2

Please sign in to comment.