DescriptionProper support for multiple text decorations.
This patch fixes two issues:
* Incorrect style recalc for text-decoration-[style, color] for
immediate child text nodes. (Issue 350840).
* The ability of having multiple applied text decorations on the same line,
for example a dashed underline over a wavy underline. (If that's your thing).
Applied decorations (any number) are now stored as a vector of
AppliedTextDecoration objects in StyleRareInheritedData. In the common case of
a solid-underline-currentColor decoration, we don't store AppliedTextDecoration
objects, but set a bit in inherited_flags instead. Some notes related to this:
* If there are multiple solid-underline-currentColor decorations applied (i.e.
if more than one parent generates such a decoration), it will not trigger
the rare behavior.
* The single-bit optimization will only be used if there are no other "rare"
decorations applied already.
Other changes:
* Computing the color for the decoration has been moved to RenderStyle
(visitedDependentDecoration[Style]Color).
* I attempted to beautify the painting code in InlineTextBox.cpp a little bit.
* The isRubyText check in the former RenderObject::getTextDecorations has been
moved to StyleAdjuster:doesNotInheritTextDecoration.
* The 'firstlineStyle'-case of RenderObject::getTextDecorations is now an
implementation detail of RenderObject::resolvedDecorations, rather than
something the caller must remember to do.
Problems:
* -webkit-text-decorations-in-effect (in its current form) is not compatible
with CSS3 text decorations (in its current form). Behavior after this patch:
if you set this property in a stylesheet, it will clear all decorations,
and apply up to three solid-currentColor decorations as specified by the
property. One solution to this would be to change the property to a comma-
separated list of decorations (not recommended), or if at all possible
*remove* the whole property (recommended). I attempted to remove the
property, but it's used by core/editing in horrible ways I have yet to fully
understand.
Of course there are no issues if experimental features are not enabled. In
this case the behavior should be indistinguishable from the current
behavior.
* text-decoration-line seems to accept multiple values (up to three), even
though the spec does not allow it. (CSS2.1 does describe this for
text-decoration, though, so it's possibly a problem with the spec rather
than our implementation).
BUG=350840, 315271
TEST=text-decoration-color-recalc.html
text-decoration-style-recalc.html
text-decoration-line-recalc.html
text-decoration-style-multiple-overlap.html
Patch Set 1 #
Total comments: 24
Patch Set 2 : Rebase. #Patch Set 3 : Fix most review issues. #Patch Set 4 : Rebase #Patch Set 5 : Resolve decoration colors dynamically. #
Total comments: 5
Patch Set 6 : Rebase. #Patch Set 7 : Fix review issues. #
Total comments: 16
Patch Set 8 : Rebase. #Patch Set 9 : Fix jchaffraix' issues. #Messages
Total messages: 14 (0 generated)
|