Make "is block frame" check more nuanced, in nsHTMLScrollFrame::GetLogicalBaseline
Categories
(Core :: Layout: Scrolling and Overflow, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: dholbert, Assigned: dholbert)
References
Details
Attachments
(3 files)
STR:
- Load testcase
- Click to expand the details
EXPECTED RESULTS:
"aaa" should align with the border bottom (technically the margin bottom but there's no margin), both before and after it expands.
ACTUAL RESULTS:
"aaa" aligns with the baseline of the text inside the details frame (and with clipped text super-far-down, after it's expanded)
This is a followup to bug 969874 -- see bug 969874 comment 22. Emilio suggested that we want to use IsFrameOfType(eBlock) in nsHTMLScrollFrame::GetLogicalBaseline, and I think that's probably correct.
(The spec text around this isn't specific enough -- it says "if an inline-block is a scroll container" but that's not specific enough per https://github.com/w3c/csswg-drafts/issues/3611 )
Assignee | ||
Updated•6 years ago
|
Comment 1•6 years ago
|
||
Yeah, my bad, I should have spotted that. I think what we want to use
here is static_cast<nsBlockFrame*>(do_QueryFrame(...))
Assignee | ||
Comment 2•6 years ago
|
||
Any reason to prefer that method vs. emilio's suggestion of IsFrameOfType(eBlockFrame)
(i.e. would you object to IsFrameOfType(eBlockFrame)? That seems like a simpler/more direct way of asking the "is this a block" question, to me.)
Assignee | ||
Updated•6 years ago
|
Comment 3•6 years ago
|
||
It's faster in the common case (avoids the virtual call).
We should probably remove eBlockFrame now that do_QueryFrame
does this faster. I'm assuming no subclass opts out from
eBlockFrame and they actually are equivalent.
Assignee | ||
Comment 4•6 years ago
|
||
OK, thanks - yeah, I didn't recall for sure whether do_QueryFrame required a virtual call under the hood.
I might add a convenience member-function nsIFrame::IsBlockFrameOrSubclass() to encapsulate that check -- sound good? (name bikeshedding welcome)
Comment 5•6 years ago
|
||
Yeah, sounds good.
Assignee | ||
Comment 6•6 years ago
|
||
(Ah, right, do_QueryFrame is faster now as of bug 1364815.)
Assignee | ||
Comment 7•6 years ago
|
||
Assignee | ||
Comment 8•6 years ago
|
||
Depends on D19083
Assignee | ||
Comment 9•6 years ago
|
||
Comment 10•6 years ago
|
||
Comment 11•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/91eea845d54e
https://hg.mozilla.org/mozilla-central/rev/ee8803de7f47
Comment 14•6 years ago
|
||
I was late for bikeshedding ;) FWIW, we have nsLayoutUtils::GetAsBlock()
for similar purpose.
Comment 15•6 years ago
|
||
Yeah, I guess nsIFrame::GetAsBlock() could have worked too.
I think should remove the nsLayoutUtils method now though,
so we don't have two ways to do exactly the same thing.
Updated•6 years ago
|
Description
•