Merge mozilla-central to b2g-inbound on a CLOSED TREE

This commit is contained in:
Carsten "Tomcat" Book 2016-01-08 15:26:31 +01:00
commit 2f118c726f
352 changed files with 9633 additions and 2212 deletions

View File

@ -389,8 +389,10 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
childDoc->SetIPCDoc(ipcDoc);
nsCOMPtr<nsITabChild> tabChild =
do_GetInterface(mDocument->DocumentNode()->GetDocShell());
static_cast<TabChild*>(tabChild.get())->
SendPDocAccessibleConstructor(ipcDoc, parentIPCDoc, id);
if (tabChild) {
static_cast<TabChild*>(tabChild.get())->
SendPDocAccessibleConstructor(ipcDoc, parentIPCDoc, id);
}
}
}

View File

@ -763,7 +763,9 @@
}
// If the browser was playing audio, we should remove the playing state.
if (this.mTab.hasAttribute("soundplaying") && this.mBrowser.lastURI != aLocation) {
if (this.mTab.hasAttribute("soundplaying") &&
(!this.mBrowser.lastURI ||
this.mBrowser.lastURI.spec != aLocation.spec)) {
this.mTab.removeAttribute("soundplaying");
this.mTabBrowser._tabAttrModified(this.mTab, ["soundplaying"]);
}

View File

@ -289,7 +289,7 @@ skip-if = os == "mac" || e10s # bug 967013; e10s: bug 1094761 - test hits the ne
[browser_datareporting_notification.js]
skip-if = !datareporting
[browser_datachoices_notification.js]
skip-if = !datareporting || e10s # bug 1113930
skip-if = !datareporting
[browser_devedition.js]
[browser_devices_get_user_media.js]
skip-if = buildapp == 'mulet' || (os == "linux" && debug) || e10s # linux: bug 976544; e10s: bug 1071623
@ -299,7 +299,6 @@ skip-if = e10s # Bug 1071623
skip-if = e10s # Bug 1071623
[browser_discovery.js]
[browser_double_close_tab.js]
skip-if = e10s
[browser_documentnavigation.js]
[browser_duplicateIDs.js]
[browser_drag.js]
@ -472,7 +471,7 @@ skip-if = e10s # Bug 1100700 - test relies on unload event firing on closed tabs
[browser_urlbarDelete.js]
[browser_urlbarEnter.js]
[browser_urlbarEnterAfterMouseOver.js]
skip-if = os == "linux" || e10s # Bug 1073339 - Investigate autocomplete test unreliability on Linux/e10s
skip-if = os == "linux" # Bug 1073339 - Investigate autocomplete test unreliability on Linux/e10s
[browser_urlbarRevert.js]
[browser_urlbarSearchSingleWordNotification.js]
[browser_urlbarSearchSuggestions.js]

View File

@ -1,3 +1,3 @@
This is the pdf.js project output, https://github.com/mozilla/pdf.js
Current extension version is: 1.3.142
Current extension version is: 1.3.161

View File

@ -13,21 +13,32 @@
* limitations under the License.
*/
/* jshint globalstrict: false */
/* globals PDFJS, global */
/* umdutils ignore */
// Initializing PDFJS global object (if still undefined)
if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window :
typeof global !== 'undefined' ? global : this).PDFJS = {};
}
PDFJS.version = '1.3.142';
PDFJS.build = 'e8db825';
(function pdfjsWrapper() {
(function (root, factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define('pdfjs-dist/build/pdf', ['exports'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports);
} else {
factory((root.pdfjsDistBuildPdf = {}));
}
}(this, function (exports) {
// Use strict in our context only - users might not want it
'use strict';
var pdfjsVersion = '1.3.161';
var pdfjsBuild = '4a215f0';
var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ?
document.currentScript.src : null;
var pdfjsLibs = {};
(function pdfjsWrapper() {
(function (root, factory) {
@ -49,6 +60,13 @@ PDFJS.build = 'e8db825';
globalScope.PDFJS = {};
}
if (typeof pdfjsVersion !== 'undefined') {
globalScope.PDFJS.version = pdfjsVersion;
}
if (typeof pdfjsVersion !== 'undefined') {
globalScope.PDFJS.build = pdfjsBuild;
}
globalScope.PDFJS.pdfBug = false;
exports.globalScope = globalScope;
@ -598,6 +616,16 @@ var XRefParseException = (function XRefParseExceptionClosure() {
return XRefParseException;
})();
var NullCharactersRegExp = /\x00/g;
function removeNullCharacters(str) {
if (typeof str !== 'string') {
warn('The argument for removeNullCharacters must be a string.');
return str;
}
return str.replace(NullCharactersRegExp, '');
}
PDFJS.removeNullCharacters = removeNullCharacters;
function bytesToString(bytes) {
assert(bytes !== null && typeof bytes === 'object' &&
@ -1462,6 +1490,7 @@ exports.log2 = log2;
exports.readInt8 = readInt8;
exports.readUint16 = readUint16;
exports.readUint32 = readUint32;
exports.removeNullCharacters = removeNullCharacters;
exports.shadow = shadow;
exports.string32 = string32;
exports.stringToBytes = stringToBytes;
@ -1484,6 +1513,7 @@ var AnnotationType = sharedUtil.AnnotationType;
var Util = sharedUtil.Util;
var isExternalLinkTargetSet = sharedUtil.isExternalLinkTargetSet;
var LinkTargetStringMap = sharedUtil.LinkTargetStringMap;
var removeNullCharacters = sharedUtil.removeNullCharacters;
var warn = sharedUtil.warn;
var CustomStyle = displayDOMUtils.CustomStyle;
@ -1523,9 +1553,18 @@ AnnotationElementFactory.prototype =
case AnnotationType.POPUP:
return new PopupAnnotationElement(parameters);
case AnnotationType.HIGHLIGHT:
return new HighlightAnnotationElement(parameters);
case AnnotationType.UNDERLINE:
return new UnderlineAnnotationElement(parameters);
case AnnotationType.SQUIGGLY:
return new SquigglyAnnotationElement(parameters);
case AnnotationType.STRIKEOUT:
return new StrikeOutAnnotationElement(parameters);
default:
throw new Error('Unimplemented annotation type "' + subtype + '"');
}
@ -1674,7 +1713,8 @@ var LinkAnnotationElement = (function LinkAnnotationElementClosure() {
this.container.className = 'linkAnnotation';
var link = document.createElement('a');
link.href = link.title = this.data.url || '';
link.href = link.title = (this.data.url ?
removeNullCharacters(this.data.url) : '');
if (this.data.url && isExternalLinkTargetSet()) {
link.target = LinkTargetStringMap[PDFJS.externalLinkTarget];
@ -2054,6 +2094,33 @@ var PopupElement = (function PopupElementClosure() {
return PopupElement;
})();
/**
* @class
* @alias HighlightAnnotationElement
*/
var HighlightAnnotationElement = (
function HighlightAnnotationElementClosure() {
function HighlightAnnotationElement(parameters) {
AnnotationElement.call(this, parameters);
}
Util.inherit(HighlightAnnotationElement, AnnotationElement, {
/**
* Render the highlight annotation's HTML element in the empty container.
*
* @public
* @memberof HighlightAnnotationElement
* @returns {HTMLSectionElement}
*/
render: function HighlightAnnotationElement_render() {
this.container.className = 'highlightAnnotation';
return this.container;
}
});
return HighlightAnnotationElement;
})();
/**
* @class
* @alias UnderlineAnnotationElement
@ -2081,6 +2148,59 @@ var UnderlineAnnotationElement = (
return UnderlineAnnotationElement;
})();
/**
* @class
* @alias SquigglyAnnotationElement
*/
var SquigglyAnnotationElement = (function SquigglyAnnotationElementClosure() {
function SquigglyAnnotationElement(parameters) {
AnnotationElement.call(this, parameters);
}
Util.inherit(SquigglyAnnotationElement, AnnotationElement, {
/**
* Render the squiggly annotation's HTML element in the empty container.
*
* @public
* @memberof SquigglyAnnotationElement
* @returns {HTMLSectionElement}
*/
render: function SquigglyAnnotationElement_render() {
this.container.className = 'squigglyAnnotation';
return this.container;
}
});
return SquigglyAnnotationElement;
})();
/**
* @class
* @alias StrikeOutAnnotationElement
*/
var StrikeOutAnnotationElement = (
function StrikeOutAnnotationElementClosure() {
function StrikeOutAnnotationElement(parameters) {
AnnotationElement.call(this, parameters);
}
Util.inherit(StrikeOutAnnotationElement, AnnotationElement, {
/**
* Render the strikeout annotation's HTML element in the empty container.
*
* @public
* @memberof StrikeOutAnnotationElement
* @returns {HTMLSectionElement}
*/
render: function StrikeOutAnnotationElement_render() {
this.container.className = 'strikeoutAnnotation';
return this.container;
}
});
return StrikeOutAnnotationElement;
})();
/**
* @typedef {Object} AnnotationLayerParameters
* @property {PageViewport} viewport
@ -5699,10 +5819,10 @@ exports.createScratchCanvas = createScratchCanvas;
{
factory((root.pdfjsDisplayAPI = {}), root.pdfjsSharedUtil,
root.pdfjsDisplayFontLoader, root.pdfjsDisplayCanvas,
root.pdfjsSharedGlobal);
root.pdfjsDisplayMetadata, root.pdfjsSharedGlobal);
}
}(this, function (exports, sharedUtil, displayFontLoader, displayCanvas,
sharedGlobal, amdRequire) {
displayMetadata, sharedGlobal, amdRequire) {
var InvalidPDFException = sharedUtil.InvalidPDFException;
var MessageHandler = sharedUtil.MessageHandler;
@ -5726,6 +5846,7 @@ var FontFaceObject = displayFontLoader.FontFaceObject;
var FontLoader = displayFontLoader.FontLoader;
var CanvasGraphics = displayCanvas.CanvasGraphics;
var createScratchCanvas = displayCanvas.createScratchCanvas;
var Metadata = displayMetadata.Metadata;
var PDFJS = sharedGlobal.PDFJS;
var globalScope = sharedGlobal.globalScope;
@ -6844,6 +6965,13 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
var PDFWorker = (function PDFWorkerClosure() {
var nextFakeWorkerId = 0;
function getWorkerSrc() {
if (PDFJS.workerSrc) {
return PDFJS.workerSrc;
}
error('No PDFJS.workerSrc specified');
}
// Loads worker code into main thread.
function setupFakeWorkerGlobal() {
if (!PDFJS.fakeWorkerFilesLoadedCapability) {
@ -6852,7 +6980,7 @@ var PDFWorker = (function PDFWorkerClosure() {
// other files and resolves the promise. In production only the
// pdf.worker.js file is needed.
var loader = fakeWorkerFilesLoader || function (callback) {
Util.loadScript(PDFJS.workerSrc, callback);
Util.loadScript(getWorkerSrc(), callback);
};
loader(function () {
PDFJS.fakeWorkerFilesLoadedCapability.resolve();
@ -6892,10 +7020,7 @@ var PDFWorker = (function PDFWorkerClosure() {
// Right now, the requirement is, that an Uint8Array is still an
// Uint8Array as it arrives on the worker. (Chrome added this with v.15.)
if (!globalScope.PDFJS.disableWorker && typeof Worker !== 'undefined') {
var workerSrc = PDFJS.workerSrc;
if (!workerSrc) {
error('No PDFJS.workerSrc specified');
}
var workerSrc = getWorkerSrc();
try {
// Some versions of FF can't create a worker on localhost, see:
@ -7447,7 +7572,7 @@ var WorkerTransport = (function WorkerTransportClosure() {
then(function transportMetadata(results) {
return {
info: results[0],
metadata: (results[1] ? new PDFJS.Metadata(results[1]) : null)
metadata: (results[1] ? new Metadata(results[1]) : null)
};
});
},
@ -7780,7 +7905,22 @@ exports.PDFPageProxy = PDFPageProxy;
}));
}).call((typeof window === 'undefined') ? this : window);
}).call(pdfjsLibs);
exports.PDFJS = pdfjsLibs.pdfjsSharedGlobal.PDFJS;
exports.getDocument = pdfjsLibs.pdfjsDisplayAPI.getDocument;
exports.PDFDataRangeTransport =
pdfjsLibs.pdfjsDisplayAPI.PDFDataRangeTransport;
exports.renderTextLayer = pdfjsLibs.pdfjsDisplayTextLayer.renderTextLayer;
exports.AnnotationLayer =
pdfjsLibs.pdfjsDisplayAnnotationLayer.AnnotationLayer;
exports.CustomStyle = pdfjsLibs.pdfjsDisplayDOMUtils.CustomStyle;
exports.PasswordResponses = pdfjsLibs.pdfjsSharedUtil.PasswordResponses;
exports.InvalidPDFException = pdfjsLibs.pdfjsSharedUtil.InvalidPDFException;
exports.MissingPDFException = pdfjsLibs.pdfjsSharedUtil.MissingPDFException;
exports.UnexpectedResponseException =
pdfjsLibs.pdfjsSharedUtil.UnexpectedResponseException;
}));

View File

@ -13,21 +13,32 @@
* limitations under the License.
*/
/* jshint globalstrict: false */
/* globals PDFJS, global */
/* umdutils ignore */
// Initializing PDFJS global object (if still undefined)
if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window :
typeof global !== 'undefined' ? global : this).PDFJS = {};
}
PDFJS.version = '1.3.142';
PDFJS.build = 'e8db825';
(function pdfjsWrapper() {
(function (root, factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define('pdfjs-dist/build/pdf.worker', ['exports'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports);
} else {
factory((root.pdfjsDistBuildPdfWorker = {}));
}
}(this, function (exports) {
// Use strict in our context only - users might not want it
'use strict';
var pdfjsVersion = '1.3.161';
var pdfjsBuild = '4a215f0';
var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ?
document.currentScript.src : null;
var pdfjsLibs = {};
(function pdfjsWrapper() {
(function (root, factory) {
@ -8738,6 +8749,13 @@ exports.Metrics = Metrics;
globalScope.PDFJS = {};
}
if (typeof pdfjsVersion !== 'undefined') {
globalScope.PDFJS.version = pdfjsVersion;
}
if (typeof pdfjsVersion !== 'undefined') {
globalScope.PDFJS.build = pdfjsBuild;
}
globalScope.PDFJS.pdfBug = false;
exports.globalScope = globalScope;
@ -9637,6 +9655,16 @@ var XRefParseException = (function XRefParseExceptionClosure() {
return XRefParseException;
})();
var NullCharactersRegExp = /\x00/g;
function removeNullCharacters(str) {
if (typeof str !== 'string') {
warn('The argument for removeNullCharacters must be a string.');
return str;
}
return str.replace(NullCharactersRegExp, '');
}
PDFJS.removeNullCharacters = removeNullCharacters;
function bytesToString(bytes) {
assert(bytes !== null && typeof bytes === 'object' &&
@ -10501,6 +10529,7 @@ exports.log2 = log2;
exports.readInt8 = readInt8;
exports.readUint16 = readUint16;
exports.readUint32 = readUint32;
exports.removeNullCharacters = removeNullCharacters;
exports.shadow = shadow;
exports.string32 = string32;
exports.stringToBytes = stringToBytes;
@ -24015,6 +24044,9 @@ var HINTING_ENABLED = false;
// to control analysis of seac charstrings.
var SEAC_ANALYSIS_ENABLED = false;
// Maximum subroutine call depth of type 2 chartrings. Matches OTS.
var MAX_SUBR_NESTING = 10;
var FontFlags = {
FixedPitch: 1,
Serif: 2,
@ -30044,10 +30076,7 @@ var CFFParser = (function CFFParserClosure() {
cff.isCIDFont = topDict.hasName('ROS');
var charStringOffset = topDict.getByName('CharStrings');
var charStringsAndSeacs = this.parseCharStrings(charStringOffset);
cff.charStrings = charStringsAndSeacs.charStrings;
cff.seacs = charStringsAndSeacs.seacs;
cff.widths = charStringsAndSeacs.widths;
var charStringIndex = this.parseIndex(charStringOffset).obj;
var fontMatrix = topDict.getByName('FontMatrix');
if (fontMatrix) {
@ -30075,19 +30104,30 @@ var CFFParser = (function CFFParserClosure() {
// cid fonts don't have an encoding
encoding = null;
charset = this.parseCharsets(topDict.getByName('charset'),
cff.charStrings.count, cff.strings, true);
charStringIndex.count, cff.strings, true);
cff.fdSelect = this.parseFDSelect(topDict.getByName('FDSelect'),
cff.charStrings.count);
charStringIndex.count);
} else {
charset = this.parseCharsets(topDict.getByName('charset'),
cff.charStrings.count, cff.strings, false);
charStringIndex.count, cff.strings, false);
encoding = this.parseEncoding(topDict.getByName('Encoding'),
properties,
cff.strings, charset.charset);
}
cff.charset = charset;
cff.encoding = encoding;
var charStringsAndSeacs = this.parseCharStrings(
charStringIndex,
topDict.privateDict.subrsIndex,
globalSubrIndex.obj,
cff.fdSelect,
cff.fdArray);
cff.charStrings = charStringsAndSeacs.charStrings;
cff.seacs = charStringsAndSeacs.seacs;
cff.widths = charStringsAndSeacs.widths;
return cff;
},
parseHeader: function CFFParser_parseHeader() {
@ -30262,118 +30302,201 @@ var CFFParser = (function CFFParserClosure() {
}
return cffDict;
},
parseCharStrings: function CFFParser_parseCharStrings(charStringOffset) {
var charStrings = this.parseIndex(charStringOffset).obj;
parseCharString: function CFFParser_parseCharString(state, data,
localSubrIndex,
globalSubrIndex) {
if (state.callDepth > MAX_SUBR_NESTING) {
return false;
}
var stackSize = state.stackSize;
var stack = state.stack;
var length = data.length;
for (var j = 0; j < length;) {
var value = data[j++];
var validationCommand = null;
if (value === 12) {
var q = data[j++];
if (q === 0) {
// The CFF specification state that the 'dotsection' command
// (12, 0) is deprecated and treated as a no-op, but all Type2
// charstrings processors should support them. Unfortunately
// the font sanitizer don't. As a workaround the sequence (12, 0)
// is replaced by a useless (0, hmoveto).
data[j - 2] = 139;
data[j - 1] = 22;
stackSize = 0;
} else {
validationCommand = CharstringValidationData12[q];
}
} else if (value === 28) { // number (16 bit)
stack[stackSize] = ((data[j] << 24) | (data[j + 1] << 16)) >> 16;
j += 2;
stackSize++;
} else if (value === 14) {
if (stackSize >= 4) {
stackSize -= 4;
if (SEAC_ANALYSIS_ENABLED) {
state.seac = stack.slice(stackSize, stackSize + 4);
return false;
}
}
validationCommand = CharstringValidationData[value];
} else if (value >= 32 && value <= 246) { // number
stack[stackSize] = value - 139;
stackSize++;
} else if (value >= 247 && value <= 254) { // number (+1 bytes)
stack[stackSize] = (value < 251 ?
((value - 247) << 8) + data[j] + 108 :
-((value - 251) << 8) - data[j] - 108);
j++;
stackSize++;
} else if (value === 255) { // number (32 bit)
stack[stackSize] = ((data[j] << 24) | (data[j + 1] << 16) |
(data[j + 2] << 8) | data[j + 3]) / 65536;
j += 4;
stackSize++;
} else if (value === 19 || value === 20) {
state.hints += stackSize >> 1;
// skipping right amount of hints flag data
j += (state.hints + 7) >> 3;
stackSize %= 2;
validationCommand = CharstringValidationData[value];
} else if (value === 10 || value === 29) {
var subrsIndex;
if (value === 10) {
subrsIndex = localSubrIndex;
} else {
subrsIndex = globalSubrIndex;
}
if (!subrsIndex) {
validationCommand = CharstringValidationData[value];
warn('Missing subrsIndex for ' + validationCommand.id);
return false;
}
var bias = 32768;
if (subrsIndex.count < 1240) {
bias = 107;
} else if (subrsIndex.count < 33900) {
bias = 1131;
}
var subrNumber = stack[--stackSize] + bias;
if (subrNumber < 0 || subrNumber >= subrsIndex.count) {
validationCommand = CharstringValidationData[value];
warn('Out of bounds subrIndex for ' + validationCommand.id);
return false;
}
state.stackSize = stackSize;
state.callDepth++;
var valid = this.parseCharString(state, subrsIndex.get(subrNumber),
localSubrIndex, globalSubrIndex);
if (!valid) {
return false;
}
state.callDepth--;
stackSize = state.stackSize;
continue;
} else if (value === 11) {
state.stackSize = stackSize;
return true;
} else {
validationCommand = CharstringValidationData[value];
}
if (validationCommand) {
if (validationCommand.stem) {
state.hints += stackSize >> 1;
}
if ('min' in validationCommand) {
if (!state.undefStack && stackSize < validationCommand.min) {
warn('Not enough parameters for ' + validationCommand.id +
'; actual: ' + stackSize +
', expected: ' + validationCommand.min);
return false;
}
}
if (state.firstStackClearing && validationCommand.stackClearing) {
state.firstStackClearing = false;
// the optional character width can be found before the first
// stack-clearing command arguments
stackSize -= validationCommand.min;
if (stackSize >= 2 && validationCommand.stem) {
// there are even amount of arguments for stem commands
stackSize %= 2;
} else if (stackSize > 1) {
warn('Found too many parameters for stack-clearing command');
}
if (stackSize > 0 && stack[stackSize - 1] >= 0) {
state.width = stack[stackSize - 1];
}
}
if ('stackDelta' in validationCommand) {
if ('stackFn' in validationCommand) {
validationCommand.stackFn(stack, stackSize);
}
stackSize += validationCommand.stackDelta;
} else if (validationCommand.stackClearing) {
stackSize = 0;
} else if (validationCommand.resetStack) {
stackSize = 0;
state.undefStack = false;
} else if (validationCommand.undefStack) {
stackSize = 0;
state.undefStack = true;
state.firstStackClearing = false;
}
}
}
state.stackSize = stackSize;
return true;
},
parseCharStrings: function CFFParser_parseCharStrings(charStrings,
localSubrIndex,
globalSubrIndex,
fdSelect,
fdArray) {
var seacs = [];
var widths = [];
var count = charStrings.count;
for (var i = 0; i < count; i++) {
var charstring = charStrings.get(i);
var stackSize = 0;
var stack = [];
var undefStack = true;
var hints = 0;
var state = {
callDepth: 0,
stackSize: 0,
stack: [],
undefStack: true,
hints: 0,
firstStackClearing: true,
seac: null,
width: null
};
var valid = true;
var data = charstring;
var length = data.length;
var firstStackClearing = true;
for (var j = 0; j < length;) {
var value = data[j++];
var validationCommand = null;
if (value === 12) {
var q = data[j++];
if (q === 0) {
// The CFF specification state that the 'dotsection' command
// (12, 0) is deprecated and treated as a no-op, but all Type2
// charstrings processors should support them. Unfortunately
// the font sanitizer don't. As a workaround the sequence (12, 0)
// is replaced by a useless (0, hmoveto).
data[j - 2] = 139;
data[j - 1] = 22;
stackSize = 0;
} else {
validationCommand = CharstringValidationData12[q];
}
} else if (value === 28) { // number (16 bit)
stack[stackSize] = ((data[j] << 24) | (data[j + 1] << 16)) >> 16;
j += 2;
stackSize++;
} else if (value === 14) {
if (stackSize >= 4) {
stackSize -= 4;
if (SEAC_ANALYSIS_ENABLED) {
seacs[i] = stack.slice(stackSize, stackSize + 4);
valid = false;
}
}
validationCommand = CharstringValidationData[value];
} else if (value >= 32 && value <= 246) { // number
stack[stackSize] = value - 139;
stackSize++;
} else if (value >= 247 && value <= 254) { // number (+1 bytes)
stack[stackSize] = (value < 251 ?
((value - 247) << 8) + data[j] + 108 :
-((value - 251) << 8) - data[j] - 108);
j++;
stackSize++;
} else if (value === 255) { // number (32 bit)
stack[stackSize] = ((data[j] << 24) | (data[j + 1] << 16) |
(data[j + 2] << 8) | data[j + 3]) / 65536;
j += 4;
stackSize++;
} else if (value === 19 || value === 20) {
hints += stackSize >> 1;
j += (hints + 7) >> 3; // skipping right amount of hints flag data
stackSize %= 2;
validationCommand = CharstringValidationData[value];
} else {
validationCommand = CharstringValidationData[value];
var localSubrToUse = null;
if (fdSelect && fdArray.length) {
var fdIndex = fdSelect.getFDIndex(i);
if (fdIndex === -1) {
warn('Glyph index is not in fd select.');
valid = false;
}
if (validationCommand) {
if (validationCommand.stem) {
hints += stackSize >> 1;
}
if ('min' in validationCommand) {
if (!undefStack && stackSize < validationCommand.min) {
warn('Not enough parameters for ' + validationCommand.id +
'; actual: ' + stackSize +
', expected: ' + validationCommand.min);
valid = false;
break;
}
}
if (firstStackClearing && validationCommand.stackClearing) {
firstStackClearing = false;
// the optional character width can be found before the first
// stack-clearing command arguments
stackSize -= validationCommand.min;
if (stackSize >= 2 && validationCommand.stem) {
// there are even amount of arguments for stem commands
stackSize %= 2;
} else if (stackSize > 1) {
warn('Found too many parameters for stack-clearing command');
}
if (stackSize > 0 && stack[stackSize - 1] >= 0) {
widths[i] = stack[stackSize - 1];
}
}
if ('stackDelta' in validationCommand) {
if ('stackFn' in validationCommand) {
validationCommand.stackFn(stack, stackSize);
}
stackSize += validationCommand.stackDelta;
} else if (validationCommand.stackClearing) {
stackSize = 0;
} else if (validationCommand.resetStack) {
stackSize = 0;
undefStack = false;
} else if (validationCommand.undefStack) {
stackSize = 0;
undefStack = true;
firstStackClearing = false;
}
if (fdIndex >= fdArray.length) {
warn('Invalid fd index for glyph index.');
valid = false;
}
if (valid) {
localSubrToUse = fdArray[fdIndex].privateDict.subrsIndex;
}
} else if (localSubrIndex) {
localSubrToUse = localSubrIndex;
}
if (valid) {
valid = this.parseCharString(state, charstring, localSubrToUse,
globalSubrIndex);
}
if (state.width !== null) {
widths[i] = state.width;
}
if (state.seac !== null) {
seacs[i] = state.seac;
}
if (!valid) {
// resetting invalid charstring to single 'endchar'
@ -30868,6 +30991,14 @@ var CFFFDSelect = (function CFFFDSelectClosure() {
this.fdSelect = fdSelect;
this.raw = raw;
}
CFFFDSelect.prototype = {
getFDIndex: function CFFFDSelect_get(glyphIndex) {
if (glyphIndex < 0 || glyphIndex >= this.fdSelect.length) {
return -1;
}
return this.fdSelect[glyphIndex];
}
};
return CFFFDSelect;
})();
@ -34555,10 +34686,8 @@ var Pattern = (function PatternClosure() {
var Shadings = {};
// A small number to offset the first/last color stops so we can insert ones to
// support extend. Number.MIN_VALUE appears to be too small and breaks the
// extend. 1e-7 works in FF but chrome seems to use an even smaller sized number
// internally so we have to go bigger.
Shadings.SMALL_NUMBER = 1e-2;
// support extend. Number.MIN_VALUE is too small and breaks the extend.
Shadings.SMALL_NUMBER = 1e-6;
// Radial and axial shading have very similar implementations
// If needed, the implementations can be broken into two classes
@ -38295,9 +38424,18 @@ AnnotationFactory.prototype = /** @lends AnnotationFactory.prototype */ {
case 'Popup':
return new PopupAnnotation(parameters);
case 'Highlight':
return new HighlightAnnotation(parameters);
case 'Underline':
return new UnderlineAnnotation(parameters);
case 'Squiggly':
return new SquigglyAnnotation(parameters);
case 'StrikeOut':
return new StrikeOutAnnotation(parameters);
default:
warn('Unimplemented annotation type "' + subtype + '", ' +
'falling back to base annotation');
@ -38988,6 +39126,22 @@ var PopupAnnotation = (function PopupAnnotationClosure() {
return PopupAnnotation;
})();
var HighlightAnnotation = (function HighlightAnnotationClosure() {
function HighlightAnnotation(parameters) {
Annotation.call(this, parameters);
this.data.annotationType = AnnotationType.HIGHLIGHT;
this.data.hasHtml = true;
// PDF viewers completely ignore any border styles.
this.data.borderStyle.setWidth(0);
}
Util.inherit(HighlightAnnotation, Annotation, {});
return HighlightAnnotation;
})();
var UnderlineAnnotation = (function UnderlineAnnotationClosure() {
function UnderlineAnnotation(parameters) {
Annotation.call(this, parameters);
@ -39004,6 +39158,38 @@ var UnderlineAnnotation = (function UnderlineAnnotationClosure() {
return UnderlineAnnotation;
})();
var SquigglyAnnotation = (function SquigglyAnnotationClosure() {
function SquigglyAnnotation(parameters) {
Annotation.call(this, parameters);
this.data.annotationType = AnnotationType.SQUIGGLY;
this.data.hasHtml = true;
// PDF viewers completely ignore any border styles.
this.data.borderStyle.setWidth(0);
}
Util.inherit(SquigglyAnnotation, Annotation, {});
return SquigglyAnnotation;
})();
var StrikeOutAnnotation = (function StrikeOutAnnotationClosure() {
function StrikeOutAnnotation(parameters) {
Annotation.call(this, parameters);
this.data.annotationType = AnnotationType.STRIKEOUT;
this.data.hasHtml = true;
// PDF viewers completely ignore any border styles.
this.data.borderStyle.setWidth(0);
}
Util.inherit(StrikeOutAnnotation, Annotation, {});
return StrikeOutAnnotation;
})();
exports.Annotation = Annotation;
exports.AnnotationBorderStyle = AnnotationBorderStyle;
exports.AnnotationFactory = AnnotationFactory;
@ -40418,7 +40604,10 @@ exports.WorkerMessageHandler = WorkerMessageHandler;
}));
}).call((typeof window === 'undefined') ? this : window);
}).call(pdfjsLibs);
exports.PDFJS = pdfjsLibs.pdfjsSharedGlobal.PDFJS;
}));

View File

@ -129,7 +129,10 @@
padding-top: 0.2em;
}
.annotationLayer .underlineAnnotation {
.annotationLayer .highlightAnnotation,
.annotationLayer .underlineAnnotation,
.annotationLayer .squigglyAnnotation,
.annotationLayer .strikeoutAnnotation {
cursor: pointer;
}

View File

@ -52,12 +52,6 @@ var MAX_AUTO_SCALE = 1.25;
var SCROLLBAR_PADDING = 40;
var VERTICAL_PADDING = 5;
var NullCharactersRegExp = /\x00/g;
function removeNullCharacters(str) {
return str.replace(NullCharactersRegExp, '');
}
function getFileName(url) {
var anchor = url.indexOf('#');
var query = url.indexOf('?');
@ -5828,7 +5822,7 @@ var PDFOutlineView = (function PDFOutlineViewClosure() {
div.className = 'outlineItem';
var element = document.createElement('a');
this._bindLink(element, item);
element.textContent = removeNullCharacters(item.title);
element.textContent = PDFJS.removeNullCharacters(item.title);
div.appendChild(element);
if (item.items.length > 0) {
@ -5932,7 +5926,7 @@ var PDFAttachmentView = (function PDFAttachmentViewClosure() {
div.className = 'attachmentsItem';
var button = document.createElement('button');
this._bindLink(button, item.content, filename);
button.textContent = removeNullCharacters(filename);
button.textContent = PDFJS.removeNullCharacters(filename);
div.appendChild(button);
this.container.appendChild(div);
}

View File

@ -4,7 +4,6 @@ support-files =
file_disableScript.html
[test_app_principal_equality.html]
skip-if = e10s
[test_bug246699.html]
[test_bug292789.html]
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage

View File

@ -13,25 +13,47 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=777467
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=777467">Mozilla Bug 777467</a>
<p id="display"></p>
<script>
// Initialization.
SpecialPowers.addPermission("browser", true, document);
SpecialPowers.addPermission("embed-apps", true, document);
SpecialPowers.setBoolPref('dom.mozBrowserFramesEnabled', true);
SpecialPowers.setBoolPref("dom.ipc.browser_frames.oop_by_default", false);
</script>
<div id="content" style="display: none;">
<iframe src="error404"></iframe>
<iframe mozbrowser src="error404"></iframe>
<iframe mozapp="http://example.org/manifest.webapp" mozbrowser src="error404"></iframe>
</div>
<pre id="test">
<script type="application/javascript">
/** Test for app principal's equality **/
SimpleTest.waitForExplicitFinish();
var permissions = new Promise(resolve => {
SpecialPowers.pushPermissions(
[{ type: "browser", allow: true, context: document },
{ type: "embed-apps", allow: true, context: document }],
resolve);
});
permissions.then(() => {
$('content').innerHTML =
'<iframe src="error404"></iframe>\n' +
'<iframe mozbrowser src="error404"></iframe>\n' +
'<iframe mozapp="http://example.org/manifest.webapp" mozbrowser src="error404"></iframe>';
var iframes = document.getElementsByTagName("iframe");
var promises = []
for (var i = 0; i < promises.length; ++i) {
promises.push(new Promise(resolve => {
iframes[i].addEventListener("load", resolve);
}));
}
return Promise.all(promises);
});
var prefs = new Promise(resolve => {
SpecialPowers.pushPrefEnv(
{ set: [[ "dom.mozBrowserFramesEnabled", true ],
[ "dom.ipc.browser_frames.oop_by_default", false ]] },
resolve);
});
</script>
<div id="content" style="display: none;">
</div>
<pre id="test">
<script type="application/javascript">
function canAccessDocument(win) {
var result = true;
try {
@ -42,7 +64,11 @@ function canAccessDocument(win) {
return result;
}
addLoadEvent(function() {
var loaded = new Promise(resolve => addLoadEvent(resolve));
Promise.all([ permissions, prefs, loaded ]).then(runTest);
function runTest() {
// Test the witness frame (we can access same-origin frame).
is(canAccessDocument(frames[0]), true,
"should be able to access the first frame");
@ -53,14 +79,8 @@ addLoadEvent(function() {
"should not be able to access the other frames");
}
// Cleanup.
SpecialPowers.clearUserPref('dom.mozBrowserFramesEnabled');
SpecialPowers.clearUserPref('dom.ipc.browser_frames.oop_by_default');
SpecialPowers.removePermission("browser", window.document);
SpecialPowers.removePermission("embed-apps", window.document);
SimpleTest.finish();
});
}
</script>
</pre>

View File

@ -1448,7 +1448,7 @@ if test "$GNU_CC"; then
# -Wall - lots of useful warnings
# -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
# -Wignored-qualifiers - catches returns types with qualifiers like const
# -Wignored-qualifiers - catches return types with qualifiers like const
# -Wpointer-arith - catches pointer arithmetic using NULL or sizeof(void)
# -Wtype-limits - catches overflow bugs, few false positives
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall"
@ -1530,11 +1530,13 @@ if test "$GNU_CXX"; then
# -Wall - lots of useful warnings
# -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
# -Wignored-qualifiers - catches return types with qualifiers like const
# -Woverloaded-virtual - function declaration hides virtual function from base class
# -Wpointer-arith - catches pointer arithmetic using NULL or sizeof(void)
# -Wtype-limits - catches overflow bugs, few false positives
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wempty-body"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wignored-qualifiers"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Woverloaded-virtual"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wpointer-arith"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wtype-limits"

View File

@ -15,7 +15,7 @@ var {HostType} = require("devtools/client/framework/toolbox").Toolbox;
loader.lazyRequireGetter(this, "CSS", "CSS");
loader.lazyGetter(this, "MarkupView", () => require("devtools/client/markupview/markup-view").MarkupView);
loader.lazyGetter(this, "MarkupView", () => require("devtools/client/inspector/markup/markup").MarkupView);
loader.lazyGetter(this, "HTMLBreadcrumbs", () => require("devtools/client/inspector/breadcrumbs").HTMLBreadcrumbs);
loader.lazyGetter(this, "ToolSidebar", () => require("devtools/client/framework/sidebar").ToolSidebar);
loader.lazyGetter(this, "InspectorSearch", () => require("devtools/client/inspector/inspector-search").InspectorSearch);
@ -924,7 +924,7 @@ InspectorPanel.prototype = {
this._markupBox.setAttribute("collapsed", true);
this._markupBox.appendChild(this._markupFrame);
this._markupFrame.setAttribute("src", "chrome://devtools/content/markupview/markup-view.xhtml");
this._markupFrame.setAttribute("src", "chrome://devtools/content/inspector/markup/markup.xhtml");
this._markupFrame.setAttribute("aria-label", strings.GetStringFromName("inspector.panelLabel.markupView"));
},

View File

@ -26,7 +26,7 @@ function stopPropagation(e) {
* way is that the editor is loaded in an iframe, and calling appendChild
* causes it to reload.
*
* Meant to be embedded inside of an HTML page, as in markup-view.xhtml.
* Meant to be embedded inside of an HTML page, as in markup.xhtml.
*
* @param HTMLDocument htmlDocument
* The document to attach the editor to. Will also use this

View File

@ -21,7 +21,7 @@ const AUTOCOMPLETE_POPUP_PANEL_ID = "markupview_autoCompletePopup";
const {UndoStack} = require("devtools/client/shared/undo");
const {editableField, InplaceEditor} = require("devtools/client/shared/inplace-editor");
const {HTMLEditor} = require("devtools/client/markupview/html-editor");
const {HTMLEditor} = require("devtools/client/inspector/markup/html-editor");
const promise = require("promise");
const {Tooltip} = require("devtools/client/shared/widgets/Tooltip");
const EventEmitter = require("devtools/shared/event-emitter");
@ -62,7 +62,7 @@ loader.lazyGetter(this, "AutocompletePopup", () => {
* @param Inspector aInspector
* The inspector we're watching.
* @param iframe aFrame
* An iframe in which the caller has kindly loaded markup-view.xhtml.
* An iframe in which the caller has kindly loaded markup.xhtml.
*/
function MarkupView(aInspector, aFrame, aControllerWindow) {
this._inspector = aInspector;
@ -361,7 +361,7 @@ MarkupView.prototype = {
return promise.all([onShown, this._briefBoxModelPromise.promise]);
},
template: function(aName, aDest, aOptions={stack: "markup-view.xhtml"}) {
template: function(aName, aDest, aOptions={stack: "markup.xhtml"}) {
let node = this.doc.getElementById("template-" + aName).cloneNode(true);
node.removeAttribute("id");
template(node, aDest, aOptions);

View File

@ -7,8 +7,8 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" href="chrome://devtools/content/markupview/markup-view.css" type="text/css"/>
<link rel="stylesheet" href="chrome://devtools/skin/markup-view.css" type="text/css"/>
<link rel="stylesheet" href="chrome://devtools/content/inspector/markup/markup.css" type="text/css"/>
<link rel="stylesheet" href="chrome://devtools/skin/markup.css" type="text/css"/>
<link rel="stylesheet" href="chrome://devtools/skin/common.css" type="text/css"/>
<script type="application/javascript;version=1.8"

View File

@ -4,9 +4,9 @@
# 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/.
BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
DevToolsModules(
'html-editor.js',
'markup-view.js',
'markup.js',
)
BROWSER_CHROME_MANIFESTS += ['test/browser.ini']

View File

@ -1,4 +1,4 @@
{
// Extend from the shared list of defined globals for mochitests.
"extends": "../../../.eslintrc.mochitests"
"extends": "../../../../.eslintrc.mochitests"
}

View File

@ -0,0 +1,124 @@
[DEFAULT]
tags = devtools
subsuite = devtools
support-files =
actor_events_form.js
doc_markup_anonymous.html
doc_markup_dragdrop.html
doc_markup_dragdrop_autoscroll.html
doc_markup_edit.html
doc_markup_events.html
doc_markup_events_form.html
doc_markup_events_jquery.html
doc_markup_events-overflow.html
doc_markup_flashing.html
doc_markup_links.html
doc_markup_mutation.html
doc_markup_navigation.html
doc_markup_not_displayed.html
doc_markup_pagesize_01.html
doc_markup_pagesize_02.html
doc_markup_search.html
doc_markup_svg_attributes.html
doc_markup_toggle.html
doc_markup_tooltip.png
doc_markup_xul.xul
head.js
helper_attributes_test_runner.js
helper_events_test_runner.js
helper_outerhtml_test_runner.js
lib_jquery_1.0.js
lib_jquery_1.1.js
lib_jquery_1.2_min.js
lib_jquery_1.3_min.js
lib_jquery_1.4_min.js
lib_jquery_1.6_min.js
lib_jquery_1.7_min.js
lib_jquery_1.11.1_min.js
lib_jquery_2.1.1_min.js
[browser_markup_anonymous_01.js]
[browser_markup_anonymous_02.js]
skip-if = e10s # scratchpad.xul is not loading in e10s window
[browser_markup_anonymous_03.js]
[browser_markup_anonymous_04.js]
[browser_markup_copy_image_data.js]
[browser_markup_css_completion_style_attribute.js]
[browser_markup_dragdrop_autoscroll.js]
skip-if = e10s && os == 'win'
[browser_markup_dragdrop_distance.js]
[browser_markup_dragdrop_dragRootNode.js]
[browser_markup_dragdrop_escapeKeyPress.js]
[browser_markup_dragdrop_invalidNodes.js]
[browser_markup_dragdrop_reorder.js]
[browser_markup_dragdrop_tooltip.js]
[browser_markup_events.js]
skip-if = e10s # Bug 1040751 - CodeMirror editor.destroy() isn't e10s compatible
[browser_markup_events_form.js]
# [browser_markup_events-overflow.js]
# skip-if = e10s # Bug 1040751 - CodeMirror editor.destroy() isn't e10s compatible
# disabled - See bug 1177550
[browser_markup_events_jquery_1.0.js]
skip-if = e10s # Bug 1040751 - CodeMirror editor.destroy() isn't e10s compatible
[browser_markup_events_jquery_1.1.js]
skip-if = e10s # Bug 1040751 - CodeMirror editor.destroy() isn't e10s compatible
[browser_markup_events_jquery_1.2.js]
skip-if = e10s # Bug 1040751 - CodeMirror editor.destroy() isn't e10s compatible
[browser_markup_events_jquery_1.3.js]
skip-if = e10s # Bug 1040751 - CodeMirror editor.destroy() isn't e10s compatible
[browser_markup_events_jquery_1.4.js]
skip-if = e10s # Bug 1040751 - CodeMirror editor.destroy() isn't e10s compatible
[browser_markup_events_jquery_1.6.js]
skip-if = e10s # Bug 1040751 - CodeMirror editor.destroy() isn't e10s compatible
[browser_markup_events_jquery_1.7.js]
skip-if = e10s # Bug 1040751 - CodeMirror editor.destroy() isn't e10s compatible
[browser_markup_events_jquery_1.11.1.js]
skip-if = e10s # Bug 1040751 - CodeMirror editor.destroy() isn't e10s compatible
[browser_markup_events_jquery_2.1.1.js]
skip-if = e10s # Bug 1040751 - CodeMirror editor.destroy() isn't e10s compatible
[browser_markup_links_01.js]
[browser_markup_links_02.js]
[browser_markup_links_03.js]
[browser_markup_links_04.js]
[browser_markup_links_05.js]
[browser_markup_links_06.js]
[browser_markup_links_07.js]
[browser_markup_load_01.js]
[browser_markup_html_edit_01.js]
[browser_markup_html_edit_02.js]
[browser_markup_html_edit_03.js]
[browser_markup_image_tooltip.js]
[browser_markup_image_tooltip_mutations.js]
[browser_markup_keybindings_01.js]
[browser_markup_keybindings_02.js]
[browser_markup_keybindings_03.js]
[browser_markup_keybindings_04.js]
[browser_markup_keybindings_delete_attributes.js]
[browser_markup_mutation_01.js]
[browser_markup_mutation_02.js]
[browser_markup_navigation.js]
[browser_markup_node_not_displayed_01.js]
[browser_markup_node_not_displayed_02.js]
[browser_markup_pagesize_01.js]
[browser_markup_pagesize_02.js]
[browser_markup_remove_xul_attributes.js]
skip-if = e10s # Bug 1036409 - The last selected node isn't reselected
[browser_markup_search_01.js]
[browser_markup_tag_edit_01.js]
[browser_markup_tag_edit_02.js]
[browser_markup_tag_edit_03.js]
[browser_markup_tag_edit_04.js]
[browser_markup_tag_edit_05.js]
[browser_markup_tag_edit_06.js]
[browser_markup_tag_edit_07.js]
[browser_markup_tag_edit_08.js]
[browser_markup_tag_edit_09.js]
[browser_markup_tag_edit_10.js]
[browser_markup_tag_edit_11.js]
[browser_markup_tag_edit_12.js]
[browser_markup_tag_edit_13-other.js]
[browser_markup_textcontent_edit_01.js]
[browser_markup_toggle_01.js]
[browser_markup_toggle_02.js]
[browser_markup_toggle_03.js]
[browser_markup_update-on-navigtion.js]

Some files were not shown because too many files have changed in this diff Show More