mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Back out c95958e3b85d and e8a8bf41e0c4 (bug 798964) for Android reftest-4 failures
This commit is contained in:
parent
b4416e2c2d
commit
aad1519dae
@ -162,10 +162,6 @@ protected:
|
||||
{
|
||||
NS_PRECONDITION(aFrame, "Need a frame");
|
||||
|
||||
if (aFrame == mFrame) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsIFrame *prevContinuation = GetPrevContinuation(aFrame);
|
||||
|
||||
if (!prevContinuation || mFrame != prevContinuation) {
|
||||
@ -225,19 +221,6 @@ protected:
|
||||
|
||||
void Init(nsIFrame* aFrame)
|
||||
{
|
||||
mBidiEnabled = aFrame->PresContext()->BidiEnabled();
|
||||
if (mBidiEnabled) {
|
||||
// Find the containing block frame
|
||||
nsIFrame* frame = aFrame;
|
||||
do {
|
||||
frame = frame->GetParent();
|
||||
mBlockFrame = do_QueryFrame(frame);
|
||||
}
|
||||
while (frame && frame->IsFrameOfType(nsIFrame::eLineParticipant));
|
||||
|
||||
NS_ASSERTION(mBlockFrame, "Cannot find containing block.");
|
||||
}
|
||||
|
||||
// Start with the previous flow frame as our continuation point
|
||||
// is the total of the widths of the previous frames.
|
||||
nsIFrame* inlineFrame = GetPrevContinuation(aFrame);
|
||||
@ -245,9 +228,6 @@ protected:
|
||||
while (inlineFrame) {
|
||||
nsRect rect = inlineFrame->GetRect();
|
||||
mContinuationPoint += rect.width;
|
||||
if (mBidiEnabled && !AreOnSameLine(aFrame, inlineFrame)) {
|
||||
mLineContinuationPoint += rect.width;
|
||||
}
|
||||
mUnbrokenWidth += rect.width;
|
||||
mBoundingBox.UnionRect(mBoundingBox, rect);
|
||||
inlineFrame = GetPrevContinuation(inlineFrame);
|
||||
@ -264,6 +244,21 @@ protected:
|
||||
}
|
||||
|
||||
mFrame = aFrame;
|
||||
|
||||
mBidiEnabled = aFrame->PresContext()->BidiEnabled();
|
||||
if (mBidiEnabled) {
|
||||
// Find the containing block frame
|
||||
nsIFrame* frame = aFrame;
|
||||
do {
|
||||
frame = frame->GetParent();
|
||||
mBlockFrame = do_QueryFrame(frame);
|
||||
}
|
||||
while (frame && frame->IsFrameOfType(nsIFrame::eLineParticipant));
|
||||
|
||||
NS_ASSERTION(mBlockFrame, "Cannot find containing block.");
|
||||
|
||||
mLineContinuationPoint = mContinuationPoint;
|
||||
}
|
||||
}
|
||||
|
||||
bool AreOnSameLine(nsIFrame* aFrame1, nsIFrame* aFrame2) {
|
||||
@ -1510,7 +1505,7 @@ nsCSSRendering::PaintBackground(nsPresContext* aPresContext,
|
||||
if (!FindBackground(aPresContext, aForFrame, &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, otherwise keep going in order to let the theme stuff
|
||||
// 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 (!aForFrame->GetStyleDisplay()->mAppearance) {
|
||||
@ -1531,42 +1526,6 @@ nsCSSRendering::PaintBackground(nsPresContext* aPresContext,
|
||||
aBGClipRect, aLayer);
|
||||
}
|
||||
|
||||
void
|
||||
nsCSSRendering::PaintBackgroundColor(nsPresContext* aPresContext,
|
||||
nsRenderingContext& aRenderingContext,
|
||||
nsIFrame* aForFrame,
|
||||
const nsRect& aDirtyRect,
|
||||
const nsRect& aBorderArea,
|
||||
uint32_t aFlags)
|
||||
{
|
||||
SAMPLE_LABEL("nsCSSRendering", "PaintBackgroundColor");
|
||||
NS_PRECONDITION(aForFrame,
|
||||
"Frame is expected to be provided to PaintBackground");
|
||||
|
||||
nsStyleContext *sc;
|
||||
if (!FindBackground(aPresContext, aForFrame, &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 (!aForFrame->GetStyleDisplay()->mAppearance) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsIContent* content = aForFrame->GetContent();
|
||||
if (!content || content->GetParent()) {
|
||||
return;
|
||||
}
|
||||
|
||||
sc = aForFrame->GetStyleContext();
|
||||
}
|
||||
|
||||
PaintBackgroundColorWithSC(aPresContext, aRenderingContext, aForFrame,
|
||||
aDirtyRect, aBorderArea, sc,
|
||||
*aForFrame->GetStyleBorder(), aFlags);
|
||||
}
|
||||
|
||||
static bool
|
||||
IsOpaqueBorderEdge(const nsStyleBorder& aBorder, mozilla::css::Side aSide)
|
||||
{
|
||||
@ -2445,10 +2404,11 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
|
||||
drawBackgroundImage,
|
||||
drawBackgroundColor);
|
||||
|
||||
// If we're drawing a specific layer, we don't want to draw the
|
||||
// If we're not drawing the back-most layer, we don't want to draw the
|
||||
// background color.
|
||||
const nsStyleBackground *bg = aBackgroundSC->GetStyleBackground();
|
||||
if (drawBackgroundColor && aLayer >= 0) {
|
||||
if (drawBackgroundColor && aLayer >= 0 &&
|
||||
static_cast<uint32_t>(aLayer) != bg->mImageCount - 1) {
|
||||
drawBackgroundColor = false;
|
||||
}
|
||||
|
||||
@ -2609,99 +2569,6 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsCSSRendering::PaintBackgroundColorWithSC(nsPresContext* aPresContext,
|
||||
nsRenderingContext& aRenderingContext,
|
||||
nsIFrame* aForFrame,
|
||||
const nsRect& aDirtyRect,
|
||||
const nsRect& aBorderArea,
|
||||
nsStyleContext* aBackgroundSC,
|
||||
const nsStyleBorder& aBorder,
|
||||
uint32_t aFlags)
|
||||
{
|
||||
NS_PRECONDITION(aForFrame,
|
||||
"Frame is expected to be provided to PaintBackground");
|
||||
|
||||
// Check to see if we have an appearance defined. If so, we let the theme
|
||||
// renderer draw the background and bail out.
|
||||
const nsStyleDisplay* displayData = aForFrame->GetStyleDisplay();
|
||||
if (displayData->mAppearance) {
|
||||
nsITheme *theme = aPresContext->GetTheme();
|
||||
if (theme && theme->ThemeSupportsWidget(aPresContext, aForFrame,
|
||||
displayData->mAppearance)) {
|
||||
NS_ERROR("Shouldn't be trying to paint a background color if we are themed!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
NS_ASSERTION(!IsCanvasFrame(aForFrame), "Should not be trying to paint a background color for canvas frames!");
|
||||
|
||||
// Determine whether we are drawing background images and/or
|
||||
// background colors.
|
||||
bool drawBackgroundImage;
|
||||
bool drawBackgroundColor;
|
||||
|
||||
nscolor bgColor = DetermineBackgroundColor(aPresContext,
|
||||
aBackgroundSC,
|
||||
aForFrame,
|
||||
drawBackgroundImage,
|
||||
drawBackgroundColor);
|
||||
|
||||
NS_ASSERTION(drawBackgroundColor, "Should not be trying to paint a background color if we don't have one");
|
||||
|
||||
// Compute the outermost boundary of the area that might be painted.
|
||||
gfxContext *ctx = aRenderingContext.ThebesContext();
|
||||
nscoord appUnitsPerPixel = aPresContext->AppUnitsPerDevPixel();
|
||||
|
||||
// Same coordinate space as aBorderArea
|
||||
gfxCornerSizes bgRadii;
|
||||
bool haveRoundedCorners;
|
||||
{
|
||||
nscoord radii[8];
|
||||
nsSize frameSize = aForFrame->GetSize();
|
||||
if (&aBorder == aForFrame->GetStyleBorder() &&
|
||||
frameSize == aBorderArea.Size()) {
|
||||
haveRoundedCorners = aForFrame->GetBorderRadii(radii);
|
||||
} else {
|
||||
haveRoundedCorners = nsIFrame::ComputeBorderRadii(aBorder.mBorderRadius,
|
||||
frameSize, aBorderArea.Size(),
|
||||
aForFrame->GetSkipSides(), radii);
|
||||
}
|
||||
if (haveRoundedCorners)
|
||||
ComputePixelRadii(radii, appUnitsPerPixel, &bgRadii);
|
||||
}
|
||||
|
||||
// The background is rendered over the 'background-clip' area,
|
||||
// which is normally equal to the border area but may be reduced
|
||||
// to the padding area by CSS. Also, if the border is solid, we
|
||||
// don't need to draw outside the padding area. In either case,
|
||||
// if the borders are rounded, make sure we use the same inner
|
||||
// radii as the border code will.
|
||||
// The background-color is drawn based on the bottom
|
||||
// background-clip.
|
||||
const nsStyleBackground *bg = aBackgroundSC->GetStyleBackground();
|
||||
uint8_t currentBackgroundClip = bg->BottomLayer().mClip;
|
||||
bool isSolidBorder =
|
||||
(aFlags & PAINTBG_WILL_PAINT_BORDER) && IsOpaqueBorder(aBorder);
|
||||
if (isSolidBorder && currentBackgroundClip == NS_STYLE_BG_CLIP_BORDER) {
|
||||
// If we have rounded corners, we need to inflate the background
|
||||
// drawing area a bit to avoid seams between the border and
|
||||
// background.
|
||||
currentBackgroundClip = haveRoundedCorners ?
|
||||
NS_STYLE_BG_CLIP_MOZ_ALMOST_PADDING : NS_STYLE_BG_CLIP_PADDING;
|
||||
}
|
||||
|
||||
BackgroundClipState clipState;
|
||||
GetBackgroundClip(ctx, currentBackgroundClip, aForFrame, aBorderArea,
|
||||
aDirtyRect, haveRoundedCorners, bgRadii, appUnitsPerPixel,
|
||||
&clipState);
|
||||
|
||||
ctx->SetColor(gfxRGBA(bgColor));
|
||||
|
||||
gfxContextAutoSaveRestore autoSR;
|
||||
DrawBackgroundColor(clipState, ctx, haveRoundedCorners, appUnitsPerPixel);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
IsTransformed(nsIFrame* aForFrame, nsIFrame* aTopFrame)
|
||||
{
|
||||
|
@ -337,13 +337,6 @@ struct nsCSSRendering {
|
||||
uint32_t aFlags,
|
||||
nsRect* aBGClipRect = nullptr,
|
||||
int32_t aLayer = -1);
|
||||
|
||||
static void PaintBackgroundColor(nsPresContext* aPresContext,
|
||||
nsRenderingContext& aRenderingContext,
|
||||
nsIFrame* aForFrame,
|
||||
const nsRect& aDirtyRect,
|
||||
const nsRect& aBorderArea,
|
||||
uint32_t aFlags);
|
||||
|
||||
/**
|
||||
* Same as |PaintBackground|, except using the provided style structs.
|
||||
@ -365,14 +358,6 @@ struct nsCSSRendering {
|
||||
nsRect* aBGClipRect = nullptr,
|
||||
int32_t aLayer = -1);
|
||||
|
||||
static void PaintBackgroundColorWithSC(nsPresContext* aPresContext,
|
||||
nsRenderingContext& aRenderingContext,
|
||||
nsIFrame* aForFrame,
|
||||
const nsRect& aDirtyRect,
|
||||
const nsRect& aBorderArea,
|
||||
nsStyleContext *aStyleContext,
|
||||
const nsStyleBorder& aBorder,
|
||||
uint32_t aFlags);
|
||||
/**
|
||||
* Returns the rectangle covered by the given background layer image, taking
|
||||
* into account background positioning, sizing, and repetition, but not
|
||||
|
@ -1,6 +1,5 @@
|
||||
DECLARE_DISPLAY_ITEM_TYPE(ALT_FEEDBACK)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(BACKGROUND)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(BACKGROUND_COLOR)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(BORDER)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(BOX_SHADOW_OUTER)
|
||||
DECLARE_DISPLAY_ITEM_TYPE(BOX_SHADOW_INNER)
|
||||
|
@ -1531,7 +1531,7 @@ nsDisplayBackground::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuilder,
|
||||
nsDisplayList* aList,
|
||||
nsDisplayBackground** aBackground)
|
||||
{
|
||||
nsStyleContext* bgSC = nullptr;
|
||||
nsStyleContext* bgSC;
|
||||
const nsStyleBackground* bg = nullptr;
|
||||
nsPresContext* presContext = aFrame->PresContext();
|
||||
if (!aFrame->IsThemed() &&
|
||||
@ -1539,21 +1539,6 @@ nsDisplayBackground::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuilder,
|
||||
bg = bgSC->GetStyleBackground();
|
||||
}
|
||||
|
||||
bool drawBackgroundColor = false;
|
||||
nscolor color;
|
||||
if (!nsCSSRendering::IsCanvasFrame(aFrame) && bg) {
|
||||
bool drawBackgroundImage;
|
||||
color =
|
||||
nsCSSRendering::DetermineBackgroundColor(presContext, bgSC, aFrame,
|
||||
drawBackgroundImage, drawBackgroundColor);
|
||||
}
|
||||
|
||||
// Even if we don't actually have a background color to paint, we still need
|
||||
// to create the item because it's used for hit testing.
|
||||
aList->AppendNewToTop(
|
||||
new (aBuilder) nsDisplayBackgroundColor(aBuilder, aFrame,
|
||||
drawBackgroundColor ? color : NS_RGBA(0, 0, 0, 0)));
|
||||
|
||||
// Passing bg == nullptr in this macro will result in one iteration with
|
||||
// i = 0.
|
||||
bool backgroundSet = !aBackground;
|
||||
@ -1894,9 +1879,8 @@ nsDisplayBackground::ComputeVisibility(nsDisplayListBuilder* aBuilder,
|
||||
nsCSSRendering::FindBackground(mFrame->PresContext(), mFrame, &bgSC);
|
||||
}
|
||||
|
||||
/* static */ nsRegion
|
||||
nsDisplayBackground::GetInsideClipRegion(nsDisplayItem* aItem,
|
||||
nsPresContext* aPresContext,
|
||||
nsRegion
|
||||
nsDisplayBackground::GetInsideClipRegion(nsPresContext* aPresContext,
|
||||
uint8_t aClip, const nsRect& aRect,
|
||||
bool* aSnap)
|
||||
{
|
||||
@ -1904,23 +1888,21 @@ nsDisplayBackground::GetInsideClipRegion(nsDisplayItem* aItem,
|
||||
if (aRect.IsEmpty())
|
||||
return result;
|
||||
|
||||
nsIFrame *frame = aItem->GetUnderlyingFrame();
|
||||
|
||||
nscoord radii[8];
|
||||
nsRect clipRect;
|
||||
bool haveRadii;
|
||||
switch (aClip) {
|
||||
case NS_STYLE_BG_CLIP_BORDER:
|
||||
haveRadii = frame->GetBorderRadii(radii);
|
||||
clipRect = nsRect(aItem->ToReferenceFrame(), frame->GetSize());
|
||||
haveRadii = mFrame->GetBorderRadii(radii);
|
||||
clipRect = nsRect(ToReferenceFrame(), mFrame->GetSize());
|
||||
break;
|
||||
case NS_STYLE_BG_CLIP_PADDING:
|
||||
haveRadii = frame->GetPaddingBoxBorderRadii(radii);
|
||||
clipRect = frame->GetPaddingRect() - frame->GetPosition() + aItem->ToReferenceFrame();
|
||||
haveRadii = mFrame->GetPaddingBoxBorderRadii(radii);
|
||||
clipRect = mFrame->GetPaddingRect() - mFrame->GetPosition() + ToReferenceFrame();
|
||||
break;
|
||||
case NS_STYLE_BG_CLIP_CONTENT:
|
||||
haveRadii = frame->GetContentBoxBorderRadii(radii);
|
||||
clipRect = frame->GetContentRect() - frame->GetPosition() + aItem->ToReferenceFrame();
|
||||
haveRadii = mFrame->GetContentBoxBorderRadii(radii);
|
||||
clipRect = mFrame->GetContentRect() - mFrame->GetPosition() + ToReferenceFrame();
|
||||
break;
|
||||
default:
|
||||
NS_NOTREACHED("Unknown clip type");
|
||||
@ -1954,9 +1936,16 @@ nsDisplayBackground::GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
|
||||
if (!nsCSSRendering::FindBackground(presContext, mFrame, &bgSC))
|
||||
return result;
|
||||
const nsStyleBackground* bg = bgSC->GetStyleBackground();
|
||||
const nsStyleBackground::Layer& bottomLayer = bg->BottomLayer();
|
||||
|
||||
*aSnap = true;
|
||||
|
||||
nsRect borderBox = nsRect(ToReferenceFrame(), mFrame->GetSize());
|
||||
if (mIsBottommostLayer && NS_GET_A(bg->mBackgroundColor) == 255 &&
|
||||
!nsCSSRendering::IsCanvasFrame(mFrame)) {
|
||||
result = GetInsideClipRegion(presContext, bottomLayer.mClip, borderBox, aSnap);
|
||||
}
|
||||
|
||||
// For policies other than EACH_BOX, don't try to optimize here, since
|
||||
// this could easily lead to O(N^2) behavior inside InlineBackgroundData,
|
||||
// which expects frames to be sent to it in content order, not reverse
|
||||
@ -1966,10 +1955,9 @@ nsDisplayBackground::GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
|
||||
(!mFrame->GetPrevContinuation() && !mFrame->GetNextContinuation())) {
|
||||
const nsStyleBackground::Layer& layer = bg->mLayers[mLayer];
|
||||
if (layer.mImage.IsOpaque()) {
|
||||
nsRect borderBox = nsRect(ToReferenceFrame(), mFrame->GetSize());
|
||||
nsRect r = nsCSSRendering::GetBackgroundLayerRect(presContext, mFrame,
|
||||
borderBox, *bg, layer);
|
||||
result.Or(result, GetInsideClipRegion(this, presContext, layer.mClip, r, aSnap));
|
||||
result.Or(result, GetInsideClipRegion(presContext, layer.mClip, r, aSnap));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2058,9 +2046,11 @@ nsDisplayBackground::RenderingMightDependOnFrameSize()
|
||||
return false;
|
||||
const nsStyleBackground* bg = bgSC->GetStyleBackground();
|
||||
|
||||
const nsStyleBackground::Layer &layer = bg->mLayers[mLayer];
|
||||
if (layer.RenderingMightDependOnFrameSize()) {
|
||||
return true;
|
||||
NS_FOR_VISIBLE_BACKGROUND_LAYERS_BACK_TO_FRONT(i, bg) {
|
||||
const nsStyleBackground::Layer &layer = bg->mLayers[i];
|
||||
if (layer.RenderingMightDependOnFrameSize()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -2071,26 +2061,17 @@ nsDisplayBackground::ShouldFixToViewport(nsDisplayListBuilder* aBuilder)
|
||||
return mIsFixed;
|
||||
}
|
||||
|
||||
static void CheckForBorderItem(nsDisplayItem *aItem, uint32_t& aFlags)
|
||||
{
|
||||
nsDisplayItem* nextItem = aItem->GetAbove();
|
||||
while (nextItem && nextItem->GetType() == nsDisplayItem::TYPE_BACKGROUND) {
|
||||
nextItem = nextItem->GetAbove();
|
||||
}
|
||||
if (nextItem &&
|
||||
nextItem->GetUnderlyingFrame() == aItem->GetUnderlyingFrame() &&
|
||||
nextItem->GetType() == nsDisplayItem::TYPE_BORDER) {
|
||||
aFlags |= nsCSSRendering::PAINTBG_WILL_PAINT_BORDER;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsDisplayBackground::Paint(nsDisplayListBuilder* aBuilder,
|
||||
nsRenderingContext* aCtx) {
|
||||
|
||||
nsPoint offset = ToReferenceFrame();
|
||||
uint32_t flags = aBuilder->GetBackgroundPaintFlags();
|
||||
CheckForBorderItem(this, flags);
|
||||
nsDisplayItem* nextItem = GetAbove();
|
||||
if (nextItem && nextItem->GetUnderlyingFrame() == mFrame &&
|
||||
nextItem->GetType() == TYPE_BORDER) {
|
||||
flags |= nsCSSRendering::PAINTBG_WILL_PAINT_BORDER;
|
||||
}
|
||||
nsCSSRendering::PaintBackground(mFrame->PresContext(), *aCtx, mFrame,
|
||||
mVisibleRect,
|
||||
nsRect(offset, mFrame->GetSize()),
|
||||
@ -2121,11 +2102,10 @@ void nsDisplayBackground::ComputeInvalidationRegion(nsDisplayListBuilder* aBuild
|
||||
|
||||
nsRect
|
||||
nsDisplayBackground::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) {
|
||||
*aSnap = true;
|
||||
nsRect r(nsPoint(0,0), mFrame->GetSize());
|
||||
nsPresContext* presContext = mFrame->PresContext();
|
||||
|
||||
if (mIsThemed) {
|
||||
nsRect r(nsPoint(0,0), mFrame->GetSize());
|
||||
presContext->GetTheme()->
|
||||
GetWidgetOverflow(presContext->DeviceContext(), mFrame,
|
||||
mFrame->GetStyleDisplay()->mAppearance, &r);
|
||||
@ -2133,20 +2113,10 @@ nsDisplayBackground::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) {
|
||||
// Bug 748219
|
||||
r.Inflate(mFrame->PresContext()->AppUnitsPerDevPixel());
|
||||
#endif
|
||||
|
||||
return r + ToReferenceFrame();
|
||||
}
|
||||
|
||||
nsStyleContext* bgSC;
|
||||
if (!nsCSSRendering::FindBackground(presContext, mFrame, &bgSC)) {
|
||||
return nsRect();
|
||||
}
|
||||
|
||||
const nsStyleBackground* bg = bgSC->GetStyleBackground();
|
||||
nsRect borderBox = nsRect(ToReferenceFrame(), mFrame->GetSize());
|
||||
const nsStyleBackground::Layer& layer = bg->mLayers[mLayer];
|
||||
return nsCSSRendering::GetBackgroundLayerRect(presContext, mFrame,
|
||||
borderBox, *bg, layer);
|
||||
*aSnap = true;
|
||||
return r + ToReferenceFrame();
|
||||
}
|
||||
|
||||
uint32_t
|
||||
@ -2156,72 +2126,6 @@ nsDisplayBackground::GetPerFrameKey()
|
||||
nsDisplayItem::GetPerFrameKey();
|
||||
}
|
||||
|
||||
void
|
||||
nsDisplayBackgroundColor::Paint(nsDisplayListBuilder* aBuilder,
|
||||
nsRenderingContext* aCtx)
|
||||
{
|
||||
if (mColor == NS_RGBA(0, 0, 0, 0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsPoint offset = ToReferenceFrame();
|
||||
uint32_t flags = aBuilder->GetBackgroundPaintFlags();
|
||||
CheckForBorderItem(this, flags);
|
||||
nsCSSRendering::PaintBackgroundColor(mFrame->PresContext(), *aCtx, mFrame,
|
||||
mVisibleRect,
|
||||
nsRect(offset, mFrame->GetSize()),
|
||||
flags);
|
||||
}
|
||||
|
||||
nsRegion
|
||||
nsDisplayBackgroundColor::GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
|
||||
bool* aSnap)
|
||||
{
|
||||
if (NS_GET_A(mColor) != 255) {
|
||||
return nsRegion();
|
||||
}
|
||||
|
||||
nsStyleContext* bgSC;
|
||||
nsPresContext* presContext = mFrame->PresContext();
|
||||
if (!nsCSSRendering::FindBackground(presContext, mFrame, &bgSC))
|
||||
return nsRegion();
|
||||
const nsStyleBackground* bg = bgSC->GetStyleBackground();
|
||||
const nsStyleBackground::Layer& bottomLayer = bg->BottomLayer();
|
||||
|
||||
*aSnap = true;
|
||||
|
||||
nsRect borderBox = nsRect(ToReferenceFrame(), mFrame->GetSize());
|
||||
return nsDisplayBackground::GetInsideClipRegion(this, presContext, bottomLayer.mClip, borderBox, aSnap);
|
||||
}
|
||||
|
||||
bool
|
||||
nsDisplayBackgroundColor::IsUniform(nsDisplayListBuilder* aBuilder, nscolor* aColor)
|
||||
{
|
||||
*aColor = mColor;
|
||||
nsStyleContext* bgSC;
|
||||
nsPresContext* presContext = mFrame->PresContext();
|
||||
if (!nsCSSRendering::FindBackground(presContext, mFrame, &bgSC))
|
||||
return true;
|
||||
|
||||
const nsStyleBackground* bg = bgSC->GetStyleBackground();
|
||||
return (!nsLayoutUtils::HasNonZeroCorner(mFrame->GetStyleBorder()->mBorderRadius) &&
|
||||
bg->BottomLayer().mClip == NS_STYLE_BG_CLIP_BORDER);
|
||||
}
|
||||
|
||||
void
|
||||
nsDisplayBackgroundColor::HitTest(nsDisplayListBuilder* aBuilder,
|
||||
const nsRect& aRect,
|
||||
HitTestState* aState,
|
||||
nsTArray<nsIFrame*> *aOutFrames)
|
||||
{
|
||||
if (!RoundedBorderIntersectsRect(mFrame, ToReferenceFrame(), aRect)) {
|
||||
// aRect doesn't intersect our border-radius curve.
|
||||
return;
|
||||
}
|
||||
|
||||
aOutFrames->AppendElement(mFrame);
|
||||
}
|
||||
|
||||
nsRect
|
||||
nsDisplayOutline::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) {
|
||||
*aSnap = false;
|
||||
|
@ -1834,12 +1834,12 @@ public:
|
||||
const nsDisplayItemGeometry* aGeometry,
|
||||
nsRegion* aInvalidRegion);
|
||||
|
||||
static nsRegion GetInsideClipRegion(nsDisplayItem* aItem, nsPresContext* aPresContext, uint8_t aClip,
|
||||
const nsRect& aRect, bool* aSnap);
|
||||
protected:
|
||||
typedef class mozilla::layers::ImageContainer ImageContainer;
|
||||
typedef class mozilla::layers::ImageLayer ImageLayer;
|
||||
|
||||
nsRegion GetInsideClipRegion(nsPresContext* aPresContext, uint8_t aClip,
|
||||
const nsRect& aRect, bool* aSnap);
|
||||
|
||||
bool TryOptimizeToImageLayer(nsDisplayListBuilder* aBuilder);
|
||||
bool IsSingleFixedPositionImage(nsDisplayListBuilder* aBuilder, const nsRect& aClipRect);
|
||||
@ -1860,27 +1860,6 @@ protected:
|
||||
uint32_t mLayer;
|
||||
};
|
||||
|
||||
class nsDisplayBackgroundColor : public nsDisplayItem
|
||||
{
|
||||
public:
|
||||
nsDisplayBackgroundColor(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, nscolor aColor)
|
||||
: nsDisplayItem(aBuilder, aFrame)
|
||||
, mColor(aColor)
|
||||
{ }
|
||||
|
||||
virtual void Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
|
||||
bool* aSnap) MOZ_OVERRIDE;
|
||||
virtual bool IsUniform(nsDisplayListBuilder* aBuilder, nscolor* aColor) MOZ_OVERRIDE;
|
||||
virtual void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
|
||||
HitTestState* aState, nsTArray<nsIFrame*> *aOutFrames) MOZ_OVERRIDE;
|
||||
|
||||
NS_DISPLAY_DECL_NAME("BackgroundColor", TYPE_BACKGROUND_COLOR)
|
||||
|
||||
nscolor mColor;
|
||||
};
|
||||
|
||||
/**
|
||||
* The standard display item to paint the outer CSS box-shadows of a frame.
|
||||
*/
|
||||
|
@ -6,9 +6,9 @@ random-if(bug685516) == layers-layer-count-cascade-1.xhtml layers-layer-count-1-
|
||||
random-if(bug685516) == layers-layer-count-inheritance-1.xhtml layers-layer-count-1-ref.xhtml
|
||||
random-if(bug685516) == layers-layer-count-cascade-2.xhtml layers-layer-count-2-ref.xhtml
|
||||
random-if(bug685516) == layers-layer-count-inheritance-2.xhtml layers-layer-count-2-ref.xhtml
|
||||
fuzzy-if(Android,9,600000) == viewport-translucent-color-1.html viewport-translucent-color-ref.html
|
||||
== viewport-translucent-color-2.html viewport-translucent-color-ref.html
|
||||
== viewport-translucent-color-3.html viewport-translucent-color-ref.html
|
||||
== viewport-translucent-color-1.html viewport-translucent-color-ref.html
|
||||
fails-if(Android) == viewport-translucent-color-2.html viewport-translucent-color-ref.html
|
||||
fails-if(Android) == viewport-translucent-color-3.html viewport-translucent-color-ref.html
|
||||
!= viewport-translucent-color-ref.html about:blank
|
||||
random-if(bug685516) == iframe-translucent-color-1.html iframe-translucent-color-ref.html
|
||||
random-if(bug685516) == translucent-color-1.html translucent-color-ref.html
|
||||
|
@ -123,7 +123,7 @@ fuzzy-if(!contentSameGfxBackendAsCanvas,2,20000) fails-if(Android) == aja-linear
|
||||
fuzzy-if(!contentSameGfxBackendAsCanvas,2,16477) fails-if(Android) == aja-linear-6a.html aja-linear-6-ref.html # bug 526708
|
||||
fails == aja-linear-6b.html aja-linear-6-ref.html # bug 522607
|
||||
== height-dependence-1.html height-dependence-1-ref.html
|
||||
== height-dependence-2.html height-dependence-2-ref.html
|
||||
fails-if(cocoaWidget) == height-dependence-2.html height-dependence-2-ref.html # bug 535007
|
||||
== height-dependence-3.html height-dependence-3-ref.html
|
||||
|
||||
fails-if(d2d) == linear-onestopposition-1.html linear-onestopposition-1-ref.html # bug 638664
|
||||
|
Loading…
Reference in New Issue
Block a user