mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 369236: Move IsBidiFormControl from nsHTMLReflowState to nsBlockFrame. r+sr=roc
This commit is contained in:
parent
1cdd8d7898
commit
b21d2d6a35
@ -122,7 +122,7 @@ public:
|
||||
* @param aFirstChild The first child frame of aBlockFrame
|
||||
* @param aIsVisualFormControl [IN] Set if we are in a form control on a
|
||||
* visual page.
|
||||
* @see nsHTMLReflowState::IsBidiFormControl
|
||||
* @see nsBlockFrame::IsVisualFormControl
|
||||
*
|
||||
* @lina 06/18/2000
|
||||
*/
|
||||
|
@ -868,7 +868,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
||||
if (bidiUtils) {
|
||||
bidiUtils->Resolve(aPresContext, this,
|
||||
mLines.front()->mFirstChild,
|
||||
aReflowState.mFlags.mVisualBidiFormControl);
|
||||
IsVisualFormControl(aPresContext));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -6279,6 +6279,35 @@ nsBlockFrame::SetParent(const nsIFrame* aParent)
|
||||
|
||||
// XXX keep the text-run data in the first-in-flow of the block
|
||||
|
||||
#ifdef IBMBIDI
|
||||
PRBool
|
||||
nsBlockFrame::IsVisualFormControl(nsPresContext* aPresContext)
|
||||
{
|
||||
// This check is only necessary on visual bidi pages, because most
|
||||
// visual pages use logical order for form controls so that they will
|
||||
// display correctly on native widgets in OSs with Bidi support.
|
||||
// So bail out if the page is not visual, or if the pref is
|
||||
// set to use visual order on forms in visual pages
|
||||
if (!aPresContext->IsVisualMode()) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRUint32 options = aPresContext->GetBidi();
|
||||
if (IBMBIDI_CONTROLSTEXTMODE_LOGICAL != GET_BIDI_OPTION_CONTROLSTEXTMODE(options)) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
nsIContent* content = GetContent();
|
||||
for ( ; content; content = content->GetParent()) {
|
||||
if (content->IsNodeOfType(nsINode::eHTML_FORM_CONTROL)) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return PR_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
nsBlockFrame::VerifyLines(PRBool aFinalCheckOK)
|
||||
|
@ -350,6 +350,18 @@ protected:
|
||||
nsresult AddFrames(nsIFrame* aFrameList,
|
||||
nsIFrame* aPrevSibling);
|
||||
|
||||
#ifdef IBMBIDI
|
||||
/**
|
||||
* Test whether the frame is a form control in a visual Bidi page.
|
||||
* This is necessary for backwards-compatibility, because most visual
|
||||
* pages use logical order for form controls so that they will
|
||||
* display correctly on native widgets in OSs with Bidi support
|
||||
* @param aPresContext the pres context
|
||||
* @return whether the frame is a BIDI form control
|
||||
*/
|
||||
PRBool IsVisualFormControl(nsPresContext* aPresContext);
|
||||
#endif
|
||||
|
||||
public:
|
||||
/** does all the real work for removing aDeletedFrame from this
|
||||
* finds the line containing aFrame.
|
||||
|
@ -109,7 +109,6 @@ nsHTMLReflowState::nsHTMLReflowState(nsPresContext* aPresContext,
|
||||
mPercentHeightReflowInitiator = nsnull;
|
||||
Init(aPresContext);
|
||||
#ifdef IBMBIDI
|
||||
mFlags.mVisualBidiFormControl = IsBidiFormControl(aPresContext);
|
||||
mRightEdge = NS_UNCONSTRAINEDSIZE;
|
||||
#endif
|
||||
}
|
||||
@ -177,8 +176,6 @@ nsHTMLReflowState::nsHTMLReflowState(nsPresContext* aPresContext,
|
||||
}
|
||||
|
||||
#ifdef IBMBIDI
|
||||
mFlags.mVisualBidiFormControl = (aParentReflowState.mFlags.mVisualBidiFormControl) ?
|
||||
PR_TRUE : IsBidiFormControl(aPresContext);
|
||||
mRightEdge = aParentReflowState.mRightEdge;
|
||||
#endif // IBMBIDI
|
||||
}
|
||||
@ -2104,47 +2101,3 @@ nsHTMLReflowState::ComputeMinMaxValues(nscoord aContainingBlockWidth,
|
||||
mComputedMaxHeight = mComputedMinHeight;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef IBMBIDI
|
||||
PRBool
|
||||
nsHTMLReflowState::IsBidiFormControl(nsPresContext* aPresContext)
|
||||
{
|
||||
// This check is only necessary on visual bidi pages, because most
|
||||
// visual pages use logical order for form controls so that they will
|
||||
// display correctly on native widgets in OSs with Bidi support.
|
||||
// So bail out if the page is not Bidi, or not visual, or if the pref is
|
||||
// set to use visual order on forms in visual pages
|
||||
if (!aPresContext->BidiEnabled()) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
if (!aPresContext->IsVisualMode()) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRUint32 options = aPresContext->GetBidi();
|
||||
if (IBMBIDI_CONTROLSTEXTMODE_LOGICAL != GET_BIDI_OPTION_CONTROLSTEXTMODE(options)) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
nsIContent* content = frame->GetContent();
|
||||
if (!content) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
// If this is a root reflow, we have to walk up the content tree to
|
||||
// find out if the reflow root is a descendant of a form control.
|
||||
// Otherwise, just test this content node
|
||||
if (mReflowDepth == 0) {
|
||||
for ( ; content; content = content->GetParent()) {
|
||||
if (content->IsNodeOfType(nsINode::eHTML_FORM_CONTROL)) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return (content->IsNodeOfType(nsINode::eHTML_FORM_CONTROL));
|
||||
}
|
||||
|
||||
return PR_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
@ -305,7 +305,6 @@ public:
|
||||
// is changing
|
||||
PRUint16 mIsTopOfPage:1; // is the current context at the top of a page?
|
||||
PRUint16 mBlinks:1; // Keep track of text-decoration: blink
|
||||
PRUint16 mVisualBidiFormControl:1; // Keep track of descendants of form controls on Visual Bidi pages
|
||||
PRUint16 mHasClearance:1; // Block has clearance
|
||||
PRUint16 mAssumingHScrollbar:1; // parent frame is an nsIScrollableFrame and it
|
||||
// is assuming a horizontal scrollbar
|
||||
@ -457,17 +456,6 @@ protected:
|
||||
|
||||
nscoord CalculateHorizBorderPaddingMargin(nscoord aContainingBlockWidth);
|
||||
|
||||
#ifdef IBMBIDI
|
||||
/**
|
||||
* Test whether the frame is a form control in a visual Bidi page.
|
||||
* This is necessary for backwards-compatibility, because most visual
|
||||
* pages use logical order for form controls so that they will
|
||||
* display correctly on native widgets in OSs with Bidi support
|
||||
* @param aPresContext the pres context
|
||||
* @return whether the frame is a BIDI form control
|
||||
*/
|
||||
PRBool IsBidiFormControl(nsPresContext* aPresContext);
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* nsHTMLReflowState_h___ */
|
||||
|
Loading…
Reference in New Issue
Block a user