Bug 1340127 - Consider different bidi control/override values when deciding whether to consider a frame first or last. r=jfkthame

I believe the reordering of the first/last check across the code that
delves into letter frames is an improvement, but a currently undectable
one, since it appears that we don't currently allow ::first-letter
pseudo-elements to break across lines, even in the presence of
multi-character ::first-letters that are broken by
'word-break:break-all'.
This commit is contained in:
L. David Baron 2017-03-01 10:04:27 -08:00
parent 0c32b64e57
commit 347306cdf9

View File

@ -1021,8 +1021,6 @@ nsBidiPresUtils::TraverseFrames(nsBlockInFlowLineIterator* aLineIter,
* twice.
*/
nsIFrame* nextSibling = childFrame->GetNextSibling();
bool isLastFrame = !childFrame->GetNextContinuation();
bool isFirstFrame = !childFrame->GetPrevContinuation();
// If the real frame for a placeholder is a first letter frame, we need to
// drill down into it and include its contents in Bidi resolution.
@ -1036,6 +1034,20 @@ nsBidiPresUtils::TraverseFrames(nsBlockInFlowLineIterator* aLineIter,
}
}
auto DifferentBidiValues = [](nsIFrame* aFrame1, nsIFrame* aFrame2) {
nsStyleContext* sc1 = aFrame1->StyleContext();
nsStyleContext* sc2 = aFrame2->StyleContext();
return GetBidiControl(sc1) != GetBidiControl(sc2) ||
GetBidiOverride(sc1) != GetBidiOverride(sc2);
};
nsIFrame* nextContinuation = frame->GetNextContinuation();
nsIFrame* prevContinuation = frame->GetPrevContinuation();
bool isLastFrame = !nextContinuation ||
DifferentBidiValues(frame, nextContinuation);
bool isFirstFrame = !prevContinuation ||
DifferentBidiValues(frame, prevContinuation);
char16_t controlChar = 0;
char16_t overrideChar = 0;
if (frame->IsFrameOfType(nsIFrame::eBidiInlineContainer)) {