Confirmed users, Bureaucrats and Sysops emeriti
969
edits
No edit summary |
No edit summary |
||
| Line 31: | Line 31: | ||
== Alternative Implementation Strategies == | == Alternative Implementation Strategies == | ||
The following strategies assume that parsing data from attribute values | The following strategies assume that parsing data from attribute values every time it's needed would be too expensive. Therefore we will continue to store typed data mirroring SVG attributes in some way. | ||
The strategies below also assume we will use tearoffs to implement the object heavy SVG DOM element interfaces so that their member object trees (the | The strategies below also assume we will use tearoffs to implement the object heavy SVG DOM element interfaces so that their member object trees (the DOM trees that mirror attributes) are only created "on demand". | ||
=== Strategy A === | === Strategy A === | ||
Store the typed | Store the typed data tree directly on the content object as mTransform etc., similar to the way we store the DOM trees now. We could still have nulled out pointers for data trees when an attribute isn't set. | ||
==== Pros. ==== | ==== Pros. ==== | ||
* The typed data is always there (with default values) for the internal code to access. | * The typed data is always there (along with default values) for the internal code to access. Depending on what extent we null out pointers, the internal code may not need to have so much knowledge about default values or have much branching code to handle whether there is typed data avalable or not. | ||
* No GetAttr call required to get to the typed values (unlike strategy B below). Is this a significant saving/issue? | * No GetAttr call required to get to the typed values (unlike strategy B below). Is this a significant saving/issue? | ||
| Line 47: | Line 47: | ||
=== Strategy B === | === Strategy B === | ||
Store | Store each attribute's typed data on its nsAttr similar to the way we do things for the 'style' attribute on HTML content. Every time we want an attribute value or its typed data mirror we'd have to go via GetAttr. | ||
==== Pros. ==== | ==== Pros. ==== | ||