Bug 616684 - Remove support for DOM Views; r=sicking,ehsan
authorMs2ger <ms2ger@gmail.com>
Sun, 24 Apr 2011 08:54:25 +0200
changeset 68811 0fb6deab9b72d2e59fd0466739a02abaa37dd7f4
parent 68810 74af720b024cd916590fb556ba8b71ed884f4eaa
child 68812 4bbc17c443c91e5ed1e93ed50b96ad7ea6668500
push idunknown
push userunknown
push dateunknown
reviewerssicking, ehsan
bugs616684
milestone6.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 616684 - Remove support for DOM Views; r=sicking,ehsan
accessible/src/atk/nsMaiInterfaceComponent.cpp
accessible/src/base/nsCoreUtils.cpp
accessible/src/html/nsHyperTextAccessible.cpp
accessible/src/msaa/nsAccessNodeWrap.cpp
content/base/src/nsContentAreaDragDrop.cpp
content/base/src/nsContentUtils.cpp
content/base/src/nsDocument.cpp
content/base/src/nsDocument.h
content/base/src/nsGenericElement.cpp
content/events/src/nsDOMDragEvent.cpp
content/events/src/nsDOMKeyboardEvent.cpp
content/events/src/nsDOMMouseEvent.cpp
content/events/src/nsDOMMouseScrollEvent.cpp
content/events/src/nsDOMMozTouchEvent.cpp
content/events/src/nsDOMScrollAreaEvent.cpp
content/events/src/nsDOMSimpleGestureEvent.cpp
content/events/src/nsDOMTouchEvent.cpp
content/events/src/nsDOMUIEvent.cpp
content/events/src/nsDOMUIEvent.h
content/events/src/nsDOMXULCommandEvent.cpp
content/events/src/nsEventStateManager.cpp
content/html/document/src/nsHTMLDocument.cpp
content/smil/nsDOMTimeEvent.cpp
content/smil/nsDOMTimeEvent.h
content/svg/content/src/nsSVGElement.cpp
content/xml/document/src/nsXMLPrettyPrinter.cpp
content/xul/content/src/nsXULElement.cpp
dom/Makefile.in
dom/base/nsDOMClassInfo.cpp
dom/base/nsGlobalWindow.cpp
dom/base/nsGlobalWindow.h
dom/interfaces/base/domstubs.idl
dom/interfaces/base/nsIDOMWindow.idl
dom/interfaces/base/nsIDOMWindow2.idl
dom/interfaces/base/nsIDOMWindowInternal.idl
dom/interfaces/core/nsIDOMDocument.idl
dom/interfaces/core/nsIDOMXMLDocument.idl
dom/interfaces/css/Makefile.in
dom/interfaces/css/nsIDOMViewCSS.idl
dom/interfaces/events/nsIDOMDragEvent.idl
dom/interfaces/events/nsIDOMKeyEvent.idl
dom/interfaces/events/nsIDOMMouseEvent.idl
dom/interfaces/events/nsIDOMMouseScrollEvent.idl
dom/interfaces/events/nsIDOMMozTouchEvent.idl
dom/interfaces/events/nsIDOMNSMouseEvent.idl
dom/interfaces/events/nsIDOMScrollAreaEvent.idl
dom/interfaces/events/nsIDOMSimpleGestureEvent.idl
dom/interfaces/events/nsIDOMTouchEvent.idl
dom/interfaces/events/nsIDOMUIEvent.idl
dom/interfaces/html/nsIDOMHTMLDocument.idl
dom/interfaces/smil/nsIDOMTimeEvent.idl
dom/interfaces/svg/nsIDOMSVGDocument.idl
dom/interfaces/svg/nsIDOMSVGZoomEvent.idl
dom/interfaces/views/Makefile.in
dom/interfaces/views/nsIDOMAbstractView.idl
dom/interfaces/views/nsIDOMDocumentView.idl
dom/interfaces/xul/nsIDOMXULCommandEvent.idl
editor/libeditor/html/nsHTMLAbsPosition.cpp
editor/libeditor/html/nsHTMLAnonymousUtils.cpp
editor/libeditor/html/nsHTMLCSSUtils.cpp
editor/libeditor/html/nsHTMLCSSUtils.h
embedding/browser/webBrowser/nsContextMenuInfo.cpp
extensions/spellcheck/src/mozInlineSpellWordUtil.cpp
extensions/spellcheck/src/mozInlineSpellWordUtil.h
extensions/widgetutils/src/nsWidgetUtils.cpp
js/src/xpconnect/src/dom_quickstubs.qsconf
layout/inspector/src/inLayoutUtils.cpp
toolkit/toolkit-makefiles.sh
widget/src/cocoa/nsMenuItemIconX.mm
widget/src/cocoa/nsMenuUtilsX.mm
xpfe/appshell/src/nsXULWindow.cpp
--- a/accessible/src/atk/nsMaiInterfaceComponent.cpp
+++ b/accessible/src/atk/nsMaiInterfaceComponent.cpp
@@ -40,18 +40,16 @@
 
 #include "nsMaiInterfaceComponent.h"
 
 #include "nsAccessibleWrap.h"
 #include "nsAccUtils.h"
 #include "nsCoreUtils.h"
 
 #include "nsIDOMDocument.h"
-#include "nsIDOMDocumentView.h"
-#include "nsIDOMAbstractView.h"
 #include "nsIDOMWindowInternal.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIInterfaceRequestorUtils.h"
 
 void
 componentInterfaceInitCB(AtkComponentIface *aIface)
 {
     NS_ASSERTION(aIface, "Invalid Interface");
--- a/accessible/src/base/nsCoreUtils.cpp
+++ b/accessible/src/base/nsCoreUtils.cpp
@@ -38,25 +38,22 @@
 
 #include "nsCoreUtils.h"
 
 #include "nsIAccessibleTypes.h"
 
 #include "nsAccessNode.h"
 
 #include "nsIDocument.h"
-#include "nsIDOMAbstractView.h"
 #include "nsIDOM3Node.h"
 #include "nsIDOMDocument.h"
-#include "nsIDOMDocumentView.h"
 #include "nsIDOMHTMLDocument.h"
 #include "nsIDOMHTMLElement.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMRange.h"
-#include "nsIDOMViewCSS.h"
 #include "nsIDOMWindowInternal.h"
 #include "nsIDOMXULElement.h"
 #include "nsIDocShell.h"
 #include "nsIContentViewer.h"
 #include "nsIEventListenerManager.h"
 #include "nsIPresShell.h"
 #include "nsPresContext.h"
 #include "nsIScrollableFrame.h"
@@ -420,23 +417,22 @@ nsCoreUtils::GetScreenCoordsForWindow(ns
   nsIntPoint coords(0, 0);
   nsCOMPtr<nsIDocShellTreeItem> treeItem(GetDocShellTreeItemFor(aNode));
   if (!treeItem)
     return coords;
 
   nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
   treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
   nsCOMPtr<nsIDOMDocument> domDoc = do_GetInterface(rootTreeItem);
-  nsCOMPtr<nsIDOMDocumentView> docView(do_QueryInterface(domDoc));
-  if (!docView)
+  if (!domDoc)
     return coords;
 
-  nsCOMPtr<nsIDOMAbstractView> abstractView;
-  docView->GetDefaultView(getter_AddRefs(abstractView));
-  nsCOMPtr<nsIDOMWindowInternal> windowInter(do_QueryInterface(abstractView));
+  nsCOMPtr<nsIDOMWindow> window;
+  domDoc->GetDefaultView(getter_AddRefs(window));
+  nsCOMPtr<nsIDOMWindowInternal> windowInter(do_QueryInterface(window));
   if (!windowInter)
     return coords;
 
   windowInter->GetScreenX(&coords.x);
   windowInter->GetScreenY(&coords.y);
   return coords;
 }
 
@@ -592,24 +588,24 @@ nsCoreUtils::GetComputedStyleDeclaration
   if (!content)
     return nsnull;
 
   // Returns number of items in style declaration
   nsIDocument* document = content->GetOwnerDoc();
   if (!document)
     return nsnull;
 
-  nsCOMPtr<nsIDOMViewCSS> viewCSS(do_QueryInterface(document->GetWindow()));
-  if (!viewCSS)
+  nsCOMPtr<nsIDOMWindow> window = do_QueryInterface(document->GetWindow());
+  if (!window)
     return nsnull;
 
-  nsIDOMCSSStyleDeclaration* cssDecl = nsnull;
+  nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl;
   nsCOMPtr<nsIDOMElement> domElement(do_QueryInterface(content));
-  viewCSS->GetComputedStyle(domElement, aPseudoElt, &cssDecl);
-  return cssDecl;
+  window->GetComputedStyle(domElement, aPseudoElt, getter_AddRefs(cssDecl));
+  return cssDecl.forget();
 }
 
 already_AddRefed<nsIBoxObject>
 nsCoreUtils::GetTreeBodyBoxObject(nsITreeBoxObject *aTreeBoxObj)
 {
   nsCOMPtr<nsIDOMElement> tcElm;
   aTreeBoxObj->GetTreeBody(getter_AddRefs(tcElm));
   nsCOMPtr<nsIDOMXULElement> tcXULElm(do_QueryInterface(tcElm));
--- a/accessible/src/html/nsHyperTextAccessible.cpp
+++ b/accessible/src/html/nsHyperTextAccessible.cpp
@@ -42,21 +42,19 @@
 #include "States.h"
 #include "nsAccessibilityAtoms.h"
 #include "nsAccessibilityService.h"
 #include "nsAccUtils.h"
 #include "nsTextAttrs.h"
 
 #include "nsIClipboard.h"
 #include "nsContentCID.h"
-#include "nsIDOMAbstractView.h"
 #include "nsIDOMCharacterData.h"
 #include "nsIDOMDocument.h"
 #include "nsPIDOMWindow.h"        
-#include "nsIDOMDocumentView.h"
 #include "nsIDOMRange.h"
 #include "nsIDOMNSRange.h"
 #include "nsIDOMWindowInternal.h"
 #include "nsIDOMXULDocument.h"
 #include "nsIEditingSession.h"
 #include "nsIEditor.h"
 #include "nsIFrame.h"
 #include "nsFrameSelection.h"
--- a/accessible/src/msaa/nsAccessNodeWrap.cpp
+++ b/accessible/src/msaa/nsAccessNodeWrap.cpp
@@ -47,17 +47,16 @@
 #include "nsCoreUtils.h"
 #include "nsRootAccessible.h"
 #include "nsWinUtils.h"
 
 #include "nsAttrName.h"
 #include "nsIDocument.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMNSHTMLElement.h"
-#include "nsIDOMViewCSS.h"
 #include "nsIFrame.h"
 #include "nsINameSpaceManager.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsPIDOMWindow.h"
 #include "nsIServiceManager.h"
 
 /// the accessible library and cached methods
--- a/content/base/src/nsContentAreaDragDrop.cpp
+++ b/content/base/src/nsContentAreaDragDrop.cpp
@@ -49,17 +49,16 @@
 #include "nsIDOMNSUIEvent.h"
 #include "nsIDOMUIEvent.h"
 #include "nsISelection.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMEvent.h"
 #include "nsIDOMNSEvent.h"
 #include "nsIDOMDragEvent.h"
-#include "nsIDOMAbstractView.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMDocumentRange.h"
 #include "nsIDOMRange.h"
 #include "nsIFormControl.h"
 #include "nsIDOMHTMLAreaElement.h"
 #include "nsIDOMHTMLAnchorElement.h"
 #include "nsITransferable.h"
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -163,17 +163,16 @@ static NS_DEFINE_CID(kXTFServiceCID, NS_
 #include "nsIChannelEventSink.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIOfflineCacheUpdate.h"
 #include "nsCPrefetchService.h"
 #include "nsIChromeRegistry.h"
 #include "nsIMIMEHeaderParam.h"
 #include "nsIDOMXULCommandEvent.h"
-#include "nsIDOMAbstractView.h"
 #include "nsIDOMDragEvent.h"
 #include "nsDOMDataTransfer.h"
 #include "nsHtml5Module.h"
 #include "nsPresContext.h"
 #include "nsLayoutStatics.h"
 #include "nsLayoutUtils.h"
 #include "nsFrameManager.h"
 #include "BasicLayers.h"
@@ -5518,19 +5517,18 @@ nsContentUtils::DispatchXULCommand(nsICo
   nsCOMPtr<nsIDOMDocumentEvent> docEvent = do_QueryInterface(doc);
   NS_ENSURE_STATE(docEvent);
   nsCOMPtr<nsIDOMEvent> event;
   docEvent->CreateEvent(NS_LITERAL_STRING("xulcommandevent"),
                         getter_AddRefs(event));
   nsCOMPtr<nsIDOMXULCommandEvent> xulCommand = do_QueryInterface(event);
   nsCOMPtr<nsIPrivateDOMEvent> pEvent = do_QueryInterface(xulCommand);
   NS_ENSURE_STATE(pEvent);
-  nsCOMPtr<nsIDOMAbstractView> view = do_QueryInterface(doc->GetWindow());
   nsresult rv = xulCommand->InitCommandEvent(NS_LITERAL_STRING("command"),
-                                             PR_TRUE, PR_TRUE, view,
+                                             PR_TRUE, PR_TRUE, doc->GetWindow(),
                                              0, aCtrl, aAlt, aShift, aMeta,
                                              aSourceEvent);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (aShell) {
     nsEventStatus status = nsEventStatus_eIgnore;
     nsCOMPtr<nsIPresShell> kungFuDeathGrip = aShell;
     return aShell->HandleDOMEventWithTarget(aTarget, event, &status);
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -70,18 +70,16 @@
 
 #include "nsGUIEvent.h"
 #include "nsPLDOMEvent.h"
 
 #include "nsIDOMStyleSheet.h"
 #include "nsDOMAttribute.h"
 #include "nsIDOMDOMStringList.h"
 #include "nsIDOMDOMImplementation.h"
-#include "nsIDOMDocumentView.h"
-#include "nsIDOMAbstractView.h"
 #include "nsIDOMDocumentXBL.h"
 #include "mozilla/FunctionTimer.h"
 #include "nsGenericElement.h"
 #include "nsGenericHTMLElement.h"
 #include "nsIDOMEventGroup.h"
 #include "nsIDOMCDATASection.h"
 #include "nsIDOMProcessingInstruction.h"
 #include "nsDOMString.h"
@@ -5072,26 +5070,24 @@ nsDocument::CreateTreeWalker(nsIDOMNode 
 
   NS_ADDREF(*_retval = walker);
 
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
-nsDocument::GetDefaultView(nsIDOMAbstractView** aDefaultView)
-{
+nsDocument::GetDefaultView(nsIDOMWindow** aDefaultView)
+{
+  *aDefaultView = nsnull;
   nsPIDOMWindow* win = GetWindow();
-  if (win) {
-    return CallQueryInterface(win, aDefaultView);
-  }
-
-  *aDefaultView = nsnull;
-
-  return NS_OK;
+  if (!win) {
+    return NS_OK;
+  }
+  return CallQueryInterface(win, aDefaultView);
 }
 
 NS_IMETHODIMP
 nsDocument::GetLocation(nsIDOMLocation **_retval)
 {
   NS_ENSURE_ARG_POINTER(_retval);
   *_retval = nsnull;
 
@@ -8326,17 +8322,17 @@ nsDocument::SetImagesNeedAnimating(PRBoo
                                          : DecrementAnimationEnumerator,
                               nsnull);
 
   // Update state.
   mAnimatingImages = aAnimating;
 }
 
 NS_IMETHODIMP
-nsDocument::CreateTouch(nsIDOMAbstractView* aView,
+nsDocument::CreateTouch(nsIDOMWindow* aView,
                         nsIDOMEventTarget* aTarget,
                         PRInt32 aIdentifier,
                         PRInt32 aPageX,
                         PRInt32 aPageY,
                         PRInt32 aScreenX,
                         PRInt32 aScreenY,
                         PRInt32 aClientX,
                         PRInt32 aClientY,
--- a/content/base/src/nsDocument.h
+++ b/content/base/src/nsDocument.h
@@ -47,17 +47,16 @@
 #include "nsCRT.h"
 #include "nsIDocument.h"
 #include "nsWeakReference.h"
 #include "nsWeakPtr.h"
 #include "nsVoidArray.h"
 #include "nsTArray.h"
 #include "nsHashSets.h"
 #include "nsIDOMXMLDocument.h"
-#include "nsIDOMDocumentView.h"
 #include "nsIDOMDocumentXBL.h"
 #include "nsIDOMNSDocument.h"
 #include "nsIDOMNSDocumentStyle.h"
 #include "nsIDOMDocumentRange.h"
 #include "nsIDOMDocumentTraversal.h"
 #include "nsStubDocumentObserver.h"
 #include "nsIDOM3EventTarget.h"
 #include "nsIDOMNSEventTarget.h"
@@ -494,17 +493,16 @@ protected:
 // nsIDOMXMLDocument unless someone writes a real implementation of
 // the interface.
 class nsDocument : public nsIDocument,
                    public nsIDOMXMLDocument, // inherits nsIDOMDocument
                    public nsIDOMNSDocument,
                    public nsIDOMDocumentEvent,
                    public nsIDOM3DocumentEvent,
                    public nsIDOMNSDocumentStyle,
-                   public nsIDOMDocumentView,
                    public nsIDOMDocumentRange,
                    public nsIDOMDocumentTraversal,
                    public nsIDOMDocumentXBL,
                    public nsSupportsWeakReference,
                    public nsIDOMEventTarget,
                    public nsIDOM3EventTarget,
                    public nsIDOMNSEventTarget,
                    public nsIScriptObjectPrincipal,
@@ -811,19 +809,16 @@ public:
   NS_DECL_NSIDOM3DOCUMENTEVENT
 
   // nsIDOMDocumentStyle
   NS_DECL_NSIDOMDOCUMENTSTYLE
 
   // nsIDOMNSDocumentStyle
   NS_DECL_NSIDOMNSDOCUMENTSTYLE
 
-  // nsIDOMDocumentView
-  NS_DECL_NSIDOMDOCUMENTVIEW
-
   // nsIDOMDocumentRange
   NS_DECL_NSIDOMDOCUMENTRANGE
 
   // nsIDOMDocumentTraversal
   NS_DECL_NSIDOMDOCUMENTTRAVERSAL
 
   // nsIDOMDocumentXBL
   NS_DECL_NSIDOMDOCUMENTXBL
@@ -1263,15 +1258,14 @@ protected:
 #endif
 };
 
 #define NS_DOCUMENT_INTERFACE_TABLE_BEGIN(_class)                             \
   NS_NODE_OFFSET_AND_INTERFACE_TABLE_BEGIN(_class)                            \
   NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocument, nsDocument)      \
   NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMNSDocument, nsDocument)    \
   NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocumentEvent, nsDocument) \
-  NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocumentView, nsDocument)  \
   NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocumentTraversal,         \
                                      nsDocument)                              \
   NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMEventTarget, nsDocument)   \
   NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMNode, nsDocument)
 
 #endif /* nsDocument_h___ */
