Closed
Bug 1217833
Opened 9 years ago
Closed 9 years ago
CSS :first-line rule on RTL element, text placement is wrong
Categories
(Core :: Layout, defect)
Tracking
()
RESOLVED
FIXED
mozilla45
Tracking | Status | |
---|---|---|
firefox45 | --- | fixed |
People
(Reporter: yonizaf, Assigned: dbaron)
References
Details
(Keywords: regression, rtl)
Attachments
(3 files)
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0 Build ID: 20150916094008 Steps to reproduce: If you add a ::first-line CSS rule to a div that has dir=rtl and text-align:right, the text in the div get placed outside the element and far to the right. The ::first-line rule can be empty, it doesn't have to have any properties in it for this to happen. A test file is attached to show the problem.
Updated•9 years ago
|
Keywords: regression
Comment 1•9 years ago
|
||
This is a regression, but not a recent one. The initial regression range is http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=44ae8462d6ab&tochange=46041cc216fd, though it seems to have morphed a bit since then. A likely culprit is http://hg.mozilla.org/mozilla-central/rev/dab8e3865967 from bug 789096
Keywords: rtl
Is there a reason why this bug still has unconfirmed status?
Updated•9 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Comment 3•9 years ago
|
||
Not surprisingly, the nsFirstLineFrame frames for both the first and following lines have basically the same x-offset as their contents, double-offsetting the contents. I suspect that before the patch we always aligned first line frames to the left edge. But I think that in a logical coordinate world it makes more sense to align them to the start-edge.
Assignee | ||
Comment 4•9 years ago
|
||
Though another reasonable possibility would be to make the line frame fill the entire inline-size of the block (possibly excluding space taken by floats).
Assignee | ||
Comment 5•9 years ago
|
||
That said, it's not clear to me what's going wrong, given that we do call BeginSpan and EndSpan for the nsFirstLineFrame (which uses nsInlineFrame::ReflowFrames), so it's not clear to me why the use of ContainerSizeForSpan (and the calls to SetRect in VerticalAlignFrames) don't take care of this properly.
Assignee | ||
Comment 6•9 years ago
|
||
The nsLineLayout code is doing the right thing, but then nsBidiPresUtils::RepositionFrame is moving it.
Assignee | ||
Comment 7•9 years ago
|
||
The thing that seems like the obvious patch: https://hg.mozilla.org/users/dbaron_mozilla.com/patches/raw-file/71b60ac7f7e4/remove-line-frame-exception breaks the bidi reordering of the second of my tests (while fixing the positioning).
Assignee | ||
Comment 9•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=7c5c82835f0c&group_state=expanded
Assignee | ||
Comment 10•9 years ago
|
||
Attachment #8691218 -
Flags: review?(jfkthame)
Assignee | ||
Comment 11•9 years ago
|
||
Oops, I need to fix that commit message to be: Bug 1217833 - Fix container width in exception for line frames in nsBidiPresUtils::ReorderFrames.
Assignee | ||
Updated•9 years ago
|
Attachment #8691218 -
Attachment description: Remove exception for line frames from nsBidiPresUtils::ReorderFrames since line frames now lay out more like regular inlines → Fix container width in exception for line frames in nsBidiPresUtils::ReorderFrames
Comment 12•9 years ago
|
||
Comment on attachment 8691218 [details] [diff] [review] Fix container width in exception for line frames in nsBidiPresUtils::ReorderFrames Review of attachment 8691218 [details] [diff] [review]: ----------------------------------------------------------------- Makes sense to me, thanks (with the corrected commit msg).
Attachment #8691218 -
Flags: review?(jfkthame) → review+
Assignee | ||
Comment 13•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/0ac7ee2441e58d18ecac91a19a9a886b92794c5e Bug 1217833 - Fix container width in exception for line frames in nsBidiPresUtils::ReorderFrames. r=jfkthame
Assignee | ||
Comment 14•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=f1425df0a968&group_state=expanded
Assignee | ||
Comment 15•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/e567a54aa60420657992d405823af24b2b2e7e70 Bug 1217833 followup - Mark one test as fuzzy(43,2) on a CLOSED TREE (though fuzzy amounts needed vary by platform).
Assignee | ||
Comment 16•9 years ago
|
||
I think the fuzz was needed because the leftmost edge of the t was overlapping with the blue background, and the paint order of the two was different between test and reference. I'll try a try run with adding a margin and removing the fuzz.
Comment 17•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/0ac7ee2441e5 https://hg.mozilla.org/mozilla-central/rev/e567a54aa604
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Assignee | ||
Comment 18•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=ad5633db33bf&group_state=expanded
Assignee | ||
Comment 19•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/5a84fdee7bfbfe60f4bf2555519556e87d028dfe Bug 1217833 followup - Add margin to avoid fuzz on reftest.
Comment 20•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5a84fdee7bfb
You need to log in
before you can comment on or make changes to this bug.
Description
•