// RemoveComputedStyleValue removes the value of the property from the computed // style object. func RemoveComputedStyleValue(css *dom.CSSStyleDeclaration, prop string) { defer func() { recover() }() css.Call("removeProperty", prop) }
// GetComputedStyleValueWith usings the CSSStyleDeclaration to // retrieves the value of the property from the computed // style object. func GetComputedStyleValueWith(css *dom.CSSStyleDeclaration, prop string) (*js.Object, error) { vs := css.Call("getPropertyValue", prop) if vs == nil { return nil, ErrNotFound } return vs, nil }
// GetComputedStylePriority retrieves the proritiy of the property from the computed // style object. func GetComputedStylePriority(css *dom.CSSStyleDeclaration, prop string) (int, error) { vs := css.Call("getPropertyPriority", prop) if vs == nil { return 0, ErrNotFound } if strings.TrimSpace(vs.String()) == "" { return 0, nil } return 1, nil }