mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 836844 - Pass the right clip area for canvas frames. r=roc
This commit is contained in:
parent
42c1163af1
commit
26805f9ea7
@ -3006,12 +3006,13 @@ nsRect
|
|||||||
nsCSSRendering::GetBackgroundLayerRect(nsPresContext* aPresContext,
|
nsCSSRendering::GetBackgroundLayerRect(nsPresContext* aPresContext,
|
||||||
nsIFrame* aForFrame,
|
nsIFrame* aForFrame,
|
||||||
const nsRect& aBorderArea,
|
const nsRect& aBorderArea,
|
||||||
|
const nsRect& aClipRect,
|
||||||
const nsStyleBackground& aBackground,
|
const nsStyleBackground& aBackground,
|
||||||
const nsStyleBackground::Layer& aLayer)
|
const nsStyleBackground::Layer& aLayer)
|
||||||
{
|
{
|
||||||
nsBackgroundLayerState state =
|
nsBackgroundLayerState state =
|
||||||
PrepareBackgroundLayer(aPresContext, aForFrame, 0, aBorderArea,
|
PrepareBackgroundLayer(aPresContext, aForFrame, 0, aBorderArea,
|
||||||
aBorderArea, aBackground, aLayer);
|
aClipRect, aBackground, aLayer);
|
||||||
return state.mFillArea;
|
return state.mFillArea;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -390,6 +390,7 @@ struct nsCSSRendering {
|
|||||||
static nsRect GetBackgroundLayerRect(nsPresContext* aPresContext,
|
static nsRect GetBackgroundLayerRect(nsPresContext* aPresContext,
|
||||||
nsIFrame* aForFrame,
|
nsIFrame* aForFrame,
|
||||||
const nsRect& aBorderArea,
|
const nsRect& aBorderArea,
|
||||||
|
const nsRect& aClipRect,
|
||||||
const nsStyleBackground& aBackground,
|
const nsStyleBackground& aBackground,
|
||||||
const nsStyleBackground::Layer& aLayer);
|
const nsStyleBackground::Layer& aLayer);
|
||||||
|
|
||||||
|
@ -2010,11 +2010,8 @@ nsDisplayBackgroundImage::GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
|
|||||||
(!mFrame->GetPrevContinuation() && !mFrame->GetNextContinuation())) {
|
(!mFrame->GetPrevContinuation() && !mFrame->GetNextContinuation())) {
|
||||||
const nsStyleBackground::Layer& layer = mBackgroundStyle->mLayers[mLayer];
|
const nsStyleBackground::Layer& layer = mBackgroundStyle->mLayers[mLayer];
|
||||||
if (layer.mImage.IsOpaque()) {
|
if (layer.mImage.IsOpaque()) {
|
||||||
nsRect borderBox = nsRect(ToReferenceFrame(), mFrame->GetSize());
|
|
||||||
nsPresContext* presContext = mFrame->PresContext();
|
nsPresContext* presContext = mFrame->PresContext();
|
||||||
nsRect r = nsCSSRendering::GetBackgroundLayerRect(presContext, mFrame,
|
result = GetInsideClipRegion(this, presContext, layer.mClip, mBounds, aSnap);
|
||||||
borderBox, *mBackgroundStyle, layer);
|
|
||||||
result = GetInsideClipRegion(this, presContext, layer.mClip, r, aSnap);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2193,9 +2190,14 @@ nsDisplayBackgroundImage::GetBoundsInternal() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsRect borderBox = nsRect(ToReferenceFrame(), mFrame->GetSize());
|
nsRect borderBox = nsRect(ToReferenceFrame(), mFrame->GetSize());
|
||||||
|
nsRect clipRect = borderBox;
|
||||||
|
if (mFrame->GetType() == nsGkAtoms::canvasFrame) {
|
||||||
|
nsCanvasFrame* frame = static_cast<nsCanvasFrame*>(mFrame);
|
||||||
|
clipRect = frame->CanvasArea() + ToReferenceFrame();
|
||||||
|
}
|
||||||
const nsStyleBackground::Layer& layer = mBackgroundStyle->mLayers[mLayer];
|
const nsStyleBackground::Layer& layer = mBackgroundStyle->mLayers[mLayer];
|
||||||
return nsCSSRendering::GetBackgroundLayerRect(presContext, mFrame,
|
return nsCSSRendering::GetBackgroundLayerRect(presContext, mFrame,
|
||||||
borderBox, *mBackgroundStyle, layer);
|
borderBox, clipRect, *mBackgroundStyle, layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
|
12
layout/reftests/bugs/836844-1-ref.html
Normal file
12
layout/reftests/bugs/836844-1-ref.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html><head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<style type="text/css">
|
||||||
|
body {
|
||||||
|
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAECAYAAACzzX7wAAAANUlEQVQImWPonzzt/6L5y+B4Yv8UFD4DMgcbhiuYMnni/wULFsAlJkzqJ2DCwuX/F81f9h8Aludb9rn0ffkAAAAASUVORK5CYII=') repeat scroll 0% 0% transparent;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
</body>
|
||||||
|
</html>
|
22
layout/reftests/bugs/836844-1.html
Normal file
22
layout/reftests/bugs/836844-1.html
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html class="reftest-wait"><head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<style type="text/css">
|
||||||
|
body {
|
||||||
|
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAECAYAAACzzX7wAAAANUlEQVQImWPonzzt/6L5y+B4Yv8UFD4DMgcbhiuYMnni/wULFsAlJkzqJ2DCwuX/F81f9h8Aludb9rn0ffkAAAAASUVORK5CYII=') repeat scroll 0% 0% transparent;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function doScroll() {
|
||||||
|
window.scrollTo(0, 500);
|
||||||
|
document.documentElement.removeAttribute("class");
|
||||||
|
}
|
||||||
|
document.addEventListener("MozReftestInvalidate", doScroll, false);
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div style="height: 2000px;"></div>
|
||||||
|
|
||||||
|
|
||||||
|
</body></html>
|
@ -1743,3 +1743,4 @@ skip-if(B2G) == 818276-1.html 818276-1-ref.html
|
|||||||
== 827577-1a.html 827577-1-ref.html
|
== 827577-1a.html 827577-1-ref.html
|
||||||
== 827577-1b.html 827577-1-ref.html
|
== 827577-1b.html 827577-1-ref.html
|
||||||
== 827799-1.html about:blank
|
== 827799-1.html about:blank
|
||||||
|
== 836844-1.html 836844-1-ref.html
|
||||||
|
Loading…
Reference in New Issue
Block a user