зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 2 changesets (bug 504622) for android reftest failures a=backout
Backed out changeset c024721d9b03 (bug 504622) Backed out changeset 056f728704e7 (bug 504622)
This commit is contained in:
Родитель
03322ca26d
Коммит
f0071bb179
|
@ -110,7 +110,6 @@ public:
|
|||
virtual void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder,
|
||||
const nsDisplayItemGeometry* aGeometry,
|
||||
nsRegion *aInvalidRegion) override;
|
||||
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) override;
|
||||
NS_DISPLAY_DECL_NAME("FieldSetBorderBackground", TYPE_FIELDSET_BORDER_BACKGROUND)
|
||||
};
|
||||
|
||||
|
@ -156,19 +155,6 @@ nsDisplayFieldSetBorderBackground::ComputeInvalidationRegion(nsDisplayListBuilde
|
|||
nsDisplayItem::ComputeInvalidationRegion(aBuilder, aGeometry, aInvalidRegion);
|
||||
}
|
||||
|
||||
nsRect
|
||||
nsDisplayFieldSetBorderBackground::GetBounds(nsDisplayListBuilder* aBuilder,
|
||||
bool* aSnap)
|
||||
{
|
||||
// Just go ahead and claim our frame's overflow rect as the bounds, because we
|
||||
// may have border-image-outset or other features that cause borders to extend
|
||||
// outside the border rect. We could try to duplicate all the complexity
|
||||
// nsDisplayBorder has here, but keeping things in sync would be a pain, and
|
||||
// this code is not typically performance-sensitive.
|
||||
*aSnap = false;
|
||||
return Frame()->GetVisualOverflowRectRelativeToSelf() + ToReferenceFrame();
|
||||
}
|
||||
|
||||
void
|
||||
nsFieldSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
const nsRect& aDirtyRect,
|
||||
|
@ -231,12 +217,14 @@ nsFieldSetFrame::PaintBorder(
|
|||
nsPoint aPt,
|
||||
const nsRect& aDirtyRect)
|
||||
{
|
||||
// If the border is smaller than the legend, move the border down
|
||||
// to be centered on the legend. We call VisualBorderRectRelativeToSelf() to
|
||||
// compute the border positioning.
|
||||
// if the border is smaller than the legend. Move the border down
|
||||
// to be centered on the legend.
|
||||
// FIXME: This means border-radius clamping is incorrect; we should
|
||||
// override nsIFrame::GetBorderRadii.
|
||||
nsRect rect = VisualBorderRectRelativeToSelf() + aPt;
|
||||
WritingMode wm = GetWritingMode();
|
||||
nsRect rect = VisualBorderRectRelativeToSelf();
|
||||
nscoord off = wm.IsVertical() ? rect.x : rect.y;
|
||||
rect += aPt;
|
||||
nsPresContext* presContext = PresContext();
|
||||
|
||||
PaintBorderFlags borderFlags = aBuilder->ShouldSyncDecodeImages()
|
||||
|
@ -249,39 +237,55 @@ nsFieldSetFrame::PaintBorder(
|
|||
this, rect);
|
||||
|
||||
if (nsIFrame* legend = GetLegend()) {
|
||||
// We want to avoid drawing our border under the legend, so clip out the
|
||||
// legend while drawing our border. We don't want to use mLegendRect here,
|
||||
// because we do want to draw our border under the legend's inline-start and
|
||||
// -end margins. And we use GetNormalRect(), not GetRect(), because we do
|
||||
// not want relative positioning applied to the legend to change how our
|
||||
// border looks.
|
||||
nsRect legendRect = legend->GetNormalRect() + aPt;
|
||||
Side legendSide = wm.PhysicalSide(eLogicalSideBStart);
|
||||
nscoord legendBorderWidth =
|
||||
StyleBorder()->GetComputedBorderWidth(legendSide);
|
||||
|
||||
// Use the rect of the legend frame, not mLegendRect, so we draw our
|
||||
// border under the legend's inline-start and -end margins.
|
||||
LogicalRect legendRect(wm, legend->GetRect() + aPt, rect.Size());
|
||||
|
||||
// Compute clipRect using logical coordinates, so that the legend space
|
||||
// will be clipped out of the appropriate physical side depending on mode.
|
||||
LogicalRect clipRect = LogicalRect(wm, rect, rect.Size());
|
||||
DrawTarget* drawTarget = aRenderingContext.GetDrawTarget();
|
||||
// We set up a clip path which has our rect clockwise and the legend rect
|
||||
// counterclockwise, with FILL_WINDING as the fill rule. That will allow us
|
||||
// to paint within our rect but outside the legend rect. For "our rect" we
|
||||
// use our visual overflow rect (relative to ourselves, so it's not affected
|
||||
// by transforms), because we can have borders sticking outside our border
|
||||
// box (e.g. due to border-image-outset).
|
||||
RefPtr<PathBuilder> pathBuilder =
|
||||
drawTarget->CreatePathBuilder(FillRule::FILL_WINDING);
|
||||
int32_t appUnitsPerDevPixel = presContext->AppUnitsPerDevPixel();
|
||||
AppendRectToPath(pathBuilder,
|
||||
NSRectToSnappedRect(GetVisualOverflowRectRelativeToSelf() + aPt,
|
||||
appUnitsPerDevPixel,
|
||||
*drawTarget),
|
||||
true);
|
||||
AppendRectToPath(pathBuilder,
|
||||
NSRectToSnappedRect(legendRect, appUnitsPerDevPixel,
|
||||
*drawTarget),
|
||||
false);
|
||||
RefPtr<Path> clipPath = pathBuilder->Finish();
|
||||
|
||||
gfxContext* gfx = aRenderingContext.ThebesContext();
|
||||
int32_t appUnitsPerDevPixel = presContext->AppUnitsPerDevPixel();
|
||||
|
||||
// draw inline-start portion of the block-start side of the border
|
||||
clipRect.ISize(wm) = legendRect.IStart(wm) - clipRect.IStart(wm);
|
||||
clipRect.BSize(wm) = legendBorderWidth;
|
||||
|
||||
gfx->Save();
|
||||
gfx->Clip(clipPath);
|
||||
gfx->Clip(NSRectToSnappedRect(clipRect.GetPhysicalRect(wm, rect.Size()),
|
||||
appUnitsPerDevPixel, *drawTarget));
|
||||
result &=
|
||||
nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
|
||||
aDirtyRect, rect, mStyleContext, borderFlags);
|
||||
gfx->Restore();
|
||||
|
||||
// draw inline-end portion of the block-start side of the border
|
||||
clipRect = LogicalRect(wm, rect, rect.Size());
|
||||
clipRect.ISize(wm) = clipRect.IEnd(wm) - legendRect.IEnd(wm);
|
||||
clipRect.IStart(wm) = legendRect.IEnd(wm);
|
||||
clipRect.BSize(wm) = legendBorderWidth;
|
||||
|
||||
gfx->Save();
|
||||
gfx->Clip(NSRectToSnappedRect(clipRect.GetPhysicalRect(wm, rect.Size()),
|
||||
appUnitsPerDevPixel, *drawTarget));
|
||||
result &=
|
||||
nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
|
||||
aDirtyRect, rect, mStyleContext, borderFlags);
|
||||
gfx->Restore();
|
||||
|
||||
// draw remainder of the border (omitting the block-start side)
|
||||
clipRect = LogicalRect(wm, rect, rect.Size());
|
||||
clipRect.BStart(wm) += legendBorderWidth;
|
||||
clipRect.BSize(wm) = BSize(wm) - (off + legendBorderWidth);
|
||||
|
||||
gfx->Save();
|
||||
gfx->Clip(NSRectToSnappedRect(clipRect.GetPhysicalRect(wm, rect.Size()),
|
||||
appUnitsPerDevPixel, *drawTarget));
|
||||
result &=
|
||||
nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
|
||||
aDirtyRect, rect, mStyleContext, borderFlags);
|
||||
|
@ -341,6 +345,42 @@ nsFieldSetFrame::GetPrefISize(nsRenderingContext* aRenderingContext)
|
|||
}
|
||||
|
||||
/* virtual */
|
||||
LogicalSize
|
||||
nsFieldSetFrame::ComputeSize(nsRenderingContext *aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags)
|
||||
{
|
||||
LogicalSize result =
|
||||
nsContainerFrame::ComputeSize(aRenderingContext, aWM,
|
||||
aCBSize, aAvailableISize,
|
||||
aMargin, aBorder, aPadding, aFlags);
|
||||
|
||||
// XXX The code below doesn't make sense if the caller's writing mode
|
||||
// is orthogonal to this frame's. Not sure yet what should happen then;
|
||||
// for now, just bail out.
|
||||
if (aWM.IsVertical() != GetWritingMode().IsVertical()) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// Fieldsets never shrink below their min width.
|
||||
|
||||
// If we're a container for font size inflation, then shrink
|
||||
// wrapping inside of us should not apply font size inflation.
|
||||
AutoMaybeDisableFontInflation an(this);
|
||||
|
||||
nscoord minISize = GetMinISize(aRenderingContext);
|
||||
if (minISize > result.ISize(aWM)) {
|
||||
result.ISize(aWM) = minISize;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
||||
ReflowOutput& aDesiredSize,
|
||||
|
@ -388,6 +428,18 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
|||
LogicalSize legendAvailSize = aReflowInput.ComputedSizeWithPadding(legendWM);
|
||||
innerAvailSize.BSize(innerWM) = legendAvailSize.BSize(legendWM) =
|
||||
NS_UNCONSTRAINEDSIZE;
|
||||
NS_ASSERTION(!inner ||
|
||||
nsLayoutUtils::IntrinsicForContainer(aReflowInput.mRenderingContext,
|
||||
inner,
|
||||
nsLayoutUtils::MIN_ISIZE) <=
|
||||
innerAvailSize.ISize(innerWM),
|
||||
"Bogus availSize.ISize; should be bigger");
|
||||
NS_ASSERTION(!legend ||
|
||||
nsLayoutUtils::IntrinsicForContainer(aReflowInput.mRenderingContext,
|
||||
legend,
|
||||
nsLayoutUtils::MIN_ISIZE) <=
|
||||
legendAvailSize.ISize(legendWM),
|
||||
"Bogus availSize.ISize; should be bigger");
|
||||
|
||||
// get our border and padding
|
||||
LogicalMargin border = aReflowInput.ComputedLogicalBorderPadding() -
|
||||
|
@ -551,8 +603,11 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
|||
MOZ_ASSERT_UNREACHABLE("unexpected GetLogicalAlign value");
|
||||
}
|
||||
} else {
|
||||
// otherwise just start-align it.
|
||||
// otherwise make place for the legend
|
||||
mLegendRect.IStart(wm) = innerContentRect.IStart(wm);
|
||||
innerContentRect.ISize(wm) = mLegendRect.ISize(wm);
|
||||
contentRect.ISize(wm) = mLegendRect.ISize(wm) +
|
||||
aReflowInput.ComputedLogicalPadding().IStartEnd(wm);
|
||||
}
|
||||
|
||||
// place the legend
|
||||
|
|
|
@ -24,6 +24,15 @@ public:
|
|||
nsLayoutUtils::IntrinsicISizeType);
|
||||
virtual nscoord GetMinISize(nsRenderingContext* aRenderingContext) override;
|
||||
virtual nscoord GetPrefISize(nsRenderingContext* aRenderingContext) override;
|
||||
virtual mozilla::LogicalSize
|
||||
ComputeSize(nsRenderingContext *aRenderingContext,
|
||||
mozilla::WritingMode aWritingMode,
|
||||
const mozilla::LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const mozilla::LogicalSize& aMargin,
|
||||
const mozilla::LogicalSize& aBorder,
|
||||
const mozilla::LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags) override;
|
||||
virtual nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode) const override;
|
||||
|
||||
/**
|
||||
|
|
|
@ -26,10 +26,7 @@ fieldset { border-right:7px solid blue; font-size: 16px; }
|
|||
|
||||
#test5 { position:fixed; top:12em; width:200px; }
|
||||
#test5 fieldset { background:lime;}
|
||||
/* Percentage margins don't get counted in intrinsic width, so make sure that
|
||||
our fixed-size margins sum to 0, so they also do not affect intrinsic width
|
||||
either. */
|
||||
#test5 .legend { margin-left: 193px; background:pink; margin-right: -193px; }
|
||||
#test5 .legend { margin-left: 193px; background:pink; }
|
||||
|
||||
#test6 { position:fixed; left:20px; top:15em; width:400px; }
|
||||
#test6 fieldset { width:300px; }
|
||||
|
|
Двоичные данные
layout/reftests/forms/fieldset/blue-1x1.png
Двоичные данные
layout/reftests/forms/fieldset/blue-1x1.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 69 B |
|
@ -1,13 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
div {
|
||||
padding: 0;
|
||||
margin: 10px;
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
border: 10px solid;
|
||||
border-image-source: url(blue-1x1.png);
|
||||
border-image-outset: 10px;
|
||||
}
|
||||
</style>
|
||||
<div></div>
|
|
@ -1,13 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
fieldset {
|
||||
padding: 0;
|
||||
margin: 10px;
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
border: 10px solid;
|
||||
border-image-source: url(blue-1x1.png);
|
||||
border-image-outset: 10px;
|
||||
}
|
||||
</style>
|
||||
<fieldset></fieldset>
|
|
@ -1,13 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
fieldset {
|
||||
padding: 0;
|
||||
margin: 10px;
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
border: 10px solid;
|
||||
border-image-source: url(blue-1x1.png);
|
||||
border-image-outset: 10px;
|
||||
}
|
||||
</style>
|
||||
<fieldset><legend></legend></fieldset>
|
|
@ -1,14 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
div {
|
||||
padding: 0;
|
||||
margin: 10px;
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
border: 10px solid;
|
||||
border-image-source: url(blue-1x1.png);
|
||||
border-image-outset: 10px;
|
||||
transform: scale(0.5);
|
||||
}
|
||||
</style>
|
||||
<div></div>
|
|
@ -1,14 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
fieldset {
|
||||
padding: 0;
|
||||
margin: 10px;
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
border: 10px solid;
|
||||
border-image-source: url(blue-1x1.png);
|
||||
border-image-outset: 10px;
|
||||
transform: scale(0.5);
|
||||
}
|
||||
</style>
|
||||
<fieldset></fieldset>
|
|
@ -1,14 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
fieldset {
|
||||
padding: 0;
|
||||
margin: 10px;
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
border: 10px solid;
|
||||
border-image-source: url(blue-1x1.png);
|
||||
border-image-outset: 10px;
|
||||
transform: scale(0.5);
|
||||
}
|
||||
</style>
|
||||
<fieldset><legend></legend></fieldset>
|
|
@ -1,4 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<fieldset style="width: -moz-fit-content">
|
||||
Longwordgoeshere
|
||||
</fieldset>
|
|
@ -1,4 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<fieldset style="width: 0">
|
||||
Longwordgoeshere
|
||||
</fieldset>
|
|
@ -1,6 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<body style="width: 0">
|
||||
<fieldset style="width: 0">
|
||||
Longwordgoeshere
|
||||
</fieldset>
|
||||
</body>
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<fieldset style="width: -moz-fit-content">‌<!-- To give us the right height --></fieldset>
|
|
@ -1,4 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<fieldset style="width: 0; min-width: 0">
|
||||
<div style="visibility: hidden">Longwordgoeshere</div>
|
||||
</fieldset>
|
|
@ -1,6 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<body style="width: 0">
|
||||
<fieldset style="min-width: 0">
|
||||
<div style="visibility: hidden">Longwordgoeshere</div>
|
||||
</fieldset>
|
||||
</body>
|
|
@ -1,15 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
fieldset {
|
||||
min-width: 0;
|
||||
width: 0;
|
||||
}
|
||||
legend {
|
||||
width: 100px;
|
||||
height: 20px;
|
||||
background: white;
|
||||
}
|
||||
</style>
|
||||
<fieldset>
|
||||
<legend></legend>
|
||||
</fieldset>
|
|
@ -1,14 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
fieldset {
|
||||
min-width: 0;
|
||||
width: 0;
|
||||
}
|
||||
legend {
|
||||
width: 100px;
|
||||
height: 20px;
|
||||
}
|
||||
</style>
|
||||
<fieldset>
|
||||
<legend></legend>
|
||||
</fieldset>
|
|
@ -8,20 +8,9 @@ fuzzy-if(skiaContent,2,13) == dynamic-legend-scroll-1.html dynamic-legend-scroll
|
|||
fuzzy-if(winWidget&&!layersGPUAccelerated,121,276) == positioned-container-1.html positioned-container-1-ref.html
|
||||
== relpos-legend-1.html relpos-legend-1-ref.html
|
||||
== relpos-legend-2.html relpos-legend-2-ref.html
|
||||
== relpos-legend-3.html relpos-legend-3-ref.html
|
||||
== relpos-legend-4.html relpos-legend-4-ref.html
|
||||
== sticky-legend-1.html sticky-legend-1-ref.html
|
||||
fuzzy-if(skiaContent,1,40768) == abs-pos-child-sizing.html abs-pos-child-sizing-ref.html
|
||||
== overflow-hidden.html overflow-hidden-ref.html
|
||||
== legend-rtl.html legend-rtl-ref.html
|
||||
== fieldset-grid-001.html fieldset-grid-001-ref.html
|
||||
== fieldset-flexbox-001.html fieldset-flexbox-001-ref.html
|
||||
== fieldset-min-width-1a.html fieldset-min-width-1-ref.html
|
||||
== fieldset-min-width-1b.html fieldset-min-width-1-ref.html
|
||||
== fieldset-min-width-2a.html fieldset-min-width-2-ref.html
|
||||
== fieldset-min-width-2b.html fieldset-min-width-2-ref.html
|
||||
== legend-overlapping-right-border-1.html legend-overlapping-right-border-1-ref.html
|
||||
== fieldset-border-image-1a.html fieldset-border-image-1-ref.html
|
||||
== fieldset-border-image-1b.html fieldset-border-image-1-ref.html
|
||||
== fieldset-border-image-2a.html fieldset-border-image-2-ref.html
|
||||
== fieldset-border-image-2b.html fieldset-border-image-2-ref.html
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<body>
|
||||
<fieldset>
|
||||
<legend><div style="position:relative; left:20px">Legend</div></legend>
|
||||
</fieldset>
|
||||
</body>
|
||||
</html>
|
|
@ -1,8 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<body>
|
||||
<fieldset>
|
||||
<legend style="position:relative; left:20px">Legend</legend>
|
||||
</fieldset>
|
||||
</body>
|
||||
</html>
|
|
@ -1,8 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<body>
|
||||
<fieldset>
|
||||
<legend><span style="position:relative; left:20px">Legend</span></legend>
|
||||
</fieldset>
|
||||
</body>
|
||||
</html>
|
|
@ -1,8 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<body>
|
||||
<fieldset>
|
||||
<legend style="display:inline; position:relative; left:20px">Legend</legend>
|
||||
</fieldset>
|
||||
</body>
|
||||
</html>
|
|
@ -71,7 +71,6 @@ fieldset {
|
|||
padding-inline-start: 0.625em;
|
||||
padding-inline-end: 0.625em;
|
||||
border: 2px groove ThreeDLightShadow;
|
||||
min-width: -moz-min-content;
|
||||
}
|
||||
|
||||
label {
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
[min-width-not-important.html]
|
||||
type: reftest
|
||||
expected: FAIL
|
Загрузка…
Ссылка в новой задаче