diff --git a/mozilla/accessible/src/base/nsAccessible.cpp b/mozilla/accessible/src/base/nsAccessible.cpp index 8d1e4902fa1..e09a989f563 100644 --- a/mozilla/accessible/src/base/nsAccessible.cpp +++ b/mozilla/accessible/src/base/nsAccessible.cpp @@ -48,7 +48,7 @@ public: nsIFrame* GetChildBefore(nsIFrame* aParent, nsIFrame* aChild); PRInt32 GetCount(nsIFrame* aFrame); - static PRBool ShouldSkip(nsIPresContext* aContext, nsIAtom* aList, nsIFrame* aStart, nsIFrame* aNext); + static PRBool IsSameContent(nsIFrame* aFrame1, nsIFrame* aFrame2); static void GetAccessible(nsIFrame* aFrame, nsCOMPtr& aAccessible, nsCOMPtr& aContent); nsCOMPtr mPresContext; @@ -92,14 +92,10 @@ nsIFrame* nsFrameTreeWalker::GetNextSibling(nsIFrame* aFrame) // get next sibling nsIFrame* next = nsnull; aFrame->GetNextSibling(&next); - nsIAtom* list = nsnull; - mOwner->GetListAtomForFrame(aFrame, list); - // skip any frames with the same content node - while(ShouldSkip(mPresContext, list, aFrame, next)) + while(IsSameContent(aFrame,next)) next->GetNextSibling(&next); - // if failed if (!next) @@ -125,11 +121,7 @@ nsIFrame* nsFrameTreeWalker::GetNextSibling(nsIFrame* aFrame) return nsnull; } else { // next on parent - nsIFrame* n = GetNextSibling(parent); - if (ShouldSkip(mPresContext, list, aFrame, n)) - return GetNextSibling(n); - else - return n; + return GetNextSibling(parent); } } @@ -147,19 +139,11 @@ nsIFrame* nsFrameTreeWalker::GetNextSibling(nsIFrame* aFrame) nsIFrame* first = GetFirstChild(next); // if found - if (first) { - if (ShouldSkip(mPresContext, list, aFrame, first)) - return GetNextSibling(first); - else - return first; - } + if (first) + return first; // call next on next - nsIFrame* n = GetNextSibling(next); - if (ShouldSkip(mPresContext, list, aFrame, next)) - return GetNextSibling(n); - else - return n; + return GetNextSibling(next); } nsIFrame* nsFrameTreeWalker::GetFirstChild(nsIFrame* aFrame) @@ -198,10 +182,7 @@ nsIFrame* nsFrameTreeWalker::GetFirstChild(nsIFrame* aFrame) child->GetNextSibling(&next); // skip children with duplicate content nodes - nsIAtom* list = nsnull; - mOwner->GetListAtomForFrame(child, list); - - while(ShouldSkip(mPresContext, list, child, next)) + while(IsSameContent(child,next)) next->GetNextSibling(&next); child = next; @@ -306,31 +287,23 @@ void nsFrameTreeWalker::GetAccessible(nsIFrame* aFrame, nsCOMPtr& if (!aAccessible) aAccessible = do_QueryInterface(aContent); - // if (aAccessible) - // printf("Found accessible!\n"); + if (aAccessible) + printf("Found accessible!\n"); } -PRBool nsFrameTreeWalker::ShouldSkip(nsIPresContext* aContext, nsIAtom* aList, nsIFrame* aStart, nsIFrame* aNext) +PRBool nsFrameTreeWalker::IsSameContent(nsIFrame* aFrame1, nsIFrame* aFrame2) { - if (!aStart || !aNext) + if (!aFrame1 || !aFrame2) return PR_FALSE; - // is content the same? If so skip it nsCOMPtr content1; nsCOMPtr content2; - aStart->GetContent(getter_AddRefs(content1)); - aNext->GetContent(getter_AddRefs(content2)); - - if (content1 == content2 && content1 != nsnull) { - // does it have childen? It it does then don't skip it - nsIFrame* child = nsnull; - aNext->FirstChild(aContext, aList, &child); - if (child) - return PR_FALSE; + aFrame1->GetContent(getter_AddRefs(content1)); + aFrame2->GetContent(getter_AddRefs(content2)); + if (content1 == content2 && content1 != nsnull) return PR_TRUE; - } return PR_FALSE; } @@ -827,7 +800,7 @@ NS_IMETHODIMP nsAccessible::AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, start->GetRect(r); - while (nsFrameTreeWalker::ShouldSkip(context,nsnull, start, next)) + while (nsFrameTreeWalker::IsSameContent(start, next)) { nsRect r2; next->GetRect(r2); diff --git a/mozilla/accessible/src/nsAccessible.cpp b/mozilla/accessible/src/nsAccessible.cpp index 8d1e4902fa1..e09a989f563 100644 --- a/mozilla/accessible/src/nsAccessible.cpp +++ b/mozilla/accessible/src/nsAccessible.cpp @@ -48,7 +48,7 @@ public: nsIFrame* GetChildBefore(nsIFrame* aParent, nsIFrame* aChild); PRInt32 GetCount(nsIFrame* aFrame); - static PRBool ShouldSkip(nsIPresContext* aContext, nsIAtom* aList, nsIFrame* aStart, nsIFrame* aNext); + static PRBool IsSameContent(nsIFrame* aFrame1, nsIFrame* aFrame2); static void GetAccessible(nsIFrame* aFrame, nsCOMPtr& aAccessible, nsCOMPtr& aContent); nsCOMPtr mPresContext; @@ -92,14 +92,10 @@ nsIFrame* nsFrameTreeWalker::GetNextSibling(nsIFrame* aFrame) // get next sibling nsIFrame* next = nsnull; aFrame->GetNextSibling(&next); - nsIAtom* list = nsnull; - mOwner->GetListAtomForFrame(aFrame, list); - // skip any frames with the same content node - while(ShouldSkip(mPresContext, list, aFrame, next)) + while(IsSameContent(aFrame,next)) next->GetNextSibling(&next); - // if failed if (!next) @@ -125,11 +121,7 @@ nsIFrame* nsFrameTreeWalker::GetNextSibling(nsIFrame* aFrame) return nsnull; } else { // next on parent - nsIFrame* n = GetNextSibling(parent); - if (ShouldSkip(mPresContext, list, aFrame, n)) - return GetNextSibling(n); - else - return n; + return GetNextSibling(parent); } } @@ -147,19 +139,11 @@ nsIFrame* nsFrameTreeWalker::GetNextSibling(nsIFrame* aFrame) nsIFrame* first = GetFirstChild(next); // if found - if (first) { - if (ShouldSkip(mPresContext, list, aFrame, first)) - return GetNextSibling(first); - else - return first; - } + if (first) + return first; // call next on next - nsIFrame* n = GetNextSibling(next); - if (ShouldSkip(mPresContext, list, aFrame, next)) - return GetNextSibling(n); - else - return n; + return GetNextSibling(next); } nsIFrame* nsFrameTreeWalker::GetFirstChild(nsIFrame* aFrame) @@ -198,10 +182,7 @@ nsIFrame* nsFrameTreeWalker::GetFirstChild(nsIFrame* aFrame) child->GetNextSibling(&next); // skip children with duplicate content nodes - nsIAtom* list = nsnull; - mOwner->GetListAtomForFrame(child, list); - - while(ShouldSkip(mPresContext, list, child, next)) + while(IsSameContent(child,next)) next->GetNextSibling(&next); child = next; @@ -306,31 +287,23 @@ void nsFrameTreeWalker::GetAccessible(nsIFrame* aFrame, nsCOMPtr& if (!aAccessible) aAccessible = do_QueryInterface(aContent); - // if (aAccessible) - // printf("Found accessible!\n"); + if (aAccessible) + printf("Found accessible!\n"); } -PRBool nsFrameTreeWalker::ShouldSkip(nsIPresContext* aContext, nsIAtom* aList, nsIFrame* aStart, nsIFrame* aNext) +PRBool nsFrameTreeWalker::IsSameContent(nsIFrame* aFrame1, nsIFrame* aFrame2) { - if (!aStart || !aNext) + if (!aFrame1 || !aFrame2) return PR_FALSE; - // is content the same? If so skip it nsCOMPtr content1; nsCOMPtr content2; - aStart->GetContent(getter_AddRefs(content1)); - aNext->GetContent(getter_AddRefs(content2)); - - if (content1 == content2 && content1 != nsnull) { - // does it have childen? It it does then don't skip it - nsIFrame* child = nsnull; - aNext->FirstChild(aContext, aList, &child); - if (child) - return PR_FALSE; + aFrame1->GetContent(getter_AddRefs(content1)); + aFrame2->GetContent(getter_AddRefs(content2)); + if (content1 == content2 && content1 != nsnull) return PR_TRUE; - } return PR_FALSE; } @@ -827,7 +800,7 @@ NS_IMETHODIMP nsAccessible::AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, start->GetRect(r); - while (nsFrameTreeWalker::ShouldSkip(context,nsnull, start, next)) + while (nsFrameTreeWalker::IsSameContent(start, next)) { nsRect r2; next->GetRect(r2); diff --git a/mozilla/content/events/src/nsEventStateManager.cpp b/mozilla/content/events/src/nsEventStateManager.cpp index 4b2412230ab..e83673a53a1 100644 --- a/mozilla/content/events/src/nsEventStateManager.cpp +++ b/mozilla/content/events/src/nsEventStateManager.cpp @@ -2438,7 +2438,7 @@ nsEventStateManager::ShiftFocus(PRBool forward, nsIContent* aRoot) mPresContext->GetContainer(getter_AddRefs(container)); nsCOMPtr docShellAsWin(do_QueryInterface(container)); if (docShellAsWin) { - docShellAsWin->FocusAvailable(docShellAsWin, &focusTaken); + docShellAsWin->FocusAvailable(docShellAsWin, forward, &focusTaken); } //No one took focus and we're not already at the top of the doc diff --git a/mozilla/content/html/content/src/nsHTMLBodyElement.cpp b/mozilla/content/html/content/src/nsHTMLBodyElement.cpp index 3271328b98f..25f001931f7 100644 --- a/mozilla/content/html/content/src/nsHTMLBodyElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLBodyElement.cpp @@ -594,6 +594,17 @@ BodyFixupRule::MapStyleInto(nsIMutableStyleContext* aContext, } } + // To fix the regression in bug 70831 caused by the fix to bug 67478, + // use the nsStyleColor that we would have used before the fix to + // bug 67478. + nsStyleColor* documentStyleColor = styleColor; + if (bodyStyleColor != styleColor && htmlStyleColor != styleColor) { + nsCompatibility mode; + aPresContext->GetCompatibilityMode(&mode); + if (eCompatibility_NavQuirks == mode) + documentStyleColor = bodyStyleColor; + } + nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); if (presShell) { @@ -607,10 +618,11 @@ BodyFixupRule::MapStyleInto(nsIMutableStyleContext* aContext, htmlContainer->GetAttributeStyleSheet(getter_AddRefs(styleSheet)); if (styleSheet) { - styleSheet->SetDocumentForegroundColor(styleColor->mColor); - if (!(styleColor->mBackgroundFlags & + styleSheet->SetDocumentForegroundColor(documentStyleColor->mColor); + if (!(documentStyleColor->mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT)) { - styleSheet->SetDocumentBackgroundColor(styleColor->mBackgroundColor); + styleSheet->SetDocumentBackgroundColor( + documentStyleColor->mBackgroundColor); } } } diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 02933aa004c..e6ed502652e 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -20,6 +20,7 @@ * Travis Bogard * Pierre Phaneuf * Peter Annema + * Dan Rosen */ #include "nsIComponentManager.h" @@ -102,6 +103,10 @@ #include "nsIFrame.h" #include "nsIStyleContext.h" +// for embedding +#include "nsIEmbeddingSiteWindow.h" +#include "nsIWebBrowserChromeFocus.h" + static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID); static NS_DEFINE_CID(kSimpleURICID, NS_SIMPLEURI_CID); static NS_DEFINE_CID(kDocumentCharsetInfoCID, NS_DOCUMENTCHARSETINFO_CID); @@ -2025,14 +2030,31 @@ NS_IMETHODIMP nsDocShell::SetFocus() return NS_OK; } -NS_IMETHODIMP nsDocShell::FocusAvailable(nsIBaseWindow* aCurrentFocus, +NS_IMETHODIMP nsDocShell::FocusAvailable(nsIBaseWindow* aCurrentFocus, + PRBool aForward, PRBool* aTookFocus) { NS_ENSURE_ARG_POINTER(aTookFocus); - - // Next person we should call is first the parent otherwise the - // docshell tree owner. + nsresult ret; + + // Are we embedded? + + nsCOMPtr + chromeFocus(do_GetInterface(mTreeOwner, &ret)); + if (chromeFocus) { +#ifdef DEBUG_dr + printf("dr :: nsDocShell::FocusAvailable, embedded\n"); +#endif + if (aForward) + ret = chromeFocus->FocusNextElement(); + else + ret = chromeFocus->FocusPrevElement(); + return ret; + } + + // Otherwise, first person we should call is the parent, or the + // docshell tree owner. nsCOMPtr nextCallWin(do_QueryInterface(mParent)); if(!nextCallWin) nextCallWin = do_QueryInterface(mTreeOwner); @@ -2040,7 +2062,9 @@ NS_IMETHODIMP nsDocShell::FocusAvailable(nsIBaseWindow* aCurrentFocus, //If the current focus is us, offer it to the next owner. if(aCurrentFocus == NS_STATIC_CAST(nsIBaseWindow*, this)) { if(nextCallWin) { - nsresult ret = nextCallWin->FocusAvailable(aCurrentFocus, aTookFocus); + ret = nextCallWin->FocusAvailable(aCurrentFocus, + aForward, + aTookFocus); if (NS_SUCCEEDED(ret) && *aTookFocus) return NS_OK; } @@ -2094,7 +2118,7 @@ NS_IMETHODIMP nsDocShell::FocusAvailable(nsIBaseWindow* aCurrentFocus, // Call again to offer focus upwards and to start at the beginning of our // child list if no one above us wants focus. - return FocusAvailable(this, aTookFocus); + return FocusAvailable(this, aForward, aTookFocus); } NS_IMETHODIMP nsDocShell::GetTitle(PRUnichar** aTitle) diff --git a/mozilla/docshell/base/nsDocShell.h b/mozilla/docshell/base/nsDocShell.h index fa37174f1b4..bfca595b63b 100644 --- a/mozilla/docshell/base/nsDocShell.h +++ b/mozilla/docshell/base/nsDocShell.h @@ -1,4 +1,4 @@ -/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * The contents of this file are subject to the Mozilla Public * License Version 1.1 (the "License"); you may not use this file diff --git a/mozilla/embedding/browser/gtk/src/EmbedWindow.cpp b/mozilla/embedding/browser/gtk/src/EmbedWindow.cpp index 652ca36f454..daddf2dc5f0 100644 --- a/mozilla/embedding/browser/gtk/src/EmbedWindow.cpp +++ b/mozilla/embedding/browser/gtk/src/EmbedWindow.cpp @@ -99,6 +99,7 @@ NS_IMPL_RELEASE(EmbedWindow) NS_INTERFACE_MAP_BEGIN(EmbedWindow) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebBrowserChrome) NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome) + NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChromeFocus) NS_INTERFACE_MAP_ENTRY(nsIEmbeddingSiteWindow) NS_INTERFACE_MAP_ENTRY(nsITooltipListener) NS_INTERFACE_MAP_ENTRY(nsIPrompt) @@ -232,6 +233,20 @@ EmbedWindow::ExitModalEventLoop(nsresult aStatus) return NS_ERROR_NOT_IMPLEMENTED; } +// nsIWebBrowserChromeFocus + +NS_IMETHODIMP +EmbedWindow::FocusNextElement() +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP +EmbedWindow::FocusPrevElement() +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + // nsIEmbeddingSiteWindow NS_IMETHODIMP diff --git a/mozilla/embedding/browser/gtk/src/EmbedWindow.h b/mozilla/embedding/browser/gtk/src/EmbedWindow.h index 0e77542806d..4523102eeea 100644 --- a/mozilla/embedding/browser/gtk/src/EmbedWindow.h +++ b/mozilla/embedding/browser/gtk/src/EmbedWindow.h @@ -23,6 +23,7 @@ #define __EmbedWindow_h #include +#include #include #include #include @@ -37,6 +38,7 @@ class EmbedPrivate; class EmbedWindow : public nsIWebBrowserChrome, + public nsIWebBrowserChromeFocus, public nsIEmbeddingSiteWindow, public nsITooltipListener, public nsIPrompt, @@ -56,6 +58,8 @@ class EmbedWindow : public nsIWebBrowserChrome, NS_DECL_NSIWEBBROWSERCHROME + NS_DECL_NSIWEBBROWSERCHROMEFOCUS + NS_DECL_NSIEMBEDDINGSITEWINDOW NS_DECL_NSITOOLTIPLISTENER diff --git a/mozilla/embedding/browser/macbuild/browserIDL.mcp b/mozilla/embedding/browser/macbuild/browserIDL.mcp index b693a766b82..ade7b02ef18 100644 Binary files a/mozilla/embedding/browser/macbuild/browserIDL.mcp and b/mozilla/embedding/browser/macbuild/browserIDL.mcp differ diff --git a/mozilla/embedding/browser/photon/src/PhMozEmbedChrome.cpp b/mozilla/embedding/browser/photon/src/PhMozEmbedChrome.cpp index 959303ddac8..7a748fcc670 100644 --- a/mozilla/embedding/browser/photon/src/PhMozEmbedChrome.cpp +++ b/mozilla/embedding/browser/photon/src/PhMozEmbedChrome.cpp @@ -782,8 +782,9 @@ NS_IMETHODIMP PhMozEmbedChrome::SetFocus(void) return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP PhMozEmbedChrome::FocusAvailable(nsIBaseWindow *aCurrentFocus, - PRBool *aTookFocus) +NS_IMETHODIMP PhMozEmbedChrome::FocusAvailable(nsIBaseWindow *aCurrentFocus, + PRBool aForward, + PRBool *aTookFocus) { PR_LOG(mozEmbedLm, PR_LOG_DEBUG, ("PhMozEmbedChrome::FocusAvailable\n")); return NS_ERROR_NOT_IMPLEMENTED; diff --git a/mozilla/embedding/browser/powerplant/source/CWebBrowserChrome.cpp b/mozilla/embedding/browser/powerplant/source/CWebBrowserChrome.cpp index 021999e3d91..b324277e4c5 100644 --- a/mozilla/embedding/browser/powerplant/source/CWebBrowserChrome.cpp +++ b/mozilla/embedding/browser/powerplant/source/CWebBrowserChrome.cpp @@ -227,6 +227,20 @@ NS_IMETHODIMP CWebBrowserChrome::ExitModalEventLoop(nsresult aStatus) return NS_OK; } +//***************************************************************************** +// CWebBrowserChrome::nsIWebBrowserChromeFocus +//***************************************************************************** + +NS_IMETHODIMP CWebBrowserChrome::FocusNextElement() +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP CWebBrowserChrome::FocusPrevElement() +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + //***************************************************************************** // CWebBrowserChrome::nsIWebProgressListener //***************************************************************************** diff --git a/mozilla/embedding/browser/powerplant/source/CWebBrowserChrome.h b/mozilla/embedding/browser/powerplant/source/CWebBrowserChrome.h index 655f39db20d..ba4b7a6859b 100644 --- a/mozilla/embedding/browser/powerplant/source/CWebBrowserChrome.h +++ b/mozilla/embedding/browser/powerplant/source/CWebBrowserChrome.h @@ -1,4 +1,4 @@ -/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * The contents of this file are subject to the Mozilla Public * License Version 1.1 (the "License"); you may not use this file @@ -29,6 +29,7 @@ // Interfaces Needed #include "nsIWebBrowserChrome.h" +#include "nsIWebBrowserChromeFocus.h" #include "nsIWebProgressListener.h" #include "nsIEmbeddingSiteWindow.h" #include "nsIInterfaceRequestor.h" @@ -44,18 +45,20 @@ class CBrowserWindow; class CBrowserShell; class CWebBrowserChrome : public nsIWebBrowserChrome, - public nsIWebProgressListener, - public nsIEmbeddingSiteWindow, - public nsIInterfaceRequestor, - public nsIContextMenuListener, - public nsITooltipListener, - public nsSupportsWeakReference + public nsIWebBrowserChromeFocus, + public nsIWebProgressListener, + public nsIEmbeddingSiteWindow, + public nsIInterfaceRequestor, + public nsIContextMenuListener, + public nsITooltipListener, + public nsSupportsWeakReference { friend class CBrowserWindow; public: NS_DECL_ISUPPORTS NS_DECL_NSIWEBBROWSERCHROME + NS_DECL_NSIWEBBROWSERCHROMEFOCUS NS_DECL_NSIWEBPROGRESSLISTENER NS_DECL_NSIEMBEDDINGSITEWINDOW NS_DECL_NSIINTERFACEREQUESTOR diff --git a/mozilla/embedding/browser/webBrowser/MANIFEST_IDL b/mozilla/embedding/browser/webBrowser/MANIFEST_IDL index f43334b563e..142a48315f5 100644 --- a/mozilla/embedding/browser/webBrowser/MANIFEST_IDL +++ b/mozilla/embedding/browser/webBrowser/MANIFEST_IDL @@ -23,6 +23,7 @@ nsCWebBrowser.idl nsIWebBrowser.idl nsIWebBrowserChrome.idl +nsIWebBrowserChromeFocus.idl nsIWebBrowserSetup.idl nsIEmbeddingSiteWindow.idl nsIWebBrowserPersist.idl diff --git a/mozilla/embedding/browser/webBrowser/Makefile.in b/mozilla/embedding/browser/webBrowser/Makefile.in index bad89469ca3..430a7e05569 100644 --- a/mozilla/embedding/browser/webBrowser/Makefile.in +++ b/mozilla/embedding/browser/webBrowser/Makefile.in @@ -34,6 +34,7 @@ XPIDLSRCS = \ nsCWebBrowser.idl \ nsIWebBrowser.idl \ nsIWebBrowserChrome.idl \ + nsIWebBrowserChromeFocus.idl \ nsIWebBrowserSetup.idl \ nsICommandHandler.idl \ nsIContextMenuListener.idl \ diff --git a/mozilla/embedding/browser/webBrowser/makefile.win b/mozilla/embedding/browser/webBrowser/makefile.win index ceecf94b4ee..2cd7f4740d1 100644 --- a/mozilla/embedding/browser/webBrowser/makefile.win +++ b/mozilla/embedding/browser/webBrowser/makefile.win @@ -28,6 +28,7 @@ XPIDLSRCS= \ .\nsCWebBrowser.idl \ .\nsIWebBrowser.idl \ .\nsIWebBrowserChrome.idl \ + .\nsIWebBrowserChromeFocus.idl \ .\nsICommandHandler.idl \ .\nsIWebBrowserSetup.idl \ .\nsIWebBrowserPersist.idl \ diff --git a/mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp b/mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp index 01616f9778a..816ee2058a6 100644 --- a/mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp +++ b/mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp @@ -57,6 +57,7 @@ #include "nsPIWindowWatcher.h" #include "nsIPrompt.h" #include "nsIWalletService.h" +#include "nsIWebBrowserChromeFocus.h" static char *sWindowWatcherContractID = "@mozilla.org/embedcomp/window-watcher;1"; @@ -112,6 +113,9 @@ NS_IMETHODIMP nsDocShellTreeOwner::GetInterface(const nsIID& aIID, void** aSink) if(NS_SUCCEEDED(QueryInterface(aIID, aSink))) return NS_OK; + if (aIID.Equals(NS_GET_IID(nsIWebBrowserChromeFocus))) + return mOwnerWin->QueryInterface(aIID, aSink); + if (aIID.Equals(NS_GET_IID(nsIPrompt))) { nsIPrompt *prompt; EnsurePrompter(); @@ -617,8 +621,9 @@ NS_IMETHODIMP nsDocShellTreeOwner::SetFocus() return NS_ERROR_NULL_POINTER; } -NS_IMETHODIMP nsDocShellTreeOwner::FocusAvailable(nsIBaseWindow* aCurrentFocus, - PRBool* aTookFocus) +NS_IMETHODIMP nsDocShellTreeOwner::FocusAvailable(nsIBaseWindow* aCurrentFocus, + PRBool aForward, + PRBool* aTookFocus) { return NS_ERROR_NULL_POINTER; } diff --git a/mozilla/embedding/browser/webBrowser/nsIWebBrowserChromeFocus.idl b/mozilla/embedding/browser/webBrowser/nsIWebBrowserChromeFocus.idl new file mode 100644 index 00000000000..b3a95c0fc33 --- /dev/null +++ b/mozilla/embedding/browser/webBrowser/nsIWebBrowserChromeFocus.idl @@ -0,0 +1,50 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 0 -*- + * + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is the Mozilla browser. + * + * The Initial Developer of the Original Code is Netscape + * Communications, Inc. Portions created by Netscape are + * Copyright (C) 1999, Mozilla. All Rights Reserved. + * + * Original Author: + * Dan Rosen + * Contributor(s): + * + */ + +#include "nsISupports.idl" + +/** + * The nsIWebBrowserChromeFocus is implemented by the same object as the + * nsIWebBrowserSiteWindow. It represents the focus up-calls from mozilla + * to the embedding chrome. See mozilla bug #70224 for gratuitous info. + * + * @status UNDER_REVIEW + */ + +[scriptable, uuid(d2206418-1dd1-11b2-8e55-acddcd2bcfb8)] +interface nsIWebBrowserChromeFocus : nsISupports +{ + /** + * Set the focus at the next focusable element in the chrome + */ + + void focusNextElement(); + + /** + * Set the focus at the previous focusable element in the chrome + */ + + void focusPrevElement(); + +}; diff --git a/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp b/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp index bb1672a2da0..71b65d2aa2c 100644 --- a/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp +++ b/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp @@ -1191,7 +1191,8 @@ NS_IMETHODIMP nsWebBrowser::SetFocus() } NS_IMETHODIMP nsWebBrowser::FocusAvailable(nsIBaseWindow* aCurrentFocus, - PRBool* aTookFocus) + PRBool aForward, + PRBool* aTookFocus) { NS_ENSURE_ARG_POINTER(aTookFocus); @@ -1205,7 +1206,8 @@ NS_IMETHODIMP nsWebBrowser::FocusAvailable(nsIBaseWindow* aCurrentFocus, if(aCurrentFocus == NS_STATIC_CAST(nsIBaseWindow*, this)) { if(nextCallWin) - return nextCallWin->FocusAvailable(aCurrentFocus, aTookFocus); + return nextCallWin->FocusAvailable(aCurrentFocus, + aForward, aTookFocus); return NS_OK; } diff --git a/mozilla/embedding/tests/gtkEmbed/WebBrowserChrome.cpp b/mozilla/embedding/tests/gtkEmbed/WebBrowserChrome.cpp index 570654589f2..0b5a0f25505 100644 --- a/mozilla/embedding/tests/gtkEmbed/WebBrowserChrome.cpp +++ b/mozilla/embedding/tests/gtkEmbed/WebBrowserChrome.cpp @@ -59,6 +59,7 @@ NS_INTERFACE_MAP_BEGIN(WebBrowserChrome) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebBrowserChrome) NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor) NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome) + NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChromeFocus) NS_INTERFACE_MAP_ENTRY(nsIEmbeddingSiteWindow) NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener) //optional // NS_INTERFACE_MAP_ENTRY(nsIPrompt) @@ -207,6 +208,19 @@ NS_IMETHODIMP WebBrowserChrome::ExitModalEventLoop(nsresult aStatus) return NS_ERROR_NOT_IMPLEMENTED; } +//***************************************************************************** +// WebBrowserChrome::nsIWebBrowserChromeFocus +//***************************************************************************** + +NS_IMETHODIMP WebBrowserChrome::FocusNextElement() +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP WebBrowserChrome::FocusPrevElement() +{ + return NS_ERROR_NOT_IMPLEMENTED; +} //***************************************************************************** // WebBrowserChrome::nsIWebProgressListener @@ -306,4 +320,3 @@ NS_IMETHODIMP WebBrowserChrome::GetSiteWindow(void ** aSiteWindow) *aSiteWindow = mNativeWindow; return NS_OK; } - diff --git a/mozilla/embedding/tests/gtkEmbed/WebBrowserChrome.h b/mozilla/embedding/tests/gtkEmbed/WebBrowserChrome.h index 7c45ecce45e..dc49fd6ca35 100644 --- a/mozilla/embedding/tests/gtkEmbed/WebBrowserChrome.h +++ b/mozilla/embedding/tests/gtkEmbed/WebBrowserChrome.h @@ -1,4 +1,4 @@ -/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * The contents of this file are subject to the Mozilla Public * License Version 1.1 (the "License"); you may not use this file @@ -26,6 +26,7 @@ #include "nsIGenericFactory.h" #include "nsString.h" #include "nsIWebBrowserChrome.h" +#include "nsIWebBrowserChromeFocus.h" #include "nsIDocShell.h" #include "nsIContentViewer.h" @@ -40,8 +41,8 @@ #include "nsVoidArray.h" - class WebBrowserChrome : public nsIWebBrowserChrome, + public nsIWebBrowserChromeFocus, public nsIWebProgressListener, public nsIEmbeddingSiteWindow, // public nsIPrompt, @@ -56,6 +57,7 @@ public: NS_DECL_NSIWEBBROWSERCHROME NS_DECL_NSIWEBPROGRESSLISTENER NS_DECL_NSIEMBEDDINGSITEWINDOW + NS_DECL_NSIWEBBROWSERCHROMEFOCUS // NS_DECL_NSIPROMPT NS_DECL_NSIINTERFACEREQUESTOR diff --git a/mozilla/embedding/tests/mfcembed/BrowserImpl.cpp b/mozilla/embedding/tests/mfcembed/BrowserImpl.cpp index 10de6cf98c5..f3e54aae28a 100644 --- a/mozilla/embedding/tests/mfcembed/BrowserImpl.cpp +++ b/mozilla/embedding/tests/mfcembed/BrowserImpl.cpp @@ -104,6 +104,7 @@ NS_INTERFACE_MAP_BEGIN(CBrowserImpl) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebBrowserChrome) NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor) NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome) + NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChromeFocus) NS_INTERFACE_MAP_ENTRY(nsIEmbeddingSiteWindow) NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener) NS_INTERFACE_MAP_ENTRY(nsIContextMenuListener) @@ -240,6 +241,20 @@ NS_IMETHODIMP CBrowserImpl::ExitModalEventLoop(nsresult aStatus) return NS_OK; } +//***************************************************************************** +// CBrowserImpl::nsIWebBrowserChromeFocus +//***************************************************************************** + +NS_IMETHODIMP CBrowserImpl::FocusNextElement() +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP CBrowserImpl::FocusPrevElement() +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + //***************************************************************************** // CBrowserImpl::nsIEmbeddingSiteWindow //***************************************************************************** diff --git a/mozilla/embedding/tests/mfcembed/BrowserImpl.h b/mozilla/embedding/tests/mfcembed/BrowserImpl.h index b974b18dc69..5cd74546a38 100644 --- a/mozilla/embedding/tests/mfcembed/BrowserImpl.h +++ b/mozilla/embedding/tests/mfcembed/BrowserImpl.h @@ -25,9 +25,11 @@ #define _BROWSERIMPL_H #include "IBrowserFrameGlue.h" +#include "nsIWebBrowserChromeFocus.h" class CBrowserImpl : public nsIInterfaceRequestor, public nsIWebBrowserChrome, + public nsIWebBrowserChromeFocus, public nsIEmbeddingSiteWindow, public nsIWebProgressListener, public nsIContextMenuListener, @@ -42,6 +44,7 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSIINTERFACEREQUESTOR NS_DECL_NSIWEBBROWSERCHROME + NS_DECL_NSIWEBBROWSERCHROMEFOCUS NS_DECL_NSIEMBEDDINGSITEWINDOW NS_DECL_NSIWEBPROGRESSLISTENER NS_DECL_NSICONTEXTMENULISTENER diff --git a/mozilla/embedding/tests/winEmbed/WebBrowserChrome.cpp b/mozilla/embedding/tests/winEmbed/WebBrowserChrome.cpp index 31e93d41a60..4e192ee8651 100644 --- a/mozilla/embedding/tests/winEmbed/WebBrowserChrome.cpp +++ b/mozilla/embedding/tests/winEmbed/WebBrowserChrome.cpp @@ -251,6 +251,20 @@ NS_IMETHODIMP WebBrowserChrome::ExitModalEventLoop(nsresult aStatus) return NS_OK; } +//***************************************************************************** +// WebBrowserChrome::nsIWebBrowserChromeFocus +//***************************************************************************** + +NS_IMETHODIMP WebBrowserChrome::FocusNextElement() +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP WebBrowserChrome::FocusPrevElement() +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + //***************************************************************************** // WebBrowserChrome::nsIWebProgressListener //***************************************************************************** diff --git a/mozilla/embedding/tests/winEmbed/WebBrowserChrome.h b/mozilla/embedding/tests/winEmbed/WebBrowserChrome.h index d2e500d2af2..038f00c98eb 100644 --- a/mozilla/embedding/tests/winEmbed/WebBrowserChrome.h +++ b/mozilla/embedding/tests/winEmbed/WebBrowserChrome.h @@ -1,4 +1,4 @@ -/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * The contents of this file are subject to the Mozilla Public * License Version 1.1 (the "License"); you may not use this file @@ -26,6 +26,7 @@ #include "nsIGenericFactory.h" #include "nsString.h" #include "nsIWebBrowserChrome.h" +#include "nsIWebBrowserChromeFocus.h" #include "nsIDocShell.h" #include "nsIContentViewer.h" @@ -61,6 +62,7 @@ public: }; class WebBrowserChrome : public nsIWebBrowserChrome, + public nsIWebBrowserChromeFocus, public nsIWebProgressListener, public nsIEmbeddingSiteWindow, public nsIInterfaceRequestor, @@ -77,6 +79,7 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSIWEBBROWSERCHROME + NS_DECL_NSIWEBBROWSERCHROMEFOCUS NS_DECL_NSIWEBPROGRESSLISTENER NS_DECL_NSIEMBEDDINGSITEWINDOW NS_DECL_NSIINTERFACEREQUESTOR diff --git a/mozilla/gfx/src/gtk/scale.c b/mozilla/gfx/src/gtk/scale.c index 26368544fb4..32f39688614 100644 --- a/mozilla/gfx/src/gtk/scale.c +++ b/mozilla/gfx/src/gtk/scale.c @@ -25,6 +25,7 @@ #include "drawers.h" #include +#include #include #include @@ -43,20 +44,26 @@ NNScaleImage(Display *display, XImage *img, PRUint32 size; char *data; - size = newWidth * newHeight * img->depth; - data = (char *) PR_Malloc(size); - - if (!data) { - return (XImage *) NULL; - } newImg = XCreateImage(display, DefaultVisual(display, 0), img->depth, img->format, 0, 0, newWidth, newHeight, img->bitmap_pad, 0); + + if (!newImg) { + return NULL; + } + + size = newHeight * newImg->bytes_per_line; + data = (char *) PR_Malloc(size); newImg->data = data; + if (!data) { + XDestroyImage(newImg); + return NULL; + } + if (factorX == 1) { /* an obvious optimization is to bypass XPutPixel and to memcpy rows in img->data if factorX is 1 @@ -70,8 +77,8 @@ NNScaleImage(Display *display, XImage *img, for (i = 0; i < newHeight; i++) { ysrc = (PRInt16) (i * factorY); sptr = img->data + ysrc * rowsize; - memcpy(dptr, sptr, rowsize); - dptr += rowsize; + memcpy(dptr, sptr, PR_MIN(rowsize, newImg->bytes_per_line)); + dptr += newImg->bytes_per_line; } } else { for (i = 0; i < newWidth; i++) { diff --git a/mozilla/gfx/src/mac/nsDeviceContextMac.cpp b/mozilla/gfx/src/mac/nsDeviceContextMac.cpp index d64a3dc050b..f77797bd3b3 100644 --- a/mozilla/gfx/src/mac/nsDeviceContextMac.cpp +++ b/mozilla/gfx/src/mac/nsDeviceContextMac.cpp @@ -159,8 +159,14 @@ NS_IMETHODIMP nsDeviceContextMac :: SupportsNativeWidgets(PRBool &aSupportsWidge // Raptor currently doesn't work this way and needs to be fixed. // (please remove this comment when this situation is rectified) + if( nsnull != mSpec){ + aSupportsWidgets = PR_FALSE; + } else { + aSupportsWidgets = PR_TRUE; + } + //if (nsnull == mSurface) - aSupportsWidgets = PR_TRUE; + //else //aSupportsWidgets = PR_FALSE; diff --git a/mozilla/gfx/src/nsPrintOptionsImpl.cpp b/mozilla/gfx/src/nsPrintOptionsImpl.cpp index d654fbc8194..769b2a97352 100644 --- a/mozilla/gfx/src/nsPrintOptionsImpl.cpp +++ b/mozilla/gfx/src/nsPrintOptionsImpl.cpp @@ -103,7 +103,7 @@ nsPrintOptions::nsPrintOptions() : mPrintInColor(PR_TRUE), mPaperSize(kLetterPaperSize), mPrintToFile(PR_FALSE), - mPrintFrameType(kSelectedFrame), + mPrintFrameType(kFramesAsIs), mHowToEnableFrameUI(kFrameEnableNone), mPageNumJust(kJustLeft), mIsCancelled(PR_FALSE), diff --git a/mozilla/js/landbranch.pl b/mozilla/js/landbranch.pl new file mode 100755 index 00000000000..369b74d43e0 --- /dev/null +++ b/mozilla/js/landbranch.pl @@ -0,0 +1,227 @@ +#! /usr/local/bin/perl5 + +use File::Path; + +# The development branch is where primary development and checkins +# are done on a day-to-day basis. +$development_branch_prefix = "SpiderMonkey140"; + +# Space-separated list of CVS-controlled directories to tag/merge +$merge_dirs = + "mozilla/js/src " ; + +# When line below uncommented, don't recurse into subdirs +#$recurse_flag = '-l'; + +#---------------------------------------------------------------------------- + +# The merge branch is itself a branch off of the development branch +# at a point where the development branch is thought to be stable. +# (A branch is used rather than a static tag because, inevitably, +# the development branch is not quite as stable/buildable as was +# thought.) The contents of the merge branch will be copied to +# the trunk when merging takes place. + + +# The following tags are created automatically by this script: +# +# JS_STABLE_DROP +# +# A static tag on the development branch (or a branch off the +# development branch) that indicates the code that should be merged +# into the trunk. This is a "variable" tag in the sense that it is +# redefined after each merge. +# +# JS_LAST_STABLE_DROP +# +# A static tag that is a copy of what the JS_STABLE_DROP tag was in +# the previous merge cycle. This is a "variable" tag that is +# redefined after each merge. Changes in the branch can be merged +# to the trunk by using: +# +# cvs up -jJS_LAST_STABLE_DROP -jJS_STABLE_DROP +# +# JS_LANDING +# +# A static tag that identifies the code on the trunk after the merge +# from the branch to the trunk takes place. This is a "variable" +# tag that is redefined after each merge. Changes on the trunk +# since the last branch landing can be seen by using: +# +# cvs diff -rJS_LANDING -rHEAD +# +# JS_LANDING_mmddyyyy +# +# This is a tag on the trunk which may be used for archaeological +# purposes. This tag is made from the JS_LANDING tag. + + +$development_branch = $development_branch_prefix . "_BRANCH"; +$development_base = $development_branch_prefix . "_BASE"; + +sub help { +print <<"END"; +$0: A tool for merging stable snapshots of JavaScript from a CVS +development branch onto the trunk + +Landing a snapshot of the development branch consists of +the following steps: + + 1) Tag all/some files on the branch to identify files to be merged. + 2) Merge files from the branch into the trunk using a temporary + working directory. + 3) Resolve any conflicts that arise as a result of the merge. + 4) Commit merged changes to the trunk. + 5) Make changes to resolve (build) difficulties and re-commit. + Repeat as necessary. + 6) Backpropagate changes on the trunk to the development branch. + +This script will assist with steps #2, #4 and #6: + + $0 -merge JS_STABLE_10131998 + $0 -commit + $0 -backpatch + +END +} + +sub log { + local($msg) = @_; + print LOGFILE $msg if $logfile; +} + +# Similar to die built-in +sub die { + local($msg) = @_; + &log($msg); + chomp($msg); + if ($logfile) { + $msg .= "\nSee $logfile for details."; + } + die "$msg\n"; +} + +# Similar to system() built-in +sub system { + local(@args) = @_; + local($cmd) = join(" ", @args); + &log("Executing: $cmd\n"); + + if ($logfile) { + $cmd .= " >> $logfile 2>&1"; + close(LOGFILE); + } + + local($result) = 0xffff & system($cmd); + + if ($logfile) { + open(LOGFILE, ">>$logfile"); + } + + return unless ($result); + $msg = "Died while executing $cmd"; + + if ($result == 0xff00) { + &die("$msg\nWhile executExecution failed due to perl error: $!. "); + } else { + $result >>= 8; + &die("$msg\nExecution failed; exit status: $result. "); + } +} + +chomp($root_dir = `pwd`); + +# Default log file +$logfile = $root_dir . "/log"; + +while ($#ARGV >=0) { + $_ = shift; + + if (/-merge/) { + $do_tag = 1; + $do_checkout = 1; + $do_merge = 1; + $tag = shift; + } elsif (/-commit/ || /-ci/) { + $do_commit = 1; + } elsif (/-backpatch/) { + $do_backpatch = 1; + } elsif (/-log/) { + $logfile = shift; + } elsif (/-tag/) { # Debugging option + $do_tag = 1; + $tag = shift; + } elsif (/-co/) { # Debugging option + $do_checkout = 1; + } else { + print STDERR "Illegal option: $_\n" unless (/-h/); + &help(); + exit(1); + } +} + +die "You must set your CVSROOT environment variable" if !$ENV{"CVSROOT"}; + +if ($logfile) { + open(LOGFILE, ">$logfile") || die "Couldn't open log file \"$logfile\""; + print("Logging to file \"$logfile\".\n"); +} + +$trunk_dir = $root_dir . "/trunk"; + +if ($do_tag) { + if (!$tag) { + &die("Must specify tag on command-line\n"); + } + + print("Tagging tree with tag JS_STABLE_DROP.\n"); + &system("cvs rtag $recurse_flag -F -r $tag JS_STABLE_DROP $merge_dirs"); +} + +if ($do_checkout) { + + # Delete trunk subdir if it already exists + if (-d $trunk_dir) { + &log("Deleting directory $trunk_dir\n"); + rmtree ($trunk_dir, 0, 1); + } + &log("Creating directory $trunk_dir\n"); + mkdir($trunk_dir, 0777) || die "Couldn't create directory $trunk_dir"; + + # Check out on trunk + print("Checking out $merge_dirs.\n"); + chdir $trunk_dir; + &system("cvs co $recurse_flag -A $merge_dirs"); +} + +if ($do_merge) { + chdir $trunk_dir; + print("Merging from JS_STABLE_DROP into trunk\n"); + &system("cvs up -jJS_LAST_STABLE_DROP -jJS_STABLE_DROP"); +} + +if ($do_commit) { + &die("No merged tree found. Wrong directory ?") if (!chdir $trunk_dir); + + ($_,$_,$_,$day,$mon,$year,$_,$_) = localtime(time()); + if ($year < 30) { + $year = "20" . $year; + } else { + $year = "19" . $year; + } + + $mmddyyyy = sprintf("%02d%02d%s", $mon, $day, $year); + + print("Checking in code on trunk"); + &system("cvs ci -m 'Stable drop of JavaScript interpreter code from " . + "$development_branch'"); + + # Tag merged result + &system("cvs tag -F JS_LANDING"); + &system("cvs tag -F JS_LANDING_$mmddyyyy"); + + # Move JS_LAST_STABLE_DROP tag forward + &system("cvs tag -F -rJS_STABLE_DROP JS_LAST_STABLE_DROP"); +} + + diff --git a/mozilla/layout/build/nsLayoutCID.h b/mozilla/layout/build/nsLayoutCID.h index 7e03e06cea0..f37bfe368a9 100644 --- a/mozilla/layout/build/nsLayoutCID.h +++ b/mozilla/layout/build/nsLayoutCID.h @@ -231,4 +231,8 @@ #define NS_PLAINTEXTSERIALIZER_CID \ { 0x6030f7ef, 0x32ed, 0x46a7, { 0x9a, 0x63, 0x6a, 0x5d, 0x3f, 0x90, 0x44, 0x5f } } +// {5C5AF390-34BE-11d5-A03B-0010A4EF48C9} +#define NS_LAYOUT_HISTORY_STATE_CID \ +{ 0x5c5af390, 0x34be, 0x11d5, { 0xa0, 0x3b, 0x00, 0x10, 0xa4, 0xef, 0x48, 0xc9 } } + #endif /* nsLayoutCID_h__ */ diff --git a/mozilla/layout/build/nsLayoutFactory.cpp b/mozilla/layout/build/nsLayoutFactory.cpp index c4305fe3bd3..66adcbae94d 100644 --- a/mozilla/layout/build/nsLayoutFactory.cpp +++ b/mozilla/layout/build/nsLayoutFactory.cpp @@ -88,6 +88,7 @@ static NS_DEFINE_CID(kIFrameBoxObjectCID, NS_IFRAMEBOXOBJECT_CID); static NS_DEFINE_CID(kOutlinerBoxObjectCID, NS_OUTLINERBOXOBJECT_CID); static NS_DEFINE_CID(kAutoCopyServiceCID, NS_AUTOCOPYSERVICE_CID); +static NS_DEFINE_CID(kLayoutHistoryStateCID, NS_LAYOUT_HISTORY_STATE_CID); extern nsresult NS_NewLayoutDocumentLoaderFactory(nsIDocumentLoaderFactory** aResult); #ifdef NS_DEBUG @@ -115,6 +116,7 @@ extern nsresult NS_NewPrintContext(nsIPrintContext** aResult); extern nsresult NS_CreateFrameTraversal(nsIFrameTraversal** aResult); extern nsresult NS_CreateCSSFrameConstructor(nsICSSFrameConstructor** aResult); +extern nsresult NS_NewLayoutHistoryState(nsILayoutHistoryState** aResult); //---------------------------------------------------------------------- @@ -314,6 +316,13 @@ nsLayoutFactory::CreateInstance(nsISupports *aOuter, return res; } } + else if (mClassID.Equals(kLayoutHistoryStateCID)) { + res = NS_NewLayoutHistoryState((nsILayoutHistoryState**) &inst); + if (NS_FAILED(res)) { + LOG_NEW_FAILURE("NS_NewLayoutHistoryState", res); + return res; + } + } else { return NS_NOINTERFACE; } diff --git a/mozilla/layout/build/nsLayoutModule.cpp b/mozilla/layout/build/nsLayoutModule.cpp index 876cce33bf9..fd09fbf0ae2 100644 --- a/mozilla/layout/build/nsLayoutModule.cpp +++ b/mozilla/layout/build/nsLayoutModule.cpp @@ -324,6 +324,7 @@ static Components gComponents[] = { { "CSS Frame Constructor", NS_CSSFRAMECONSTRUCTOR_CID, nsnull, }, { "Frame Traversal", NS_FRAMETRAVERSAL_CID, nsnull, }, + { "Layout History State", NS_LAYOUT_HISTORY_STATE_CID, nsnull, }, // XXX ick { "Presentation shell", NS_PRESSHELL_CID, nsnull, }, diff --git a/mozilla/layout/html/base/src/nsFrame.cpp b/mozilla/layout/html/base/src/nsFrame.cpp index 39473fea05c..407cba19903 100644 --- a/mozilla/layout/html/base/src/nsFrame.cpp +++ b/mozilla/layout/html/base/src/nsFrame.cpp @@ -3984,6 +3984,28 @@ nsFrame::IsMouseCaptured(nsIPresContext* aPresContext) return PR_FALSE; } +void +nsFrame::SetDefaultBackgroundColor(nsIPresContext* aPresContext) +{ + nsCOMPtr shell; + aPresContext->GetShell(getter_AddRefs(shell)); + + if (shell) { + nsCOMPtr vm; + shell->GetViewManager(getter_AddRefs(vm)); + + if (vm) { + nsStyleColor color; + mStyleContext->GetStyle(eStyleStruct_Color, color); + + vm->SetDefaultBackgroundColor( + (color.mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT) == 0 + ? color.mBackgroundColor + : NS_RGBA(0, 0, 0, 0)); + } + } +} + #ifdef IBMBIDI /** * retrieve Bidi property of this frame diff --git a/mozilla/layout/html/base/src/nsFrame.h b/mozilla/layout/html/base/src/nsFrame.h index 93dbb1cc0dd..225c23502c9 100644 --- a/mozilla/layout/html/base/src/nsFrame.h +++ b/mozilla/layout/html/base/src/nsFrame.h @@ -464,6 +464,10 @@ protected: static void XMLQuote(nsString& aString); + // Helper function that sets the view manager's default background to be + // the background of this frame. + void SetDefaultBackgroundColor(nsIPresContext* aPresContext); + virtual PRBool ParentDisablesSelection() const; // Set the overflow clip rect into the rendering-context. Used for block-level diff --git a/mozilla/layout/html/base/src/nsFrameManager.cpp b/mozilla/layout/html/base/src/nsFrameManager.cpp index 2987f7da417..018822c9631 100644 --- a/mozilla/layout/html/base/src/nsFrameManager.cpp +++ b/mozilla/layout/html/base/src/nsFrameManager.cpp @@ -1030,26 +1030,23 @@ FrameManager::CantRenderReplacedElement(nsIPresContext* aPresContext, #ifdef NOISY_EVENTS printf("%p FrameManager::CantRenderReplacedElement called\n", this); #endif - nsIEventQueueService* eventService; - nsresult rv; // We need to notify the style stystem, but post the notification so it // doesn't happen now - rv = nsServiceManager::GetService(kEventQueueServiceCID, - NS_GET_IID(nsIEventQueueService), - (nsISupports **)&eventService); - if (NS_SUCCEEDED(rv)) { + nsresult rv; + nsCOMPtr eventService = do_GetService(kEventQueueServiceCID, &rv); + + if (eventService) { nsCOMPtr eventQueue; rv = eventService->GetThreadEventQueue(NS_CURRENT_THREAD, getter_AddRefs(eventQueue)); - nsServiceManager::ReleaseService(kEventQueueServiceCID, eventService); if (NS_SUCCEEDED(rv) && eventQueue) { -#ifdef NS_DEBUG // Verify that there isn't already a posted event associated with - // this frame - NS_ASSERTION(!*FindPostedEventFor(aFrame), "frame already has posted event"); -#endif + // this frame. + if (*FindPostedEventFor(aFrame)) + return NS_OK; + CantRenderReplacedElementEvent* ev; // Create a new event diff --git a/mozilla/layout/html/base/src/nsHTMLFrame.cpp b/mozilla/layout/html/base/src/nsHTMLFrame.cpp index cdcb4912c11..1f795edd988 100644 --- a/mozilla/layout/html/base/src/nsHTMLFrame.cpp +++ b/mozilla/layout/html/base/src/nsHTMLFrame.cpp @@ -85,6 +85,11 @@ public: return NS_OK; } + NS_IMETHOD Paint(nsIPresContext* aPresContext, + nsIRenderingContext& aRenderingContext, + const nsRect& aDirtyRect, + nsFramePaintLayer aWhichLayer); + /** * Get the "type" of the frame * @@ -220,6 +225,18 @@ CanvasFrame::RemoveFrame(nsIPresContext* aPresContext, return rv; } +NS_IMETHODIMP +CanvasFrame::Paint(nsIPresContext* aPresContext, + nsIRenderingContext& aRenderingContext, + const nsRect& aDirtyRect, + nsFramePaintLayer aWhichLayer) +{ + if (NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer) { + SetDefaultBackgroundColor(aPresContext); + } + return nsHTMLContainerFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer); +} + NS_IMETHODIMP CanvasFrame::Reflow(nsIPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, diff --git a/mozilla/layout/html/base/src/nsObjectFrame.cpp b/mozilla/layout/html/base/src/nsObjectFrame.cpp index e8ed3618c81..56aa5cba0e5 100644 --- a/mozilla/layout/html/base/src/nsObjectFrame.cpp +++ b/mozilla/layout/html/base/src/nsObjectFrame.cpp @@ -89,7 +89,6 @@ static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID); #undef KeyPress #endif -#define NATIVE_ERROR 05 class nsPluginInstanceOwner : public nsIPluginInstanceOwner, public nsIPluginTagInfo2, @@ -1401,6 +1400,18 @@ nsObjectFrame::HandleEvent(nsIPresContext* aPresContext, //FIX FOR CRASHING WHEN NO INSTANCE OWVER if (!mInstanceOwner) return NS_ERROR_NULL_POINTER; + + if (anEvent->message == NS_PLUGIN_ACTIVATE) + { + nsCOMPtr content; + GetContent(getter_AddRefs(content)); + if (content) + { + content->SetFocus(aPresContext); + return rv; + } + } + #ifdef XP_WIN rv = nsObjectFrameSuper::HandleEvent(aPresContext, anEvent, anEventStatus); return rv; @@ -2672,7 +2683,13 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const nsGUIEvent& anEvent) #ifdef XP_MAC if (mWidget != NULL) { // check for null mWidget EventRecord* event = (EventRecord*)anEvent.nativeMsg; - if ((event == NULL) || (event->what == nullEvent) || ((int)event < NATIVE_ERROR)) { + if ((event == NULL) || (event->what == nullEvent) || + (anEvent.message == NS_FOCUS_EVENT_START) || + (anEvent.message == NS_GOTFOCUS) || + (anEvent.message == NS_LOSTFOCUS) || + (anEvent.message == NS_MOUSE_MOVE) || + (anEvent.message == NS_MOUSE_ENTER)) + { EventRecord macEvent; GUItoMacEvent(anEvent, macEvent); event = &macEvent; diff --git a/mozilla/layout/html/base/src/nsPresShell.cpp b/mozilla/layout/html/base/src/nsPresShell.cpp index 2d91039f631..95a563faa19 100644 --- a/mozilla/layout/html/base/src/nsPresShell.cpp +++ b/mozilla/layout/html/base/src/nsPresShell.cpp @@ -3905,9 +3905,7 @@ PresShell::ScrollFrameIntoView(nsIFrame *aFrame, nscoord frameAlignX = frameBounds.x + (frameBounds.width * aHPercent) / 100; scrollOffsetX = frameAlignX - (visibleRect.width * aHPercent) / 100; } - if (scrollOffsetX != 0 || scrollOffsetY != 0) { - scrollingView->ScrollTo(scrollOffsetX, scrollOffsetY, NS_VMREFRESH_IMMEDIATE); - } + scrollingView->ScrollTo(scrollOffsetX, scrollOffsetY, NS_VMREFRESH_IMMEDIATE); } } return rv; diff --git a/mozilla/layout/html/base/src/nsSimplePageSequence.cpp b/mozilla/layout/html/base/src/nsSimplePageSequence.cpp index a926121eaac..96265e7eb8d 100644 --- a/mozilla/layout/html/base/src/nsSimplePageSequence.cpp +++ b/mozilla/layout/html/base/src/nsSimplePageSequence.cpp @@ -773,15 +773,19 @@ nsSimplePageSequenceFrame::PrintNextPage(nsIPresContext* aPresContext, NS_IMETHODIMP nsSimplePageSequenceFrame::DoPageEnd(nsIPresContext* aPresContext) { + nsresult rv = NS_OK; + if (mPrintThisPage) { nsCOMPtr dc; aPresContext->GetDeviceContext(getter_AddRefs(dc)); NS_ASSERTION(dc, "nsIDeviceContext can't be NULL!"); - PRINT_DEBUG_MSG1("***************** End Page (DoPageEnd) *****************\n"); - nsresult rv = dc->EndPage(); - if (NS_FAILED(rv)) { - return rv; + if(mSkipPageEnd){ + PRINT_DEBUG_MSG1("***************** End Page (DoPageEnd) *****************\n"); + nsresult rv = dc->EndPage(); + if (NS_FAILED(rv)) { + return rv; + } } } @@ -791,7 +795,12 @@ nsSimplePageSequenceFrame::DoPageEnd(nsIPresContext* aPresContext) } mPageNum++; - return mCurrentPageFrame->GetNextSibling(&mCurrentPageFrame); + + if( nsnull != mCurrentPageFrame){ + rv = mCurrentPageFrame->GetNextSibling(&mCurrentPageFrame); + } + + return rv; } NS_IMETHODIMP diff --git a/mozilla/layout/html/forms/src/nsFileControlFrame.cpp b/mozilla/layout/html/forms/src/nsFileControlFrame.cpp index 02bbab90c03..106f78883ab 100644 --- a/mozilla/layout/html/forms/src/nsFileControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsFileControlFrame.cpp @@ -655,12 +655,15 @@ NS_IMETHODIMP nsFileControlFrame::SetProperty(nsIPresContext* aPresContext, NS_IMETHODIMP nsFileControlFrame::GetProperty(nsIAtom* aName, nsAWritableString& aValue) { - // Return the value of the property from the widget it is not null. - // If widget is null, assume the widget is GFX-rendered and return a member variable instead. + aValue.Truncate(); // initialize out param if (nsHTMLAtoms::value == aName) { - if (mTextFrame) + if (mTextFrame) { mTextFrame->GetTextControlFrameState(aValue); + } + else if (mCachedState) { + aValue.Assign(*mCachedState); + } } return NS_OK; } @@ -699,6 +702,11 @@ nsFileControlFrame::SaveState(nsIPresContext* aPresContext, nsIPresState** aStat { NS_ENSURE_ARG_POINTER(aState); + // Don't save state before we are initialized + if (!mTextFrame && !mCachedState) { + return NS_OK; + } + // Get the value string nsAutoString stateString; nsresult res = GetProperty(nsHTMLAtoms::value, stateString); diff --git a/mozilla/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp b/mozilla/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp index 00338960e6a..2bf12e04fc0 100644 --- a/mozilla/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp @@ -626,6 +626,11 @@ NS_IMETHODIMP nsGfxCheckboxControlFrame::SaveState(nsIPresContext* aPresContext, { NS_ENSURE_ARG_POINTER(aState); + // Don't save state before we are initialized + if (!mDidInit) { + return NS_OK; + } + CheckState stateCheck = GetCheckboxState(); PRBool defaultStateBool = PR_FALSE; nsresult res = GetDefaultCheckState(&defaultStateBool); diff --git a/mozilla/layout/html/forms/src/nsGfxRadioControlFrame.cpp b/mozilla/layout/html/forms/src/nsGfxRadioControlFrame.cpp index 99d09cd02a5..3662fc1026f 100644 --- a/mozilla/layout/html/forms/src/nsGfxRadioControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsGfxRadioControlFrame.cpp @@ -389,6 +389,11 @@ nsGfxRadioControlFrame::SaveState(nsIPresContext* aPresContext, nsIPresState** a { NS_ENSURE_ARG_POINTER(aState); + // Don't save state before we are initialized + if (!mDidInit) { + return NS_OK; + } + nsresult res = NS_OK; PRBool stateBool = GetRadioState(); PRBool defaultStateBool = GetDefaultChecked(); diff --git a/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp b/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp index b78431bf68e..eb496054ea4 100644 --- a/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp +++ b/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp @@ -3087,7 +3087,7 @@ nsGfxTextControlFrame2::InvalidateCachedState() void nsGfxTextControlFrame2::GetTextControlFrameState(nsAWritableString& aValue) { - aValue.SetLength(0); // initialize out param + aValue.Truncate(); // initialize out param if (mEditor && mUseEditor) { @@ -3110,7 +3110,7 @@ void nsGfxTextControlFrame2::GetTextControlFrameState(nsAWritableString& aValue) mEditor->OutputToString(aValue, NS_LITERAL_STRING("text/plain"), flags); } - else if (mCachedState && mCachedState->Length() > 0) + else if (mCachedState) aValue.Assign(*mCachedState); } @@ -3303,6 +3303,11 @@ nsGfxTextControlFrame2::SaveState(nsIPresContext* aPresContext, nsIPresState** a { NS_ENSURE_ARG_POINTER(aState); + // Don't save state before we are initialized + if (!mUseEditor) { + return NS_OK; + } + // Get the value string nsString stateString; nsresult res = GetProperty(nsHTMLAtoms::value, stateString); diff --git a/mozilla/layout/html/forms/src/nsListControlFrame.cpp b/mozilla/layout/html/forms/src/nsListControlFrame.cpp index 54f2d4a86df..4eed2c46566 100644 --- a/mozilla/layout/html/forms/src/nsListControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsListControlFrame.cpp @@ -3983,6 +3983,11 @@ nsListControlFrame::GetStateType(nsIPresContext* aPresContext, NS_IMETHODIMP nsListControlFrame::SaveStateInternal(nsIPresContext* aPresContext, nsIPresState** aState) { + // Don't save state before we are initialized + if (!mHasBeenInitialized) { + return NS_OK; + } + PRBool saveState = PR_FALSE; nsresult res = NS_OK; diff --git a/mozilla/layout/html/tests/block/bugs/file_list.txt b/mozilla/layout/html/tests/block/bugs/file_list.txt index 3f25a9fc6f7..aa0bc3173ed 100644 --- a/mozilla/layout/html/tests/block/bugs/file_list.txt +++ b/mozilla/layout/html/tests/block/bugs/file_list.txt @@ -53,6 +53,7 @@ file:///s:/mozilla/layout/html/tests/block/bugs/13481.html file:///s:/mozilla/layout/html/tests/block/bugs/13553.html file:///s:/mozilla/layout/html/tests/block/bugs/13599.html file:///s:/mozilla/layout/html/tests/block/bugs/13869.html +file:///s:/mozilla/layout/html/tests/block/bugs/14118-a.html file:///s:/mozilla/layout/html/tests/block/bugs/14118-b.html file:///s:/mozilla/layout/html/tests/block/bugs/14140.html file:///s:/mozilla/layout/html/tests/block/bugs/14161.html diff --git a/mozilla/layout/html/tests/table/bugs/bug29314.html b/mozilla/layout/html/tests/table/bugs/bug29314.html new file mode 100644 index 00000000000..24e9ebb586d --- /dev/null +++ b/mozilla/layout/html/tests/table/bugs/bug29314.html @@ -0,0 +1,14 @@ + + + + + + + + + + + +
+ + diff --git a/mozilla/layout/html/tests/table/bugs/bug39209.html b/mozilla/layout/html/tests/table/bugs/bug39209.html new file mode 100644 index 00000000000..92eb8ca6ca1 --- /dev/null +++ b/mozilla/layout/html/tests/table/bugs/bug39209.html @@ -0,0 +1,23 @@ + + + Moz Bug + + + + + +
+ Blah + + + +
+
+ +
+
+
+ This line is only here to separate the two columns in the row above +
+ + diff --git a/mozilla/layout/html/tests/table/bugs/bug43854-1.html b/mozilla/layout/html/tests/table/bugs/bug43854-1.html new file mode 100644 index 00000000000..9ae6447f524 --- /dev/null +++ b/mozilla/layout/html/tests/table/bugs/bug43854-1.html @@ -0,0 +1,47 @@ + + + + +test case + + + + + +

