diff --git a/accessible/base/DocManager.cpp b/accessible/base/DocManager.cpp index 08db38e6569..6fa97d62972 100644 --- a/accessible/base/DocManager.cpp +++ b/accessible/base/DocManager.cpp @@ -190,11 +190,11 @@ DocManager::OnStateChange(nsIWebProgress* aWebProgress, aWebProgress->GetDOMWindow(getter_AddRefs(DOMWindow)); NS_ENSURE_STATE(DOMWindow); - nsCOMPtr DOMDocument; - DOMWindow->GetDocument(getter_AddRefs(DOMDocument)); - NS_ENSURE_STATE(DOMDocument); + nsCOMPtr piWindow = do_QueryInterface(DOMWindow); + MOZ_ASSERT(piWindow); - nsCOMPtr document(do_QueryInterface(DOMDocument)); + nsCOMPtr document = piWindow->GetDoc(); + NS_ENSURE_STATE(document); // Document was loaded. if (aStateFlags & STATE_STOP) { diff --git a/accessible/generic/ApplicationAccessible.cpp b/accessible/generic/ApplicationAccessible.cpp index 4a2f1a38755..69537e26b82 100644 --- a/accessible/generic/ApplicationAccessible.cpp +++ b/accessible/generic/ApplicationAccessible.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* vim:expandtab:shiftwidth=4:tabstop=4: +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:expandtab:shiftwidth=2:tabstop=2: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -193,12 +193,10 @@ ApplicationAccessible::CacheChildren() while (hasMore) { nsCOMPtr window; windowEnumerator->GetNext(getter_AddRefs(window)); - nsCOMPtr DOMWindow = do_QueryInterface(window); + nsCOMPtr DOMWindow = do_QueryInterface(window); if (DOMWindow) { - nsCOMPtr DOMDocument; - DOMWindow->GetDocument(getter_AddRefs(DOMDocument)); - if (DOMDocument) { - nsCOMPtr docNode(do_QueryInterface(DOMDocument)); + nsCOMPtr docNode = DOMWindow->GetDoc(); + if (docNode) { GetAccService()->GetDocAccessible(docNode); // ensure creation } } diff --git a/accessible/generic/ImageAccessible.cpp b/accessible/generic/ImageAccessible.cpp index 0f2f7ca08db..cd9a7f44378 100644 --- a/accessible/generic/ImageAccessible.cpp +++ b/accessible/generic/ImageAccessible.cpp @@ -133,13 +133,12 @@ ImageAccessible::DoAction(uint8_t aIndex) nsIDocument* document = mContent->OwnerDoc(); nsCOMPtr piWindow = document->GetWindow(); - nsCOMPtr win = do_QueryInterface(piWindow); - if (!win) + if (!piWindow) return false; - nsCOMPtr tmp; - return NS_SUCCEEDED(win->Open(spec, EmptyString(), EmptyString(), - getter_AddRefs(tmp))); + nsCOMPtr tmp; + return NS_SUCCEEDED(piWindow->Open(spec, EmptyString(), EmptyString(), + getter_AddRefs(tmp))); } //////////////////////////////////////////////////////////////////////////////// diff --git a/accessible/generic/RootAccessible.cpp b/accessible/generic/RootAccessible.cpp index 01d7153f32e..1989b119468 100644 --- a/accessible/generic/RootAccessible.cpp +++ b/accessible/generic/RootAccessible.cpp @@ -486,11 +486,9 @@ RootAccessible::RelationByType(RelationType aType) nsPIDOMWindow* rootWindow = mDocumentNode->GetWindow(); if (rootWindow) { nsCOMPtr contentWindow = nsGlobalWindow::Cast(rootWindow)->GetContent(); - if (contentWindow) { - nsCOMPtr contentDOMDocument; - contentWindow->GetDocument(getter_AddRefs(contentDOMDocument)); - nsCOMPtr contentDocumentNode = - do_QueryInterface(contentDOMDocument); + nsCOMPtr piWindow = do_QueryInterface(contentWindow); + if (piWindow) { + nsCOMPtr contentDocumentNode = piWindow->GetDoc(); if (contentDocumentNode) { DocAccessible* contentDocument = GetAccService()->GetDocAccessible(contentDocumentNode); diff --git a/accessible/windows/msaa/moz.build b/accessible/windows/msaa/moz.build index 42469ada2d3..d3dfce81011 100644 --- a/accessible/windows/msaa/moz.build +++ b/accessible/windows/msaa/moz.build @@ -56,6 +56,7 @@ LOCAL_INCLUDES += [ '/accessible/xpcom', '/accessible/xul', '/dom/base', + '/layout/style', ] include('/ipc/chromium/chromium-config.mozbuild') diff --git a/accessible/windows/msaa/nsWinUtils.cpp b/accessible/windows/msaa/nsWinUtils.cpp index 96a2ddb32f6..15a9701a5e7 100644 --- a/accessible/windows/msaa/nsWinUtils.cpp +++ b/accessible/windows/msaa/nsWinUtils.cpp @@ -15,13 +15,15 @@ #include "mozilla/Preferences.h" #include "nsArrayUtils.h" #include "nsIArray.h" +#include "nsICSSDeclaration.h" #include "nsIDocument.h" #include "nsIDocShellTreeItem.h" -#include "nsIDOMElement.h" +#include "mozilla/dom/Element.h" #include "nsXULAppAPI.h" using namespace mozilla; using namespace mozilla::a11y; +using mozilla::dom::Element; // Window property used by ipc related code in identifying accessible // tab windows. @@ -43,15 +45,18 @@ nsWinUtils::GetComputedStyleDeclaration(nsIContent* aContent) return nullptr; // Returns number of items in style declaration - nsCOMPtr window = + nsCOMPtr window = do_QueryInterface(elm->OwnerDoc()->GetWindow()); if (!window) return nullptr; - nsCOMPtr cssDecl; - nsCOMPtr domElement(do_QueryInterface(elm)); - window->GetComputedStyle(domElement, EmptyString(), getter_AddRefs(cssDecl)); - return cssDecl.forget(); + ErrorResult dummy; + nsCOMPtr cssDecl; + nsCOMPtr domElement(do_QueryInterface(elm)); + cssDecl = window->GetComputedStyle(*domElement, EmptyString(), dummy); + nsCOMPtr domDecl = do_QueryInterface(cssDecl); + dummy.SuppressException(); + return domDecl.forget(); } bool diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index c3fa5a8fa8e..2caa3e0e67c 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -1025,6 +1025,7 @@ pref("apz.fling_curve_function_x2", "0.80"); pref("apz.fling_curve_function_y2", "1.0"); pref("apz.fling_curve_threshold_inches_per_ms", "0.01"); pref("apz.fling_friction", "0.0019"); +pref("apz.fling_snap_friction", "0.015"); pref("apz.max_velocity_inches_per_ms", "0.07"); pref("apz.touch_start_tolerance", "0.1"); diff --git a/b2g/chrome/content/settings.js b/b2g/chrome/content/settings.js index 14beb13937c..f55aef186e6 100644 --- a/b2g/chrome/content/settings.js +++ b/b2g/chrome/content/settings.js @@ -121,7 +121,15 @@ SettingsListener.observe('language.current', 'en-US', function(value) { Services.prefs.setCharPref(prefName, value); if (shell.hasStarted() == false) { - shell.bootstrap(); + // On b2gdroid at first run we need to synchronize our wallpaper with + // Android one's before bootstrapping. + if (AppConstants.MOZ_B2GDROID) { + Cc["@mozilla.org/b2g/b2gdroid-setup;1"] + .getService().wrappedJSObject.setWallpaper() + .then(() => { shell.bootstrap(); }); + } else { + shell.bootstrap(); + } } }); diff --git a/b2g/config/aries/sources.xml b/b2g/config/aries/sources.xml index 85efb1e04c4..3ae32b10301 100644 --- a/b2g/config/aries/sources.xml +++ b/b2g/config/aries/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 2d6486fbcb6..f5171fed4e0 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 4bad2cac68e..bc8c59db790 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index b84235e07e8..027064b557d 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 2c5b5589377..40fc38834e2 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-l/sources.xml b/b2g/config/emulator-l/sources.xml index 4350c01884f..ac6902f8cfe 100644 --- a/b2g/config/emulator-l/sources.xml +++ b/b2g/config/emulator-l/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 4bad2cac68e..bc8c59db790 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index c576c40e9c0..becd238c5a5 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 554d1d53dcf..544c204746d 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,9 +1,9 @@ { "git": { - "git_revision": "b564b21e08ffc3e4962f08850843c7482932ee7b", + "git_revision": "b6ede3d0fdec5fc922e9ca3401e60db461bf705c", "remote": "https://git.mozilla.org/releases/gaia.git", "branch": "" }, - "revision": "bc907981bd62560e8d0079244bdc32b1dfe98e36", + "revision": "220b45ec153f267a2efc58275a30a665a4ec9e57", "repo_path": "integration/gaia-central" } diff --git a/b2g/config/nexus-4-kk/sources.xml b/b2g/config/nexus-4-kk/sources.xml index a00bc8a72b9..0f438450f20 100644 --- a/b2g/config/nexus-4-kk/sources.xml +++ b/b2g/config/nexus-4-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index e35768c89df..fbb6db6af61 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -18,7 +18,7 @@ - + diff --git a/b2g/config/nexus-5-l/sources.xml b/b2g/config/nexus-5-l/sources.xml index dc46bbdedcd..f663477d69b 100644 --- a/b2g/config/nexus-5-l/sources.xml +++ b/b2g/config/nexus-5-l/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/browser/base/content/abouthome/aboutHome.js b/browser/base/content/abouthome/aboutHome.js index 4abb38fdf3d..352d534b325 100644 --- a/browser/base/content/abouthome/aboutHome.js +++ b/browser/base/content/abouthome/aboutHome.js @@ -357,7 +357,7 @@ function showDefaultSnippets() } function fitToWidth() { - if (window.scrollMaxX) { + if (window.scrollMaxX != window.scrollMinX) { document.body.setAttribute("narrow", "true"); } else if (document.body.hasAttribute("narrow")) { document.body.removeAttribute("narrow"); diff --git a/browser/components/customizableui/CustomizableUI.jsm b/browser/components/customizableui/CustomizableUI.jsm index e74815230dd..dfc6ead7ebe 100644 --- a/browser/components/customizableui/CustomizableUI.jsm +++ b/browser/components/customizableui/CustomizableUI.jsm @@ -4086,7 +4086,7 @@ OverflowableToolbar.prototype = { let child = this._target.lastChild; - while (child && this._target.scrollLeftMax > 0) { + while (child && this._target.scrollLeftMin != this._target.scrollLeftMax) { let prevChild = child.previousSibling; if (child.getAttribute("overflows") != "false") { @@ -4166,7 +4166,7 @@ OverflowableToolbar.prototype = { if (!this._enabled) return; - if (this._target.scrollLeftMax > 0) { + if (this._target.scrollLeftMin != this._target.scrollLeftMax) { this.onOverflow(); } else { this._moveItemsBackToTheirOrigin(); diff --git a/browser/components/places/content/browserPlacesViews.js b/browser/components/places/content/browserPlacesViews.js index d444e4b3add..149e64a26f1 100644 --- a/browser/components/places/content/browserPlacesViews.js +++ b/browser/components/places/content/browserPlacesViews.js @@ -1181,7 +1181,7 @@ PlacesToolbar.prototype = { }, updateOverflowStatus: function() { - if (this._rootElt.scrollLeftMax > 0) { + if (this._rootElt.scrollLeftMin != this._rootElt.scrollLeftMax) { this._onOverflow(); } else { this._onUnderflow(); diff --git a/caps/BasePrincipal.cpp b/caps/BasePrincipal.cpp index 01bec09b447..006bb320f56 100644 --- a/caps/BasePrincipal.cpp +++ b/caps/BasePrincipal.cpp @@ -340,9 +340,30 @@ BasePrincipal::GetCspJSON(nsAString& outCSPinJSON) } NS_IMETHODIMP -BasePrincipal::GetIsNullPrincipal(bool* aIsNullPrincipal) +BasePrincipal::GetIsNullPrincipal(bool* aResult) { - *aIsNullPrincipal = false; + *aResult = Kind() == eNullPrincipal; + return NS_OK; +} + +NS_IMETHODIMP +BasePrincipal::GetIsCodebasePrincipal(bool* aResult) +{ + *aResult = Kind() == eCodebasePrincipal; + return NS_OK; +} + +NS_IMETHODIMP +BasePrincipal::GetIsExpandedPrincipal(bool* aResult) +{ + *aResult = Kind() == eExpandedPrincipal; + return NS_OK; +} + +NS_IMETHODIMP +BasePrincipal::GetIsSystemPrincipal(bool* aResult) +{ + *aResult = Kind() == eSystemPrincipal; return NS_OK; } diff --git a/caps/BasePrincipal.h b/caps/BasePrincipal.h index 0c1c036ce1d..97ef77b0d2f 100644 --- a/caps/BasePrincipal.h +++ b/caps/BasePrincipal.h @@ -147,7 +147,10 @@ public: NS_IMETHOD GetCsp(nsIContentSecurityPolicy** aCsp) override; NS_IMETHOD SetCsp(nsIContentSecurityPolicy* aCsp) override; NS_IMETHOD GetCspJSON(nsAString& outCSPinJSON) override; - NS_IMETHOD GetIsNullPrincipal(bool* aIsNullPrincipal) override; + NS_IMETHOD GetIsNullPrincipal(bool* aResult) override; + NS_IMETHOD GetIsCodebasePrincipal(bool* aResult) override; + NS_IMETHOD GetIsExpandedPrincipal(bool* aResult) override; + NS_IMETHOD GetIsSystemPrincipal(bool* aResult) override; NS_IMETHOD GetJarPrefix(nsACString& aJarPrefix) final; NS_IMETHOD GetOriginAttributes(JSContext* aCx, JS::MutableHandle aVal) final; NS_IMETHOD GetOriginSuffix(nsACString& aOriginSuffix) final; @@ -171,6 +174,15 @@ public: uint32_t UserContextId() const { return mOriginAttributes.mUserContextId; } bool IsInBrowserElement() const { return mOriginAttributes.mInBrowser; } + enum PrincipalKind { + eNullPrincipal, + eCodebasePrincipal, + eExpandedPrincipal, + eSystemPrincipal + }; + + virtual PrincipalKind Kind() = 0; + protected: virtual ~BasePrincipal(); diff --git a/caps/nsIPrincipal.idl b/caps/nsIPrincipal.idl index 352ecc0b9cb..7263d5eb853 100644 --- a/caps/nsIPrincipal.idl +++ b/caps/nsIPrincipal.idl @@ -20,7 +20,7 @@ interface nsIContentSecurityPolicy; [ptr] native JSPrincipals(JSPrincipals); [ptr] native PrincipalArray(nsTArray >); -[scriptable, builtinclass, uuid(a083acd0-1ebf-4585-85ab-08cfdd9c96bd)] +[scriptable, builtinclass, uuid(86e5fd29-dccb-4547-8918-f224005479a0)] interface nsIPrincipal : nsISerializable { /** @@ -280,11 +280,26 @@ interface nsIPrincipal : nsISerializable [infallible] readonly attribute boolean unknownAppId; /** - * Returns true iff this principal is a null principal (corresponding to an + * Returns true iff this is a null principal (corresponding to an * unknown, hence assumed minimally privileged, security context). */ [infallible] readonly attribute boolean isNullPrincipal; + /** + * Returns true iff this principal corresponds to a codebase origin. + */ + [infallible] readonly attribute boolean isCodebasePrincipal; + + /** + * Returns true iff this is an expanded principal. + */ + [infallible] readonly attribute boolean isExpandedPrincipal; + + /** + * Returns true iff this is the system principal. + */ + [infallible] readonly attribute boolean isSystemPrincipal; + /** * Returns true if this principal's origin is recognized as being on the * whitelist of sites that can use the CSS Unprefixing Service. diff --git a/caps/nsNullPrincipal.cpp b/caps/nsNullPrincipal.cpp index 6f31aae5f45..6c06f7b9402 100644 --- a/caps/nsNullPrincipal.cpp +++ b/caps/nsNullPrincipal.cpp @@ -124,13 +124,6 @@ nsNullPrincipal::MayLoadInternal(nsIURI* aURI) return false; } -NS_IMETHODIMP -nsNullPrincipal::GetIsNullPrincipal(bool* aIsNullPrincipal) -{ - *aIsNullPrincipal = true; - return NS_OK; -} - NS_IMETHODIMP nsNullPrincipal::GetBaseDomain(nsACString& aBaseDomain) { diff --git a/caps/nsNullPrincipal.h b/caps/nsNullPrincipal.h index f2852ba7d20..04c7b0590bd 100644 --- a/caps/nsNullPrincipal.h +++ b/caps/nsNullPrincipal.h @@ -44,7 +44,6 @@ public: NS_IMETHOD GetURI(nsIURI** aURI) override; NS_IMETHOD GetDomain(nsIURI** aDomain) override; NS_IMETHOD SetDomain(nsIURI* aDomain) override; - NS_IMETHOD GetIsNullPrincipal(bool* aIsNullPrincipal) override; NS_IMETHOD GetBaseDomain(nsACString& aBaseDomain) override; nsresult GetOriginInternal(nsACString& aOrigin) override; @@ -59,6 +58,8 @@ public: virtual void GetScriptLocation(nsACString &aStr) override; + PrincipalKind Kind() override { return eNullPrincipal; } + protected: virtual ~nsNullPrincipal() {} diff --git a/caps/nsPrincipal.h b/caps/nsPrincipal.h index 1c436062905..0c5075bfd1c 100644 --- a/caps/nsPrincipal.h +++ b/caps/nsPrincipal.h @@ -49,6 +49,8 @@ public: */ static void InitializeStatics(); + PrincipalKind Kind() override { return eCodebasePrincipal; } + nsCOMPtr mDomain; nsCOMPtr mCodebase; // If mCodebaseImmutable is true, mCodebase is non-null and immutable @@ -83,6 +85,8 @@ public: virtual void GetScriptLocation(nsACString &aStr) override; nsresult GetOriginInternal(nsACString& aOrigin) override; + PrincipalKind Kind() override { return eExpandedPrincipal; } + protected: virtual ~nsExpandedPrincipal(); diff --git a/caps/nsSystemPrincipal.h b/caps/nsSystemPrincipal.h index 06c456226c1..5542d09898b 100644 --- a/caps/nsSystemPrincipal.h +++ b/caps/nsSystemPrincipal.h @@ -50,6 +50,8 @@ protected: { return true; } + + PrincipalKind Kind() override { return eSystemPrincipal; } }; #endif // nsSystemPrincipal_h__ diff --git a/caps/tests/unit/test_origin.js b/caps/tests/unit/test_origin.js index 30b9e367d25..8bd4d505849 100644 --- a/caps/tests/unit/test_origin.js +++ b/caps/tests/unit/test_origin.js @@ -162,4 +162,16 @@ function run_test() { checkCrossOrigin(exampleOrg_signedPkg, exampleOrg); checkCrossOrigin(exampleOrg_signedPkg, exampleOrg_signedPkg_browser); checkCrossOrigin(exampleOrg_signedPkg, exampleOrg_signedPkg_another); + + // Check Principal kinds. + function checkKind(prin, kind) { + do_check_eq(prin.isNullPrincipal, kind == 'nullPrincipal'); + do_check_eq(prin.isCodebasePrincipal, kind == 'codebasePrincipal'); + do_check_eq(prin.isExpandedPrincipal, kind == 'expandedPrincipal'); + do_check_eq(prin.isSystemPrincipal, kind == 'systemPrincipal'); + } + checkKind(ssm.createNullPrincipal({}), 'nullPrincipal'); + checkKind(ssm.createCodebasePrincipal(makeURI('http://www.example.com'), {}), 'codebasePrincipal'); + checkKind(ssm.createExpandedPrincipal([ssm.createCodebasePrincipal(makeURI('http://www.example.com'), {})]), 'expandedPrincipal'); + checkKind(ssm.getSystemPrincipal(), 'systemPrincipal'); } diff --git a/chrome/moz.build b/chrome/moz.build index 2ba1c2ce39c..c4ee0f64f5f 100644 --- a/chrome/moz.build +++ b/chrome/moz.build @@ -33,6 +33,7 @@ GENERATED_INCLUDES += [ ] LOCAL_INCLUDES += [ + '/dom/base', '/netwerk/base', '/netwerk/protocol/res', '/xpcom/components' diff --git a/chrome/nsChromeRegistry.cpp b/chrome/nsChromeRegistry.cpp index 378ebb48193..88dc67d3ac9 100644 --- a/chrome/nsChromeRegistry.cpp +++ b/chrome/nsChromeRegistry.cpp @@ -313,15 +313,10 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURI, nsIURI* *aResult) // theme stuff -static void FlushSkinBindingsForWindow(nsIDOMWindow* aWindow) +static void FlushSkinBindingsForWindow(nsPIDOMWindow* aWindow) { - // Get the DOM document. - nsCOMPtr domDocument; - aWindow->GetDocument(getter_AddRefs(domDocument)); - if (!domDocument) - return; - - nsCOMPtr document = do_QueryInterface(domDocument); + // Get the document. + nsCOMPtr document = aWindow->GetDoc(); if (!document) return; @@ -345,7 +340,7 @@ NS_IMETHODIMP nsChromeRegistry::RefreshSkins() nsCOMPtr protoWindow; windowEnumerator->GetNext(getter_AddRefs(protoWindow)); if (protoWindow) { - nsCOMPtr domWindow = do_QueryInterface(protoWindow); + nsCOMPtr domWindow = do_QueryInterface(protoWindow); if (domWindow) FlushSkinBindingsForWindow(domWindow); } @@ -360,7 +355,7 @@ NS_IMETHODIMP nsChromeRegistry::RefreshSkins() nsCOMPtr protoWindow; windowEnumerator->GetNext(getter_AddRefs(protoWindow)); if (protoWindow) { - nsCOMPtr domWindow = do_QueryInterface(protoWindow); + nsCOMPtr domWindow = do_QueryInterface(protoWindow); if (domWindow) RefreshWindow(domWindow); } @@ -382,28 +377,23 @@ nsChromeRegistry::FlushSkinCaches() } // XXXbsmedberg: move this to windowmediator -nsresult nsChromeRegistry::RefreshWindow(nsIDOMWindow* aWindow) +nsresult nsChromeRegistry::RefreshWindow(nsPIDOMWindow* aWindow) { // Deal with our subframes first. - nsCOMPtr frames; - aWindow->GetFrames(getter_AddRefs(frames)); + nsCOMPtr frames = aWindow->GetFrames(); uint32_t length; frames->GetLength(&length); uint32_t j; for (j = 0; j < length; j++) { nsCOMPtr childWin; frames->Item(j, getter_AddRefs(childWin)); - RefreshWindow(childWin); + nsCOMPtr piWindow = do_QueryInterface(childWin); + RefreshWindow(piWindow); } nsresult rv; - // Get the DOM document. - nsCOMPtr domDocument; - aWindow->GetDocument(getter_AddRefs(domDocument)); - if (!domDocument) - return NS_OK; - - nsCOMPtr document = do_QueryInterface(domDocument); + // Get the document. + nsCOMPtr document = aWindow->GetDoc(); if (!document) return NS_OK; @@ -521,10 +511,9 @@ nsChromeRegistry::ReloadChrome() nsCOMPtr protoWindow; rv = windowEnumerator->GetNext(getter_AddRefs(protoWindow)); if (NS_SUCCEEDED(rv)) { - nsCOMPtr domWindow = do_QueryInterface(protoWindow); + nsCOMPtr domWindow = do_QueryInterface(protoWindow); if (domWindow) { - nsCOMPtr location; - domWindow->GetLocation(getter_AddRefs(location)); + nsIDOMLocation* location = domWindow->GetLocation(); if (location) { rv = location->Reload(false); if (NS_FAILED(rv)) return rv; diff --git a/chrome/nsChromeRegistry.h b/chrome/nsChromeRegistry.h index 22fc983d28b..c9176cb3e2d 100644 --- a/chrome/nsChromeRegistry.h +++ b/chrome/nsChromeRegistry.h @@ -22,7 +22,7 @@ #include "mozilla/FileLocation.h" -class nsIDOMWindow; +class nsPIDOMWindow; class nsIPrefBranch; class nsIURL; @@ -95,7 +95,7 @@ protected: nsresult SelectLocaleFromPref(nsIPrefBranch* prefs); - static nsresult RefreshWindow(nsIDOMWindow* aWindow); + static nsresult RefreshWindow(nsPIDOMWindow* aWindow); static nsresult GetProviderAndPath(nsIURL* aChromeURL, nsACString& aProvider, nsACString& aPath); diff --git a/devtools/client/tilt/tilt-utils.js b/devtools/client/tilt/tilt-utils.js index 1208dccf867..bde8a53abda 100644 --- a/devtools/client/tilt/tilt-utils.js +++ b/devtools/client/tilt/tilt-utils.js @@ -371,8 +371,10 @@ TiltUtils.DOM = { aContentWindow) { return { - width: aContentWindow.innerWidth + aContentWindow.scrollMaxX, - height: aContentWindow.innerHeight + aContentWindow.scrollMaxY + width: aContentWindow.innerWidth + + aContentWindow.scrollMaxX - aContentWindow.scrollMinX, + height: aContentWindow.innerHeight + + aContentWindow.scrollMaxY - aContentWindow.scrollMinY }; }, diff --git a/devtools/shared/gcli/commands/screenshot.js b/devtools/shared/gcli/commands/screenshot.js index 2155eceac49..be7610e491c 100644 --- a/devtools/shared/gcli/commands/screenshot.js +++ b/devtools/shared/gcli/commands/screenshot.js @@ -270,8 +270,8 @@ function createScreenshotData(document, args) { // Bug 961832: GCLI screenshot shows fixed position element in wrong // position if we don't scroll to top window.scrollTo(0,0); - width = window.innerWidth + window.scrollMaxX; - height = window.innerHeight + window.scrollMaxY; + width = window.innerWidth + window.scrollMaxX - window.scrollMinX; + height = window.innerHeight + window.scrollMaxY - window.scrollMinY; } else if (args.selector) { ({ top, left, width, height } = getRect(window, args.selector, window)); diff --git a/docshell/base/nsDSURIContentListener.cpp b/docshell/base/nsDSURIContentListener.cpp index ab86756cc94..98de0eef053 100644 --- a/docshell/base/nsDSURIContentListener.cpp +++ b/docshell/base/nsDSURIContentListener.cpp @@ -148,8 +148,8 @@ nsDSURIContentListener::DoContent(const nsACString& aContentType, } if (loadFlags & nsIChannel::LOAD_RETARGETED_DOCUMENT_URI) { - nsCOMPtr domWindow = - mDocShell ? mDocShell->GetWindow() : nullptr; + nsCOMPtr domWindow = do_QueryInterface( + mDocShell ? mDocShell->GetWindow() : nullptr); NS_ENSURE_TRUE(domWindow, NS_ERROR_FAILURE); domWindow->Focus(); } @@ -294,7 +294,7 @@ nsDSURIContentListener::CheckOneFrameOptionsPolicy(nsIHttpChannel* aHttpChannel, // window, if we're not the top. X-F-O: SAMEORIGIN requires that the // document must be same-origin with top window. X-F-O: DENY requires that // the document must never be framed. - nsCOMPtr thisWindow = mDocShell->GetWindow(); + nsCOMPtr thisWindow = mDocShell->GetWindow(); // If we don't have DOMWindow there is no risk of clickjacking if (!thisWindow) { return true; @@ -302,8 +302,7 @@ nsDSURIContentListener::CheckOneFrameOptionsPolicy(nsIHttpChannel* aHttpChannel, // GetScriptableTop, not GetTop, because we want this to respect //