mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 866470 - Make the style context lookup in nsDisplayList match what nsCSSRendering does. r=roc
This commit is contained in:
parent
452720f8d7
commit
f46eb6a53e
@ -1606,6 +1606,29 @@ nsDisplayBackgroundImage::WriteDebugInfo(FILE *aOutput)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static nsStyleContext* GetBackgroundStyleContext(nsIFrame* aFrame)
|
||||||
|
{
|
||||||
|
nsStyleContext *sc;
|
||||||
|
if (!nsCSSRendering::FindBackground(aFrame, &sc)) {
|
||||||
|
// We don't want to bail out if moz-appearance is set on a root
|
||||||
|
// node. If it has a parent content node, bail because it's not
|
||||||
|
// a root, other wise keep going in order to let the theme stuff
|
||||||
|
// draw the background. The canvas really should be drawing the
|
||||||
|
// bg, but there's no way to hook that up via css.
|
||||||
|
if (!aFrame->StyleDisplay()->mAppearance) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsIContent* content = aFrame->GetContent();
|
||||||
|
if (!content || content->GetParent()) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
sc = aFrame->StyleContext();
|
||||||
|
}
|
||||||
|
return sc;
|
||||||
|
}
|
||||||
|
|
||||||
/*static*/ nsresult
|
/*static*/ nsresult
|
||||||
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuilder,
|
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuilder,
|
||||||
nsIFrame* aFrame,
|
nsIFrame* aFrame,
|
||||||
@ -1616,9 +1639,12 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
|
|||||||
const nsStyleBackground* bg = nullptr;
|
const nsStyleBackground* bg = nullptr;
|
||||||
nsPresContext* presContext = aFrame->PresContext();
|
nsPresContext* presContext = aFrame->PresContext();
|
||||||
bool isThemed = aFrame->IsThemed();
|
bool isThemed = aFrame->IsThemed();
|
||||||
if (!isThemed && nsCSSRendering::FindBackground(aFrame, &bgSC)) {
|
if (!isThemed) {
|
||||||
|
bgSC = GetBackgroundStyleContext(aFrame);
|
||||||
|
if (bgSC) {
|
||||||
bg = bgSC->StyleBackground();
|
bg = bgSC->StyleBackground();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool drawBackgroundColor = false;
|
bool drawBackgroundColor = false;
|
||||||
nscolor color;
|
nscolor color;
|
||||||
|
Loading…
Reference in New Issue
Block a user