зеркало из https://github.com/mozilla/gecko-dev.git
Merge inbound to mozilla-central r=merge a=merge
This commit is contained in:
Коммит
adbfbaab81
|
@ -7,7 +7,6 @@
|
|||
#include "nsIArray.idl"
|
||||
|
||||
interface nsIPersistentProperties;
|
||||
interface nsIDOMCSSPrimitiveValue;
|
||||
interface nsIDOMNode;
|
||||
interface nsIAccessibleDocument;
|
||||
interface nsIAccessibleRelation;
|
||||
|
|
|
@ -39,7 +39,7 @@ static LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg,
|
|||
|
||||
bool nsWinUtils::sWindowEmulationStarted = false;
|
||||
|
||||
already_AddRefed<nsIDOMCSSStyleDeclaration>
|
||||
already_AddRefed<nsICSSDeclaration>
|
||||
nsWinUtils::GetComputedStyleDeclaration(nsIContent* aContent)
|
||||
{
|
||||
nsIContent* elm = nsCoreUtils::GetDOMElementFor(aContent);
|
||||
|
@ -52,12 +52,11 @@ nsWinUtils::GetComputedStyleDeclaration(nsIContent* aContent)
|
|||
return nullptr;
|
||||
|
||||
ErrorResult dummy;
|
||||
nsCOMPtr<nsICSSDeclaration> cssDecl;
|
||||
nsCOMPtr<Element> domElement(do_QueryInterface(elm));
|
||||
cssDecl = window->GetComputedStyle(*domElement, EmptyString(), dummy);
|
||||
nsCOMPtr<nsIDOMCSSStyleDeclaration> domDecl = do_QueryInterface(cssDecl);
|
||||
nsCOMPtr<nsICSSDeclaration> cssDecl =
|
||||
window->GetComputedStyle(*domElement, EmptyString(), dummy);
|
||||
dummy.SuppressException();
|
||||
return domDecl.forget();
|
||||
return cssDecl.forget();
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include <functional>
|
||||
#include <windows.h>
|
||||
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsICSSDeclaration.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
class nsIContent;
|
||||
|
@ -35,7 +35,7 @@ public:
|
|||
* @note Please use it carefully since it can shutdown the accessible tree
|
||||
* you operate on.
|
||||
*/
|
||||
static already_AddRefed<nsIDOMCSSStyleDeclaration>
|
||||
static already_AddRefed<nsICSSDeclaration>
|
||||
GetComputedStyleDeclaration(nsIContent* aContent);
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "nsCoreUtils.h"
|
||||
#include "nsIAccessibleTypes.h"
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsICSSDeclaration.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsWinUtils.h"
|
||||
|
@ -231,7 +231,7 @@ sdnAccessible::get_computedStyle(unsigned short aMaxStyleProperties,
|
|||
if (mNode->IsNodeOfType(nsINode::eDOCUMENT))
|
||||
return S_FALSE;
|
||||
|
||||
nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl =
|
||||
nsCOMPtr<nsICSSDeclaration> cssDecl =
|
||||
nsWinUtils::GetComputedStyleDeclaration(mNode->AsContent());
|
||||
NS_ENSURE_TRUE(cssDecl, E_FAIL);
|
||||
|
||||
|
@ -244,7 +244,8 @@ sdnAccessible::get_computedStyle(unsigned short aMaxStyleProperties,
|
|||
nsAutoString property, value;
|
||||
|
||||
// Ignore -moz-* properties.
|
||||
if (NS_SUCCEEDED(cssDecl->Item(index, property)) && property.CharAt(0) != '-')
|
||||
cssDecl->Item(index, property);
|
||||
if (property.CharAt(0) != '-')
|
||||
cssDecl->GetPropertyValue(property, value); // Get property value
|
||||
|
||||
if (!value.IsEmpty()) {
|
||||
|
@ -274,7 +275,7 @@ sdnAccessible::get_computedStyleForProperties(unsigned short aNumStyleProperties
|
|||
if (mNode->IsNodeOfType(nsINode::eDOCUMENT))
|
||||
return S_FALSE;
|
||||
|
||||
nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl =
|
||||
nsCOMPtr<nsICSSDeclaration> cssDecl =
|
||||
nsWinUtils::GetComputedStyleDeclaration(mNode->AsContent());
|
||||
NS_ENSURE_TRUE(cssDecl, E_FAIL);
|
||||
|
||||
|
|
|
@ -199,7 +199,6 @@
|
|||
@RESPATH@/components/dom_system.xpt
|
||||
@RESPATH@/components/dom_canvas.xpt
|
||||
@RESPATH@/components/dom_core.xpt
|
||||
@RESPATH@/components/dom_css.xpt
|
||||
@RESPATH@/components/dom_events.xpt
|
||||
@RESPATH@/components/dom_geolocation.xpt
|
||||
@RESPATH@/components/dom_media.xpt
|
||||
|
@ -215,7 +214,6 @@
|
|||
@RESPATH@/components/dom_security.xpt
|
||||
@RESPATH@/components/dom_sidebar.xpt
|
||||
@RESPATH@/components/dom_storage.xpt
|
||||
@RESPATH@/components/dom_stylesheets.xpt
|
||||
@RESPATH@/components/dom_traversal.xpt
|
||||
#ifdef MOZ_WEBSPEECH
|
||||
@RESPATH@/components/dom_webspeechrecognition.xpt
|
||||
|
|
|
@ -13,7 +13,7 @@ add_task(function* () {
|
|||
|
||||
let { tab, document } = yield openAboutDebugging("workers");
|
||||
|
||||
let swTab = yield addTab(TAB_URL, { background: true });
|
||||
let swTab = yield addTab(TAB_URL);
|
||||
|
||||
let serviceWorkersElement = getServiceWorkerList(document);
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ function* testBody(url, expecting) {
|
|||
yield enableServiceWorkerDebugging();
|
||||
let { tab, document } = yield openAboutDebugging("workers");
|
||||
|
||||
let swTab = yield addTab(url, {background: true});
|
||||
let swTab = yield addTab(url);
|
||||
|
||||
let serviceWorkersElement = getServiceWorkerList(document);
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ add_task(function* () {
|
|||
let serviceWorkersElement = getServiceWorkerList(document);
|
||||
|
||||
// Open a tab that registers a push service worker.
|
||||
let swTab = yield addTab(TAB_URL, { background: true });
|
||||
let swTab = yield addTab(TAB_URL);
|
||||
|
||||
info("Make the test page notify us when the service worker sends a message.");
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ add_task(function* () {
|
|||
let serviceWorkersElement = document.getElementById("service-workers");
|
||||
|
||||
// Open a tab that registers a push service worker.
|
||||
let swTab = yield addTab(TAB_URL, { background: true });
|
||||
let swTab = yield addTab(TAB_URL);
|
||||
|
||||
info("Wait until the service worker appears in about:debugging");
|
||||
yield waitUntilServiceWorkerContainer(SERVICE_WORKER, document);
|
||||
|
|
|
@ -25,7 +25,7 @@ add_task(function* () {
|
|||
let serviceWorkersElement = getServiceWorkerList(document);
|
||||
|
||||
// Open a tab that registers an empty service worker.
|
||||
let swTab = yield addTab(TAB_URL, { background: true });
|
||||
let swTab = yield addTab(TAB_URL);
|
||||
|
||||
// Wait for the service-workers list to update.
|
||||
info("Wait until the service worker appears in about:debugging");
|
||||
|
|
|
@ -21,7 +21,7 @@ add_task(function* () {
|
|||
// Listen for mutations in the service-workers list.
|
||||
let serviceWorkersElement = getServiceWorkerList(document);
|
||||
|
||||
let swTab = yield addTab(TAB_URL, { background: true });
|
||||
let swTab = yield addTab(TAB_URL);
|
||||
|
||||
info("Wait until the service worker appears in about:debugging");
|
||||
let container = yield waitUntilServiceWorkerContainer(SERVICE_WORKER, document);
|
||||
|
|
|
@ -20,7 +20,7 @@ add_task(function* () {
|
|||
|
||||
let serviceWorkersElement = getServiceWorkerList(document);
|
||||
|
||||
let swTab = yield addTab(TAB_URL, { background: true });
|
||||
let swTab = yield addTab(TAB_URL);
|
||||
|
||||
info("Wait until the service worker appears in about:debugging");
|
||||
yield waitUntilServiceWorkerContainer(SERVICE_WORKER, document);
|
||||
|
|
|
@ -20,7 +20,7 @@ add_task(function* () {
|
|||
let { tab, document } = yield openAboutDebugging("workers");
|
||||
|
||||
// Open a tab that registers an empty service worker.
|
||||
let swTab = yield addTab(TAB_URL, { background: true });
|
||||
let swTab = yield addTab(TAB_URL);
|
||||
|
||||
info("Wait until the service worker appears in about:debugging");
|
||||
yield waitUntilServiceWorkerContainer(SERVICE_WORKER, document);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
This is the debugger.html project output.
|
||||
See https://github.com/devtools-html/debugger.html
|
||||
|
||||
Version 7.0
|
||||
Comparison - https://github.com/devtools-html/debugger.html/compare/release-6...release-7
|
||||
Commit: https://github.com/devtools-html/debugger.html/commit/fb10a431822a1a1eb22e02613cb09cf12a10e67a
|
||||
Version 8.0
|
||||
commit https://github.com/devtools-html/debugger.html/commit/9be8e9d9e7a70730bc02e50ae019028f1f06b14e
|
||||
comparison https://github.com/devtools-html/debugger.html/compare/release-7...release-8
|
||||
|
||||
Packages:
|
||||
- babel-plugin-transform-es2015-modules-commonjs @6.26.0
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -300,9 +300,7 @@ function assertDebugLine(dbg, line) {
|
|||
const url = source.get("url");
|
||||
ok(
|
||||
false,
|
||||
`Looks like the source ${
|
||||
url
|
||||
} is still loading. Try adding waitForLoadedSource in the test.`
|
||||
`Looks like the source ${url} is still loading. Try adding waitForLoadedSource in the test.`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
@ -917,9 +915,7 @@ const selectors = {
|
|||
expressionNode: i =>
|
||||
`.expressions-list .expression-container:nth-child(${i}) .object-label`,
|
||||
expressionValue: i =>
|
||||
`.expressions-list .expression-container:nth-child(${
|
||||
i
|
||||
}) .object-delimiter + *`,
|
||||
`.expressions-list .expression-container:nth-child(${i}) .object-delimiter + *`,
|
||||
expressionClose: i =>
|
||||
`.expressions-list .expression-container:nth-child(${i}) .close`,
|
||||
expressionNodes: ".expressions-list .tree-node",
|
||||
|
|
|
@ -16,8 +16,6 @@ const { cssUsageSpec } = require("devtools/shared/specs/csscoverage");
|
|||
loader.lazyRequireGetter(this, "stylesheets", "devtools/server/actors/stylesheets");
|
||||
loader.lazyRequireGetter(this, "prettifyCSS", "devtools/shared/inspector/css-logic", true);
|
||||
|
||||
const CSSRule = Ci.nsIDOMCSSRule;
|
||||
|
||||
const MAX_UNUSED_RULES = 10000;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1716,7 +1716,7 @@ DebuggerServer.ObjectActorPreviewers.Object = [
|
|||
},
|
||||
|
||||
function CSSMediaRule({obj, hooks}, grip, rawObj) {
|
||||
if (isWorker || !rawObj || !(rawObj instanceof Ci.nsIDOMCSSMediaRule)) {
|
||||
if (isWorker || !rawObj || obj.class != "CSSMediaRule") {
|
||||
return false;
|
||||
}
|
||||
grip.preview = {
|
||||
|
@ -1727,7 +1727,7 @@ DebuggerServer.ObjectActorPreviewers.Object = [
|
|||
},
|
||||
|
||||
function CSSStyleRule({obj, hooks}, grip, rawObj) {
|
||||
if (isWorker || !rawObj || !(rawObj instanceof Ci.nsIDOMCSSStyleRule)) {
|
||||
if (isWorker || !rawObj || obj.class != "CSSStyleRule") {
|
||||
return false;
|
||||
}
|
||||
grip.preview = {
|
||||
|
@ -1738,8 +1738,8 @@ DebuggerServer.ObjectActorPreviewers.Object = [
|
|||
},
|
||||
|
||||
function ObjectWithURL({obj, hooks}, grip, rawObj) {
|
||||
if (isWorker || !rawObj || !(rawObj instanceof Ci.nsIDOMCSSImportRule ||
|
||||
rawObj instanceof Ci.nsIDOMCSSStyleSheet ||
|
||||
if (isWorker || !rawObj || !(obj.class == "CSSImportRule" ||
|
||||
obj.class == "CSSStyleSheet" ||
|
||||
obj.class == "Location" ||
|
||||
rawObj instanceof Ci.nsIDOMWindow)) {
|
||||
return false;
|
||||
|
@ -1766,13 +1766,13 @@ DebuggerServer.ObjectActorPreviewers.Object = [
|
|||
if (isWorker || !rawObj ||
|
||||
obj.class != "DOMStringList" &&
|
||||
obj.class != "DOMTokenList" &&
|
||||
obj.class != "CSSRuleList" &&
|
||||
obj.class != "MediaList" &&
|
||||
obj.class != "StyleSheetList" &&
|
||||
obj.class != "CSSValueList" &&
|
||||
!(rawObj instanceof Ci.nsIDOMMozNamedAttrMap ||
|
||||
rawObj instanceof Ci.nsIDOMCSSRuleList ||
|
||||
rawObj instanceof Ci.nsIDOMCSSValueList ||
|
||||
rawObj instanceof Ci.nsIDOMFileList ||
|
||||
rawObj instanceof Ci.nsIDOMMediaList ||
|
||||
rawObj instanceof Ci.nsIDOMNodeList ||
|
||||
rawObj instanceof Ci.nsIDOMStyleSheetList)) {
|
||||
rawObj instanceof Ci.nsIDOMNodeList)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1802,7 +1802,8 @@ DebuggerServer.ObjectActorPreviewers.Object = [
|
|||
|
||||
function CSSStyleDeclaration({obj, hooks}, grip, rawObj) {
|
||||
if (isWorker || !rawObj ||
|
||||
!(rawObj instanceof Ci.nsIDOMCSSStyleDeclaration)) {
|
||||
(obj.class != "CSSStyleDeclaration" &&
|
||||
obj.class != "CSS2Properties")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -165,8 +165,8 @@ var PageStyleActor = protocol.ActorClassWithSpec(pageStyleSpec, {
|
|||
},
|
||||
|
||||
/**
|
||||
* Return or create a StyleSheetActor for the given nsIDOMCSSStyleSheet.
|
||||
* @param {DOMStyleSheet} sheet
|
||||
* Return or create a StyleSheetActor for the given CSSStyleSheet.
|
||||
* @param {CSSStyleSheet} sheet
|
||||
* The style sheet to create an actor for.
|
||||
* @return {StyleSheetActor}
|
||||
* The actor for this style sheet
|
||||
|
@ -947,11 +947,11 @@ var StyleRuleActor = protocol.ActorClassWithSpec(styleRuleSpec, {
|
|||
this._parentSheet = null;
|
||||
this._onStyleApplied = this._onStyleApplied.bind(this);
|
||||
|
||||
if (item instanceof (Ci.nsIDOMCSSRule)) {
|
||||
if (CSSRule.isInstance(item)) {
|
||||
this.type = item.type;
|
||||
this.rawRule = item;
|
||||
if ((this.type === Ci.nsIDOMCSSRule.STYLE_RULE ||
|
||||
this.type === Ci.nsIDOMCSSRule.KEYFRAME_RULE) &&
|
||||
if ((this.type === CSSRule.STYLE_RULE ||
|
||||
this.type === CSSRule.KEYFRAME_RULE) &&
|
||||
this.rawRule.parentStyleSheet) {
|
||||
this.line = InspectorUtils.getRelativeRuleLine(this.rawRule);
|
||||
this.column = InspectorUtils.getRuleColumn(this.rawRule);
|
||||
|
@ -1054,7 +1054,7 @@ var StyleRuleActor = protocol.ActorClassWithSpec(styleRuleSpec, {
|
|||
// of MEDIA_RULEs. We need to check the parentRule to check if a rule is
|
||||
// a media rule so we do this here instead of in the switch statement
|
||||
// below.
|
||||
if (this.rawRule.parentRule.type === Ci.nsIDOMCSSRule.MEDIA_RULE) {
|
||||
if (this.rawRule.parentRule.type === CSSRule.MEDIA_RULE) {
|
||||
form.media = [];
|
||||
for (let i = 0, n = this.rawRule.parentRule.media.length; i < n; i++) {
|
||||
form.media.push(this.rawRule.parentRule.media.item(i));
|
||||
|
@ -1074,7 +1074,7 @@ var StyleRuleActor = protocol.ActorClassWithSpec(styleRuleSpec, {
|
|||
form.authoredText = this.authoredText;
|
||||
|
||||
switch (this.type) {
|
||||
case Ci.nsIDOMCSSRule.STYLE_RULE:
|
||||
case CSSRule.STYLE_RULE:
|
||||
form.selectors = CssLogic.getSelectors(this.rawRule);
|
||||
form.cssText = this.rawStyle.cssText || "";
|
||||
break;
|
||||
|
@ -1087,17 +1087,17 @@ var StyleRuleActor = protocol.ActorClassWithSpec(styleRuleSpec, {
|
|||
form.cssText = this.rawStyle.cssText || "";
|
||||
form.authoredText = this.rawNode.getAttribute("style");
|
||||
break;
|
||||
case Ci.nsIDOMCSSRule.CHARSET_RULE:
|
||||
case CSSRule.CHARSET_RULE:
|
||||
form.encoding = this.rawRule.encoding;
|
||||
break;
|
||||
case Ci.nsIDOMCSSRule.IMPORT_RULE:
|
||||
case CSSRule.IMPORT_RULE:
|
||||
form.href = this.rawRule.href;
|
||||
break;
|
||||
case Ci.nsIDOMCSSRule.KEYFRAMES_RULE:
|
||||
case CSSRule.KEYFRAMES_RULE:
|
||||
form.cssText = this.rawRule.cssText;
|
||||
form.name = this.rawRule.name;
|
||||
break;
|
||||
case Ci.nsIDOMCSSRule.KEYFRAME_RULE:
|
||||
case CSSRule.KEYFRAME_RULE:
|
||||
form.cssText = this.rawStyle.cssText || "";
|
||||
form.keyText = this.rawRule.keyText || "";
|
||||
break;
|
||||
|
@ -1235,8 +1235,8 @@ var StyleRuleActor = protocol.ActorClassWithSpec(styleRuleSpec, {
|
|||
*/
|
||||
getAuthoredCssText: function () {
|
||||
if (!this.canSetRuleText ||
|
||||
(this.type !== Ci.nsIDOMCSSRule.STYLE_RULE &&
|
||||
this.type !== Ci.nsIDOMCSSRule.KEYFRAME_RULE)) {
|
||||
(this.type !== CSSRule.STYLE_RULE &&
|
||||
this.type !== CSSRule.KEYFRAME_RULE)) {
|
||||
return promise.resolve("");
|
||||
}
|
||||
|
||||
|
@ -1314,8 +1314,7 @@ var StyleRuleActor = protocol.ActorClassWithSpec(styleRuleSpec, {
|
|||
document = this.rawNode.ownerDocument;
|
||||
} else {
|
||||
let parentStyleSheet = this._parentSheet;
|
||||
while (parentStyleSheet.ownerRule &&
|
||||
parentStyleSheet.ownerRule instanceof Ci.nsIDOMCSSImportRule) {
|
||||
while (parentStyleSheet.ownerRule) {
|
||||
parentStyleSheet = parentStyleSheet.ownerRule.parentStyleSheet;
|
||||
}
|
||||
|
||||
|
|
|
@ -529,7 +529,7 @@ var StyleSheetActor = protocol.ActorClassWithSpec(styleSheetSpec, {
|
|||
let mediaRules = [];
|
||||
for (let i = 0; i < rules.length; i++) {
|
||||
let rule = rules[i];
|
||||
if (rule.type != Ci.nsIDOMCSSRule.MEDIA_RULE) {
|
||||
if (rule.type != CSSRule.MEDIA_RULE) {
|
||||
continue;
|
||||
}
|
||||
let actor = new MediaRuleActor(rule, this);
|
||||
|
@ -554,7 +554,7 @@ var StyleSheetActor = protocol.ActorClassWithSpec(styleSheetSpec, {
|
|||
if (sheet.cssRules) {
|
||||
let rules = sheet.cssRules;
|
||||
if (rules.length
|
||||
&& rules.item(0).type == Ci.nsIDOMCSSRule.CHARSET_RULE) {
|
||||
&& rules.item(0).type == CSSRule.CHARSET_RULE) {
|
||||
return rules.item(0).encoding;
|
||||
}
|
||||
}
|
||||
|
@ -570,7 +570,7 @@ var StyleSheetActor = protocol.ActorClassWithSpec(styleSheetSpec, {
|
|||
// step 4 (1 of 2): charset of referring stylesheet.
|
||||
let parentSheet = sheet.parentStyleSheet;
|
||||
if (parentSheet && parentSheet.cssRules &&
|
||||
parentSheet.cssRules[0].type == Ci.nsIDOMCSSRule.CHARSET_RULE) {
|
||||
parentSheet.cssRules[0].type == CSSRule.CHARSET_RULE) {
|
||||
return parentSheet.cssRules[0].encoding;
|
||||
}
|
||||
|
||||
|
@ -841,7 +841,7 @@ var StyleSheetsActor = protocol.ActorClassWithSpec(styleSheetsSpec, {
|
|||
|
||||
for (let i = 0; i < rules.length; i++) {
|
||||
let rule = rules[i];
|
||||
if (rule.type == Ci.nsIDOMCSSRule.IMPORT_RULE) {
|
||||
if (rule.type == CSSRule.IMPORT_RULE) {
|
||||
// With the Gecko style system, the associated styleSheet may be null
|
||||
// if it has already been seen because an import cycle for the same
|
||||
// URL. With Stylo, the styleSheet will exist (which is correct per
|
||||
|
@ -858,7 +858,7 @@ var StyleSheetsActor = protocol.ActorClassWithSpec(styleSheetsSpec, {
|
|||
// recurse imports in this stylesheet as well
|
||||
let children = yield this._getImported(doc, actor);
|
||||
imported = imported.concat(children);
|
||||
} else if (rule.type != Ci.nsIDOMCSSRule.CHARSET_RULE) {
|
||||
} else if (rule.type != CSSRule.CHARSET_RULE) {
|
||||
// @import rules must precede all others except @charset
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* - CssSheet provides a more useful API to a DOM CSSSheet for our purposes,
|
||||
* including shortSource and href.
|
||||
* - CssRule a more useful API to a nsIDOMCSSRule including access to the group
|
||||
* - CssRule a more useful API to a DOM CSSRule including access to the group
|
||||
* of CssSelectors that the rule provides properties for
|
||||
* - CssSelector A single selector - i.e. not a selector group. In other words
|
||||
* a CssSelector does not contain ','. This terminology is different from the
|
||||
|
@ -384,15 +384,15 @@ CssLogic.prototype = {
|
|||
/**
|
||||
|
||||
/**
|
||||
* Get the number nsIDOMCSSRule objects in the document, counted from all of
|
||||
* Get the number CSSRule objects in the document, counted from all of
|
||||
* the stylesheets. System sheets are excluded. If a filter is active, this
|
||||
* tells only the number of nsIDOMCSSRule objects inside the selected
|
||||
* tells only the number of CSSRule objects inside the selected
|
||||
* CSSStyleSheet.
|
||||
*
|
||||
* WARNING: This only provides an estimate of the rule count, and the results
|
||||
* could change at a later date. Todo remove this
|
||||
*
|
||||
* @return {number} the number of nsIDOMCSSRule (all rules).
|
||||
* @return {number} the number of CSSRule (all rules).
|
||||
*/
|
||||
get ruleCount() {
|
||||
if (!this._sheetsCached) {
|
||||
|
@ -806,7 +806,7 @@ CssSheet.prototype = {
|
|||
/**
|
||||
* Retrieve the number of rules in this stylesheet.
|
||||
*
|
||||
* @return {number} the number of nsIDOMCSSRule objects in this stylesheet.
|
||||
* @return {number} the number of CSSRule objects in this stylesheet.
|
||||
*/
|
||||
get ruleCount() {
|
||||
try {
|
||||
|
|
|
@ -23,9 +23,11 @@ const { PromiseDebugging, ChromeUtils, HeapSnapshot,
|
|||
|
||||
// Create a single Sandbox to access global properties needed in this module.
|
||||
// Sandbox are memory expensive, so we should create as little as possible.
|
||||
const { CSS, FileReader, indexedDB, InspectorUtils, URL } =
|
||||
const { CSS, CSSRule, FileReader, indexedDB, InspectorUtils, URL } =
|
||||
Cu.Sandbox(CC("@mozilla.org/systemprincipal;1", "nsIPrincipal")(), {
|
||||
wantGlobalProperties: ["CSS", "FileReader", "indexedDB", "InspectorUtils", "URL"]
|
||||
wantGlobalProperties: [
|
||||
"CSS", "CSSRule", "FileReader", "indexedDB", "InspectorUtils", "URL",
|
||||
]
|
||||
});
|
||||
|
||||
/**
|
||||
|
@ -220,6 +222,7 @@ exports.globals = {
|
|||
TextDecoder: TextDecoder,
|
||||
URL,
|
||||
CSS,
|
||||
CSSRule,
|
||||
loader: {
|
||||
lazyGetter: defineLazyGetter,
|
||||
lazyImporter: defineLazyModuleGetter,
|
||||
|
@ -290,7 +293,6 @@ lazyGlobal("clearInterval", () => {
|
|||
lazyGlobal("setInterval", () => {
|
||||
return Cu.import("resource://gre/modules/Timer.jsm", {}).setInterval;
|
||||
});
|
||||
lazyGlobal("CSSRule", () => Ci.nsIDOMCSSRule);
|
||||
lazyGlobal("DOMParser", () => {
|
||||
return CC("@mozilla.org/xmlextras/domparser;1", "nsIDOMParser");
|
||||
});
|
||||
|
|
|
@ -24,7 +24,7 @@ const MAX_DATA_URL_LENGTH = 40;
|
|||
*
|
||||
* - CssSheet provides a more useful API to a DOM CSSSheet for our purposes,
|
||||
* including shortSource and href.
|
||||
* - CssRule a more useful API to a nsIDOMCSSRule including access to the group
|
||||
* - CssRule a more useful API to a DOM CSSRule including access to the group
|
||||
* of CssSelectors that the rule provides properties for
|
||||
* - CssSelector A single selector - i.e. not a selector group. In other words
|
||||
* a CssSelector does not contain ','. This terminology is different from the
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#include "nsIDOMEvent.h"
|
||||
#include "nsDOMCID.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsDOMCSSAttrDeclaration.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsContentList.h"
|
||||
|
|
|
@ -51,7 +51,6 @@
|
|||
#include "nsIDOMEvent.h"
|
||||
#include "nsDOMCID.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsDOMCSSAttrDeclaration.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsContentList.h"
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
#include "mozilla/CSSStyleSheet.h"
|
||||
#include "mozilla/dom/StyleSheetListBinding.h"
|
||||
#include "nsStubDocumentObserver.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
@ -17,9 +16,8 @@ NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(StyleSheetList)
|
|||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(StyleSheetList)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMStyleSheetList)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIMutationObserver)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMStyleSheetList)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(StyleSheetList)
|
||||
|
@ -31,20 +29,6 @@ StyleSheetList::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
|||
return StyleSheetListBinding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
StyleSheetList::GetLength(uint32_t* aLength)
|
||||
{
|
||||
*aLength = Length();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
StyleSheetList::SlowItem(uint32_t aIndex, nsIDOMStyleSheet** aItem)
|
||||
{
|
||||
NS_IF_ADDREF(*aItem = Item(aIndex));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
StyleSheetList::NodeWillBeDestroyed(const nsINode* aNode)
|
||||
{
|
||||
|
|
|
@ -8,9 +8,8 @@
|
|||
#define mozilla_dom_StyleSheetList_h
|
||||
|
||||
#include "mozilla/dom/DocumentOrShadowRoot.h"
|
||||
#include "nsIDOMStyleSheetList.h"
|
||||
#include "nsStubMutationObserver.h"
|
||||
#include "nsWrapperCache.h"
|
||||
#include "nsStubDocumentObserver.h"
|
||||
|
||||
class nsINode;
|
||||
|
||||
|
@ -19,15 +18,12 @@ class StyleSheet;
|
|||
|
||||
namespace dom {
|
||||
|
||||
class StyleSheetList final : public nsIDOMStyleSheetList
|
||||
class StyleSheetList final : public nsStubMutationObserver
|
||||
, public nsWrapperCache
|
||||
, public nsStubDocumentObserver
|
||||
{
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(StyleSheetList, nsIDOMStyleSheetList)
|
||||
|
||||
NS_DECL_NSIDOMSTYLESHEETLIST
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(StyleSheetList)
|
||||
|
||||
NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYED
|
||||
|
||||
|
|
|
@ -68,7 +68,6 @@
|
|||
#include "nsIDOMEventTarget.h"
|
||||
|
||||
// CSS related includes
|
||||
#include "nsIDOMCSSRule.h"
|
||||
#include "nsMemory.h"
|
||||
|
||||
// includes needed for the prototype chain interfaces
|
||||
|
|
|
@ -98,7 +98,6 @@
|
|||
#include "GeckoProfiler.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsIContentIterator.h"
|
||||
#include "nsIDOMStyleSheet.h"
|
||||
#include "nsIStyleSheetService.h"
|
||||
#include "nsContentPermissionHelper.h"
|
||||
#include "nsCSSPseudoElements.h" // for CSSPseudoElementType
|
||||
|
@ -1522,6 +1521,11 @@ nsDOMWindowUtils::CompareCanvases(nsISupports *aCanvas1,
|
|||
RefPtr<DataSourceSurface> img1 = CanvasToDataSourceSurface(canvas1);
|
||||
RefPtr<DataSourceSurface> img2 = CanvasToDataSourceSurface(canvas2);
|
||||
|
||||
if (img1->Equals(img2)) {
|
||||
// They point to the same underlying content.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
DataSourceSurface::ScopedMap map1(img1, DataSourceSurface::READ);
|
||||
DataSourceSurface::ScopedMap map2(img2, DataSourceSurface::READ);
|
||||
|
||||
|
@ -2179,7 +2183,7 @@ nsDOMWindowUtils::GetVisitedDependentComputedStyle(
|
|||
nsCOMPtr<nsPIDOMWindowInner> innerWindow = window->GetCurrentInnerWindow();
|
||||
NS_ENSURE_STATE(window);
|
||||
|
||||
nsCOMPtr<nsIDOMCSSStyleDeclaration> decl;
|
||||
nsCOMPtr<nsICSSDeclaration> decl;
|
||||
{
|
||||
ErrorResult rv;
|
||||
decl = innerWindow->GetComputedStyle(*element, aPseudoElement, rv);
|
||||
|
|
|
@ -58,7 +58,6 @@
|
|||
#include "mozilla/EventStateManager.h"
|
||||
#include "nsIDOMNodeFilter.h"
|
||||
|
||||
#include "nsIDOMStyleSheet.h"
|
||||
#include "mozilla/dom/Attr.h"
|
||||
#include "mozilla/dom/BindingDeclarations.h"
|
||||
#include "nsIDOMDOMImplementation.h"
|
||||
|
@ -237,7 +236,6 @@
|
|||
#include "nsITextControlElement.h"
|
||||
#include "nsIDOMNSEditableElement.h"
|
||||
#include "nsIEditor.h"
|
||||
#include "nsIDOMCSSStyleRule.h"
|
||||
#include "mozilla/css/StyleRule.h"
|
||||
#include "nsIHttpChannelInternal.h"
|
||||
#include "nsISecurityConsoleMessage.h"
|
||||
|
@ -6359,13 +6357,6 @@ nsDocument::GetElementsByTagNameNS(const nsAString& aNamespaceURI,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::GetStyleSheets(nsIDOMStyleSheetList** aStyleSheets)
|
||||
{
|
||||
NS_ADDREF(*aStyleSheets = StyleSheets());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::GetMozSelectedStyleSheetSet(nsAString& aSheetSet)
|
||||
{
|
||||
|
|
|
@ -134,7 +134,6 @@
|
|||
#include "nsIWebBrowserChrome.h"
|
||||
#include "nsIWebBrowserFind.h" // For window.find()
|
||||
#include "nsIWindowMediator.h" // For window.find()
|
||||
#include "nsComputedDOMStyle.h"
|
||||
#include "nsDOMCID.h"
|
||||
#include "nsDOMWindowUtils.h"
|
||||
#include "nsIWindowWatcher.h"
|
||||
|
@ -169,6 +168,7 @@
|
|||
#include "nsIJARChannel.h"
|
||||
#include "nsIScreenManager.h"
|
||||
#include "nsIEffectiveTLDService.h"
|
||||
#include "nsICSSDeclaration.h"
|
||||
|
||||
#include "xpcprivate.h"
|
||||
|
||||
|
@ -4933,7 +4933,7 @@ nsresult
|
|||
nsGlobalWindowInner::GetComputedStyleHelper(nsIDOMElement* aElt,
|
||||
const nsAString& aPseudoElt,
|
||||
bool aDefaultStylesOnly,
|
||||
nsIDOMCSSStyleDeclaration** aReturn)
|
||||
nsICSSDeclaration** aReturn)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aReturn);
|
||||
*aReturn = nullptr;
|
||||
|
@ -4944,9 +4944,9 @@ nsGlobalWindowInner::GetComputedStyleHelper(nsIDOMElement* aElt,
|
|||
}
|
||||
|
||||
ErrorResult rv;
|
||||
nsCOMPtr<nsIDOMCSSStyleDeclaration> declaration =
|
||||
nsCOMPtr<nsICSSDeclaration> cs =
|
||||
GetComputedStyleHelper(*element, aPseudoElt, aDefaultStylesOnly, rv);
|
||||
declaration.forget(aReturn);
|
||||
cs.forget(aReturn);
|
||||
|
||||
return rv.StealNSResult();
|
||||
}
|
||||
|
|
|
@ -1241,7 +1241,7 @@ protected:
|
|||
nsresult GetComputedStyleHelper(nsIDOMElement* aElt,
|
||||
const nsAString& aPseudoElt,
|
||||
bool aDefaultStylesOnly,
|
||||
nsIDOMCSSStyleDeclaration** aReturn);
|
||||
nsICSSDeclaration** aReturn);
|
||||
|
||||
nsGlobalWindowInner* InnerForSetTimeoutOrInterval(mozilla::ErrorResult& aError);
|
||||
|
||||
|
|
|
@ -6893,7 +6893,7 @@ nsGlobalWindowOuter::GetComputedStyleHelperOuter(Element& aElt,
|
|||
}
|
||||
}
|
||||
|
||||
RefPtr<nsComputedDOMStyle> compStyle =
|
||||
RefPtr<nsICSSDeclaration> compStyle =
|
||||
NS_NewComputedDOMStyle(&aElt, aPseudoElt, presShell,
|
||||
aDefaultStylesOnly ? nsComputedDOMStyle::eDefaultOnly :
|
||||
nsComputedDOMStyle::eAll);
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "nsIDocument.h"
|
||||
#include "nsIDOMComment.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDOMStyleSheet.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsXPCOMCIDInternal.h"
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include "nsCSSParser.h"
|
||||
#include "nsCSSPropertyID.h"
|
||||
#include "nsUnicharInputStream.h"
|
||||
#include "nsIDOMCSSRule.h"
|
||||
#include "nsAttrName.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsNetUtil.h"
|
||||
|
@ -1138,13 +1137,8 @@ nsTreeSanitizer::SanitizeStyleSheet(const nsAString& aOriginal,
|
|||
case mozilla::css::Rule::FONT_FACE_RULE: {
|
||||
// Append @namespace and @font-face rules verbatim.
|
||||
nsAutoString cssText;
|
||||
nsCOMPtr<nsIDOMCSSRule> styleRule = do_QueryInterface(rule);
|
||||
if (styleRule) {
|
||||
rv = styleRule->GetCssText(cssText);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
aSanitized.Append(cssText);
|
||||
}
|
||||
}
|
||||
rule->GetCssText(cssText);
|
||||
aSanitized.Append(cssText);
|
||||
break;
|
||||
}
|
||||
case mozilla::css::Rule::STYLE_RULE: {
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
// Check the first and last characters of the numeric input.
|
||||
var test6Element = document.getElementById("test6");
|
||||
var test6Rect = test6Element.getBoundingClientRect();
|
||||
checkOffsetsFromPoint(Math.round(test6Rect.left + 5),
|
||||
checkOffsetsFromPoint(Math.round(test6Rect.left + 4),
|
||||
Math.round(test6Rect.top + (test6Rect.height / 2)),
|
||||
0, "test6");
|
||||
checkOffsetsFromPoint(Math.round(test6Rect.left + test6Rect.width - 30),
|
||||
|
|
|
@ -2498,6 +2498,37 @@ InterfaceHasInstance(JSContext* cx, int prototypeID, int depth,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
InterfaceIsInstance(JSContext* cx, unsigned argc, JS::Value* vp,
|
||||
prototypes::ID prototypeID, int depth)
|
||||
{
|
||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||
if (MOZ_UNLIKELY(args.length() < 1)) {
|
||||
nsPrintfCString message("%s.isInstance",
|
||||
NamesOfInterfacesWithProtos(prototypeID));
|
||||
return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, message.get());
|
||||
}
|
||||
|
||||
if (!args[0].isObject()) {
|
||||
nsPrintfCString message("Argument 1 of %s.isInstance",
|
||||
NamesOfInterfacesWithProtos(prototypeID));
|
||||
return ThrowErrorMessage(cx, MSG_NOT_OBJECT, message.get());
|
||||
}
|
||||
|
||||
JS::Rooted<JSObject*> instance(cx, &args[0].toObject());
|
||||
|
||||
const DOMJSClass* domClass =
|
||||
GetDOMClass(js::UncheckedUnwrap(instance, /* stopAtWindowProxy = */ false));
|
||||
|
||||
if (domClass && domClass->mInterfaceChain[depth] == prototypeID) {
|
||||
args.rval().setBoolean(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
args.rval().setBoolean(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ReportLenientThisUnwrappingFailure(JSContext* cx, JSObject* obj)
|
||||
{
|
||||
|
|
|
@ -2713,6 +2713,11 @@ InterfaceHasInstance(JSContext* cx, int prototypeID, int depth,
|
|||
JS::Handle<JSObject*> instance,
|
||||
bool* bp);
|
||||
|
||||
// Used to implement the cross-context <Interface>.isInstance static method.
|
||||
bool
|
||||
InterfaceIsInstance(JSContext* cx, unsigned argc, JS::Value* vp,
|
||||
prototypes::ID prototypeID, int depth);
|
||||
|
||||
// Helper for lenient getters/setters to report to console. If this
|
||||
// returns false, we couldn't even get a global.
|
||||
bool
|
||||
|
|
|
@ -1724,7 +1724,6 @@ def addExternalIface(iface, nativeType=None, headerFile=None,
|
|||
addExternalIface('ApplicationCache', nativeType='nsIDOMOfflineResourceList')
|
||||
addExternalIface('Cookie', nativeType='nsICookie2',
|
||||
headerFile='nsICookie2.h', notflattened=True)
|
||||
addExternalIface('Counter')
|
||||
addExternalIface('RTCDataChannel', nativeType='nsIDOMDataChannel')
|
||||
addExternalIface('HitRegionOptions', nativeType='nsISupports')
|
||||
addExternalIface('imgINotificationObserver', nativeType='imgINotificationObserver')
|
||||
|
|
|
@ -1769,6 +1769,23 @@ def JSNativeArguments():
|
|||
Argument('JS::Value*', 'vp')]
|
||||
|
||||
|
||||
class CGIsInstanceMethod(CGAbstractStaticMethod):
|
||||
"""
|
||||
A class for generating the static isInstance method.
|
||||
"""
|
||||
def __init__(self, descriptor):
|
||||
assert descriptor.interface.hasInterfacePrototypeObject()
|
||||
CGAbstractStaticMethod.__init__(self, descriptor, "isInstance", "bool",
|
||||
JSNativeArguments())
|
||||
|
||||
def definition_body(self):
|
||||
return fill(
|
||||
"""
|
||||
return InterfaceIsInstance(cx, argc, vp, prototypes::id::${name},
|
||||
PrototypeTraits<prototypes::id::${name}>::Depth);
|
||||
""",
|
||||
name=self.descriptor.name)
|
||||
|
||||
class CGClassConstructor(CGAbstractStaticMethod):
|
||||
"""
|
||||
JS-visible constructor for our objects
|
||||
|
@ -2416,6 +2433,18 @@ class MethodDefiner(PropertyDefiner):
|
|||
else:
|
||||
self.regular.append(method)
|
||||
|
||||
# Generate the isInstance static method.
|
||||
if (static and
|
||||
(self.descriptor.interface.hasInterfaceObject() and
|
||||
self.descriptor.interface.hasInterfacePrototypeObject())):
|
||||
self.chrome.append({
|
||||
"name": "isInstance",
|
||||
"methodInfo": False,
|
||||
"length": 1,
|
||||
"flags": "JSPROP_ENUMERATE",
|
||||
"condition": MemberCondition(),
|
||||
})
|
||||
|
||||
# TODO: Once iterable is implemented, use tiebreak rules instead of
|
||||
# failing. Also, may be more tiebreak rules to implement once spec bug
|
||||
# is resolved.
|
||||
|
@ -2803,6 +2832,7 @@ class ConstDefiner(PropertyDefiner):
|
|||
|
||||
class PropertyArrays():
|
||||
def __init__(self, descriptor):
|
||||
self.descriptor = descriptor
|
||||
self.staticMethods = MethodDefiner(descriptor, "StaticMethods",
|
||||
static=True)
|
||||
self.staticAttrs = AttrDefiner(descriptor, "StaticAttributes",
|
||||
|
@ -2821,7 +2851,11 @@ class PropertyArrays():
|
|||
"unforgeableMethods", "unforgeableAttrs", "consts"]
|
||||
|
||||
def hasChromeOnly(self):
|
||||
return any(getattr(self, a).hasChromeOnly() for a in self.arrayNames())
|
||||
# All interfaces that generate an interface object and interface
|
||||
# prototype object have a chrome only isInstance static method.
|
||||
return ((self.staticMethods.descriptor.interface.hasInterfaceObject() and
|
||||
self.staticMethods.descriptor.interface.hasInterfacePrototypeObject()) or
|
||||
any(getattr(self, a).hasChromeOnly() for a in self.arrayNames()))
|
||||
|
||||
def hasNonChromeOnly(self):
|
||||
return any(getattr(self, a).hasNonChromeOnly() for a in self.arrayNames())
|
||||
|
@ -12759,6 +12793,9 @@ class CGDescriptor(CGThing):
|
|||
for n in descriptor.interface.namedConstructors:
|
||||
cgThings.append(CGClassConstructor(descriptor, n,
|
||||
NamedConstructorName(n)))
|
||||
if (descriptor.interface.hasInterfaceObject() and
|
||||
descriptor.interface.hasInterfacePrototypeObject()):
|
||||
cgThings.append(CGIsInstanceMethod(descriptor))
|
||||
for m in descriptor.interface.members:
|
||||
if m.isMethod() and m.identifier.name == 'queryInterface':
|
||||
continue
|
||||
|
@ -14279,9 +14316,13 @@ class CGBindingRoot(CGThing):
|
|||
# JS-implemented interfaces with an interface object get a
|
||||
# chromeonly _create method. And interfaces with an
|
||||
# interface object might have a ChromeOnly constructor.
|
||||
# Also interfaces whose interface prototype object is
|
||||
# generated (which is most of them) for the isInstance
|
||||
# method.
|
||||
(desc.interface.hasInterfaceObject() and
|
||||
(desc.interface.isJSImplemented() or
|
||||
(ctor and isChromeOnly(ctor)))) or
|
||||
(ctor and isChromeOnly(ctor)) or
|
||||
desc.interface.hasInterfacePrototypeObject())) or
|
||||
# JS-implemented interfaces with clearable cached
|
||||
# attrs have chromeonly _clearFoo methods.
|
||||
(desc.interface.isJSImplemented() and
|
||||
|
|
|
@ -225,28 +225,28 @@ CreateImageFromRawData(const gfx::IntSize& aSize,
|
|||
}
|
||||
|
||||
// Convert RGBA to BGRA
|
||||
DataSourceSurface::MappedSurface rgbaMap;
|
||||
RefPtr<DataSourceSurface> rgbaDataSurface = rgbaSurface->GetDataSurface();
|
||||
if (NS_WARN_IF(!rgbaDataSurface->Map(DataSourceSurface::MapType::READ, &rgbaMap))) {
|
||||
DataSourceSurface::ScopedMap rgbaMap(rgbaDataSurface, DataSourceSurface::READ);
|
||||
if (NS_WARN_IF(!rgbaMap.IsMapped())) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<DataSourceSurface> bgraDataSurface =
|
||||
Factory::CreateDataSourceSurfaceWithStride(rgbaDataSurface->GetSize(),
|
||||
SurfaceFormat::B8G8R8A8,
|
||||
rgbaMap.mStride);
|
||||
|
||||
DataSourceSurface::MappedSurface bgraMap;
|
||||
if (NS_WARN_IF(!bgraDataSurface->Map(DataSourceSurface::MapType::WRITE, &bgraMap))) {
|
||||
rgbaMap.GetStride());
|
||||
if (NS_WARN_IF(!bgraDataSurface)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SwizzleData(rgbaMap.mData, rgbaMap.mStride, SurfaceFormat::R8G8B8A8,
|
||||
bgraMap.mData, bgraMap.mStride, SurfaceFormat::B8G8R8A8,
|
||||
bgraDataSurface->GetSize());
|
||||
DataSourceSurface::ScopedMap bgraMap(bgraDataSurface, DataSourceSurface::WRITE);
|
||||
if (NS_WARN_IF(!bgraMap.IsMapped())) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
rgbaDataSurface->Unmap();
|
||||
bgraDataSurface->Unmap();
|
||||
SwizzleData(rgbaMap.GetData(), rgbaMap.GetStride(), SurfaceFormat::R8G8B8A8,
|
||||
bgraMap.GetData(), bgraMap.GetStride(), SurfaceFormat::B8G8R8A8,
|
||||
bgraDataSurface->GetSize());
|
||||
|
||||
// Create an Image from the BGRA SourceSurface.
|
||||
RefPtr<layers::Image> image = CreateImageFromSurface(bgraDataSurface);
|
||||
|
@ -481,6 +481,9 @@ ConvertColorFormatIfNeeded(RefPtr<SourceSurface> aSurface)
|
|||
Factory::CreateDataSourceSurfaceWithStride(dstSize,
|
||||
SurfaceFormat::B8G8R8A8,
|
||||
dstStride);
|
||||
if (NS_WARN_IF(!dstDataSurface)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<DataSourceSurface> srcDataSurface = aSurface->GetDataSurface();
|
||||
if (NS_WARN_IF(!srcDataSurface)) {
|
||||
|
@ -1429,7 +1432,9 @@ ImageBitmap::WriteStructuredClone(JSStructuredCloneWriter* aWriter,
|
|||
map.GetStride(),
|
||||
true);
|
||||
}
|
||||
MOZ_ASSERT(dstDataSurface);
|
||||
if (NS_WARN_IF(!dstDataSurface)) {
|
||||
return false;
|
||||
}
|
||||
Factory::CopyDataSourceSurface(snapshot, dstDataSurface);
|
||||
aClonedSurfaces.AppendElement(dstDataSurface);
|
||||
return true;
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "nsIContentInlines.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMStyleSheet.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsIStyleSheetLinkingElement.h"
|
||||
#include "nsIURL.h"
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include "mozilla/dom/HTMLStyleElementBinding.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIDOMStyleSheet.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
|
|
@ -40,11 +40,6 @@ class DOMException;
|
|||
}
|
||||
%}
|
||||
|
||||
// Style Sheets
|
||||
interface nsIDOMStyleSheetList;
|
||||
interface nsIDOMStyleSheet;
|
||||
interface nsIDOMMediaList;
|
||||
|
||||
// Base
|
||||
interface nsIDOMWindow;
|
||||
interface nsIDOMWindowCollection;
|
||||
|
@ -61,20 +56,6 @@ interface nsIDOMHTMLElement;
|
|||
interface nsIDOMHTMLFormElement;
|
||||
interface nsIDOMHTMLHeadElement;
|
||||
|
||||
// CSS
|
||||
interface nsIDOMCSSValue;
|
||||
interface nsIDOMCSSPrimitiveValue;
|
||||
interface nsIDOMCSSRule;
|
||||
interface nsIDOMCSSRuleList;
|
||||
interface nsIDOMCSSKeyframeRule;
|
||||
interface nsIDOMCSSFontFeatureValuesRule;
|
||||
interface nsIDOMCSSStyleSheet;
|
||||
interface nsIDOMCSSStyleDeclaration;
|
||||
interface nsIDOMCounter;
|
||||
interface nsIDOMRect;
|
||||
interface nsIDOMCSSStyleRule;
|
||||
interface nsIDOMCSSStyleRuleCollection;
|
||||
|
||||
// Range
|
||||
interface nsIDOMRange;
|
||||
|
||||
|
|
|
@ -147,10 +147,6 @@ interface nsIDOMDocument : nsIDOMNode
|
|||
|
||||
|
||||
// CSSOM
|
||||
/**
|
||||
* @see <http://dev.w3.org/csswg/cssom/#dom-document-stylesheets>
|
||||
*/
|
||||
readonly attribute nsIDOMStyleSheetList styleSheets;
|
||||
|
||||
/**
|
||||
* This attribute must return the preferred style sheet set as set by the
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# 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
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Core", "DOM: CSS Object Model")
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIDOMCounter.idl',
|
||||
'nsIDOMCSSConditionRule.idl',
|
||||
'nsIDOMCSSCounterStyleRule.idl',
|
||||
'nsIDOMCSSFontFaceRule.idl',
|
||||
'nsIDOMCSSFontFeatureValuesRule.idl',
|
||||
'nsIDOMCSSGroupingRule.idl',
|
||||
'nsIDOMCSSImportRule.idl',
|
||||
'nsIDOMCSSKeyframeRule.idl',
|
||||
'nsIDOMCSSKeyframesRule.idl',
|
||||
'nsIDOMCSSMediaRule.idl',
|
||||
'nsIDOMCSSMozDocumentRule.idl',
|
||||
'nsIDOMCSSPageRule.idl',
|
||||
'nsIDOMCSSPrimitiveValue.idl',
|
||||
'nsIDOMCSSRule.idl',
|
||||
'nsIDOMCSSRuleList.idl',
|
||||
'nsIDOMCSSStyleDeclaration.idl',
|
||||
'nsIDOMCSSStyleRule.idl',
|
||||
'nsIDOMCSSStyleSheet.idl',
|
||||
'nsIDOMCSSSupportsRule.idl',
|
||||
'nsIDOMCSSUnknownRule.idl',
|
||||
'nsIDOMCSSValue.idl',
|
||||
'nsIDOMCSSValueList.idl',
|
||||
'nsIDOMRect.idl',
|
||||
]
|
||||
|
||||
XPIDL_MODULE = 'dom_css'
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsIDOMCSSGroupingRule.idl"
|
||||
|
||||
/**
|
||||
* Interface in the CSS OM for at-rules that conditionally apply their
|
||||
* child rules.
|
||||
*/
|
||||
[scriptable, uuid(44da41b2-5660-415d-8692-eae805776103)]
|
||||
interface nsIDOMCSSConditionRule : nsIDOMCSSGroupingRule
|
||||
{
|
||||
attribute DOMString conditionText;
|
||||
};
|
|
@ -1,23 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[scriptable, uuid(9b5e48ce-d84c-4e31-aff5-34e9f4141313)]
|
||||
interface nsIDOMCSSCounterStyleRule : nsISupports
|
||||
{
|
||||
attribute DOMString name;
|
||||
attribute DOMString system;
|
||||
attribute DOMString symbols;
|
||||
attribute DOMString additiveSymbols;
|
||||
attribute DOMString negative;
|
||||
attribute DOMString prefix;
|
||||
attribute DOMString suffix;
|
||||
attribute DOMString range;
|
||||
attribute DOMString pad;
|
||||
attribute DOMString speakAs;
|
||||
attribute DOMString fallback;
|
||||
};
|
|
@ -1,14 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMCSSStyleDeclaration;
|
||||
|
||||
[scriptable, uuid(db971017-fe0c-4529-972c-8217f2fee217)]
|
||||
interface nsIDOMCSSFontFaceRule : nsISupports
|
||||
{
|
||||
readonly attribute nsIDOMCSSStyleDeclaration style;
|
||||
};
|
|
@ -1,16 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[scriptable, uuid(a343d27f-1da6-4fc3-9355-d4ca434f958e)]
|
||||
interface nsIDOMCSSFontFeatureValuesRule : nsISupports
|
||||
{
|
||||
attribute DOMString fontFamily;
|
||||
// raises(DOMException) on setting
|
||||
|
||||
attribute DOMString valueText;
|
||||
// raises(DOMException) on setting
|
||||
};
|
|
@ -1,23 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMCSSRuleList;
|
||||
|
||||
/**
|
||||
* Interface for at-rules that have child rules in the CSS OM.
|
||||
*/
|
||||
[scriptable, uuid(a0e3324a-f911-4baf-9591-5322c76cbb0d)]
|
||||
interface nsIDOMCSSGroupingRule : nsISupports
|
||||
{
|
||||
readonly attribute nsIDOMCSSRuleList cssRules;
|
||||
|
||||
unsigned long insertRule(in DOMString rule,
|
||||
in unsigned long index)
|
||||
raises(DOMException);
|
||||
void deleteRule(in unsigned long index)
|
||||
raises(DOMException);
|
||||
};
|
|
@ -1,17 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMMediaList;
|
||||
interface nsIDOMCSSStyleSheet;
|
||||
|
||||
[scriptable, uuid(d3b2b914-01ef-4663-beda-a6475a26f491)]
|
||||
interface nsIDOMCSSImportRule : nsISupports
|
||||
{
|
||||
readonly attribute DOMString href;
|
||||
readonly attribute nsIDOMMediaList media;
|
||||
readonly attribute nsIDOMCSSStyleSheet styleSheet;
|
||||
};
|
|
@ -1,15 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMCSSStyleDeclaration;
|
||||
|
||||
[scriptable, uuid(a281a8b4-eaa2-49a8-8b97-acc2814a57c9)]
|
||||
interface nsIDOMCSSKeyframeRule : nsISupports
|
||||
{
|
||||
attribute DOMString keyText;
|
||||
readonly attribute nsIDOMCSSStyleDeclaration style;
|
||||
};
|
|
@ -1,20 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMCSSRuleList;
|
||||
interface nsIDOMCSSKeyframeRule;
|
||||
|
||||
[scriptable, uuid(400f4b70-ad0a-4047-aba4-ee8019f6b907)]
|
||||
interface nsIDOMCSSKeyframesRule : nsISupports
|
||||
{
|
||||
attribute DOMString name;
|
||||
readonly attribute nsIDOMCSSRuleList cssRules;
|
||||
|
||||
void appendRule(in DOMString rule);
|
||||
void deleteRule(in DOMString key);
|
||||
nsIDOMCSSKeyframeRule findRule(in DOMString key);
|
||||
};
|
|
@ -1,17 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsIDOMCSSConditionRule.idl"
|
||||
|
||||
interface nsIDOMMediaList;
|
||||
|
||||
/**
|
||||
* Interface for @media rules in the CSS OM.
|
||||
*/
|
||||
[scriptable, uuid(6cf9c5b2-fa0f-43c0-aa50-ef85b4756e3a)]
|
||||
interface nsIDOMCSSMediaRule : nsIDOMCSSConditionRule
|
||||
{
|
||||
readonly attribute nsIDOMMediaList media;
|
||||
};
|
|
@ -1,15 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsIDOMCSSConditionRule.idl"
|
||||
|
||||
/**
|
||||
* Interface for @-moz-document rules in the CSS OM.
|
||||
*/
|
||||
[scriptable, uuid(2d0cef9d-c1b2-4c6c-9003-fa83040626d1)]
|
||||
interface nsIDOMCSSMozDocumentRule : nsIDOMCSSConditionRule
|
||||
{
|
||||
// XXX Add access to the URL list.
|
||||
};
|
|
@ -1,17 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMCSSStyleDeclaration;
|
||||
|
||||
[scriptable, uuid(c119072b-7d2f-4aeb-a90d-e2d6b606c32a)]
|
||||
interface nsIDOMCSSPageRule : nsISupports
|
||||
{
|
||||
//attribute DOMString selectorText;
|
||||
// raises(DOMException) on setting
|
||||
|
||||
readonly attribute nsIDOMCSSStyleDeclaration style;
|
||||
};
|
|
@ -1,62 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsIDOMCSSValue.idl"
|
||||
|
||||
/**
|
||||
* The nsIDOMCSSPrimitiveValue interface is a datatype for a primitive
|
||||
* CSS value in the Document Object Model.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Style
|
||||
*/
|
||||
|
||||
[uuid(f6df7293-2dc9-4cb9-9531-778caf4370e0)]
|
||||
interface nsIDOMCSSPrimitiveValue : nsIDOMCSSValue
|
||||
{
|
||||
// UnitTypes
|
||||
const unsigned short CSS_UNKNOWN = 0;
|
||||
const unsigned short CSS_NUMBER = 1;
|
||||
const unsigned short CSS_PERCENTAGE = 2;
|
||||
const unsigned short CSS_EMS = 3;
|
||||
const unsigned short CSS_EXS = 4;
|
||||
const unsigned short CSS_PX = 5;
|
||||
const unsigned short CSS_CM = 6;
|
||||
const unsigned short CSS_MM = 7;
|
||||
const unsigned short CSS_IN = 8;
|
||||
const unsigned short CSS_PT = 9;
|
||||
const unsigned short CSS_PC = 10;
|
||||
const unsigned short CSS_DEG = 11;
|
||||
const unsigned short CSS_RAD = 12;
|
||||
const unsigned short CSS_GRAD = 13;
|
||||
const unsigned short CSS_MS = 14;
|
||||
const unsigned short CSS_S = 15;
|
||||
const unsigned short CSS_HZ = 16;
|
||||
const unsigned short CSS_KHZ = 17;
|
||||
const unsigned short CSS_DIMENSION = 18;
|
||||
const unsigned short CSS_STRING = 19;
|
||||
const unsigned short CSS_URI = 20;
|
||||
const unsigned short CSS_IDENT = 21;
|
||||
const unsigned short CSS_ATTR = 22;
|
||||
const unsigned short CSS_COUNTER = 23;
|
||||
const unsigned short CSS_RECT = 24;
|
||||
const unsigned short CSS_RGBCOLOR = 25;
|
||||
|
||||
readonly attribute unsigned short primitiveType;
|
||||
void setFloatValue(in unsigned short unitType,
|
||||
in float floatValue)
|
||||
raises(DOMException);
|
||||
float getFloatValue(in unsigned short unitType)
|
||||
raises(DOMException);
|
||||
void setStringValue(in unsigned short stringType,
|
||||
in DOMString stringValue)
|
||||
raises(DOMException);
|
||||
DOMString getStringValue()
|
||||
raises(DOMException);
|
||||
nsIDOMCounter getCounterValue()
|
||||
raises(DOMException);
|
||||
nsIDOMRect getRectValue()
|
||||
raises(DOMException);
|
||||
};
|
|
@ -1,57 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
%{C++
|
||||
namespace mozilla {
|
||||
namespace css {
|
||||
class Rule;
|
||||
}
|
||||
}
|
||||
%}
|
||||
|
||||
[ptr] native Rule(mozilla::css::Rule);
|
||||
|
||||
/**
|
||||
* The nsIDOMCSSRule interface is a datatype for a CSS style rule in
|
||||
* the Document Object Model.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Style
|
||||
*/
|
||||
|
||||
[scriptable, uuid(4d6b3bad-f53c-4585-82f6-62982e27ede8)]
|
||||
interface nsIDOMCSSRule : nsISupports
|
||||
{
|
||||
// RuleType
|
||||
const unsigned short UNKNOWN_RULE = 0;
|
||||
const unsigned short STYLE_RULE = 1;
|
||||
const unsigned short CHARSET_RULE = 2;
|
||||
const unsigned short IMPORT_RULE = 3;
|
||||
const unsigned short MEDIA_RULE = 4;
|
||||
const unsigned short FONT_FACE_RULE = 5;
|
||||
const unsigned short PAGE_RULE = 6;
|
||||
const unsigned short KEYFRAMES_RULE = 7;
|
||||
const unsigned short KEYFRAME_RULE = 8;
|
||||
// When layout.css.prefixes.animations is disabled/removed,
|
||||
// we should remove these two MOZ_* constants.
|
||||
const unsigned short MOZ_KEYFRAMES_RULE = 7;
|
||||
const unsigned short MOZ_KEYFRAME_RULE = 8;
|
||||
const unsigned short NAMESPACE_RULE = 10;
|
||||
const unsigned short COUNTER_STYLE_RULE = 11;
|
||||
const unsigned short SUPPORTS_RULE = 12;
|
||||
const unsigned short DOCUMENT_RULE = 13;
|
||||
const unsigned short FONT_FEATURE_VALUES_RULE = 14;
|
||||
|
||||
readonly attribute unsigned short type;
|
||||
attribute DOMString cssText;
|
||||
// raises(DOMException) on setting
|
||||
|
||||
readonly attribute nsIDOMCSSStyleSheet parentStyleSheet;
|
||||
readonly attribute nsIDOMCSSRule parentRule;
|
||||
|
||||
[noscript, nostdcall, notxpcom] Rule getCSSRule();
|
||||
};
|
|
@ -1,21 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
/**
|
||||
* The nsIDOMCSSRuleList interface is a datatype for a list of CSS
|
||||
* style rules in the Document Object Model.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Style
|
||||
*/
|
||||
|
||||
[scriptable, uuid(a6cf90c0-15b3-11d2-932e-00805f8add32)]
|
||||
interface nsIDOMCSSRuleList : nsISupports
|
||||
{
|
||||
readonly attribute unsigned long length;
|
||||
nsIDOMCSSRule item(in unsigned long index);
|
||||
};
|
|
@ -1,44 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
/**
|
||||
* The nsIDOMCSSStyleDeclaration interface is a datatype for a CSS
|
||||
* style declaration in the Document Object Model.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Style
|
||||
*/
|
||||
|
||||
interface nsIPrincipal;
|
||||
|
||||
[uuid(a6cf90be-15b3-11d2-932e-00805f8add32)]
|
||||
interface nsIDOMCSSStyleDeclaration : nsISupports
|
||||
{
|
||||
// We declare these in C++, so that we can declare default argument values,
|
||||
// since those are unsupported by XPIDL and this is not a scriptable
|
||||
// interface.
|
||||
%{C++
|
||||
NS_IMETHOD GetCssText(nsAString& aCssText) = 0;
|
||||
NS_IMETHOD SetCssText(const nsAString& aCssText,
|
||||
nsIPrincipal* aSubjectPrincipal = nullptr) = 0;
|
||||
|
||||
NS_IMETHOD SetProperty(const nsAString& aPropertyName,
|
||||
const nsAString& aValue,
|
||||
const nsAString& aPriority,
|
||||
nsIPrincipal* aSubjectPrincipal = nullptr) = 0;
|
||||
%}
|
||||
|
||||
DOMString getPropertyValue(in DOMString propertyName);
|
||||
nsIDOMCSSValue getPropertyCSSValue(in DOMString propertyName);
|
||||
DOMString removeProperty(in DOMString propertyName)
|
||||
raises(DOMException);
|
||||
DOMString getPropertyPriority(in DOMString propertyName);
|
||||
|
||||
readonly attribute unsigned long length;
|
||||
DOMString item(in unsigned long index);
|
||||
readonly attribute nsIDOMCSSRule parentRule;
|
||||
};
|
|
@ -1,17 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMCSSStyleDeclaration;
|
||||
|
||||
[scriptable, uuid(b5e9af48-a7c2-4f88-aae3-58307af4b5a5)]
|
||||
interface nsIDOMCSSStyleRule : nsISupports
|
||||
{
|
||||
attribute DOMString selectorText;
|
||||
// raises(DOMException) on setting
|
||||
|
||||
readonly attribute nsIDOMCSSStyleDeclaration style;
|
||||
};
|
|
@ -1,27 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsIDOMStyleSheet.idl"
|
||||
|
||||
/**
|
||||
* The nsIDOMCSSStyleSheet interface is a datatype for a CSS style
|
||||
* sheet in the Document Object Model.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Style
|
||||
*/
|
||||
|
||||
[uuid(a6cf90c2-15b3-11d2-932e-00805f8add32)]
|
||||
interface nsIDOMCSSStyleSheet : nsIDOMStyleSheet
|
||||
{
|
||||
readonly attribute nsIDOMCSSRule ownerRule;
|
||||
readonly attribute nsIDOMCSSRuleList cssRules;
|
||||
|
||||
unsigned long insertRule(in DOMString rule,
|
||||
in unsigned long index)
|
||||
raises(DOMException);
|
||||
void deleteRule(in unsigned long index)
|
||||
raises(DOMException);
|
||||
};
|
|
@ -1,14 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsIDOMCSSConditionRule.idl"
|
||||
|
||||
/**
|
||||
* Interface for @supports rules in the CSS OM.
|
||||
*/
|
||||
[scriptable, uuid(0b9e63a1-1bd7-4caf-850e-148b762b14d2)]
|
||||
interface nsIDOMCSSSupportsRule : nsIDOMCSSConditionRule
|
||||
{
|
||||
};
|
|
@ -1,11 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[scriptable, uuid(98f4c27b-fb35-4355-8fd9-546c4697d71a)]
|
||||
interface nsIDOMCSSUnknownRule : nsISupports
|
||||
{
|
||||
};
|
|
@ -1,29 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
/**
|
||||
* The nsIDOMCSSValue interface is a datatype for a CSS value in the
|
||||
* Document Object Model.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Style
|
||||
*/
|
||||
|
||||
[uuid(009f7ea5-9e80-41be-b008-db62f10823f2)]
|
||||
interface nsIDOMCSSValue : nsISupports
|
||||
{
|
||||
// UnitTypes
|
||||
const unsigned short CSS_INHERIT = 0;
|
||||
const unsigned short CSS_PRIMITIVE_VALUE = 1;
|
||||
const unsigned short CSS_VALUE_LIST = 2;
|
||||
const unsigned short CSS_CUSTOM = 3;
|
||||
|
||||
attribute DOMString cssText;
|
||||
// raises(DOMException) on setting
|
||||
|
||||
readonly attribute unsigned short cssValueType;
|
||||
};
|
|
@ -1,12 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "domstubs.idl"
|
||||
#include "nsIDOMCSSValue.idl"
|
||||
|
||||
[uuid(92364ed1-e364-4175-bc52-c2fe9671cbc7)]
|
||||
interface nsIDOMCSSValueList : nsIDOMCSSValue
|
||||
{
|
||||
};
|
|
@ -1,14 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
[scriptable, uuid(31adb439-0055-402d-9b1d-d5ca94f3f55b)]
|
||||
interface nsIDOMCounter : nsISupports
|
||||
{
|
||||
readonly attribute DOMString identifier;
|
||||
readonly attribute DOMString listStyle;
|
||||
readonly attribute DOMString separator;
|
||||
};
|
|
@ -1,15 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
[uuid(71735f62-ac5c-4236-9a1f-5ffb280d531c)]
|
||||
interface nsIDOMRect : nsISupports
|
||||
{
|
||||
readonly attribute nsIDOMCSSPrimitiveValue top;
|
||||
readonly attribute nsIDOMCSSPrimitiveValue right;
|
||||
readonly attribute nsIDOMCSSPrimitiveValue bottom;
|
||||
readonly attribute nsIDOMCSSPrimitiveValue left;
|
||||
};
|
|
@ -1,17 +0,0 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# 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
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Core", "DOM: CSS Object Model")
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIDOMMediaList.idl',
|
||||
'nsIDOMStyleSheet.idl',
|
||||
'nsIDOMStyleSheetList.idl',
|
||||
]
|
||||
|
||||
XPIDL_MODULE = 'dom_stylesheets'
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
/**
|
||||
* The nsIDOMMediaList interface is a datatype for a list of media
|
||||
* types in the Document Object Model.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Style
|
||||
*/
|
||||
|
||||
[uuid(9b0c2ed7-111c-4824-adf9-ef0da6dad371)]
|
||||
interface nsIDOMMediaList : nsISupports
|
||||
{
|
||||
attribute DOMString mediaText;
|
||||
// raises(DOMException) on setting
|
||||
|
||||
readonly attribute unsigned long length;
|
||||
DOMString item(in unsigned long index);
|
||||
void deleteMedium(in DOMString oldMedium)
|
||||
raises(DOMException);
|
||||
void appendMedium(in DOMString newMedium)
|
||||
raises(DOMException);
|
||||
};
|
|
@ -1,26 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
/**
|
||||
* The nsIDOMStyleSheet interface is a datatype for a style sheet in
|
||||
* the Document Object Model.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Style
|
||||
*/
|
||||
|
||||
[uuid(a6cf9080-15b3-11d2-932e-00805f8add32)]
|
||||
interface nsIDOMStyleSheet : nsISupports
|
||||
{
|
||||
readonly attribute DOMString type;
|
||||
attribute boolean disabled;
|
||||
readonly attribute nsIDOMNode ownerNode;
|
||||
readonly attribute nsIDOMStyleSheet parentStyleSheet;
|
||||
readonly attribute DOMString href;
|
||||
readonly attribute DOMString title;
|
||||
readonly attribute nsIDOMMediaList media;
|
||||
};
|
|
@ -1,22 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
/**
|
||||
* The nsIDOMStyleSheetList interface is a datatype for a style sheet
|
||||
* list in the Document Object Model.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Style
|
||||
*/
|
||||
|
||||
[uuid(0e424250-ac2a-4fe2-bccd-a45824af090e)]
|
||||
interface nsIDOMStyleSheetList : nsISupports
|
||||
{
|
||||
readonly attribute unsigned long length;
|
||||
[binaryname(SlowItem)]
|
||||
nsIDOMStyleSheet item(in unsigned long index);
|
||||
};
|
|
@ -5,10 +5,6 @@
|
|||
|
||||
#include "nsIDOMElement.idl"
|
||||
|
||||
interface nsIDOMCSSStyleDeclaration;
|
||||
interface nsIDOMCSSValue;
|
||||
|
||||
|
||||
[uuid(c63517c5-8bab-4cd1-8694-bccafc32a195)]
|
||||
interface nsIDOMSVGElement : nsIDOMElement
|
||||
{
|
||||
|
@ -18,5 +14,4 @@ interface nsIDOMSVGElement : nsIDOMElement
|
|||
|
||||
[binaryname(SVGClassName)]
|
||||
readonly attribute nsISupports className;
|
||||
readonly attribute nsIDOMCSSStyleDeclaration style;
|
||||
};
|
||||
|
|
|
@ -19,9 +19,7 @@ interfaces = [
|
|||
'core',
|
||||
'html',
|
||||
'events',
|
||||
'stylesheets',
|
||||
'sidebar',
|
||||
'css',
|
||||
'traversal',
|
||||
'range',
|
||||
'xbl',
|
||||
|
|
|
@ -116,13 +116,6 @@ nsSVGElement::GetSVGClassName(nsISupports** aClassName)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGElement::GetStyle(nsIDOMCSSStyleDeclaration** aStyle)
|
||||
{
|
||||
NS_ADDREF(*aStyle = Style());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsSVGElement methods
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ support-files =
|
|||
tags = fullscreen
|
||||
[test_bug799299.xul]
|
||||
[test_bug800817.xul]
|
||||
[test_bug830396.xul]
|
||||
[test_bug830858.xul]
|
||||
[test_bug1224790-1.xul]
|
||||
tags = openwindow
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
||||
type="text/css"?>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=830396
|
||||
-->
|
||||
<window title="Mozilla Bug 830396"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
|
||||
<script class="testbody" type="application/javascript">
|
||||
<![CDATA[
|
||||
|
||||
function runTests()
|
||||
{
|
||||
var doc = frames[0].document;
|
||||
var cs = doc.defaultView.getComputedStyle(doc.body);
|
||||
var nsIDOMCSSValueList = Components.interfaces.nsIDOMCSSValueList;
|
||||
ok(cs.getPropertyCSSValue("cursor") instanceof nsIDOMCSSValueList,
|
||||
"CSSValueList should be a nsIDOMCSSValueList");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
]]>
|
||||
</script>
|
||||
<body onload="runTests();" xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=830396">Mozilla Bug 830396</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
<iframe type="content"></iframe>
|
||||
</body>
|
||||
|
||||
|
||||
</window>
|
|
@ -4,8 +4,6 @@
|
|||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
interface Counter;
|
||||
|
||||
interface CSSPrimitiveValue : CSSValue {
|
||||
|
||||
// UnitTypes
|
||||
|
@ -48,7 +46,7 @@ interface CSSPrimitiveValue : CSSValue {
|
|||
[Throws]
|
||||
DOMString getStringValue();
|
||||
[Throws]
|
||||
Counter getCounterValue();
|
||||
void getCounterValue(); // always throws
|
||||
[Throws]
|
||||
Rect getRectValue();
|
||||
[Throws]
|
||||
|
|
|
@ -46,6 +46,12 @@ partial interface CSSRule {
|
|||
const unsigned short SUPPORTS_RULE = 12;
|
||||
};
|
||||
|
||||
// Non-standard extension for @-moz-document rules.
|
||||
partial interface CSSRule {
|
||||
[ChromeOnly]
|
||||
const unsigned short DOCUMENT_RULE = 13;
|
||||
};
|
||||
|
||||
// https://drafts.csswg.org/css-fonts-3/#om-fontfeaturevalues
|
||||
partial interface CSSRule {
|
||||
const unsigned short FONT_FEATURE_VALUES_RULE = 14;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
interface StyleSheet {
|
||||
[Constant]
|
||||
readonly attribute DOMString type;
|
||||
[Constant]
|
||||
[Constant, Throws]
|
||||
readonly attribute DOMString? href;
|
||||
// Spec says "Node", but it can go null when the node gets a new
|
||||
// sheet. That's also why it's not [Constant]
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
#include "XULDocument.h"
|
||||
#include "nsXULPopupListener.h"
|
||||
#include "nsRuleWalker.h"
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsCSSParser.h"
|
||||
#include "ListBoxObject.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "nsGkAtoms.h"
|
||||
#include "nsAtom.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsICSSDeclaration.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIDocument.h"
|
||||
|
@ -1268,7 +1268,7 @@ CSSEditUtils::ElementsSameStyle(Element* aFirstElement,
|
|||
return false;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMCSSStyleDeclaration> firstCSSDecl, secondCSSDecl;
|
||||
nsCOMPtr<nsICSSDeclaration> firstCSSDecl, secondCSSDecl;
|
||||
uint32_t firstLength, secondLength;
|
||||
nsresult rv = GetInlineStyles(aFirstElement, getter_AddRefs(firstCSSDecl), &firstLength);
|
||||
if (NS_FAILED(rv) || !firstCSSDecl) {
|
||||
|
@ -1313,7 +1313,7 @@ CSSEditUtils::ElementsSameStyle(Element* aFirstElement,
|
|||
|
||||
nsresult
|
||||
CSSEditUtils::GetInlineStyles(Element* aElement,
|
||||
nsIDOMCSSStyleDeclaration** aCssDecl,
|
||||
nsICSSDeclaration** aCssDecl,
|
||||
uint32_t* aLength)
|
||||
{
|
||||
NS_ENSURE_TRUE(aElement && aLength, NS_ERROR_NULL_POINTER);
|
||||
|
@ -1321,8 +1321,7 @@ CSSEditUtils::GetInlineStyles(Element* aElement,
|
|||
nsCOMPtr<nsStyledElement> inlineStyles = do_QueryInterface(aElement);
|
||||
NS_ENSURE_TRUE(inlineStyles, NS_ERROR_NULL_POINTER);
|
||||
|
||||
nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl =
|
||||
do_QueryInterface(inlineStyles->Style());
|
||||
nsCOMPtr<nsICSSDeclaration> cssDecl = inlineStyles->Style();
|
||||
MOZ_ASSERT(cssDecl);
|
||||
|
||||
cssDecl.forget(aCssDecl);
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
class nsComputedDOMStyle;
|
||||
class nsAtom;
|
||||
class nsIContent;
|
||||
class nsIDOMCSSStyleDeclaration;
|
||||
class nsICSSDeclaration;
|
||||
class nsIDOMNode;
|
||||
class nsINode;
|
||||
|
||||
|
@ -324,7 +324,7 @@ public:
|
|||
* @param aLength [OUT] The number of declarations in aCssDecl.
|
||||
*/
|
||||
nsresult GetInlineStyles(dom::Element* aElement,
|
||||
nsIDOMCSSStyleDeclaration** aCssDecl,
|
||||
nsICSSDeclaration** aCssDecl,
|
||||
uint32_t* aLength);
|
||||
|
||||
public:
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "mozilla/EditorUtils.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/TextEditRules.h"
|
||||
#include "mozilla/dom/CSSPrimitiveValueBinding.h"
|
||||
#include "mozilla/dom/Selection.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/mozalloc.h"
|
||||
|
@ -25,7 +26,6 @@
|
|||
#include "nsGkAtoms.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsROCSSPrimitiveValue.h"
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
|
@ -681,17 +681,17 @@ HTMLEditor::CheckPositionedElementBGandFG(nsIDOMElement* aElement,
|
|||
nsROCSSPrimitiveValue* val = cssVal->AsPrimitiveValue();
|
||||
NS_ENSURE_TRUE(val, NS_ERROR_FAILURE);
|
||||
|
||||
if (nsIDOMCSSPrimitiveValue::CSS_RGBCOLOR == val->PrimitiveType()) {
|
||||
if (CSSPrimitiveValueBinding::CSS_RGBCOLOR == val->PrimitiveType()) {
|
||||
nsDOMCSSRGBColor* rgbVal = val->GetRGBColorValue(error);
|
||||
NS_ENSURE_TRUE(!error.Failed(), error.StealNSResult());
|
||||
float r = rgbVal->Red()->
|
||||
GetFloatValue(nsIDOMCSSPrimitiveValue::CSS_NUMBER, error);
|
||||
GetFloatValue(CSSPrimitiveValueBinding::CSS_NUMBER, error);
|
||||
NS_ENSURE_TRUE(!error.Failed(), error.StealNSResult());
|
||||
float g = rgbVal->Green()->
|
||||
GetFloatValue(nsIDOMCSSPrimitiveValue::CSS_NUMBER, error);
|
||||
GetFloatValue(CSSPrimitiveValueBinding::CSS_NUMBER, error);
|
||||
NS_ENSURE_TRUE(!error.Failed(), error.StealNSResult());
|
||||
float b = rgbVal->Blue()->
|
||||
GetFloatValue(nsIDOMCSSPrimitiveValue::CSS_NUMBER, error);
|
||||
GetFloatValue(CSSPrimitiveValueBinding::CSS_NUMBER, error);
|
||||
NS_ENSURE_TRUE(!error.Failed(), error.StealNSResult());
|
||||
if (r >= BLACK_BG_RGB_TRIGGER &&
|
||||
g >= BLACK_BG_RGB_TRIGGER &&
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "mozilla/HTMLEditor.h"
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/CSSPrimitiveValueBinding.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/mozalloc.h"
|
||||
#include "nsAString.h"
|
||||
|
@ -16,9 +17,6 @@
|
|||
#include "nsAtom.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsID.h"
|
||||
#include "nsIDOMCSSPrimitiveValue.h"
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsIDOMCSSValue.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
|
@ -42,6 +40,7 @@
|
|||
#include "nsUnicharUtils.h"
|
||||
#include "nscore.h"
|
||||
#include "nsContentUtils.h" // for nsAutoScriptBlocker
|
||||
#include "nsROCSSPrimitiveValue.h"
|
||||
|
||||
class nsIDOMEventListener;
|
||||
class nsISelection;
|
||||
|
@ -51,36 +50,40 @@ namespace mozilla {
|
|||
using namespace dom;
|
||||
|
||||
// retrieve an integer stored into a CSS computed float value
|
||||
static int32_t GetCSSFloatValue(nsIDOMCSSStyleDeclaration * aDecl,
|
||||
const nsAString & aProperty)
|
||||
static int32_t GetCSSFloatValue(nsComputedDOMStyle* aComputedStyle,
|
||||
const nsAString& aProperty)
|
||||
{
|
||||
MOZ_ASSERT(aDecl);
|
||||
MOZ_ASSERT(aComputedStyle);
|
||||
|
||||
nsCOMPtr<nsIDOMCSSValue> value;
|
||||
// get the computed CSSValue of the property
|
||||
nsresult rv = aDecl->GetPropertyCSSValue(aProperty, getter_AddRefs(value));
|
||||
if (NS_FAILED(rv) || !value) {
|
||||
ErrorResult rv;
|
||||
RefPtr<CSSValue> value = aComputedStyle->GetPropertyCSSValue(aProperty, rv);
|
||||
if (rv.Failed() || !value) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// check the type of the returned CSSValue; we handle here only
|
||||
// pixel and enum types
|
||||
nsCOMPtr<nsIDOMCSSPrimitiveValue> val = do_QueryInterface(value);
|
||||
uint16_t type;
|
||||
val->GetPrimitiveType(&type);
|
||||
RefPtr<nsROCSSPrimitiveValue> val = value->AsPrimitiveValue();
|
||||
uint16_t type = val->PrimitiveType();
|
||||
|
||||
float f = 0;
|
||||
switch (type) {
|
||||
case nsIDOMCSSPrimitiveValue::CSS_PX:
|
||||
case CSSPrimitiveValueBinding::CSS_PX:
|
||||
// the value is in pixels, just get it
|
||||
rv = val->GetFloatValue(nsIDOMCSSPrimitiveValue::CSS_PX, &f);
|
||||
NS_ENSURE_SUCCESS(rv, 0);
|
||||
f = val->GetFloatValue(CSSPrimitiveValueBinding::CSS_PX, rv);
|
||||
if (rv.Failed()) {
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case nsIDOMCSSPrimitiveValue::CSS_IDENT: {
|
||||
case CSSPrimitiveValueBinding::CSS_IDENT: {
|
||||
// the value is keyword, we have to map these keywords into
|
||||
// numeric values
|
||||
nsAutoString str;
|
||||
val->GetStringValue(str);
|
||||
val->GetStringValue(str, rv);
|
||||
if (rv.Failed()) {
|
||||
return 0;
|
||||
}
|
||||
if (str.EqualsLiteral("thin")) {
|
||||
f = 1;
|
||||
} else if (str.EqualsLiteral("medium")) {
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "nsIInlineSpellChecker.h"
|
||||
|
||||
#include "mozilla/css/Loader.h"
|
||||
#include "nsIDOMStyleSheet.h"
|
||||
|
||||
#include "nsIContent.h"
|
||||
#include "nsIContentIterator.h"
|
||||
|
@ -2894,7 +2893,8 @@ HTMLEditor::EnableStyleSheet(const nsAString& aURL,
|
|||
nsCOMPtr<nsIDocument> document = GetDocument();
|
||||
sheet->SetAssociatedDocument(document, StyleSheet::NotOwnedByDocument);
|
||||
|
||||
return sheet->SetDisabled(!aEnable);
|
||||
sheet->SetDisabled(!aEnable);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "nsDebug.h"
|
||||
#include "nsAtom.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMRange.h"
|
||||
#include "nsIEditor.h"
|
||||
|
|
11
gfx/2d/2D.h
11
gfx/2d/2D.h
|
@ -378,6 +378,17 @@ public:
|
|||
*/
|
||||
virtual bool IsValid() const { return true; }
|
||||
|
||||
/**
|
||||
* This returns true if it is the same underlying surface data, even if
|
||||
* the objects are different (e.g. indirection due to
|
||||
* DataSourceSurfaceWrapper).
|
||||
*/
|
||||
virtual bool Equals(SourceSurface* aOther, bool aSymmetric = true)
|
||||
{
|
||||
return this == aOther ||
|
||||
(aSymmetric && aOther && aOther->Equals(this, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will return true if the surface type matches that of a
|
||||
* DataSourceSurface and if GetDataSurface will return the same object.
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace gfx {
|
|||
|
||||
// Wraps a DataSourceSurface and forwards all methods except for GetType(),
|
||||
// from which it always returns SurfaceType::DATA.
|
||||
class DataSourceSurfaceWrapper : public DataSourceSurface
|
||||
class DataSourceSurfaceWrapper final : public DataSourceSurface
|
||||
{
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurfaceWrapper, override)
|
||||
|
@ -22,6 +22,12 @@ public:
|
|||
: mSurface(aSurface)
|
||||
{}
|
||||
|
||||
bool Equals(SourceSurface* aOther, bool aSymmetric = true) override
|
||||
{
|
||||
return DataSourceSurface::Equals(aOther, aSymmetric) ||
|
||||
mSurface->Equals(aOther, aSymmetric);
|
||||
}
|
||||
|
||||
virtual SurfaceType GetType() const override { return SurfaceType::DATA; }
|
||||
|
||||
virtual uint8_t *GetData() override { return mSurface->GetData(); }
|
||||
|
@ -30,6 +36,13 @@ public:
|
|||
virtual SurfaceFormat GetFormat() const override { return mSurface->GetFormat(); }
|
||||
virtual bool IsValid() const override { return mSurface->IsValid(); }
|
||||
|
||||
bool Map(MapType aType, MappedSurface *aMappedSurface) override
|
||||
{
|
||||
return mSurface->Map(aType, aMappedSurface);
|
||||
}
|
||||
|
||||
void Unmap() override { mSurface->Unmap(); }
|
||||
|
||||
private:
|
||||
RefPtr<DataSourceSurface> mSurface;
|
||||
};
|
||||
|
|
|
@ -203,6 +203,10 @@ public:
|
|||
virtual already_AddRefed<DataSourceSurface> GetDataSurface()
|
||||
{
|
||||
RefPtr<DataSourceSurface> surf = Factory::CreateDataSourceSurface(GetSize(), GetFormat());
|
||||
if (!surf) {
|
||||
gfxCriticalError() << "DrawTargetTiled::GetDataSurface failed to allocate surface";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
DataSourceSurface::MappedSurface mappedSurf;
|
||||
if (!surf->Map(DataSourceSurface::MapType::WRITE, &mappedSurf)) {
|
||||
|
|
|
@ -17,9 +17,13 @@ inline already_AddRefed<DataSourceSurface>
|
|||
ConvertToB8G8R8A8_SIMD(SourceSurface* aSurface)
|
||||
{
|
||||
IntSize size = aSurface->GetSize();
|
||||
RefPtr<DataSourceSurface> input = aSurface->GetDataSurface();
|
||||
RefPtr<DataSourceSurface> output =
|
||||
Factory::CreateDataSourceSurface(size, SurfaceFormat::B8G8R8A8);
|
||||
if (!output) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<DataSourceSurface> input = aSurface->GetDataSurface();
|
||||
DataSourceSurface::ScopedMap inputMap(input, DataSourceSurface::READ);
|
||||
DataSourceSurface::ScopedMap outputMap(output, DataSourceSurface::READ_WRITE);
|
||||
uint8_t *inputData = inputMap.GetData();
|
||||
|
@ -287,29 +291,21 @@ ShuffleAndPackComponents(i32x4_t bbbb1234, i32x4_t gggg1234,
|
|||
}
|
||||
|
||||
template<typename i32x4_t, typename i16x8_t, typename u8x16_t, BlendMode mode>
|
||||
inline already_AddRefed<DataSourceSurface>
|
||||
ApplyBlending_SIMD(DataSourceSurface* aInput1, DataSourceSurface* aInput2)
|
||||
inline void
|
||||
ApplyBlending_SIMD(const DataSourceSurface::ScopedMap& aInputMap1,
|
||||
const DataSourceSurface::ScopedMap& aInputMap2,
|
||||
const DataSourceSurface::ScopedMap& aOutputMap,
|
||||
const IntSize& aSize)
|
||||
{
|
||||
IntSize size = aInput1->GetSize();
|
||||
RefPtr<DataSourceSurface> target =
|
||||
Factory::CreateDataSourceSurface(size, SurfaceFormat::B8G8R8A8);
|
||||
if (!target) {
|
||||
return nullptr;
|
||||
}
|
||||
uint8_t* source1Data = aInputMap1.GetData();
|
||||
uint8_t* source2Data = aInputMap2.GetData();
|
||||
uint8_t* targetData = aOutputMap.GetData();
|
||||
int32_t targetStride = aOutputMap.GetStride();
|
||||
int32_t source1Stride = aInputMap1.GetStride();
|
||||
int32_t source2Stride = aInputMap2.GetStride();
|
||||
|
||||
DataSourceSurface::ScopedMap inputMap1(aInput1, DataSourceSurface::READ);
|
||||
DataSourceSurface::ScopedMap inputMap2(aInput2, DataSourceSurface::READ);
|
||||
DataSourceSurface::ScopedMap outputMap(target, DataSourceSurface::READ_WRITE);
|
||||
|
||||
uint8_t* source1Data = inputMap1.GetData();
|
||||
uint8_t* source2Data = inputMap2.GetData();
|
||||
uint8_t* targetData = outputMap.GetData();
|
||||
int32_t targetStride = outputMap.GetStride();
|
||||
int32_t source1Stride = inputMap1.GetStride();
|
||||
int32_t source2Stride = inputMap2.GetStride();
|
||||
|
||||
for (int32_t y = 0; y < size.height; y++) {
|
||||
for (int32_t x = 0; x < size.width; x += 4) {
|
||||
for (int32_t y = 0; y < aSize.height; y++) {
|
||||
for (int32_t x = 0; x < aSize.width; x += 4) {
|
||||
int32_t targetIndex = y * targetStride + 4 * x;
|
||||
int32_t source1Index = y * source1Stride + 4 * x;
|
||||
int32_t source2Index = y * source2Stride + 4 * x;
|
||||
|
@ -340,6 +336,27 @@ ApplyBlending_SIMD(DataSourceSurface* aInput1, DataSourceSurface* aInput2)
|
|||
simd::Store8(&targetData[targetIndex], result1234);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template<typename i32x4_t, typename i16x8_t, typename u8x16_t, BlendMode mode>
|
||||
inline already_AddRefed<DataSourceSurface>
|
||||
ApplyBlending_SIMD(DataSourceSurface* aInput1, DataSourceSurface* aInput2)
|
||||
{
|
||||
IntSize size = aInput1->GetSize();
|
||||
RefPtr<DataSourceSurface> target =
|
||||
Factory::CreateDataSourceSurface(size, SurfaceFormat::B8G8R8A8);
|
||||
if (!target) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
DataSourceSurface::ScopedMap inputMap1(aInput1, DataSourceSurface::READ);
|
||||
DataSourceSurface::ScopedMap outputMap(target, DataSourceSurface::READ_WRITE);
|
||||
if (aInput1->Equals(aInput2)) {
|
||||
ApplyBlending_SIMD<i32x4_t,i16x8_t,u8x16_t,mode>(inputMap1, inputMap1, outputMap, size);
|
||||
} else {
|
||||
DataSourceSurface::ScopedMap inputMap2(aInput2, DataSourceSurface::READ);
|
||||
ApplyBlending_SIMD<i32x4_t,i16x8_t,u8x16_t,mode>(inputMap1, inputMap2, outputMap, size);
|
||||
}
|
||||
|
||||
return target.forget();
|
||||
}
|
||||
|
@ -1026,27 +1043,19 @@ ArithmeticCombineTwoPixels(i16x8_t in1, i16x8_t in2,
|
|||
}
|
||||
|
||||
template<typename i32x4_t, typename i16x8_t, typename u8x16_t>
|
||||
static already_AddRefed<DataSourceSurface>
|
||||
ApplyArithmeticCombine_SIMD(DataSourceSurface* aInput1, DataSourceSurface* aInput2,
|
||||
static void
|
||||
ApplyArithmeticCombine_SIMD(const DataSourceSurface::ScopedMap& aInputMap1,
|
||||
const DataSourceSurface::ScopedMap& aInputMap2,
|
||||
const DataSourceSurface::ScopedMap& aOutputMap,
|
||||
const IntSize& aSize,
|
||||
Float aK1, Float aK2, Float aK3, Float aK4)
|
||||
{
|
||||
IntSize size = aInput1->GetSize();
|
||||
RefPtr<DataSourceSurface> target =
|
||||
Factory::CreateDataSourceSurface(size, SurfaceFormat::B8G8R8A8);
|
||||
if (!target) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
DataSourceSurface::ScopedMap inputMap1(aInput1, DataSourceSurface::READ);
|
||||
DataSourceSurface::ScopedMap inputMap2(aInput2, DataSourceSurface::READ);
|
||||
DataSourceSurface::ScopedMap outputMap(target, DataSourceSurface::READ_WRITE);
|
||||
|
||||
uint8_t* source1Data = inputMap1.GetData();
|
||||
uint8_t* source2Data = inputMap2.GetData();
|
||||
uint8_t* targetData = outputMap.GetData();
|
||||
uint32_t source1Stride = inputMap1.GetStride();
|
||||
uint32_t source2Stride = inputMap2.GetStride();
|
||||
uint32_t targetStride = outputMap.GetStride();
|
||||
uint8_t* source1Data = aInputMap1.GetData();
|
||||
uint8_t* source2Data = aInputMap2.GetData();
|
||||
uint8_t* targetData = aOutputMap.GetData();
|
||||
uint32_t source1Stride = aInputMap1.GetStride();
|
||||
uint32_t source2Stride = aInputMap2.GetStride();
|
||||
uint32_t targetStride = aOutputMap.GetStride();
|
||||
|
||||
// The arithmetic combine filter does the following calculation:
|
||||
// result = k1 * in1 * in2 + k2 * in1 + k3 * in2 + k4
|
||||
|
@ -1068,8 +1077,8 @@ ApplyArithmeticCombine_SIMD(DataSourceSurface* aInput1, DataSourceSurface* aInpu
|
|||
i16x8_t k1And4 = simd::InterleaveLo16(k1, k4);
|
||||
i16x8_t k2And3 = simd::InterleaveLo16(k2, k3);
|
||||
|
||||
for (int32_t y = 0; y < size.height; y++) {
|
||||
for (int32_t x = 0; x < size.width; x += 4) {
|
||||
for (int32_t y = 0; y < aSize.height; y++) {
|
||||
for (int32_t x = 0; x < aSize.width; x += 4) {
|
||||
uint32_t source1Index = y * source1Stride + 4 * x;
|
||||
uint32_t source2Index = y * source2Stride + 4 * x;
|
||||
uint32_t targetIndex = y * targetStride + 4 * x;
|
||||
|
@ -1090,6 +1099,31 @@ ApplyArithmeticCombine_SIMD(DataSourceSurface* aInput1, DataSourceSurface* aInpu
|
|||
simd::Store8(&targetData[targetIndex], simd::PackAndSaturate16To8(result_12, result_34));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template<typename i32x4_t, typename i16x8_t, typename u8x16_t>
|
||||
static already_AddRefed<DataSourceSurface>
|
||||
ApplyArithmeticCombine_SIMD(DataSourceSurface* aInput1, DataSourceSurface* aInput2,
|
||||
Float aK1, Float aK2, Float aK3, Float aK4)
|
||||
{
|
||||
IntSize size = aInput1->GetSize();
|
||||
RefPtr<DataSourceSurface> target =
|
||||
Factory::CreateDataSourceSurface(size, SurfaceFormat::B8G8R8A8);
|
||||
if (!target) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
DataSourceSurface::ScopedMap inputMap1(aInput1, DataSourceSurface::READ);
|
||||
DataSourceSurface::ScopedMap outputMap(target, DataSourceSurface::READ_WRITE);
|
||||
|
||||
if (aInput1->Equals(aInput2)) {
|
||||
ApplyArithmeticCombine_SIMD<i32x4_t, i16x8_t, u8x16_t>(inputMap1, inputMap1, outputMap,
|
||||
size, aK1, aK2, aK3, aK4);
|
||||
} else {
|
||||
DataSourceSurface::ScopedMap inputMap2(aInput2, DataSourceSurface::READ);
|
||||
ApplyArithmeticCombine_SIMD<i32x4_t, i16x8_t, u8x16_t>(inputMap1, inputMap2, outputMap,
|
||||
size, aK1, aK2, aK3, aK4);
|
||||
}
|
||||
|
||||
return target.forget();
|
||||
}
|
||||
|
|
|
@ -161,6 +161,9 @@ AsyncCanvasRenderer::CopyFromTextureClient(TextureClient* aTextureClient)
|
|||
{
|
||||
uint32_t stride = gfx::GetAlignedStride<8>(size.width, BytesPerPixel(format));
|
||||
mSurfaceForBasic = gfx::Factory::CreateDataSourceSurfaceWithStride(size, format, stride);
|
||||
if (!mSurfaceForBasic) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
MappedTextureData mapped;
|
||||
|
@ -244,6 +247,9 @@ AsyncCanvasRenderer::GetSurface()
|
|||
gfx::Factory::CreateDataSourceSurfaceWithStride(mSurfaceForBasic->GetSize(),
|
||||
mSurfaceForBasic->GetFormat(),
|
||||
srcMap.GetStride());
|
||||
if (NS_WARN_IF(!result)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
gfx::DataSourceSurface::ScopedMap dstMap(result, gfx::DataSourceSurface::WRITE);
|
||||
|
||||
|
|
|
@ -408,13 +408,13 @@ WebRenderBridgeParent::AddExternalImage(wr::ExternalImageId aExtId, wr::ImageKey
|
|||
|
||||
RefPtr<WebRenderImageHost> host = mExternalImageIds.Get(wr::AsUint64(aExtId));
|
||||
if (!host) {
|
||||
NS_ERROR("CompositableHost does not exist");
|
||||
gfxCriticalNote << "CompositableHost does not exist for extId:" << wr::AsUint64(aExtId);
|
||||
return false;
|
||||
}
|
||||
if (!gfxEnv::EnableWebRenderRecording()) {
|
||||
TextureHost* texture = host->GetAsTextureHostForComposite();
|
||||
if (!texture) {
|
||||
NS_ERROR("TextureHost does not exist");
|
||||
gfxCriticalNote << "TextureHost does not exist for extId:" << wr::AsUint64(aExtId);
|
||||
return false;
|
||||
}
|
||||
WebRenderTextureHost* wrTexture = texture->AsWebRenderTextureHost();
|
||||
|
@ -428,13 +428,13 @@ WebRenderBridgeParent::AddExternalImage(wr::ExternalImageId aExtId, wr::ImageKey
|
|||
}
|
||||
|
||||
if (!dSurf) {
|
||||
NS_ERROR("TextureHost does not return DataSourceSurface");
|
||||
gfxCriticalNote << "TextureHost does not return DataSourceSurface for extId:" << wr::AsUint64(aExtId);
|
||||
return false;
|
||||
}
|
||||
|
||||
DataSourceSurface::MappedSurface map;
|
||||
if (!dSurf->Map(gfx::DataSourceSurface::MapType::READ, &map)) {
|
||||
NS_ERROR("DataSourceSurface failed to map");
|
||||
gfxCriticalNote << "DataSourceSurface failed to map for Image for extId:" << wr::AsUint64(aExtId);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -510,22 +510,6 @@ WebRenderLayerManager::DidComposite(uint64_t aTransactionId,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
WebRenderLayerManager::ClearLayer(Layer* aLayer)
|
||||
{
|
||||
aLayer->ClearCachedResources();
|
||||
if (aLayer->GetMaskLayer()) {
|
||||
aLayer->GetMaskLayer()->ClearCachedResources();
|
||||
}
|
||||
for (size_t i = 0; i < aLayer->GetAncestorMaskLayerCount(); i++) {
|
||||
aLayer->GetAncestorMaskLayerAt(i)->ClearCachedResources();
|
||||
}
|
||||
for (Layer* child = aLayer->GetFirstChild(); child;
|
||||
child = child->GetNextSibling()) {
|
||||
ClearLayer(child);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
WebRenderLayerManager::ClearCachedResources(Layer* aSubtree)
|
||||
{
|
||||
|
|
|
@ -171,8 +171,6 @@ private:
|
|||
*/
|
||||
void MakeSnapshotIfRequired(LayoutDeviceIntSize aSize);
|
||||
|
||||
void ClearLayer(Layer* aLayer);
|
||||
|
||||
private:
|
||||
nsIWidget* MOZ_NON_OWNING_REF mWidget;
|
||||
nsTArray<wr::ImageKey> mImageKeysToDelete;
|
||||
|
|
|
@ -516,27 +516,10 @@ gfxFT2FontBase::GetFTGlyphAdvance(uint16_t aGID)
|
|||
? FT_LOAD_ADVANCE_ONLY
|
||||
: FT_LOAD_ADVANCE_ONLY | FT_LOAD_NO_AUTOHINT | FT_LOAD_NO_HINTING;
|
||||
FT_Fixed advance = 0;
|
||||
// FT_Get_Advance is not reliable with variations until FreeType 2.8.2,
|
||||
// so fall back to calling FT_Load_Glyph and reading the glyph slot's
|
||||
// linearHoriAdvance.
|
||||
// See https://savannah.nongnu.org/bugs/index.php?52683.
|
||||
static uint32_t sFTVersion = 0;
|
||||
if (!sFTVersion) {
|
||||
FT_Int major, minor, patch;
|
||||
FT_Library_Version(face.get()->glyph->library, &major, &minor, &patch);
|
||||
sFTVersion = (major << 16) | (minor << 8) | patch;
|
||||
}
|
||||
if (sFTVersion < 0x020802 &&
|
||||
(face.get()->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS)) {
|
||||
mozilla::DebugOnly<FT_Error> ftError =
|
||||
FT_Load_Glyph(face.get(), aGID, flags);
|
||||
MOZ_ASSERT(!ftError);
|
||||
advance = face.get()->glyph->linearHoriAdvance;
|
||||
} else {
|
||||
mozilla::DebugOnly<FT_Error> ftError =
|
||||
FT_Get_Advance(face.get(), aGID, flags, &advance);
|
||||
MOZ_ASSERT(!ftError);
|
||||
}
|
||||
mozilla::DebugOnly<FT_Error> ftError =
|
||||
FT_Load_Glyph(face.get(), aGID, flags);
|
||||
MOZ_ASSERT(!ftError);
|
||||
advance = face.get()->glyph->linearHoriAdvance;
|
||||
|
||||
// If freetype emboldening is being used, and it's not a zero-width glyph,
|
||||
// adjust the advance to account for the increased width.
|
||||
|
@ -549,6 +532,10 @@ gfxFT2FontBase::GetFTGlyphAdvance(uint16_t aGID)
|
|||
advance += strength;
|
||||
}
|
||||
|
||||
// Round the 16.16 fixed-point value to whole pixels for better consistency
|
||||
// with how cairo renders the glyphs.
|
||||
advance = (advance + 0x8000) & 0xffff0000u;
|
||||
|
||||
return advance;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ RenderBufferTextureHost::Lock(uint8_t aChannelIndex, gl::GLContext* aGL)
|
|||
if (!mLocked) {
|
||||
if (!GetBuffer()) {
|
||||
// We hit some problems to get the shmem.
|
||||
return RawDataToWrExternalImage(nullptr, 0);
|
||||
return InvalidToWrExternalImage();
|
||||
}
|
||||
if (mFormat != gfx::SurfaceFormat::YUV) {
|
||||
mSurface = gfx::Factory::CreateWrappingDataSourceSurface(GetBuffer(),
|
||||
|
@ -58,11 +58,11 @@ RenderBufferTextureHost::Lock(uint8_t aChannelIndex, gl::GLContext* aGL)
|
|||
mSize,
|
||||
mFormat);
|
||||
if (NS_WARN_IF(!mSurface)) {
|
||||
return RawDataToWrExternalImage(nullptr, 0);
|
||||
return InvalidToWrExternalImage();
|
||||
}
|
||||
if (NS_WARN_IF(!mSurface->Map(gfx::DataSourceSurface::MapType::READ_WRITE, &mMap))) {
|
||||
mSurface = nullptr;
|
||||
return RawDataToWrExternalImage(nullptr, 0);
|
||||
return InvalidToWrExternalImage();
|
||||
}
|
||||
} else {
|
||||
const layers::YCbCrDescriptor& desc = mDescriptor.get_YCbCrDescriptor();
|
||||
|
@ -81,13 +81,13 @@ RenderBufferTextureHost::Lock(uint8_t aChannelIndex, gl::GLContext* aGL)
|
|||
gfx::SurfaceFormat::A8);
|
||||
if (NS_WARN_IF(!mYSurface || !mCbSurface || !mCrSurface)) {
|
||||
mYSurface = mCbSurface = mCrSurface = nullptr;
|
||||
return RawDataToWrExternalImage(nullptr, 0);
|
||||
return InvalidToWrExternalImage();
|
||||
}
|
||||
if (NS_WARN_IF(!mYSurface->Map(gfx::DataSourceSurface::MapType::READ_WRITE, &mYMap) ||
|
||||
!mCbSurface->Map(gfx::DataSourceSurface::MapType::READ_WRITE, &mCbMap) ||
|
||||
!mCrSurface->Map(gfx::DataSourceSurface::MapType::READ_WRITE, &mCrMap))) {
|
||||
mYSurface = mCbSurface = mCrSurface = nullptr;
|
||||
return RawDataToWrExternalImage(nullptr, 0);
|
||||
return InvalidToWrExternalImage();
|
||||
}
|
||||
}
|
||||
mLocked = true;
|
||||
|
|
|
@ -159,7 +159,7 @@ RenderDXGITextureHostOGL::Lock(uint8_t aChannelIndex, gl::GLContext* aGL)
|
|||
}
|
||||
|
||||
if (!EnsureLockable()) {
|
||||
return NativeTextureToWrExternalImage(0, 0, 0, 0, 0);
|
||||
return InvalidToWrExternalImage();
|
||||
}
|
||||
|
||||
if (!mLocked) {
|
||||
|
@ -167,7 +167,7 @@ RenderDXGITextureHostOGL::Lock(uint8_t aChannelIndex, gl::GLContext* aGL)
|
|||
HRESULT hr = mKeyedMutex->AcquireSync(0, 100);
|
||||
if (hr != S_OK) {
|
||||
gfxCriticalError() << "RenderDXGITextureHostOGL AcquireSync timeout, hr=" << gfx::hexa(hr);
|
||||
return NativeTextureToWrExternalImage(0, 0, 0, 0, 0);
|
||||
return InvalidToWrExternalImage();
|
||||
}
|
||||
}
|
||||
mLocked = true;
|
||||
|
@ -342,7 +342,7 @@ RenderDXGIYCbCrTextureHostOGL::Lock(uint8_t aChannelIndex, gl::GLContext* aGL)
|
|||
}
|
||||
|
||||
if (!EnsureLockable()) {
|
||||
return NativeTextureToWrExternalImage(0, 0, 0, 0, 0);
|
||||
return InvalidToWrExternalImage();
|
||||
}
|
||||
|
||||
if (!mLocked) {
|
||||
|
@ -351,7 +351,7 @@ RenderDXGIYCbCrTextureHostOGL::Lock(uint8_t aChannelIndex, gl::GLContext* aGL)
|
|||
HRESULT hr = mutex->AcquireSync(0, 100);
|
||||
if (hr != S_OK) {
|
||||
gfxCriticalError() << "RenderDXGIYCbCrTextureHostOGL AcquireSync timeout, hr=" << gfx::hexa(hr);
|
||||
return NativeTextureToWrExternalImage(0, 0, 0, 0, 0);
|
||||
return InvalidToWrExternalImage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче