Closed Bug 1153140 Opened 7 years ago Closed 7 years ago

[css-grid][RTL] grid contents in right-to-left mode offset by left+right border width

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

See testcase: the grid items are offset to the left by an amount that depends on the border width of the containing grid.

A similar problem occurs with writing-mode:vertical-rl.
I don't know if this is the best place to handle it, but a simple fix to gridWidth in nsGridContainerFrame::ReflowChildren appears to resolve the problem.
Attachment #8590714 - Flags: review?(mats)
For sanity-checking, here are RTL versions of a couple of the reftests; these fail without the gridWidth fix, and pass with it.
Attachment #8590715 - Flags: review?(mats)
Attachment #8590715 - Attachment description: di versions of a couple of the grid reftests → dir=rtl versions of a couple of the grid reftests
Blocks: 1079164
Comment on attachment 8590714 [details] [diff] [review]
Include borderPadding width in the containerWidth for grid item placement

LGTM.  Could you rename it to 'containerWidth' while you're here?
I think it would be more accurate.

I think I just misunderstood what aContainerWidth meant in the
ReflowChild/FinishReflowChild signatures.  Perhaps it's worth a adding
a @param there that explains it's the container's border-box width?
Attachment #8590714 - Flags: review?(mats) → review+
Attachment #8590715 - Flags: review?(mats) → review+
(In reply to Mats Palmgren (:mats) from comment #3)
> I think I just misunderstood what aContainerWidth meant in the
> ReflowChild/FinishReflowChild signatures.  Perhaps it's worth a adding
> a @param there that explains it's the container's border-box width?

Good idea, done.
Assignee: nobody → jfkthame
https://hg.mozilla.org/mozilla-central/rev/646e795e8e46
https://hg.mozilla.org/mozilla-central/rev/129ed36713d3
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Depends on: 1157691
You need to log in before you can comment on or make changes to this bug.