Bug 201299. Make lazy scrollbars more selective to avoid XUL tree and listbox problems. r+sr=bzbarsky
git-svn-id: svn://10.0.0.236/trunk@140907 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -175,6 +175,7 @@ XUL_ATOM(increment, "increment")
|
||||
XUL_ATOM(pageincrement, "pageincrement")
|
||||
XUL_ATOM(thumb, "thumb")
|
||||
XUL_ATOM(toggled, "toggled")
|
||||
XUL_ATOM(lazy, "lazy")
|
||||
XUL_ATOM(grippy, "grippy")
|
||||
XUL_ATOM(splitter, "splitter")
|
||||
XUL_ATOM(collapse, "collapse")
|
||||
|
||||
@@ -419,6 +419,11 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
|
||||
}
|
||||
}
|
||||
|
||||
// Add the "lazy" attribute if the content is non-XUL (and therefore
|
||||
// we can be sure no mediator is involved). Style rules in xul.css
|
||||
// make sure that "lazy" scrollbars are XBL-bound only when needed.
|
||||
PRBool lazyScrollbar = !mContent->IsContentOfType(nsIContent::eXUL);
|
||||
|
||||
// create horzontal scrollbar
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIElementFactory> elementFactory =
|
||||
@@ -444,6 +449,10 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
|
||||
content->SetAttr(kNameSpaceID_None, nsXULAtoms::collapsed,
|
||||
NS_LITERAL_STRING("true"), PR_FALSE);
|
||||
|
||||
if (lazyScrollbar)
|
||||
content->SetAttr(kNameSpaceID_None, nsXULAtoms::lazy,
|
||||
NS_LITERAL_STRING("true"), PR_FALSE);
|
||||
|
||||
aAnonymousChildren.AppendElement(content);
|
||||
|
||||
// create vertical scrollbar
|
||||
@@ -455,6 +464,10 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
|
||||
content->SetAttr(kNameSpaceID_None, nsXULAtoms::collapsed,
|
||||
NS_LITERAL_STRING("true"), PR_FALSE);
|
||||
|
||||
if (lazyScrollbar)
|
||||
content->SetAttr(kNameSpaceID_None, nsXULAtoms::lazy,
|
||||
NS_LITERAL_STRING("true"), PR_FALSE);
|
||||
|
||||
aAnonymousChildren.AppendElement(content);
|
||||
|
||||
// XXX For GFX never have scrollbars
|
||||
|
||||
@@ -419,6 +419,11 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
|
||||
}
|
||||
}
|
||||
|
||||
// Add the "lazy" attribute if the content is non-XUL (and therefore
|
||||
// we can be sure no mediator is involved). Style rules in xul.css
|
||||
// make sure that "lazy" scrollbars are XBL-bound only when needed.
|
||||
PRBool lazyScrollbar = !mContent->IsContentOfType(nsIContent::eXUL);
|
||||
|
||||
// create horzontal scrollbar
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIElementFactory> elementFactory =
|
||||
@@ -444,6 +449,10 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
|
||||
content->SetAttr(kNameSpaceID_None, nsXULAtoms::collapsed,
|
||||
NS_LITERAL_STRING("true"), PR_FALSE);
|
||||
|
||||
if (lazyScrollbar)
|
||||
content->SetAttr(kNameSpaceID_None, nsXULAtoms::lazy,
|
||||
NS_LITERAL_STRING("true"), PR_FALSE);
|
||||
|
||||
aAnonymousChildren.AppendElement(content);
|
||||
|
||||
// create vertical scrollbar
|
||||
@@ -455,6 +464,10 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
|
||||
content->SetAttr(kNameSpaceID_None, nsXULAtoms::collapsed,
|
||||
NS_LITERAL_STRING("true"), PR_FALSE);
|
||||
|
||||
if (lazyScrollbar)
|
||||
content->SetAttr(kNameSpaceID_None, nsXULAtoms::lazy,
|
||||
NS_LITERAL_STRING("true"), PR_FALSE);
|
||||
|
||||
aAnonymousChildren.AppendElement(content);
|
||||
|
||||
// XXX For GFX never have scrollbars
|
||||
|
||||
@@ -723,8 +723,11 @@ scrollbar {
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
scrollbar[collapsed="true"],
|
||||
scrollbar[moz-collapsed="true"] {
|
||||
/* Scrollbars which have been marked 'lazy' are unbound while
|
||||
collapsed; this saves anonymous content creation for scrollbars
|
||||
which are not visible */
|
||||
scrollbar[lazy="true"][collapsed="true"],
|
||||
scrollbar[lazy="true"][moz-collapsed="true"] {
|
||||
-moz-binding: none;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user