Comment 36 for bug 288111

Revision history for this message
In , Enn (enndeakin) wrote :

Comment on attachment 364717
Resize & Reorder Patch

>+ if (mFrame->GetStyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL) {
>+ PRBool tmp = left;
>+ left = right;
>+ right = tmp;
>+ }
>+

This is OK, but it seems like it could be written more compact with the code about and below it.

>+ var columns = [];
> var col = this.columns.getFirstColumn();
>- var lastCol = null;
>+ while (col) {
>+ columns.push(col);
>+ col = col.getNext();
>+ }
>+ if (isRTL)
>+ columns.reverse();

It would be simpler code to just iterate using getColumnAt()

I don't follow this patch really. It seems that getColumnAtX should already return the right column whether in ltr or rtl mode, especially as you say you are interpreting 'before' or 'after' without respect to the direction.

Perhaps you really want to just iterate the same in either direction but the two lines here just be reversed?

 currentX += cw;
 if (currentX - (cw * aThresh) > adjustedX)