@ -346,7 +346,14 @@ class BrowserDomAdapter extends GenericBrowserDomAdapter {
|
||||
String tagName(Element element) => element.tagName;
|
||||
|
||||
Map<String, String> attributeMap(Element element) {
|
||||
return new Map.from(element.attributes);
|
||||
var result = {};
|
||||
result.addAll(element.attributes);
|
||||
// TODO(tbosch): element.getNamespacedAttributes() somehow does not return the attribute value
|
||||
var xlinkHref = element.getAttributeNS('http://www.w3.org/1999/xlink', 'href');
|
||||
if (xlinkHref != null) {
|
||||
result['xlink:href'] = xlinkHref;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool hasAttribute(Element element, String attribute) =>
|
||||
|
@ -226,7 +226,7 @@ export class BrowserDomAdapter extends GenericBrowserDomAdapter {
|
||||
hasAttribute(element, attribute: string): boolean { return element.hasAttribute(attribute); }
|
||||
getAttribute(element, attribute: string): string { return element.getAttribute(attribute); }
|
||||
setAttribute(element, name: string, value: string) { element.setAttribute(name, value); }
|
||||
setAttributeNS(ns: string, element, name: string, value: string) {
|
||||
setAttributeNS(element, ns: string, name: string, value: string) {
|
||||
element.setAttributeNS(ns, name, value);
|
||||
}
|
||||
removeAttribute(element, attribute: string) { element.removeAttribute(attribute); }
|
||||
|
Reference in New Issue
Block a user