mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 836844 - Pass the right clip area for canvas frames. r=roc
This commit is contained in:
parent
bdf9a900a1
commit
ce93190e34
@ -3006,12 +3006,13 @@ nsRect
|
||||
nsCSSRendering::GetBackgroundLayerRect(nsPresContext* aPresContext,
|
||||
nsIFrame* aForFrame,
|
||||
const nsRect& aBorderArea,
|
||||
const nsRect& aClipRect,
|
||||
const nsStyleBackground& aBackground,
|
||||
const nsStyleBackground::Layer& aLayer)
|
||||
{
|
||||
nsBackgroundLayerState state =
|
||||
PrepareBackgroundLayer(aPresContext, aForFrame, 0, aBorderArea,
|
||||
aBorderArea, aBackground, aLayer);
|
||||
aClipRect, aBackground, aLayer);
|
||||
return state.mFillArea;
|
||||
}
|
||||
|
||||
|
@ -390,6 +390,7 @@ struct nsCSSRendering {
|
||||
static nsRect GetBackgroundLayerRect(nsPresContext* aPresContext,
|
||||
nsIFrame* aForFrame,
|
||||
const nsRect& aBorderArea,
|
||||
const nsRect& aClipRect,
|
||||
const nsStyleBackground& aBackground,
|
||||
const nsStyleBackground::Layer& aLayer);
|
||||
|
||||
|
@ -2010,11 +2010,8 @@ nsDisplayBackgroundImage::GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
|
||||
(!mFrame->GetPrevContinuation() && !mFrame->GetNextContinuation())) {
|
||||
const nsStyleBackground::Layer& layer = mBackgroundStyle->mLayers[mLayer];
|
||||
if (layer.mImage.IsOpaque()) {
|
||||
nsRect borderBox = nsRect(ToReferenceFrame(), mFrame->GetSize());
|
||||
nsPresContext* presContext = mFrame->PresContext();
|
||||
nsRect r = nsCSSRendering::GetBackgroundLayerRect(presContext, mFrame,
|
||||
borderBox, *mBackgroundStyle, layer);
|
||||
result = GetInsideClipRegion(this, presContext, layer.mClip, r, aSnap);
|
||||
result = GetInsideClipRegion(this, presContext, layer.mClip, mBounds, aSnap);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2193,9 +2190,14 @@ nsDisplayBackgroundImage::GetBoundsInternal() {
|
||||
}
|
||||
|
||||
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];
|
||||
return nsCSSRendering::GetBackgroundLayerRect(presContext, mFrame,
|
||||
borderBox, *mBackgroundStyle, layer);
|
||||
borderBox, clipRect, *mBackgroundStyle, layer);
|
||||
}
|
||||
|
||||
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-1b.html 827577-1-ref.html
|
||||
== 827799-1.html about:blank
|
||||
== 836844-1.html 836844-1-ref.html
|
||||
|
Loading…
Reference in New Issue
Block a user