refactor(core): remove testing-only style utils from DomAdapters (#32291)
PR Close #32291
This commit is contained in:

committed by
Miško Hevery

parent
46caf88b2c
commit
ede5786d1e
@ -162,6 +162,7 @@ export class DominoAdapter extends BrowserDomAdapter {
|
||||
}
|
||||
element.setAttribute('style', styleAttrValue);
|
||||
}
|
||||
|
||||
setStyle(element: any, styleName: string, styleValue?: string|null) {
|
||||
styleName = styleName.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
||||
const styleMap = this._readStyleAttribute(element);
|
||||
@ -173,14 +174,11 @@ export class DominoAdapter extends BrowserDomAdapter {
|
||||
// see https://github.com/angular/angular/issues/7916
|
||||
this.setStyle(element, styleName, '');
|
||||
}
|
||||
|
||||
getStyle(element: any, styleName: string): string {
|
||||
const styleMap = this._readStyleAttribute(element);
|
||||
return styleMap[styleName] || '';
|
||||
}
|
||||
hasStyle(element: any, styleName: string, styleValue?: string): boolean {
|
||||
const value = this.getStyle(element, styleName);
|
||||
return styleValue ? value == styleValue : value.length > 0;
|
||||
}
|
||||
|
||||
dispatchEvent(el: Node, evt: any) {
|
||||
el.dispatchEvent(evt);
|
||||
|
Reference in New Issue
Block a user