refactor(core): remove testing-only style utils from DomAdapters (#32291)

PR Close #32291
This commit is contained in:
Kara Erickson
2019-08-23 12:32:00 -07:00
committed by Miško Hevery
parent 46caf88b2c
commit ede5786d1e
14 changed files with 63 additions and 75 deletions

View File

@ -199,3 +199,16 @@ export function setCookie(name: string, value: string) {
export function supportsWebAnimation(): boolean {
return typeof(<any>Element).prototype['animate'] === 'function';
}
export function hasStyle(element: any, styleName: string, styleValue?: string | null): boolean {
const value = element.style[styleName] || '';
return styleValue ? value == styleValue : value.length > 0;
}
export function hasClass(element: any, className: string): boolean {
return element.classList.contains(className);
}
export function sortedClassList(element: any): any[] {
return Array.prototype.slice.call(element.classList, 0).sort();
}