зеркало из https://github.com/mozilla/gecko-dev.git
merge fx-team to mozilla-central a=merge
This commit is contained in:
Коммит
75e7b5bab2
|
@ -1,3 +1,3 @@
|
|||
This is the pdf.js project output, https://github.com/mozilla/pdf.js
|
||||
|
||||
Current extension version is: 1.5.305
|
||||
Current extension version is: 1.5.322
|
||||
|
|
|
@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdf = {}));
|
|||
// Use strict in our context only - users might not want it
|
||||
'use strict';
|
||||
|
||||
var pdfjsVersion = '1.5.305';
|
||||
var pdfjsBuild = '546e223';
|
||||
var pdfjsVersion = '1.5.322';
|
||||
var pdfjsBuild = 'b6826a4';
|
||||
|
||||
var pdfjsFilePath =
|
||||
typeof document !== 'undefined' && document.currentScript ?
|
||||
|
|
|
@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfWorker = {}));
|
|||
// Use strict in our context only - users might not want it
|
||||
'use strict';
|
||||
|
||||
var pdfjsVersion = '1.5.305';
|
||||
var pdfjsBuild = '546e223';
|
||||
var pdfjsVersion = '1.5.322';
|
||||
var pdfjsBuild = 'b6826a4';
|
||||
|
||||
var pdfjsFilePath =
|
||||
typeof document !== 'undefined' && document.currentScript ?
|
||||
|
@ -27021,6 +27021,25 @@ function getFontType(type, subtype) {
|
|||
}
|
||||
}
|
||||
|
||||
// Some bad PDF generators, e.g. Scribus PDF, include glyph names
|
||||
// in a 'uniXXXX' format -- attempting to recover proper ones.
|
||||
function recoverGlyphName(name, glyphsUnicodeMap) {
|
||||
if (glyphsUnicodeMap[name] !== undefined) {
|
||||
return name;
|
||||
}
|
||||
// The glyph name is non-standard, trying to recover.
|
||||
var unicode = getUnicodeForGlyph(name, glyphsUnicodeMap);
|
||||
if (unicode !== -1) {
|
||||
for (var key in glyphsUnicodeMap) {
|
||||
if (glyphsUnicodeMap[key] === unicode) {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
}
|
||||
warn('Unable to recover a standard glyph name for: ' + name);
|
||||
return name;
|
||||
}
|
||||
|
||||
var Glyph = (function GlyphClosure() {
|
||||
function Glyph(fontChar, unicode, accent, width, vmetric, operatorListId,
|
||||
isSpace, isInFont) {
|
||||
|
@ -27280,6 +27299,7 @@ var ProblematicCharRanges = new Int32Array([
|
|||
0x2028, 0x2030,
|
||||
0x205F, 0x2070,
|
||||
0x25CC, 0x25CD,
|
||||
0x3000, 0x3001,
|
||||
// Chars that is used in complex-script shaping.
|
||||
0xAA60, 0xAA80,
|
||||
// Specials Unicode block.
|
||||
|
@ -29101,26 +29121,6 @@ var Font = (function FontClosure() {
|
|||
return false;
|
||||
}
|
||||
|
||||
// Some bad PDF generators, e.g. Scribus PDF, include glyph names
|
||||
// in a 'uniXXXX' format -- attempting to recover proper ones.
|
||||
function recoverGlyphName(name, glyphsUnicodeMap) {
|
||||
if (glyphsUnicodeMap[name] !== undefined) {
|
||||
return name;
|
||||
}
|
||||
// The glyph name is non-standard, trying to recover.
|
||||
var unicode = getUnicodeForGlyph(name, glyphsUnicodeMap);
|
||||
if (unicode !== -1) {
|
||||
for (var key in glyphsUnicodeMap) {
|
||||
if (glyphsUnicodeMap[key] === unicode) {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
}
|
||||
warn('Unable to recover a standard glyph name for: ' + name);
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
if (properties.type === 'CIDFontType2') {
|
||||
var cidToGidMap = properties.cidToGidMap || [];
|
||||
var isCidToGidMapEmpty = cidToGidMap.length === 0;
|
||||
|
@ -29485,7 +29485,7 @@ var Font = (function FontClosure() {
|
|||
}
|
||||
|
||||
// trying to estimate space character width
|
||||
var possibleSpaceReplacements = ['space', 'minus', 'one', 'i'];
|
||||
var possibleSpaceReplacements = ['space', 'minus', 'one', 'i', 'I'];
|
||||
var width;
|
||||
for (var i = 0, ii = possibleSpaceReplacements.length; i < ii; i++) {
|
||||
var glyphName = possibleSpaceReplacements[i];
|
||||
|
@ -29694,11 +29694,21 @@ function type1FontGlyphMapping(properties, builtInEncoding, glyphNames) {
|
|||
}
|
||||
|
||||
// Lastly, merge in the differences.
|
||||
var differences = properties.differences;
|
||||
var differences = properties.differences, glyphsUnicodeMap;
|
||||
if (differences) {
|
||||
for (charCode in differences) {
|
||||
var glyphName = differences[charCode];
|
||||
glyphId = glyphNames.indexOf(glyphName);
|
||||
|
||||
if (glyphId === -1) {
|
||||
if (!glyphsUnicodeMap) {
|
||||
glyphsUnicodeMap = getGlyphsUnicode();
|
||||
}
|
||||
var standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap);
|
||||
if (standardGlyphName !== glyphName) {
|
||||
glyphId = glyphNames.indexOf(standardGlyphName);
|
||||
}
|
||||
}
|
||||
if (glyphId >= 0) {
|
||||
charCodeToGlyphId[charCode] = glyphId;
|
||||
} else {
|
||||
|
@ -39735,6 +39745,7 @@ var TextWidgetAnnotation = (function TextWidgetAnnotationClosure() {
|
|||
WidgetAnnotation.call(this, params);
|
||||
|
||||
this.data.textAlignment = Util.getInheritableProperty(params.dict, 'Q');
|
||||
this.data.maxLen = Util.getInheritableProperty(params.dict, 'MaxLen');
|
||||
}
|
||||
|
||||
Util.inherit(TextWidgetAnnotation, WidgetAnnotation, {
|
||||
|
|
|
@ -7372,7 +7372,8 @@ var PDFViewerApplication = {
|
|||
},
|
||||
|
||||
get supportsFullscreen() {
|
||||
var support = document.fullscreenEnabled === true;
|
||||
var support = document.fullscreenEnabled === true ||
|
||||
document.mozFullScreenEnabled === true;
|
||||
if (support && pdfjsLib.PDFJS.disableFullscreen === true) {
|
||||
support = false;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
"use strict";
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
const {interfaces: Ci, utils: Cu} = Components;
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["Windows8WindowFrameColor"];
|
||||
|
||||
|
@ -22,19 +22,25 @@ var Windows8WindowFrameColor = {
|
|||
const dwmKey = "Software\\Microsoft\\Windows\\DWM";
|
||||
let customizationColor = Registry.readRegKey(HKCU, dwmKey,
|
||||
"ColorizationColor");
|
||||
if (!customizationColor) {
|
||||
if (customizationColor == undefined) {
|
||||
// Seems to be the default color (hardcoded because of bug 1065998)
|
||||
return [158, 158, 158];
|
||||
}
|
||||
|
||||
// The color returned from the Registry is in decimal form.
|
||||
let customizationColorHex = customizationColor.toString(16);
|
||||
|
||||
// Zero-pad the number just to make sure that it is 8 digits.
|
||||
customizationColorHex = ("00000000" + customizationColorHex).substr(-8);
|
||||
let customizationColorArray = customizationColorHex.match(/../g);
|
||||
let [unused, fgR, fgG, fgB] = customizationColorArray.map(val => parseInt(val, 16));
|
||||
let colorizationColorBalance = Registry.readRegKey(HKCU, dwmKey,
|
||||
"ColorizationColorBalance") || 78;
|
||||
// Window frame base color when Color Intensity is at 0, see bug 1004576.
|
||||
"ColorizationColorBalance");
|
||||
if (colorizationColorBalance == undefined) {
|
||||
colorizationColorBalance = 78;
|
||||
}
|
||||
|
||||
// Window frame base color when Color Intensity is at 0, see bug 1004576.
|
||||
let frameBaseColor = 217;
|
||||
let alpha = colorizationColorBalance / 100;
|
||||
|
||||
|
|
|
@ -62,6 +62,8 @@ BottomHost.prototype = {
|
|||
|
||||
this._splitter = ownerDocument.createElement("splitter");
|
||||
this._splitter.setAttribute("class", "devtools-horizontal-splitter");
|
||||
// Avoid resizing notification containers
|
||||
this._splitter.setAttribute("resizebefore", "flex");
|
||||
|
||||
this.frame = ownerDocument.createElement("iframe");
|
||||
this.frame.className = "devtools-toolbox-bottom-iframe";
|
||||
|
|
|
@ -11,9 +11,8 @@ define(function (require, exports, module) {
|
|||
const React = require("devtools/client/shared/vendor/react");
|
||||
|
||||
// Reps
|
||||
const { createFactories, isGrip } = require("./rep-utils");
|
||||
const { createFactories, isGrip, cropString } = require("./rep-utils");
|
||||
const { ObjectLink } = createFactories(require("./object-link"));
|
||||
const { cropString } = require("./string");
|
||||
|
||||
/**
|
||||
* This component represents a template for Function objects.
|
||||
|
|
|
@ -31,7 +31,51 @@ define(function (require, exports, module) {
|
|||
return object && object.actor;
|
||||
}
|
||||
|
||||
function escapeNewLines(value) {
|
||||
return value.replace(/\r/gm, "\\r").replace(/\n/gm, "\\n");
|
||||
}
|
||||
|
||||
function cropMultipleLines(text, limit) {
|
||||
return escapeNewLines(cropString(text, limit));
|
||||
}
|
||||
|
||||
function cropString(text, limit, alternativeText) {
|
||||
if (!alternativeText) {
|
||||
alternativeText = "\u2026";
|
||||
}
|
||||
|
||||
// Make sure it's a string.
|
||||
text = text + "";
|
||||
|
||||
// Use default limit if necessary.
|
||||
if (!limit) {
|
||||
limit = 50;
|
||||
}
|
||||
|
||||
// Crop the string only if a limit is actually specified.
|
||||
if (limit <= 0) {
|
||||
return text;
|
||||
}
|
||||
|
||||
// Set the limit at least to the length of the alternative text
|
||||
// plus one character of the original text.
|
||||
if (limit <= alternativeText.length) {
|
||||
limit = alternativeText.length + 1;
|
||||
}
|
||||
|
||||
let halfLimit = (limit - alternativeText.length) / 2;
|
||||
|
||||
if (text.length > limit) {
|
||||
return text.substr(0, Math.ceil(halfLimit)) + alternativeText +
|
||||
text.substr(text.length - Math.floor(halfLimit));
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
// Exports from this module
|
||||
exports.createFactories = createFactories;
|
||||
exports.isGrip = isGrip;
|
||||
exports.cropString = cropString;
|
||||
exports.cropMultipleLines = cropMultipleLines;
|
||||
});
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
define(function (require, exports, module) {
|
||||
// Dependencies
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
const { createFactories } = require("./rep-utils");
|
||||
const { createFactories, cropMultipleLines } = require("./rep-utils");
|
||||
const { ObjectBox } = createFactories(require("./object-box"));
|
||||
|
||||
/**
|
||||
|
@ -38,55 +38,6 @@ define(function (require, exports, module) {
|
|||
},
|
||||
});
|
||||
|
||||
// Helpers
|
||||
|
||||
function escapeNewLines(value) {
|
||||
return value.replace(/\r/gm, "\\r").replace(/\n/gm, "\\n");
|
||||
}
|
||||
|
||||
function cropMultipleLines(text, limit) {
|
||||
return escapeNewLines(cropString(text, limit));
|
||||
}
|
||||
|
||||
function cropString(text, limit, alternativeText) {
|
||||
if (!alternativeText) {
|
||||
alternativeText = "\u2026";
|
||||
}
|
||||
|
||||
// Make sure it's a string.
|
||||
text = text + "";
|
||||
|
||||
// Use default limit if necessary.
|
||||
if (!limit) {
|
||||
limit = 50;
|
||||
}
|
||||
|
||||
// Crop the string only if a limit is actually specified.
|
||||
if (limit <= 0) {
|
||||
return text;
|
||||
}
|
||||
|
||||
// Set the limit at least to the length of the alternative text
|
||||
// plus one character of the original text.
|
||||
if (limit <= alternativeText.length) {
|
||||
limit = alternativeText.length + 1;
|
||||
}
|
||||
|
||||
let halfLimit = (limit - alternativeText.length) / 2;
|
||||
|
||||
if (text.length > limit) {
|
||||
return text.substr(0, Math.ceil(halfLimit)) + alternativeText +
|
||||
text.substr(text.length - Math.floor(halfLimit));
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
function isCropped(value) {
|
||||
let cropLength = 50;
|
||||
return typeof value == "string" && value.length > cropLength;
|
||||
}
|
||||
|
||||
function supportsObject(object, type) {
|
||||
return (type == "string");
|
||||
}
|
||||
|
@ -97,8 +48,4 @@ define(function (require, exports, module) {
|
|||
rep: StringRep,
|
||||
supportsObject: supportsObject,
|
||||
};
|
||||
|
||||
exports.isCropped = isCropped;
|
||||
exports.cropString = cropString;
|
||||
exports.cropMultipleLines = cropMultipleLines;
|
||||
});
|
||||
|
|
|
@ -11,9 +11,8 @@ define(function (require, exports, module) {
|
|||
const React = require("devtools/client/shared/vendor/react");
|
||||
|
||||
// Reps
|
||||
const { createFactories, isGrip } = require("./rep-utils");
|
||||
const { createFactories, isGrip, cropMultipleLines } = require("./rep-utils");
|
||||
const { ObjectLink } = createFactories(require("./object-link"));
|
||||
const { cropMultipleLines } = require("./string");
|
||||
|
||||
// Shortcuts
|
||||
const DOM = React.DOM;
|
||||
|
|
|
@ -11,9 +11,8 @@ define(function (require, exports, module) {
|
|||
const React = require("devtools/client/shared/vendor/react");
|
||||
|
||||
// Reps
|
||||
const { createFactories, isGrip } = require("./rep-utils");
|
||||
const { createFactories, isGrip, cropString } = require("./rep-utils");
|
||||
const { ObjectBox } = createFactories(require("./object-box"));
|
||||
const { cropString } = require("./string");
|
||||
|
||||
// Shortcuts
|
||||
const DOM = React.DOM;
|
||||
|
|
|
@ -15,6 +15,7 @@ support-files =
|
|||
[test_reps_number.html]
|
||||
[test_reps_object-with-text.html]
|
||||
[test_reps_object-with-url.html]
|
||||
[test_reps_string.html]
|
||||
[test_reps_stylesheet.html]
|
||||
[test_reps_undefined.html]
|
||||
[test_reps_window.html]
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
Test String rep
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Rep test - String</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
|
||||
</head>
|
||||
<body>
|
||||
<pre id="test">
|
||||
<script src="head.js" type="application/javascript;version=1.8"></script>
|
||||
<script type="application/javascript;version=1.8">
|
||||
window.onload = Task.async(function* () {
|
||||
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
|
||||
let { StringRep } = browserRequire("devtools/client/shared/components/reps/string");
|
||||
|
||||
try {
|
||||
// Test that correct rep is chosen
|
||||
const renderedRep = shallowRenderComponent(Rep, { object: getGripStub("testMultiline") });
|
||||
is(renderedRep.type, StringRep.rep, `Rep correctly selects ${StringRep.rep.displayName}`);
|
||||
|
||||
// Test rendering
|
||||
yield testMultiline();
|
||||
yield testMultilineOpen();
|
||||
} catch(e) {
|
||||
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
||||
} finally {
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
function testMultiline() {
|
||||
const renderedComponent = renderComponent(StringRep.rep, { object: getGripStub("testMultiline") });
|
||||
is(renderedComponent.textContent, "\"aaaaaaaaaaaaaaaaaaaaa\\nbbb…bbbbbb\\ncccccccccccccccc\\n\"", "String rep has expected text content for multiline string");
|
||||
}
|
||||
|
||||
function testMultilineOpen() {
|
||||
const renderedComponent = renderComponent(StringRep.rep, { object: getGripStub("testMultiline"), member: {open: true} });
|
||||
is(renderedComponent.textContent, "\"aaaaaaaaaaaaaaaaaaaaa\nbbbbbbbbbbbbbbbbbbb\ncccccccccccccccc\n\"", "String rep has expected text content for multiline string when open");
|
||||
}
|
||||
|
||||
function getGripStub(name) {
|
||||
switch (name) {
|
||||
case "testMultiline":
|
||||
return "aaaaaaaaaaaaaaaaaaaaa\nbbbbbbbbbbbbbbbbbbb\ncccccccccccccccc\n";
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -30,6 +30,8 @@
|
|||
}
|
||||
|
||||
#color-value {
|
||||
/* avoid the # appearing at the end for some colours in RTL locales */
|
||||
direction: ltr;
|
||||
padding: 0.3em;
|
||||
text-shadow: 1px 1px 1px #fff;
|
||||
}
|
||||
|
|
|
@ -293,7 +293,7 @@
|
|||
dominant-baseline: middle;
|
||||
}
|
||||
|
||||
/* Rules highlighter */
|
||||
/* Rulers highlighter */
|
||||
|
||||
:-moz-native-anonymous .rulers-highlighter-elements {
|
||||
shape-rendering: crispEdges;
|
||||
|
@ -329,7 +329,7 @@
|
|||
}
|
||||
|
||||
:-moz-native-anonymous .rulers-highlighter-horizontal-labels > text {
|
||||
text-anchor: left;
|
||||
text-anchor: start;
|
||||
}
|
||||
|
||||
:-moz-native-anonymous .rulers-highlighter-vertical-labels > text {
|
||||
|
|
|
@ -348,8 +348,9 @@ var NodeActor = exports.NodeActor = protocol.ActorClassWithSpec(nodeSpec, {
|
|||
let hasAnonChildren = rawNode.nodeType === Ci.nsIDOMNode.ELEMENT_NODE &&
|
||||
rawNode.ownerDocument.getAnonymousNodes(rawNode);
|
||||
|
||||
if (numChildren === 0 &&
|
||||
(rawNode.contentDocument || rawNode.getSVGDocument)) {
|
||||
let hasContentDocument = rawNode.contentDocument;
|
||||
let hasSVGDocument = rawNode.getSVGDocument && rawNode.getSVGDocument();
|
||||
if (numChildren === 0 && (hasContentDocument || hasSVGDocument)) {
|
||||
// This might be an iframe with virtual children.
|
||||
numChildren = 1;
|
||||
}
|
||||
|
@ -1610,10 +1611,6 @@ var WalkerActor = protocol.ActorClassWithSpec(walkerSpec, {
|
|||
}
|
||||
}
|
||||
sugs.classes.delete("");
|
||||
// Editing the style editor may make the stylesheet have errors and
|
||||
// thus the page's elements' styles start changing with a transition.
|
||||
// That transition comes from the `moz-styleeditor-transitioning` class.
|
||||
sugs.classes.delete("moz-styleeditor-transitioning");
|
||||
sugs.classes.delete(HIDDEN_CLASS);
|
||||
for (let [className, count] of sugs.classes) {
|
||||
if (className.startsWith(completing)) {
|
||||
|
@ -1685,10 +1682,6 @@ var WalkerActor = protocol.ActorClassWithSpec(walkerSpec, {
|
|||
id && result.push(["#" + id, count]);
|
||||
}
|
||||
sugs.classes.delete("");
|
||||
// Editing the style editor may make the stylesheet have errors and
|
||||
// thus the page's elements' styles start changing with a transition.
|
||||
// That transition comes from the `moz-styleeditor-transitioning` class.
|
||||
sugs.classes.delete("moz-styleeditor-transitioning");
|
||||
sugs.classes.delete(HIDDEN_CLASS);
|
||||
for (let [className, count] of sugs.classes) {
|
||||
className && result.push(["." + className, count]);
|
||||
|
@ -3030,8 +3023,9 @@ var imageToImageData = Task.async(function* (node, maxDim) {
|
|||
// Extract the image data
|
||||
let imageData;
|
||||
// The image may already be a data-uri, in which case, save ourselves the
|
||||
// trouble of converting via the canvas.drawImage.toDataURL method
|
||||
if (isImg && node.src.startsWith("data:")) {
|
||||
// trouble of converting via the canvas.drawImage.toDataURL method, but only
|
||||
// if the image doesn't need resizing
|
||||
if (isImg && node.src.startsWith("data:") && resizeRatio === 1) {
|
||||
imageData = node.src;
|
||||
} else {
|
||||
// Create a canvas to copy the rawNode into and get the imageData from
|
||||
|
|
|
@ -17,6 +17,8 @@ const {listenOnce} = require("devtools/shared/async-utils");
|
|||
const {originalSourceSpec, mediaRuleSpec, styleSheetSpec,
|
||||
styleSheetsSpec} = require("devtools/shared/specs/stylesheets");
|
||||
const {SourceMapConsumer} = require("source-map");
|
||||
const { installHelperSheet,
|
||||
addPseudoClassLock, removePseudoClassLock } = require("devtools/server/actors/highlighters/utils/markup");
|
||||
|
||||
loader.lazyGetter(this, "CssLogic", () => require("devtools/shared/inspector/css-logic"));
|
||||
|
||||
|
@ -24,17 +26,17 @@ XPCOMUtils.defineLazyGetter(this, "DOMUtils", function () {
|
|||
return Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils);
|
||||
});
|
||||
|
||||
var TRANSITION_CLASS = "moz-styleeditor-transitioning";
|
||||
var TRANSITION_PSEUDO_CLASS = ":-moz-styleeditor-transitioning";
|
||||
var TRANSITION_DURATION_MS = 500;
|
||||
var TRANSITION_BUFFER_MS = 1000;
|
||||
var TRANSITION_RULE_SELECTOR =
|
||||
".moz-styleeditor-transitioning:root, .moz-styleeditor-transitioning:root *";
|
||||
var TRANSITION_RULE = TRANSITION_RULE_SELECTOR + " {\
|
||||
transition-duration: " + TRANSITION_DURATION_MS + "ms !important; \
|
||||
transition-delay: 0ms !important;\
|
||||
transition-timing-function: ease-out !important;\
|
||||
transition-property: all !important;\
|
||||
}";
|
||||
`:root${TRANSITION_PSEUDO_CLASS}, :root${TRANSITION_PSEUDO_CLASS} *`;
|
||||
var TRANSITION_RULE = `${TRANSITION_RULE_SELECTOR} {
|
||||
transition-duration: ${TRANSITION_DURATION_MS}ms !important;
|
||||
transition-delay: 0ms !important;
|
||||
transition-timing-function: ease-out !important;
|
||||
transition-property: all !important;
|
||||
}`;
|
||||
|
||||
var LOAD_ERROR = "error-load";
|
||||
|
||||
|
@ -248,6 +250,22 @@ var StyleSheetActor = protocol.ActorClassWithSpec(styleSheetSpec, {
|
|||
return this._styleSheetIndex;
|
||||
},
|
||||
|
||||
destroy: function () {
|
||||
if (this._transitionTimeout) {
|
||||
this.window.clearTimeout(this._transitionTimeout);
|
||||
removePseudoClassLock(
|
||||
this.document.documentElement, TRANSITION_PSEUDO_CLASS);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Since StyleSheetActor doesn't have a protocol.js parent actor that take
|
||||
* care of its lifetime, implementing disconnect is required to cleanup.
|
||||
*/
|
||||
disconnect: function () {
|
||||
this.destroy();
|
||||
},
|
||||
|
||||
initialize: function (aStyleSheet, aParentActor, aWindow) {
|
||||
protocol.Actor.prototype.initialize.call(this, null);
|
||||
|
||||
|
@ -260,8 +278,6 @@ var StyleSheetActor = protocol.ActorClassWithSpec(styleSheetSpec, {
|
|||
// text and index are unknown until source load
|
||||
this.text = null;
|
||||
this._styleSheetIndex = -1;
|
||||
|
||||
this._transitionRefCount = 0;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -721,7 +737,7 @@ var StyleSheetActor = protocol.ActorClassWithSpec(styleSheetSpec, {
|
|||
* to remove the rule after a certain time.
|
||||
*/
|
||||
_insertTransistionRule: function (kind) {
|
||||
this.document.documentElement.classList.add(TRANSITION_CLASS);
|
||||
addPseudoClassLock(this.document.documentElement, TRANSITION_PSEUDO_CLASS);
|
||||
|
||||
// We always add the rule since we've just reset all the rules
|
||||
this.rawSheet.insertRule(TRANSITION_RULE, this.rawSheet.cssRules.length);
|
||||
|
@ -739,7 +755,8 @@ var StyleSheetActor = protocol.ActorClassWithSpec(styleSheetSpec, {
|
|||
*/
|
||||
_onTransitionEnd: function (kind)
|
||||
{
|
||||
this.document.documentElement.classList.remove(TRANSITION_CLASS);
|
||||
this._transitionTimeout = null;
|
||||
removePseudoClassLock(this.document.documentElement, TRANSITION_PSEUDO_CLASS);
|
||||
|
||||
let index = this.rawSheet.cssRules.length - 1;
|
||||
let rule = this.rawSheet.cssRules[index];
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
<head>
|
||||
<body>
|
||||
<img class="custom">
|
||||
<img class="big-horizontal" src="large-image.jpg" style="width:500px;" />
|
||||
<img class="big-horizontal" src="large-image.jpg" style="width:500px;">
|
||||
<canvas class="big-vertical" style="width:500px;"></canvas>
|
||||
<img class="small" src="small-image.gif"></img>
|
||||
<img class="small" src="small-image.gif">
|
||||
<img class="data" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAJklEQVRIie3NMREAAAgAoe9fWls4eAzMVM0xoVAoFAqFQqFQ+C9chp4NHvu+4Q4AAAAASUVORK5CYII=">
|
||||
<script>
|
||||
window.onload = () => {
|
||||
var canvas = document.querySelector("canvas"), ctx = canvas.getContext("2d");
|
||||
|
|
|
@ -47,7 +47,7 @@ addTest(function testLargeImage() {
|
|||
|
||||
imageData.data.string().then(str => {
|
||||
ok(str, "We have an image data string!");
|
||||
runNextTest();
|
||||
testResizing(imageData, str);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -68,7 +68,7 @@ addTest(function testLargeCanvas() {
|
|||
|
||||
imageData.data.string().then(str => {
|
||||
ok(str, "We have an image data string!");
|
||||
runNextTest();
|
||||
testResizing(imageData, str);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -89,7 +89,28 @@ addTest(function testSmallImage() {
|
|||
|
||||
imageData.data.string().then(str => {
|
||||
ok(str, "We have an image data string!");
|
||||
runNextTest();
|
||||
testResizing(imageData, str);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
addTest(function testDataImage() {
|
||||
// Select the data image node from the test page
|
||||
gWalker.querySelector(gWalker.rootNode, ".data").then(img => {
|
||||
ok(img, "Image node found in the test page");
|
||||
ok(img.getImageData, "Image node has the getImageData function");
|
||||
|
||||
img.getImageData(14).then(imageData => {
|
||||
ok(imageData.data, "Image data actor was sent back");
|
||||
ok(imageData.size, "Image size info was sent back too");
|
||||
is(imageData.size.naturalWidth, 28, "Natural width of the image correct");
|
||||
is(imageData.size.naturalHeight, 28, "Natural width of the image correct");
|
||||
ok(imageData.size.resized, "Image was resized");
|
||||
|
||||
imageData.data.string().then(str => {
|
||||
ok(str, "We have an image data string!");
|
||||
testResizing(imageData, str);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -106,6 +127,20 @@ addTest(function cleanup() {
|
|||
runNextTest();
|
||||
});
|
||||
|
||||
/**
|
||||
* Checks if the server told the truth about resizing the image
|
||||
*/
|
||||
function testResizing(imageData, str) {
|
||||
let img = document.createElement("img");
|
||||
img.addEventListener("load", () => {
|
||||
let resized = !(img.naturalWidth == imageData.size.naturalWidth &&
|
||||
img.naturalHeight == imageData.size.naturalHeight);
|
||||
is(imageData.size.resized, resized, "Server told the truth about resizing");
|
||||
runNextTest();
|
||||
}, false);
|
||||
img.src = str;
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts that the given promise rejects.
|
||||
*/
|
||||
|
|
|
@ -21,6 +21,8 @@ const { Services } = jsmScope;
|
|||
// Steal various globals only available in JSM scope (and not Sandbox one)
|
||||
const { PromiseDebugging, ChromeUtils, ThreadSafeChromeUtils, HeapSnapshot,
|
||||
atob, btoa, Iterator } = jsmScope;
|
||||
const { URL } = Cu.Sandbox(CC("@mozilla.org/systemprincipal;1", "nsIPrincipal")(),
|
||||
{wantGlobalProperties: ["URL"]});
|
||||
|
||||
/**
|
||||
* Defines a getter on a specified object that will be created upon first use.
|
||||
|
@ -236,6 +238,7 @@ const globals = exports.globals = {
|
|||
reportError: Cu.reportError,
|
||||
atob: atob,
|
||||
btoa: btoa,
|
||||
URL,
|
||||
_Iterator: Iterator,
|
||||
loader: {
|
||||
lazyGetter: defineLazyGetter,
|
||||
|
@ -274,7 +277,6 @@ const globals = exports.globals = {
|
|||
defineLazyGetter(globals, "console", () => {
|
||||
return Cu.import("resource://gre/modules/Console.jsm", {}).console;
|
||||
});
|
||||
|
||||
defineLazyGetter(globals, "clearTimeout", () => {
|
||||
return Cu.import("resource://gre/modules/Timer.jsm", {}).clearTimeout;
|
||||
});
|
||||
|
@ -287,12 +289,6 @@ defineLazyGetter(globals, "clearInterval", () => {
|
|||
defineLazyGetter(globals, "setInterval", () => {
|
||||
return Cu.import("resource://gre/modules/Timer.jsm", {}).setInterval;
|
||||
});
|
||||
defineLazyGetter(globals, "URL", () => {
|
||||
let sandbox
|
||||
= Cu.Sandbox(CC("@mozilla.org/systemprincipal;1", "nsIPrincipal")(),
|
||||
{wantGlobalProperties: ["URL"]});
|
||||
return sandbox.URL;
|
||||
});
|
||||
defineLazyGetter(globals, "CSSRule", () => Ci.nsIDOMCSSRule);
|
||||
defineLazyGetter(globals, "DOMParser", () => {
|
||||
return CC("@mozilla.org/xmlextras/domparser;1", "nsIDOMParser");
|
||||
|
|
|
@ -286,6 +286,8 @@ private:
|
|||
#define NS_EVENT_STATE_DEVTOOLS_HIGHLIGHTED NS_DEFINE_EVENT_STATE_MACRO(45)
|
||||
// Element is an unresolved custom element candidate
|
||||
#define NS_EVENT_STATE_UNRESOLVED NS_DEFINE_EVENT_STATE_MACRO(46)
|
||||
// Element is transitioning for rules changed by style editor
|
||||
#define NS_EVENT_STATE_STYLEEDITOR_TRANSITIONING NS_DEFINE_EVENT_STATE_MACRO(47)
|
||||
|
||||
// Event state that is used for values that need to be parsed but do nothing.
|
||||
#define NS_EVENT_STATE_IGNORE NS_DEFINE_EVENT_STATE_MACRO(63)
|
||||
|
@ -304,4 +306,3 @@ private:
|
|||
#define INTRINSIC_STATES (~ESM_MANAGED_STATES)
|
||||
|
||||
#endif // mozilla_EventStates_h_
|
||||
|
||||
|
|
|
@ -161,6 +161,8 @@ CSS_STATE_PSEUDO_CLASS(indeterminate, ":indeterminate", 0, "",
|
|||
|
||||
CSS_STATE_PSEUDO_CLASS(mozDevtoolsHighlighted, ":-moz-devtools-highlighted", 0, "",
|
||||
NS_EVENT_STATE_DEVTOOLS_HIGHLIGHTED)
|
||||
CSS_STATE_PSEUDO_CLASS(mozStyleeditorTransitioning, ":-moz-styleeditor-transitioning", 0, "",
|
||||
NS_EVENT_STATE_STYLEEDITOR_TRANSITIONING)
|
||||
|
||||
// Matches the element which is being displayed full-screen, and
|
||||
// any containing frames.
|
||||
|
|
|
@ -82,6 +82,7 @@ SessionStore.prototype = {
|
|||
this._sessionFileBackup.append("sessionstore.bak");
|
||||
|
||||
this._loadState = STATE_STOPPED;
|
||||
this._startupRestoreFinished = false;
|
||||
|
||||
this._interval = Services.prefs.getIntPref("browser.sessionstore.interval");
|
||||
this._maxTabsUndo = Services.prefs.getIntPref("browser.sessionstore.max_tabs_undo");
|
||||
|
@ -214,6 +215,10 @@ SessionStore.prototype = {
|
|||
selected: true
|
||||
});
|
||||
}
|
||||
// Normally, _restoreWindow() will have set this to true already,
|
||||
// but we want to make sure it's set even in case of a restore failure.
|
||||
this._startupRestoreFinished = true;
|
||||
log("startupRestoreFinished = true (through notification)");
|
||||
}.bind(this)
|
||||
};
|
||||
Services.obs.addObserver(restoreCleanup, "sessionstore-windows-restored", false);
|
||||
|
@ -223,12 +228,20 @@ SessionStore.prototype = {
|
|||
this.restoreLastSession(data.sessionString);
|
||||
} else {
|
||||
// Not doing a restore; just send restore message
|
||||
this._startupRestoreFinished = true;
|
||||
log("startupRestoreFinished = true");
|
||||
Services.obs.notifyObservers(null, "sessionstore-windows-restored", "");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "Session:NotifyLocationChange": {
|
||||
let browser = aSubject;
|
||||
|
||||
if (browser.__SS_restoreReloadPending && this._startupRestoreFinished) {
|
||||
delete browser.__SS_restoreReloadPending;
|
||||
log("remove restoreReloadPending");
|
||||
}
|
||||
|
||||
if (browser.__SS_restoreDataOnLocationChange) {
|
||||
delete browser.__SS_restoreDataOnLocationChange;
|
||||
this._restoreZoom(browser.__SS_data.scrolldata, browser);
|
||||
|
@ -496,17 +509,10 @@ SessionStore.prototype = {
|
|||
aBrowser.removeEventListener("scroll", this, true);
|
||||
aBrowser.removeEventListener("resize", this, true);
|
||||
|
||||
let tabId = aWindow.BrowserApp.getTabForBrowser(aBrowser).id;
|
||||
|
||||
// If this browser is being restored, skip any session save activity
|
||||
if (aBrowser.__SS_restore) {
|
||||
log("onTabRemove() ran for zombie tab " + tabId + ", aNoNotification = " + aNoNotification);
|
||||
return;
|
||||
}
|
||||
|
||||
delete aBrowser.__SS_data;
|
||||
|
||||
log("onTabRemove() ran for tab " + tabId + ", aNoNotification = " + aNoNotification);
|
||||
log("onTabRemove() ran for tab " + aWindow.BrowserApp.getTabForBrowser(aBrowser).id +
|
||||
", aNoNotification = " + aNoNotification);
|
||||
if (!aNoNotification) {
|
||||
this.saveStateDelayed();
|
||||
}
|
||||
|
@ -542,8 +548,9 @@ SessionStore.prototype = {
|
|||
},
|
||||
|
||||
onTabLoad: function ss_onTabLoad(aWindow, aBrowser) {
|
||||
// If this browser is being restored, skip any session save activity
|
||||
if (aBrowser.__SS_restore) {
|
||||
// If this browser belongs to a zombie tab or the initial restore hasn't yet finished,
|
||||
// skip any session save activity.
|
||||
if (aBrowser.__SS_restore || !this._startupRestoreFinished || aBrowser.__SS_restoreReloadPending) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -637,8 +644,9 @@ SessionStore.prototype = {
|
|||
},
|
||||
|
||||
onTabInput: function ss_onTabInput(aWindow, aBrowser) {
|
||||
// If this browser is being restored, skip any session save activity
|
||||
if (aBrowser.__SS_restore) {
|
||||
// If this browser belongs to a zombie tab or the initial restore hasn't yet finished,
|
||||
// skip any session save activity.
|
||||
if (aBrowser.__SS_restore || !this._startupRestoreFinished || aBrowser.__SS_restoreReloadPending) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -696,8 +704,9 @@ SessionStore.prototype = {
|
|||
log("onTabScroll() clearing pending timeout");
|
||||
}
|
||||
|
||||
// If this browser is being restored, skip any session save activity.
|
||||
if (aBrowser.__SS_restore) {
|
||||
// If this browser belongs to a zombie tab or the initial restore hasn't yet finished,
|
||||
// skip any session save activity.
|
||||
if (aBrowser.__SS_restore || !this._startupRestoreFinished || aBrowser.__SS_restoreReloadPending) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1479,6 +1488,13 @@ SessionStore.prototype = {
|
|||
if (window.BrowserApp.selectedTab == tab) {
|
||||
this._restoreTab(tabData, tab.browser);
|
||||
|
||||
// We can now lift the general ban on tab data capturing,
|
||||
// but we still need to protect the foreground tab until we're
|
||||
// sure it's actually reloading after history restoring has finished.
|
||||
tab.browser.__SS_restoreReloadPending = true;
|
||||
this._startupRestoreFinished = true;
|
||||
log("startupRestoreFinished = true");
|
||||
|
||||
delete tab.browser.__SS_restore;
|
||||
tab.browser.removeAttribute("pending");
|
||||
} else {
|
||||
|
|
|
@ -30,7 +30,7 @@ pref("services.sync.engine.history", true);
|
|||
pref("services.sync.engine.passwords", true);
|
||||
pref("services.sync.engine.prefs", true);
|
||||
pref("services.sync.engine.tabs", true);
|
||||
pref("services.sync.engine.tabs.filteredUrls", "^(about:.*|chrome://weave/.*|wyciwyg:.*|file:.*)$");
|
||||
pref("services.sync.engine.tabs.filteredUrls", "^(about:.*|chrome://weave/.*|wyciwyg:.*|file:.*|blob:.*)$");
|
||||
|
||||
pref("services.sync.jpake.serverURL", "https://setup.services.mozilla.com/");
|
||||
pref("services.sync.jpake.pollInterval", 1000);
|
||||
|
|
Загрузка…
Ссылка в новой задаче