All cell borders should look the same.

+ + ++ + + + + + + + + + + +

look at cell borders...

border
bottom?

this cell
border
fine
this cell
border
fine
this cell
border
fine

this cell
border
fine
this cell
border
fine
this cell
border
fine

+ + + diff --git a/mozilla/layout/html/tests/table/bugs/bug43854-2.html b/mozilla/layout/html/tests/table/bugs/bug43854-2.html new file mode 100644 index 00000000000..be7aa69a2a9 --- /dev/null +++ b/mozilla/layout/html/tests/table/bugs/bug43854-2.html @@ -0,0 +1,83 @@ + + +Calendar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SunMonTueWedThuFriSat
1
7:50
2
Althea Halliday
3
CHORTle
Avondale graduation
4

5
SAC Speech night
6
Management committee
7
Castle Hill and Mountain View Speech nights
8
7:56
9
Reconciliation
10
Christmas party
11

12

13
Community Ministries committee
14

15
8:02
16
Paul Goltz
17

18

19
End school term 4
20

21

22
8:06
23
Christmas programme
24

25
Christmas day
26
Boxing day
27

28

29
8:09
30
David Holman
31

+ + + + diff --git a/mozilla/layout/html/tests/table/bugs/bug52505.html b/mozilla/layout/html/tests/table/bugs/bug52505.html new file mode 100644 index 00000000000..4b612e14951 --- /dev/null +++ b/mozilla/layout/html/tests/table/bugs/bug52505.html @@ -0,0 +1,34 @@ + + + + + + + +
+ + +
+ + + +
12
22
+ + diff --git a/mozilla/layout/html/tests/table/bugs/bug52506.html b/mozilla/layout/html/tests/table/bugs/bug52506.html new file mode 100644 index 00000000000..68328969a2e --- /dev/null +++ b/mozilla/layout/html/tests/table/bugs/bug52506.html @@ -0,0 +1,34 @@ + + + + + + + +
+ + +
+ + + +
12
22
+ + diff --git a/mozilla/layout/html/tests/table/bugs/bug55527.html b/mozilla/layout/html/tests/table/bugs/bug55527.html new file mode 100644 index 00000000000..e2ae9327d9f --- /dev/null +++ b/mozilla/layout/html/tests/table/bugs/bug55527.html @@ -0,0 +1,70 @@ + + + + Mozilla Bug 55527 + + + + + + + + + + + + + + + + +
blah + blah + blah + blah +
blah + blah + blah + blah +
blah + blah + blah + blah +
blah + blah + blah + blah +
blah + blah + blah + blah +
blah + blah + blah + blah +
blah + blah + blah + blah +
blah + blah + blah + blah +
+ + + diff --git a/mozilla/layout/html/tests/table/bugs/bug56405.html b/mozilla/layout/html/tests/table/bugs/bug56405.html new file mode 100644 index 00000000000..8540e766a8c --- /dev/null +++ b/mozilla/layout/html/tests/table/bugs/bug56405.html @@ -0,0 +1,20 @@ + + + +Test + + + + +
+ + + +
+ I'm down here! +
+ + +The end. + + diff --git a/mozilla/layout/html/tests/table/bugs/bug59354.html b/mozilla/layout/html/tests/table/bugs/bug59354.html new file mode 100644 index 00000000000..7a308ad3918 --- /dev/null +++ b/mozilla/layout/html/tests/table/bugs/bug59354.html @@ -0,0 +1,50 @@ + + + Preferences for Simon King + + + + + + +
+ + + + + + + + + + + +
General PreferencesGroups / PermissionsPasswordEmailViews

