mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1230466. Make sure to update our scrollbar styles when a <body> is removed from the DOM, since we might now need to propagate from some other element. r=roc
This commit is contained in:
parent
7891e4b101
commit
76d78ff09a
@ -7895,6 +7895,13 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
|
||||
*aDestroyedFramesFor = aChild;
|
||||
}
|
||||
|
||||
if (aChild->IsHTMLElement(nsGkAtoms::body) ||
|
||||
(!aContainer && aChild->IsElement())) {
|
||||
// This might be the element we propagated viewport scrollbar
|
||||
// styles from. Recompute those.
|
||||
mPresShell->GetPresContext()->UpdateViewportScrollbarStylesOverride();
|
||||
}
|
||||
|
||||
// XXXldb Do we need to re-resolve style to handle the CSS2 + combinator and
|
||||
// the :empty pseudo-class?
|
||||
|
||||
|
@ -1634,6 +1634,11 @@ GetPropagatedScrollbarStylesForViewport(nsPresContext* aPresContext,
|
||||
nsIDocument* document = aPresContext->Document();
|
||||
Element* docElement = document->GetRootElement();
|
||||
|
||||
// docElement might be null if we're doing this after removing it.
|
||||
if (!docElement) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Check the style on the document root element
|
||||
nsStyleSet *styleSet = aPresContext->StyleSet();
|
||||
RefPtr<nsStyleContext> rootStyle;
|
||||
|
12
layout/reftests/bugs/1230466.html
Normal file
12
layout/reftests/bugs/1230466.html
Normal file
@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<script>
|
||||
var b = document.createElement("body");
|
||||
b.style.overflow = "scroll";
|
||||
var h = document.documentElement;
|
||||
h.insertBefore(b, h.firstChild);
|
||||
b.offsetWidth;
|
||||
b.remove();
|
||||
</script>
|
||||
</html>
|
@ -1943,3 +1943,4 @@ fuzzy(1,74) fuzzy-if(gtkWidget,6,79) == 1174332-1.html 1174332-1-ref.html
|
||||
== 1209994-4.html 1209994-4-ref.html
|
||||
== 1222226-1.html 1222226-1-ref.html
|
||||
pref(layout.css.overflow-clip-box.enabled,true) == 1226278.html 1226278-ref.html
|
||||
== 1230466.html about:blank
|
||||
|
Loading…
Reference in New Issue
Block a user