Land bug 72747 in pieces: Simplify the mechanisms used to prevent framesets from having scrollbars and used to implement the scrolling attribute on frames and iframes. Implement scrolling='yes'. b=72747 r+sr=roc

git-svn-id: svn://10.0.0.236/trunk@161744 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%dbaron.org
2004-09-04 06:53:36 +00:00
parent 22aae5389e
commit b8499fbfc0
15 changed files with 154 additions and 262 deletions

View File

@@ -3824,7 +3824,6 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
// for print-preview, but not when printing), then create a scroll frame that
// will act as the scrolling mechanism for the viewport.
// XXX Do we even need a viewport when printing to a printer?
PRBool isScrollable = PR_TRUE;
//isScrollable = PR_FALSE;
@@ -3837,8 +3836,6 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
// 2) NS_STYLE_OVERFLOW_AUTO = scrollbars appear if needed
// 3) NS_STYLE_OVERFLOW_SCROLL = scrollbars always
// Only need to create a scroll frame/view for cases 2 and 3.
// Currently OVERFLOW_SCROLL isn't honored, as
// scrollportview::SetScrollPref is not implemented.
PRBool isHTML = aDocElement->IsContentOfType(nsIContent::eHTML);
PRBool isXUL = PR_FALSE;
@@ -3848,28 +3845,13 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
}
// Never create scrollbars for XUL documents
#ifdef MOZ_XUL
if (isXUL) {
isScrollable = PR_FALSE;
} else
#endif
{
nsresult rv;
if (aPresContext) {
nsCOMPtr<nsISupports> container = aPresContext->GetContainer();
if (container) {
nsCOMPtr<nsIScrollable> scrollableContainer = do_QueryInterface(container, &rv);
if (NS_SUCCEEDED(rv) && scrollableContainer) {
PRInt32 scrolling = -1;
// XXX We should get prefs for X and Y and deal with these independently!
scrollableContainer->GetCurrentScrollbarPreferences(nsIScrollable::ScrollOrientation_Y,&scrolling);
if (nsIScrollable::Scrollbar_Never == scrolling) {
isScrollable = PR_FALSE;
}
// XXX NS_STYLE_OVERFLOW_SCROLL should create 'always on' scrollbars
}
}
}
PRBool isScrollable = !isXUL;
// Never create scrollbars for frameset documents.
if (isHTML) {
nsCOMPtr<nsIHTMLDocument> htmlDoc = do_QueryInterface(mDocument);
if (htmlDoc && htmlDoc->GetIsFrameset())
isScrollable = PR_FALSE;
}
if (isPaginated) {