--- a/content/base/src/nsGenericElement.cpp
+++ b/content/base/src/nsGenericElement.cpp
@@ -87,17 +87,16 @@
 #ifdef MOZ_XUL
 #include "nsXULElement.h"
 #endif /* MOZ_XUL */
 #include "nsFrameManager.h"
 #include "nsFrameSelection.h"
 
 #include "nsBindingManager.h"
 #include "nsXBLBinding.h"
-#include "nsIDOMViewCSS.h"
 #include "nsIXBLService.h"
 #include "nsPIDOMWindow.h"
 #include "nsIBoxObject.h"
 #include "nsPIBoxObject.h"
 #include "nsIDOMNSDocument.h"
 #include "nsIDOMNSElement.h"
 #include "nsClientRect.h"
 #ifdef MOZ_SVG
--- a/content/events/src/nsDOMDragEvent.cpp
+++ b/content/events/src/nsDOMDragEvent.cpp
@@ -75,17 +75,17 @@ DOMCI_DATA(DragEvent, nsDOMDragEvent)
 NS_INTERFACE_MAP_BEGIN(nsDOMDragEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMDragEvent)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(DragEvent)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent)
 
 NS_IMETHODIMP
 nsDOMDragEvent::InitDragEvent(const nsAString & aType,
                               PRBool aCanBubble, PRBool aCancelable,
-                              nsIDOMAbstractView* aView, PRInt32 aDetail,
+                              nsIDOMWindow* aView, PRInt32 aDetail,
                               PRInt32 aScreenX, PRInt32 aScreenY,
                               PRInt32 aClientX, PRInt32 aClientY, 
                               PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey,
                               PRBool aMetaKey, PRUint16 aButton,
                               nsIDOMEventTarget *aRelatedTarget,
                               nsIDOMDataTransfer* aDataTransfer)
 {
   nsresult rv = nsDOMMouseEvent::InitMouseEvent(aType, aCanBubble, aCancelable,
@@ -127,12 +127,10 @@ nsDOMDragEvent::GetDataTransfer(nsIDOMDa
   return NS_OK;
 }
 
 nsresult NS_NewDOMDragEvent(nsIDOMEvent** aInstancePtrResult,
                             nsPresContext* aPresContext,
                             nsDragEvent *aEvent) 
 {
   nsDOMDragEvent* event = new nsDOMDragEvent(aPresContext, aEvent);
-  NS_ENSURE_TRUE(event, NS_ERROR_OUT_OF_MEMORY);
-
   return CallQueryInterface(event, aInstancePtrResult);
 }
--- a/content/events/src/nsDOMKeyboardEvent.cpp
+++ b/content/events/src/nsDOMKeyboardEvent.cpp
@@ -170,17 +170,17 @@ nsDOMKeyboardEvent::GetWhich(PRUint32* a
       break;
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMKeyboardEvent::InitKeyEvent(const nsAString& aType, PRBool aCanBubble, PRBool aCancelable,
-                                 nsIDOMAbstractView* aView, PRBool aCtrlKey, PRBool aAltKey,
+                                 nsIDOMWindow* aView, PRBool aCtrlKey, PRBool aAltKey,
                                  PRBool aShiftKey, PRBool aMetaKey,
                                  PRUint32 aKeyCode, PRUint32 aCharCode)
 {
   nsresult rv = nsDOMUIEvent::InitUIEvent(aType, aCanBubble, aCancelable, aView, 0);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsKeyEvent* keyEvent = static_cast<nsKeyEvent*>(mEvent);
   keyEvent->isControl = aCtrlKey;
@@ -193,14 +193,10 @@ nsDOMKeyboardEvent::InitKeyEvent(const n
   return NS_OK;
 }
 
 nsresult NS_NewDOMKeyboardEvent(nsIDOMEvent** aInstancePtrResult,
                                 nsPresContext* aPresContext,
                                 nsKeyEvent *aEvent)
 {
   nsDOMKeyboardEvent* it = new nsDOMKeyboardEvent(aPresContext, aEvent);
-  if (nsnull == it) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-
   return CallQueryInterface(it, aInstancePtrResult);
 }
--- a/content/events/src/nsDOMMouseEvent.cpp
+++ b/content/events/src/nsDOMMouseEvent.cpp
@@ -99,17 +99,17 @@ DOMCI_DATA(MouseEvent, nsDOMMouseEvent)
 NS_INTERFACE_MAP_BEGIN(nsDOMMouseEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMMouseEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMNSMouseEvent)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MouseEvent)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent)
 
 NS_IMETHODIMP
 nsDOMMouseEvent::InitMouseEvent(const nsAString & aType, PRBool aCanBubble, PRBool aCancelable,
-                                nsIDOMAbstractView *aView, PRInt32 aDetail, PRInt32 aScreenX, 
+                                nsIDOMWindow* aView, PRInt32 aDetail, PRInt32 aScreenX, 
                                 PRInt32 aScreenY, PRInt32 aClientX, PRInt32 aClientY, 
                                 PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey, 
                                 PRBool aMetaKey, PRUint16 aButton, nsIDOMEventTarget *aRelatedTarget)
 {
   nsresult rv = nsDOMUIEvent::InitUIEvent(aType, aCanBubble, aCancelable, aView, aDetail);
   NS_ENSURE_SUCCESS(rv, rv);
 
   switch(mEvent->eventStructType)
@@ -142,17 +142,17 @@ nsDOMMouseEvent::InitMouseEvent(const ns
        break;
   }
 
   return NS_OK;
 }   
 
 NS_IMETHODIMP
 nsDOMMouseEvent::InitNSMouseEvent(const nsAString & aType, PRBool aCanBubble, PRBool aCancelable,
-                                  nsIDOMAbstractView *aView, PRInt32 aDetail, PRInt32 aScreenX,
+                                  nsIDOMWindow *aView, PRInt32 aDetail, PRInt32 aScreenX,
                                   PRInt32 aScreenY, PRInt32 aClientX, PRInt32 aClientY,
                                   PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey,
                                   PRBool aMetaKey, PRUint16 aButton, nsIDOMEventTarget *aRelatedTarget,
                                   float aPressure, PRUint16 aInputSource)
 {
   nsresult rv = nsDOMMouseEvent::InitMouseEvent(aType, aCanBubble, aCancelable,
                                                 aView, aDetail, aScreenX, aScreenY,
                                                 aClientX, aClientY, aCtrlKey, aAltKey, aShiftKey,
@@ -308,14 +308,10 @@ nsDOMMouseEvent::GetMozInputSource(PRUin
   return NS_OK;
 }
 
 nsresult NS_NewDOMMouseEvent(nsIDOMEvent** aInstancePtrResult,
                              nsPresContext* aPresContext,
                              nsInputEvent *aEvent) 
 {
   nsDOMMouseEvent* it = new nsDOMMouseEvent(aPresContext, aEvent);
-  if (nsnull == it) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-
   return CallQueryInterface(it, aInstancePtrResult);
 }
--- a/content/events/src/nsDOMMouseScrollEvent.cpp
+++ b/content/events/src/nsDOMMouseScrollEvent.cpp
@@ -83,17 +83,17 @@ DOMCI_DATA(MouseScrollEvent, nsDOMMouseS
 
 NS_INTERFACE_MAP_BEGIN(nsDOMMouseScrollEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMMouseScrollEvent)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MouseScrollEvent)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent)
 
 NS_IMETHODIMP
 nsDOMMouseScrollEvent::InitMouseScrollEvent(const nsAString & aType, PRBool aCanBubble, PRBool aCancelable,
-                                nsIDOMAbstractView *aView, PRInt32 aDetail, PRInt32 aScreenX, 
+                                nsIDOMWindow *aView, PRInt32 aDetail, PRInt32 aScreenX, 
                                 PRInt32 aScreenY, PRInt32 aClientX, PRInt32 aClientY, 
                                 PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey, 
                                 PRBool aMetaKey, PRUint16 aButton, nsIDOMEventTarget *aRelatedTarget,
                                 PRInt32 aAxis)
 {
   nsresult rv = nsDOMMouseEvent::InitMouseEvent(aType, aCanBubble, aCancelable, aView, aDetail,
                                                 aScreenX, aScreenY, aClientX, aClientY, aCtrlKey,
                                                 aAltKey, aShiftKey, aMetaKey, aButton, aRelatedTarget);
@@ -124,14 +124,10 @@ nsDOMMouseScrollEvent::GetAxis(PRInt32* 
   return NS_OK;
 }
 
 nsresult NS_NewDOMMouseScrollEvent(nsIDOMEvent** aInstancePtrResult,
                                    nsPresContext* aPresContext,
                                    nsInputEvent *aEvent) 
 {
   nsDOMMouseScrollEvent* it = new nsDOMMouseScrollEvent(aPresContext, aEvent);
-  if (nsnull == it) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-
   return CallQueryInterface(it, aInstancePtrResult);
 }
--- a/content/events/src/nsDOMMozTouchEvent.cpp
+++ b/content/events/src/nsDOMMozTouchEvent.cpp
@@ -80,17 +80,17 @@ nsDOMMozTouchEvent::GetStreamId(PRUint32
   *aStreamId = static_cast<nsMozTouchEvent*>(mEvent)->streamId;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMMozTouchEvent::InitMozTouchEvent(const nsAString& aTypeArg,
                                       PRBool aCanBubbleArg,
                                       PRBool aCancelableArg,
-                                      nsIDOMAbstractView* aViewArg,
+                                      nsIDOMWindow* aViewArg,
                                       PRInt32 aDetailArg,
                                       PRInt32 aScreenX,
                                       PRInt32 aScreenY,
                                       PRInt32 aClientX,
                                       PRInt32 aClientY,
                                       PRBool aCtrlKeyArg,
                                       PRBool aAltKeyArg,
                                       PRBool aShiftKeyArg,
@@ -122,13 +122,10 @@ nsDOMMozTouchEvent::InitMozTouchEvent(co
   return NS_OK;
 }
 
 nsresult NS_NewDOMMozTouchEvent(nsIDOMEvent** aInstancePtrResult,
                                      nsPresContext* aPresContext,
                                      nsMozTouchEvent *aEvent)
 {
   nsDOMMozTouchEvent *it = new nsDOMMozTouchEvent(aPresContext, aEvent);
-  if (nsnull == it) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
   return CallQueryInterface(it, aInstancePtrResult);
 }
--- a/content/events/src/nsDOMScrollAreaEvent.cpp
+++ b/content/events/src/nsDOMScrollAreaEvent.cpp
@@ -96,17 +96,17 @@ nsDOMScrollAreaEvent::GetHeight(float *a
 {
   return mClientArea.GetHeight(aHeight);
 }
 
 NS_IMETHODIMP
 nsDOMScrollAreaEvent::InitScrollAreaEvent(const nsAString &aEventType,
                                           PRBool aCanBubble,
                                           PRBool aCancelable,
-                                          nsIDOMAbstractView *aView,
+                                          nsIDOMWindow *aView,
                                           PRInt32 aDetail,
                                           float aX, float aY,
                                           float aWidth, float aHeight)
 {
   nsresult rv = nsDOMUIEvent::InitUIEvent(aEventType, aCanBubble, aCancelable, aView, aDetail);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mClientArea.SetRect(aX, aY, aWidth, aHeight);
@@ -151,15 +151,10 @@ nsDOMScrollAreaEvent::Deserialize(const 
 }
 
 nsresult
 NS_NewDOMScrollAreaEvent(nsIDOMEvent **aInstancePtrResult,
                          nsPresContext *aPresContext,
                          nsScrollAreaEvent *aEvent)
 {
   nsDOMScrollAreaEvent *ev = new nsDOMScrollAreaEvent(aPresContext, aEvent);
-
-  if (!ev) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-
   return CallQueryInterface(ev, aInstancePtrResult);
 }
--- a/content/events/src/nsDOMSimpleGestureEvent.cpp
+++ b/content/events/src/nsDOMSimpleGestureEvent.cpp
@@ -90,17 +90,17 @@ nsDOMSimpleGestureEvent::GetDelta(PRFloa
   *aDelta = static_cast<nsSimpleGestureEvent*>(mEvent)->delta;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMSimpleGestureEvent::InitSimpleGestureEvent(const nsAString& aTypeArg,
                                                 PRBool aCanBubbleArg,
                                                 PRBool aCancelableArg,
-                                                nsIDOMAbstractView* aViewArg,
+                                                nsIDOMWindow* aViewArg,
                                                 PRInt32 aDetailArg,
                                                 PRInt32 aScreenX, 
                                                 PRInt32 aScreenY,
                                                 PRInt32 aClientX,
                                                 PRInt32 aClientY,
                                                 PRBool aCtrlKeyArg,
                                                 PRBool aAltKeyArg,
                                                 PRBool aShiftKeyArg,
--- a/content/events/src/nsDOMTouchEvent.cpp
+++ b/content/events/src/nsDOMTouchEvent.cpp
@@ -1,9 +1,9 @@
-                     /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
+/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * 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/
  *
@@ -239,17 +239,17 @@ NS_INTERFACE_MAP_END_INHERITING(nsDOMUIE
 NS_IMPL_ADDREF_INHERITED(nsDOMTouchEvent, nsDOMUIEvent)
 NS_IMPL_RELEASE_INHERITED(nsDOMTouchEvent, nsDOMUIEvent)
 
 
 NS_IMETHODIMP
 nsDOMTouchEvent::InitTouchEvent(const nsAString& aType,
                                 PRBool aCanBubble,
                                 PRBool aCancelable,
-                                nsIDOMAbstractView* aView,
+                                nsIDOMWindow* aView,
                                 PRInt32 aDetail,
                                 PRBool aCtrlKey,
                                 PRBool aAltKey,
                                 PRBool aShiftKey,
                                 PRBool aMetaKey,
                                 nsIDOMTouchList* aTouches,
                                 nsIDOMTouchList* aTargetTouches,
                                 nsIDOMTouchList* aChangedTouches)
--- a/content/events/src/nsDOMUIEvent.cpp
+++ b/content/events/src/nsDOMUIEvent.cpp
@@ -171,32 +171,36 @@ nsDOMUIEvent::GetClientPoint()
   if (rootFrame)
     pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(mEvent, rootFrame);
 
   return nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(pt.x),
                     nsPresContext::AppUnitsToIntCSSPixels(pt.y));
 }
 
 NS_IMETHODIMP
-nsDOMUIEvent::GetView(nsIDOMAbstractView** aView)
+nsDOMUIEvent::GetView(nsIDOMWindow** aView)
 {
   *aView = mView;
   NS_IF_ADDREF(*aView);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMUIEvent::GetDetail(PRInt32* aDetail)
 {
   *aDetail = mDetail;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMUIEvent::InitUIEvent(const nsAString & typeArg, PRBool canBubbleArg, PRBool cancelableArg, nsIDOMAbstractView *viewArg, PRInt32 detailArg)
+nsDOMUIEvent::InitUIEvent(const nsAString& typeArg,
+                          PRBool canBubbleArg,
+                          PRBool cancelableArg,
+                          nsIDOMWindow* viewArg,
+                          PRInt32 detailArg)
 {
   nsresult rv = nsDOMEvent::InitEvent(typeArg, canBubbleArg, cancelableArg);
   NS_ENSURE_SUCCESS(rv, rv);
   
   mDetail = detailArg;
   mView = viewArg;
 
   return NS_OK;
@@ -413,14 +417,10 @@ nsDOMUIEvent::Deserialize(const IPC::Mes
   return PR_TRUE;
 }
 
 nsresult NS_NewDOMUIEvent(nsIDOMEvent** aInstancePtrResult,
                           nsPresContext* aPresContext,
                           nsGUIEvent *aEvent) 
 {
   nsDOMUIEvent* it = new nsDOMUIEvent(aPresContext, aEvent);
-  if (nsnull == it) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-
   return CallQueryInterface(it, aInstancePtrResult);
 }
--- a/content/events/src/nsDOMUIEvent.h
+++ b/content/events/src/nsDOMUIEvent.h
@@ -31,22 +31,21 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#ifndef nsDOMUIEvent_h__
-#define nsDOMUIEvent_h__
+#ifndef nsDOMUIEvent_h
+#define nsDOMUIEvent_h
 
 #include "nsIDOMUIEvent.h"
 #include "nsIDOMNSUIEvent.h"
-#include "nsIDOMAbstractView.h"
 #include "nsDOMEvent.h"
 
 class nsDOMUIEvent : public nsDOMEvent,
                      public nsIDOMUIEvent,
                      public nsIDOMNSUIEvent
 {
 public:
   nsDOMUIEvent(nsPresContext* aPresContext, nsGUIEvent* aEvent);
@@ -73,21 +72,21 @@ protected:
 
   // Internal helper functions
   nsIntPoint GetClientPoint();
   nsIntPoint GetScreenPoint();
   nsIntPoint GetLayerPoint();
   nsIntPoint GetPagePoint();
   
 protected:
-  nsCOMPtr<nsIDOMAbstractView> mView;
+  nsCOMPtr<nsIDOMWindow> mView;
   PRInt32 mDetail;
   nsIntPoint mClientPoint;
   // Screenpoint is mEvent->refPoint.
   nsIntPoint mLayerPoint;
   nsIntPoint mPagePoint;
 };
 
 #define NS_FORWARD_TO_NSDOMUIEVENT \
   NS_FORWARD_NSIDOMUIEVENT(nsDOMUIEvent::) \
   NS_FORWARD_TO_NSDOMEVENT
 
-#endif // nsDOMUIEvent_h__
+#endif // nsDOMUIEvent_h
--- a/content/events/src/nsDOMXULCommandEvent.cpp
+++ b/content/events/src/nsDOMXULCommandEvent.cpp
@@ -113,17 +113,17 @@ nsDOMXULCommandEvent::GetSourceEvent(nsI
   NS_ENSURE_ARG_POINTER(aSourceEvent);
   NS_IF_ADDREF(*aSourceEvent = mSourceEvent);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMXULCommandEvent::InitCommandEvent(const nsAString& aType,
                                        PRBool aCanBubble, PRBool aCancelable,
-                                       nsIDOMAbstractView *aView,
+                                       nsIDOMWindow* aView,
                                        PRInt32 aDetail,
                                        PRBool aCtrlKey, PRBool aAltKey,
                                        PRBool aShiftKey, PRBool aMetaKey,
                                        nsIDOMEvent* aSourceEvent)
 {
   nsresult rv = nsDOMUIEvent::InitUIEvent(aType, aCanBubble, aCancelable,
                                           aView, aDetail);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -139,14 +139,10 @@ nsDOMXULCommandEvent::InitCommandEvent(c
 }
 
 
 nsresult NS_NewDOMXULCommandEvent(nsIDOMEvent** aInstancePtrResult,
                                   nsPresContext* aPresContext,
                                   nsInputEvent *aEvent) 
 {
   nsDOMXULCommandEvent* it = new nsDOMXULCommandEvent(aPresContext, aEvent);
-  if (nsnull == it) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-
   return CallQueryInterface(it, aInstancePtrResult);
 }
--- a/content/events/src/nsEventStateManager.cpp
+++ b/content/events/src/nsEventStateManager.cpp
@@ -113,17 +113,16 @@
 #include "nsIObserverService.h"
 #include "nsIDocShell.h"
 #include "nsIMarkupDocumentViewer.h"
 #include "nsIDOMDocumentRange.h"
 #include "nsIDOMDocumentEvent.h"
 #include "nsIDOMMouseScrollEvent.h"
 #include "nsIDOMDragEvent.h"
 #include "nsIDOMEventTarget.h"
-#include "nsIDOMDocumentView.h"
 #include "nsIDOMNSUIEvent.h"
 #include "nsDOMDragEvent.h"
 #include "nsIDOMNSEditableElement.h"
 
 #include "nsIDOMRange.h"
 #include "nsCaret.h"
 #include "nsILookAndFeel.h"
 #include "nsWidgetsCID.h"
--- a/content/html/document/src/nsHTMLDocument.cpp
+++ b/content/html/document/src/nsHTMLDocument.cpp
@@ -1383,16 +1383,22 @@ nsHTMLDocument::AdoptNode(nsIDOMNode* aS
 }
 
 NS_IMETHODIMP
 nsHTMLDocument::NormalizeDocument()
 {
   return nsDocument::NormalizeDocument();
 }
 
+NS_IMETHODIMP
+nsHTMLDocument::GetDefaultView(nsIDOMWindow** aWindow)
+{
+  return nsDocument::GetDefaultView(aWindow);
+}
+
 //
 // nsIDOMHTMLDocument interface implementation
 //
 NS_IMETHODIMP
 nsHTMLDocument::GetTitle(nsAString& aTitle)
 {
   return nsDocument::GetTitle(aTitle);
 }
--- a/content/smil/nsDOMTimeEvent.cpp
+++ b/content/smil/nsDOMTimeEvent.cpp
@@ -34,17 +34,16 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsDOMTimeEvent.h"
 #include "nsGUIEvent.h"
 #include "nsPresContext.h"
 #include "nsIInterfaceRequestorUtils.h"
-#include "nsIDOMAbstractView.h"
 
 nsDOMTimeEvent::nsDOMTimeEvent(nsPresContext* aPresContext, nsEvent* aEvent)
   : nsDOMEvent(aPresContext, aEvent ? aEvent : new nsUIEvent(PR_FALSE, 0, 0)),
     mDetail(0)
 {
   if (aEvent) {
     mEventIsInternal = PR_FALSE;
   } else {
@@ -87,33 +86,33 @@ NS_IMPL_RELEASE_INHERITED(nsDOMTimeEvent
 DOMCI_DATA(TimeEvent, nsDOMTimeEvent)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMTimeEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMTimeEvent)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(TimeEvent)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
 
 NS_IMETHODIMP
-nsDOMTimeEvent::GetView(nsIDOMAbstractView** aView)
+nsDOMTimeEvent::GetView(nsIDOMWindow** aView)
 {
   *aView = mView;
   NS_IF_ADDREF(*aView);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMTimeEvent::GetDetail(PRInt32* aDetail)
 {
   *aDetail = mDetail;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMTimeEvent::InitTimeEvent(const nsAString& aTypeArg,
-                              nsIDOMAbstractView* aViewArg,
+                              nsIDOMWindow* aViewArg,
                               PRInt32 aDetailArg)
 {
   nsresult rv = nsDOMEvent::InitEvent(aTypeArg, PR_FALSE /*doesn't bubble*/,
                                                 PR_FALSE /*can't cancel*/);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mDetail = aDetailArg;
   mView = aViewArg;
--- a/content/smil/nsDOMTimeEvent.h
+++ b/content/smil/nsDOMTimeEvent.h
@@ -53,13 +53,13 @@ public:
 
   // nsIDOMTimeEvent interface:
   NS_DECL_NSIDOMTIMEEVENT
 
   // Forward to base class
   NS_FORWARD_TO_NSDOMEVENT
 
 private:
-  nsCOMPtr<nsIDOMAbstractView> mView;
-  PRInt32                      mDetail;
+  nsCOMPtr<nsIDOMWindow> mView;
+  PRInt32 mDetail;
 };
 
 #endif // NS_DOMTIMEEVENT_H_
--- a/content/svg/content/src/nsSVGElement.cpp
+++ b/content/svg/content/src/nsSVGElement.cpp
@@ -46,18 +46,16 @@
 #include "nsIDOMMutationEvent.h"
 #include "nsMutationEvent.h"
 #include "nsXBLPrototypeBinding.h"
 #include "nsBindingManager.h"
 #include "nsXBLBinding.h"
 #include "nsStyleConsts.h"
 #include "nsDOMError.h"
 #include "nsIPresShell.h"
-#include "nsIDOMViewCSS.h"
-#include "nsIDOMCSSStyleDeclaration.h"
 #include "nsIServiceManager.h"
 #include "nsIXBLService.h"
 #include "nsGkAtoms.h"
 #include "mozilla/css/StyleRule.h"
 #include "nsRuleWalker.h"
 #include "mozilla/css/Declaration.h"
 #include "nsCSSProps.h"
 #include "nsCSSParser.h"
--- a/content/xml/document/src/nsXMLPrettyPrinter.cpp
+++ b/content/xml/document/src/nsXMLPrettyPrinter.cpp
@@ -33,20 +33,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
  
 #include "nsXMLPrettyPrinter.h"
 #include "nsContentUtils.h"
-#include "nsIDOMDocumentView.h"
-#include "nsIDOMAbstractView.h"
 #include "nsIDOMCSSStyleDeclaration.h"
-#include "nsIDOMViewCSS.h"
 #include "nsIDOMDocumentXBL.h"
 #include "nsIObserver.h"
 #include "nsIXSLTProcessor.h"
 #include "nsSyncLoadService.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMDocument.h"
 #include "nsIServiceManager.h"
@@ -90,26 +87,23 @@ nsXMLPrettyPrinter::PrettyPrint(nsIDocum
     if (internalWin) {
         internalWin->GetFrameElement(getter_AddRefs(frameElem));
     }
 
     if (frameElem) {
         nsCOMPtr<nsIDOMCSSStyleDeclaration> computedStyle;
         nsCOMPtr<nsIDOMDocument> frameOwnerDoc;
         frameElem->GetOwnerDocument(getter_AddRefs(frameOwnerDoc));
-        nsCOMPtr<nsIDOMDocumentView> docView = do_QueryInterface(frameOwnerDoc);
-        if (docView) {
-            nsCOMPtr<nsIDOMAbstractView> defaultView;
-            docView->GetDefaultView(getter_AddRefs(defaultView));
-            nsCOMPtr<nsIDOMViewCSS> defaultCSSView =
-                do_QueryInterface(defaultView);
-            if (defaultCSSView) {
-                defaultCSSView->GetComputedStyle(frameElem,
-                                                 EmptyString(),
-                                                 getter_AddRefs(computedStyle));
+        if (frameOwnerDoc) {
+            nsCOMPtr<nsIDOMWindow> window;
+            frameOwnerDoc->GetDefaultView(getter_AddRefs(window));
+            if (window) {
+                window->GetComputedStyle(frameElem,
+                                         EmptyString(),
+                                         getter_AddRefs(computedStyle));
             }
         }
 
         if (computedStyle) {
             nsAutoString visibility;
             computedStyle->GetPropertyValue(NS_LITERAL_STRING("visibility"),
                                             visibility);
             if (!visibility.EqualsLiteral("visible")) {
--- a/content/xul/content/src/nsXULElement.cpp
+++ b/content/xul/content/src/nsXULElement.cpp
@@ -1,11 +1,10 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * ***** BEGIN LICENSE BLOCK *****
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * 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,
@@ -114,17 +113,16 @@
 #include "nsStyleConsts.h"
 #include "nsXPIDLString.h"
 #include "nsXULControllers.h"
 #include "nsIBoxObject.h"
 #include "nsPIBoxObject.h"
 #include "nsXULDocument.h"
 #include "nsXULPopupListener.h"
 #include "nsRuleWalker.h"
-#include "nsIDOMViewCSS.h"
 #include "nsIDOMCSSStyleDeclaration.h"
 #include "nsCSSParser.h"
 #include "nsIListBoxObject.h"
 #include "nsContentUtils.h"
 #include "nsContentList.h"
 #include "nsMutationEvent.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsPIDOMWindow.h"
--- a/dom/Makefile.in
+++ b/dom/Makefile.in
@@ -45,17 +45,16 @@ include $(DEPTH)/config/autoconf.mk
 MODULE		= dom
 DIRS = \
   interfaces/base \
   interfaces/canvas \
   interfaces/core \
   interfaces/html \
   interfaces/events \
   interfaces/stylesheets \
-  interfaces/views \
   interfaces/sidebar \
   interfaces/css \
   interfaces/traversal \
   interfaces/range \
   interfaces/xbl \
   interfaces/xpath \
   interfaces/load-save \
   interfaces/xul \
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -187,17 +187,16 @@
 #include "nsDOMCSSAttrDeclaration.h"
 
 // XBL related includes.
 #include "nsIXBLService.h"
 #include "nsXBLBinding.h"
 #include "nsBindingManager.h"
 #include "nsIFrame.h"
 #include "nsIPresShell.h"
-#include "nsIDOMViewCSS.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMCSSStyleDeclaration.h"
 #include "nsStyleSet.h"
 #include "nsStyleContext.h"
 #include "nsAutoPtr.h"
 #include "nsMemory.h"
 
 // Tranformiix
@@ -248,17 +247,16 @@
 #include "nsIDOMTransitionEvent.h"
 #ifdef MOZ_CSS_ANIMATIONS
 #include "nsIDOMAnimationEvent.h"
 #endif
 #include "nsIDOMNSDocumentStyle.h"
 #include "nsIDOMDocumentRange.h"
 #include "nsIDOMDocumentTraversal.h"
 #include "nsIDOMDocumentXBL.h"
-#include "nsIDOMDocumentView.h"
 #include "nsIDOMElementCSSInlineStyle.h"
 #include "nsIDOMLinkStyle.h"
 #include "nsIDOMHTMLDocument.h"
 #include "nsIDOMNSHTMLDocument.h"
 #include "nsIDOMHTMLElement.h"
 #include "nsIDOMNSHTMLElement.h"
 #include "nsIDOMHTMLAnchorElement.h"
 #include "nsIDOMHTMLAppletElement.h"
@@ -2298,17 +2296,16 @@ nsDOMClassInfo::RegisterExternalClasses(
     d.mInterfaces = interface_list;                                           \
   }
 
 #define DOM_CLASSINFO_DOCUMENT_MAP_ENTRIES                                    \
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSDocument)                                 \
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentEvent)                              \
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentStyle)                              \
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSDocumentStyle)                            \
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentView)                               \
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentRange)                              \
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentTraversal)                          \
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentXBL)                                \
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)                              \
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)                                \
     DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Node)                                      \
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMXPathEvaluator)                             \
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMNodeSelector)
@@ -2375,31 +2372,27 @@ nsDOMClassInfo::Init()
 
   if (nsGlobalWindow::HasIndexedDBSupport()) {
     DOM_CLASSINFO_MAP_BEGIN(Window, nsIDOMWindow)
       DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow)
       DOM_CLASSINFO_MAP_ENTRY(nsIDOMJSWindow)
       DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal)
       DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
       DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
-      DOM_CLASSINFO_MAP_ENTRY(nsIDOMViewCSS)
-      DOM_CLASSINFO_MAP_ENTRY(nsIDOMAbstractView)
       DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow)
       DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageIndexedDB)
       DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow_2_0_BRANCH)
     DOM_CLASSINFO_MAP_END
   } else {
     DOM_CLASSINFO_MAP_BEGIN(Window, nsIDOMWindow)
       DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow)
       DOM_CLASSINFO_MAP_ENTRY(nsIDOMJSWindow)
       DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal)
       DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
       DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
-      DOM_CLASSINFO_MAP_ENTRY(nsIDOMViewCSS)
-      DOM_CLASSINFO_MAP_ENTRY(nsIDOMAbstractView)
       DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow)
       DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow_2_0_BRANCH)
     DOM_CLASSINFO_MAP_END
   }
 
   DOM_CLASSINFO_MAP_BEGIN(WindowUtils, nsIDOMWindowUtils)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowUtils)
   DOM_CLASSINFO_MAP_END
@@ -3123,18 +3116,16 @@ nsDOMClassInfo::Init()
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMJSWindow)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMChromeWindow)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageIndexedDB)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMViewCSS)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMAbstractView)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(RangeException, nsIDOMRangeException)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMRangeException)
     DOM_CLASSINFO_MAP_ENTRY(nsIException)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ContentList, nsIDOMHTMLCollection)