+ + + + +
+
+ + + + +
+ User Preferences + + + + + + +
Email Address : + +
+
+
+
+
+
+ + diff --git a/mozilla/layout/html/tests/table/bugs/bug60804.html b/mozilla/layout/html/tests/table/bugs/bug60804.html new file mode 100644 index 00000000000..6c67b5cddeb --- /dev/null +++ b/mozilla/layout/html/tests/table/bugs/bug60804.html @@ -0,0 +1,34 @@ +Testcase for bug 60807 + + + + + + + + + + + + +
MERCHANTDESCRIPTIONPRICEINFO
+ + + + + + + + + + + + + + + +
American StarlexDigital_Cameras DC200 New|In stock; Kodak$270.00More
+ + + + diff --git a/mozilla/layout/html/tests/table/bugs/bug67915-1.html b/mozilla/layout/html/tests/table/bugs/bug67915-1.html new file mode 100644 index 00000000000..29b765d15d6 --- /dev/null +++ b/mozilla/layout/html/tests/table/bugs/bug67915-1.html @@ -0,0 +1,221 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
A +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +
B +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +
C +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +
D +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +
E +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +
F +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +
G +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +
H +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +
I +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +
J +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +
K +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +
K +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +
L +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +
M +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +
N +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +
O +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +
P +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +
Q +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +
R +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +test test test test test test test test test test test test test test test +
+ + + diff --git a/mozilla/layout/html/tests/table/bugs/bug67915-2.html b/mozilla/layout/html/tests/table/bugs/bug67915-2.html new file mode 100644 index 00000000000..11b530396d9 --- /dev/null +++ b/mozilla/layout/html/tests/table/bugs/bug67915-2.html @@ -0,0 +1,6 @@ + + + + +
foo
+ diff --git a/mozilla/layout/html/tests/table/bugs/bug69187.html b/mozilla/layout/html/tests/table/bugs/bug69187.html new file mode 100644 index 00000000000..b381c99c005 --- /dev/null +++ b/mozilla/layout/html/tests/table/bugs/bug69187.html @@ -0,0 +1,44 @@ + + + + African American People + + + + + + + + + + + +
+

