From 3d8ce0f47f81d06d054f8afa93d64575510faae3 Mon Sep 17 00:00:00 2001 From: "roc+@cs.cmu.edu" Date: Tue, 16 Oct 2007 16:56:27 -0700 Subject: [PATCH] Backing out 393758 just in case it caused perf regression --- layout/generic/nsTextFrameThebes.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/layout/generic/nsTextFrameThebes.cpp b/layout/generic/nsTextFrameThebes.cpp index 61fce5193e0..2be61819930 100644 --- a/layout/generic/nsTextFrameThebes.cpp +++ b/layout/generic/nsTextFrameThebes.cpp @@ -1081,17 +1081,6 @@ BuildTextRunsScanner::ContinueTextRunAcrossFrames(nsTextFrame* aFrame1, nsTextFr if (textStyle1->WhiteSpaceIsSignificant() && HasTerminalNewline(aFrame1)) return PR_FALSE; - if (aFrame1->GetContent() == aFrame2->GetContent() && - aFrame1->GetNextInFlow() != aFrame2) { - // aFrame2 must be a non-fluid continuation of aFrame1. This can happen - // sometimes when the unicode-bidi property is used; the bidi resolver - // breaks text into different frames even though the text has the same - // direction. We can't allow these two frames to share the same textrun - // because that would violate our invariant that two flows in the same - // textrun have different content elements. - return PR_FALSE; - } - nsStyleContext* sc2 = aFrame2->GetStyleContext(); if (sc1 == sc2) return PR_TRUE; @@ -1758,8 +1747,10 @@ nsTextFrame::EnsureTextRun(gfxContext* aReferenceContext, nsIFrame* aLineContain for (i = startAt; 0 <= i && i < userData->mMappedFlowCount; i += direction) { TextRunMappedFlow* flow = &userData->mMappedFlows[i]; if (flow->mStartFrame->GetContent() == mContent) { - // Since textruns can only contain one flow for a given content element, - // this must be our flow. + // This may not actually be the flow that we're in. But BuildTextRuns + // promises that this will work ... flows for the same content in the same + // textrun have to be consecutive, they can't skip characters in the middle. + // See assertion "Gap in textframes mapping content?!" above. userData->mLastFlowIndex = i; gfxSkipCharsIterator iter(mTextRun->GetSkipChars(), flow->mDOMOffsetToBeforeTransformOffset, mContentOffset);