зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 6a56c14d382f (bug 1024707) for dt1 and xpshell test bustages on a CLOSED TREE
This commit is contained in:
Родитель
09a3eb0e72
Коммит
e31951a5dd
|
@ -132,8 +132,8 @@ typedef CallbackObjectHolder<NodeFilter, nsIDOMNodeFilter> NodeFilterHolder;
|
|||
} // namespace mozilla
|
||||
|
||||
#define NS_IDOCUMENT_IID \
|
||||
{ 0xd3bf7259, 0xbe90, 0x4de7, \
|
||||
{ 0x85, 0x77, 0x22, 0xf2, 0x45, 0xf8, 0x16, 0xd5} }
|
||||
{ 0xc9e11955, 0xaa55, 0x49a1, \
|
||||
{ 0x94, 0x29, 0x58, 0xe9, 0xbe, 0xf6, 0x79, 0x54 } }
|
||||
|
||||
// Enum for requesting a particular type of document when creating a doc
|
||||
enum DocumentFlavor {
|
||||
|
@ -851,7 +851,6 @@ public:
|
|||
};
|
||||
|
||||
virtual nsresult LoadAdditionalStyleSheet(additionalSheetType aType, nsIURI* aSheetURI) = 0;
|
||||
virtual nsresult AddAdditionalStyleSheet(additionalSheetType aType, nsIStyleSheet* aSheet) = 0;
|
||||
virtual void RemoveAdditionalStyleSheet(additionalSheetType aType, nsIURI* sheetURI) = 0;
|
||||
virtual nsIStyleSheet* FirstAdditionalAuthorSheet() = 0;
|
||||
|
||||
|
|
|
@ -4221,34 +4221,22 @@ nsDocument::LoadAdditionalStyleSheet(additionalSheetType aType, nsIURI* aSheetUR
|
|||
true, getter_AddRefs(sheet));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mAdditionalSheets[aType].AppendObject(sheet);
|
||||
sheet->SetOwningDocument(this);
|
||||
MOZ_ASSERT(sheet->IsApplicable());
|
||||
|
||||
return AddAdditionalStyleSheet(aType, sheet);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsDocument::AddAdditionalStyleSheet(additionalSheetType aType, nsIStyleSheet* aSheet)
|
||||
{
|
||||
if (mAdditionalSheets[aType].Contains(aSheet))
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
if (!aSheet->IsApplicable())
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
mAdditionalSheets[aType].AppendObject(aSheet);
|
||||
|
||||
BeginUpdate(UPDATE_STYLE);
|
||||
nsCOMPtr<nsIPresShell> shell = GetShell();
|
||||
if (shell) {
|
||||
nsStyleSet::sheetType type = ConvertAdditionalSheetType(aType);
|
||||
shell->StyleSet()->AppendStyleSheet(type, aSheet);
|
||||
shell->StyleSet()->AppendStyleSheet(type, sheet);
|
||||
}
|
||||
|
||||
// Passing false, so documet.styleSheets.length will not be affected by
|
||||
// these additional sheets.
|
||||
NotifyStyleSheetAdded(aSheet, false);
|
||||
NotifyStyleSheetAdded(sheet, false);
|
||||
EndUpdate(UPDATE_STYLE);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -11887,10 +11875,6 @@ SizeOfStyleSheetsElementIncludingThis(nsIStyleSheet* aStyleSheet,
|
|||
MallocSizeOf aMallocSizeOf,
|
||||
void* aData)
|
||||
{
|
||||
if (!aStyleSheet->GetOwningDocument()) {
|
||||
// Avoid over-reporting shared sheets.
|
||||
return 0;
|
||||
}
|
||||
return aStyleSheet->SizeOfIncludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
||||
|
|
|
@ -809,7 +809,6 @@ public:
|
|||
bool aApplicable) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult LoadAdditionalStyleSheet(additionalSheetType aType, nsIURI* aSheetURI) MOZ_OVERRIDE;
|
||||
virtual nsresult AddAdditionalStyleSheet(additionalSheetType aType, nsIStyleSheet* aSheet) MOZ_OVERRIDE;
|
||||
virtual void RemoveAdditionalStyleSheet(additionalSheetType aType, nsIURI* sheetURI) MOZ_OVERRIDE;
|
||||
virtual nsIStyleSheet* FirstAdditionalAuthorSheet() MOZ_OVERRIDE;
|
||||
|
||||
|
|
|
@ -161,7 +161,6 @@ LOCAL_INCLUDES += [
|
|||
'/content/base/src',
|
||||
'/content/html/document/src',
|
||||
'/content/xul/document/src',
|
||||
'/layout/base',
|
||||
'/layout/generic',
|
||||
'/layout/style',
|
||||
'/layout/xul',
|
||||
|
|
|
@ -90,8 +90,6 @@
|
|||
#include "GeckoProfiler.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsIContentIterator.h"
|
||||
#include "nsIDOMStyleSheet.h"
|
||||
#include "nsIStyleSheet.h"
|
||||
#include "nsContentPermissionHelper.h"
|
||||
|
||||
#ifdef XP_WIN
|
||||
|
@ -3369,28 +3367,6 @@ nsDOMWindowUtils::LoadSheet(nsIURI *aSheetURI, uint32_t aSheetType)
|
|||
return doc->LoadAdditionalStyleSheet(type, aSheetURI);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::AddSheet(nsIDOMStyleSheet *aSheet, uint32_t aSheetType)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome());
|
||||
|
||||
NS_ENSURE_ARG_POINTER(aSheet);
|
||||
NS_ENSURE_ARG(aSheetType == AGENT_SHEET ||
|
||||
aSheetType == USER_SHEET ||
|
||||
aSheetType == AUTHOR_SHEET);
|
||||
|
||||
nsCOMPtr<nsIDocument> doc = GetDocument();
|
||||
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
|
||||
|
||||
nsIDocument::additionalSheetType type = convertSheetType(aSheetType);
|
||||
nsCOMPtr<nsIStyleSheet> sheet = do_QueryInterface(aSheet);
|
||||
NS_ENSURE_TRUE(sheet, NS_ERROR_FAILURE);
|
||||
if (sheet->GetOwningDocument()) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
return doc->AddAdditionalStyleSheet(type, sheet);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::RemoveSheet(nsIURI *aSheetURI, uint32_t aSheetType)
|
||||
{
|
||||
|
|
|
@ -35,7 +35,6 @@ interface nsIDOMNodeList;
|
|||
interface nsIDOMElement;
|
||||
interface nsIDOMHTMLCanvasElement;
|
||||
interface nsIDOMEvent;
|
||||
interface nsIDOMStyleSheet;
|
||||
interface nsITransferable;
|
||||
interface nsIQueryContentEventResult;
|
||||
interface nsIDOMWindow;
|
||||
|
@ -51,7 +50,7 @@ interface nsITranslationNodeList;
|
|||
interface nsIJSRAIIHelper;
|
||||
interface nsIContentPermissionRequest;
|
||||
|
||||
[scriptable, uuid(4c4c8c17-5a73-4d7e-a8e7-f67bfebb97f5)]
|
||||
[scriptable, uuid(ca202fa7-7b8f-4814-acc3-a8545f67320b)]
|
||||
interface nsIDOMWindowUtils : nsISupports {
|
||||
|
||||
/**
|
||||
|
@ -1564,22 +1563,15 @@ interface nsIDOMWindowUtils : nsISupports {
|
|||
*
|
||||
* Sheets added via this API take effect immediately on the document.
|
||||
*/
|
||||
void loadSheet(in nsIURI 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.
|
||||
*/
|
||||
void addSheet(in nsIDOMStyleSheet sheet, in unsigned long type);
|
||||
void loadSheet(in nsIURI sheetURI,
|
||||
in unsigned long type);
|
||||
|
||||
/**
|
||||
* 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);
|
||||
void removeSheet(in nsIURI sheetURI,
|
||||
in unsigned long type);
|
||||
|
||||
/**
|
||||
* Returns true if a user input is being handled.
|
||||
|
|
|
@ -8,14 +8,13 @@
|
|||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIURI;
|
||||
interface nsIDOMStyleSheet;
|
||||
|
||||
/*
|
||||
* nsIStyleSheetService allows extensions or embeddors to add to the
|
||||
* built-in list of user or agent style sheets.
|
||||
*/
|
||||
|
||||
[scriptable, uuid(4c4c8c17-5a73-4d7e-a8e7-f67bfebb97f5)]
|
||||
[scriptable, uuid(1f42a6a2-ab0a-45d4-8a96-396f58ea6c6d)]
|
||||
interface nsIStyleSheetService : nsISupports
|
||||
{
|
||||
const unsigned long AGENT_SHEET = 0;
|
||||
|
@ -47,12 +46,6 @@ interface nsIStyleSheetService : nsISupports
|
|||
*/
|
||||
boolean sheetRegistered(in nsIURI sheetURI, in unsigned long type);
|
||||
|
||||
/**
|
||||
* Synchronously loads a style sheet from |sheetURI| and returns the
|
||||
* new style sheet object. Can be used with nsIDOMWindowUtils.addSheet.
|
||||
*/
|
||||
nsIDOMStyleSheet preloadSheet(in nsIURI sheetURI, in unsigned long type);
|
||||
|
||||
/**
|
||||
* Remove the style sheet at |sheetURI| from the list of style sheets
|
||||
* specified by |type|. The removal takes effect immediately, even for
|
||||
|
|
|
@ -214,27 +214,6 @@ nsStyleSheetService::SheetRegistered(nsIURI *sheetURI,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsStyleSheetService::PreloadSheet(nsIURI *aSheetURI, uint32_t aSheetType,
|
||||
nsIDOMStyleSheet **aSheet)
|
||||
{
|
||||
NS_ENSURE_ARG(aSheetType == AGENT_SHEET ||
|
||||
aSheetType == USER_SHEET ||
|
||||
aSheetType == AUTHOR_SHEET);
|
||||
NS_ENSURE_ARG_POINTER(aSheetURI);
|
||||
NS_PRECONDITION(aSheet, "Null out param");
|
||||
|
||||
nsRefPtr<css::Loader> loader = new css::Loader();
|
||||
|
||||
// Allow UA sheets, but not user sheets, to use unsafe rules
|
||||
nsRefPtr<CSSStyleSheet> sheet;
|
||||
nsresult rv = loader->LoadSheetSync(aSheetURI, aSheetType == AGENT_SHEET,
|
||||
true, getter_AddRefs(sheet));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
sheet.forget(aSheet);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsStyleSheetService::UnregisterSheet(nsIURI *aSheetURI, uint32_t aSheetType)
|
||||
{
|
||||
|
|
|
@ -63,7 +63,7 @@ class nsStyleSheetService MOZ_FINAL
|
|||
// Like LoadAndRegisterSheet, but doesn't notify. If successful, the
|
||||
// new sheet will be the last sheet in mSheets[aSheetType].
|
||||
nsresult LoadAndRegisterSheetInternal(nsIURI *aSheetURI,
|
||||
uint32_t aSheetType);
|
||||
uint32_t aSheetType);
|
||||
|
||||
nsCOMArray<nsIStyleSheet> mSheets[3];
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче