DescriptionImprove RAII of StyleResolverState.
This patch ensures that the correct RenderStyle and parent is provided upon
construction of StyleResolverState, and *removes* the possibility of these
pointers changing from the outside at arbitrary times. This makes construction
of member objects easier, removes unnecessary 'setStyle' methods, and reduces
elements of surprise in general.
Also, StyleResolverState::parentStyle is now never nullptr for the lifetime
of the object.
Changes:
* The parentNode-style-if-null logic in the StyleResolverState constructor
has been moved to ElementResolveContext. This makes it possible to use the
result of this logic without constructing a StyleResolverState.
* StyleBasisContext has been added as a subclass of ElementResolveContext.
It contains additional context related to animation, inheritance and
pseudo elements.
R=rune@opera.com
Patch Set 1 #Patch Set 2 : Make StyleResolverContext STACK_ALLOCATED. #Patch Set 3 : Drop StyleResolverContext. Extend ElementResolveContext instead. #Patch Set 4 : Fix very incorrect parentStyles (plus minor stuff). #Patch Set 5 : When baseRenderStyle!=0: 1) don't inherit, and 2) use defaultStyleForElement as fallback parent. #
Total comments: 7
Patch Set 6 : Rebased, added StyleBasisContext and AnimationResolveContext. #Patch Set 7 : Fix unused var + minor diff noise. #
Total comments: 8
Patch Set 8 : Reduce the number of contexts. #Patch Set 9 : Rebase. #Patch Set 10 : Fixed issues. #Patch Set 11 : Fix assertions. #
Total comments: 5
Messages
Total messages: 16 (0 generated)
|