Backed out changeset fd5cb917b6eb (bug 1412179) for Wr failures at /html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-vertical.html

This commit is contained in:
Coroiu Cristina 2019-04-13 11:04:15 +03:00
parent 7f9d62dd87
commit 3b2b29f924
3 changed files with 4 additions and 33 deletions

View File

@ -642,14 +642,6 @@ class MOZ_RAII SpaceAndClipChainHelper final {
aBuilder.mCurrentSpaceAndClipChain.space = aSpatialId;
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
}
SpaceAndClipChainHelper(DisplayListBuilder& aBuilder,
wr::WrClipChainId aClipChainId
MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
: mBuilder(aBuilder),
mOldSpaceAndClipChain(aBuilder.mCurrentSpaceAndClipChain) {
aBuilder.mCurrentSpaceAndClipChain.clip_chain = aClipChainId.id;
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
}
~SpaceAndClipChainHelper() {
mBuilder.mCurrentSpaceAndClipChain = mOldSpaceAndClipChain;

View File

@ -167,36 +167,15 @@ bool nsDisplayFieldSetBorder::CreateWebRenderCommands(
auto frame = static_cast<nsFieldSetFrame*>(mFrame);
auto offset = ToReferenceFrame();
nsRect rect;
Maybe<wr::SpaceAndClipChainHelper> clipOut;
if (nsIFrame* legend = frame->GetLegend()) {
rect = frame->VisualBorderRectRelativeToSelf() + offset;
// Legends require a "negative" clip around the text, which WR doesn't
// support yet.
nsRect legendRect = legend->GetNormalRect() + offset;
// Make sure we clip all of the border in case the legend is smaller.
nscoord borderTopWidth = frame->GetUsedBorder().top;
if (legendRect.height < borderTopWidth) {
legendRect.height = borderTopWidth;
legendRect.y = offset.y;
}
if (!legendRect.IsEmpty()) {
// We need to clip out the part of the border where the legend would go
auto appUnitsPerDevPixel = frame->PresContext()->AppUnitsPerDevPixel();
auto layoutRect = wr::ToRoundedLayoutRect(
LayoutDeviceRect::FromAppUnits(rect, appUnitsPerDevPixel));
wr::ComplexClipRegion region;
region.rect = wr::ToRoundedLayoutRect(
LayoutDeviceRect::FromAppUnits(legendRect, appUnitsPerDevPixel));
region.mode = wr::ClipMode::ClipOut;
region.radii = wr::EmptyBorderRadius();
nsTArray<mozilla::wr::ComplexClipRegion> array{region};
auto clip = aBuilder.DefineClip(Nothing(), layoutRect, &array, nullptr);
auto clipChain = aBuilder.DefineClipChain({clip});
clipOut.emplace(aBuilder, clipChain);
return false;
}
} else {
rect = nsRect(offset, frame->GetRect().Size());

View File

@ -40,7 +40,7 @@ fuzzy(0-13,0-9445) fuzzy-if(d2d,0-13,0-10926) fuzzy-if(webrender,14-15,11263-132
== overflow-not-scrollable-2.html overflow-not-scrollable-2-ref.html
fuzzy-if(webrender,0-1,0-655) == 611574-1.html 611574-1-ref.html
fuzzy-if(webrender,0-4,0-144) == 611574-2.html 611574-2-ref.html
fuzzy-if(winWidget,0-5,0-30) fuzzy-if(skiaContent,0-16,0-10) == fieldset.html fieldset-ref.html # minor anti-aliasing problem on Windows
fuzzy-if(winWidget,0-5,0-30) fuzzy-if(skiaContent,0-16,0-10) fuzzy-if(webrender,20-34,82-84) == fieldset.html fieldset-ref.html # minor anti-aliasing problem on Windows
fuzzy-if(winWidget,0-5,0-30) fuzzy-if(skiaContent,0-16,0-10) fails-if(webrender) == fieldset-inset.html fieldset-inset-ref.html # minor anti-aliasing problem on Windows
== 1178575.html 1178575-ref.html
== 1178575-2.html 1178575-2-ref.html