Bug 613659 - Implement box-decoration-break layout for backgrounds. r=cam,jmuizelaar

--HG--
rename : layout/reftests/backgrounds/background-size-each-box.html => layout/reftests/backgrounds/background-size-clone.html
rename : layout/reftests/backgrounds/background-size-cover-each-box.html => layout/reftests/backgrounds/background-size-cover-clone.html
rename : layout/reftests/backgrounds/background-size-cover-continuous.html => layout/reftests/backgrounds/background-size-cover-slice.html
rename : layout/reftests/backgrounds/background-size-continuous.html => layout/reftests/backgrounds/background-size-slice.html
This commit is contained in:
Mats Palmgren 2014-05-05 17:55:54 +00:00
Родитель 361c3593e3
Коммит 402beefae6
19 изменённых файлов: 112 добавлений и 257 удалений

Просмотреть файл

@ -831,14 +831,12 @@ public:
mContext->Save();
}
void Reset(gfxContext *aContext) {
// Do the equivalent of destroying and re-creating this object.
NS_PRECONDITION(aContext, "must provide a context");
if (mContext) {
mContext->Restore();
void EnsureSaved(gfxContext *aContext) {
MOZ_ASSERT(!mContext || mContext == aContext, "wrong context");
if (!mContext) {
mContext = aContext;
mContext->Save();
}
mContext = aContext;
mContext->Save();
}
private:

Просмотреть файл

@ -527,6 +527,18 @@ BoxDecorationRectForBorder(nsIFrame* aFrame, const nsRect& aBorderArea,
: aBorderArea;
}
static nsRect
BoxDecorationRectForBackground(nsIFrame* aFrame, const nsRect& aBorderArea,
const nsStyleBorder* aStyleBorder = nullptr)
{
if (!aStyleBorder) {
aStyleBorder = aFrame->StyleBorder();
}
return ::IsBoxDecorationSlice(*aStyleBorder)
? ::JoinBoxesForSlice(aFrame, aBorderArea, eForBackground)
: aBorderArea;
}
//----------------------------------------------------------------------
// Thebes Border Rendering Code Start
@ -1697,6 +1709,7 @@ GetBackgroundClip(gfxContext *aCtx, uint8_t aBackgroundClip,
aClipState->mCustomClip = false;
aClipState->mRadiiAreOuter = true;
aClipState->mClippedRadii = aBGRadii;
if (aForFrame->GetType() == nsGkAtoms::scrollFrame &&
NS_STYLE_BG_ATTACHMENT_LOCAL == aBackgroundAttachment) {
// As of this writing, this is still in discussion in the CSS Working Group
@ -1795,15 +1808,13 @@ SetupBackgroundClip(BackgroundClipState& aClipState, gfxContext *aCtx,
// as above with bgArea, arguably a bug, but table painting seems
// to depend on it.
if (aHaveRoundedCorners || aClipState.mHasAdditionalBGClipArea) {
aAutoSR->Reset(aCtx);
}
if (aClipState.mHasAdditionalBGClipArea) {
gfxRect bgAreaGfx = nsLayoutUtils::RectToGfxRect(
aClipState.mAdditionalBGClipArea, aAppUnitsPerPixel);
bgAreaGfx.Round();
bgAreaGfx.Condition();
aAutoSR->EnsureSaved(aCtx);
aCtx->NewPath();
aCtx->Rectangle(bgAreaGfx, true);
aCtx->Clip();
@ -1824,6 +1835,7 @@ SetupBackgroundClip(BackgroundClipState& aClipState, gfxContext *aCtx,
return;
}
aAutoSR->EnsureSaved(aCtx);
aCtx->NewPath();
aCtx->RoundedRectangle(bgAreaGfx, aClipState.mClippedRadii, aClipState.mRadiiAreOuter);
aCtx->Clip();
@ -2598,26 +2610,14 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
return;
// Compute the outermost boundary of the area that might be painted.
gfxContext *ctx = aRenderingContext.ThebesContext();
nscoord appUnitsPerPixel = aPresContext->AppUnitsPerDevPixel();
// Same coordinate space as aBorderArea & aBGClipRect
// Same coordinate space as aBorderArea & aBGClipRect.
nsRect paintBorderArea =
::BoxDecorationRectForBackground(aForFrame, aBorderArea, &aBorder);
nsRect clipBorderArea =
::BoxDecorationRectForBorder(aForFrame, aBorderArea, &aBorder);
gfxCornerSizes bgRadii;
bool haveRoundedCorners;
{
nscoord radii[8];
nsSize frameSize = aForFrame->GetSize();
if (&aBorder == aForFrame->StyleBorder() &&
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);
}
bool haveRoundedCorners =
::GetRadii(aForFrame, aBorder, aBorderArea, clipBorderArea, &bgRadii);
// The 'bgClipArea' (used only by the image tiling logic, far below)
// is the caller-provided aBGClipRect if any, or else the area
@ -2625,6 +2625,8 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
// SetupCurrentBackgroundClip. (Arguably it should be the
// intersection, but that breaks the table painter -- in particular,
// taking the intersection breaks reftests/bugs/403249-1[ab].)
gfxContext* ctx = aRenderingContext.ThebesContext();
nscoord appUnitsPerPixel = aPresContext->AppUnitsPerDevPixel();
BackgroundClipState clipState;
uint8_t currentBackgroundClip;
bool isSolidBorder;
@ -2654,7 +2656,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
}
GetBackgroundClip(ctx, currentBackgroundClip, bg->BottomLayer().mAttachment,
aForFrame, aBorderArea,
aForFrame, clipBorderArea,
aDirtyRect, haveRoundedCorners, bgRadii, appUnitsPerPixel,
&clipState);
}
@ -2663,6 +2665,8 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
if (drawBackgroundColor && !isCanvasFrame)
ctx->SetColor(gfxRGBA(bgColor));
// NOTE: no Save() yet, we do that later by calling autoSR.EnsureSaved(ctx)
// in the cases we need it.
gfxContextAutoSaveRestore autoSR;
// If there is no background image, draw a color. (If there is
@ -2722,19 +2726,30 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
// already called GetBackgroundClip above and it stored its results
// in clipState.
if (clipSet) {
autoSR = gfxContextAutoSaveRestore(); // reset the previous one
GetBackgroundClip(ctx, currentBackgroundClip, layer.mAttachment, aForFrame,
aBorderArea, aDirtyRect, haveRoundedCorners,
clipBorderArea, aDirtyRect, haveRoundedCorners,
bgRadii, appUnitsPerPixel, &clipState);
}
SetupBackgroundClip(clipState, ctx, haveRoundedCorners,
appUnitsPerPixel, &autoSR);
clipSet = true;
if (!clipBorderArea.IsEqualEdges(aBorderArea)) {
// We're drawing the background for the joined continuation boxes
// so we need to clip that to the slice that we want for this frame.
gfxRect clip =
nsLayoutUtils::RectToGfxRect(aBorderArea, appUnitsPerPixel);
autoSR.EnsureSaved(ctx);
ctx->NewPath();
ctx->SnappedRectangle(clip);
ctx->Clip();
}
}
}
if ((aLayer < 0 || i == (uint32_t)startLayer) &&
!clipState.mDirtyRectGfx.IsEmpty()) {
nsBackgroundLayerState state = PrepareBackgroundLayer(aPresContext, aForFrame,
aFlags, aBorderArea, clipState.mBGClipArea, *bg, layer);
aFlags, paintBorderArea, clipState.mBGClipArea, layer);
if (!state.mFillArea.IsEmpty()) {
if (state.mCompositingOp != gfxContext::OPERATOR_OVER) {
NS_ASSERTION(ctx->CurrentOperator() == gfxContext::OPERATOR_OVER,
@ -2743,7 +2758,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
}
state.mImageRenderer.DrawBackground(aPresContext, aRenderingContext,
state.mDestArea, state.mFillArea,
state.mAnchor + aBorderArea.TopLeft(),
state.mAnchor + paintBorderArea.TopLeft(),
clipState.mDirtyRect);
if (state.mCompositingOp != gfxContext::OPERATOR_OVER) {
ctx->SetOperator(gfxContext::OPERATOR_OVER);
@ -2798,26 +2813,12 @@ nsCSSRendering::PaintBackgroundColorWithSC(nsPresContext* aPresContext,
}
// Compute the outermost boundary of the area that might be painted.
gfxContext *ctx = aRenderingContext.ThebesContext();
nscoord appUnitsPerPixel = aPresContext->AppUnitsPerDevPixel();
// Same coordinate space as aBorderArea
// Same coordinate space as aBorderArea.
nsRect clipBorderArea =
::BoxDecorationRectForBorder(aForFrame, aBorderArea, &aBorder);
gfxCornerSizes bgRadii;
bool haveRoundedCorners;
{
nscoord radii[8];
nsSize frameSize = aForFrame->GetSize();
if (&aBorder == aForFrame->StyleBorder() &&
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);
}
bool haveRoundedCorners =
::GetRadii(aForFrame, aBorder, aBorderArea, clipBorderArea, &bgRadii);
// The background is rendered over the 'background-clip' area,
// which is normally equal to the border area but may be reduced
@ -2827,6 +2828,8 @@ nsCSSRendering::PaintBackgroundColorWithSC(nsPresContext* aPresContext,
// radii as the border code will.
// The background-color is drawn based on the bottom
// background-clip.
gfxContext* ctx = aRenderingContext.ThebesContext();
nscoord appUnitsPerPixel = aPresContext->AppUnitsPerDevPixel();
const nsStyleBackground *bg = aBackgroundSC->StyleBackground();
uint8_t currentBackgroundClip = bg->BottomLayer().mClip;
bool isSolidBorder =
@ -2841,7 +2844,7 @@ nsCSSRendering::PaintBackgroundColorWithSC(nsPresContext* aPresContext,
BackgroundClipState clipState;
GetBackgroundClip(ctx, currentBackgroundClip, bg->BottomLayer().mAttachment,
aForFrame, aBorderArea,
aForFrame, clipBorderArea,
aDirtyRect, haveRoundedCorners, bgRadii, appUnitsPerPixel,
&clipState);
@ -2866,47 +2869,17 @@ nsRect
nsCSSRendering::ComputeBackgroundPositioningArea(nsPresContext* aPresContext,
nsIFrame* aForFrame,
const nsRect& aBorderArea,
const nsStyleBackground& aBackground,
const nsStyleBackground::Layer& aLayer,
nsIFrame** aAttachedToFrame)
{
// Compute background origin area relative to aBorderArea now as we may need
// it to compute the effective image size for a CSS gradient.
nsRect bgPositioningArea(0, 0, 0, 0);
nsRect bgPositioningArea;
nsIAtom* frameType = aForFrame->GetType();
nsIFrame* geometryFrame = aForFrame;
if (frameType == nsGkAtoms::inlineFrame) {
// XXXjwalden Strictly speaking this is not quite faithful to how
// background-break is supposed to interact with background-origin values,
// but it's a non-trivial amount of work to make it fully conformant, and
// until the specification is more finalized (and assuming background-break
// even makes the cut) it doesn't make sense to hammer out exact behavior.
switch (aBackground.mBackgroundInlinePolicy) {
case NS_STYLE_BG_INLINE_POLICY_EACH_BOX:
bgPositioningArea = nsRect(nsPoint(0,0), aBorderArea.Size());
break;
case NS_STYLE_BG_INLINE_POLICY_BOUNDING_BOX:
bgPositioningArea = gInlineBGData->GetBoundingRect(aForFrame);
break;
default:
NS_ERROR("Unknown background-inline-policy value! "
"Please, teach me what to do.");
case NS_STYLE_BG_INLINE_POLICY_CONTINUOUS:
bgPositioningArea = gInlineBGData->GetContinuousRect(aForFrame);
break;
}
} else if (frameType == nsGkAtoms::canvasFrame) {
geometryFrame = aForFrame->GetFirstPrincipalChild();
// geometryFrame might be null if this canvas is a page created
// as an overflow container (e.g. the in-flow content has already
// finished and this page only displays the continuations of
// absolutely positioned content).
if (geometryFrame) {
bgPositioningArea = geometryFrame->GetRect();
}
} else if (frameType == nsGkAtoms::scrollFrame &&
NS_STYLE_BG_ATTACHMENT_LOCAL == aLayer.mAttachment) {
if (MOZ_UNLIKELY(frameType == nsGkAtoms::scrollFrame &&
NS_STYLE_BG_ATTACHMENT_LOCAL == aLayer.mAttachment)) {
nsIScrollableFrame* scrollableFrame = do_QueryFrame(aForFrame);
bgPositioningArea = nsRect(
scrollableFrame->GetScrolledFrame()->GetPosition()
@ -2930,6 +2903,17 @@ nsCSSRendering::ComputeBackgroundPositioningArea(nsPresContext* aPresContext,
}
*aAttachedToFrame = aForFrame;
return bgPositioningArea;
}
if (MOZ_UNLIKELY(frameType == nsGkAtoms::canvasFrame)) {
geometryFrame = aForFrame->GetFirstPrincipalChild();
// geometryFrame might be null if this canvas is a page created
// as an overflow container (e.g. the in-flow content has already
// finished and this page only displays the continuations of
// absolutely positioned content).
if (geometryFrame) {
bgPositioningArea = geometryFrame->GetRect();
}
} else {
bgPositioningArea = nsRect(nsPoint(0,0), aBorderArea.Size());
}
@ -2943,7 +2927,6 @@ nsCSSRendering::ComputeBackgroundPositioningArea(nsPresContext* aPresContext,
NS_ASSERTION(aLayer.mOrigin == NS_STYLE_BG_ORIGIN_CONTENT,
"unknown background-origin value");
}
geometryFrame->ApplySkipSides(border);
bgPositioningArea.Deflate(border);
}
@ -3027,11 +3010,10 @@ nsCSSRendering::PrepareBackgroundLayer(nsPresContext* aPresContext,
uint32_t aFlags,
const nsRect& aBorderArea,
const nsRect& aBGClipRect,
const nsStyleBackground& aBackground,
const nsStyleBackground::Layer& aLayer)
{
/*
* The background properties we need to keep in mind when drawing background
* The properties we need to keep in mind when drawing background
* layers are:
*
* background-image
@ -3041,8 +3023,8 @@ nsCSSRendering::PrepareBackgroundLayer(nsPresContext* aPresContext,
* background-clip
* background-origin
* background-size
* background-break (-moz-background-inline-policy)
* background-blend-mode
* box-decoration-break
*
* (background-color applies to the entire element and not to individual
* layers, so it is irrelevant to this method.)
@ -3065,22 +3047,21 @@ nsCSSRendering::PrepareBackgroundLayer(nsPresContext* aPresContext,
* depends upon background-attachment (only in the case where that value
* is 'fixed')
* background-size
* depends upon background-break (for the background positioning area for
* resolving percentages), background-image (for the image's intrinsic
* depends upon box-decoration-break (for the background positioning area
* for resolving percentages), background-image (for the image's intrinsic
* size), background-repeat (if that value is 'round'), and
* background-origin (for the background painting area, when
* background-repeat is 'round')
* background-break
* depends upon background-origin (specifying how the boxes making up the
* background positioning area are determined)
* box-decoration-break
* no dependencies
*
* As a result of only-if dependencies we don't strictly do a topological
* sort of the above properties when processing, but it's pretty close to one:
*
* background-clip (by caller)
* background-image
* background-break, background-origin
* background-attachment (postfix for background-{origin,break} if 'fixed')
* box-decoration-break, background-origin
* background-attachment (postfix for background-origin if 'fixed')
* background-size
* background-position
* background-repeat
@ -3106,7 +3087,7 @@ nsCSSRendering::PrepareBackgroundLayer(nsPresContext* aPresContext,
// it to compute the effective image size for a CSS gradient.
nsRect bgPositioningArea =
ComputeBackgroundPositioningArea(aPresContext, aForFrame, aBorderArea,
aBackground, aLayer, &attachedToFrame);
aLayer, &attachedToFrame);
// For background-attachment:fixed backgrounds, we'll limit the area
// where the background can be drawn to the viewport.
@ -3176,13 +3157,13 @@ nsCSSRendering::GetBackgroundLayerRect(nsPresContext* aPresContext,
nsIFrame* aForFrame,
const nsRect& aBorderArea,
const nsRect& aClipRect,
const nsStyleBackground& aBackground,
const nsStyleBackground::Layer& aLayer,
uint32_t aFlags)
{
nsRect borderArea = ::BoxDecorationRectForBackground(aForFrame, aBorderArea);
nsBackgroundLayerState state =
PrepareBackgroundLayer(aPresContext, aForFrame, aFlags, aBorderArea,
aClipRect, aBackground, aLayer);
PrepareBackgroundLayer(aPresContext, aForFrame, aFlags, borderArea,
aClipRect, aLayer);
return state.mFillArea;
}

Просмотреть файл

@ -456,7 +456,6 @@ struct nsCSSRendering {
ComputeBackgroundPositioningArea(nsPresContext* aPresContext,
nsIFrame* aForFrame,
const nsRect& aBorderArea,
const nsStyleBackground& aBackground,
const nsStyleBackground::Layer& aLayer,
nsIFrame** aAttachedToFrame);
@ -466,7 +465,6 @@ struct nsCSSRendering {
uint32_t aFlags,
const nsRect& aBorderArea,
const nsRect& aBGClipRect,
const nsStyleBackground& aBackground,
const nsStyleBackground::Layer& aLayer);
/**
@ -542,7 +540,6 @@ struct nsCSSRendering {
nsIFrame* aForFrame,
const nsRect& aBorderArea,
const nsRect& aClipRect,
const nsStyleBackground& aBackground,
const nsStyleBackground::Layer& aLayer,
uint32_t aFlags);

Просмотреть файл

@ -1942,14 +1942,8 @@ nsDisplayBackgroundImage::IsSingleFixedPositionImage(nsDisplayListBuilder* aBuil
return false;
nsBackgroundLayerState state =
nsCSSRendering::PrepareBackgroundLayer(presContext,
mFrame,
flags,
borderArea,
aClipRect,
*mBackgroundStyle,
layer);
nsCSSRendering::PrepareBackgroundLayer(presContext, mFrame, flags,
borderArea, aClipRect, layer);
nsImageRenderer* imageRenderer = &state.mImageRenderer;
// We only care about images here, not gradients.
if (!imageRenderer->IsRasterImage())
@ -1982,14 +1976,8 @@ nsDisplayBackgroundImage::TryOptimizeToImageLayer(LayerManager* aManager,
}
nsBackgroundLayerState state =
nsCSSRendering::PrepareBackgroundLayer(presContext,
mFrame,
flags,
borderArea,
borderArea,
*mBackgroundStyle,
layer);
nsCSSRendering::PrepareBackgroundLayer(presContext, mFrame, flags,
borderArea, borderArea, layer);
nsImageRenderer* imageRenderer = &state.mImageRenderer;
// We only care about images here, not gradients.
if (!imageRenderer->IsRasterImage())
@ -2261,7 +2249,7 @@ nsDisplayBackgroundImage::GetPositioningArea()
return nsCSSRendering::ComputeBackgroundPositioningArea(
mFrame->PresContext(), mFrame,
nsRect(ToReferenceFrame(), mFrame->GetSize()),
*mBackgroundStyle, mBackgroundStyle->mLayers[mLayer],
mBackgroundStyle->mLayers[mLayer],
&attachedToFrame) + ToReferenceFrame();
}
@ -2383,8 +2371,7 @@ nsDisplayBackgroundImage::GetBoundsInternal(nsDisplayListBuilder* aBuilder) {
}
const nsStyleBackground::Layer& layer = mBackgroundStyle->mLayers[mLayer];
return nsCSSRendering::GetBackgroundLayerRect(presContext, mFrame,
borderBox, clipRect,
*mBackgroundStyle, layer,
borderBox, clipRect, layer,
aBuilder->GetBackgroundPaintFlags());
}

Просмотреть файл

@ -78,7 +78,7 @@ function foo()
<br style="clear: none;" id="br2">
<br style="height: auto; clear: both; width: auto;" id="br3">
<br style="position: static;" id="br4">
<br style="background: yellow none repeat scroll 0% 0%; background-clip: initial; background-origin: initial; -moz-background-inline-policy: initial; display: inline;" id="br5">
<br style="background: yellow none repeat scroll 0% 0%; background-clip: initial; background-origin: initial; display: inline;" id="br5">
<br style="width: 1px; visibility: visible;" id="br6">
<br style="color: black; width: 2px; display: table-cell;" id="br7">
<table border="1"><tbody><tr style="display: list-item;" id="tableRow"><td>x</td></tr></tbody></table>

Просмотреть файл

@ -1,36 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>background-break: bounding-box</title>
<style type="text/css">
@font-face
{
font-family: Ahem;
src: url(../fonts/Ahem.ttf);
}
#outer
{
border: 1px solid black;
width: 10em;
}
#ahem-lines
{
font-family: Ahem;
font-size: 32px;
white-space: pre;
background-image: url(blue-8x20-green-8x20.png);
background-repeat: no-repeat;
-moz-background-inline-policy: bounding-box;
}
</style>
</head>
<body>
<div id="outer">
<span id="ahem-lines"> <!-- EOL -->
<!-- mix it up for each-box and bounding-box --><!-- EOL -->
<!-- EOL -->
<!-- EOL -->
</span></div>
</body>
</html>

Просмотреть файл

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>background-break: each-box</title>
<title>box-decoration-break: clone</title>
<style type="text/css">
@font-face
{
@ -21,14 +21,14 @@
white-space: pre;
background-image: url(blue-8x20-green-8x20.png);
background-repeat: no-repeat;
-moz-background-inline-policy: each-box;
box-decoration-break: clone;
}
</style>
</head>
<body>
<div id="outer">
<span id="ahem-lines"> <!-- EOL -->
<!-- mix it up for each-box and bounding-box --><!-- EOL -->
<!-- mix it up for clone --><!-- EOL -->
<!-- EOL -->
<!-- EOL -->
</span></div>

Просмотреть файл

@ -1,37 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>background-size: cover; background-break: bounding-box</title>
<style type="text/css">
@font-face
{
font-family: Ahem;
src: url(../fonts/Ahem.ttf);
}
#outer
{
border: 1px solid black;
width: 10em;
}
#ahem-lines
{
font-family: Ahem;
font-size: 32px;
white-space: pre;
background-image: url(blue-8x20-green-8x20.png);
background-repeat: no-repeat;
background-size: cover;
-moz-background-inline-policy: bounding-box;
}
</style>
</head>
<body>
<div id="outer">
<span id="ahem-lines"> <!-- EOL -->
<!-- mix it up for each-box and bounding-box --><!-- EOL -->
<!-- EOL -->
<!-- EOL -->
</span></div>
</body>
</html>

Просмотреть файл

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>background-size: cover; background-break: each-box</title>
<title>background-size: cover; box-decoration-break: clone</title>
<style type="text/css">
@font-face
{
@ -22,14 +22,14 @@
background-image: url(blue-8x20-green-8x20.png);
background-repeat: no-repeat;
background-size: cover;
-moz-background-inline-policy: each-box;
box-decoration-break: clone;
}
</style>
</head>
<body>
<div id="outer">
<span id="ahem-lines"> <!-- EOL -->
<!-- mix it up for each-box and bounding-box --><!-- EOL -->
<!-- mix it up for clone --><!-- EOL -->
<!-- EOL -->
<!-- EOL -->
</span></div>

Просмотреть файл

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>background-size: cover; background-break: continuous</title>
<title>background-size: cover; box-decoration-break: slice</title>
<style type="text/css">
@font-face
{
@ -22,14 +22,14 @@
background-image: url(blue-8x20-green-8x20.png);
background-repeat: no-repeat;
background-size: cover;
-moz-background-inline-policy: continuous;
box-decoration-break: slice;
}
</style>
</head>
<body>
<div id="outer">
<span id="ahem-lines"> <!-- EOL -->
<!-- mix it up for each-box and bounding-box --><!-- EOL -->
<!-- mix it up for slice --><!-- EOL -->
<!-- EOL -->
<!-- EOL -->
</span></div>

Просмотреть файл

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>background-break: continuous</title>
<title>box-decoration-break: slice</title>
<style type="text/css">
@font-face
{
@ -21,14 +21,14 @@
white-space: pre;
background-image: url(blue-8x20-green-8x20.png);
background-repeat: no-repeat;
-moz-background-inline-policy: continuous;
box-decoration-break: slice;
}
</style>
</head>
<body>
<div id="outer">
<span id="ahem-lines"> <!-- EOL -->
<!-- mix it up for each-box and bounding-box --><!-- EOL -->
<!-- mix it up for slice --><!-- EOL -->
<!-- EOL -->
<!-- EOL -->
</span></div>

Просмотреть файл

@ -90,19 +90,15 @@ fails-if(smallScreen&&Android) != background-size-body-contain-no-repeat.html ba
skip-if(B2G) == background-layers-1a.html background-layers-1-ref.html # bug 773482
== background-layers-1b.html background-layers-1-ref.html
# -moz-background-inline-policy is touchy and hard to test due to stretching
# artifacts and the difficulty of covering exact lines, and its CSS3 analog is
# on the chopping block at the moment, so just make sure background-size results
# in a different rendering when present.
!= background-size-cover-continuous.html background-size-continuous.html
!= background-size-cover-each-box.html background-size-each-box.html
!= background-size-cover-bounding-box.html background-size-bounding-box.html
# box-decoration-break's effect on backgrounds is touchy and hard to test due to stretching
# artifacts and the difficulty of covering exact lines, so just make sure
# background-size results in a different rendering when present.
pref(layout.css.box-decoration-break.enabled,true) != background-size-cover-slice.html background-size-slice.html
pref(layout.css.box-decoration-break.enabled,true) != background-size-cover-clone.html background-size-clone.html
# ...and make sure each rendering with background-size is different from the
# others
!= background-size-cover-continuous.html background-size-cover-each-box.html
!= background-size-cover-continuous.html background-size-cover-bounding-box.html
!= background-size-cover-each-box.html background-size-cover-bounding-box.html
# other
pref(layout.css.box-decoration-break.enabled,true) != background-size-cover-slice.html background-size-cover-clone.html
== background-size-monster-ch.html background-size-monster-ref.html
== background-size-monster-cm.html background-size-monster-ref.html

Просмотреть файл

@ -5,7 +5,7 @@
</head>
<body style="line-height: 3; width: 500px; height: 250px;">
<span style="background: url(repeatable-diagonal-gradient.png); background-clip: border-box; background-clip: border; background-origin: padding-box; background-origin: padding; margin: 7px 4px 2px 18px; border: 6px transparent solid; border-width: 2px 10px 15px 2px; -moz-background-inline-policy: continuous; background-inline-policy: continuous;">
<span style="background: url(repeatable-diagonal-gradient.png); background-clip: border-box; background-clip: border; background-origin: padding-box; background-origin: padding; margin: 7px 4px 2px 18px; border: 6px transparent solid; border-width: 2px 10px 15px 2px;">
blah<br>
blah<br>
blah

Просмотреть файл

@ -5,7 +5,7 @@
</head>
<body style="line-height: 3; width: 500px; height: 250px;">
<span style="background: url(repeatable-diagonal-gradient.png); background-clip: padding-box; background-clip: padding; background-origin: content-box; background-origin: content; border: medium transparent solid; border-width: 7px 4px 2px 18px; padding: 2px 2% 3% 2px; -moz-background-inline-policy: continuous; background-inline-policy: continuous;">
<span style="background: url(repeatable-diagonal-gradient.png); background-clip: padding-box; background-clip: padding; background-origin: content-box; background-origin: content; border: medium transparent solid; border-width: 7px 4px 2px 18px; padding: 2px 2% 3% 2px;">
blah<br>
blah<br>
blah

Просмотреть файл

@ -1,15 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Testcase, bug 368020</title>
</head>
<body style="line-height: 3; width: 500px; height: 250px;">
<span style="background: url(repeatable-diagonal-gradient.png); background-clip: border-box; background-clip: border; background-origin: padding-box; background-origin: padding; margin: 7px 4px 2px 18px; border: 6px transparent solid; border-width: 2px 10px 15px 2px; -moz-background-inline-policy: bounding-box; background-inline-policy: bounding-box;">
blah<br>
blah<br>
blah
</span>
</body>
</html>

Просмотреть файл

@ -1,15 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Testcase, bug 368020</title>
</head>
<body style="line-height: 3; width: 500px; height: 250px;">
<span style="background: url(repeatable-diagonal-gradient.png); background-clip: padding-box; background-clip: padding; background-origin: content-box; background-origin: content; border: medium transparent solid; border-width: 7px 4px 2px 18px; padding: 2px 2% 3% 2px; -moz-background-inline-policy: bounding-box; background-inline-policy: bounding-box;">
blah<br>
blah<br>
blah
</span>
</body>
</html>

Просмотреть файл

@ -5,7 +5,7 @@
</head>
<body style="line-height: 3; width: 500px; height: 250px;">
<span style="background: url(repeatable-diagonal-gradient.png); background-clip: border-box; background-clip: border; background-origin: padding-box; background-origin: padding; margin: 7px 4px 2px 18px; border: 6px transparent solid; border-width: 2px 10px 15px 2px; -moz-background-inline-policy: each-box; background-inline-policy: each-box;">
<span style="background: url(repeatable-diagonal-gradient.png); background-clip: border-box; background-clip: border; background-origin: padding-box; background-origin: padding; margin: 7px 4px 2px 18px; border: 6px transparent solid; border-width: 2px 10px 15px 2px; box-decoration-break: clone;">
blah<br>
blah<br>
blah

Просмотреть файл

@ -5,7 +5,7 @@
</head>
<body style="line-height: 3; width: 500px; height: 250px;">
<span style="background: url(repeatable-diagonal-gradient.png); background-clip: padding-box; background-clip: padding; background-origin: content-box; background-origin: content; border: medium transparent solid; border-width: 7px 4px 2px 18px; padding: 2px 10px 15px 2px; -moz-background-inline-policy: each-box; background-inline-policy: each-box;">
<span style="background: url(repeatable-diagonal-gradient.png); background-clip: padding-box; background-clip: padding; background-origin: content-box; background-origin: content; border: medium transparent solid; border-width: 7px 4px 2px 18px; padding: 2px 10px 15px 2px; box-decoration-break: clone;">
blah<br>
blah<br>
blah

Просмотреть файл

@ -596,8 +596,7 @@ skip-if(B2G) == 367247-l-scroll.html 367247-l-auto.html
skip-if(B2G) random-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) == 368020-1.html 368020-1-ref.html
== 368020-2.html 368020-2-ref.html
fails == 368020-3.html 368020-3-ref.html # bug 368085
fails == 368020-4.html 368020-4-ref.html # bug 368085
== 368020-5.html 368020-5-ref.html
pref(layout.css.box-decoration-break.enabled,true) == 368020-5.html 368020-5-ref.html
== 368155-1.xhtml 368155-1-ref.xhtml
asserts(4) == 368155-negative-margins-1.html 368155-negative-margins-1-ref.html # bug 387205 / bug 457397
# we can't test this because there's antialiasing involved, and our comparison