+ Personal Friends +

+
+ +

+ Alisha - Password-Protected +

+

+ Arlesia +

+

+ Asale +

+
+

+ Ernie +

+

+ Melanie +

+

+ Tamara +

+
+ + + diff --git a/mozilla/layout/html/tests/table/bugs/bug69382-1.html b/mozilla/layout/html/tests/table/bugs/bug69382-1.html new file mode 100644 index 00000000000..3a74868284f --- /dev/null +++ b/mozilla/layout/html/tests/table/bugs/bug69382-1.html @@ -0,0 +1,117 @@ + + +WebVoyage Titles + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
# Relevance Title Long Author Date
+  1  + **UNIX and Windows 2000 integration toolkit : a complete guide for systems administrators / Rawn Shah.Shah, Rawn.2000
+ + + + +
Title has multiple holdings
+
+  2  + **Learning Red Hat Linux / Bill McCarty.McCarty, Bill, 1953-1999
+ + + + +
Title has multiple holdings
+
+  3  + **Learning Debian GNU/Linux / Bill Mccarty.McCarty, Bill, 1953-1999
+ + + + +
Title has multiple holdings
+
+  4  + **Advanced Java networking / Dick Steflik, Prashant Sridharan.Steflik, Dick.2000
+ + + + +
Title has multiple holdings
+
+ +
+ + + + diff --git a/mozilla/layout/html/tests/table/bugs/bug69382-2.html b/mozilla/layout/html/tests/table/bugs/bug69382-2.html new file mode 100644 index 00000000000..27c74bdff8d --- /dev/null +++ b/mozilla/layout/html/tests/table/bugs/bug69382-2.html @@ -0,0 +1,31 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
5**Text text text 1970
No Holdings Available
6**Text text text 1970
No Holdings Available
+
+ + diff --git a/mozilla/layout/html/tests/table/bugs/file_list4.txt b/mozilla/layout/html/tests/table/bugs/file_list4.txt index a281bd78a4a..0b9f58a6f56 100644 --- a/mozilla/layout/html/tests/table/bugs/file_list4.txt +++ b/mozilla/layout/html/tests/table/bugs/file_list4.txt @@ -18,6 +18,7 @@ file:///s|/mozilla/layout/html/tests/table/bugs/bug29058-1.html file:///s|/mozilla/layout/html/tests/table/bugs/bug29058-2.html file:///s|/mozilla/layout/html/tests/table/bugs/bug29058-3.html file:///s|/mozilla/layout/html/tests/table/bugs/bug29157.html +file:///s|/mozilla/layout/html/tests/table/bugs/bug29314.html file:///s|/mozilla/layout/html/tests/table/bugs/bug29326.html file:///s|/mozilla/layout/html/tests/table/bugs/bug29429.html file:///s|/mozilla/layout/html/tests/table/bugs/bug2947.html diff --git a/mozilla/layout/html/tests/table/bugs/file_list5.txt b/mozilla/layout/html/tests/table/bugs/file_list5.txt index eab924c0eb2..0351e124403 100644 --- a/mozilla/layout/html/tests/table/bugs/file_list5.txt +++ b/mozilla/layout/html/tests/table/bugs/file_list5.txt @@ -16,6 +16,7 @@ file:///s|/mozilla/layout/html/tests/table/bugs/bug3681-2.html file:///s|/mozilla/layout/html/tests/table/bugs/bug3718.html file:///s|/mozilla/layout/html/tests/table/bugs/bug38916.html file:///s|/mozilla/layout/html/tests/table/bugs/bug3977.html +file:///s|/mozilla/layout/html/tests/table/bugs/bug39209.html file:///s|/mozilla/layout/html/tests/table/bugs/bug40828.html file:///s|/mozilla/layout/html/tests/table/bugs/bug4093.html file:///s|/mozilla/layout/html/tests/table/bugs/bug41890.html @@ -27,6 +28,8 @@ file:///s|/mozilla/layout/html/tests/table/bugs/bug42443.html file:///s|/mozilla/layout/html/tests/table/bugs/bug43204.html file:///s|/mozilla/layout/html/tests/table/bugs/bug4382.html file:///s|/mozilla/layout/html/tests/table/bugs/bug4385.html +file:///s|/mozilla/layout/html/tests/table/bugs/bug43854-1.html +file:///s|/mozilla/layout/html/tests/table/bugs/bug43854-2.html file:///s|/mozilla/layout/html/tests/table/bugs/bug4427.html file:///s|/mozilla/layout/html/tests/table/bugs/bug4429.html file:///s|/mozilla/layout/html/tests/table/bugs/bug44523.html @@ -56,15 +59,19 @@ file:///s|/mozilla/layout/html/tests/table/bugs/bug50695-2.html file:///s|/mozilla/layout/html/tests/table/bugs/bug51140.html file:///s|/mozilla/layout/html/tests/table/bugs/bug51727.html file:///s|/mozilla/layout/html/tests/table/bugs/bug5188.html +file:///s|/mozilla/layout/html/tests/table/bugs/bug52505.html +file:///s|/mozilla/layout/html/tests/table/bugs/bug52506.html file:///s|/mozilla/layout/html/tests/table/bugs/bug53690-1.html file:///s|/mozilla/layout/html/tests/table/bugs/bug53690-2.html file:///s|/mozilla/layout/html/tests/table/bugs/bug53891.html file:///s|/mozilla/layout/html/tests/table/bugs/bug5538.html +file:///s|/mozilla/layout/html/tests/table/bugs/bug55527.html file:///s|/mozilla/layout/html/tests/table/bugs/bug55545.html # Non-existant test case? #file:///s|/mozilla/layout/html/tests/table/bugs/bug55563.html file:///s|/mozilla/layout/html/tests/table/bugs/bug55789.html file:///s|/mozilla/layout/html/tests/table/bugs/bug56024.html +file:///s|/mozilla/layout/html/tests/table/bugs/bug56024.html file:///s|/mozilla/layout/html/tests/table/bugs/bug56201.html file:///s|/mozilla/layout/html/tests/table/bugs/bug57378.html file:///s|/mozilla/layout/html/tests/table/bugs/bug57828.html @@ -76,3 +83,4 @@ file:///s|/mozilla/layout/html/tests/table/bugs/bug5799.html file:///s|/mozilla/layout/html/tests/table/bugs/bug5835.html file:///s|/mozilla/layout/html/tests/table/bugs/bug5838.html file:///s|/mozilla/layout/html/tests/table/bugs/bug59252.html +file:///s|/mozilla/layout/html/tests/table/bugs/bug59354.html diff --git a/mozilla/layout/html/tests/table/bugs/file_list6.txt b/mozilla/layout/html/tests/table/bugs/file_list6.txt index 3bef53adf90..36aabd71e89 100644 --- a/mozilla/layout/html/tests/table/bugs/file_list6.txt +++ b/mozilla/layout/html/tests/table/bugs/file_list6.txt @@ -1,4 +1,5 @@ file:///s|/mozilla/layout/html/tests/table/bugs/bug60749.html +file:///s|/mozilla/layout/html/tests/table/bugs/bug60804.html file:///s|/mozilla/layout/html/tests/table/bugs/bug60807.html file:///s|/mozilla/layout/html/tests/table/bugs/bug61042-1.html file:///s|/mozilla/layout/html/tests/table/bugs/bug61042-2.html @@ -14,8 +15,13 @@ file:///s|/mozilla/layout/html/tests/table/bugs/bug650.html file:///s|/mozilla/layout/html/tests/table/bugs/bug65372.html file:///s|/mozilla/layout/html/tests/table/bugs/bug6674.html file:///s|/mozilla/layout/html/tests/table/bugs/bug6674.html +file:///s|/mozilla/layout/html/tests/table/bugs/bug67915-1.html +file:///s|/mozilla/layout/html/tests/table/bugs/bug67915-2.html file:///s|/mozilla/layout/html/tests/table/bugs/bug67864.html file:///s|/mozilla/layout/html/tests/table/bugs/bug68912.html +file:///s|/mozilla/layout/html/tests/table/bugs/bug69187.html +file:///s|/mozilla/layout/html/tests/table/bugs/bug69382-1.html +file:///s|/mozilla/layout/html/tests/table/bugs/bug69382-2.html file:///s|/mozilla/layout/html/tests/table/bugs/bug709.html file:///s|/mozilla/layout/html/tests/table/bugs/bug7112-1.html file:///s|/mozilla/layout/html/tests/table/bugs/bug7112-2.html diff --git a/mozilla/layout/html/tests/table/interactive/bug44148.html b/mozilla/layout/html/tests/table/interactive/bug44148.html new file mode 100644 index 00000000000..d27b956d6a9 --- /dev/null +++ b/mozilla/layout/html/tests/table/interactive/bug44148.html @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
r1c1r1c2r1c3
cell 1cell 2cell 3
r3c1r3c2r3c3
+ +
+ + +
+ + diff --git a/mozilla/layout/html/tests/table/interactive/bug66804.html b/mozilla/layout/html/tests/table/interactive/bug66804.html new file mode 100644 index 00000000000..666919a6290 --- /dev/null +++ b/mozilla/layout/html/tests/table/interactive/bug66804.html @@ -0,0 +1,22 @@ + + + + +Both rows should render equal in strict mode. + + + + + + + + + + + +
12
1 2
+ + diff --git a/mozilla/layout/html/tests/table/printing/bug59280-1.html b/mozilla/layout/html/tests/table/printing/bug59280-1.html new file mode 100644 index 00000000000..b16dc560fbb --- /dev/null +++ b/mozilla/layout/html/tests/table/printing/bug59280-1.html @@ -0,0 +1,509 @@ + + +Your Order with Amazon.com + + + + + + + + + + + + + +
+Amazon.com logo +
+ your account + + + + + + +
+
+
+
+ + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + +
Thank + you for ordering from Amazon.com. + + + + + + + + + + + + + + + +

