mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-12 18:50:08 +00:00
Bug 1053035: Don't give <body> its own scroll frame, when it's styled as 'flex' or 'grid' and we've propagated its scrollability to the viewport. r=mats
This commit is contained in:
parent
aecd542da9
commit
4752030d6b
@ -4552,6 +4552,22 @@ nsCSSFrameConstructor::FindDisplayData(const nsStyleDisplay* aDisplay,
|
||||
return &sNonScrollableBlockData;
|
||||
}
|
||||
|
||||
// If this is for a <body> node and we've propagated the scroll-frame to the
|
||||
// viewport, we need to make sure not to add another layer of scrollbars, so
|
||||
// we use a different FCData struct without FCDATA_MAY_NEED_SCROLLFRAME.
|
||||
if (propagatedScrollToViewport && aDisplay->IsScrollableOverflow()) {
|
||||
if (aDisplay->mDisplay == NS_STYLE_DISPLAY_FLEX) {
|
||||
static const FrameConstructionData sNonScrollableFlexData =
|
||||
FCDATA_DECL(0, NS_NewFlexContainerFrame);
|
||||
return &sNonScrollableFlexData;
|
||||
}
|
||||
if (aDisplay->mDisplay == NS_STYLE_DISPLAY_GRID) {
|
||||
static const FrameConstructionData sNonScrollableGridData =
|
||||
FCDATA_DECL(0, NS_NewGridContainerFrame);
|
||||
return &sNonScrollableGridData;
|
||||
}
|
||||
}
|
||||
|
||||
static const FrameConstructionDataByInt sDisplayData[] = {
|
||||
// To keep the hash table small don't add inline frames (they're
|
||||
// typically things like FONT and B), because we can quickly
|
||||
|
17
layout/reftests/bugs/1053035-1-flex.html
Normal file
17
layout/reftests/bugs/1053035-1-flex.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
body {
|
||||
display: flex;
|
||||
background: yellow;
|
||||
overflow: scroll;
|
||||
border: 1px solid black;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
17
layout/reftests/bugs/1053035-1-grid.html
Normal file
17
layout/reftests/bugs/1053035-1-grid.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
body {
|
||||
display: grid;
|
||||
background: yellow;
|
||||
overflow: scroll;
|
||||
border: 1px solid black;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
17
layout/reftests/bugs/1053035-1-ref.html
Normal file
17
layout/reftests/bugs/1053035-1-ref.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
body {
|
||||
display: block;
|
||||
background: yellow;
|
||||
overflow: scroll;
|
||||
border: 1px solid black;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
@ -1821,3 +1821,5 @@ pref(browser.display.use_document_fonts,0) == 1022481-1.html 1022481-1-ref.html
|
||||
== 1042104-1.html 1042104-1-ref.html
|
||||
== 1044198-1.html 1044198-1-ref.html
|
||||
== 1049499-1.html 1049499-1-ref.html
|
||||
== 1053035-1-flex.html 1053035-1-ref.html
|
||||
test-pref(layout.css.grid.enabled,true) == 1053035-1-grid.html 1053035-1-ref.html
|
||||
|
Loading…
x
Reference in New Issue
Block a user