@@ -4018,18 +4009,16 @@ nsDOMClassInfo::Init()
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ModalContentWindow, nsIDOMWindow)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMJSWindow)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMViewCSS)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMAbstractView)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageIndexedDB)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMModalContentWindow)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(DataContainerEvent, nsIDOMDataContainerEvent)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMDataContainerEvent)
     DOM_CLASSINFO_EVENT_MAP_ENTRIES
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -106,17 +106,16 @@
 #include "nsIHTMLDocument.h"
 #include "nsIDOMHTMLDocument.h"
 #include "nsIDOMHTMLElement.h"
 #ifndef MOZ_DISABLE_DOMCRYPTO
 #include "nsIDOMCrypto.h"
 #endif
 #include "nsIDOMDocument.h"
 #include "nsIDOMNSDocument.h"
-#include "nsIDOMDocumentView.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMDocumentEvent.h"
 #include "nsIDOMEvent.h"
 #include "nsIDOMHTMLAnchorElement.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMMessageEvent.h"
 #include "nsIDOMPopupBlockedEvent.h"
 #include "nsIDOMPopStateEvent.h"
@@ -1329,18 +1328,16 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
   NS_INTERFACE_MAP_ENTRY(nsIDOMJSWindow)
   NS_INTERFACE_MAP_ENTRY(nsIScriptGlobalObject)
   NS_INTERFACE_MAP_ENTRY(nsIScriptObjectPrincipal)
   NS_INTERFACE_MAP_ENTRY(nsPIDOMEventTarget)
   NS_INTERFACE_MAP_ENTRY(nsIDOMEventTarget)
   NS_INTERFACE_MAP_ENTRY(nsIDOM3EventTarget)
   NS_INTERFACE_MAP_ENTRY(nsIDOMNSEventTarget)
   NS_INTERFACE_MAP_ENTRY(nsPIDOMWindow)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMViewCSS)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMAbstractView)
   NS_INTERFACE_MAP_ENTRY(nsIDOMStorageWindow)
   NS_INTERFACE_MAP_ENTRY(nsIDOMStorageIndexedDB)
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
   NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
   NS_INTERFACE_MAP_ENTRY(nsIDOMWindow_2_0_BRANCH)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Window)
   OUTER_WINDOW_ONLY
     NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