If + you ordered several items to be delivered to the same + address, we may send them to you in separate boxes to + give you the speediest service. Rest assured: This will + not affect your shipping charges. + + + + +

Thanks + for shopping with us! +

Amazon.com + Customer Service + + + + + + + +

+

+ Purchasing Information: + +

+ + + + + +
+

+ + + + + +
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
 TABLE 1
+ +   + +
+ + +   + + +
 
+ +   + +
+

+
+
+ + + + + + + +
+

  + + Order Summary: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + 1 + + +
+ + + + 1 + + +
+
+ + + +
+
+ + + + + + + +
+

Manage + Your Account: +

+

Manage all your orders online. Access Your Account, and you can: +

+

If you still need to get in touch with us about your order, send an e-mail message to orders@amazon.com (or just reply to this message). + + + +

Thanks again for shopping at Amazon.com! +

+Amazon.com
+ Earth's Biggest Selection +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Your Recommendations:

+ Ideas for Your Next Visit
+ +
+ + + + + + + + + Programming Windows Security (The DevelopMentor Series) + + + + +
by Keith Brown + + + +
+ + + Our Price: $39.95
+ + + +
+
+ + + + + + + + + Transactional COM+ + + + + +
by Tim Ewald + + + +
+ + + Our Price: $39.95
+ + + +
+
+ + + +See All Your +Recommendations + + + +
+ + + + + + + + + + + +unsubscribe icon Prefer not to receive HTML Mail? Click here
+
+ + + + + + + + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
Manage Your Account:
+
+ +View Your Orders
+ + +Edit Shipping Options
+Cancel Unshipped Orders
+ + +Go to Your Account
+
+
+

 

