Skip to content

Commit

Permalink
Bug 969874: Make scrollable frames derive their baseline from their s…
Browse files Browse the repository at this point in the history
…crolled content (unless their display value is block-inside). r=mats

Before this patch, we made scrollable frames derive their baseline from their
margin-box, because that's what the spec requires for scrollable inline-block
boxes. However, the spec now singles out inline-block as a special case, and
other sorts of scrollable inline-level containers are supposed to derive their
baseline from the scrolled content. So, this patch makes us do that, with an
exception for scrollable inline-block boxes.

For more info about the block-inside special case, see the end of the "block
containers" chunk here: https://drafts.csswg.org/css-align/#baseline-export
(Though that spec text may be a bit too specific, per my spec issue at
w3c/csswg-drafts#3611 -- that's why this patch checks
for block-inside rather than inline-block.)

Differential Revision: https://phabricator.services.mozilla.com/D18481

UltraBlame original commit: 21b74260c8a9fcc8c35ffafc2f98254753fe8d7a
  • Loading branch information
marco-c committed Oct 3, 2019
1 parent ba386d9 commit 371645c
Show file tree
Hide file tree
Showing 5 changed files with 1,523 additions and 0 deletions.
212 changes: 212 additions & 0 deletions layout/generic/nsGfxScrollFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7463,6 +7463,218 @@ GetScrollableOverflowRectRelativeToParent
}
}
}
nscoord
nsHTMLScrollFrame
:
:
GetLogicalBaseline
(
WritingMode
aWritingMode
)
const
{
/
/
This
function
implements
some
of
the
spec
text
here
:
/
/
https
:
/
/
drafts
.
csswg
.
org
/
css
-
align
/
#
baseline
-
export
/
/
/
/
Specifically
:
if
our
scrolled
frame
is
a
block
we
just
use
the
inherited
/
/
GetLogicalBaseline
(
)
impl
which
synthesizes
a
baseline
from
the
/
/
margin
-
box
.
Otherwise
we
defer
to
our
scrolled
frame
considering
it
/
/
to
be
scrolled
to
its
initial
scroll
position
.
if
(
mHelper
.
mScrolledFrame
-
>
IsBlockFrame
(
)
)
{
return
nsContainerFrame
:
:
GetLogicalBaseline
(
aWritingMode
)
;
}
/
/
OK
here
'
s
where
we
defer
to
our
scrolled
frame
.
We
have
to
add
our
/
/
border
BStart
thickness
to
whatever
it
returns
to
produce
an
offset
in
/
/
our
frame
-
rect
'
s
coordinate
system
.
(
We
don
'
t
have
to
add
padding
/
/
because
the
scrolled
frame
handles
our
padding
.
)
LogicalMargin
border
=
GetLogicalUsedBorder
(
aWritingMode
)
;
return
border
.
BStart
(
aWritingMode
)
+
mHelper
.
mScrolledFrame
-
>
GetLogicalBaseline
(
aWritingMode
)
;
}
void
nsHTMLScrollFrame
:
Expand Down
12 changes: 12 additions & 0 deletions layout/generic/nsGfxScrollFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -5238,6 +5238,18 @@ aOverflowAreas
)
;
}
nscoord
GetLogicalBaseline
(
mozilla
:
:
WritingMode
aWritingMode
)
const
override
;
bool
GetVerticalAlignBaseline
(
Expand Down
Loading

0 comments on commit 371645c

Please sign in to comment.