mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 885009. Handle clip-all-descendants cases with rounded corners. r=mats
--HG-- extra : rebase_source : 284587e5fa70532bc6435f987f03c1282edc9cb8
This commit is contained in:
parent
269f816a9e
commit
71ed3a62d3
@ -53,9 +53,14 @@ DisplayListClipState::ClipContainingBlockDescendants(const nsRect& aRect,
|
||||
|
||||
void
|
||||
DisplayListClipState::ClipContentDescendants(const nsRect& aRect,
|
||||
const nscoord* aRadii,
|
||||
DisplayItemClip& aClipOnStack)
|
||||
{
|
||||
aClipOnStack.SetTo(aRect);
|
||||
if (aRadii) {
|
||||
aClipOnStack.SetTo(aRect, aRadii);
|
||||
} else {
|
||||
aClipOnStack.SetTo(aRect);
|
||||
}
|
||||
if (mClipContentDescendants) {
|
||||
aClipOnStack.IntersectWith(*mClipContentDescendants);
|
||||
}
|
||||
|
@ -79,6 +79,7 @@ private:
|
||||
DisplayItemClip& aClipOnStack);
|
||||
|
||||
void ClipContentDescendants(const nsRect& aRect,
|
||||
const nscoord* aRadii,
|
||||
DisplayItemClip& aClipOnStack);
|
||||
|
||||
/**
|
||||
@ -150,7 +151,7 @@ public:
|
||||
* the result, stored in aClipOnStack.
|
||||
*/
|
||||
void ClipContainingBlockDescendants(const nsRect& aRect,
|
||||
const nscoord* aRadii)
|
||||
const nscoord* aRadii = nullptr)
|
||||
{
|
||||
NS_ASSERTION(!mRestored, "Already restored!");
|
||||
NS_ASSERTION(!mClipUsed, "mClip already used");
|
||||
@ -158,12 +159,13 @@ public:
|
||||
mState.ClipContainingBlockDescendants(aRect, aRadii, mClip);
|
||||
}
|
||||
|
||||
void ClipContentDescendants(const nsRect& aRect)
|
||||
void ClipContentDescendants(const nsRect& aRect,
|
||||
const nscoord* aRadii = nullptr)
|
||||
{
|
||||
NS_ASSERTION(!mRestored, "Already restored!");
|
||||
NS_ASSERTION(!mClipUsed, "mClip already used");
|
||||
mClipUsed = true;
|
||||
mState.ClipContentDescendants(aRect, mClip);
|
||||
mState.ClipContentDescendants(aRect, aRadii, mClip);
|
||||
}
|
||||
|
||||
/**
|
||||
|
7
layout/generic/crashtests/885009-1.html
Normal file
7
layout/generic/crashtests/885009-1.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
</head>
|
||||
<body style="display: -moz-inline-stack; overflow: scroll; border-style: solid; border-radius: 4px;"></body>
|
||||
</html>
|
@ -497,3 +497,4 @@ test-pref(layout.css.flexbox.enabled,true) load 862947-1.html
|
||||
needs-focus pref(accessibility.browsewithcaret,true) load 868906.html
|
||||
test-pref(layout.css.flexbox.enabled,true) load 866547-1.html
|
||||
asserts(1-4) test-pref(layout.css.flexbox.enabled,true) load 876074-1.html # bug 876749
|
||||
load 885009-1.html
|
||||
|
@ -2251,18 +2251,13 @@ nsGfxScrollFrameInner::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
} else {
|
||||
nsRect clip = mScrollPort + aBuilder->ToReferenceFrame(mOuter);
|
||||
nscoord radii[8];
|
||||
bool haveRadii = mOuter->GetPaddingBoxBorderRadii(radii);
|
||||
// Our override of GetBorderRadii ensures we never have a radius at
|
||||
// the corners where we have a scrollbar.
|
||||
if (mClipAllDescendants) {
|
||||
#ifdef DEBUG
|
||||
nscoord radii[8];
|
||||
#endif
|
||||
NS_ASSERTION(!mOuter->GetPaddingBoxBorderRadii(radii),
|
||||
"Roots with radii not supported");
|
||||
clipState.ClipContentDescendants(clip);
|
||||
clipState.ClipContentDescendants(clip, haveRadii ? radii : nullptr);
|
||||
} else {
|
||||
nscoord radii[8];
|
||||
bool haveRadii = mOuter->GetPaddingBoxBorderRadii(radii);
|
||||
clipState.ClipContainingBlockDescendants(clip, haveRadii ? radii : nullptr);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user