+


+

+ + + + + + +
+ + + + + + +
+
Refer a friend banner
+ and receive a $5.00 gift certificate!
+ Click here for details.
+
+
+

+

+

 

+
+
+
+

 

 
+ + diff --git a/mozilla/layout/html/tests/table/printing/bug59280-2.html b/mozilla/layout/html/tests/table/printing/bug59280-2.html new file mode 100644 index 00000000000..eab6411c639 --- /dev/null +++ b/mozilla/layout/html/tests/table/printing/bug59280-2.html @@ -0,0 +1,188 @@ + + + + + +
+
div1
+
div1
+
+ + + + diff --git a/mozilla/layout/html/tests/table/printing/bug61663.html b/mozilla/layout/html/tests/table/printing/bug61663.html new file mode 100644 index 00000000000..6cf1d0eb606 --- /dev/null +++ b/mozilla/layout/html/tests/table/printing/bug61663.html @@ -0,0 +1,131 @@ + + + +thead test - print me! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
This thead element
will only appear on the first and
last pages printed.
November 30, 2000
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
text
+ + diff --git a/mozilla/layout/html/tests/table/printing/bug66804.html b/mozilla/layout/html/tests/table/printing/bug66804.html new file mode 100644 index 00000000000..9181e4c9883 --- /dev/null +++ b/mozilla/layout/html/tests/table/printing/bug66804.html @@ -0,0 +1,50 @@ + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + +
+ Network Applications +
foo +
+
+

  +

