feat: introduce Title service

Closes #612

Closes #900
This commit is contained in:
Pawel Kozlowski
2015-03-09 17:39:18 +01:00
parent 7e93c54603
commit 0d1dece7b4
5 changed files with 60 additions and 0 deletions

View File

@ -173,6 +173,10 @@ class BrowserDomAdapter extends DomAdapter {
document.implementation.createHtmlDocument('fakeTitle');
HtmlDocument defaultDoc() => document;
String getTitle() => document.title;
void setTitle(String newTitle) {
document.title = newTitle;
}
bool elementMatches(n, String selector) =>
n is Element && n.matches(selector);
bool isTemplateElement(Element el) =>

View File

@ -215,6 +215,12 @@ export class BrowserDomAdapter extends DomAdapter {
defaultDoc() {
return document;
}
getTitle() {
return document.title;
}
setTitle(newTitle:string) {
document.title = newTitle;
}
elementMatches(n, selector:string):boolean {
return n instanceof HTMLElement && n.matches(selector);
}

View File

@ -201,6 +201,12 @@ export class DomAdapter {
defaultDoc() {
throw _abstract();
}
getTitle() {
throw _abstract();
}
setTitle(newTitle:string) {
throw _abstract();
}
elementMatches(n, selector:string):boolean {
throw _abstract();
}