feat(dom): add location and history as DOM-like APIs.

Instead of global access methods.
This commit is contained in:
Rado Kirov
2015-05-05 14:50:53 -07:00
parent 0520ca68b4
commit f356d03362
6 changed files with 34 additions and 4 deletions

View File

@ -307,4 +307,10 @@ class BrowserDomAdapter extends GenericBrowserDomAdapter {
return document.body;
}
}
getHistory() {
return window.history;
}
getLocation() {
return window.location;
}
}

View File

@ -372,4 +372,10 @@ export class BrowserDomAdapter extends GenericBrowserDomAdapter {
return document.body;
}
}
getHistory() {
return window.history;
}
getLocation() {
return window.location;
}
}

View File

@ -283,4 +283,10 @@ export class DomAdapter {
getGlobalEventTarget(target:string) {
throw _abstract();
}
getHistory() {
throw _abstract();
}
getLocation() {
throw _abstract();
}
}

View File

@ -281,4 +281,10 @@ class Html5LibDomAdapter implements DomAdapter {
bool supportsNativeShadowDOM() {
throw 'not implemented';
}
getHistory() {
throw 'not implemented';
}
getLocation() {
throw 'not implemented';
}
}

View File

@ -523,6 +523,12 @@ export class Parse5DomAdapter extends DomAdapter {
return this.defaultDoc().body;
}
}
getHistory() {
throw 'not implemented';
}
getLocation() {
throw 'not implemented';
}
}
//TODO: build a proper list, this one is all the keys of a HTMLInputElement