We now bail in GetRenderedText when we encounter dirty text frames. This should be okay since dirty text frames should be reflowed at some point and we'll refresh our accessible text cache. (relanding)
We now bail in GetRenderedText when we encounter dirty text frames. This shouldm be okay since dirty text frames should be reflowed at some point and we'll refresh our accessible text cache.
This change does two things:
1) Makes sure that we don't clear textruns when removing continuations due to
an earlier consideration expanding to contain all their text.
2) Remove continuations in chunks to work around the fact that blocks are
really bad at handling single frame removals.
2011-08-25 23:29:24 -04:00
Alfred Kayser ext:(%2C%20Ms2ger%20%3Cms2ger%40gmail.com%3E)
This code is a little bit sketchy, but given that text-decoration
drawing is the same across modes we shouldn't have a quirks mode check
here (though there's a decent argument to be made that we shouldn't be
checking text decorations at all).
The FrameProperty representing baseline is set when a block defines
text-decorations and has vertically-aligned children, but we were
retrieving it whether the block or the vertically-aligned frame itself
defined the decorations. As a result, we "undo" the frame offset to get
the baseline from the child in that case.
Make the quirks mode text-decoration + text-shadow code draw the
decorations for shadows that do not have a specified color using
the same color used for the un-shadowed decorations, which matches
standards mode behavior. (The color of unspecified-color shadows
is explicitly undefined in the specification.)
This code will (in a later patch on this bug) be used for both
quirks and standards modes.
Quirks-mode code draws text, and then all decorations. We need to instead draw
underlines, then overlines, -then- text, then line-throughs, as per CSS 2.1.
This involves refactoring nsTextFrame::PaintTextDecorations and
nsTextFrame::DrawText by merging them together, and also updating some
of their callers.
Rendering text decorations far away from the frame's baseline seems to
sometimes introduce rounding issues. This patch addresses that by
avoiding snapped-baseline weirdness and using a different argument to
nsTextFrame::PaintTextDecorations in some computations that didn't
really need to use the snapped baseline anyway.
Change the quirks mode text-decoration code (soon to be used for all
modes) to follow CSS 2.1's rules for positioning of decoration lines.
Decorations are now drawn at a constant vertical position established by
the element creating the decoration, and more than one of the same type
(underline, overline, line-through) of decoration are supported on the
same piece of text.
This means that text-decorations can now significantly overflow a text
frame, since the vertical-alignment of the element with text-decoration
may be substantially different from the vertical alignment of the text.
Set overflow areas for text frames with text decorations in
nsLineLayout::RelativePositionFrames since it must happen *after*
vertical alignment is done, and when relative positioning data are
consistent (nsIFrame::GetRelativeOffset matches the offset that has been
applied).