+
bar +
+

+ + But agents soon will be able to get electronic forms and cut processing time down to five minutes or less: Farm Bureau Financial Services, an insurance and financial services company in West Des Moines, Iowa, is rolling out a new extranet for its growing number of agent offices and affiliates across the country.

+The extranet environment replaces the "dumb" terminals that linked the company's 370 remote offices to headquarters with browser-based workstations or laptops. "In the past, we just threw a router out there with TN3270 and a green screen," says Duke Burrell, network architect for Farm Bureau Financial Services. "As our agent offices and business affiliates grow, so does our need to get information to them."

+Farm Bureau now also provides Novell VPN (virtual private network) client access at the desktop for the Novell BorderManager-based VPN, and some of the company's larger offices will have their own servers equipped with VPN access to the hosts at headquarters. "That will be more of a site-to-site VPN," Burrell says.

+The insurance and financial services company uses the IPsec (IP security) feature in the VPN software for encrypting the IP transmission and authenticating the devices. Burrell says a few Farm Bureau offices purchased their own Internet access, so filters and access controllers will also be used on their edge routers for security, but the bulk of the sites and users connecting to the extranet will do so with IPsec. Digital certificates also are on the horizon for authenticating agents when they log onto the extranet, as are digital signatures for agents to electronically sign forms.

