Closed
Bug 1079157
Opened 10 years ago
Closed 10 years ago
Logical coordinate support for columns
Categories
(Core :: Layout: Text and Fonts, defect)
Core
Layout: Text and Fonts
Tracking
()
RESOLVED
FIXED
mozilla37
People
(Reporter: smontagu, Assigned: jfkthame)
References
(Blocks 1 open bug)
Details
Attachments
(5 files, 6 obsolete files)
8.02 KB,
text/html
|
Details | |
1.68 KB,
text/html
|
Details | |
45.77 KB,
patch
|
smontagu
:
review+
|
Details | Diff | Splinter Review |
16.34 KB,
patch
|
smontagu
:
review+
|
Details | Diff | Splinter Review |
28.81 KB,
patch
|
smontagu
:
review+
|
Details | Diff | Splinter Review |
Part of support for vertical text
Assignee | ||
Comment 1•10 years ago
|
||
Here's a WIP patch. This seems to make columns basically work in vertical writing modes, though hasn't been tested much yet.
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Assignee | ||
Updated•10 years ago
|
Blocks: enable-writing-mode-dev
Assignee | ||
Comment 2•10 years ago
|
||
Updated and tidied up this patch a bit; it seems pretty functional in my simple testing. (We'll want a bunch of proper testcases...)
Attachment #8530275 -
Flags: review?(smontagu)
Assignee | ||
Updated•10 years ago
|
Attachment #8519084 -
Attachment is obsolete: true
Assignee | ||
Comment 3•10 years ago
|
||
Here's a simple example to play with.
Note that it behaves quite erratically (chunks of the text disappear or are smashed together on the right) during horizontal resizing, and sometimes when changing the various options. I'm about to file a separate bug on this; it's not specific to columns.
Assignee | ||
Comment 4•10 years ago
|
||
(In reply to Jonathan Kew (:jfkthame) from comment #3)
> Created attachment 8530287 [details]
> sample with columns in vertical writing mode
>
> Here's a simple example to play with.
>
> Note that it behaves quite erratically (chunks of the text disappear or are
> smashed together on the right) during horizontal resizing, and sometimes
> when changing the various options. I'm about to file a separate bug on this;
> it's not specific to columns.
smontagu got there first, and filed bug 1106083 on this.
Assignee | ||
Comment 5•10 years ago
|
||
The patch above doesn't return proper metrics for the columnset, with the result that things break badly in vertical-rl mode when the columnset frame is only one of several children of its container; it's liable to disappear, as in this example.
Assignee | ||
Comment 6•10 years ago
|
||
And here's a slightly revised patch that works much better; the testcase above now looks good in all writing modes.
Attachment #8530513 -
Flags: review?(smontagu)
Assignee | ||
Updated•10 years ago
|
Attachment #8530275 -
Attachment is obsolete: true
Attachment #8530275 -
Flags: review?(smontagu)
Assignee | ||
Comment 7•10 years ago
|
||
Comment on attachment 8530513 [details] [diff] [review]
Make nsColumnSetFrame support vertical writing mode
To make this a bit easier to review (I hope), I'm splitting it into two patches; first, purely mechanical renaming of a bunch of local variables and members in nsColumnSetFrame, generated with sed; and then the manual changes that actually make things work in vertical mode. That way, the first patch should need little more than a rubber-stamp, and it'll be easier to follow the real changes in the second.
Attachment #8530513 -
Attachment is obsolete: true
Attachment #8530513 -
Flags: review?(smontagu)
Assignee | ||
Comment 8•10 years ago
|
||
Attachment #8530526 -
Flags: review?(smontagu)
Assignee | ||
Comment 9•10 years ago
|
||
Attachment #8530527 -
Flags: review?(smontagu)
Assignee | ||
Comment 10•10 years ago
|
||
Please excuse the churn, but I'm going to refresh these patches once more: in addition to the mechanical renaming in part 1, I've split a bunch of comment-only hunks, as well as some whitespace cleanup, out into a new part 2 patch, to make it easier to see the actual code changes in the final part 3.
Assignee | ||
Comment 11•10 years ago
|
||
Attachment #8530533 -
Flags: review?(smontagu)
Assignee | ||
Updated•10 years ago
|
Attachment #8530526 -
Attachment is obsolete: true
Attachment #8530526 -
Flags: review?(smontagu)
Assignee | ||
Comment 12•10 years ago
|
||
Attachment #8530534 -
Flags: review?(smontagu)
Assignee | ||
Comment 13•10 years ago
|
||
Attachment #8530535 -
Flags: review?(smontagu)
Assignee | ||
Updated•10 years ago
|
Attachment #8530527 -
Attachment is obsolete: true
Attachment #8530527 -
Flags: review?(smontagu)
Reporter | ||
Comment 14•10 years ago
|
||
Comment on attachment 8530533 [details] [diff] [review]
part 1 - Purely mechanical renaming of local variables and members in nsColumnSetFrame
Review of attachment 8530533 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks for doing the split!
Attachment #8530533 -
Flags: review?(smontagu) → review+
Reporter | ||
Updated•10 years ago
|
Attachment #8530534 -
Flags: review?(smontagu) → review+
Reporter | ||
Comment 15•10 years ago
|
||
Comment on attachment 8530535 [details] [diff] [review]
part 3 - Make nsColumnSetFrame support vertical writing mode
Review of attachment 8530535 [details] [diff] [review]:
-----------------------------------------------------------------
::: layout/generic/nsColumnSetFrame.cpp
@@ +771,5 @@
> }
> }
>
> aColData.mMaxBSize = contentBEnd;
> contentRect.height = std::max(contentRect.height, contentBEnd);
This seems like mixing logical and physical coordinates, as does the initialization of contentSize a few lines below.
Is there any reason why contentRect can't be a LogicalRect?
Assignee | ||
Comment 16•10 years ago
|
||
You're right, things were a little fishy there. Here's an updated patch that fixes the confusion, and appears to work better too. It seemed easier to keep contentRect as physical while it's being computed (unioning in the rects of the child frames), but then the final contentSize is converted properly to logical coordinates.
Attachment #8531014 -
Flags: review?(smontagu)
Assignee | ||
Updated•10 years ago
|
Attachment #8530535 -
Attachment is obsolete: true
Attachment #8530535 -
Flags: review?(smontagu)
Reporter | ||
Comment 17•10 years ago
|
||
Comment on attachment 8531014 [details] [diff] [review]
part 3 - Make nsColumnSetFrame support vertical writing mode
Review of attachment 8531014 [details] [diff] [review]:
-----------------------------------------------------------------
::: layout/generic/nsColumnSetFrame.cpp
@@ -721,3 @@
>
> - WritingMode wm = aReflowState.GetWritingMode();
> - LogicalSize contentSize(wm, nsSize(contentRect.XMost(), contentRect.YMost()));
So instead of these two lines you just have
LogicalSize contentSize = LogicalSize(wm, contentRect.Size());
Do subtracting border padding and the difference between the size and the XMost/YMost necessarily cancel out?
Reporter | ||
Comment 18•10 years ago
|
||
*sigh*. "review" doesn't show the same quoted content in the preview of a comment that appears when publishing. Do we have a bug on that?
"These two lines" in comment 17 mean
- contentRect -= nsPoint(physicalBP.left, physicalBP.top);
and
- // contentRect included the borderPadding.left,borderPadding.top of the child rects
- LogicalSize contentSize(wm, nsSize(contentRect.XMost(), contentRect.YMost()));
Assignee | ||
Comment 19•10 years ago
|
||
(In reply to Simon Montagu :smontagu from comment #17)
> Comment on attachment 8531014 [details] [diff] [review]
> part 3 - Make nsColumnSetFrame support vertical writing mode
>
> Review of attachment 8531014 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: layout/generic/nsColumnSetFrame.cpp
> @@ -721,3 @@
> >
> > - WritingMode wm = aReflowState.GetWritingMode();
> > - LogicalSize contentSize(wm, nsSize(contentRect.XMost(), contentRect.YMost()));
>
> So instead of these two lines you just have
> LogicalSize contentSize = LogicalSize(wm, contentRect.Size());
>
> Do subtracting border padding and the difference between the size and the
> XMost/YMost necessarily cancel out?
AFAICT, yes. The accumulated contentRect will have been "offset" by the topLeft of the borderPadding; subtracting that leaves its topLeft at 0,0, and its XMost/YMost is then the same as Size. I tried putting a big fat border on the columnSet frame and confirmed that this still behaves as expected.
Reporter | ||
Comment 20•10 years ago
|
||
Comment on attachment 8531014 [details] [diff] [review]
part 3 - Make nsColumnSetFrame support vertical writing mode
Review of attachment 8531014 [details] [diff] [review]:
-----------------------------------------------------------------
OK, I'll buy that
Attachment #8531014 -
Flags: review?(smontagu) → review+
Assignee | ||
Comment 21•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/d17bd17b3786
https://hg.mozilla.org/integration/mozilla-inbound/rev/d588126b6d92
https://hg.mozilla.org/integration/mozilla-inbound/rev/52a6bc20f60d
Target Milestone: --- → mozilla37
Comment 22•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/d17bd17b3786
https://hg.mozilla.org/mozilla-central/rev/d588126b6d92
https://hg.mozilla.org/mozilla-central/rev/52a6bc20f60d
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•