@@ -7883,20 +7880,16 @@ nsGlobalWindow::UpdateCanvasFocus(PRBool
           nsCanvasFrame* canvasFrame = FindCanvasFrame(frame);
           if (canvasFrame) {
               canvasFrame->SetHasFocus(PR_FALSE);
           }
       }      
   }
 }
 
-//*****************************************************************************
-// nsGlobalWindow::nsIDOMViewCSS
-//*****************************************************************************
-
 NS_IMETHODIMP
 nsGlobalWindow::GetComputedStyle(nsIDOMElement* aElt,
                                  const nsAString& aPseudoElt,
                                  nsIDOMCSSStyleDeclaration** aReturn)
 {
   FORWARD_TO_OUTER(GetComputedStyle, (aElt, aPseudoElt, aReturn),
                    NS_ERROR_NOT_INITIALIZED);
 
@@ -7924,37 +7917,16 @@ nsGlobalWindow::GetComputedStyle(nsIDOME
   NS_ENSURE_SUCCESS(rv, rv);
 
   *aReturn = compStyle.forget().get();
 
   return NS_OK;
 }
 
 //*****************************************************************************
-// nsGlobalWindow::nsIDOMAbstractView
-//*****************************************************************************
-
-NS_IMETHODIMP
-nsGlobalWindow::GetDocument(nsIDOMDocumentView ** aDocumentView)
-{
-  NS_ENSURE_ARG_POINTER(aDocumentView);
-
-  nsresult rv = NS_OK;
-
-  if (mDocument) {
-    rv = CallQueryInterface(mDocument, aDocumentView);
-  }
-  else {
-    *aDocumentView = nsnull;
-  }
-
-  return rv;
-}
-
-//*****************************************************************************
 // nsGlobalWindow::nsIDOMStorageWindow
 //*****************************************************************************
 
 NS_IMETHODIMP
 nsGlobalWindow::GetSessionStorage(nsIDOMStorage ** aSessionStorage)
 {
   FORWARD_TO_INNER(GetSessionStorage, (aSessionStorage), NS_ERROR_UNEXPECTED);
 
--- a/dom/base/nsGlobalWindow.h
+++ b/dom/base/nsGlobalWindow.h
@@ -57,17 +57,16 @@
 
 // Interfaces Needed
 #include "nsDOMWindowList.h"
 #include "nsIBaseWindow.h"
 #include "nsIBrowserDOMWindow.h"
 #include "nsIDocShellTreeOwner.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDOMClientInformation.h"
-#include "nsIDOMViewCSS.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIDOM3EventTarget.h"
 #include "nsIDOMNSEventTarget.h"
 #include "nsIDOMNavigator.h"
 #include "nsIDOMNavigatorGeolocation.h"
 #include "nsIDOMNavigatorDesktopNotification.h"
 #include "nsIDOMLocation.h"
 #include "nsIDOMWindowInternal.h"
@@ -275,17 +274,16 @@ JSObject *NS_NewOuterWindowProxy(JSConte
 class nsGlobalWindow : public nsPIDOMWindow,
                        public nsIScriptGlobalObject,
                        public nsIDOMJSWindow,
                        public nsIScriptObjectPrincipal,
                        public nsIDOMEventTarget,
                        public nsPIDOMEventTarget,
                        public nsIDOM3EventTarget,
                        public nsIDOMNSEventTarget,
-                       public nsIDOMViewCSS,
                        public nsIDOMStorageWindow,
                        public nsIDOMStorageIndexedDB,
                        public nsSupportsWeakReference,
                        public nsIInterfaceRequestor,
                        public nsIDOMWindow_2_0_BRANCH,
                        public nsWrapperCache,
                        public PRCListStr
 {
@@ -414,22 +412,16 @@ public:
 
   virtual NS_HIDDEN_(PRBool) CanClose();
   virtual NS_HIDDEN_(nsresult) ForceClose();
 
   virtual NS_HIDDEN_(void) SetHasOrientationEventListener();
   virtual NS_HIDDEN_(void) MaybeUpdateTouchState();
   virtual NS_HIDDEN_(void) UpdateTouchState();
 
-  // nsIDOMViewCSS
-  NS_DECL_NSIDOMVIEWCSS
-
-  // nsIDOMAbstractView
-  NS_DECL_NSIDOMABSTRACTVIEW
-
   // nsIDOMStorageWindow
   NS_DECL_NSIDOMSTORAGEWINDOW
 
   // nsIInterfaceRequestor
   NS_DECL_NSIINTERFACEREQUESTOR
 
   // Object Management
   nsGlobalWindow(nsGlobalWindow *aOuterWindow);
--- a/dom/interfaces/base/domstubs.idl
+++ b/dom/interfaces/base/domstubs.idl
@@ -72,20 +72,16 @@ interface DOMException;
 interface RangeException;
 
 // Style Sheets
 interface nsIDOMStyleSheetList;
 interface nsIDOMLinkStyle;
 interface nsIDOMStyleSheet;
 interface nsIDOMMediaList;
 
-// Views
-interface nsIDOMAbstractView;
-interface nsIDOMDocumentView;
-
 // Base
 interface nsIDOMWindow;
 interface nsIDOMWindowInternal;
 interface nsIDOMWindowCollection;
 interface nsIDOMPlugin;
 interface nsIDOMPluginArray;
 interface nsIDOMMimeType;
 interface nsIDOMMimeTypeArray;
@@ -125,9 +121,8 @@ interface nsIDOMHTMLTableSectionElement;
 
 // Range
 interface nsIDOMRange;
 
 // Crypto
 interface nsIDOMCRMFObject;
 interface nsIDOMCrypto;
 interface nsIDOMPkcs11;
-
--- a/dom/interfaces/base/nsIDOMWindow.idl
+++ b/dom/interfaces/base/nsIDOMWindow.idl
@@ -42,21 +42,20 @@
 interface nsISelection;
 
 /**
  * The nsIDOMWindow interface is the primary interface for a DOM
  * window object. It represents a single window object that may
  * contain child windows if the document in the window contains a
  * HTML frameset document or if the document contains iframe elements.
  *
- * This interface is not officially defined by any standard bodies, it
- * originates from the defacto DOM Level 0 standard.
+ * @see <http://www.whatwg.org/html/#window>
  */
 
-[scriptable, uuid(a6cf906b-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(ff7d278f-93db-4078-b89a-058c8e1270b4)]
 interface nsIDOMWindow : nsISupports
 {
   /**
    * Accessor for the document in this window.
    */
   readonly attribute nsIDOMDocument                     document;
 
   /**
@@ -145,9 +144,15 @@ interface nsIDOMWindow : nsISupports
    * Method for scrolling this window by a number of pages.
    */
   void                      scrollByPages(in long numPages);
 
   /**
    * Method for sizing this window to the content in the window.
    */
   void                      sizeToContent();
+
+  /**
+   * @see <http://dev.w3.org/csswg/cssom/#dom-window-getcomputedstyle>
+   */
+  nsIDOMCSSStyleDeclaration getComputedStyle(in nsIDOMElement elt, 
+                                             [optional] in DOMString pseudoElt);
 };
--- a/dom/interfaces/base/nsIDOMWindow2.idl
+++ b/dom/interfaces/base/nsIDOMWindow2.idl
@@ -35,17 +35,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMWindow.idl"
 
 interface nsIDOMOfflineResourceList;
 interface nsIDOMBlob;
 
-[scriptable, uuid(efff0d88-3b94-4375-bdeb-676a847ecd7d)]
+[scriptable, uuid(e2796e00-14de-4ce0-acfe-0374bc0e715d)]
 interface nsIDOMWindow2 : nsIDOMWindow
 {
   /**
    * Get the window root for this window. This is useful for hooking
    * up event listeners to this window and every other window nested
    * in the window root.
    */
   [noscript] readonly attribute nsIDOMEventTarget windowRoot;
--- a/dom/interfaces/base/nsIDOMWindowInternal.idl
+++ b/dom/interfaces/base/nsIDOMWindowInternal.idl
@@ -41,17 +41,17 @@
 
 interface nsIPrompt;
 interface nsIControllers;
 interface nsIDOMLocation;
 interface nsIVariant;
 interface nsIAnimationFrameListener;
 interface nsIDOMMediaQueryList;
 
-[scriptable, uuid(04eafa93-efbe-4254-9d65-91c344fa7ff2)]
+[scriptable, uuid(4d95736f-8130-43cb-a276-5bc554eca80a)]
 interface nsIDOMWindowInternal : nsIDOMWindow2
 {
   readonly attribute nsIDOMWindowInternal        window;
 
   /* [replaceable] self */
   readonly attribute nsIDOMWindowInternal        self;
 
   readonly attribute nsIDOMNavigator             navigator;
--- a/dom/interfaces/core/nsIDOMDocument.idl
+++ b/dom/interfaces/core/nsIDOMDocument.idl
@@ -47,17 +47,17 @@
  * cannot exist outside the context of a Document, the nsIDOMDocument 
  * interface also contains the factory methods needed to create these 
  * objects.
  *
  * For more information on this interface please see 
  * http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
  */
 
-[scriptable, uuid(2d305b95-a030-4d24-a12c-7fabf61a8c3c)]
+[scriptable, uuid(d12f0ecf-434a-4b5c-81ad-354e3b9037b9)]
 interface nsIDOMDocument : nsIDOMNode
 {
   readonly attribute nsIDOMDocumentType         doctype;
   readonly attribute nsIDOMDOMImplementation    implementation;
   readonly attribute nsIDOMElement              documentElement;
   nsIDOMElement                 createElement(in DOMString tagName)
                                   raises(DOMException);
   nsIDOMDocumentFragment        createDocumentFragment();
@@ -103,9 +103,16 @@ interface nsIDOMDocument : nsIDOMNode
                                         // raises(DOMException) on setting
   // Introduced in DOM Level 3:
            attribute DOMString       documentURI;
   // Introduced in DOM Level 3:
   nsIDOMNode         adoptNode(in nsIDOMNode source)
                                         raises(DOMException);
   // Introduced in DOM Level 3:
   void               normalizeDocument();
+
+  /**
+   * The window associated with this document.
+   *
+   * @see http://www.whatwg.org/html/#dom-document-defaultview
+   */
+  readonly attribute nsIDOMWindow    defaultView;
 };
--- a/dom/interfaces/core/nsIDOMXMLDocument.idl
+++ b/dom/interfaces/core/nsIDOMXMLDocument.idl
@@ -33,17 +33,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMDocument.idl"
 
-[scriptable, uuid(f493687c-ea80-471b-965b-11467ebea24b)]
+[scriptable, uuid(68e4448c-eb64-48ea-801a-0c83008d2607)]
 interface nsIDOMXMLDocument : nsIDOMDocument
 {
   // DOM Level 3 Load & Save, DocumentLS
   // http://www.w3.org/TR/DOM-Level-3-LS/load-save.html#LS-DocumentLS
   /**
    * Whether to load synchronously or asynchronously.
    * The default is async==true.
    */
--- a/dom/interfaces/css/Makefile.in
+++ b/dom/interfaces/css/Makefile.in
@@ -66,17 +66,16 @@ XPIDLSRCS =					\
 	nsIDOMCSSMozDocumentRule.idl		\
 	nsIDOMCSSPageRule.idl			\
 	nsIDOMCSSStyleRule.idl			\
 	nsIDOMCSSUnknownRule.idl		\
 	nsIDOMCounter.idl			\
 	nsIDOMDocumentCSS.idl			\
 	nsIDOMRGBColor.idl			\
 	nsIDOMRect.idl				\
-	nsIDOMViewCSS.idl			\
 	nsIDOMNSRGBAColor.idl			\
 	$(NULL)
 
 ifdef MOZ_CSS_ANIMATIONS
 XPIDLSRCS +=					\
 	nsIDOMMozCSSKeyframeRule.idl		\
 	nsIDOMMozCSSKeyframesRule.idl		\
 	$(NULL)
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMViewCSS.idl
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * 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 mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2000
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Johnny Stenback <jst@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsIDOMAbstractView.idl"
-
-[scriptable, uuid(0b9341f3-95d4-4fa4-adcd-e119e0db2889)]
-interface nsIDOMViewCSS : nsIDOMAbstractView
-{
-  /**
-   * @see <http://dev.w3.org/csswg/cssom/#dom-window-getcomputedstyle>
-   */
-  nsIDOMCSSStyleDeclaration getComputedStyle(in nsIDOMElement elt, 
-                                             [optional] in DOMString pseudoElt);
-};
--- a/dom/interfaces/events/nsIDOMDragEvent.idl
+++ b/dom/interfaces/events/nsIDOMDragEvent.idl
@@ -33,28 +33,27 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "domstubs.idl"
 #include "nsIDOMMouseEvent.idl"
 
-interface nsIDOMAbstractView;
 interface nsIDOMDataTransfer;
 
-[scriptable, uuid(98351627-62d7-4b07-bbf3-78009b20764b)]
+[scriptable, uuid(0f4fef03-c0e9-406c-a754-c01148e431ae)]
 interface nsIDOMDragEvent : nsIDOMMouseEvent
 {
   readonly attribute nsIDOMDataTransfer dataTransfer;
 
   void initDragEvent(in DOMString typeArg,
                      in boolean canBubbleArg,
                      in boolean cancelableArg,
-                     in nsIDOMAbstractView aView,
+                     in nsIDOMWindow aView,
                      in long aDetail,
                      in long aScreenX,
                      in long aScreenY,
                      in long aClientX,
                      in long aClientY,
                      in boolean aCtrlKey,
                      in boolean aAltKey,
                      in boolean aShiftKey,
--- a/dom/interfaces/events/nsIDOMKeyEvent.idl
+++ b/dom/interfaces/events/nsIDOMKeyEvent.idl
@@ -34,17 +34,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMUIEvent.idl"
 
-[scriptable, uuid(028e0e6e-8b01-11d3-aae7-0010838a3123)]
+[scriptable, uuid(e44d7977-20f2-442e-bc13-0f2f52992a4c)]
 interface nsIDOMKeyEvent : nsIDOMUIEvent
 {
   const unsigned long DOM_VK_CANCEL         = 0x03;
   const unsigned long DOM_VK_HELP           = 0x06;
   const unsigned long DOM_VK_BACK_SPACE     = 0x08;
   const unsigned long DOM_VK_TAB            = 0x09;
   const unsigned long DOM_VK_CLEAR          = 0x0C;
   const unsigned long DOM_VK_RETURN         = 0x0D;
@@ -188,16 +188,16 @@ interface nsIDOMKeyEvent : nsIDOMUIEvent
   readonly attribute boolean          altKey;
   readonly attribute boolean          ctrlKey;
   readonly attribute boolean          shiftKey;
   readonly attribute boolean          metaKey;
 
   void                      initKeyEvent(in DOMString typeArg,
                                          in boolean canBubbleArg,
                                          in boolean cancelableArg,
-                                         in nsIDOMAbstractView viewArg,
+                                         in nsIDOMWindow viewArg,
                                          in boolean ctrlKeyArg,
                                          in boolean altKeyArg,
                                          in boolean shiftKeyArg,
                                          in boolean metaKeyArg,
                                          in unsigned long keyCodeArg,
                                          in unsigned long charCodeArg);
 };
--- a/dom/interfaces/events/nsIDOMMouseEvent.idl
+++ b/dom/interfaces/events/nsIDOMMouseEvent.idl
@@ -42,17 +42,17 @@
 /**
  * The nsIDOMMouseEvent interface is the datatype for all mouse events
  * in the Document Object Model.
  *
  * For more information on this interface please see
  * http://www.w3.org/TR/DOM-Level-2-Events/
  */
 
-[scriptable, uuid(ff751edc-8b02-aae7-0010-8301838a3123)]
+[scriptable, uuid(73558605-f479-493e-86d1-9794cd117fef)]
 interface nsIDOMMouseEvent : nsIDOMUIEvent
 {
   readonly attribute long               screenX;
   readonly attribute long               screenY;
 
   readonly attribute long               clientX;
   readonly attribute long               clientY;
 
@@ -62,17 +62,17 @@ interface nsIDOMMouseEvent : nsIDOMUIEve
   readonly attribute boolean            metaKey;
 
   readonly attribute unsigned short     button;
   readonly attribute nsIDOMEventTarget  relatedTarget;
 
   void                      initMouseEvent(in DOMString typeArg,
                                            in boolean canBubbleArg,
                                            in boolean cancelableArg,
-                                           in nsIDOMAbstractView viewArg,
+                                           in nsIDOMWindow viewArg,
                                            in long detailArg,
                                            in long screenXArg,
                                            in long screenYArg,
                                            in long clientXArg,
                                            in long clientYArg,
                                            in boolean ctrlKeyArg,
                                            in boolean altKeyArg,
                                            in boolean shiftKeyArg,
--- a/dom/interfaces/events/nsIDOMMouseScrollEvent.idl
+++ b/dom/interfaces/events/nsIDOMMouseScrollEvent.idl
@@ -33,28 +33,28 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMMouseEvent.idl"
 
-[scriptable, uuid(ba8d1a7e-b475-4542-8d32-01e7ea7b8091)]
+[scriptable, uuid(af08bce0-6821-4bac-8964-0fcee4be549a)]
 interface nsIDOMMouseScrollEvent : nsIDOMMouseEvent
 {
   const long HORIZONTAL_AXIS = 1;
   const long VERTICAL_AXIS = 2;
 
   readonly attribute long axis;
 
   void                initMouseScrollEvent(in DOMString typeArg,
                                            in boolean canBubbleArg,
                                            in boolean cancelableArg,
-                                           in nsIDOMAbstractView viewArg,
+                                           in nsIDOMWindow viewArg,
                                            in long detailArg,
                                            in long screenXArg,
                                            in long screenYArg,
                                            in long clientXArg,
                                            in long clientYArg,
                                            in boolean ctrlKeyArg,
                                            in boolean altKeyArg,
                                            in boolean shiftKeyArg,
--- a/dom/interfaces/events/nsIDOMMozTouchEvent.idl
+++ b/dom/interfaces/events/nsIDOMMozTouchEvent.idl
@@ -35,25 +35,25 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 
 #include "nsIDOMMouseEvent.idl"
 
 
-[scriptable, uuid(9b454391-0190-4313-a070-1e26e9bf6f31)]
+[scriptable, uuid(e9ed248b-1995-482f-8407-33ae7744bb9c)]
 interface nsIDOMMozTouchEvent : nsIDOMMouseEvent
 {
   readonly attribute unsigned long streamId;
 
   void initMozTouchEvent(in DOMString typeArg,
                          in boolean canBubbleArg,
                          in boolean cancelableArg,
-                         in nsIDOMAbstractView viewArg,
+                         in nsIDOMWindow viewArg,
                          in long detailArg,
                          in long screenXArg,
                          in long screenYArg,
                          in long clientXArg,
                          in long clientYArg,
                          in boolean ctrlKeyArg,
                          in boolean altKeyArg,
                          in boolean shiftKeyArg,
--- a/dom/interfaces/events/nsIDOMNSMouseEvent.idl
+++ b/dom/interfaces/events/nsIDOMNSMouseEvent.idl
@@ -38,17 +38,17 @@
 
 #include "nsIDOMMouseEvent.idl"
 
 /**
  * The nsIDOMNSMouseEvent interface extends nsIDOMMouseEvent
  * by providing various information related to the mouse event.
  */
 
-[scriptable, uuid(f5dd5fbb-f4ff-4277-819c-f31aa1dafc32)]
+[scriptable, uuid(8418a402-3c9b-431a-80a7-a59b23ed57a0)]
 interface nsIDOMNSMouseEvent : nsIDOMMouseEvent
 {
   // Finger or touch pressure event value
   // ranges between 0.0 and 1.0
   readonly attribute float mozPressure;
 
   const unsigned short    MOZ_SOURCE_UNKNOWN    = 0;
   const unsigned short    MOZ_SOURCE_MOUSE      = 1;
@@ -58,17 +58,17 @@ interface nsIDOMNSMouseEvent : nsIDOMMou
   const unsigned short    MOZ_SOURCE_TOUCH      = 5;
   const unsigned short    MOZ_SOURCE_KEYBOARD   = 6;
 
   readonly attribute unsigned short mozInputSource;
 
   void                initNSMouseEvent(in DOMString typeArg,
                                        in boolean canBubbleArg,
                                        in boolean cancelableArg,
-                                       in nsIDOMAbstractView viewArg,
+                                       in nsIDOMWindow viewArg,
                                        in long detailArg,
                                        in long screenXArg,
                                        in long screenYArg,
                                        in long clientXArg,
                                        in long clientYArg,
                                        in boolean ctrlKeyArg,
                                        in boolean altKeyArg,
                                        in boolean shiftKeyArg,
--- a/dom/interfaces/events/nsIDOMScrollAreaEvent.idl
+++ b/dom/interfaces/events/nsIDOMScrollAreaEvent.idl
@@ -32,27 +32,27 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMUIEvent.idl"
 
-[scriptable, uuid(b2f49035-4a2f-4e62-8fb0-deb68b0de4d9)]
+[scriptable, uuid(911c3352-6690-421c-9bbe-6bd34f1600dc)]
 interface nsIDOMScrollAreaEvent : nsIDOMUIEvent
 {
   // Scroll area client rect
   readonly attribute float x;
   readonly attribute float y;
   readonly attribute float width;
   readonly attribute float height;
 
   void initScrollAreaEvent(in DOMString aEventType,
                            in boolean aCanBubble,
                            in boolean aCancelable,
-                           in nsIDOMAbstractView aView,
+                           in nsIDOMWindow aView,
                            in long aDetail,
                            in float x,
                            in float y,
                            in float width,
                            in float height);
 };
--- a/dom/interfaces/events/nsIDOMSimpleGestureEvent.idl
+++ b/dom/interfaces/events/nsIDOMSimpleGestureEvent.idl
@@ -92,17 +92,17 @@
  * Default behavior:
  *
  * Some operating systems support default behaviors for gesture events
  * when they are not handled by the application. Consumers should
  * use event.preventDefault() to prevent default behavior when
  * consuming events.
  */
 
-[scriptable, uuid(cb68e879-f710-415d-a871-9a550860df01)]
+[scriptable, uuid(fe6b7df3-be7c-4a0b-99a2-da84e956e2f5)]
 interface nsIDOMSimpleGestureEvent : nsIDOMMouseEvent
 {
   /* Swipe direction constants */
   const unsigned long DIRECTION_UP = 1;
   const unsigned long DIRECTION_DOWN = 2;
   const unsigned long DIRECTION_LEFT = 4;
   const unsigned long DIRECTION_RIGHT = 8;
   
@@ -143,17 +143,17 @@ interface nsIDOMSimpleGestureEvent : nsI
    * and current/final width between the two touch points on the input
    * device and are measured in pixels.
    */
   readonly attribute double delta;
 
   void initSimpleGestureEvent(in DOMString typeArg,
                               in boolean canBubbleArg,
                               in boolean cancelableArg,
-                              in nsIDOMAbstractView viewArg,
+                              in nsIDOMWindow viewArg,
                               in long detailArg,
                               in long screenXArg,
                               in long screenYArg,
                               in long clientXArg,
                               in long clientYArg,
                               in boolean ctrlKeyArg,
                               in boolean altKeyArg,
                               in boolean shiftKeyArg,
--- a/dom/interfaces/events/nsIDOMTouchEvent.idl
+++ b/dom/interfaces/events/nsIDOMTouchEvent.idl
@@ -72,30 +72,30 @@ interface nsIDOMTouchEvent : nsIDOMUIEve
   readonly attribute nsIDOMTouchList changedTouches;
   readonly attribute boolean         altKey;
   readonly attribute boolean         metaKey;
   readonly attribute boolean         ctrlKey;
   readonly attribute boolean         shiftKey;
   void initTouchEvent(in DOMString type,
                       in boolean canBubble,
                       in boolean cancelable,
-                      in nsIDOMAbstractView view,
+                      in nsIDOMWindow view,
                       in long detail,
                       in boolean ctrlKey,
                       in boolean altKey,
                       in boolean shiftKey,
                       in boolean metaKey,
                       in nsIDOMTouchList touches,
                       in nsIDOMTouchList targetTouches,
                       in nsIDOMTouchList changedTouches);
 };
 
-[scriptable, uuid(922e0f11-28b9-4560-9fb8-869fe143845f)]
+[scriptable, uuid(804a3851-ea2e-4e5f-bedd-315f37f31ab1)]
 interface nsIDOMDocumentTouch : nsISupports {
-  nsIDOMTouch createTouch([optional] in nsIDOMAbstractView view,
+  nsIDOMTouch createTouch([optional] in nsIDOMWindow view,
                           [optional] in nsIDOMEventTarget target,
                           [optional] in long identifier,
                           [optional] in long pageX,
                           [optional] in long pageY,
                           [optional] in long screenX,
                           [optional] in long screenY,
                           [optional] in long clientX,
                           [optional] in long clientY,
--- a/dom/interfaces/events/nsIDOMUIEvent.idl
+++ b/dom/interfaces/events/nsIDOMUIEvent.idl
@@ -42,19 +42,19 @@
 /**
  * The nsIDOMUIEvent interface is the datatype for all UI events in the
  * Document Object Model.
  *
  * For more information on this interface please see
  * http://www.w3.org/TR/DOM-Level-2-Events/
  */
 
-[scriptable, uuid(a6cf90c3-15b3-11d2-932e-00805f8add32)]
+[scriptable, uuid(25f28689-3f78-47e8-8d76-15b936faf8c1)]
 interface nsIDOMUIEvent : nsIDOMEvent
 {
-  readonly attribute nsIDOMAbstractView view;
+  readonly attribute nsIDOMWindow       view;
   readonly attribute long               detail;
   void                      initUIEvent(in DOMString typeArg,
                                         in boolean canBubbleArg,
                                         in boolean cancelableArg,
-                                        in nsIDOMAbstractView viewArg,
+                                        in nsIDOMWindow viewArg,
                                         in long detailArg);
 };
--- a/dom/interfaces/html/nsIDOMHTMLDocument.idl
+++ b/dom/interfaces/html/nsIDOMHTMLDocument.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(2d7a0f2e-6b1c-4e93-bbea-122eb0a8a513)]
+[scriptable, uuid(42bb545e-be46-4f4f-8c0a-6c948ea0c1d4)]
 interface nsIDOMHTMLDocument : nsIDOMDocument
 {
            attribute DOMString            title;
   readonly attribute DOMString            referrer;
   // domain is readonly per spec, but it's settable in
   // nsIDOMNSHTMLDocument
   [noscript] readonly attribute DOMString domain;
   readonly attribute DOMString            URL;
--- a/dom/interfaces/smil/nsIDOMTimeEvent.idl
+++ b/dom/interfaces/smil/nsIDOMTimeEvent.idl
@@ -40,18 +40,18 @@
 /**
  * The SMIL TimeEvent interface.
  *
  * For more information please refer to:
  * http://www.w3.org/TR/SMIL/smil-timing.html#Events-TimeEvent
  * http://www.w3.org/TR/SVG/animate.html#InterfaceTimeEvent
  */
 
-[scriptable, uuid(0d309c26-ddbb-44cb-9af1-3008972349e3)]
+[scriptable, uuid(873785cc-d8be-48af-8b30-5c566e3f4e6e)]
 interface nsIDOMTimeEvent : nsIDOMEvent
 {
   readonly attribute long detail;
-  readonly attribute nsIDOMAbstractView view;
+  readonly attribute nsIDOMWindow view;
   
   void initTimeEvent(in DOMString typeArg,
-                     in nsIDOMAbstractView viewArg,
+                     in nsIDOMWindow viewArg,
                      in long detailArg);
 };
--- a/dom/interfaces/svg/nsIDOMSVGDocument.idl
+++ b/dom/interfaces/svg/nsIDOMSVGDocument.idl
@@ -34,17 +34,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMDocument.idl"
 
 interface nsIDOMSVGSVGElement;
 
-[scriptable, uuid(dcac0765-b258-4e0b-9862-6470eb9876ba)]
+[scriptable, uuid(907f1ada-5ace-4789-8c25-0c79f251044d)]
 interface nsIDOMSVGDocument : nsIDOMDocument
                          /* , nsIDOMDocumentEvent */
 {
   readonly attribute DOMString title;
   readonly attribute DOMString referrer;
   readonly attribute DOMString domain;
   readonly attribute DOMString URL;
   readonly attribute nsIDOMSVGSVGElement rootElement;
--- a/dom/interfaces/svg/nsIDOMSVGZoomEvent.idl
+++ b/dom/interfaces/svg/nsIDOMSVGZoomEvent.idl
@@ -40,17 +40,17 @@
 /**
  * For more information on this interface please see
  * http://www.w3.org/TR/SVG11/script.html#InterfaceSVGZoomEvent
  */
 
 interface nsIDOMSVGRect;
 interface nsIDOMSVGPoint;
 
-[scriptable, uuid(339a8c7a-552e-4cbc-8d96-8370a3939358)]
+[scriptable, uuid(7298880d-127d-470d-a8ac-e5a8e5969270)]
 interface nsIDOMSVGZoomEvent : nsIDOMUIEvent
 {
   readonly attribute nsIDOMSVGRect  zoomRectScreen;
   readonly attribute float          previousScale;
   readonly attribute nsIDOMSVGPoint previousTranslate;
   readonly attribute float          newScale;
   readonly attribute nsIDOMSVGPoint newTranslate;
 };
deleted file mode 100644
--- a/dom/interfaces/views/Makefile.in
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# 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 mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either of the GNU General Public License Version 2 or later (the "GPL"),
-# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH		= ../../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE		= dom
-XPIDL_MODULE	= dom_views
-GRE_MODULE	= 1
-
-SDK_XPIDLSRCS =                                 \
-	nsIDOMDocumentView.idl			\
-	nsIDOMAbstractView.idl			\
-	$(NULL)
-
-include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/dom/interfaces/views/nsIDOMAbstractView.idl
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * 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 mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2000
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Johnny Stenback <jst@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "domstubs.idl"
-
-/**
- * The nsIDOMAbstractView interface is a datatype for a view in the
- * Document Object Model.
- *
- * For more information on this interface please see
- * http://www.w3.org/TR/DOM-Level-2-Views
- */
-
-[scriptable, uuid(F51EBADE-8B1A-11D3-AAE7-0010830123B4)]
-interface nsIDOMAbstractView : nsISupports
-{
-  readonly attribute nsIDOMDocumentView     document;
-};
deleted file mode 100644
--- a/dom/interfaces/views/nsIDOMDocumentView.idl
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * 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 mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2000
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Johnny Stenback <jst@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "domstubs.idl"
-
-/**
- * The nsIDOMDocumentView interface is a datatype for a document that
- * supports views in the Document Object Model.
- *
- * For more information on this interface please see
- * http://www.w3.org/TR/DOM-Level-2-Views
- */
-
-[scriptable, uuid(1ACDB2BA-1DD2-11B2-95BC-9542495D2569)]
-interface nsIDOMDocumentView : nsISupports
-{
-  readonly attribute nsIDOMAbstractView     defaultView;
-};
-
--- a/dom/interfaces/xul/nsIDOMXULCommandEvent.idl
+++ b/dom/interfaces/xul/nsIDOMXULCommandEvent.idl
@@ -38,17 +38,17 @@
 
 /**
  * This interface is supported by command events, which are dispatched to
  * XUL elements as a result of mouse or keyboard activation.
  */
 
 #include "nsIDOMUIEvent.idl"
 
-[scriptable, uuid(f9fa8205-a988-4828-9228-f3332d5475ac)]
+[scriptable, uuid(1d78da1e-2177-4b8f-9b11-41e78d1e60f7)]
 interface nsIDOMXULCommandEvent : nsIDOMUIEvent
 {
   /**
    * Command events support the same set of modifier keys as mouse and key
    * events.
    */
   readonly attribute boolean ctrlKey;
   readonly attribute boolean shiftKey;
@@ -63,16 +63,16 @@ interface nsIDOMXULCommandEvent : nsIDOM
   readonly attribute nsIDOMEvent sourceEvent;
 
   /**
    * Creates a new command event with the given attributes.
    */
   void initCommandEvent(in DOMString typeArg,
                         in boolean canBubbleArg,
                         in boolean cancelableArg,
-                        in nsIDOMAbstractView viewArg,
+                        in nsIDOMWindow viewArg,
                         in long detailArg,
                         in boolean ctrlKeyArg,
                         in boolean altKeyArg,
                         in boolean shiftKeyArg,
                         in boolean metaKeyArg,
                         in nsIDOMEvent sourceEvent);
 };
--- a/editor/libeditor/html/nsHTMLAbsPosition.cpp
+++ b/editor/libeditor/html/nsHTMLAbsPosition.cpp
@@ -685,23 +685,24 @@ nsHTMLEditor::CheckPositionedElementBGan
   if (bgImageStr.EqualsLiteral("none")) {
     nsAutoString bgColorStr;
     res =
       mHTMLCSSUtils->GetComputedProperty(aElement,
                                          nsEditProperty::cssBackgroundColor,
                                          bgColorStr);
     NS_ENSURE_SUCCESS(res, res);
     if (bgColorStr.EqualsLiteral("transparent")) {
-
-      nsCOMPtr<nsIDOMViewCSS> viewCSS;
-      res = mHTMLCSSUtils->GetDefaultViewCSS(aElement, getter_AddRefs(viewCSS));
+      nsCOMPtr<nsIDOMWindow> window;
+      res = mHTMLCSSUtils->GetDefaultViewCSS(aElement, getter_AddRefs(window));
       NS_ENSURE_SUCCESS(res, res);
+
       nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl;
-      res = viewCSS->GetComputedStyle(aElement, EmptyString(), getter_AddRefs(cssDecl));
+      res = window->GetComputedStyle(aElement, EmptyString(), getter_AddRefs(cssDecl));
       NS_ENSURE_SUCCESS(res, res);
+
       // from these declarations, get the one we want and that one only
       nsCOMPtr<nsIDOMCSSValue> colorCssValue;
       res = cssDecl->GetPropertyCSSValue(NS_LITERAL_STRING("color"), getter_AddRefs(colorCssValue));
       NS_ENSURE_SUCCESS(res, res);
 
       PRUint16 type;
       res = colorCssValue->GetCssValueType(&type);
       NS_ENSURE_SUCCESS(res, res);
--- a/editor/libeditor/html/nsHTMLAnonymousUtils.cpp
+++ b/editor/libeditor/html/nsHTMLAnonymousUtils.cpp
@@ -425,23 +425,23 @@ nsHTMLEditor::GetPositionAndDimensions(n
                                        positionStr);
     isPositioned = positionStr.EqualsLiteral("absolute");
   }
 
   if (isPositioned) {
     // Yes, it is absolutely positioned
     mResizedObjectIsAbsolutelyPositioned = PR_TRUE;
 
-    nsCOMPtr<nsIDOMViewCSS> viewCSS;
-    res = mHTMLCSSUtils->GetDefaultViewCSS(aElement, getter_AddRefs(viewCSS));
-    NS_ENSURE_TRUE(viewCSS, NS_ERROR_FAILURE);
+    nsCOMPtr<nsIDOMWindow> window;
+    res = mHTMLCSSUtils->GetDefaultViewCSS(aElement, getter_AddRefs(window));
+    NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
 
     nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl;
     // Get the all the computed css styles attached to the element node
-    res = viewCSS->GetComputedStyle(aElement, EmptyString(), getter_AddRefs(cssDecl));
+    res = window->GetComputedStyle(aElement, EmptyString(), getter_AddRefs(cssDecl));
     NS_ENSURE_SUCCESS(res, res);
 
     aBorderLeft = GetCSSFloatValue(cssDecl, NS_LITERAL_STRING("border-left-width"));
     aBorderTop  = GetCSSFloatValue(cssDecl, NS_LITERAL_STRING("border-top-width"));
     aMarginLeft = GetCSSFloatValue(cssDecl, NS_LITERAL_STRING("margin-left"));
     aMarginTop  = GetCSSFloatValue(cssDecl, NS_LITERAL_STRING("margin-top"));
 
     aX = GetCSSFloatValue(cssDecl, NS_LITERAL_STRING("left")) +
--- a/editor/libeditor/html/nsHTMLCSSUtils.cpp
+++ b/editor/libeditor/html/nsHTMLCSSUtils.cpp
@@ -42,17 +42,16 @@
 #include "nsIPrefBranch.h"
 #include "nsIPrefService.h"
 #include "nsIServiceManager.h"
 #include "nsEditProperty.h"
 #include "ChangeCSSInlineStyleTxn.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMElementCSSInlineStyle.h"
 #include "nsIDOMDocument.h"
-#include "nsIDOMDocumentView.h"
 #include "nsIContent.h"
 #include "nsIAtom.h"
 #include "nsTextEditUtils.h"
 #include "nsReadableUtils.h"
 #include "nsUnicharUtils.h"
 #include "nsHTMLCSSUtils.h"
 #include "nsColor.h"
 #include "nsAttrName.h"
@@ -533,45 +532,46 @@ nsHTMLCSSUtils::GetSpecifiedProperty(nsI
 {
   return GetCSSInlinePropertyBase(aNode, aProperty, aValue, nsnull, SPECIFIED_STYLE_TYPE);
 }
 
 nsresult
 nsHTMLCSSUtils::GetComputedProperty(nsIDOMNode *aNode, nsIAtom *aProperty,
                                     nsAString & aValue)
 {
-  nsCOMPtr<nsIDOMViewCSS> viewCSS = nsnull;
-  nsresult res = GetDefaultViewCSS(aNode, getter_AddRefs(viewCSS));
+  nsCOMPtr<nsIDOMWindow> window;
+  nsresult res = GetDefaultViewCSS(aNode, getter_AddRefs(window));
   NS_ENSURE_SUCCESS(res, res);
 
-  return GetCSSInlinePropertyBase(aNode, aProperty, aValue, viewCSS, COMPUTED_STYLE_TYPE);
+  return GetCSSInlinePropertyBase(aNode, aProperty, aValue, window, COMPUTED_STYLE_TYPE);
 }
 
 nsresult
 nsHTMLCSSUtils::GetCSSInlinePropertyBase(nsIDOMNode *aNode, nsIAtom *aProperty,
-                                        nsAString &aValue,
-                                        nsIDOMViewCSS *aViewCSS,
-                                        PRUint8 aStyleType)
+                                         nsAString& aValue,
+                                         nsIDOMWindow* aWindow,
+                                         PRUint8 aStyleType)
 {
   aValue.Truncate();
   NS_ENSURE_TRUE(aProperty, NS_ERROR_NULL_POINTER);
 
-  nsCOMPtr<nsIDOMElement>element;
+  nsCOMPtr<nsIDOMElement> element;
   nsresult res = GetElementContainerOrSelf(aNode, getter_AddRefs(element));
   NS_ENSURE_SUCCESS(res, res);
 
   switch (aStyleType) {
     case COMPUTED_STYLE_TYPE:
-      if (element && aViewCSS) {
+      if (element && aWindow) {
         nsAutoString value, propString;
         nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl;
         aProperty->ToString(propString);
         // Get the all the computed css styles attached to the element node
-        res = aViewCSS->GetComputedStyle(element, EmptyString(), getter_AddRefs(cssDecl));
-        if (NS_FAILED(res) || !cssDecl) return res;
+        res = aWindow->GetComputedStyle(element, EmptyString(), getter_AddRefs(cssDecl));
+        if (NS_FAILED(res) || !cssDecl)
+          return res;
         // from these declarations, get the one we want and that one only
         res = cssDecl->GetPropertyValue(propString, value);
         NS_ENSURE_SUCCESS(res, res);
         aValue.Assign(value);
       }
       break;
     case SPECIFIED_STYLE_TYPE:
       if (element) {
@@ -586,43 +586,39 @@ nsHTMLCSSUtils::GetCSSInlinePropertyBase
         aValue.Assign(value);
       }
       break;
   }
   return NS_OK;
 }
 
 nsresult
-nsHTMLCSSUtils::GetDefaultViewCSS(nsIDOMNode *aNode, nsIDOMViewCSS **aViewCSS)
+nsHTMLCSSUtils::GetDefaultViewCSS(nsIDOMNode *aNode, nsIDOMWindow **aViewCSS)
 {
-  nsCOMPtr<nsIDOMElement>element;
+  nsCOMPtr<nsIDOMElement> element;
   nsresult res = GetElementContainerOrSelf(aNode, getter_AddRefs(element));
   NS_ENSURE_SUCCESS(res, res);
 
-  // if we have an element node
-  if (element) {
-    // find the owner document
-    nsCOMPtr<nsIDOMDocument> doc;
-    nsCOMPtr<nsIDOMNode> node = do_QueryInterface(element);
-    res = node->GetOwnerDocument(getter_AddRefs(doc));
-    NS_ENSURE_SUCCESS(res, res);
-    if (doc) {
-      nsCOMPtr<nsIDOMDocumentView> documentView = do_QueryInterface(doc);
-      nsCOMPtr<nsIDOMAbstractView> abstractView;
-      // from the document, get the abtractView
-      res = documentView->GetDefaultView(getter_AddRefs(abstractView));
-      NS_ENSURE_SUCCESS(res, res);
-      if (abstractView) {
-        // from the abstractView, get the CSS view
-        CallQueryInterface(abstractView, aViewCSS);
-        return NS_OK;
-      }
-    }
+  // TODO: move this initialization to the top of the function
+  *aViewCSS = nsnull;
+  if (!element) {
+    return NS_OK;
   }
-  *aViewCSS = nsnull;
+  // find the owner document
+  nsCOMPtr<nsIDOMDocument> doc;
+  nsCOMPtr<nsIDOMNode> node = do_QueryInterface(element);
+  res = node->GetOwnerDocument(getter_AddRefs(doc));
+  NS_ENSURE_SUCCESS(res, res);
+  if (!doc) {
+    return NS_OK;
+  }
+  nsCOMPtr<nsIDOMWindow> window;
+  res = doc->GetDefaultView(getter_AddRefs(window));
+  NS_ENSURE_SUCCESS(res, res);
+  window.forget(aViewCSS);
   return NS_OK;
 }
 
 nsresult
 NS_NewHTMLCSSUtils(nsHTMLCSSUtils** aInstancePtrResult)
 {
   nsHTMLCSSUtils * rules = new nsHTMLCSSUtils();
   if (rules) {
@@ -1082,34 +1078,34 @@ nsHTMLCSSUtils::GetCSSEquivalentToHTMLIn
   aValueString.Truncate();
   nsCOMPtr<nsIDOMElement> theElement;
   nsresult res = GetElementContainerOrSelf(aNode, getter_AddRefs(theElement));
   NS_ENSURE_SUCCESS(res, res);
 
   if (theElement && IsCSSEditableProperty(theElement, aHTMLProperty, aAttribute)) {
     // Yes, the requested HTML style has a CSS equivalence in this implementation
     // Retrieve the default ViewCSS if we are asked for computed styles
-    nsCOMPtr<nsIDOMViewCSS> viewCSS = nsnull;
+    nsCOMPtr<nsIDOMWindow> window;
     if (COMPUTED_STYLE_TYPE == aStyleType) {
-      res = GetDefaultViewCSS(theElement, getter_AddRefs(viewCSS));
+      res = GetDefaultViewCSS(theElement, getter_AddRefs(window));
       NS_ENSURE_SUCCESS(res, res);
     }
     nsTArray<nsIAtom*> cssPropertyArray;
     nsTArray<nsString> cssValueArray;
     // get the CSS equivalence with last param PR_TRUE indicating we want only the
     // "gettable" properties
     GenerateCSSDeclarationsFromHTMLStyle(theElement, aHTMLProperty, aAttribute, nsnull,
                                          cssPropertyArray, cssValueArray, PR_TRUE);
     PRInt32 count = cssPropertyArray.Length();
     PRInt32 index;
     for (index = 0; index < count; index++) {
       nsAutoString valueString;
       // retrieve the specified/computed value of the property
       res = GetCSSInlinePropertyBase(theElement, cssPropertyArray[index],
-                                     valueString, viewCSS, aStyleType);
+                                     valueString, window, aStyleType);
       NS_ENSURE_SUCCESS(res, res);
       // append the value to aValueString (possibly with a leading whitespace)
       if (index) aValueString.Append(PRUnichar(' '));
       aValueString.Append(valueString);
     }
   }
   return NS_OK;
 }
--- a/editor/libeditor/html/nsHTMLCSSUtils.h
+++ b/editor/libeditor/html/nsHTMLCSSUtils.h
@@ -37,28 +37,28 @@
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsHTMLCSSUtils_h__
 #define nsHTMLCSSUtils_h__
 
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "nsTArray.h"
-#include "nsIDOMViewCSS.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMElement.h"
 #include "nsIHTMLEditor.h"
 #include "ChangeCSSInlineStyleTxn.h"
 #include "nsEditProperty.h"
 #include "nsIDOMCSSStyleDeclaration.h"
 
 #define SPECIFIED_STYLE_TYPE    1
 #define COMPUTED_STYLE_TYPE     2
 
 class nsHTMLEditor;
+class nsIDOMWindow;
 
 typedef void (*nsProcessValueFunc)(const nsAString * aInputString, nsAString & aOutputString,
                                    const char * aDefaultValueString,
                                    const char * aPrependString, const char* aAppendString);
 
 class nsHTMLCSSUtils
 {
 public:
@@ -307,22 +307,23 @@ public:
   /** returns aNode itself if it is an element node, or the first ancestors being an element
     * node if aNode is not one itself
     *
     * @param aNode           [IN] a node
     * @param aElement        [OUT] the deepest element node containing aNode (possibly aNode itself)
     */
   nsresult GetElementContainerOrSelf(nsIDOMNode * aNode, nsIDOMElement ** aElement);
 
-  /** Gets the default DOMView for a given node
+  /**
+   * Gets the default Window for a given node.
    *
-   * @param aNode               the node we want the default DOMView for
-   * @param aViewCSS            [OUT] the default DOMViewCSS
+   * @param aNode    the node we want the default Window for
+   * @param aWindow  [OUT] the default Window
    */
-  nsresult        GetDefaultViewCSS(nsIDOMNode * aNode, nsIDOMViewCSS ** aViewCSS);
+  nsresult        GetDefaultViewCSS(nsIDOMNode* aNode, nsIDOMWindow** aWindow);
 
 
 private:
 
   /** retrieves the css property atom from an enum
     *
     * @param aProperty          [IN] the enum value for the property
     * @param aAtom              [OUT] the corresponding atom
@@ -378,27 +379,27 @@ private:
     */
   nsresult    CreateCSSPropertyTxn(nsIDOMElement * aElement, 
                                    nsIAtom * aProperty,
                                    const nsAString & aValue,
                                    ChangeCSSInlineStyleTxn ** aTxn,
                                    PRBool aRemoveProperty);
 
   /** back-end for GetSpecifiedProperty and GetComputedProperty
-    *
-    * @param aNode               [IN] a DOM node
-    * @param aProperty           [IN] a CSS property
-    * @param aValue              [OUT] the retrieved value for this property
-    * @param aViewCSS            [IN] the ViewCSS we need in case we query computed styles
-    * @param aStyleType          [IN] SPECIFIED_STYLE_TYPE to query the specified style values
-                                      COMPUTED_STYLE_TYPE  to query the computed style values
-    */
+   *
+   * @param aNode               [IN] a DOM node
+   * @param aProperty           [IN] a CSS property
+   * @param aValue              [OUT] the retrieved value for this property
+   * @param aWindow             [IN] the window we need in case we query computed styles
+   * @param aStyleType          [IN] SPECIFIED_STYLE_TYPE to query the specified style values
+   *                                 COMPUTED_STYLE_TYPE  to query the computed style values
+   */
   nsresult    GetCSSInlinePropertyBase(nsIDOMNode * aNode, nsIAtom * aProperty,
                                        nsAString & aValue,
-                                       nsIDOMViewCSS * aViewCSS,
+                                       nsIDOMWindow* aWindow,
                                        PRUint8 aStyleType);
 
 
 private:
   nsHTMLEditor            *mHTMLEditor;
   PRBool                  mIsCSSPrefChecked; 
 
 };
--- a/embedding/browser/webBrowser/nsContextMenuInfo.cpp
+++ b/embedding/browser/webBrowser/nsContextMenuInfo.cpp
@@ -1,11 +1,10 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * ***** BEGIN LICENSE BLOCK *****
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * 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,
@@ -19,16 +18,17 @@
  * Netscape Communications, Inc.
  * Portions created by the Initial Developer are Copyright (C) 1999
  * the Initial Developer. All Rights Reserved.
  *
  * Contributor(s):
  *   Chris Saari <saari@netscape.com>
  *   Conrad Carlen <ccarlen@netscape.com>
  *   Pierre Chanial <p_ch@verizon.net>
+ *   Ms2ger <ms2ger@gmail.com>
  *
  * Alternatively, the contents of this file may be used under the terms of
  * either the GNU General Public License Version 2 or later (the "GPL"), or
  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  * in which case the provisions of the GPL or the LGPL are applicable instead
  * of those above. If you wish to allow use of your version of this file only
  * under the terms of either the GPL or the LGPL, and not to allow others to
  * use your version of this file under the terms of the MPL, indicate your
@@ -46,19 +46,17 @@
 #include "nsIDOMDocument.h"
 #include "nsIDOMHTMLDocument.h"
 #include "nsIDOMHTMLElement.h"
 #include "nsIDOMHTMLHtmlElement.h"
 #include "nsIDOMHTMLAnchorElement.h"
 #include "nsIDOMHTMLImageElement.h"
 #include "nsIDOMHTMLAreaElement.h"
 #include "nsIDOMHTMLLinkElement.h"
-#include "nsIDOMDocumentView.h"
-#include "nsIDOMAbstractView.h"
-#include "nsIDOMViewCSS.h"
+#include "nsIDOMWindow.h"
 #include "nsIDOMCSSStyleDeclaration.h"
 #include "nsIDOMCSSValue.h"
 #include "nsIDOMCSSPrimitiveValue.h"
 #include "nsNetUtil.h"
 #include "nsUnicharUtils.h"
 #include "nsIDocument.h"
 #include "nsIPrincipal.h"
 #include "nsIChannelPolicy.h"
@@ -288,23 +286,21 @@ nsContextMenuInfo::GetBackgroundImageReq
 {
   NS_ENSURE_ARG_POINTER(aDOMNode);
 
   nsCOMPtr<nsIDOMNode> domNode = aDOMNode;
   nsCOMPtr<nsIDOMNode> parentNode;
 
   nsCOMPtr<nsIDOMDocument> document;
   domNode->GetOwnerDocument(getter_AddRefs(document));
-  nsCOMPtr<nsIDOMDocumentView> docView(do_QueryInterface(document));
-  NS_ENSURE_TRUE(docView, NS_ERROR_FAILURE);
+  NS_ENSURE_TRUE(document, NS_ERROR_FAILURE);
 
-  nsCOMPtr<nsIDOMAbstractView> defaultView;
-  docView->GetDefaultView(getter_AddRefs(defaultView));
-  nsCOMPtr<nsIDOMViewCSS> defaultCSSView(do_QueryInterface(defaultView));
-  NS_ENSURE_TRUE(defaultCSSView, NS_ERROR_FAILURE);
+  nsCOMPtr<nsIDOMWindow> window;
+  document->GetDefaultView(getter_AddRefs(window));
+  NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
 
   nsCOMPtr<nsIDOMCSSPrimitiveValue> primitiveValue;
   nsAutoString bgStringValue;
 
   // get Content Security Policy to pass to LoadImage
   nsCOMPtr<nsIDocument> doc(do_QueryInterface(document));
   nsCOMPtr<nsIPrincipal> principal;
   nsCOMPtr<nsIChannelPolicy> channelPolicy;
@@ -322,18 +318,18 @@ nsContextMenuInfo::GetBackgroundImageReq
   
   while (PR_TRUE) {
     nsCOMPtr<nsIDOMElement> domElement(do_QueryInterface(domNode));
     // bail for the parent node of the root element or null argument
     if (!domElement)
       break;
     
     nsCOMPtr<nsIDOMCSSStyleDeclaration> computedStyle;
-    defaultCSSView->GetComputedStyle(domElement, EmptyString(),
-                                     getter_AddRefs(computedStyle));
+    window->GetComputedStyle(domElement, EmptyString(),
+                             getter_AddRefs(computedStyle));
     if (computedStyle) {
       nsCOMPtr<nsIDOMCSSValue> cssValue;
       computedStyle->GetPropertyCSSValue(NS_LITERAL_STRING("background-image"),
                                          getter_AddRefs(cssValue));
       primitiveValue = do_QueryInterface(cssValue);
       if (primitiveValue) {
         primitiveValue->GetStringValue(bgStringValue);
         if (!bgStringValue.EqualsLiteral("none")) {
--- a/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp
+++ b/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp
@@ -16,16 +16,17 @@
  *
  * The Initial Developer of the Original Code is Google Inc.
  * Portions created by the Initial Developer are Copyright (C) 2004-2006
  * the Initial Developer. All Rights Reserved.
  *
  * Contributor(s):
  *   Brett Wilson <brettw@gmail.com> (original author)
  *   Robert O'Callahan <rocallahan@novell.com>
+ *   Ms2ger <ms2ger@gmail.com>
  *
  * Alternatively, the contents of this file may be used under the terms of
  * either the GNU General Public License Version 2 or later (the "GPL"), or
  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  * in which case the provisions of the GPL or the LGPL are applicable instead
  * of those above. If you wish to allow use of your version of this file only
  * under the terms of either the GPL or the LGPL, and not to allow others to
  * use your version of this file under the terms of the MPL, indicate your
@@ -36,17 +37,16 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "mozInlineSpellWordUtil.h"
 #include "nsDebug.h"
 #include "nsIAtom.h"
 #include "nsComponentManagerUtils.h"
 #include "nsIDOMCSSStyleDeclaration.h"
-#include "nsIDOMDocumentView.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMNSRange.h"
 #include "nsIDOMRange.h"
 #include "nsIEditor.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMHTMLBRElement.h"
 #include "nsUnicharUtilCIID.h"
 #include "nsServiceManagerUtils.h"
@@ -97,24 +97,23 @@ mozInlineSpellWordUtil::Init(nsWeakPtr a
   NS_ENSURE_SUCCESS(rv, rv);
 
   mDocument = do_QueryInterface(domDoc, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mDOMDocumentRange = do_QueryInterface(domDoc, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  // view
-  nsCOMPtr<nsIDOMDocumentView> docView = do_QueryInterface(domDoc, &rv);
+  // Window
+  nsCOMPtr<nsIDOMWindow> window;
+  rv = domDoc->GetDefaultView(getter_AddRefs(window));
   NS_ENSURE_SUCCESS(rv, rv);
-  nsCOMPtr<nsIDOMAbstractView> abstractView;
-  rv = docView->GetDefaultView(getter_AddRefs(abstractView));
-  NS_ENSURE_SUCCESS(rv, rv);
-  mCSSView = do_QueryInterface(abstractView, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
+
+  mCSSView = window;
+  NS_ENSURE_TRUE(window, NS_ERROR_NULL_POINTER);
 
   // Find the root node for the editor. For contenteditable we'll need something
   // cleverer here.
   nsCOMPtr<nsIDOMElement> rootElt;
   rv = editor->GetRootElement(getter_AddRefs(rootElt));
   NS_ENSURE_SUCCESS(rv, rv);
   
   mRootNode = rootElt;
@@ -493,17 +492,17 @@ ContainsDOMWordSeparator(nsIDOMNode* aNo
       *aSeparatorOffset = i;
       return PR_TRUE;
     }
   }
   return PR_FALSE;
 }
 
 static PRBool
-IsBreakElement(nsIDOMViewCSS* aDocView, nsIDOMNode* aNode)
+IsBreakElement(nsIDOMWindow* aDocView, nsIDOMNode* aNode)
 {
   nsCOMPtr<nsIDOMElement> element = do_QueryInterface(aNode);
   if (!element)
     return PR_FALSE;
     
   if (IsBRElement(aNode))
     return PR_TRUE;
   
@@ -532,18 +531,18 @@ IsBreakElement(nsIDOMViewCSS* aDocView, 
   if (!position.EqualsLiteral("static"))
     return PR_TRUE;
     
   // XXX What about floats? What else?
   return PR_FALSE;
 }
 
 struct CheckLeavingBreakElementClosure {
-  nsIDOMViewCSS* mDocView;
-  PRPackedBool   mLeftBreakElement;
+  nsIDOMWindow* mDocView;
+  PRPackedBool  mLeftBreakElement;
 };
 
 static void
 CheckLeavingBreakElement(nsIDOMNode* aNode, void* aClosure)
 {
   CheckLeavingBreakElementClosure* cl =
     static_cast<CheckLeavingBreakElementClosure*>(aClosure);
   if (!cl->mLeftBreakElement && IsBreakElement(cl->mDocView, aNode)) {
--- a/extensions/spellcheck/src/mozInlineSpellWordUtil.h
+++ b/extensions/spellcheck/src/mozInlineSpellWordUtil.h
@@ -33,17 +33,16 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsCOMPtr.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMDocumentRange.h"
-#include "nsIDOMViewCSS.h"
 #include "nsIDocument.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "nsIUGenCategory.h"
 
 //#define DEBUG_SPELLCHECK
 
 class nsIDOMRange;
@@ -121,17 +120,17 @@ public:
   nsIDOMNode* GetRootNode() { return mRootNode; }
   nsIUGenCategory* GetCategories() { return mCategories; }
   
 private:
 
   // cached stuff for the editor, set by Init
   nsCOMPtr<nsIDOMDocumentRange> mDOMDocumentRange;
   nsCOMPtr<nsIDocument>         mDocument;
-  nsCOMPtr<nsIDOMViewCSS>       mCSSView;
+  nsCOMPtr<nsIDOMWindow>        mCSSView;
   nsCOMPtr<nsIUGenCategory>     mCategories;
 
   // range to check, see SetRange
   nsIDOMNode* mRootNode;
   NodeOffset  mSoftBegin;
   NodeOffset  mSoftEnd;
 
   // DOM text covering the soft range, with newlines added at block boundaries
--- a/extensions/widgetutils/src/nsWidgetUtils.cpp
+++ b/extensions/widgetutils/src/nsWidgetUtils.cpp
@@ -17,16 +17,17 @@
  *
  * The Initial Developer of the Original Code is the Mozilla Foundation.
  * Portions created by the Initial Developer are Copyright (C) 2006
  * the Initial Developer. All Rights Reserved.
  *
  * Contributor(s):
  *   Oleg Romashin <romaxa@gmail.com> (original author)
  *   Brad Lassey <blassey@mozilla.com>
+ *   Ms2ger <ms2ger@gmail.com>
  *
  * Alternatively, the contents of this file may be used under the terms of
  * either the GNU General Public License Version 2 or later (the "GPL"), or
  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  * in which case the provisions of the GPL or the LGPL are applicable instead
  * of those above. If you wish to allow use of your version of this file only
  * under the terms of either the GPL or the LGPL, and not to allow others to
  * use your version of this file under the terms of the MPL, indicate your
@@ -34,19 +35,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsCURILoader.h"
 #include "nsICategoryManager.h"
-#include "nsIDOMAbstractView.h"
 #include "nsIDOMDocument.h"
-#include "nsIDOMDocumentView.h"
 #include "nsIDOMHTMLElement.h"
 #include "nsIDOMHTMLIFrameElement.h"
 #include "nsIDOMNSDocument.h"
 #include "nsIDOMNSElement.h"
 #include "nsIDOMNSHTMLElement.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMWindow.h"
@@ -63,17 +62,16 @@
 #include "nsRect.h"
 #include "nsStringGlue.h"
 #include "nsWeakReference.h"
 #include "nsIWebBrowser.h"
 #include "nsIObserverService.h"
 #include "nsIDOMEventTarget.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDOMWindow.h"
-//#include ".h"
 #include "nsIDOM3EventTarget.h"
 #include "nsIDOMKeyListener.h"
 #include "nsIDOMCompositionListener.h"
 #include "nsIDOMTextListener.h"
 #include "nsIDOMMouseMotionListener.h"
 #include "nsIDOMMouseListener.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsIDOMNSEvent.h"
@@ -423,38 +421,34 @@ nsWidgetUtils::IsXULNode(nsIDOMNode *aNo
     *aType = 2; // Magic
   else if (sorigNode.EqualsLiteral("xul:scrollbarbutton"))
     *aType = 3; // Magic
 
   return retval;
 }
 
 nsresult
-nsWidgetUtils::GetDOMWindowByNode(nsIDOMNode *aNode, nsIDOMWindow * *aDOMWindow)
+nsWidgetUtils::GetDOMWindowByNode(nsIDOMNode* aNode, nsIDOMWindow** aDOMWindow)
 {
-  nsresult rv;
   nsCOMPtr<nsIDOMDocument> nodeDoc;
-  rv = aNode->GetOwnerDocument(getter_AddRefs(nodeDoc));
-  NS_ENSURE_SUCCESS(rv, rv);
-  nsCOMPtr<nsIDOMDocumentView> docView = do_QueryInterface(nodeDoc, &rv);
+  nsresult rv = aNode->GetOwnerDocument(getter_AddRefs(nodeDoc));
   NS_ENSURE_SUCCESS(rv, rv);
-  nsCOMPtr<nsIDOMAbstractView> absView;
-  NS_ENSURE_SUCCESS(rv, rv);
-  rv = docView->GetDefaultView(getter_AddRefs(absView));
+  NS_ENSURE_TRUE(nodeDoc, NS_ERROR_NULL_POINTER);
+
+  nsCOMPtr<nsIDOMWindow> window;
+  rv = nodeDoc->GetDefaultView(getter_AddRefs(window));
   NS_ENSURE_SUCCESS(rv, rv);
-  nsCOMPtr<nsIDOMWindow> window = do_QueryInterface(absView, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-  *aDOMWindow = window;
-  NS_IF_ADDREF(*aDOMWindow);
+  NS_ENSURE_TRUE(window, NS_ERROR_NULL_POINTER);
+  window.forget(aDOMWindow);
   return rv;
 }
 
 void
 nsWidgetUtils::GetChromeEventHandler(nsIDOMWindow *aDOMWin,
-                                 nsIDOMEventTarget **aChromeTarget)
+                                     nsIDOMEventTarget **aChromeTarget)
 {
     nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(aDOMWin));
     nsPIDOMEventTarget* chromeEventHandler = nsnull;
     if (privateDOMWindow) {
         chromeEventHandler = privateDOMWindow->GetChromeEventHandler();
     }
 
     nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(chromeEventHandler));
--- a/js/src/xpconnect/src/dom_quickstubs.qsconf
+++ b/js/src/xpconnect/src/dom_quickstubs.qsconf
@@ -66,16 +66,17 @@ members = [
     'nsIDOMWindow.parent',
     'nsIDOMWindow.top',
     # Several window properties are magically resolved, including
     # location, _content, navigator, document, and window itself.
     # These do not need quick stubs.
     #'nsIDOMWindow.document',
     'nsIDOMWindow.getSelection',
     'nsIDOMWindow.scrollByLines',
+    'nsIDOMWindow.getComputedStyle',
     'nsIDOMJSWindow.dump',
     'nsIDOMScreen.top',
     'nsIDOMScreen.height',
     'nsIDOMScreen.width',
     'nsIDOMScreen.left',
     'nsIDOMClientRect.*',
     'nsIDOMClientRectList.*',
     'nsIDOMPaintRequest.*',
@@ -103,16 +104,17 @@ members = [
     'nsIDOMDocument.getElementById',
     'nsIDOMDocument.createDocumentFragment',
     'nsIDOMDocument.createElement',
     'nsIDOMDocument.createElementNS',
     'nsIDOMDocument.importNode',
     'nsIDOMDocument.createTextNode',
     'nsIDOMDocument.documentURI',
     'nsIDOMDocument.adoptNode',
+    'nsIDOMDocument.defaultView',
     'nsIDOMElement.removeAttributeNS',
     'nsIDOMElement.removeAttribute',
     'nsIDOMElement.getAttribute',
     'nsIDOMElement.getElementsByTagName',
     'nsIDOMElement.setAttribute',
     'nsIDOMElement.getElementsByTagNameNS',
     'nsIDOMElement.hasAttributeNS',
     'nsIDOMElement.tagName',
@@ -168,17 +170,16 @@ members = [
     'nsIDOMNSDocument.activeElement',
     'nsIDOMXULDocument.getBoxObjectFor',
     'nsIDOMNSElement.*',
 
     # dom/interfaces/css
     'nsIDOMElementCSSInlineStyle.*',
     'nsIDOMCSS2Properties.*',
     'nsIDOMRect.*',
-    'nsIDOMViewCSS.getComputedStyle',
     'nsIDOMCSSStyleDeclaration.*',
 
     # dom/interfaces/events
     'nsIDOMEventTarget.dispatchEvent',
     'nsIDOMEventTarget.removeEventListener',
     'nsIDOMNSEventTarget.addEventListener',
     'nsIDOMDocumentEvent.*',
 
@@ -385,19 +386,16 @@ members = [
     'nsIDOMSVGStylable.*',
 
     # dom/interfaces/threads - None.
 
     # dom/interfaces/traversal
     'nsIDOMDocumentTraversal.createNodeIterator',
     'nsIDOMNodeIterator.nextNode',
 
-    # dom/interfaces/views
-    'nsIDOMDocumentView.defaultView',
-
     # dom/interfaces/xbl - None.
 
     # dom/interfaces/xpath
     'nsIDOMXPathEvaluator.evaluate',
     'nsIDOMXPathEvaluator.createExpression',
     'nsIDOMXPathEvaluator.createNSResolver',
     'nsIDOMXPathExpression.evaluate',
     'nsIDOMXPathNSResolver.lookupNamespaceURI',
--- a/layout/inspector/src/inLayoutUtils.cpp
+++ b/layout/inspector/src/inLayoutUtils.cpp
@@ -32,18 +32,16 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "inLayoutUtils.h"
 
-#include "nsIDOMDocumentView.h"
-#include "nsIDOMAbstractView.h"
 #include "nsIDocument.h"
 #include "nsIContent.h"
 #include "nsIContentViewer.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDocShell.h"
 #include "nsIPresShell.h"
 #include "nsPresContext.h"
 
@@ -55,25 +53,24 @@ inLayoutUtils::GetWindowFor(nsIDOMNode* 
   nsCOMPtr<nsIDOMDocument> doc1;
   aNode->GetOwnerDocument(getter_AddRefs(doc1));
   return GetWindowFor(doc1.get());
 }
 
 nsIDOMWindowInternal*
 inLayoutUtils::GetWindowFor(nsIDOMDocument* aDoc)
 {
-  nsCOMPtr<nsIDOMDocumentView> doc = do_QueryInterface(aDoc);
-  if (!doc) return nsnull;
+  nsCOMPtr<nsIDOMWindow> window;
+  aDoc->GetDefaultView(getter_AddRefs(window));
+  if (!window) {
+    return nsnull;
+  }
   
-  nsCOMPtr<nsIDOMAbstractView> view;
-  doc->GetDefaultView(getter_AddRefs(view));
-  if (!view) return nsnull;
-  
-  nsCOMPtr<nsIDOMWindowInternal> window = do_QueryInterface(view);
-  return window;
+  nsCOMPtr<nsIDOMWindowInternal> windowInternal = do_QueryInterface(window);
+  return windowInternal;
 }
 
 nsIPresShell* 
 inLayoutUtils::GetPresShellFor(nsISupports* aThing)
 {
   nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aThing);
 
   nsCOMPtr<nsIPresShell> presShell;
--- a/toolkit/toolkit-makefiles.sh
+++ b/toolkit/toolkit-makefiles.sh
@@ -65,17 +65,16 @@ MAKEFILES_dom="
   dom/interfaces/load-save/Makefile
   dom/interfaces/offline/Makefile
   dom/interfaces/range/Makefile
   dom/interfaces/sidebar/Makefile
   dom/interfaces/storage/Makefile
   dom/interfaces/stylesheets/Makefile
   dom/interfaces/threads/Makefile
   dom/interfaces/traversal/Makefile
-  dom/interfaces/views/Makefile
   dom/interfaces/xbl/Makefile
   dom/interfaces/xpath/Makefile
   dom/interfaces/xul/Makefile
   dom/base/Makefile
   dom/src/Makefile
   dom/src/events/Makefile
   dom/src/jsurl/Makefile
   dom/src/geolocation/Makefile
--- a/widget/src/cocoa/nsMenuItemIconX.mm
+++ b/widget/src/cocoa/nsMenuItemIconX.mm
@@ -44,18 +44,16 @@
 #include "nsMenuItemIconX.h"
 
 #include "nsObjCExceptions.h"
 #include "prmem.h"
 #include "nsIContent.h"
 #include "nsIDocument.h"
 #include "nsINameSpaceManager.h"
 #include "nsWidgetAtoms.h"
-#include "nsIDOMDocumentView.h"
-#include "nsIDOMViewCSS.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMCSSStyleDeclaration.h"
 #include "nsIDOMCSSValue.h"
 #include "nsIDOMCSSPrimitiveValue.h"
 #include "nsIDOMRect.h"
 #include "nsThreadUtils.h"
 #include "nsToolkit.h"
 #include "nsNetUtil.h"
@@ -196,34 +194,37 @@ nsMenuItemIconX::GetIconURI(nsIURI** aIc
   nsresult rv;
   nsCOMPtr<nsIDOMCSSValue> cssValue;
   nsCOMPtr<nsIDOMCSSStyleDeclaration> cssStyleDecl;
   nsCOMPtr<nsIDOMCSSPrimitiveValue> primitiveValue;
   PRUint16 primitiveType;
   if (!hasImageAttr) {
     // If the content node has no "image" attribute, get the
     // "list-style-image" property from CSS.
-    nsCOMPtr<nsIDOMDocumentView> domDocumentView =
-     do_QueryInterface(mContent->GetDocument());
-    if (!domDocumentView) return NS_ERROR_FAILURE;
+    nsCOMPtr<nsIDOMDocument> domDocument =
+      do_QueryInterface(mContent->GetDocument());
+    if (!domDocument)
+      return NS_ERROR_FAILURE;
 
-    nsCOMPtr<nsIDOMAbstractView> domAbstractView;
-    rv = domDocumentView->GetDefaultView(getter_AddRefs(domAbstractView));
-    if (NS_FAILED(rv)) return rv;
-
-    nsCOMPtr<nsIDOMViewCSS> domViewCSS = do_QueryInterface(domAbstractView);
-    if (!domViewCSS) return NS_ERROR_FAILURE;
+    nsCOMPtr<nsIDOMWindow> window;
+    rv = domDocument->GetDefaultView(getter_AddRefs(window));
+    if (NS_FAILED(rv))
+      return rv;
+    if (!window)
+      return NS_ERROR_FAILURE;
 
     nsCOMPtr<nsIDOMElement> domElement = do_QueryInterface(mContent);
-    if (!domElement) return NS_ERROR_FAILURE;
+    if (!domElement)
+      return NS_ERROR_FAILURE;
 
 
-    rv = domViewCSS->GetComputedStyle(domElement, EmptyString(),
-                                      getter_AddRefs(cssStyleDecl));
-    if (NS_FAILED(rv)) return rv;
+    rv = window->GetComputedStyle(domElement, EmptyString(),
+                                  getter_AddRefs(cssStyleDecl));
+    if (NS_FAILED(rv))
+      return rv;
 
     NS_NAMED_LITERAL_STRING(listStyleImage, "list-style-image");
     rv = cssStyleDecl->GetPropertyCSSValue(listStyleImage,
                                            getter_AddRefs(cssValue));
     if (NS_FAILED(rv)) return rv;
 
     primitiveValue = do_QueryInterface(cssValue);
     if (!primitiveValue) return NS_ERROR_FAILURE;
--- a/widget/src/cocoa/nsMenuUtilsX.mm
+++ b/widget/src/cocoa/nsMenuUtilsX.mm
@@ -46,38 +46,37 @@
 #include "nsCocoaWindow.h"
 #include "nsWidgetAtoms.h"
 #include "nsIDocument.h"
 #include "nsIDOMDocumentEvent.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIDOMXULCommandEvent.h"
 #include "nsIPrivateDOMEvent.h"
 #include "nsPIDOMWindow.h"
-#include "nsIDOMAbstractView.h"
 
 void nsMenuUtilsX::DispatchCommandTo(nsIContent* aTargetContent)
 {
   NS_PRECONDITION(aTargetContent, "null ptr");
 
   nsIDocument* doc = aTargetContent->GetOwnerDoc();
   nsCOMPtr<nsIDOMDocumentEvent> docEvent = do_QueryInterface(doc);
   nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(aTargetContent);
   if (docEvent && target) {
     nsCOMPtr<nsIDOMEvent> event;
     docEvent->CreateEvent(NS_LITERAL_STRING("xulcommandevent"),
                           getter_AddRefs(event));
     nsCOMPtr<nsIDOMXULCommandEvent> command = do_QueryInterface(event);
     nsCOMPtr<nsIPrivateDOMEvent> pEvent = do_QueryInterface(command);
-    nsCOMPtr<nsIDOMAbstractView> view = do_QueryInterface(doc->GetWindow());
 
     // FIXME: Should probably figure out how to init this with the actual
     // pressed keys, but this is a big old edge case anyway. -dwh
     if (pEvent &&
         NS_SUCCEEDED(command->InitCommandEvent(NS_LITERAL_STRING("command"),
-                                               PR_TRUE, PR_TRUE, view, 0,
+                                               PR_TRUE, PR_TRUE,
+                                               doc->GetWindow(), 0,
                                                PR_FALSE, PR_FALSE, PR_FALSE,
                                                PR_FALSE, nsnull))) {
       pEvent->SetTrusted(PR_TRUE);
       PRBool dummy;
       target->DispatchEvent(event, &dummy);
     }
   }
 }
--- a/xpfe/appshell/src/nsXULWindow.cpp
+++ b/xpfe/appshell/src/nsXULWindow.cpp
@@ -1,12 +1,11 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 ci et: */
-/*
- * ***** BEGIN LICENSE BLOCK *****
+/* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * 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,
@@ -79,18 +78,16 @@
 #include "nsIScreenManager.h"
 #include "nsIScreen.h"
 #include "nsIScrollable.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIWindowWatcher.h"
 #include "nsIURI.h"
-#include "nsIDOMDocumentView.h"
-#include "nsIDOMViewCSS.h"
 #include "nsIDOMCSSStyleDeclaration.h"
 #include "nsITimelineService.h"
 #include "nsAppShellCID.h"
 #include "nsReadableUtils.h"
 #include "nsStyleConsts.h"
 #include "nsPresContext.h"
 
 #include "nsWebShellWindow.h" // get rid of this one, too...