+Farm Bureau's server farm consists of clustered Novell NetWare 5.1 servers and Microsoft Windows 2000 servers connected to a Xiotech Corp. Magnitude SAN (storage area network) system. Among its applications are a massive Lotus Notes installation and some homegrown applications for policy-generation and other insurance-specific applications. For now, the extranet site contains mainly PDF files of policy forms for the agents, but Farm Bureau has begun recoding select legacy mainframe applications, including those for policy, agent membership and commission statement, with Allaire Corp.'s ColdFusion and Spectra tools to make them Web-based and accessible on the site, too.

diff --git a/mozilla/layout/html/tests/table/printing/file_list.txt b/mozilla/layout/html/tests/table/printing/file_list.txt index e3a23f83a7b..559d00a93ef 100644 --- a/mozilla/layout/html/tests/table/printing/file_list.txt +++ b/mozilla/layout/html/tests/table/printing/file_list.txt @@ -1,12 +1,16 @@ +file:///s|/mozilla/layout/html/tests/table/printing/bug26792.html file:///s|/mozilla/layout/html/tests/table/printing/bug53690.html file:///s|/mozilla/layout/html/tests/table/printing/bug54829.html -file:///s|/mozilla/layout/html/tests/table/printing/bug56792.html file:///s|/mozilla/layout/html/tests/table/printing/bug57378.html file:///s|/mozilla/layout/html/tests/table/printing/bug57467.html +file:///s|/mozilla/layout/html/tests/table/printing/bug59280-1.html +file:///s|/mozilla/layout/html/tests/table/printing/bug59280-2.html +file:///s|/mozilla/layout/html/tests/table/printing/bug61663.html +file:///s|/mozilla/layout/html/tests/table/printing/bug66804.html file:///s|/mozilla/layout/html/tests/table/printing/split2Rows.html file:///s|/mozilla/layout/html/tests/table/printing/split3Rows.html file:///s|/mozilla/layout/html/tests/table/printing/splitCell-1.html file:///s|/mozilla/layout/html/tests/table/printing/splitCell-2.html file:///s|/mozilla/layout/html/tests/table/printing/tfoot.html file:///s|/mozilla/layout/html/tests/table/printing/thead.html -file:///s|/mozilla/layout/html/tests/table/printing/theadfoot.html +file:///s|/mozilla/layout/html/tests/table/printing/theadtfoot.html diff --git a/mozilla/layout/html/tests/table/rtest.bat b/mozilla/layout/html/tests/table/rtest.bat index 9fd69566cd7..75b841acdbd 100755 --- a/mozilla/layout/html/tests/table/rtest.bat +++ b/mozilla/layout/html/tests/table/rtest.bat @@ -18,5 +18,8 @@ call rtest.bat %1 cd ..\dom call rtest.bat %1 +cd ..\printing +call rtest.bat %1 + cd .. diff --git a/mozilla/layout/xul/base/src/nsBoxFrame.cpp b/mozilla/layout/xul/base/src/nsBoxFrame.cpp index d1b2aefc1dc..1ce6c618eec 100644 --- a/mozilla/layout/xul/base/src/nsBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsBoxFrame.cpp @@ -1302,6 +1302,15 @@ nsBoxFrame::Paint(nsIPresContext* aPresContext, nsCSSRendering::PaintOutline(aPresContext, aRenderingContext, this, aDirtyRect, rect, *border, *outline, mStyleContext, 0); + // See if we need to cache the background color + nsIFrame* parent = nsnull; + GetParent(&parent); + nsIAtom* parentType = nsnull; + parent->GetFrameType(&parentType); + if (nsLayoutAtoms::rootFrame == parentType) { + SetDefaultBackgroundColor(aPresContext); + } + // The sole purpose of this is to trigger display // of the selection window for Named Anchors, // which don't have any children and normally don't diff --git a/mozilla/lib/mac/Instrumentation/InstrumentationHelpers.h b/mozilla/lib/mac/Instrumentation/InstrumentationHelpers.h new file mode 100644 index 00000000000..3c706b78ce3 --- /dev/null +++ b/mozilla/lib/mac/Instrumentation/InstrumentationHelpers.h @@ -0,0 +1,149 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1999 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Simon Fraser sfraser@netscape.com + */ + + +/* + + About this file + --------------- + + This file contains some handy macros, and a stack-based class that makes + instrumenting functions with Apple's Instrumentation SDK easier. + + Instrumentation SDK + ------------------- + + The Instrumentation SDK allows you to do code performance analysis, + collecting time-based data, and other data by putting instrumentation + points in your code, and running. + + You can get the instrumentation SDK from: + + ftp://ftp.apple.com/developer/Development_Kits/Instrumentation_SDK.hqx + + To find out how to use the Instrumentation Toolkit, read the documentation + that comes with the SDK. I'm not going to explain all that here. + + Setting up your tree + -------------------- + + Put the headers and libraries from the Instrumentation SDK into + a folder in your CodeWarrior 'Mac OS Support' folder. + + How to use + ---------- + + In C++ code, the following macros can be used thusly: + + NS_IMETHODIMP nsBigThing::SlowFunction() + { + INST_TRACE("SomeLocationDescription"); // Descriptive label. Don't use :: here. + + // code that might return anywhere. + ... + + return NS_OK; + } + + Because the INST_TRACE macro makes a stack-based StInstrumentationLog, + exit from the function will be traced wherever it occurs. + + You will also need to add the "InstrumentationLib" stub library to the + project. + + Such instrumentation points will give you data for the + 'Trace Time Line Viewer' in the viewer. There are many other types + of instrumentation data you can collect; see the docs in the SDK + for more information. + + Stalking the wild time sink + --------------------------- + + Your general strategy when using the Instrumentation tools to + track down performance problems should be to start at the high + level, then drill down into subroutines. You want to avoid + instrumenting routines that are called hundreds of thousands + of times, because you'll end up with massive data files. Rather, + instrument their calling routines to get a good sense of where + the time goes. + + This kind of performance analysis does not replace the more + traditional profiling tools. Rather, it allows you to analyse + performance problems in terms of behaviour and timing, rather + than a simply overview of % of time spent in different routines. + +*/ + +#include + +#ifdef __cplusplus +/* Stack-based class to do logging */ + +class StInstrumentationLog +{ +public: + StInstrumentationLog(const char* traceName, InstTraceClassRef &ioTraceClassRef) + { + if (ioTraceClassRef == 0) + { + if (InstCreateTraceClass( kInstRootClassRef, traceName, 0, kInstEnableClassMask, &ioTraceClassRef) != noErr) + { + DebugStr("\pFailed to make instrumentation trace class"); + return; + } + } + + mTraceClassRef = ioTraceClassRef; + mEventTag = InstCreateEventTag(); + InstLogTraceEvent(mTraceClassRef, mEventTag, kInstStartEvent); + } + + ~StInstrumentationLog() + { + InstLogTraceEvent(mTraceClassRef, mEventTag, kInstEndEvent); + } + + void LogMiddleEvent() + { + InstLogTraceEvent(mTraceClassRef, mEventTag, kInstMiddleEvent); + } + + void LogMiddleEventWithData(const char* inFormatString, void* inEventData) + { + InstDataDescriptorRef dataDesc; + InstCreateDataDescriptor(inFormatString, &dataDesc); + InstLogTraceEventWithData(mTraceClassRef, mEventTag, kInstMiddleEvent, dataDesc, inEventData); + InstDisposeDataDescriptor(dataDesc); + } + +protected: + + InstTraceClassRef mTraceClassRef; + InstEventTag mEventTag; +}; + +#define INST_TRACE(n) static InstTraceClassRef __sTrace = 0; StInstrumentationLog traceLog((n), __sTrace) +#define INST_TRACE_MIDDLE do { traceLog.LogMiddleEvent(); } while(0) +#define INST_TRACE_DATA(s, d) do { traceLog.LogMiddleEventWithData((s), (d)); } while (0) + +#endif /* __cplusplus */ diff --git a/mozilla/lib/mac/Instrumentation/MANIFEST b/mozilla/lib/mac/Instrumentation/MANIFEST new file mode 100644 index 00000000000..e8e852cd6f4 --- /dev/null +++ b/mozilla/lib/mac/Instrumentation/MANIFEST @@ -0,0 +1 @@ +InstrumentationHelpers.h diff --git a/mozilla/mailnews/base/resources/content/dbviewtest.xul b/mozilla/mailnews/base/resources/content/dbviewtest.xul deleted file mode 100644 index 333ae92a135..00000000000 --- a/mozilla/mailnews/base/resources/content/dbviewtest.xul +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - -