author | Dave Townsend <dtownsend@oxymoronical.com> |
Tue, 04 Nov 2014 09:32:06 -0800 | |
changeset 213978 | fb567390cb9238135df1ce72ee47259280fed780 |
parent 213977 | de9c2a2f67eb6d9ccd7368723f97b35ca4706689 |
child 213979 | 211787a9b23ade4d5485d8627110b252c3f6a077 |
push id | 27769 |
push user | kwierso@gmail.com |
push date | Wed, 05 Nov 2014 03:53:35 +0000 |
treeherder | mozilla-central@62990ec7ad78 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | bholley |
bugs | 1093048 |
milestone | 36.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
|
dom/base/nsDOMWindowUtils.cpp | file | annotate | diff | comparison | revisions | |
dom/interfaces/base/nsIDOMWindowUtils.idl | file | annotate | diff | comparison | revisions |
--- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -3475,17 +3475,17 @@ nsDOMWindowUtils::LoadSheet(nsIURI *aShe NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE); nsIDocument::additionalSheetType type = convertSheetType(aSheetType); return doc->LoadAdditionalStyleSheet(type, aSheetURI); } NS_IMETHODIMP -nsDOMWindowUtils::LoadSheetFromURIString(const nsACString& aSheetURI, uint32_t aSheetType) +nsDOMWindowUtils::LoadSheetUsingURIString(const nsACString& aSheetURI, uint32_t aSheetType) { MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome()); nsCOMPtr<nsIURI> uri; nsresult rv = NS_NewURI(getter_AddRefs(uri), aSheetURI); NS_ENSURE_SUCCESS(rv, rv); return LoadSheet(uri, aSheetType); @@ -3528,16 +3528,28 @@ nsDOMWindowUtils::RemoveSheet(nsIURI *aS nsIDocument::additionalSheetType type = convertSheetType(aSheetType); doc->RemoveAdditionalStyleSheet(type, aSheetURI); return NS_OK; } NS_IMETHODIMP +nsDOMWindowUtils::RemoveSheetUsingURIString(const nsACString& aSheetURI, uint32_t aSheetType) +{ + MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome()); + + nsCOMPtr<nsIURI> uri; + nsresult rv = NS_NewURI(getter_AddRefs(uri), aSheetURI); + NS_ENSURE_SUCCESS(rv, rv); + + return RemoveSheet(uri, aSheetType); +} + +NS_IMETHODIMP nsDOMWindowUtils::GetIsHandlingUserInput(bool* aHandlingUserInput) { MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome()); *aHandlingUserInput = EventStateManager::IsHandlingUserInput(); return NS_OK; }
--- a/dom/interfaces/base/nsIDOMWindowUtils.idl +++ b/dom/interfaces/base/nsIDOMWindowUtils.idl @@ -46,17 +46,17 @@ interface nsIDOMClientRect; interface nsIURI; interface nsIDOMEventTarget; interface nsIRunnable; interface nsICompositionStringSynthesizer; interface nsITranslationNodeList; interface nsIJSRAIIHelper; interface nsIContentPermissionRequest; -[scriptable, uuid(f7e4d5da-4dd0-455a-b448-d0224c17fd10)] +[scriptable, uuid(e293355b-ae7f-4ef7-9237-452bcf3e9e6b)] interface nsIDOMWindowUtils : nsISupports { /** * Image animation mode of the window. When this attribute's value * is changed, the implementation should set all images in the window * to the given value. That is, when set to kDontAnimMode, all images * will stop animating. The attribute's value must be one of the * animationMode values from imgIContainer. @@ -1596,17 +1596,17 @@ interface nsIDOMWindowUtils : nsISupport * * Sheets added via this API take effect immediately on the document. */ void loadSheet(in nsIURI sheetURI, in unsigned long type); /** * Same as the above method but allows passing the URI as a string. */ - void loadSheetFromURIString(in ACString sheetURI, in unsigned long type); + void loadSheetUsingURIString(in ACString sheetURI, in unsigned long type); /** * Adds a style sheet to the list of additional style sheets of the document. * * Style sheets can be preloaded with nsIStyleSheetService.preloadSheet. * * Sheets added via this API take effect immediately on the document. */ @@ -1614,16 +1614,21 @@ interface nsIDOMWindowUtils : nsISupport /** * Remove the document style sheet at |sheetURI| from the list of additional * style sheets of the document. The removal takes effect immediately. */ void removeSheet(in nsIURI sheetURI, in unsigned long type); /** + * Same as the above method but allows passing the URI as a string. + */ + void removeSheetUsingURIString(in ACString sheetURI, in unsigned long type); + + /** * Returns true if a user input is being handled. * * This calls EventStateManager::IsHandlingUserInput(). */ readonly attribute boolean isHandlingUserInput; /** * After calling the method, the window for which this DOMWindowUtils