Closed
Bug 1232194
Opened 9 years ago
Closed 7 years ago
[writing-mode] GetConsumedBSize() should return block-size, not physical height
Categories
(Core :: Layout: Block and Inline, defect, P3)
Core
Layout: Block and Inline
Tracking
()
RESOLVED
FIXED
mozilla53
Tracking | Status | |
---|---|---|
firefox53 | --- | fixed |
People
(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 1 obsolete file)
1.93 KB,
patch
|
dholbert
:
review+
|
Details | Diff | Splinter Review |
9.54 KB,
patch
|
dholbert
:
review+
|
Details | Diff | Splinter Review |
This doesn't look right to me: http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsSplittableFrame.cpp#210 GetContentRectRelativeToSelf().height; is the physical height, right?
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → mats
OS: Unspecified → All
Priority: -- → P3
Hardware: Unspecified → All
Assignee | ||
Comment 1•7 years ago
|
||
I think we should drop the "Get" since it always returns a valid result, to follow the naming convention. This patch also adds a WritingMode param but does not change the behavior yet. That's the next patch...
Attachment #8823022 -
Flags: review?(dholbert)
Assignee | ||
Comment 2•7 years ago
|
||
I will add reftests in an upcoming bug, since we have more bugs in this area...
Attachment #8823023 -
Flags: review?(dholbert)
Assignee | ||
Comment 3•7 years ago
|
||
Sadly, these patches actually pass all current reftests: https://treeherder.mozilla.org/#/jobs?repo=try&revision=bf28d386b5f41310652429fef26faf5d44119334&exclusion_profile=false
Comment 4•7 years ago
|
||
(In reply to Mats Palmgren (:mats) from comment #0) > This doesn't look right to me: > http://mxr.mozilla.org/mozilla-central/source/layout/generic/ > nsSplittableFrame.cpp#210 > GetContentRectRelativeToSelf().height; is the physical height, right? Indeed it is, so this must be wrong, and our tests are inadequate. Thanks for picking this up!
Group: layout-core-security
Updated•7 years ago
|
Group: layout-core-security
Assignee | ||
Comment 5•7 years ago
|
||
(FYI, I'm adding a reftest in bug 1328095 that will fail without these patches.)
Comment 6•7 years ago
|
||
Comment on attachment 8823022 [details] [diff] [review] part 1 - [writing-mode] Drop "Get" from GetConsumedBSize() and add a WritingMode param. Review of attachment 8823022 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/generic/BlockReflowInput.cpp @@ +153,3 @@ > } > > return mConsumedBSize; This caching of |mConsumedBSize| means that you're implicitly expecting |aWM| to always be the same thing, in every call to this function. (If aWM varied from one call to the next, then the cached value would be bogus!!) This expectation is worth explicitly asserting & documenting, since it's different from how nsSplittableFrame::ConsumedBSize behaves. (That one is more forgiving/flexible, I think.) Or, we should just avoid introducing this variability. So -- please do one of the following -- EITHER: (1) Please add an assertion that aWM == mReflowInput.GetWritingMode() (I suspect that should be valid). And please mention this aWM expectation in the documentation in BlockReflowInput.h. ...OR, perhaps better: (2) Don't add the aWM arg to this particular function-signature, and instead just document that this function uses mReflowInput's WM. And adjust the mBlock->ConsumedBSize() function-call to pass in mReflowState->GetWritingMode(). Personally I lean towards option #2, particularly since this only has one caller: https://dxr.mozilla.org/mozilla-central/rev/c91249f41e3766274131a84f9157a4d9d9949520/layout/generic/nsBlockFrame.cpp#1630-1631 ...and it's indeed correct to use the BlockReflowInput's mReflowState.GetWritingMode() as its writing mode, for that caller. Your patch currently adjusts that caller to pass "wm", which is declared here as aState.mReflowInput.GetWritingMode(): https://dxr.mozilla.org/mozilla-central/rev/c91249f41e3766274131a84f9157a4d9d9949520/layout/generic/nsBlockFrame.cpp#1549 ::: layout/generic/nsBlockFrame.cpp @@ +1622,5 @@ > finalSize.BSize(wm) = std::max(aReflowInput.AvailableBSize(), > aState.mBCoord + nonCarriedOutBDirMargin); > // ... but don't take up more block size than is available > nscoord effectiveComputedBSize = > + GetEffectiveComputedBSize(aReflowInput, aState.ConsumedBSize(wm)); (If you choose option #2 for my note BlockReflowInput notes above, then your patch won't need to modify this line.)
Comment 7•7 years ago
|
||
To be clear (since Splinter doesn't show enough context), the previous comment is entirely about BlockReflowInput::ConsumedBSize(), which is completely separate from the nsSplittableFrame function of the same name.
Assignee | ||
Comment 8•7 years ago
|
||
I agree option #2 seems better; no need for flexibility here, the purpose of this method is just to coalesce calls that should yield the same value.
Attachment #8823022 -
Attachment is obsolete: true
Attachment #8823022 -
Flags: review?(dholbert)
Attachment #8823404 -
Flags: review?(dholbert)
Comment 9•7 years ago
|
||
Comment on attachment 8823404 [details] [diff] [review] part 1 - [writing-mode] Drop "Get" from GetConsumedBSize() and add a WritingMode param. Review of attachment 8823404 [details] [diff] [review]: ----------------------------------------------------------------- Thanks! r=me
Attachment #8823404 -
Flags: review?(dholbert) → review+
Comment 10•7 years ago
|
||
Comment on attachment 8823023 [details] [diff] [review] part 2 - [writing-mode] Make ConsumedBSize() return the block-axis size, not the physical height. Review of attachment 8823023 [details] [diff] [review]: ----------------------------------------------------------------- r=me
Attachment #8823023 -
Flags: review?(dholbert) → review+
Comment 11•7 years ago
|
||
Pushed by mpalmgren@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/bcbf5734ae38 part 1 - [writing-mode] Drop "Get" from GetConsumedBSize() and add a WritingMode param. r=dholbert https://hg.mozilla.org/integration/mozilla-inbound/rev/efad45adb8c4 part 2 - [writing-mode] Make ConsumedBSize() return the block-axis size, not the physical height. r=dholbert
Assignee | ||
Comment 12•7 years ago
|
||
(the reftest in bug 1328095 covers this bug too)
Flags: in-testsuite+
Comment 13•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/bcbf5734ae38 https://hg.mozilla.org/mozilla-central/rev/efad45adb8c4
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox53:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in
before you can comment on or make changes to this bug.
Description
•