1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-07-03 00:46:51 +02:00

Added support of computed styles (#570)

* Added support of computed styles

* Updated style updates

* Fixed linter issues

* Updated styles manipulation in static driver

* Updated e2e tests

* Updated methods

* Updated e2e tests

* Updated README
This commit is contained in:
Tim Voronov
2020-11-20 20:09:21 -05:00
committed by GitHub
parent 01088247e2
commit 7eed93721c
26 changed files with 200 additions and 125 deletions

View File

@ -14,7 +14,7 @@ import (
// @param {String | Object} nameOrObj - Style name or an object representing a key-value pair of attributes.
// @param {String} value - If a second parameter is a string value, this parameter represent a style value.
func StyleSet(ctx context.Context, args ...core.Value) (core.Value, error) {
err := core.ValidateArgs(args, 2, core.MaxArgs)
err := core.ValidateArgs(args, 2, 3)
if err != nil {
return values.None, err
@ -35,7 +35,7 @@ func StyleSet(ctx context.Context, args ...core.Value) (core.Value, error) {
return values.None, nil
}
return values.None, el.SetStyle(ctx, arg1, args[2])
return values.None, el.SetStyle(ctx, arg1, values.NewString(args[2].String()))
case *values.Object:
// STYLE_SET(el, values)
return values.None, el.SetStyles(ctx, arg1)