зеркало из https://github.com/mozilla/pjs.git
Bug 157445. Be more aggressive about making visibility:hidden elements have visible views. r+sr=bzbarsky
This commit is contained in:
Родитель
7cc3ad9cea
Коммит
49dfc64596
|
@ -1224,6 +1224,13 @@ public:
|
|||
void* aPropertyValue) = 0;
|
||||
#endif // IBMBIDI
|
||||
|
||||
/**
|
||||
* Return PR_TRUE if and only if this frame obeys visibility:hidden.
|
||||
* if it does not, then nsContainerFrame will hide its view even though
|
||||
* this means children can't be made visible again.
|
||||
*/
|
||||
virtual PRBool SupportsVisibilityHidden() { return PR_TRUE; }
|
||||
|
||||
protected:
|
||||
// Members
|
||||
nsRect mRect;
|
||||
|
|
|
@ -223,6 +223,8 @@ public:
|
|||
*/
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
virtual PRBool SupportsVisibilityHidden() { return PR_FALSE; }
|
||||
|
||||
#ifdef DEBUG
|
||||
// nsIFrameDebug
|
||||
NS_IMETHOD GetFrameName(nsAString& aResult) const;
|
||||
|
|
|
@ -779,25 +779,13 @@ nsContainerFrame::SyncFrameViewProperties(nsIPresContext* aPresContext,
|
|||
viewIsVisible = PR_FALSE;
|
||||
}
|
||||
else if (NS_STYLE_VISIBILITY_HIDDEN == vis->mVisible) {
|
||||
// If it has a widget, hide the view because the widget can't deal with it
|
||||
nsCOMPtr<nsIWidget> widget;
|
||||
aView->GetWidget(*getter_AddRefs(widget));
|
||||
if (widget) {
|
||||
// If it's a scrollable frame that can't hide its scrollbars,
|
||||
// hide the view. This means that child elements can't override
|
||||
// their parent's visibility, but it's not practical to leave it
|
||||
// visible in all cases because the scrollbars will be showing
|
||||
if (!aFrame->SupportsVisibilityHidden()) {
|
||||
viewIsVisible = PR_FALSE;
|
||||
}
|
||||
else {
|
||||
// If it's a scroll frame or a list control frame which is derived from the scrollframe,
|
||||
// then hide the view. This means that
|
||||
// child elements can't override their parent's visibility, but
|
||||
// it's not practical to leave it visible in all cases because
|
||||
// the scrollbars will be showing
|
||||
nsCOMPtr<nsIAtom> frameType;
|
||||
aFrame->GetFrameType(getter_AddRefs(frameType));
|
||||
|
||||
if (frameType == nsLayoutAtoms::scrollFrame || frameType == nsLayoutAtoms::listControlFrame) {
|
||||
viewIsVisible = PR_FALSE;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// if the view is for a popup, don't show the view if the popup is closed
|
||||
nsCOMPtr<nsIWidget> widget;
|
||||
|
|
|
@ -1224,6 +1224,13 @@ public:
|
|||
void* aPropertyValue) = 0;
|
||||
#endif // IBMBIDI
|
||||
|
||||
/**
|
||||
* Return PR_TRUE if and only if this frame obeys visibility:hidden.
|
||||
* if it does not, then nsContainerFrame will hide its view even though
|
||||
* this means children can't be made visible again.
|
||||
*/
|
||||
virtual PRBool SupportsVisibilityHidden() { return PR_TRUE; }
|
||||
|
||||
protected:
|
||||
// Members
|
||||
nsRect mRect;
|
||||
|
|
|
@ -779,25 +779,13 @@ nsContainerFrame::SyncFrameViewProperties(nsIPresContext* aPresContext,
|
|||
viewIsVisible = PR_FALSE;
|
||||
}
|
||||
else if (NS_STYLE_VISIBILITY_HIDDEN == vis->mVisible) {
|
||||
// If it has a widget, hide the view because the widget can't deal with it
|
||||
nsCOMPtr<nsIWidget> widget;
|
||||
aView->GetWidget(*getter_AddRefs(widget));
|
||||
if (widget) {
|
||||
// If it's a scrollable frame that can't hide its scrollbars,
|
||||
// hide the view. This means that child elements can't override
|
||||
// their parent's visibility, but it's not practical to leave it
|
||||
// visible in all cases because the scrollbars will be showing
|
||||
if (!aFrame->SupportsVisibilityHidden()) {
|
||||
viewIsVisible = PR_FALSE;
|
||||
}
|
||||
else {
|
||||
// If it's a scroll frame or a list control frame which is derived from the scrollframe,
|
||||
// then hide the view. This means that
|
||||
// child elements can't override their parent's visibility, but
|
||||
// it's not practical to leave it visible in all cases because
|
||||
// the scrollbars will be showing
|
||||
nsCOMPtr<nsIAtom> frameType;
|
||||
aFrame->GetFrameType(getter_AddRefs(frameType));
|
||||
|
||||
if (frameType == nsLayoutAtoms::scrollFrame || frameType == nsLayoutAtoms::listControlFrame) {
|
||||
viewIsVisible = PR_FALSE;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// if the view is for a popup, don't show the view if the popup is closed
|
||||
nsCOMPtr<nsIWidget> widget;
|
||||
|
|
|
@ -123,6 +123,8 @@ public:
|
|||
*/
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
virtual PRBool SupportsVisibilityHidden() { return PR_FALSE; }
|
||||
|
||||
// nsIScrollableFrame
|
||||
NS_IMETHOD SetScrolledFrame(nsIPresContext* aPresContext, nsIFrame *aScrolledFrame);
|
||||
NS_IMETHOD GetScrolledFrame(nsIPresContext* aPresContext, nsIFrame *&aScrolledFrame) const;
|
||||
|
@ -146,7 +148,6 @@ public:
|
|||
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void) { return NS_OK; }
|
||||
NS_IMETHOD_(nsrefcnt) Release(void) { return NS_OK; }
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsAString& aResult) const;
|
||||
|
|
|
@ -223,6 +223,8 @@ public:
|
|||
*/
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
virtual PRBool SupportsVisibilityHidden() { return PR_FALSE; }
|
||||
|
||||
#ifdef DEBUG
|
||||
// nsIFrameDebug
|
||||
NS_IMETHOD GetFrameName(nsAString& aResult) const;
|
||||
|
|
Загрузка…
Ссылка в новой задаче