Bug 1311270 - Part 8. Add assertion for margin-box.
MozReview-Commit-ID: FEkEf3ps83k
--- a/layout/painting/nsCSSRendering.cpp
+++ b/layout/painting/nsCSSRendering.cpp
@@ -2044,16 +2044,24 @@ nsCSSRendering::GetImageLayerClip(const
aClipState->mAdditionalBGClipArea.Deflate(padding);
}
// Also clip at a non-scrolling, rounded-corner 'padding-box',
// same as the scrolled content because of the 'overflow' property.
layerClip = StyleGeometryBox::Padding;
}
+ // See the comment of StyleGeometryBox::Margin.
+ // Hitting this assertion means we decide to turn on margin-box support for
+ // positioned mask from CSS parser and style system. In this case, you
+ // should *inflate* mBGClipArea by the margin returning from
+ // aForFrame->GetUsedMargin() in the code chunk bellow.
+ MOZ_ASSERT(layerClip != StyleGeometryBox::Margin,
+ "StyleGeometryBox::Margin rendering is not supported yet.\n");
+
if (layerClip != StyleGeometryBox::Border &&
layerClip != StyleGeometryBox::Text) {
nsMargin border = aForFrame->GetUsedBorder();
if (layerClip == StyleGeometryBox::MozAlmostPadding) {
// Reduce |border| by 1px (device pixels) on all sides, if
// possible, so that we don't get antialiasing seams between the
// {background|mask} and border.
border.top = std::max(0, border.top - aAppUnitsPerPixel);
@@ -3530,16 +3538,25 @@ nsCSSRendering::ComputeImageLayerPositio
// finished and this page only displays the continuations of
// absolutely positioned content).
if (geometryFrame) {
positionArea = geometryFrame->GetRect();
}
} else {
positionArea = nsRect(nsPoint(0,0), aBorderArea.Size());
}
+
+ // See the comment of StyleGeometryBox::Margin.
+ // Hitting this assertion means we decide to turn on margin-box support for
+ // positioned mask from CSS parser and style system. In this case, you
+ // should *inflate* positionArea by the margin returning from
+ // geometryFrame->GetUsedMargin() in the code chunk bellow.
+ MOZ_ASSERT(aLayer.mOrigin != StyleGeometryBox::Margin,
+ "StyleGeometryBox::Margin rendering is not supported yet.\n");
+
// {background|mask} images are tiled over the '{background|mask}-clip' area
// but the origin of the tiling is based on the '{background|mask}-origin'
// area.
if (layerOrigin != StyleGeometryBox::Border && geometryFrame) {
nsMargin border = geometryFrame->GetUsedBorder();
if (layerOrigin != StyleGeometryBox::Padding) {
border += geometryFrame->GetUsedPadding();
NS_ASSERTION(layerOrigin == StyleGeometryBox::Content,