Closed Bug 1083892 Opened 10 years ago Closed 10 years ago

In a block with vertical writing-mode, only the first of a series of child blocks (e.g. paragraphs) appears correctly

Categories

(Core :: Layout: Block and Inline, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: jfkthame, Assigned: jfkthame)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

See testcase. When vertical-lr writing mode is selected, only the first of the three paragraphs within the test <div> is visible. Note that an unexpected vertical scrollbar appears on the top-level viewport, suggesting that layout may have placed the following paragraphs far below the expected position (thanks to an unconstrained height somewhere?), although scrolling down does not reveal them.
Blocks: 1079125
No longer blocks: writing-mode
To fix this, we need to make nsHTMLReflowState::CalculateBlockSideMargins work with logical coordinates. I have a WIP patch that seems to work pretty well; waiting for tryserver results (https://tbpl.mozilla.org/?tree=Try&rev=bb776069eab6) before posting for review.
Updated to fix a few test failures from the first attempt; now passes on try. https://tbpl.mozilla.org/?tree=Try&rev=c52ae6754d05
Attachment #8510144 - Flags: review?(smontagu)
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Attached patch Reftest.Splinter Review
And a reftest to go with it, based on the original failing testcase here. (Passes harmlessly when vertical mode is not enabled.)
Attachment #8510148 - Flags: review?(smontagu)
Attachment #8510148 - Flags: review?(smontagu) → review+
Comment on attachment 8510144 [details] [diff] [review] Make CalculateBlockSideMargins work with logical coordinates. Review of attachment 8510144 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/generic/nsHTMLReflowState.cpp @@ +2343,5 @@ > if (availMarginSpace < 0) { > if (mCBReflowState && > + mCBReflowState->GetWritingMode().IsBidiLTR() != > + mWritingMode.IsBidiLTR()) { > + margin.IStart(mWritingMode) += availMarginSpace; I'm not clear why you have this condition instead of just adding the space to margin.IEnd(mWritingMode) in all cases. @@ +2406,5 @@ > // it to 'auto', depending on 'direction'. > else if (mCBReflowState && > + mCBReflowState->GetWritingMode().IsBidiLTR() != > + mWritingMode.IsBidiLTR()) { > + isAutoStartMargin = true; Same question here
Which side's margin we need to adjust is dependent on the parent's directionality; if that doesn't match this state's mWritingMode, then we need to adjust the opposite margin than we'd do if they were the same direction. Without this, we fail a number of reftests, e.g. a lot of the examples in box-properties/CSS21-t100303.xhtml.
Comment on attachment 8510144 [details] [diff] [review] Make CalculateBlockSideMargins work with logical coordinates. Review of attachment 8510144 [details] [diff] [review]: ----------------------------------------------------------------- I see.
Attachment #8510144 - Flags: review?(smontagu) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: