зеркало из https://github.com/mozilla/gecko-dev.git
Bug 289431. Don't include overflow from children in frames that are overflow:-moz-hidden-unscrollable. r+sr=bzbarsky,a=brendan
This commit is contained in:
Родитель
98d2ea1e3c
Коммит
0a0d19cb3f
|
@ -4353,14 +4353,24 @@ nsIFrame::FinishAndStoreOverflow(nsRect* aOverflowArea, nsSize aNewSize)
|
||||||
aOverflowArea->Contains(nsRect(nsPoint(0, 0), aNewSize)),
|
aOverflowArea->Contains(nsRect(nsPoint(0, 0), aNewSize)),
|
||||||
"Computed overflow area must contain frame bounds");
|
"Computed overflow area must contain frame bounds");
|
||||||
|
|
||||||
|
PRBool geometricOverflow =
|
||||||
|
aOverflowArea->x < 0 || aOverflowArea->y < 0 ||
|
||||||
|
aOverflowArea->XMost() > aNewSize.width || aOverflowArea->YMost() > aNewSize.height;
|
||||||
|
// Clear geometric overflow area if we clip our children
|
||||||
|
NS_ASSERTION((GetStyleDisplay()->mOverflowY == NS_STYLE_OVERFLOW_CLIP) ==
|
||||||
|
(GetStyleDisplay()->mOverflowX == NS_STYLE_OVERFLOW_CLIP),
|
||||||
|
"If one overflow is clip, the other should be too");
|
||||||
|
if (geometricOverflow &&
|
||||||
|
GetStyleDisplay()->mOverflowX == NS_STYLE_OVERFLOW_CLIP) {
|
||||||
|
*aOverflowArea = nsRect(nsPoint(0, 0), aNewSize);
|
||||||
|
geometricOverflow = PR_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
PRBool hasOutline;
|
PRBool hasOutline;
|
||||||
nsRect outlineRect(ComputeOutlineRect(this, &hasOutline, *aOverflowArea));
|
nsRect outlineRect(ComputeOutlineRect(this, &hasOutline, *aOverflowArea));
|
||||||
|
|
||||||
if (hasOutline ||
|
if (hasOutline || geometricOverflow) {
|
||||||
(aOverflowArea->x < 0) ||
|
// Throw out any overflow if we're -moz-hidden-unscrollable
|
||||||
(aOverflowArea->y < 0) ||
|
|
||||||
(aOverflowArea->XMost() > aNewSize.width) ||
|
|
||||||
(aOverflowArea->YMost() > aNewSize.height)) {
|
|
||||||
mState |= NS_FRAME_OUTSIDE_CHILDREN;
|
mState |= NS_FRAME_OUTSIDE_CHILDREN;
|
||||||
nsRect* overflowArea = GetOverflowAreaProperty(PR_TRUE);
|
nsRect* overflowArea = GetOverflowAreaProperty(PR_TRUE);
|
||||||
NS_ASSERTION(overflowArea, "should have created rect");
|
NS_ASSERTION(overflowArea, "should have created rect");
|
||||||
|
|
|
@ -804,6 +804,16 @@ nsIFrame::Layout(nsBoxLayoutState& aState)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PRBool
|
||||||
|
nsBox::DoesClipChildren()
|
||||||
|
{
|
||||||
|
const nsStyleDisplay* display = GetStyleDisplay();
|
||||||
|
NS_ASSERTION((display->mOverflowY == NS_STYLE_OVERFLOW_CLIP) ==
|
||||||
|
(display->mOverflowX == NS_STYLE_OVERFLOW_CLIP),
|
||||||
|
"If one overflow is clip, the other should be too");
|
||||||
|
return display->mOverflowX == NS_STYLE_OVERFLOW_CLIP;
|
||||||
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsBox::SyncLayout(nsBoxLayoutState& aState)
|
nsBox::SyncLayout(nsBoxLayoutState& aState)
|
||||||
{
|
{
|
||||||
|
|
|
@ -110,7 +110,7 @@ public:
|
||||||
* Returns PR_TRUE if this box clips its children, e.g., if this box is an sc
|
* Returns PR_TRUE if this box clips its children, e.g., if this box is an sc
|
||||||
rollbox.
|
rollbox.
|
||||||
*/
|
*/
|
||||||
virtual PRBool DoesClipChildren() { return PR_FALSE; }
|
virtual PRBool DoesClipChildren();
|
||||||
virtual PRBool ComputesOwnOverflowArea() = 0;
|
virtual PRBool ComputesOwnOverflowArea() = 0;
|
||||||
|
|
||||||
NS_HIDDEN_(nsresult) SyncLayout(nsBoxLayoutState& aBoxLayoutState);
|
NS_HIDDEN_(nsresult) SyncLayout(nsBoxLayoutState& aBoxLayoutState);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче