bug 1270795 - do not generate any background items in glyph path generating process;
MozReview-Commit-ID: GbhxyY93Vur
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -2401,16 +2401,20 @@ SetBackgroundClipRegion(DisplayListClipS
/*static*/ bool
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame,
const nsRect& aBackgroundRect,
nsDisplayList* aList,
bool aAllowWillPaintBorderOptimization)
{
+ if (aBuilder->IsForGenerateGlyphPath()) {
+ return true;
+ }
+
nsStyleContext* bgSC = nullptr;
const nsStyleBackground* bg = nullptr;
nsRect bgRect = aBackgroundRect + aBuilder->ToReferenceFrame(aFrame);
nsPresContext* presContext = aFrame->PresContext();
bool isThemed = aFrame->IsThemed();
if (!isThemed) {
bgSC = GetBackgroundStyleContext(aFrame);
if (bgSC) {
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -1885,20 +1885,16 @@ nsFrame::DisplayBorderBackgroundOutline(
{
// The visibility check belongs here since child elements have the
// opportunity to override the visibility property and display even if
// their parent is hidden.
if (!IsVisibleForPainting(aBuilder)) {
return;
}
- if (aBuilder->IsForGenerateGlyphPath()) {
- return;
- }
-
nsCSSShadowArray* shadows = StyleEffects()->mBoxShadow;
if (shadows && shadows->HasShadowWithInset(false)) {
aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayBoxShadowOuter(aBuilder, this));
}
bool bgIsThemed = DisplayBackgroundUnconditional(aBuilder, aLists,
aForceBackground);