зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 42e80a07acd6 (bug 1177563) for bustage on a CLOSED TREE
--HG-- extra : rebase_source : 4a68bf83cc2939f899b0c6f92efa58e3d5aab6a2
This commit is contained in:
Родитель
c73561b313
Коммит
f5a2bf64b3
|
@ -101,7 +101,6 @@
|
||||||
#include "nsIContentIterator.h"
|
#include "nsIContentIterator.h"
|
||||||
#include "nsIDOMStyleSheet.h"
|
#include "nsIDOMStyleSheet.h"
|
||||||
#include "nsIStyleSheet.h"
|
#include "nsIStyleSheet.h"
|
||||||
#include "nsIStyleSheetService.h"
|
|
||||||
#include "nsContentPermissionHelper.h"
|
#include "nsContentPermissionHelper.h"
|
||||||
#include "nsNetUtil.h"
|
#include "nsNetUtil.h"
|
||||||
|
|
||||||
|
@ -3894,21 +3893,6 @@ nsDOMWindowUtils::LeaveChaosMode()
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsDOMWindowUtils::HasRuleProcessorUsedByMultipleStyleSets(uint32_t aSheetType,
|
|
||||||
bool* aRetVal)
|
|
||||||
{
|
|
||||||
MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome());
|
|
||||||
|
|
||||||
nsIPresShell* presShell = GetPresShell();
|
|
||||||
if (!presShell) {
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return presShell->HasRuleProcessorUsedByMultipleStyleSets(aSheetType,
|
|
||||||
aRetVal);
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_INTERFACE_MAP_BEGIN(nsTranslationNodeList)
|
NS_INTERFACE_MAP_BEGIN(nsTranslationNodeList)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsITranslationNodeList)
|
NS_INTERFACE_MAP_ENTRY(nsITranslationNodeList)
|
||||||
|
|
|
@ -49,7 +49,7 @@ interface nsIJSRAIIHelper;
|
||||||
interface nsIContentPermissionRequest;
|
interface nsIContentPermissionRequest;
|
||||||
interface nsIObserver;
|
interface nsIObserver;
|
||||||
|
|
||||||
[scriptable, uuid(bbcb87fb-ce2e-4e05-906b-9258687664e2)]
|
[scriptable, uuid(336a8683-5626-4512-a3d5-ec280c13e5c2)]
|
||||||
interface nsIDOMWindowUtils : nsISupports {
|
interface nsIDOMWindowUtils : nsISupports {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1857,15 +1857,6 @@ interface nsIDOMWindowUtils : nsISupports {
|
||||||
* Decrease the chaos mode activation level. See enterChaosMode().
|
* Decrease the chaos mode activation level. See enterChaosMode().
|
||||||
*/
|
*/
|
||||||
void leaveChaosMode();
|
void leaveChaosMode();
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns whether the document's style set's rule processor for the
|
|
||||||
* specified level of the cascade is shared by multiple style sets.
|
|
||||||
* (Used by tests to ensure that certain optimizations do not regress.)
|
|
||||||
*
|
|
||||||
* @param aSheetType One of the nsIStyleSheetService.*_SHEET constants.
|
|
||||||
*/
|
|
||||||
bool hasRuleProcessorUsedByMultipleStyleSets(in unsigned long aSheetType);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
[scriptable, uuid(c694e359-7227-4392-a138-33c0cc1f15a6)]
|
[scriptable, uuid(c694e359-7227-4392-a138-33c0cc1f15a6)]
|
||||||
|
|
|
@ -1568,15 +1568,6 @@ public:
|
||||||
// Whether we should assume all images are visible.
|
// Whether we should assume all images are visible.
|
||||||
virtual bool AssumeAllImagesVisible() = 0;
|
virtual bool AssumeAllImagesVisible() = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns whether the document's style set's rule processor for the
|
|
||||||
* specified level of the cascade is shared by multiple style sets.
|
|
||||||
*
|
|
||||||
* @param aSheetType One of the nsIStyleSheetService.*_SHEET constants.
|
|
||||||
*/
|
|
||||||
nsresult HasRuleProcessorUsedByMultipleStyleSets(uint32_t aSheetType,
|
|
||||||
bool* aRetVal);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Refresh observer management.
|
* Refresh observer management.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -10894,27 +10894,3 @@ nsIPresShell::SyncWindowProperties(nsView* aView)
|
||||||
nsContainerFrame::SyncWindowProperties(mPresContext, frame, aView, &rcx, 0);
|
nsContainerFrame::SyncWindowProperties(mPresContext, frame, aView, &rcx, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
|
||||||
nsIPresShell::HasRuleProcessorUsedByMultipleStyleSets(uint32_t aSheetType,
|
|
||||||
bool* aRetVal)
|
|
||||||
{
|
|
||||||
nsStyleSet::sheetType type;
|
|
||||||
switch (aSheetType) {
|
|
||||||
case nsIStyleSheetService::AGENT_SHEET:
|
|
||||||
type = nsStyleSet::eAgentSheet;
|
|
||||||
break;
|
|
||||||
case nsIStyleSheetService::USER_SHEET:
|
|
||||||
type = nsStyleSet::eUserSheet;
|
|
||||||
break;
|
|
||||||
case nsIStyleSheetService::AUTHOR_SHEET:
|
|
||||||
type = nsStyleSet::eDocSheet;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
MOZ_ASSERT(false, "unexpected aSheetType value");
|
|
||||||
return NS_ERROR_ILLEGAL_VALUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
*aRetVal = mStyleSet->HasRuleProcessorUsedByMultipleStyleSets(type);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
|
@ -183,7 +183,6 @@ public:
|
||||||
mInRuleProcessorCache = aVal;
|
mInRuleProcessorCache = aVal;
|
||||||
}
|
}
|
||||||
bool IsInRuleProcessorCache() const { return mInRuleProcessorCache; }
|
bool IsInRuleProcessorCache() const { return mInRuleProcessorCache; }
|
||||||
bool IsUsedByMultipleStyleSets() const { return mStyleSetRefCnt > 1; }
|
|
||||||
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
// Cached theme identifier for the moz-windows-theme media query.
|
// Cached theme identifier for the moz-windows-theme media query.
|
||||||
|
|
|
@ -2467,15 +2467,3 @@ nsStyleSet::InitialStyleRule()
|
||||||
}
|
}
|
||||||
return mInitialStyleRule;
|
return mInitialStyleRule;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
nsStyleSet::HasRuleProcessorUsedByMultipleStyleSets(sheetType aSheetType)
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(aSheetType < ArrayLength(mRuleProcessors));
|
|
||||||
if (!IsCSSSheetType(aSheetType) || !mRuleProcessors[aSheetType]) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
nsCSSRuleProcessor* rp =
|
|
||||||
static_cast<nsCSSRuleProcessor*>(mRuleProcessors[aSheetType].get());
|
|
||||||
return rp->IsUsedByMultipleStyleSets();
|
|
||||||
}
|
|
||||||
|
|
|
@ -394,8 +394,6 @@ class nsStyleSet final
|
||||||
|
|
||||||
nsIStyleRule* InitialStyleRule();
|
nsIStyleRule* InitialStyleRule();
|
||||||
|
|
||||||
bool HasRuleProcessorUsedByMultipleStyleSets(sheetType aSheetType);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nsStyleSet(const nsStyleSet& aCopy) = delete;
|
nsStyleSet(const nsStyleSet& aCopy) = delete;
|
||||||
nsStyleSet& operator=(const nsStyleSet& aCopy) = delete;
|
nsStyleSet& operator=(const nsStyleSet& aCopy) = delete;
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
support-files =
|
support-files =
|
||||||
bug453896_iframe.html
|
bug453896_iframe.html
|
||||||
media_queries_iframe.html
|
media_queries_iframe.html
|
||||||
newtab_share_rule_processors.html
|
|
||||||
|
|
||||||
[browser_bug453896.js]
|
[browser_bug453896.js]
|
||||||
skip-if = e10s # Bug ?????? - test touches content (TypeError: doc.documentElement is null)
|
skip-if = e10s # Bug ?????? - test touches content (TypeError: doc.documentElement is null)
|
||||||
[browser_newtab_share_rule_processors.js]
|
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
var theTab;
|
|
||||||
var theBrowser;
|
|
||||||
|
|
||||||
function listener(evt) {
|
|
||||||
if (evt.target == theBrowser.contentDocument) {
|
|
||||||
doTest();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function test() {
|
|
||||||
waitForExplicitFinish();
|
|
||||||
var testURL = getRootDirectory(gTestPath) + "newtab_share_rule_processors.html";
|
|
||||||
theTab = gBrowser.addTab(testURL);
|
|
||||||
theBrowser = gBrowser.getBrowserForTab(theTab);
|
|
||||||
theBrowser.addEventListener("load", listener, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
function doTest() {
|
|
||||||
theBrowser.removeEventListener("load", listener, true);
|
|
||||||
var winUtils = theBrowser.contentWindow
|
|
||||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
|
||||||
.getInterface(Ci.nsIDOMWindowUtils);
|
|
||||||
// The initial set of agent-level sheets should have a rule processor that's
|
|
||||||
// also being used by another document.
|
|
||||||
ok(winUtils.hasRuleProcessorUsedByMultipleStyleSets(Ci.nsIStyleSheetService.AGENT_SHEET),
|
|
||||||
"agent sheet rule processor is used by multiple style sets");
|
|
||||||
// Document-level sheets currently never get shared rule processors.
|
|
||||||
ok(!winUtils.hasRuleProcessorUsedByMultipleStyleSets(Ci.nsIStyleSheetService.AUTHOR_SHEET),
|
|
||||||
"author sheet rule processor is not used by multiple style sets");
|
|
||||||
// Adding a unique style sheet to the agent level will cause it to have a
|
|
||||||
// rule processor that is unique.
|
|
||||||
theBrowser.contentWindow.wrappedJSObject.addAgentSheet();
|
|
||||||
ok(!winUtils.hasRuleProcessorUsedByMultipleStyleSets(Ci.nsIStyleSheetService.AGENT_SHEET),
|
|
||||||
"agent sheet rule processor is not used by multiple style sets after " +
|
|
||||||
"having a unique sheet added to it");
|
|
||||||
gBrowser.removeTab(theTab);
|
|
||||||
finish();
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<style>
|
|
||||||
p { color: blue; }
|
|
||||||
</style>
|
|
||||||
<p>Hello</p>
|
|
||||||
<script>
|
|
||||||
var Cc = Components.classes;
|
|
||||||
var Ci = Components.interfaces;
|
|
||||||
|
|
||||||
var sss = Cc["@mozilla.org/content/style-sheet-service;1"]
|
|
||||||
.getService(Ci.nsIStyleSheetService);
|
|
||||||
var io = Cc["@mozilla.org/network/io-service;1"]
|
|
||||||
.getService(Ci.nsIIOService);
|
|
||||||
var winUtils = window.QueryInterface(Ci.nsIInterfaceRequestor)
|
|
||||||
.getInterface(Ci.nsIDOMWindowUtils);
|
|
||||||
|
|
||||||
function addAgentSheet() {
|
|
||||||
var sheetURI = io.newURI("data:text/css,p{background-color:yellow}", null, null);
|
|
||||||
var sheet = sss.preloadSheet(sheetURI, Ci.nsIStyleSheetService.AGENT_SHEET);
|
|
||||||
winUtils.addSheet(sheet, Ci.nsIDOMWindowUtils.AGENT_SHEET);
|
|
||||||
}
|
|
||||||
</script>
|
|
Загрузка…
Ссылка в новой задаче