From 3b2b29f924f467089617c92cc3ad3aa7b490383e Mon Sep 17 00:00:00 2001 From: Coroiu Cristina Date: Sat, 13 Apr 2019 11:04:15 +0300 Subject: [PATCH] Backed out changeset fd5cb917b6eb (bug 1412179) for Wr failures at /html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-vertical.html --- gfx/webrender_bindings/WebRenderAPI.h | 8 -------- layout/forms/nsFieldSetFrame.cpp | 27 +++---------------------- layout/reftests/box-shadow/reftest.list | 2 +- 3 files changed, 4 insertions(+), 33 deletions(-) diff --git a/gfx/webrender_bindings/WebRenderAPI.h b/gfx/webrender_bindings/WebRenderAPI.h index f8975b92f352..586fa038bb69 100644 --- a/gfx/webrender_bindings/WebRenderAPI.h +++ b/gfx/webrender_bindings/WebRenderAPI.h @@ -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; diff --git a/layout/forms/nsFieldSetFrame.cpp b/layout/forms/nsFieldSetFrame.cpp index 4f9c25a9bde0..d54b3bad1225 100644 --- a/layout/forms/nsFieldSetFrame.cpp +++ b/layout/forms/nsFieldSetFrame.cpp @@ -167,36 +167,15 @@ bool nsDisplayFieldSetBorder::CreateWebRenderCommands( auto frame = static_cast(mFrame); auto offset = ToReferenceFrame(); nsRect rect; - Maybe 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 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()); diff --git a/layout/reftests/box-shadow/reftest.list b/layout/reftests/box-shadow/reftest.list index 58af6c8a2162..57cc2997f8a7 100644 --- a/layout/reftests/box-shadow/reftest.list +++ b/layout/reftests/box-shadow/reftest.list @@ -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