Branch: refs/heads/master
Home: https://github.com/cytoscape/cytoscape.js
Commit: f42f0f6c4773879ace7b10c6c31ece9df11d5547
https://github.com/cytoscape/cytoscape.js/commit/f42f0f6c4773879ace7b10c6c31ece9df11d5547
Author: Max Franz <[email protected]>
Date: 2019-02-11 (Mon, 11 Feb 2019)
Changed paths:
M src/style/apply.js
Log Message:
-----------
When applying a function mapper to an element, the passed parsed property
should be copied.
- The feature to improve performance of function mappers (#2239) does not take
into account that the `cxtProp` is the same object for all elements: The
`cxtProp` is a reference in the stylesheet. Because `cxtProp` is the same for
all elements, storing `fnValue` and `prevFnValue` under `cxtProp` does not make
sense. This can result in the same value being applied to all elements to
which the style block applies.
- To remedy this, a copy of the `cxtProp` should be referenced by
`eleProp.mapping` rather than the original `cxtProp`. Then `fnValue` and
`prevFnValue` can safely be stored per-element under `eleProp.mapping`.
- Aside: `fnRetVal` should be explicitly checked against `null`, as a nully
value (e.g. empty string or zero) could cause unnecessary `fn()` calls.
- Applies to v3.4.x.
Ref #2282 #2239
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/cytoscape-cvs.
For more options, visit https://groups.google.com/d/optout.