Bug 382422: Optimize calls to Bidi resolution. r=dbaron, sr+a=roc
git-svn-id: svn://10.0.0.236/trunk@233781 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
52d93b63e1
commit
51c436f5f0
@ -611,6 +611,7 @@ nsBlockFrame::MarkIntrinsicWidthsDirty()
|
||||
nsBlockFrame* dirtyBlock = NS_STATIC_CAST(nsBlockFrame*, GetFirstContinuation());
|
||||
dirtyBlock->mMinWidth = NS_INTRINSIC_WIDTH_UNKNOWN;
|
||||
dirtyBlock->mPrefWidth = NS_INTRINSIC_WIDTH_UNKNOWN;
|
||||
dirtyBlock->AddStateBits(NS_BLOCK_NEEDS_BIDI_RESOLUTION);
|
||||
|
||||
nsBlockFrameSuper::MarkIntrinsicWidthsDirty();
|
||||
}
|
||||
@ -635,10 +636,10 @@ nsBlockFrame::GetMinWidth(nsIRenderingContext *aRenderingContext)
|
||||
AutoNoisyIndenter indent(gNoisyIntrinsic);
|
||||
#endif
|
||||
|
||||
ResolveBidi();
|
||||
InlineMinWidthData data;
|
||||
for (nsBlockFrame* curFrame = this; curFrame;
|
||||
curFrame = NS_STATIC_CAST(nsBlockFrame*, curFrame->GetNextContinuation())) {
|
||||
curFrame->ResolveBidi();
|
||||
for (line_iterator line = curFrame->begin_lines(), line_end = curFrame->end_lines();
|
||||
line != line_end; ++line)
|
||||
{
|
||||
@ -706,10 +707,10 @@ nsBlockFrame::GetPrefWidth(nsIRenderingContext *aRenderingContext)
|
||||
AutoNoisyIndenter indent(gNoisyIntrinsic);
|
||||
#endif
|
||||
|
||||
ResolveBidi();
|
||||
InlinePrefWidthData data;
|
||||
for (nsBlockFrame* curFrame = this; curFrame;
|
||||
curFrame = NS_STATIC_CAST(nsBlockFrame*, curFrame->GetNextContinuation())) {
|
||||
curFrame->ResolveBidi();
|
||||
for (line_iterator line = curFrame->begin_lines(), line_end = curFrame->end_lines();
|
||||
line != line_end; ++line)
|
||||
{
|
||||
@ -6175,6 +6176,9 @@ nsBlockFrame::Init(nsIContent* aContent,
|
||||
|
||||
nsresult rv = nsBlockFrameSuper::Init(aContent, aParent, aPrevInFlow);
|
||||
|
||||
if (!aPrevInFlow)
|
||||
AddStateBits(NS_BLOCK_NEEDS_BIDI_RESOLUTION);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -6590,27 +6594,40 @@ nsBlockFrame::BlockNeedsSpaceManager(nsIFrame* aBlock)
|
||||
(parent && !parent->IsFloatContainingBlock());
|
||||
}
|
||||
|
||||
// XXX keep the text-run data in the first-in-flow of the block
|
||||
|
||||
#ifdef IBMBIDI
|
||||
nsresult
|
||||
nsBlockFrame::ResolveBidi()
|
||||
{
|
||||
NS_ASSERTION(!GetPrevInFlow(),
|
||||
"ResolveBidi called on non-first continuation");
|
||||
|
||||
if (!(GetStateBits() & NS_BLOCK_NEEDS_BIDI_RESOLUTION))
|
||||
return NS_OK;
|
||||
|
||||
RemoveStateBits(NS_BLOCK_NEEDS_BIDI_RESOLUTION);
|
||||
|
||||
nsPresContext* presContext = PresContext();
|
||||
if (!presContext->BidiEnabled()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (mLines.empty()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsBidiPresUtils* bidiUtils = presContext->GetBidiUtils();
|
||||
if (!bidiUtils)
|
||||
return NS_OK;
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
return bidiUtils->Resolve(this, mLines.front()->mFirstChild,
|
||||
IsVisualFormControl(presContext));
|
||||
for (nsBlockFrame* curFrame = this;
|
||||
curFrame; curFrame = NS_STATIC_CAST(nsBlockFrame*,
|
||||
curFrame->GetNextContinuation())) {
|
||||
if (!curFrame->mLines.empty()) {
|
||||
nsresult rv = bidiUtils->Resolve(curFrame,
|
||||
curFrame->mLines.front()->mFirstChild,
|
||||
IsVisualFormControl(presContext));
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool
|
||||
|
||||
@ -109,6 +109,7 @@ class nsIntervalSet;
|
||||
*/
|
||||
|
||||
// see nsHTMLParts.h for the public block state bits
|
||||
#define NS_BLOCK_NEEDS_BIDI_RESOLUTION 0x00100000
|
||||
#define NS_BLOCK_HAS_LINE_CURSOR 0x01000000
|
||||
#define NS_BLOCK_HAS_OVERFLOW_LINES 0x02000000
|
||||
#define NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS 0x04000000
|
||||
|
||||
@ -68,7 +68,7 @@ class nsIChannel;
|
||||
#define NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET 0x40000000
|
||||
// These are the bits that get inherited from a block frame to its
|
||||
// next-in-flows and are not private to blocks
|
||||
#define NS_BLOCK_FLAGS_MASK 0xF0F00000
|
||||
#define NS_BLOCK_FLAGS_MASK 0xF0E00000
|
||||
|
||||
// Factory methods for creating html layout objects
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user