Skip to content

Computing a new AST node by combining several AST nodes within scope (cascading partial override) #1794

Answered by shutterfreak
shutterfreak asked this question in Q&A
Discussion options

You must be logged in to vote

Meanwhile I rewrote Element_get_style_items() and also added initial support for resetting style ("Reset" topic).

/**
 * Construct an array of style items that apply to the Element.
 * If the element has no style, or no style items can be found for the style provided, then an empty array is returned.
 * In all other cases, a scoped array of style items will be generated, following the following rules:
 *  - Style items at the same level in the model are combined in the order they appear.
 *  - When combining style items with the same topic, the last item is kept (overrruling previous topic definitions)
 *  - Style items at a given nesting level inherit style definitions from previous levels

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@cdietrich
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by shutterfreak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants