Last Comment Bug 779566 - CSS columns: incorrect alignment in right-aligned documents
: CSS columns: incorrect alignment in right-aligned documents
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Layout (show other bugs)
: Trunk
: All All
: -- normal with 1 vote (vote)
: mozilla17
Assigned To: Scott Johnson (:jwir3)
:
: Jet Villegas (:jet)
Mentors:
http://jsfiddle.net/aBDpt/
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-01 11:04 PDT by spammed.user
Modified: 2012-08-02 06:22 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
b779566 (5.56 KB, patch)
2012-08-01 13:39 PDT, Scott Johnson (:jwir3)
roc: review+
Details | Diff | Splinter Review

Description spammed.user 2012-08-01 11:04:51 PDT
In right-to-left documents, columns align to the left instead of aligning right. See visualization here: http://jsfiddle.net/aBDpt/
Comment 1 Scott Johnson (:jwir3) 2012-08-01 12:09:55 PDT
Hmmm...

At first glance, it seems that you point out an issue with how our column boxes are being placed. However, if you look at a slight modification to the same jsfiddle:
http://jsfiddle.net/aBDpt/6/

We render the same as in google chrome. So, it seems that our placement of column boxes is incorrect when in rtl mode and when we don't have enough column boxes to fill the requested number of columns:
http://jsfiddle.net/aBDpt/13/

(In the second example, we only have 2 columns, even though the author requested 4). If we make the number of columns requested equal 2, then we get:
http://jsfiddle.net/aBDpt/14/

Which is correct. So, I think that we need to handle the above case a little bit better. This shouldn't be too difficult... I'll see what I can do.

Thanks for the bug submission!
Comment 2 Scott Johnson (:jwir3) 2012-08-01 13:39:01 PDT
Created attachment 648062 [details] [diff] [review]
b779566

Patch that removes some code that doesn't appear to be needed any longer. This is the code that is causing the RTL columns to be aligned to the left if we don't have enough content to fill the requested number of columns. 

Alternatively, I could detect the case where we have enough content to get the requested number of column boxes, and then leave this code in, with the added condition that it only happens when there is enough content. (I thought this method simplified the code, but it might be doing something that I don't immediately see, in which case, we'd want to leave it in).
Comment 3 Scott Johnson (:jwir3) 2012-08-01 19:55:11 PDT
Inbound:
https://hg.mozilla.org/integration/mozilla-inbound/rev/2c700f9a2c1d
Comment 4 Ed Morley [:emorley] 2012-08-02 06:22:17 PDT
https://hg.mozilla.org/mozilla-central/rev/2c700f9a2c1d

Note You need to log in before you can comment on or make changes to this bug.