Closed
Bug 1106669
Opened 10 years ago
Closed 10 years ago
nsLayoutUtils::IntrinsicForContainer needs to work with logical coordinates
Categories
(Core :: Layout: Block and Inline, defect)
Core
Layout: Block and Inline
Tracking
()
RESOLVED
FIXED
mozilla37
People
(Reporter: jfkthame, Assigned: jfkthame)
References
Details
Attachments
(2 files, 1 obsolete file)
22.88 KB,
patch
|
smontagu
:
review+
|
Details | Diff | Splinter Review |
2.93 KB,
patch
|
smontagu
:
review+
|
Details | Diff | Splinter Review |
nsLayoutUtils::IntrinsicForContainer is used when sizing a <button> to fit around an <img>, and this is why the buttons that contain images in bug 1106667's testcase don't size themselves properly.
Assignee | ||
Comment 1•10 years ago
|
||
With this, those buttons size themselves properly.
Attachment #8531026 -
Flags: review?(smontagu)
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•10 years ago
|
||
Actually, IntrinsicForContainer is primarily interested in the parent's writing mode, as it is an inline size in that WM that we're computing. If aFrame is orthogonal to its parent, it'd be its block-size that we need, but that probably isn't known yet... so we lose. But this is probably close enough for a start.
Attachment #8531682 -
Flags: review?(smontagu)
Assignee | ||
Updated•10 years ago
|
Attachment #8531026 -
Attachment is obsolete: true
Attachment #8531026 -
Flags: review?(smontagu)
Comment 3•10 years ago
|
||
Comment on attachment 8531682 [details] [diff] [review]
Convert nsLayoutUtils::IntrinsicForContainer to work with logical coordinates
Review of attachment 8531682 [details] [diff] [review]:
-----------------------------------------------------------------
Tests?
::: layout/base/nsLayoutUtils.cpp
@@ +4101,5 @@
> + isVertical ? stylePos->mHeight : stylePos->mWidth;
> + const nsStyleCoord &styleMinISize =
> + isVertical ? stylePos->mMinHeight : stylePos->mMinWidth;
> + const nsStyleCoord &styleMaxISize =
> + isVertical ? stylePos->mMaxHeight : stylePos->mMaxWidth;
I think it's better to make this one if/else rather than three ternaries in a row with the same condition.
@@ +4185,5 @@
> + isVertical ? stylePos->mWidth : stylePos->mHeight;
> + const nsStyleCoord &styleMinBSize =
> + isVertical ? stylePos->mMinWidth : stylePos->mMinHeight;
> + const nsStyleCoord &styleMaxBSize =
> + isVertical ? stylePos->mMaxWidth : stylePos->mMaxHeight;
Same here
@@ +4188,5 @@
> + const nsStyleCoord &styleMaxBSize =
> + isVertical ? stylePos->mMaxWidth : stylePos->mMaxHeight;
> +
> + if (styleBSize.GetUnit() != eStyleUnit_Auto ||
> + !(styleMinBSize.GetUnit() == eStyleUnit_Auto ||
Nit: remove trailing whitespace
Attachment #8531682 -
Flags: review?(smontagu) → review+
Assignee | ||
Comment 4•10 years ago
|
||
This seems to work OK as a testcase; it uses the sizing of a button to check whether it is using the intrinsic size of its contents properly.
Attachment #8531762 -
Flags: review?(smontagu)
Updated•10 years ago
|
Attachment #8531762 -
Flags: review?(smontagu) → review+
Assignee | ||
Comment 5•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/d588126b6d92
https://hg.mozilla.org/integration/mozilla-inbound/rev/52a6bc20f60d
Target Milestone: --- → mozilla37
Comment 6•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/8b7a6e2e4ce7
https://hg.mozilla.org/mozilla-central/rev/22b0680ca880
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
•