diff --git a/addon-sdk/source/lib/sdk/ui/toolbar/view.js b/addon-sdk/source/lib/sdk/ui/toolbar/view.js index 4ef0c3d46571..6b9c54824317 100644 --- a/addon-sdk/source/lib/sdk/ui/toolbar/view.js +++ b/addon-sdk/source/lib/sdk/ui/toolbar/view.js @@ -125,7 +125,7 @@ const addView = curry((options, {document, window}) => { toolbar.setAttribute("id", "inner-" + options.id); toolbar.setAttribute("defaultset", options.items.join(",")); toolbar.setAttribute("customizable", "true"); - toolbar.setAttribute("style", "-moz-appearance: none; overflow: hidden"); + toolbar.setAttribute("style", "-moz-appearance: none; overflow: hidden; border: 0;"); toolbar.setAttribute("mode", "icons"); toolbar.setAttribute("iconsize", "small"); toolbar.setAttribute("context", "toolbar-context-menu"); diff --git a/browser/components/newtab/PlacesProvider.jsm b/browser/components/newtab/PlacesProvider.jsm index 31d02d824a55..6b9ebd706e4d 100644 --- a/browser/components/newtab/PlacesProvider.jsm +++ b/browser/components/newtab/PlacesProvider.jsm @@ -2,7 +2,7 @@ * 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/. */ -/* global XPCOMUtils, Services, PlacesUtils, gPrincipal, EventEmitter */ +/* global XPCOMUtils, Services, PlacesUtils, EventEmitter */ /* global gLinks */ /* exported PlacesProvider */ @@ -22,52 +22,14 @@ XPCOMUtils.defineLazyGetter(this, "EventEmitter", function() { return EventEmitter; }); -XPCOMUtils.defineLazyGetter(this, "gPrincipal", function() { - let uri = Services.io.newURI("about:newtab"); - return Services.scriptSecurityManager.getNoAppCodebasePrincipal(uri); -}); - XPCOMUtils.defineLazyModuleGetter(this, "Task", "resource://gre/modules/Task.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "NewTabUtils", + "resource://gre/modules/NewTabUtils.jsm"); // The maximum number of results PlacesProvider retrieves from history. const HISTORY_RESULTS_LIMIT = 100; -/** - * Singleton that checks if a given link should be displayed on about:newtab - * or if we should rather not do it for security reasons. URIs that inherit - * their caller's principal will be filtered. - */ -let LinkChecker = { - _cache: new Map(), - - get flags() { - return Ci.nsIScriptSecurityManager.DISALLOW_INHERIT_PRINCIPAL | - Ci.nsIScriptSecurityManager.DONT_REPORT_ERRORS; - }, - - checkLoadURI: function LinkChecker_checkLoadURI(aURI) { - if (!this._cache.has(aURI)) { - this._cache.set(aURI, this._doCheckLoadURI(aURI)); - } - - return this._cache.get(aURI); - }, - - _doCheckLoadURI: function LinkChecker_doCheckLoadURI(aURI) { - let result = false; - try { - Services.scriptSecurityManager. - checkLoadURIStrWithPrincipal(gPrincipal, aURI, this.flags); - result = true; - } catch (e) { - // We got a weird URI or one that would inherit the caller's principal. - Cu.reportError(e); - } - return result; - } -}; - /* Queries history to retrieve the most visited sites. Emits events when the * history changes. * Implements the EventEmitter interface. @@ -105,7 +67,8 @@ Links.prototype = { aNewFrecency, aGUID, aHidden, aLastVisitDate) { // jshint ignore:line // The implementation of the query in getLinks excludes hidden and // unvisited pages, so it's important to exclude them here, too. - if (!aHidden && aLastVisitDate) { + if (!aHidden && aLastVisitDate && + NewTabUtils.linkChecker.checkLoadURI(aURI.spec)) { gLinks.emit("linkChanged", { url: aURI.spec, frecency: aNewFrecency, @@ -122,10 +85,12 @@ Links.prototype = { }, onTitleChanged: function historyObserver_onTitleChanged(aURI, aNewTitle) { - gLinks.emit("linkChanged", { - url: aURI.spec, - title: aNewTitle - }); + if (NewTabUtils.linkChecker.checkLoadURI(aURI.spec)) { + gLinks.emit("linkChanged", { + url: aURI.spec, + title: aNewTitle + }); + } }, QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver, @@ -184,7 +149,7 @@ Links.prototype = { params: {limit: this.maxNumLinks} }); - return links.filter(link => LinkChecker.checkLoadURI(link.url)); + return links.filter(link => NewTabUtils.linkChecker.checkLoadURI(link.url)); }), /** @@ -247,6 +212,10 @@ Links.prototype = { const gLinks = new Links(); // jshint ignore:line let PlacesProvider = { - LinkChecker, links: gLinks, }; + +// Kept only for backwards-compatibility +XPCOMUtils.defineLazyGetter(PlacesProvider, "LinkChecker", + () => NewTabUtils.linkChecker); + diff --git a/browser/components/newtab/tests/xpcshell/test_PlacesProvider.js b/browser/components/newtab/tests/xpcshell/test_PlacesProvider.js index e35a0e4e6455..3494e87222df 100644 --- a/browser/components/newtab/tests/xpcshell/test_PlacesProvider.js +++ b/browser/components/newtab/tests/xpcshell/test_PlacesProvider.js @@ -59,13 +59,13 @@ function makeVisit(index, daysAgo, isTyped, domain = TEST_URL) { add_task(function test_LinkChecker_securityCheck() { let urls = [ - {url: "file://home/file/image.png", expected: false}, - {url: "resource:///modules/PlacesProvider.jsm", expected: false}, {url: "javascript:alert('hello')", expected: false}, // jshint ignore:line {url: "data:image/png;base64,XXX", expected: false}, {url: "about:newtab", expected: true}, {url: "https://example.com", expected: true}, {url: "ftp://example.com", expected: true}, + {url: "file://home/file/image.png", expected: true}, + {url: "resource:///modules/PlacesProvider.jsm", expected: true}, ]; for (let {url, expected} of urls) { let observed = PlacesProvider.LinkChecker.checkLoadURI(url); diff --git a/browser/config/tooltool-manifests/win32/clang.manifest b/browser/config/tooltool-manifests/win32/clang.manifest index 4575564bd4ff..97e0fb8dddc4 100644 --- a/browser/config/tooltool-manifests/win32/clang.manifest +++ b/browser/config/tooltool-manifests/win32/clang.manifest @@ -37,5 +37,13 @@ "algorithm": "sha512", "filename": "clang.tar.bz2", "unpack": true +}, +{ +"algorithm": "sha512", +"visibility": "public", +"filename": "makecab.tar.bz2", +"unpack": true, +"digest": "da1f7685e5bc49a5ffbe5b4a3678ac7a58a0e125031726d30e2bacbbffa53d6efb9fd9f00d6dff5b54cff9412a103efa564c2af6f8fccc63082f6939181769f8", +"size": 296777 } ] diff --git a/browser/config/tooltool-manifests/win32/releng.manifest b/browser/config/tooltool-manifests/win32/releng.manifest index 1d38b10096f6..6516cb29d45e 100644 --- a/browser/config/tooltool-manifests/win32/releng.manifest +++ b/browser/config/tooltool-manifests/win32/releng.manifest @@ -29,5 +29,13 @@ "algorithm": "sha512", "filename": "vs2015u3.zip", "unpack": true +}, +{ +"algorithm": "sha512", +"visibility": "public", +"filename": "makecab.tar.bz2", +"unpack": true, +"digest": "da1f7685e5bc49a5ffbe5b4a3678ac7a58a0e125031726d30e2bacbbffa53d6efb9fd9f00d6dff5b54cff9412a103efa564c2af6f8fccc63082f6939181769f8", +"size": 296777 } ] diff --git a/browser/config/tooltool-manifests/win64/clang.manifest b/browser/config/tooltool-manifests/win64/clang.manifest index 09bab57a250a..80131993d2de 100644 --- a/browser/config/tooltool-manifests/win64/clang.manifest +++ b/browser/config/tooltool-manifests/win64/clang.manifest @@ -38,5 +38,13 @@ "algorithm": "sha512", "filename": "clang.tar.bz2", "unpack": true +}, +{ +"algorithm": "sha512", +"visibility": "public", +"filename": "makecab.tar.bz2", +"unpack": true, +"digest": "da1f7685e5bc49a5ffbe5b4a3678ac7a58a0e125031726d30e2bacbbffa53d6efb9fd9f00d6dff5b54cff9412a103efa564c2af6f8fccc63082f6939181769f8", +"size": 296777 } ] diff --git a/browser/config/tooltool-manifests/win64/releng.manifest b/browser/config/tooltool-manifests/win64/releng.manifest index 4e4481bde50c..44e0b1ce1d90 100644 --- a/browser/config/tooltool-manifests/win64/releng.manifest +++ b/browser/config/tooltool-manifests/win64/releng.manifest @@ -30,5 +30,13 @@ "algorithm": "sha512", "filename": "vs2015u3.zip", "unpack": true +}, +{ +"algorithm": "sha512", +"visibility": "public", +"filename": "makecab.tar.bz2", +"unpack": true, +"digest": "da1f7685e5bc49a5ffbe5b4a3678ac7a58a0e125031726d30e2bacbbffa53d6efb9fd9f00d6dff5b54cff9412a103efa564c2af6f8fccc63082f6939181769f8", +"size": 296777 } ] diff --git a/browser/themes/shared/newtab/newTab.inc.css b/browser/themes/shared/newtab/newTab.inc.css index 35be0d109f6d..c116bc34835e 100644 --- a/browser/themes/shared/newtab/newTab.inc.css +++ b/browser/themes/shared/newtab/newTab.inc.css @@ -206,9 +206,12 @@ body:not(.compact) .newtab-site[type=sponsored] .newtab-thumbnail { } body.compact .newtab-title { - background-color: hsla(0,0%,100%,.8); + background-color: hsla(0,0%,100%,.85); font-size: 12px; line-height: 21px; + border: 1px solid hsla(0,0%,80%,.8); + border-top-color: hsla(0,0%,0%,.1); + background-clip: padding-box; } .newtab-title, @@ -221,12 +224,6 @@ body.compact .newtab-suggested { color: black; } -body.compact .newtab-title { - border: 1px solid hsla(0,0%,80%,.8); - border-top-color: hsla(0,0%,0%,.1); - background-clip: padding-box; -} - .newtab-suggested[active] { background-color: rgba(51, 51, 51, 0.95); border: 0; @@ -242,7 +239,7 @@ body:not(.compact) .newtab-site:hover .newtab-title { body.compact .newtab-site:hover .newtab-title { color: white; - background-color: hsla(0,0%,20%,.8); + background-color: hsla(0,0%,20%,.85); border-color: hsla(0,0%,0%,.8); border-top-color: white; } diff --git a/build/autoconf/icu.m4 b/build/autoconf/icu.m4 index 4f46345f435a..794ddcdf4e52 100644 --- a/build/autoconf/icu.m4 +++ b/build/autoconf/icu.m4 @@ -69,7 +69,7 @@ if test -n "$USE_ICU"; then fi fi - version=`sed -n 's/^[[:space:]]*#[[:space:]]*define[[:space:]][[:space:]]*U_ICU_VERSION_MAJOR_NUM[[:space:]][[:space:]]*\([0-9][0-9]*\)[[:space:]]*$/\1/p' "$icudir/common/unicode/uvernum.h"` + version=`sed -n 's/^[[[:space:]]]*#[[:space:]]*define[[:space:]][[:space:]]*U_ICU_VERSION_MAJOR_NUM[[:space:]][[:space:]]*\([0-9][0-9]*\)[[:space:]]*$/\1/p' "$icudir/common/unicode/uvernum.h"` if test x"$version" = x; then AC_MSG_ERROR([cannot determine icu version number from uvernum.h header file $lineno]) fi diff --git a/build/moz.configure/windows.configure b/build/moz.configure/windows.configure index ff9d9b83d857..3e0a4a2c8a0b 100644 --- a/build/moz.configure/windows.configure +++ b/build/moz.configure/windows.configure @@ -416,3 +416,6 @@ def alter_path(sdk_bin_path): return path set_config('PATH', alter_path) + +check_prog('MAKECAB', ('makecab.exe',)) + diff --git a/build/mozconfig.win-common b/build/mozconfig.win-common index 6e25b7ce4e24..6a15bb2aedc5 100644 --- a/build/mozconfig.win-common +++ b/build/mozconfig.win-common @@ -14,3 +14,4 @@ fi MOZ_AUTOMATION_INSTALLER=${MOZ_AUTOMATION_INSTALLER-1} export SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE=c:/builds/crash-stats-api.token +export MAKECAB=$topsrcdir/makecab.exe diff --git a/caps/moz.build b/caps/moz.build index 58b45e36019f..a7cf55a6a2c5 100644 --- a/caps/moz.build +++ b/caps/moz.build @@ -61,3 +61,7 @@ if CONFIG['ENABLE_TESTS']: include('/ipc/chromium/chromium-config.mozbuild') FINAL_LIBRARY = 'xul' + +with Files("**"): + BUG_COMPONENT = ("Core", "Security: CAPS") + diff --git a/devtools/client/shared/components/reps/array.js b/devtools/client/shared/components/reps/array.js index 735b27f4379c..f244759aa877 100644 --- a/devtools/client/shared/components/reps/array.js +++ b/devtools/client/shared/components/reps/array.js @@ -30,6 +30,8 @@ define(function (require, exports, module) { propTypes: { // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), + objectLink: React.PropTypes.func, + object: React.PropTypes.array.isRequired, }, getTitle: function (object, context) { @@ -170,6 +172,12 @@ define(function (require, exports, module) { let ItemRep = React.createFactory(React.createClass({ displayName: "ItemRep", + propTypes: { + object: React.PropTypes.any.isRequired, + delim: React.PropTypes.string.isRequired, + mode: React.PropTypes.symbol, + }, + render: wrapRender(function () { const { Rep } = createFactories(require("./rep")); diff --git a/devtools/client/shared/components/reps/attribute.js b/devtools/client/shared/components/reps/attribute.js index d29b683e6c41..5a388a4a90b9 100644 --- a/devtools/client/shared/components/reps/attribute.js +++ b/devtools/client/shared/components/reps/attribute.js @@ -29,7 +29,8 @@ define(function (require, exports, module) { displayName: "Attr", propTypes: { - object: React.PropTypes.object.isRequired + object: React.PropTypes.object.isRequired, + objectLink: React.PropTypes.func, }, getTitle: function (grip) { diff --git a/devtools/client/shared/components/reps/caption.js b/devtools/client/shared/components/reps/caption.js index dde2309c814d..e5a4bff691c5 100644 --- a/devtools/client/shared/components/reps/caption.js +++ b/devtools/client/shared/components/reps/caption.js @@ -21,6 +21,10 @@ define(function (require, exports, module) { const Caption = React.createClass({ displayName: "Caption", + propTypes: { + object: React.PropTypes.object, + }, + render: wrapRender(function () { return ( DOM.span({"className": "caption"}, this.props.object) diff --git a/devtools/client/shared/components/reps/date-time.js b/devtools/client/shared/components/reps/date-time.js index ad86bc1db6f0..70f87861f080 100644 --- a/devtools/client/shared/components/reps/date-time.js +++ b/devtools/client/shared/components/reps/date-time.js @@ -26,7 +26,8 @@ define(function (require, exports, module) { displayName: "Date", propTypes: { - object: React.PropTypes.object.isRequired + object: React.PropTypes.object.isRequired, + objectLink: React.PropTypes.func, }, getTitle: function (grip) { diff --git a/devtools/client/shared/components/reps/document.js b/devtools/client/shared/components/reps/document.js index 024b88054ec8..511cc084f94d 100644 --- a/devtools/client/shared/components/reps/document.js +++ b/devtools/client/shared/components/reps/document.js @@ -27,7 +27,8 @@ define(function (require, exports, module) { displayName: "Document", propTypes: { - object: React.PropTypes.object.isRequired + object: React.PropTypes.object.isRequired, + objectLink: React.PropTypes.func, }, getLocation: function (grip) { diff --git a/devtools/client/shared/components/reps/element-node.js b/devtools/client/shared/components/reps/element-node.js index a94be7aa57fd..94d357be3cc1 100644 --- a/devtools/client/shared/components/reps/element-node.js +++ b/devtools/client/shared/components/reps/element-node.js @@ -31,6 +31,9 @@ define(function (require, exports, module) { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), + onDOMNodeMouseOver: React.PropTypes.func, + onDOMNodeMouseOut: React.PropTypes.func, + objectLink: React.PropTypes.func, }, getElements: function (grip, mode) { diff --git a/devtools/client/shared/components/reps/error.js b/devtools/client/shared/components/reps/error.js index fe09140e5528..18ac3b526d81 100644 --- a/devtools/client/shared/components/reps/error.js +++ b/devtools/client/shared/components/reps/error.js @@ -26,6 +26,7 @@ define(function (require, exports, module) { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), + objectLink: React.PropTypes.func, }, render: wrapRender(function () { diff --git a/devtools/client/shared/components/reps/function.js b/devtools/client/shared/components/reps/function.js index ffc8a34f1416..c702d869b120 100644 --- a/devtools/client/shared/components/reps/function.js +++ b/devtools/client/shared/components/reps/function.js @@ -27,7 +27,8 @@ define(function (require, exports, module) { displayName: "Func", propTypes: { - object: React.PropTypes.object.isRequired + object: React.PropTypes.object.isRequired, + objectLink: React.PropTypes.func, }, getTitle: function (grip) { diff --git a/devtools/client/shared/components/reps/grip-array.js b/devtools/client/shared/components/reps/grip-array.js index 3a8383e994c4..425519cbb3f2 100644 --- a/devtools/client/shared/components/reps/grip-array.js +++ b/devtools/client/shared/components/reps/grip-array.js @@ -33,6 +33,7 @@ define(function (require, exports, module) { // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), provider: React.PropTypes.object, + objectLink: React.PropTypes.func, }, getLength: function (grip) { diff --git a/devtools/client/shared/components/reps/grip-map.js b/devtools/client/shared/components/reps/grip-map.js index ac5535bc9e09..b6cdaaf9e8fd 100644 --- a/devtools/client/shared/components/reps/grip-map.js +++ b/devtools/client/shared/components/reps/grip-map.js @@ -30,6 +30,8 @@ define(function (require, exports, module) { object: React.PropTypes.object, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), + objectLink: React.PropTypes.func, + isInterestingEntry: React.PropTypes.func, }, getTitle: function (object) { diff --git a/devtools/client/shared/components/reps/grip.js b/devtools/client/shared/components/reps/grip.js index cb01ed9fef63..842cd30740f7 100644 --- a/devtools/client/shared/components/reps/grip.js +++ b/devtools/client/shared/components/reps/grip.js @@ -35,6 +35,7 @@ define(function (require, exports, module) { mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), isInterestingProp: React.PropTypes.func, title: React.PropTypes.string, + objectLink: React.PropTypes.func, }, getTitle: function (object) { diff --git a/devtools/client/shared/components/reps/infinity.js b/devtools/client/shared/components/reps/infinity.js index 6d0cc3707209..352ba67d8612 100644 --- a/devtools/client/shared/components/reps/infinity.js +++ b/devtools/client/shared/components/reps/infinity.js @@ -22,6 +22,10 @@ define(function (require, exports, module) { const InfinityRep = React.createClass({ displayName: "Infinity", + propTypes: { + object: React.PropTypes.object.isRequired, + }, + render: wrapRender(function () { return ( span({className: "objectBox objectBox-number"}, diff --git a/devtools/client/shared/components/reps/long-string.js b/devtools/client/shared/components/reps/long-string.js index a438e7cc29d3..0e9013c96c3b 100644 --- a/devtools/client/shared/components/reps/long-string.js +++ b/devtools/client/shared/components/reps/long-string.js @@ -25,6 +25,9 @@ define(function (require, exports, module) { propTypes: { useQuotes: React.PropTypes.bool, style: React.PropTypes.object, + cropLimit: React.PropTypes.number.isRequired, + member: React.PropTypes.string, + object: React.PropTypes.object.isRequired, }, getDefaultProps: function () { diff --git a/devtools/client/shared/components/reps/number.js b/devtools/client/shared/components/reps/number.js index 76f3da5a8a73..5e338f2094a8 100644 --- a/devtools/client/shared/components/reps/number.js +++ b/devtools/client/shared/components/reps/number.js @@ -22,6 +22,13 @@ define(function (require, exports, module) { const Number = React.createClass({ displayName: "Number", + propTypes: { + object: React.PropTypes.oneOfType([ + React.PropTypes.object, + React.PropTypes.number, + ]).isRequired + }, + stringify: function (object) { let isNegativeZero = Object.is(object, -0) || (object.type && object.type == "-0"); diff --git a/devtools/client/shared/components/reps/object-with-text.js b/devtools/client/shared/components/reps/object-with-text.js index ac3c0680323c..8245938a2825 100644 --- a/devtools/client/shared/components/reps/object-with-text.js +++ b/devtools/client/shared/components/reps/object-with-text.js @@ -27,6 +27,7 @@ define(function (require, exports, module) { propTypes: { object: React.PropTypes.object.isRequired, + objectLink: React.PropTypes.func, }, getTitle: function (grip) { diff --git a/devtools/client/shared/components/reps/object-with-url.js b/devtools/client/shared/components/reps/object-with-url.js index 262d9b42affe..380cedf0334d 100644 --- a/devtools/client/shared/components/reps/object-with-url.js +++ b/devtools/client/shared/components/reps/object-with-url.js @@ -28,6 +28,7 @@ define(function (require, exports, module) { propTypes: { object: React.PropTypes.object.isRequired, + objectLink: React.PropTypes.func, }, getTitle: function (grip) { diff --git a/devtools/client/shared/components/reps/object.js b/devtools/client/shared/components/reps/object.js index 1f4335ea635b..15b949f7a0ca 100644 --- a/devtools/client/shared/components/reps/object.js +++ b/devtools/client/shared/components/reps/object.js @@ -29,6 +29,7 @@ define(function (require, exports, module) { object: React.PropTypes.object, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), + objectLink: React.PropTypes.func, }, getTitle: function (object) { diff --git a/devtools/client/shared/components/reps/promise.js b/devtools/client/shared/components/reps/promise.js index 8b3d2d003b44..016c172c434d 100644 --- a/devtools/client/shared/components/reps/promise.js +++ b/devtools/client/shared/components/reps/promise.js @@ -31,6 +31,7 @@ define(function (require, exports, module) { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), + objectLink: React.PropTypes.func, }, getTitle: function (object) { diff --git a/devtools/client/shared/components/reps/prop-rep.js b/devtools/client/shared/components/reps/prop-rep.js index 16072e1feb46..ea04a256b20d 100644 --- a/devtools/client/shared/components/reps/prop-rep.js +++ b/devtools/client/shared/components/reps/prop-rep.js @@ -37,6 +37,7 @@ define(function (require, exports, module) { delim: React.PropTypes.string, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), + objectLink: React.PropTypes.func, }, render: wrapRender(function () { diff --git a/devtools/client/shared/components/reps/regexp.js b/devtools/client/shared/components/reps/regexp.js index e8f5e370dd50..d8a712e1f530 100644 --- a/devtools/client/shared/components/reps/regexp.js +++ b/devtools/client/shared/components/reps/regexp.js @@ -27,6 +27,7 @@ define(function (require, exports, module) { propTypes: { object: React.PropTypes.object.isRequired, + objectLink: React.PropTypes.func, }, getSource: function (grip) { diff --git a/devtools/client/shared/components/reps/string.js b/devtools/client/shared/components/reps/string.js index dd0a71ef5ad9..4b4b717c225f 100644 --- a/devtools/client/shared/components/reps/string.js +++ b/devtools/client/shared/components/reps/string.js @@ -28,6 +28,9 @@ define(function (require, exports, module) { propTypes: { useQuotes: React.PropTypes.bool, style: React.PropTypes.object, + object: React.PropTypes.string.isRequired, + member: React.PropTypes.any, + cropLimit: React.PropTypes.number, }, getDefaultProps: function () { diff --git a/devtools/client/shared/components/reps/stylesheet.js b/devtools/client/shared/components/reps/stylesheet.js index e8abe389bd9a..cc9edaf8b1e0 100644 --- a/devtools/client/shared/components/reps/stylesheet.js +++ b/devtools/client/shared/components/reps/stylesheet.js @@ -28,6 +28,7 @@ define(function (require, exports, module) { propTypes: { object: React.PropTypes.object.isRequired, + objectLink: React.PropTypes.func, }, getTitle: function (grip) { diff --git a/devtools/client/shared/components/reps/text-node.js b/devtools/client/shared/components/reps/text-node.js index a21ef8ed7fd6..9e076d5c4958 100644 --- a/devtools/client/shared/components/reps/text-node.js +++ b/devtools/client/shared/components/reps/text-node.js @@ -31,6 +31,9 @@ define(function (require, exports, module) { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), + objectLink: React.PropTypes.func, + onDOMNodeMouseOver: React.PropTypes.func, + onDOMNodeMouseOut: React.PropTypes.func, }, getTextContent: function (grip) { diff --git a/devtools/client/shared/components/reps/window.js b/devtools/client/shared/components/reps/window.js index ec137e9ceb35..39fef58362ff 100644 --- a/devtools/client/shared/components/reps/window.js +++ b/devtools/client/shared/components/reps/window.js @@ -28,6 +28,7 @@ define(function (require, exports, module) { propTypes: { object: React.PropTypes.object.isRequired, + objectLink: React.PropTypes.func, }, getTitle: function (grip) { diff --git a/devtools/client/shared/components/splitter/split-box.js b/devtools/client/shared/components/splitter/split-box.js index 676b941d536c..985637c299bc 100644 --- a/devtools/client/shared/components/splitter/split-box.js +++ b/devtools/client/shared/components/splitter/split-box.js @@ -21,6 +21,10 @@ const SplitBox = React.createClass({ className: PropTypes.string, // Initial size of controlled panel. initialSize: PropTypes.number, + // Initial width of controlled panel. + initialWidth: PropTypes.number, + // Initial height of controlled panel. + initialHeight: PropTypes.number, // Left/top panel startPanel: PropTypes.any, // Min panel size. @@ -34,7 +38,9 @@ const SplitBox = React.createClass({ // Size of the splitter handle bar. splitterSize: PropTypes.number, // True if the splitter bar is vertical (default is vertical). - vert: PropTypes.bool + vert: PropTypes.bool, + // Style object. + style: PropTypes.object, }, getDefaultProps() { diff --git a/devtools/client/shared/components/stack-trace.js b/devtools/client/shared/components/stack-trace.js index 28ab692c13c9..f97e7b47a7c5 100644 --- a/devtools/client/shared/components/stack-trace.js +++ b/devtools/client/shared/components/stack-trace.js @@ -14,7 +14,7 @@ const l10n = new LocalizationHelper("devtools/client/locales/webconsole.properti const AsyncFrame = createFactory(createClass({ displayName: "AsyncFrame", - PropTypes: { + propTypes: { asyncCause: PropTypes.string.isRequired }, @@ -31,10 +31,10 @@ const AsyncFrame = createFactory(createClass({ const StackTrace = createClass({ displayName: "StackTrace", - PropTypes: { + propTypes: { stacktrace: PropTypes.array.isRequired, onViewSourceInDebugger: PropTypes.func.isRequired, - onViewSourceInScratchpad: PropTypes.func.isRequired, + onViewSourceInScratchpad: PropTypes.func, }, render() { diff --git a/devtools/client/shared/components/tree.js b/devtools/client/shared/components/tree.js index 49b5d1497997..28879caf694a 100644 --- a/devtools/client/shared/components/tree.js +++ b/devtools/client/shared/components/tree.js @@ -4,7 +4,8 @@ /* eslint-env browser */ "use strict"; -const { DOM: dom, createClass, createFactory, PropTypes } = require("devtools/client/shared/vendor/react"); +const React = require("devtools/client/shared/vendor/react"); +const { DOM: dom, createClass, createFactory, PropTypes } = React; const AUTO_EXPAND_DEPTH = 0; const NUMBER_OF_OFFSCREEN_ITEMS = 1; @@ -630,6 +631,14 @@ module.exports = createClass({ const ArrowExpander = createFactory(createClass({ displayName: "ArrowExpander", + propTypes: { + item: PropTypes.any.isRequired, + visible: PropTypes.bool.isRequired, + expanded: PropTypes.bool.isRequired, + onCollapse: PropTypes.func.isRequired, + onExpand: PropTypes.func.isRequired, + }, + shouldComponentUpdate(nextProps, nextState) { return this.props.item !== nextProps.item || this.props.visible !== nextProps.visible @@ -659,6 +668,23 @@ const ArrowExpander = createFactory(createClass({ })); const TreeNode = createFactory(createClass({ + propTypes: { + focused: PropTypes.bool.isRequired, + onFocusedNodeUnmount: PropTypes.func, + item: PropTypes.any.isRequired, + expanded: PropTypes.bool.isRequired, + hasChildren: PropTypes.bool.isRequired, + onExpand: PropTypes.func.isRequired, + index: PropTypes.number.isRequired, + first: PropTypes.bool, + last: PropTypes.bool, + onFocus: PropTypes.func, + onBlur: PropTypes.func, + onCollapse: PropTypes.func.isRequired, + depth: PropTypes.number.isRequired, + renderItem: PropTypes.func.isRequired, + }, + componentDidMount() { if (this.props.focused) { this.refs.button.focus(); diff --git a/devtools/client/webconsole/test/browser_webconsole_bug_595223_file_uri.js b/devtools/client/webconsole/test/browser_webconsole_bug_595223_file_uri.js index 1ce2e13a53e2..bff9fbd186b8 100644 --- a/devtools/client/webconsole/test/browser_webconsole_bug_595223_file_uri.js +++ b/devtools/client/webconsole/test/browser_webconsole_bug_595223_file_uri.js @@ -21,9 +21,11 @@ add_task(function* () { dir.append(TEST_FILE); let uri = Services.io.newFileURI(dir); - // We need a file remote type to make sure we don't switch processes when we - // load the file:// URI. - let { browser } = yield loadTab("about:blank", E10SUtils.FILE_REMOTE_TYPE); + // Open tab with correct remote type so we don't switch processes when we load + // the file:// URI, otherwise we won't get the same web console. + let remoteType = E10SUtils.getRemoteTypeForURI(uri.spec, + gMultiProcessBrowser); + let { browser } = yield loadTab("about:blank", remoteType); hud = yield openConsole(); hud.jsterm.clearOutput(); diff --git a/dom/base/OrderedTimeoutIterator.h b/dom/base/OrderedTimeoutIterator.h index 02c80ed0ed80..6a7f163c9fe8 100644 --- a/dom/base/OrderedTimeoutIterator.h +++ b/dom/base/OrderedTimeoutIterator.h @@ -78,8 +78,8 @@ public: if (mNormalIter && mTrackingIter && mNormalIter != mNormalStopAt && mTrackingIter != mTrackingStopAt && - (mTrackingIter->mWhen < mNormalIter->mWhen || - (mTrackingIter->mWhen == mNormalIter->mWhen && + (mTrackingIter->When() < mNormalIter->When() || + (mTrackingIter->When() == mNormalIter->When() && mTrackingIter->mTimeoutId < mNormalIter->mTimeoutId))) { timeout = mTrackingIter; mKind = Kind::Tracking; diff --git a/dom/base/Timeout.cpp b/dom/base/Timeout.cpp index 8edd0ac7ab9e..27278bad318b 100644 --- a/dom/base/Timeout.cpp +++ b/dom/base/Timeout.cpp @@ -108,5 +108,54 @@ Timeout::HasRefCnt(uint32_t aCount) const } #endif // DEBUG +void +Timeout::SetWhenOrTimeRemaining(const TimeStamp& aBaseTime, + const TimeDuration& aDelay) +{ + // This must not be called on dummy timeouts. Instead use SetDummyWhen(). + MOZ_DIAGNOSTIC_ASSERT(mWindow); + + // If we are frozen simply set mTimeRemaining to be the "time remaining" in + // the timeout (i.e., the interval itself). This will be used to create a + // new mWhen time when the window is thawed. The end effect is that time does + // not appear to pass for frozen windows. + if (mWindow->IsFrozen()) { + mWhen = TimeStamp(); + mTimeRemaining = aDelay; + return; + } + + // Since we are not frozen we must set a precise mWhen target wakeup + // time. Even if we are suspended we want to use this target time so + // that it appears time passes while suspended. + mWhen = aBaseTime + aDelay; + mTimeRemaining = TimeDuration(0); +} + +void +Timeout::SetDummyWhen(const TimeStamp& aWhen) +{ + MOZ_DIAGNOSTIC_ASSERT(!mWindow); + mWhen = aWhen; +} + +const TimeStamp& +Timeout::When() const +{ + MOZ_DIAGNOSTIC_ASSERT(!mWhen.IsNull()); + // Note, mWindow->IsFrozen() can be true here. The Freeze() method calls + // When() to calculate the delay to populate mTimeRemaining. + return mWhen; +} + +const TimeDuration& +Timeout::TimeRemaining() const +{ + MOZ_DIAGNOSTIC_ASSERT(mWhen.IsNull()); + // Note, mWindow->IsFrozen() can be false here. The Thaw() method calls + // TimeRemaining() to calculate the new When() value. + return mTimeRemaining; +} + } // namespace dom } // namespace mozilla diff --git a/dom/base/Timeout.h b/dom/base/Timeout.h index bdb33dc770d6..07d286908e68 100644 --- a/dom/base/Timeout.h +++ b/dom/base/Timeout.h @@ -11,7 +11,6 @@ #include "mozilla/TimeStamp.h" #include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" -#include "nsPIDOMWindow.h" class nsGlobalWindow; class nsIEventTarget; @@ -48,6 +47,17 @@ public: bool HasRefCnt(uint32_t aCount) const; #endif // DEBUG + void SetWhenOrTimeRemaining(const TimeStamp& aBaseTime, + const TimeDuration& aDelay); + + void SetDummyWhen(const TimeStamp& aWhen); + + // Can only be called when not frozen. + const TimeStamp& When() const; + + // Can only be called when frozen. + const TimeDuration& TimeRemaining() const; + // Window for which this timeout fires RefPtr mWindow; @@ -71,14 +81,6 @@ public: // Interval in milliseconds uint32_t mInterval; - // mWhen and mTimeRemaining can't be in a union, sadly, because they - // have constructors. - // Nominal time to run this timeout. Use only when timeouts are not - // suspended. - TimeStamp mWhen; - // Remaining time to wait. Used only when timeouts are suspended. - TimeDuration mTimeRemaining; - // Principal with which to execute nsCOMPtr mPrincipal; @@ -95,6 +97,14 @@ public: nsCOMPtr mScriptHandler; private: + // mWhen and mTimeRemaining can't be in a union, sadly, because they + // have constructors. + // Nominal time to run this timeout. Use only when timeouts are not + // frozen. + TimeStamp mWhen; + // Remaining time to wait. Used only when timeouts are frozen. + TimeDuration mTimeRemaining; + ~Timeout(); }; diff --git a/dom/base/TimeoutManager.cpp b/dom/base/TimeoutManager.cpp index 0ed6e97d1b5e..d5e9e274c3ef 100644 --- a/dom/base/TimeoutManager.cpp +++ b/dom/base/TimeoutManager.cpp @@ -177,24 +177,14 @@ TimeoutManager::SetTimeout(nsITimeoutHandler* aHandler, realInterval = std::max(realInterval, uint32_t(DOMMinTimeoutValue())); } - TimeDuration delta = TimeDuration::FromMilliseconds(realInterval); + timeout->mWindow = &mWindow; - if (mWindow.IsFrozen()) { - // If we are frozen simply set timeout->mTimeRemaining to be the - // "time remaining" in the timeout (i.e., the interval itself). This - // will be used to create a new mWhen time when the window is thawed. - // The end effect is that time does not appear to pass for frozen windows. - timeout->mTimeRemaining = delta; - } else { - // Since we are not frozen we must set a precise mWhen target wakeup - // time. Even if we are suspended we want to use this target time so - // that it appears time passes while suspended. - timeout->mWhen = TimeStamp::Now() + delta; - } + TimeDuration delta = TimeDuration::FromMilliseconds(realInterval); + timeout->SetWhenOrTimeRemaining(TimeStamp::Now(), delta); // If we're not suspended, then set the timer. if (!mWindow.IsSuspended()) { - MOZ_ASSERT(!timeout->mWhen.IsNull()); + MOZ_ASSERT(!timeout->When().IsNull()); nsresult rv; timeout->mTimer = do_CreateInstance("@mozilla.org/timer;1", &rv); @@ -214,8 +204,6 @@ TimeoutManager::SetTimeout(nsITimeoutHandler* aHandler, Unused << copy.forget(); } - timeout->mWindow = &mWindow; - if (!aIsInterval) { timeout->mNestingLevel = nestingLevel; } @@ -335,23 +323,23 @@ TimeoutManager::RunTimeout(Timeout* aTimeout) TimeStamp now = TimeStamp::Now(); TimeStamp deadline; - if (aTimeout && aTimeout->mWhen > now) { + if (aTimeout && aTimeout->When() > now) { // The OS timer fired early (which can happen due to the timers // having lower precision than TimeStamp does). Set |deadline| to // be the time when the OS timer *should* have fired so that any // timers that *should* have fired before aTimeout *will* be fired // now. - deadline = aTimeout->mWhen; + deadline = aTimeout->When(); } else { deadline = now; } // The timeout list is kept in deadline order. Discover the latest timeout // whose deadline has expired. On some platforms, native timeout events fire - // "early", but we handled that above by setting deadline to aTimeout->mWhen + // "early", but we handled that above by setting deadline to aTimeout->When() // if the timer fired early. So we can stop walking if we get to timeouts - // whose mWhen is greater than deadline, since once that happens we know + // whose When() is greater than deadline, since once that happens we know // nothing past that point is expired. { // Use a nested scope in order to make sure the strong references held by @@ -362,7 +350,7 @@ TimeoutManager::RunTimeout(Timeout* aTimeout) nullptr); while (true) { Timeout* timeout = expiredIter.Next(); - if (!timeout || timeout->mWhen > deadline) { + if (!timeout || timeout->When() > deadline) { break; } @@ -410,14 +398,14 @@ TimeoutManager::RunTimeout(Timeout* aTimeout) // list for any timeouts inserted as a result of running a timeout. RefPtr dummy_normal_timeout = new Timeout(); dummy_normal_timeout->mFiringDepth = firingDepth; - dummy_normal_timeout->mWhen = now; + dummy_normal_timeout->SetDummyWhen(now); if (last_expired_timeout_is_normal) { last_expired_normal_timeout->setNext(dummy_normal_timeout); } RefPtr dummy_tracking_timeout = new Timeout(); dummy_tracking_timeout->mFiringDepth = firingDepth; - dummy_tracking_timeout->mWhen = now; + dummy_tracking_timeout->SetDummyWhen(now); if (!last_expired_timeout_is_normal) { last_expired_tracking_timeout->setNext(dummy_tracking_timeout); } @@ -702,7 +690,7 @@ TimeoutManager::RescheduleTimeout(Timeout* aTimeout, const TimeStamp& now, if (aRunningPendingTimeouts) { firingTime = now + nextInterval; } else { - firingTime = aTimeout->mWhen + nextInterval; + firingTime = aTimeout->When() + nextInterval; } TimeStamp currentNow = TimeStamp::Now(); @@ -715,26 +703,13 @@ TimeoutManager::RescheduleTimeout(Timeout* aTimeout, const TimeStamp& now, delay = TimeDuration(0); } + aTimeout->SetWhenOrTimeRemaining(currentNow, delay); + if (!aTimeout->mTimer) { - if (mWindow.IsFrozen()) { - // If we are frozen simply set timeout->mTimeRemaining to be the - // "time remaining" in the timeout (i.e., the interval itself). This - // will be used to create a new mWhen time when the window is thawed. - // The end effect is that time does not appear to pass for frozen windows. - aTimeout->mTimeRemaining = delay; - } else if (mWindow.IsSuspended()) { - // Since we are not frozen we must set a precise mWhen target wakeup - // time. Even if we are suspended we want to use this target time so - // that it appears time passes while suspended. - aTimeout->mWhen = currentNow + delay; - } else { - MOZ_ASSERT_UNREACHABLE("Window should be frozen or suspended."); - } + MOZ_DIAGNOSTIC_ASSERT(mWindow.IsFrozen() || mWindow.IsSuspended()); return true; } - aTimeout->mWhen = currentNow + delay; - // Reschedule the OS timer. Don't bother returning any error codes if // this fails since the callers of this method don't care about them. nsresult rv = aTimeout->InitTimer(mWindow.EventTargetFor(TaskCategory::Timer), @@ -806,7 +781,7 @@ TimeoutManager::Timeouts::ResetTimersForThrottleReduction(int32_t aPreviousThrot // If insertion point is non-null, we're in the middle of firing timers and // the timers we're planning to fire all come before insertion point; - // insertion point itself is a dummy timeout with an mWhen that may be + // insertion point itself is a dummy timeout with an When() that may be // semi-bogus. In that case, we don't need to do anything with insertion // point or anything before it, so should start at the timer after insertion // point, if there is one. @@ -816,15 +791,15 @@ TimeoutManager::Timeouts::ResetTimersForThrottleReduction(int32_t aPreviousThrot timeout; ) { // It's important that this check be <= so that we guarantee that // taking std::max with |now| won't make a quantity equal to - // timeout->mWhen below. - if (timeout->mWhen <= now) { + // timeout->When() below. + if (timeout->When() <= now) { timeout = timeout->getNext(); continue; } - if (timeout->mWhen - now > + if (timeout->When() - now > TimeDuration::FromMilliseconds(aPreviousThrottleDelayMS)) { - // No need to loop further. Timeouts are sorted in mWhen order + // No need to loop further. Timeouts are sorted in When() order // and the ones after this point were all set up for at least // gMinBackgroundTimeoutValue ms and hence were not clamped. break; @@ -842,26 +817,27 @@ TimeoutManager::Timeouts::ResetTimersForThrottleReduction(int32_t aPreviousThrot if (oldInterval > interval) { // unclamp TimeStamp firingTime = - std::max(timeout->mWhen - oldInterval + interval, now); + std::max(timeout->When() - oldInterval + interval, now); - NS_ASSERTION(firingTime < timeout->mWhen, + NS_ASSERTION(firingTime < timeout->When(), "Our firing time should strictly decrease!"); TimeDuration delay = firingTime - now; - timeout->mWhen = firingTime; + timeout->SetWhenOrTimeRemaining(now, delay); + MOZ_DIAGNOSTIC_ASSERT(timeout->When() == firingTime); - // Since we reset mWhen we need to move |timeout| to the right - // place in the list so that it remains sorted by mWhen. + // Since we reset When() we need to move |timeout| to the right + // place in the list so that it remains sorted by When(). // Get the pointer to the next timeout now, before we move the // current timeout in the list. Timeout* nextTimeout = timeout->getNext(); - // It is safe to remove and re-insert because mWhen is now + // It is safe to remove and re-insert because When() is now // strictly smaller than it used to be, so we know we'll insert // |timeout| before nextTimeout. NS_ASSERTION(!nextTimeout || - timeout->mWhen < nextTimeout->mWhen, "How did that happen?"); + timeout->When() < nextTimeout->When(), "How did that happen?"); timeout->remove(); // Insert() will addref |timeout| and reset mFiringDepth. Make sure to // undo that after calling it. @@ -937,10 +913,10 @@ TimeoutManager::Timeouts::Insert(Timeout* aTimeout, SortBy aSortBy) for (prevSibling = GetLast(); prevSibling && prevSibling != InsertionPoint() && // This condition needs to match the one in SetTimeoutOrInterval that - // determines whether to set mWhen or mTimeRemaining. + // determines whether to set When() or TimeRemaining(). (aSortBy == SortBy::TimeRemaining ? - prevSibling->mTimeRemaining > aTimeout->mTimeRemaining : - prevSibling->mWhen > aTimeout->mWhen); + prevSibling->TimeRemaining() > aTimeout->TimeRemaining() : + prevSibling->When() > aTimeout->When()); prevSibling = prevSibling->getPrevious()) { /* Do nothing; just searching */ } @@ -1028,15 +1004,15 @@ TimeoutManager::Resume() MOZ_ASSERT(!aTimeout->mTimer); - // The timeout mWhen is set to the absolute time when the timer should + // The timeout When() is set to the absolute time when the timer should // fire. Recalculate the delay from now until that deadline. If the // the deadline has already passed or falls within our minimum delay // deadline, then clamp the resulting value to the minimum delay. The - // mWhen will remain at its absolute time, but we won'aTimeout fire the OS + // When() will remain at its absolute time, but we won'aTimeout fire the OS // timer until our calculated delay has passed. int32_t remaining = 0; - if (aTimeout->mWhen > now) { - remaining = static_cast((aTimeout->mWhen - now).ToMilliseconds()); + if (aTimeout->When() > now) { + remaining = static_cast((aTimeout->When() - now).ToMilliseconds()); } uint32_t delay = std::max(remaining, DOMMinTimeoutValue()); @@ -1068,11 +1044,12 @@ TimeoutManager::Freeze() // re-apply it when the window is Thaw()'d. This effectively // shifts timers to the right as if time does not pass while // the window is frozen. - if (aTimeout->mWhen > now) { - aTimeout->mTimeRemaining = aTimeout->mWhen - now; - } else { - aTimeout->mTimeRemaining = TimeDuration(0); + TimeDuration delta(0); + if (aTimeout->When() > now) { + delta = aTimeout->When() - now; } + aTimeout->SetWhenOrTimeRemaining(now, delta); + MOZ_DIAGNOSTIC_ASSERT(aTimeout->TimeRemaining() == delta); // Since we are suspended there should be no OS timer set for // this timeout entry. @@ -1096,8 +1073,9 @@ TimeoutManager::Thaw() return; } - // Set mWhen back to the time when the timer is supposed to fire. - aTimeout->mWhen = now + aTimeout->mTimeRemaining; + // Set When() back to the time when the timer is supposed to fire. + aTimeout->SetWhenOrTimeRemaining(now, aTimeout->TimeRemaining()); + MOZ_DIAGNOSTIC_ASSERT(!aTimeout->When().IsNull()); MOZ_ASSERT(!aTimeout->mTimer); }); diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index cff06a43ec05..9f18d867927e 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -874,9 +874,6 @@ nsOuterWindowProxy::getOwnPropertyDescriptor(JSContext* cx, } // else fall through to js::Wrapper - // When we change this to always claim the property is configurable (bug - // 1178639), update the comments in nsOuterWindowProxy::defineProperty - // accordingly. return js::Wrapper::getOwnPropertyDescriptor(cx, proxy, id, desc); } @@ -894,29 +891,6 @@ nsOuterWindowProxy::defineProperty(JSContext* cx, return result.failCantDefineWindowElement(); } -#ifndef RELEASE_OR_BETA // To be turned on in bug 1178638. - // For now, allow chrome code to define non-configurable properties - // on windows, until we sort out what exactly the addon SDK is - // doing. In the meantime, this still allows us to test web compat - // behavior. - if (desc.hasConfigurable() && !desc.configurable() && - !nsContentUtils::IsCallerChrome()) { - return ThrowErrorMessage(cx, MSG_DEFINE_NON_CONFIGURABLE_PROP_ON_WINDOW); - } - - // Note that if hasConfigurable() is false we do NOT want to - // setConfigurable(true). That would make this code: - // - // var x; - // window.x = 5; - // - // fail, because the JS engine ends up converting the assignment into a define - // with !hasConfigurable(), but the var actually declared a non-configurable - // property on our underlying Window object, so the set would fail if we - // forced setConfigurable(true) here. What we want to do instead is change - // getOwnPropertyDescriptor to always claim configurable. See bug 1178639. -#endif - return js::Wrapper::defineProperty(cx, proxy, id, desc, result); } diff --git a/dom/base/test/mochitest.ini b/dom/base/test/mochitest.ini index 201fd26e6b86..4fdf41fabec2 100644 --- a/dom/base/test/mochitest.ini +++ b/dom/base/test/mochitest.ini @@ -779,7 +779,6 @@ skip-if = toolkit == 'android' [test_window_constructor.html] [test_window_cross_origin_props.html] [test_window_define_nonconfigurable.html] -skip-if = release_or_beta [test_window_define_symbol.html] [test_window_element_enumeration.html] [test_window_enumeration.html] diff --git a/dom/base/test/test_window_define_nonconfigurable.html b/dom/base/test/test_window_define_nonconfigurable.html index ad1cf7687890..d1051b7dbc30 100644 --- a/dom/base/test/test_window_define_nonconfigurable.html +++ b/dom/base/test/test_window_define_nonconfigurable.html @@ -10,31 +10,78 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1107443 diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index abf6ba062aaa..af171cad6bb3 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -1375,10 +1375,16 @@ def UnionTypes(unionTypes, config): # And if it needs rooting, we need RootedDictionary too if typeNeedsRooting(f): headers.add("mozilla/dom/RootedDictionary.h") + elif f.isFloat() and not f.isUnrestricted(): + # Restricted floats are tested for finiteness + implheaders.add("mozilla/FloatingPoint.h") + implheaders.add("mozilla/dom/PrimitiveConversions.h") elif f.isEnum(): # Need to see the actual definition of the enum, # unfortunately. headers.add(CGHeaders.getDeclarationFilename(f.inner)) + elif f.isPrimitive(): + implheaders.add("mozilla/dom/PrimitiveConversions.h") elif f.isCallback(): # Callbacks always use strong refs, so we need to include # the right header to be able to Release() in our inlined @@ -1446,6 +1452,10 @@ def UnionConversions(unionTypes, config): headers.add(CGHeaders.getDeclarationFilename(f.inner)) elif f.isDictionary(): headers.add(CGHeaders.getDeclarationFilename(f.inner)) + elif f.isFloat() and not f.isUnrestricted(): + # Restricted floats are tested for finiteness + headers.add("mozilla/FloatingPoint.h") + headers.add("mozilla/dom/PrimitiveConversions.h") elif f.isPrimitive(): headers.add("mozilla/dom/PrimitiveConversions.h") elif f.isMozMap(): @@ -16786,7 +16796,6 @@ class GlobalGenRoots(): # If it stops being inlined or stops calling CallerSubsumes # both this bit and the bit in CGBindingRoot can be removed. includes.add("mozilla/dom/BindingUtils.h") - implincludes.add("mozilla/dom/PrimitiveConversions.h") # Wrap all of that in our namespaces. curr = CGNamespace.build(['mozilla', 'dom'], unions) diff --git a/dom/bindings/Errors.msg b/dom/bindings/Errors.msg index fafe61dbbb0b..f2d6a94f4780 100644 --- a/dom/bindings/Errors.msg +++ b/dom/bindings/Errors.msg @@ -100,3 +100,4 @@ MSG_DEF(MSG_TIME_VALUE_OUT_OF_RANGE, 1, JSEXN_TYPEERR, "{0} is outside the suppo MSG_DEF(MSG_ONLY_IF_CACHED_WITHOUT_SAME_ORIGIN, 1, JSEXN_TYPEERR, "Request mode '{0}' was used, but request cache mode 'only-if-cached' can only be used with request mode 'same-origin'.") MSG_DEF(MSG_THRESHOLD_RANGE_ERROR, 0, JSEXN_RANGEERR, "Threshold values must all be in the range [0, 1].") MSG_DEF(MSG_WORKER_THREAD_SHUTTING_DOWN, 0, JSEXN_TYPEERR, "The Worker thread is shutting down.") +MSG_DEF(MSG_CACHE_OPEN_FAILED, 0, JSEXN_TYPEERR, "CacheStorage.open() failed to access the storage system.") diff --git a/dom/bindings/RootedOwningNonNull.h b/dom/bindings/RootedOwningNonNull.h index 890afd74f775..b9f8d1812666 100644 --- a/dom/bindings/RootedOwningNonNull.h +++ b/dom/bindings/RootedOwningNonNull.h @@ -51,21 +51,12 @@ struct GCPolicy> } // namespace JS namespace js { -template -struct RootedBase> +template +struct WrappedPtrOperations, Wrapper> { - typedef mozilla::OwningNonNull SmartPtrType; - - operator SmartPtrType& () const - { - auto& self = *static_cast*>(this); - return self.get(); - } - operator T& () const { - auto& self = *static_cast*>(this); - return self.get(); + return static_cast(this)->get(); } }; } // namespace js diff --git a/dom/bindings/RootedRefPtr.h b/dom/bindings/RootedRefPtr.h index e27361b24927..c0ad03482655 100644 --- a/dom/bindings/RootedRefPtr.h +++ b/dom/bindings/RootedRefPtr.h @@ -39,19 +39,12 @@ struct GCPolicy> } // namespace JS namespace js { -template -struct RootedBase> +template +struct WrappedPtrOperations, Wrapper> { - operator RefPtr& () const - { - auto& self = *static_cast>*>(this); - return self.get(); - } - operator T*() const { - auto& self = *static_cast>*>(this); - return self.get(); + return static_cast(this)->get(); } }; } // namespace js diff --git a/dom/cache/CacheOpChild.cpp b/dom/cache/CacheOpChild.cpp index 0c6195a930a8..370800403a09 100644 --- a/dom/cache/CacheOpChild.cpp +++ b/dom/cache/CacheOpChild.cpp @@ -155,6 +155,17 @@ CacheOpChild::Recv__delete__(const ErrorResult& aRv, { auto actor = static_cast( aResult.get_StorageOpenResult().actorChild()); + + // If we have a success status then we should have an actor. Gracefully + // reject instead of crashing, though, if we get a nullptr here. + MOZ_DIAGNOSTIC_ASSERT(actor); + if (!actor) { + ErrorResult status; + status.ThrowTypeError(); + mPromise->MaybeReject(status); + break; + } + actor->SetWorkerHolder(GetWorkerHolder()); RefPtr cache = new Cache(mGlobal, actor); mPromise->MaybeResolve(cache); diff --git a/dom/cache/CacheStorage.cpp b/dom/cache/CacheStorage.cpp index c807d2a2817c..ddd911694b8e 100644 --- a/dom/cache/CacheStorage.cpp +++ b/dom/cache/CacheStorage.cpp @@ -501,6 +501,8 @@ void CacheStorage::ActorCreated(PBackgroundChild* aActor) { NS_ASSERT_OWNINGTHREAD(CacheStorage); + MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(mStatus)); + MOZ_DIAGNOSTIC_ASSERT(!mActor); MOZ_DIAGNOSTIC_ASSERT(aActor); if (NS_WARN_IF(mWorkerHolder && mWorkerHolder->Notified())) { @@ -511,19 +513,22 @@ CacheStorage::ActorCreated(PBackgroundChild* aActor) // WorkerHolder ownership is passed to the CacheStorageChild actor and any // actors it may create. The WorkerHolder will keep the worker thread alive // until the actors can gracefully shutdown. - CacheStorageChild* newActor = new CacheStorageChild(this, mWorkerHolder); - PCacheStorageChild* constructedActor = - aActor->SendPCacheStorageConstructor(newActor, mNamespace, *mPrincipalInfo); + mActor = new CacheStorageChild(this, mWorkerHolder); + mWorkerHolder = nullptr; - if (NS_WARN_IF(!constructedActor)) { - ActorFailed(); + // Pass the actor construction message to the parent. Note, if this fails + // we can get DestroyInternal() and ActorFailed() called synchronously. This + // will null out mActor and set an error mStatus. + PCacheStorageChild* constructedActor = + aActor->SendPCacheStorageConstructor(mActor, mNamespace, *mPrincipalInfo); + + if (NS_WARN_IF(NS_FAILED(mStatus))) { + MOZ_DIAGNOSTIC_ASSERT(!mActor); return; } - mWorkerHolder = nullptr; - - MOZ_DIAGNOSTIC_ASSERT(constructedActor == newActor); - mActor = newActor; + MOZ_DIAGNOSTIC_ASSERT(mActor); + MOZ_DIAGNOSTIC_ASSERT(constructedActor == mActor); MaybeRunPendingRequests(); MOZ_DIAGNOSTIC_ASSERT(mPendingRequests.IsEmpty()); @@ -533,7 +538,7 @@ void CacheStorage::ActorFailed() { NS_ASSERT_OWNINGTHREAD(CacheStorage); - MOZ_DIAGNOSTIC_ASSERT(!NS_FAILED(mStatus)); + MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(mStatus)); mStatus = NS_ERROR_UNEXPECTED; mWorkerHolder = nullptr; diff --git a/dom/cache/CacheStreamControlParent.cpp b/dom/cache/CacheStreamControlParent.cpp index f890f5343ebd..88c5c26b95ad 100644 --- a/dom/cache/CacheStreamControlParent.cpp +++ b/dom/cache/CacheStreamControlParent.cpp @@ -85,6 +85,11 @@ CacheStreamControlParent::ActorDestroy(ActorDestroyReason aReason) { NS_ASSERT_OWNINGTHREAD(CacheStreamControlParent); CloseAllReadStreamsWithoutReporting(); + // If the initial SendPStreamControlConstructor() fails we will + // be called before mStreamList is set. + if (!mStreamList) { + return; + } mStreamList->RemoveStreamControl(this); mStreamList->NoteClosedAll(); mStreamList = nullptr; diff --git a/dom/cache/Manager.cpp b/dom/cache/Manager.cpp index 7fd5a15ea796..7a0cf158dda6 100644 --- a/dom/cache/Manager.cpp +++ b/dom/cache/Manager.cpp @@ -1215,6 +1215,7 @@ public: &cacheFound, &mCacheId); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } if (cacheFound) { + MOZ_DIAGNOSTIC_ASSERT(mCacheId != INVALID_CACHE_ID); return rv; } @@ -1227,12 +1228,14 @@ public: rv = trans.Commit(); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } + MOZ_DIAGNOSTIC_ASSERT(mCacheId != INVALID_CACHE_ID); return rv; } virtual void Complete(Listener* aListener, ErrorResult&& aRv) override { + MOZ_DIAGNOSTIC_ASSERT(aRv.Failed() || mCacheId != INVALID_CACHE_ID); aListener->OnOpComplete(Move(aRv), StorageOpenResult(), mCacheId); } diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index ee486337c3e2..f43911d48322 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -1292,6 +1292,7 @@ CrossProcessSafeEvent(const WidgetEvent& aEvent) case eContextMenu: case eMouseEnterIntoWidget: case eMouseExitFromWidget: + case eMouseTouchDrag: return true; default: return false; diff --git a/dom/quota/ActorsParent.cpp b/dom/quota/ActorsParent.cpp index 7200091a45e7..8ec42a74fb25 100644 --- a/dom/quota/ActorsParent.cpp +++ b/dom/quota/ActorsParent.cpp @@ -193,6 +193,39 @@ uint32_t GetMajorStorageVersion(int32_t aStorageVersion) { return uint32_t(aStorageVersion >> 16); + +} + +nsresult +CreateTables(mozIStorageConnection* aConnection) +{ + AssertIsOnIOThread(); + MOZ_ASSERT(aConnection); + + // The database doesn't have any tables for now. It's only used for storage + // version checking. + // However, this is the place where any future tables should be created. + + nsresult rv; + +#ifdef DEBUG + { + int32_t storageVersion; + rv = aConnection->GetSchemaVersion(&storageVersion); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + MOZ_ASSERT(storageVersion == 0); + } +#endif + + rv = aConnection->SetSchemaVersion(kStorageVersion); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + return NS_OK; } /****************************************************************************** @@ -4094,12 +4127,25 @@ QuotaManager::MaybeRemoveOldDirectories() } nsresult -QuotaManager::UpgradeStorageFrom0ToCurrent(mozIStorageConnection* aConnection) +QuotaManager::UpgradeStorageFrom0_0To1_0(mozIStorageConnection* aConnection) { AssertIsOnIOThread(); MOZ_ASSERT(aConnection); - nsresult rv; + nsresult rv = MaybeUpgradeIndexedDBDirectory(); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + rv = MaybeUpgradePersistentStorageDirectory(); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + rv = MaybeRemoveOldDirectories(); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } for (const PersistenceType persistenceType : kAllPersistenceTypes) { nsCOMPtr directory = @@ -4145,12 +4191,26 @@ QuotaManager::UpgradeStorageFrom0ToCurrent(mozIStorageConnection* aConnection) #if 0 nsresult -QuotaManager::UpgradeStorageFrom1To2(mozIStorageConnection* aConnection) +QuotaManager::UpgradeStorageFrom1_0To2_0(mozIStorageConnection* aConnection) { AssertIsOnIOThread(); MOZ_ASSERT(aConnection); - nsresult rv = aConnection->SetSchemaVersion(MakeStorageVersion(2, 0)); + nsresult rv; + +#ifdef DEBUG + { + int32_t storageVersion; + rv = aConnection->GetSchemaVersion(&storageVersion); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + MOZ_ASSERT(storageVersion == MakeStorageVersion(1, 0)); + } +#endif + + rv = aConnection->SetSchemaVersion(MakeStorageVersion(2, 0)); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } @@ -4231,6 +4291,43 @@ QuotaManager::EnsureStorageIsInitialized() if (storageVersion < kStorageVersion) { const bool newDatabase = !storageVersion; + nsCOMPtr storageDir = + do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + rv = storageDir->InitWithPath(mStoragePath); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + bool exists; + rv = storageDir->Exists(&exists); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + if (!exists) { + nsCOMPtr indexedDBDir = + do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + rv = indexedDBDir->InitWithPath(mIndexedDBPath); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + rv = indexedDBDir->Exists(&exists); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + } + + const bool newDirectory = !exists; + if (newDatabase) { // Set the page size first. if (kSQLitePageSizeOverride) { @@ -4245,23 +4342,12 @@ QuotaManager::EnsureStorageIsInitialized() mozStorageTransaction transaction(connection, false, mozIStorageConnection::TRANSACTION_IMMEDIATE); - if (newDatabase) { - rv = MaybeUpgradeIndexedDBDirectory(); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - rv = MaybeUpgradePersistentStorageDirectory(); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - rv = MaybeRemoveOldDirectories(); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - rv = UpgradeStorageFrom0ToCurrent(connection); + // An upgrade method can upgrade the database, the storage or both. + // The upgrade loop below can only be avoided when there's no database and + // no storage yet (e.g. new profile). + if (newDatabase && newDirectory) { + rv = CreateTables(connection); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } @@ -4274,9 +4360,13 @@ QuotaManager::EnsureStorageIsInitialized() "Upgrade function needed due to storage version increase."); while (storageVersion != kStorageVersion) { - /* if (storageVersion == MakeStorageVersion(1, 0)) { - rv = UpgradeStorageFrom1To2(connection); - } else */ { + if (storageVersion == 0) { + rv = UpgradeStorageFrom0_0To1_0(connection); +#if 0 + } else if (storageVersion == MakeStorageVersion(1, 0)) { + rv = UpgradeStorageFrom1_0To2_0(connection); +#endif + } else { NS_WARNING("Unable to initialize storage, no upgrade path is " "available!"); return NS_ERROR_FAILURE; diff --git a/dom/quota/QuotaManager.h b/dom/quota/QuotaManager.h index 5f59ffc6b875..82fef25b2992 100644 --- a/dom/quota/QuotaManager.h +++ b/dom/quota/QuotaManager.h @@ -455,11 +455,11 @@ private: MaybeRemoveOldDirectories(); nsresult - UpgradeStorageFrom0ToCurrent(mozIStorageConnection* aConnection); + UpgradeStorageFrom0_0To1_0(mozIStorageConnection* aConnection); #if 0 nsresult - UpgradeStorageFrom1To2(mozIStorageConnection* aConnection); + UpgradeStorageFrom1_0To2_0(mozIStorageConnection* aConnection); #endif nsresult diff --git a/dom/workers/ScriptLoader.cpp b/dom/workers/ScriptLoader.cpp index b037b46a693a..2ff15bf850a6 100644 --- a/dom/workers/ScriptLoader.cpp +++ b/dom/workers/ScriptLoader.cpp @@ -1579,13 +1579,17 @@ CacheCreator::DeleteCache() { AssertIsOnMainThread(); - ErrorResult rv; + // This is called when the load is canceled which can occur before + // mCacheStorage is initialized. + if (!mCacheStorage) { + return; + } // It's safe to do this while Cache::Match() and Cache::Put() calls are // running. + IgnoredErrorResult rv; RefPtr promise = mCacheStorage->Delete(mCacheName, rv); if (NS_WARN_IF(rv.Failed())) { - rv.SuppressException(); return; } diff --git a/dom/xbl/nsXBLMaybeCompiled.h b/dom/xbl/nsXBLMaybeCompiled.h index d4b366b0eec3..b9714ccc6263 100644 --- a/dom/xbl/nsXBLMaybeCompiled.h +++ b/dom/xbl/nsXBLMaybeCompiled.h @@ -127,15 +127,15 @@ struct IsHeapConstructibleType> static constexpr bool value = true; }; -template -class HeapBase> +template +class HeapBase, Wrapper> { - const JS::Heap>& wrapper() const { - return *static_cast>*>(this); + const Wrapper& wrapper() const { + return *static_cast(this); } - JS::Heap>& wrapper() { - return *static_cast>*>(this); + Wrapper& wrapper() { + return *static_cast(this); } const nsXBLMaybeCompiled* extract() const { diff --git a/gfx/2d/2D.h b/gfx/2d/2D.h index 3c8d7e959fe0..f00ab6047baf 100644 --- a/gfx/2d/2D.h +++ b/gfx/2d/2D.h @@ -1559,8 +1559,6 @@ public: bool aUseEmbeddedBitmap, bool aForceGDIMode); - static void UpdateSystemTextQuality(); - private: static ID2D1Device *mD2D1Device; static ID3D11Device *mD3D11Device; diff --git a/gfx/2d/Factory.cpp b/gfx/2d/Factory.cpp index c9057118040c..e2cf203bb32b 100644 --- a/gfx/2d/Factory.cpp +++ b/gfx/2d/Factory.cpp @@ -41,7 +41,6 @@ #include "NativeFontResourceDWrite.h" #include #include "HelpersD2D.h" -#include "HelpersWinFonts.h" #endif #include "DrawTargetDual.h" @@ -710,15 +709,6 @@ Factory::CreateDWriteGlyphRenderingOptions(IDWriteRenderingParams *aParams) return MakeAndAddRef(aParams); } -BYTE sSystemTextQuality = CLEARTYPE_QUALITY; -void -Factory::UpdateSystemTextQuality() -{ -#ifdef WIN32 - gfx::UpdateSystemTextQuality(); -#endif -} - uint64_t Factory::GetD2DVRAMUsageDrawTarget() { diff --git a/gfx/2d/HelpersWinFonts.h b/gfx/2d/HelpersWinFonts.h index 8d0b994ed6c7..cd84070d4973 100644 --- a/gfx/2d/HelpersWinFonts.h +++ b/gfx/2d/HelpersWinFonts.h @@ -6,45 +6,32 @@ namespace mozilla { namespace gfx { - -extern BYTE sSystemTextQuality; - +// Cleartype can be dynamically enabled/disabled, so we have to check it +// everytime we want to render some text. static BYTE GetSystemTextQuality() -{ - return sSystemTextQuality; -} - -// Cleartype can be dynamically enabled/disabled, so we have to allow for dynamically -// updating it. -static void -UpdateSystemTextQuality() { BOOL font_smoothing; UINT smoothing_type; if (!SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &font_smoothing, 0)) { - sSystemTextQuality = DEFAULT_QUALITY; - return; + return DEFAULT_QUALITY; } if (font_smoothing) { if (!SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &smoothing_type, 0)) { - sSystemTextQuality = DEFAULT_QUALITY; - return; + return DEFAULT_QUALITY; } if (smoothing_type == FE_FONTSMOOTHINGCLEARTYPE) { - sSystemTextQuality = CLEARTYPE_QUALITY; - return; + return CLEARTYPE_QUALITY; } - sSystemTextQuality = ANTIALIASED_QUALITY; - return; + return ANTIALIASED_QUALITY; } - sSystemTextQuality = DEFAULT_QUALITY; + return DEFAULT_QUALITY; } static AntialiasMode diff --git a/gfx/angle/src/compiler/preprocessor/MacroExpander.cpp b/gfx/angle/src/compiler/preprocessor/MacroExpander.cpp index 25dc74180151..2f854f5a6cc5 100755 --- a/gfx/angle/src/compiler/preprocessor/MacroExpander.cpp +++ b/gfx/angle/src/compiler/preprocessor/MacroExpander.cpp @@ -51,8 +51,38 @@ class TokenLexer : public Lexer } // anonymous namespace +class MacroExpander::ScopedMacroReenabler final : angle::NonCopyable +{ + public: + ScopedMacroReenabler(MacroExpander *expander); + ~ScopedMacroReenabler(); + + private: + MacroExpander *mExpander; +}; + +MacroExpander::ScopedMacroReenabler::ScopedMacroReenabler(MacroExpander *expander) + : mExpander(expander) +{ + mExpander->mDeferReenablingMacros = true; +} + +MacroExpander::ScopedMacroReenabler::~ScopedMacroReenabler() +{ + mExpander->mDeferReenablingMacros = false; + for (auto *macro : mExpander->mMacrosToReenable) + { + macro->disabled = false; + } + mExpander->mMacrosToReenable.clear(); +} + MacroExpander::MacroExpander(Lexer *lexer, MacroSet *macroSet, Diagnostics *diagnostics) - : mLexer(lexer), mMacroSet(macroSet), mDiagnostics(diagnostics), mTotalTokensInContexts(0) + : mLexer(lexer), + mMacroSet(macroSet), + mDiagnostics(diagnostics), + mTotalTokensInContexts(0), + mDeferReenablingMacros(false) { } @@ -187,7 +217,14 @@ void MacroExpander::popMacro() ASSERT(context->empty()); ASSERT(context->macro->disabled); ASSERT(context->macro->expansionCount > 0); - context->macro->disabled = false; + if (mDeferReenablingMacros) + { + mMacrosToReenable.push_back(context->macro); + } + else + { + context->macro->disabled = false; + } context->macro->expansionCount--; mTotalTokensInContexts -= context->replacements.size(); delete context; @@ -263,6 +300,11 @@ bool MacroExpander::collectMacroArgs(const Macro ¯o, args->push_back(MacroArg()); + // Defer reenabling macros until args collection is finished to avoid the possibility of + // infinite recursion. Otherwise infinite recursion might happen when expanding the args after + // macros have been popped from the context stack when parsing the args. + ScopedMacroReenabler deferReenablingMacros(this); + int openParens = 1; while (openParens != 0) { diff --git a/gfx/angle/src/compiler/preprocessor/MacroExpander.h b/gfx/angle/src/compiler/preprocessor/MacroExpander.h index 77c767c34a07..3a8450f5ecac 100755 --- a/gfx/angle/src/compiler/preprocessor/MacroExpander.h +++ b/gfx/angle/src/compiler/preprocessor/MacroExpander.h @@ -67,6 +67,11 @@ class MacroExpander : public Lexer std::unique_ptr mReserveToken; std::vector mContextStack; size_t mTotalTokensInContexts; + + bool mDeferReenablingMacros; + std::vector mMacrosToReenable; + + class ScopedMacroReenabler; }; } // namespace pp diff --git a/gfx/angle/src/tests/preprocessor_tests/define_test.cpp b/gfx/angle/src/tests/preprocessor_tests/define_test.cpp index ead5520a3430..e074d1982dd5 100755 --- a/gfx/angle/src/tests/preprocessor_tests/define_test.cpp +++ b/gfx/angle/src/tests/preprocessor_tests/define_test.cpp @@ -971,3 +971,18 @@ TEST_F(DefineTest, UndefineInInvocationPreLParen) preprocess(input, expected); } + +// The name of the macro "a" is inside an incomplete macro invocation of macro "m()" in its own +// expansion. This should not result in infinite recursion. +TEST_F(DefineTest, RecursiveMacroNameInsideIncompleteMacroInvocationInMacroExpansion) +{ + const char *input = + "#define m(a)\n" + "#define a m((a)\n" + "a)\n"; + const char *expected = + "\n" + "\n" + "\n"; + preprocess(input, expected); +} diff --git a/gfx/layers/client/ClientLayerManager.cpp b/gfx/layers/client/ClientLayerManager.cpp index e23d74e480b8..a355b8f120ed 100644 --- a/gfx/layers/client/ClientLayerManager.cpp +++ b/gfx/layers/client/ClientLayerManager.cpp @@ -35,7 +35,6 @@ #endif #ifdef XP_WIN #include "mozilla/gfx/DeviceManagerDx.h" -#include "gfxDWriteFonts.h" #endif namespace mozilla { @@ -290,14 +289,6 @@ ClientLayerManager::EndTransactionInternal(DrawPaintedLayerCallback aCallback, { PaintTelemetry::AutoRecord record(PaintTelemetry::Metric::Rasterization); -#ifdef WIN32 - if (aCallbackData) { - // Content processes don't get OnPaint called. So update here whenever we - // may do Thebes drawing. - gfxDWriteFont::UpdateClearTypeUsage(); - } -#endif - PROFILER_LABEL("ClientLayerManager", "EndTransactionInternal", js::ProfileEntry::Category::GRAPHICS); diff --git a/gfx/tests/crashtests/1325159-1.html b/gfx/tests/crashtests/1325159-1.html new file mode 100644 index 000000000000..2441e9f2fed8 --- /dev/null +++ b/gfx/tests/crashtests/1325159-1.html @@ -0,0 +1,35 @@ + + + + + + + +
+ diff --git a/gfx/tests/crashtests/crashtests.list b/gfx/tests/crashtests/crashtests.list index 90fb0f19b736..fd2815d12965 100644 --- a/gfx/tests/crashtests/crashtests.list +++ b/gfx/tests/crashtests/crashtests.list @@ -132,3 +132,4 @@ load 1216832-1.html load 1225125-1.html asserts-if(stylo,2) load 1308394.html # bug 1324669 load 1317403-1.html +load 1325159-1.html diff --git a/gfx/thebes/gfxDWriteFonts.cpp b/gfx/thebes/gfxDWriteFonts.cpp index ea8e879fb4fa..43fc3325d738 100644 --- a/gfx/thebes/gfxDWriteFonts.cpp +++ b/gfx/thebes/gfxDWriteFonts.cpp @@ -123,7 +123,6 @@ gfxDWriteFont::~gfxDWriteFont() void gfxDWriteFont::UpdateClearTypeUsage() { - Factory::UpdateSystemTextQuality(); mUseClearType = UsingClearType(); } diff --git a/ipc/chromium/src/chrome/common/ipc_channel_posix.cc b/ipc/chromium/src/chrome/common/ipc_channel_posix.cc index 5f679c0758b0..d56dda8fbdc0 100644 --- a/ipc/chromium/src/chrome/common/ipc_channel_posix.cc +++ b/ipc/chromium/src/chrome/common/ipc_channel_posix.cc @@ -538,13 +538,6 @@ bool Channel::ChannelImpl::ProcessIncomingMessages() { " with type " << m.type(); #endif -#ifdef MOZ_TASK_TRACER - AutoSaveCurTraceInfo saveCurTraceInfo; - SetCurTraceInfo(m.header()->source_event_id, - m.header()->parent_task_id, - m.header()->source_event_type); -#endif - if (m.routing_id() == MSG_ROUTING_NONE && m.type() == HELLO_MESSAGE_TYPE) { // The Hello message contains only the process id. diff --git a/ipc/chromium/src/chrome/common/ipc_message.cc b/ipc/chromium/src/chrome/common/ipc_message.cc index 6c69d716b525..792b522d319e 100644 --- a/ipc/chromium/src/chrome/common/ipc_message.cc +++ b/ipc/chromium/src/chrome/common/ipc_message.cc @@ -13,7 +13,7 @@ #include "chrome/common/file_descriptor_set_posix.h" #endif #ifdef MOZ_TASK_TRACER -#include "GeckoTaskTracer.h" +#include "GeckoTaskTracerImpl.h" #endif #include "mozilla/Move.h" @@ -145,4 +145,39 @@ uint32_t Message::num_fds() const { #endif +#ifdef MOZ_TASK_TRACER +void *MessageTask() { + return reinterpret_cast(&MessageTask); +} + +void +Message::TaskTracerDispatch() { + header()->task_id = GenNewUniqueTaskId(); + uintptr_t* vtab = reinterpret_cast(&MessageTask); + LogVirtualTablePtr(header()->task_id, + header()->source_event_id, + vtab); + LogDispatch(header()->task_id, + header()->parent_task_id, + header()->source_event_id, + header()->source_event_type); +} + +Message::AutoTaskTracerRun::AutoTaskTracerRun(Message& aMsg) + : mMsg(aMsg) + , mTaskId(mMsg.header()->task_id) + , mSourceEventId(mMsg.header()->source_event_id) { + LogBegin(mMsg.header()->task_id, + mMsg.header()->source_event_id); + SetCurTraceInfo(mMsg.header()->source_event_id, + mMsg.header()->task_id, + mMsg.header()->source_event_type); +} + +Message::AutoTaskTracerRun::~AutoTaskTracerRun() { + AddLabel("IPC Message %s", mMsg.name()); + LogEnd(mTaskId, mSourceEventId); +} +#endif + } // namespace IPC diff --git a/ipc/chromium/src/chrome/common/ipc_message.h b/ipc/chromium/src/chrome/common/ipc_message.h index c89902b0e67f..30fbeec0a8cb 100644 --- a/ipc/chromium/src/chrome/common/ipc_message.h +++ b/ipc/chromium/src/chrome/common/ipc_message.h @@ -272,6 +272,19 @@ class Message : public Pickle { header()->flags |= INTERRUPT_BIT; } +#ifdef MOZ_TASK_TRACER + void TaskTracerDispatch(); + class AutoTaskTracerRun + : public mozilla::tasktracer::AutoSaveCurTraceInfo { + Message& mMsg; + uint64_t mTaskId; + uint64_t mSourceEventId; + public: + explicit AutoTaskTracerRun(Message& aMsg); + ~AutoTaskTracerRun(); + }; +#endif + #if !defined(OS_MACOSX) protected: #endif @@ -311,6 +324,7 @@ class Message : public Pickle { // Sequence number int32_t seqno; #ifdef MOZ_TASK_TRACER + uint64_t task_id; uint64_t source_event_id; uint64_t parent_task_id; mozilla::tasktracer::SourceEventType source_event_type; diff --git a/ipc/glue/MessageChannel.cpp b/ipc/glue/MessageChannel.cpp index 750f28c669e1..d7de59ed667d 100644 --- a/ipc/glue/MessageChannel.cpp +++ b/ipc/glue/MessageChannel.cpp @@ -22,6 +22,11 @@ #include "nsISupportsImpl.h" #include "nsContentUtils.h" +#ifdef MOZ_TASK_TRACER +#include "GeckoTaskTracer.h" +using namespace mozilla::tasktracer; +#endif + using mozilla::Move; // Undo the damage done by mozzconf.h @@ -979,6 +984,9 @@ MessageChannel::OnMessageReceivedFromLink(Message&& aMsg) // blocked. This is okay, since we always check for pending events before // blocking again. +#ifdef MOZ_TASK_TRACER + aMsg.TaskTracerDispatch(); +#endif RefPtr task = new MessageTask(this, Move(aMsg)); mPending.insertBack(task); @@ -1079,6 +1087,9 @@ MessageChannel::Send(Message* aMsg, Message* aReply) SyncStackFrame frame(this, false); NeuteredWindowRegion neuteredRgn(mFlags & REQUIRE_DEFERRED_MESSAGE_PROTECTION); #endif +#ifdef MOZ_TASK_TRACER + AutoScopedLabel autolabel("sync message %s", aMsg->name()); +#endif CxxStackFrame f(*this, OUT_MESSAGE, msg); @@ -1271,6 +1282,9 @@ MessageChannel::Call(Message* aMsg, Message* aReply) #ifdef OS_WIN SyncStackFrame frame(this, true); #endif +#ifdef MOZ_TASK_TRACER + AutoScopedLabel autolabel("sync message %s", aMsg->name()); +#endif // This must come before MonitorAutoLock, as its destructor acquires the // monitor lock. @@ -1416,6 +1430,9 @@ MessageChannel::Call(Message* aMsg, Message* aReply) // own the monitor. size_t stackDepth = InterruptStackDepth(); { +#ifdef MOZ_TASK_TRACER + Message::AutoTaskTracerRun tasktracerRun(recvd); +#endif MonitorAutoUnlock unlock(*mMonitor); CxxStackFrame frame(*this, IN_MESSAGE, &recvd); @@ -1675,6 +1692,9 @@ MessageChannel::DispatchMessage(Message &&aMsg) MOZ_RELEASE_ASSERT(!aMsg.is_sync() || id == transaction.TransactionID()); { +#ifdef MOZ_TASK_TRACER + Message::AutoTaskTracerRun tasktracerRun(aMsg); +#endif MonitorAutoUnlock unlock(*mMonitor); CxxStackFrame frame(*this, IN_MESSAGE, &aMsg); @@ -1711,6 +1731,9 @@ MessageChannel::DispatchSyncMessage(const Message& aMsg, Message*& aReply) int nestedLevel = aMsg.nested_level(); MOZ_RELEASE_ASSERT(nestedLevel == IPC::Message::NOT_NESTED || NS_IsMainThread()); +#ifdef MOZ_TASK_TRACER + AutoScopedLabel autolabel("sync message %s", aMsg.name()); +#endif MessageChannel* dummy; MessageChannel*& blockingVar = mSide == ChildSide && NS_IsMainThread() ? gParentProcessBlocker : dummy; diff --git a/js/public/GCHashTable.h b/js/public/GCHashTable.h index d6c2ce75b3ff..0776201c01eb 100644 --- a/js/public/GCHashTable.h +++ b/js/public/GCHashTable.h @@ -134,13 +134,13 @@ class GCRekeyableHashMap : public JS::GCHashMap -class GCHashMapOperations +template +class WrappedPtrOperations, Wrapper> { using Map = JS::GCHashMap; using Lookup = typename Map::Lookup; - const Map& map() const { return static_cast(this)->get(); } + const Map& map() const { return static_cast(this)->get(); } public: using AddPtr = typename Map::AddPtr; @@ -163,18 +163,18 @@ class GCHashMapOperations } }; -template -class MutableGCHashMapOperations - : public GCHashMapOperations +template +class MutableWrappedPtrOperations, Wrapper> + : public WrappedPtrOperations, Wrapper> { using Map = JS::GCHashMap; using Lookup = typename Map::Lookup; - Map& map() { return static_cast(this)->get(); } + Map& map() { return static_cast(this)->get(); } public: using AddPtr = typename Map::AddPtr; - struct Enum : public Map::Enum { explicit Enum(Outer& o) : Map::Enum(o.map()) {} }; + struct Enum : public Map::Enum { explicit Enum(Wrapper& o) : Map::Enum(o.map()) {} }; using Ptr = typename Map::Ptr; using Range = typename Map::Range; @@ -211,26 +211,6 @@ class MutableGCHashMapOperations } }; -template -class RootedBase> - : public MutableGCHashMapOperations>, A,B,C,D,E> -{}; - -template -class MutableHandleBase> - : public MutableGCHashMapOperations>, A,B,C,D,E> -{}; - -template -class HandleBase> - : public GCHashMapOperations>, A,B,C,D,E> -{}; - -template -class WeakCacheBase> - : public MutableGCHashMapOperations>, A,B,C,D,E> -{}; - } // namespace js namespace JS { @@ -292,13 +272,13 @@ class GCHashSet : public js::HashSet namespace js { -template -class GCHashSetOperations +template +class WrappedPtrOperations, Wrapper> { using Set = JS::GCHashSet; using Lookup = typename Set::Lookup; - const Set& set() const { return static_cast(this)->get(); } + const Set& set() const { return static_cast(this)->get(); } public: using AddPtr = typename Set::AddPtr; @@ -322,19 +302,19 @@ class GCHashSetOperations } }; -template -class MutableGCHashSetOperations - : public GCHashSetOperations +template +class MutableWrappedPtrOperations, Wrapper> + : public WrappedPtrOperations, Wrapper> { using Set = JS::GCHashSet; using Lookup = typename Set::Lookup; - Set& set() { return static_cast(this)->get(); } + Set& set() { return static_cast(this)->get(); } public: using AddPtr = typename Set::AddPtr; using Entry = typename Set::Entry; - struct Enum : public Set::Enum { explicit Enum(Outer& o) : Set::Enum(o.set()) {} }; + struct Enum : public Set::Enum { explicit Enum(Wrapper& o) : Set::Enum(o.set()) {} }; using Ptr = typename Set::Ptr; using Range = typename Set::Range; @@ -370,30 +350,6 @@ class MutableGCHashSetOperations } }; -template -class RootedBase> - : public MutableGCHashSetOperations>, T, HP, AP> -{ -}; - -template -class MutableHandleBase> - : public MutableGCHashSetOperations>, T, HP, AP> -{ -}; - -template -class HandleBase> - : public GCHashSetOperations>, T, HP, AP> -{ -}; - -template -class WeakCacheBase> - : public MutableGCHashSetOperations>, T, HP, AP> -{ -}; - } /* namespace js */ #endif /* GCHashTable_h */ diff --git a/js/public/GCVariant.h b/js/public/GCVariant.h index 31ab23f54c41..3e11de2136d8 100644 --- a/js/public/GCVariant.h +++ b/js/public/GCVariant.h @@ -124,13 +124,13 @@ struct GCPolicy> namespace js { -template -class GCVariantOperations +template +class WrappedPtrOperations, Wrapper> { using Impl = JS::detail::GCVariantImplementation; using Variant = mozilla::Variant; - const Variant& variant() const { return static_cast(this)->get(); } + const Variant& variant() const { return static_cast(this)->get(); } public: template @@ -150,15 +150,15 @@ class GCVariantOperations } }; -template -class MutableGCVariantOperations - : public GCVariantOperations +template +class MutableWrappedPtrOperations, Wrapper> + : public WrappedPtrOperations, Wrapper> { using Impl = JS::detail::GCVariantImplementation; using Variant = mozilla::Variant; - const Variant& variant() const { return static_cast(this)->get(); } - Variant& variant() { return static_cast(this)->get(); } + const Variant& variant() const { return static_cast(this)->get(); } + Variant& variant() { return static_cast(this)->get(); } public: template @@ -173,26 +173,6 @@ class MutableGCVariantOperations } }; -template -class RootedBase> - : public MutableGCVariantOperations>, Ts...> -{ }; - -template -class MutableHandleBase> - : public MutableGCVariantOperations>, Ts...> -{ }; - -template -class HandleBase> - : public GCVariantOperations>, Ts...> -{ }; - -template -class PersistentRootedBase> - : public MutableGCVariantOperations>, Ts...> -{ }; - } // namespace js #endif // js_GCVariant_h diff --git a/js/public/GCVector.h b/js/public/GCVector.h index 2668e65b2cf9..beff96c3f729 100644 --- a/js/public/GCVector.h +++ b/js/public/GCVector.h @@ -135,11 +135,11 @@ class GCVector namespace js { -template -class GCVectorOperations +template +class WrappedPtrOperations, Wrapper> { using Vec = JS::GCVector; - const Vec& vec() const { return static_cast(this)->get(); } + const Vec& vec() const { return static_cast(this)->get(); } public: const AllocPolicy& allocPolicy() const { return vec().allocPolicy(); } @@ -155,13 +155,13 @@ class GCVectorOperations } }; -template -class MutableGCVectorOperations - : public GCVectorOperations +template +class MutableWrappedPtrOperations, Wrapper> + : public WrappedPtrOperations, Wrapper> { using Vec = JS::GCVector; - const Vec& vec() const { return static_cast(this)->get(); } - Vec& vec() { return static_cast(this)->get(); } + const Vec& vec() const { return static_cast(this)->get(); } + Vec& vec() { return static_cast(this)->get(); } public: const AllocPolicy& allocPolicy() const { return vec().allocPolicy(); } @@ -224,26 +224,6 @@ class MutableGCVectorOperations void erase(T* aBegin, T* aEnd) { vec().erase(aBegin, aEnd); } }; -template -class RootedBase> - : public MutableGCVectorOperations>, T,N,AP> -{}; - -template -class MutableHandleBase> - : public MutableGCVectorOperations>, T,N,AP> -{}; - -template -class HandleBase> - : public GCVectorOperations>, T,N,AP> -{}; - -template -class PersistentRootedBase> - : public MutableGCVectorOperations>, T,N,AP> -{}; - } // namespace js #endif // js_GCVector_h diff --git a/js/public/RootingAPI.h b/js/public/RootingAPI.h index 55b4833ea70c..d213980640c7 100644 --- a/js/public/RootingAPI.h +++ b/js/public/RootingAPI.h @@ -113,17 +113,23 @@ template struct BarrierMethods { }; -template -class RootedBase {}; +template +class WrappedPtrOperations {}; -template -class HandleBase {}; +template +class MutableWrappedPtrOperations : public WrappedPtrOperations {}; -template -class MutableHandleBase {}; +template +class RootedBase : public MutableWrappedPtrOperations {}; -template -class HeapBase {}; +template +class HandleBase : public WrappedPtrOperations {}; + +template +class MutableHandleBase : public MutableWrappedPtrOperations {}; + +template +class HeapBase : public MutableWrappedPtrOperations {}; // Cannot use FOR_EACH_HEAP_ABLE_GC_POINTER_TYPE, as this would import too many macros into scope template struct IsHeapConstructibleType { static constexpr bool value = false; }; @@ -133,8 +139,8 @@ FOR_EACH_PUBLIC_GC_POINTER_TYPE(DECLARE_IS_HEAP_CONSTRUCTIBLE_TYPE) FOR_EACH_PUBLIC_TAGGED_GC_POINTER_TYPE(DECLARE_IS_HEAP_CONSTRUCTIBLE_TYPE) #undef DECLARE_IS_HEAP_CONSTRUCTIBLE_TYPE -template -class PersistentRootedBase {}; +template +class PersistentRootedBase : public MutableWrappedPtrOperations {}; static void* const ConstNullValue = nullptr; @@ -223,7 +229,7 @@ AssertGCThingIsNotAnObjectSubclass(js::gc::Cell* cell) {} * Type T must be a public GC pointer type. */ template -class Heap : public js::HeapBase +class Heap : public js::HeapBase> { // Please note: this can actually also be used by nsXBLMaybeCompiled, for legacy reasons. static_assert(js::IsHeapConstructibleType::value, @@ -362,7 +368,7 @@ ScriptIsMarkedGray(const Heap& script) * - It is not possible to store flag bits in a Heap. */ template -class TenuredHeap : public js::HeapBase +class TenuredHeap : public js::HeapBase> { public: using ElementType = T; @@ -445,7 +451,7 @@ class TenuredHeap : public js::HeapBase * specialization, define a HandleBase specialization containing them. */ template -class MOZ_NONHEAP_CLASS Handle : public js::HandleBase +class MOZ_NONHEAP_CLASS Handle : public js::HandleBase> { friend class JS::MutableHandle; @@ -535,7 +541,7 @@ class MOZ_NONHEAP_CLASS Handle : public js::HandleBase * them. */ template -class MOZ_STACK_CLASS MutableHandle : public js::MutableHandleBase +class MOZ_STACK_CLASS MutableHandle : public js::MutableHandleBase> { public: using ElementType = T; @@ -747,7 +753,7 @@ namespace JS { * specialization, define a RootedBase specialization containing them. */ template -class MOZ_RAII Rooted : public js::RootedBase +class MOZ_RAII Rooted : public js::RootedBase> { inline void registerWithRootLists(js::RootedListHeads& roots) { this->stack = &roots[JS::MapTypeToRootKind::kind]; @@ -845,8 +851,8 @@ namespace js { * Rooted rooted(cx, &obj->as()); * Handle h = rooted; */ -template <> -class RootedBase +template +class RootedBase : public MutableWrappedPtrOperations { public: template @@ -863,8 +869,8 @@ class RootedBase * Rooted rooted(cx, &obj->as()); * Handle h = rooted; */ -template <> -class HandleBase +template +class HandleBase : public WrappedPtrOperations { public: template @@ -873,7 +879,7 @@ class HandleBase /** Interface substitute for Rooted which does not root the variable's memory. */ template -class MOZ_RAII FakeRooted : public RootedBase +class MOZ_RAII FakeRooted : public RootedBase> { public: using ElementType = T; @@ -901,7 +907,7 @@ class MOZ_RAII FakeRooted : public RootedBase /** Interface substitute for MutableHandle which is not required to point to rooted memory. */ template -class FakeMutableHandle : public js::MutableHandleBase +class FakeMutableHandle : public js::MutableHandleBase> { public: using ElementType = T; @@ -1070,7 +1076,7 @@ MutableHandle::MutableHandle(PersistentRooted* root) * marked when the object itself is marked. */ template -class PersistentRooted : public js::PersistentRootedBase, +class PersistentRooted : public js::RootedBase>, private mozilla::LinkedListElement> { using ListBase = mozilla::LinkedListElement>; @@ -1230,44 +1236,25 @@ class JS_PUBLIC_API(ObjectPtr) namespace js { -template -class UniquePtrOperations +template +class WrappedPtrOperations, Container> { - const UniquePtr& uniquePtr() const { return static_cast(this)->get(); } + const UniquePtr& uniquePtr() const { return static_cast(this)->get(); } public: explicit operator bool() const { return !!uniquePtr(); } }; -template -class MutableUniquePtrOperations : public UniquePtrOperations +template +class MutableWrappedPtrOperations, Container> + : public WrappedPtrOperations, Container> { - UniquePtr& uniquePtr() { return static_cast(this)->get(); } + UniquePtr& uniquePtr() { return static_cast(this)->get(); } public: MOZ_MUST_USE typename UniquePtr::Pointer release() { return uniquePtr().release(); } }; -template -class RootedBase> - : public MutableUniquePtrOperations>, T, D> -{ }; - -template -class MutableHandleBase> - : public MutableUniquePtrOperations>, T, D> -{ }; - -template -class HandleBase> - : public UniquePtrOperations>, T, D> -{ }; - -template -class PersistentRootedBase> - : public MutableUniquePtrOperations>, T, D> -{ }; - namespace gc { template diff --git a/js/public/SweepingAPI.h b/js/public/SweepingAPI.h index 0eb29ae4133c..1e66c1c4c0b9 100644 --- a/js/public/SweepingAPI.h +++ b/js/public/SweepingAPI.h @@ -9,11 +9,6 @@ #include "js/HeapAPI.h" -namespace js { -template -class WeakCacheBase {}; -} // namespace js - namespace JS { template class WeakCache; @@ -25,7 +20,7 @@ RegisterWeakCache(JS::Zone* zone, JS::WeakCache* cachep); // A WeakCache stores the given Sweepable container and links itself into a // list of such caches that are swept during each GC. template -class WeakCache : public js::WeakCacheBase, +class WeakCache : public js::MutableWrappedPtrOperations>, private mozilla::LinkedListElement> { friend class mozilla::LinkedListElement>; diff --git a/js/public/Value.h b/js/public/Value.h index e052a090ca5d..dbcaff2a97d5 100644 --- a/js/public/Value.h +++ b/js/public/Value.h @@ -1288,20 +1288,18 @@ struct BarrierMethods } }; -template class MutableValueOperations; +template class MutableValueOperations; /** * A class designed for CRTP use in implementing the non-mutating parts of the - * Value interface in Value-like classes. Outer must be a class inheriting - * ValueOperations with a visible get() method returning a const - * reference to the Value abstracted by Outer. + * Value interface in Value-like classes. Wrapper must be a class inheriting + * ValueOperations with a visible get() method returning a const + * reference to the Value abstracted by Wrapper. */ -template -class ValueOperations +template +class WrappedPtrOperations { - friend class MutableValueOperations; - - const JS::Value& value() const { return static_cast(this)->get(); } + const JS::Value& value() const { return static_cast(this)->get(); } public: bool isUndefined() const { return value().isUndefined(); } @@ -1346,14 +1344,14 @@ class ValueOperations /** * A class designed for CRTP use in implementing all the mutating parts of the - * Value interface in Value-like classes. Outer must be a class inheriting - * MutableValueOperations with visible get() methods returning const and - * non-const references to the Value abstracted by Outer. + * Value interface in Value-like classes. Wrapper must be a class inheriting + * MutableWrappedPtrOperations with visible get() methods returning const and + * non-const references to the Value abstracted by Wrapper. */ -template -class MutableValueOperations : public ValueOperations +template +class MutableWrappedPtrOperations : public WrappedPtrOperations { - JS::Value& value() { return static_cast(this)->get(); } + JS::Value& value() { return static_cast(this)->get(); } public: void setNull() { value().setNull(); } @@ -1378,13 +1376,9 @@ class MutableValueOperations : public ValueOperations * Augment the generic Heap interface when T = Value with * type-querying, value-extracting, and mutating operations. */ -template <> -class HeapBase : public ValueOperations > +template +class HeapBase : public WrappedPtrOperations { - typedef JS::Heap Outer; - - friend class ValueOperations; - void setBarriered(const JS::Value& v) { *static_cast*>(this) = v; } @@ -1431,22 +1425,6 @@ class HeapBase : public ValueOperations > } }; -template <> -class HandleBase : public ValueOperations > -{}; - -template <> -class MutableHandleBase : public MutableValueOperations > -{}; - -template <> -class RootedBase : public MutableValueOperations > -{}; - -template <> -class PersistentRootedBase : public MutableValueOperations> -{}; - /* * If the Value is a GC pointer type, convert to that type and call |f| with * the pointer. If the Value is not a GC type, calls F::defaultValue. diff --git a/js/src/builtin/MapObject.h b/js/src/builtin/MapObject.h index b24877f83654..a45bd9d62d5b 100644 --- a/js/src/builtin/MapObject.h +++ b/js/src/builtin/MapObject.h @@ -53,14 +53,22 @@ class HashableValue } }; -template <> -class RootedBase { +template +class WrappedPtrOperations +{ + public: + Value value() const { + return static_cast(this)->get().get(); + } +}; + +template +class MutableWrappedPtrOperations + : public WrappedPtrOperations +{ public: MOZ_MUST_USE bool setValue(JSContext* cx, HandleValue v) { - return static_cast*>(this)->get().setValue(cx, v); - } - Value value() const { - return static_cast*>(this)->get().get(); + return static_cast(this)->get().setValue(cx, v); } }; diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index b28c6299b893..f6bcaf70b3c2 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -786,7 +786,17 @@ ScheduleGC(JSContext* cx, unsigned argc, Value* vp) PrepareZoneForGC(zone); } else if (args[0].isString()) { /* This allows us to schedule the atoms zone for GC. */ - PrepareZoneForGC(args[0].toString()->zone()); + Zone* zone = args[0].toString()->zoneFromAnyThread(); + if (!CurrentThreadCanAccessZone(zone)) { + RootedObject callee(cx, &args.callee()); + ReportUsageErrorASCII(cx, callee, "Specified zone not accessible for GC"); + return false; + } + PrepareZoneForGC(zone); + } else { + RootedObject callee(cx, &args.callee()); + ReportUsageErrorASCII(cx, callee, "Bad argument - expecting integer, object or string"); + return false; } uint32_t zealBits; @@ -4219,9 +4229,10 @@ JS_FN_HELP("rejectPromise", RejectPromise, 2, 0, gc::ZealModeHelpText), JS_FN_HELP("schedulegc", ScheduleGC, 1, 0, -"schedulegc([num | obj])", +"schedulegc([num | obj | string])", " If num is given, schedule a GC after num allocations.\n" " If obj is given, schedule a GC of obj's zone.\n" +" If string is given, schedule a GC of the string's zone if possible.\n" " Returns the number of allocations before the next trigger."), JS_FN_HELP("selectforgc", SelectForGC, 0, 0, diff --git a/js/src/ds/TraceableFifo.h b/js/src/ds/TraceableFifo.h index 5899c6799b82..95871688dc00 100644 --- a/js/src/ds/TraceableFifo.h +++ b/js/src/ds/TraceableFifo.h @@ -52,11 +52,11 @@ class TraceableFifo : public js::Fifo } }; -template -class TraceableFifoOperations +template +class WrappedPtrOperations, Wrapper> { using TF = TraceableFifo; - const TF& fifo() const { return static_cast(this)->extract(); } + const TF& fifo() const { return static_cast(this)->get(); } public: size_t length() const { return fifo().length(); } @@ -64,12 +64,12 @@ class TraceableFifoOperations const T& front() const { return fifo().front(); } }; -template -class MutableTraceableFifoOperations - : public TraceableFifoOperations +template +class MutableWrappedPtrOperations, Wrapper> + : public WrappedPtrOperations, Wrapper> { using TF = TraceableFifo; - TF& fifo() { return static_cast(this)->extract(); } + TF& fifo() { return static_cast(this)->get(); } public: T& front() { return fifo().front(); } @@ -83,46 +83,6 @@ class MutableTraceableFifoOperations void clear() { fifo().clear(); } }; -template -class RootedBase> - : public MutableTraceableFifoOperations>, A,B,C> -{ - using TF = TraceableFifo; - - friend class TraceableFifoOperations, A,B,C>; - const TF& extract() const { return *static_cast*>(this)->address(); } - - friend class MutableTraceableFifoOperations, A,B,C>; - TF& extract() { return *static_cast*>(this)->address(); } -}; - -template -class MutableHandleBase> - : public MutableTraceableFifoOperations>, A,B,C> -{ - using TF = TraceableFifo; - - friend class TraceableFifoOperations, A,B,C>; - const TF& extract() const { - return *static_cast*>(this)->address(); - } - - friend class MutableTraceableFifoOperations, A,B,C>; - TF& extract() { return *static_cast*>(this)->address(); } -}; - -template -class HandleBase> - : public TraceableFifoOperations>, A,B,C> -{ - using TF = TraceableFifo; - - friend class TraceableFifoOperations, A,B,C>; - const TF& extract() const { - return *static_cast*>(this)->address(); - } -}; - } // namespace js #endif // js_TraceableFifo_h diff --git a/js/src/gc/Barrier.h b/js/src/gc/Barrier.h index 9772eb4b7ace..5fbe3eb464fe 100644 --- a/js/src/gc/Barrier.h +++ b/js/src/gc/Barrier.h @@ -316,15 +316,9 @@ struct InternalBarrierMethods static void postBarrier(jsid* idp, jsid prev, jsid next) {} }; -// Barrier classes can use Mixins to add methods to a set of barrier -// instantiations, to make the barriered thing look and feel more like the -// thing itself. -template -class BarrieredBaseMixins {}; - // Base class of all barrier types. template -class BarrieredBase : public BarrieredBaseMixins +class BarrieredBase { protected: // BarrieredBase is not directly instantiable. @@ -345,9 +339,12 @@ class BarrieredBase : public BarrieredBaseMixins // Base class for barriered pointer types that intercept only writes. template -class WriteBarrieredBase : public BarrieredBase +class WriteBarrieredBase : public BarrieredBase, + public WrappedPtrOperations> { protected: + using BarrieredBase::value; + // WriteBarrieredBase is not directly instantiable. explicit WriteBarrieredBase(const T& v) : BarrieredBase(v) {} @@ -566,8 +563,12 @@ class ReadBarrieredBase : public BarrieredBase // insert manual post-barriers on the table for rekeying if the key is based in // any way on the address of the object. template -class ReadBarriered : public ReadBarrieredBase +class ReadBarriered : public ReadBarrieredBase, + public WrappedPtrOperations> { + protected: + using ReadBarrieredBase::value; + public: ReadBarriered() : ReadBarrieredBase(JS::GCPolicy::initial()) {} @@ -634,12 +635,6 @@ class ReadBarriered : public ReadBarrieredBase template using WeakRef = ReadBarriered; -// Add Value operations to all Barrier types. Note, this must be defined before -// HeapSlot for HeapSlot's base to get these operations. -template <> -class BarrieredBaseMixins : public ValueOperations> -{}; - // A pre- and post-barriered Value that is specialized to be aware that it // resides in a slots or elements vector. This allows it to be relocated in // memory, but with substantially less overhead than a HeapPtr. diff --git a/js/src/jit-test/tests/gc/bug-1311060.js b/js/src/jit-test/tests/gc/bug-1311060.js new file mode 100644 index 000000000000..b4bdfd2d3c93 --- /dev/null +++ b/js/src/jit-test/tests/gc/bug-1311060.js @@ -0,0 +1,3 @@ +if (helperThreadCount() === 0) + quit(); +evalInWorker(`schedulegc("s1");`); diff --git a/js/src/jit-test/tests/parser/bug-1324773-2.js b/js/src/jit-test/tests/parser/bug-1324773-2.js new file mode 100644 index 000000000000..1510232237e8 --- /dev/null +++ b/js/src/jit-test/tests/parser/bug-1324773-2.js @@ -0,0 +1,15 @@ +if (!('gczeal' in this)) + quit(); +var lfGlobal = newGlobal(); +lfGlobal.evaluate(` + for (var i = 0; i < 600; i++) + eval('function f' + i + '() {}'); +`); +var lfGlobal = newGlobal(); +lfGlobal.evaluate(` + if (!('gczeal' in this)) + quit(); + var dbg = new Debugger(); + gczeal(9, 10); + dbg.findScripts({}); +`); diff --git a/js/src/jit-test/tests/parser/bug-1324773.js b/js/src/jit-test/tests/parser/bug-1324773.js new file mode 100644 index 000000000000..95248c023602 --- /dev/null +++ b/js/src/jit-test/tests/parser/bug-1324773.js @@ -0,0 +1,15 @@ +if (!('gczeal' in this)) + quit(); +var lfGlobal = newGlobal(); +lfGlobal.evaluate(` + for (var i = 0; i < 600; i++) + eval('function f' + i + '() {}'); +`); +var lfGlobal = newGlobal(); +lfGlobal.evaluate(` + if (!('gczeal' in this)) + quit(); + var dbg = new Debugger(); + gczeal(9, 1); + dbg.findScripts({}); +`); diff --git a/js/src/jit-test/tests/wasm/integer.js b/js/src/jit-test/tests/wasm/integer.js index 3b3ce44a1114..f9dbaeae3fcc 100644 --- a/js/src/jit-test/tests/wasm/integer.js +++ b/js/src/jit-test/tests/wasm/integer.js @@ -207,33 +207,68 @@ assertEq(testTrunc(13.37), 1); testTrap64('rem_s', 10, 0, /integer divide by zero/); testTrap64('rem_u', 10, 0, /integer divide by zero/); - testBinary64('and', 42, 6, 2); + // Bitops. testBinary64('or', 42, 6, 46); - testBinary64('xor', 42, 2, 40); - testBinary64('and', "0x8765432112345678", "0xffff0000ffff0000", "0x8765000012340000"); testBinary64('or', "0x8765432112345678", "0xffff0000ffff0000", "0xffff4321ffff5678"); + + testBinary64('xor', 42, 2, 40); testBinary64('xor', "0x8765432112345678", "0xffff0000ffff0000", "0x789a4321edcb5678"); - testBinary64('shl', 40, 2, 160); - testBinary64('shr_s', -40, 2, -10); - testBinary64('shr_u', -40, 2, "0x3ffffffffffffff6"); - testBinary64('shl', 0xff00ff, 28, "0xff00ff0000000"); + + testBinary64('shl', 0xff00ff, 28, "0x0ff00ff0000000"); + testBinary64('shl', 0xff00ff, 30, "0x3fc03fc0000000"); + testBinary64('shl', 0xff00ff, 31, "0x7f807f80000000"); + testBinary64('shl', 0xff00ff, 32, "0xff00ff00000000"); testBinary64('shl', 1, 63, "0x8000000000000000"); testBinary64('shl', 1, 64, 1); - testBinary64('shr_s', "0xff00ff0000000", 28, 0xff00ff); - testBinary64('shr_u', "0x8ffff00ff0000000", 56, 0x8f); - testBinary64('rotl', 40, 2, 160); - testBinary64('rotr', 40, 2, 10); - testBinary64('rotr', "0x1234567812345678", 4, "0x8123456781234567"); - testBinary64('rotl', "0x1234567812345678", 4, "0x2345678123456781"); - testBinary64('rotl', "0x1234567812345678", 60, "0x8123456781234567"); - testBinary64('rotr', "0x1234567812345678", 60, "0x2345678123456781"); - testBinary64('rotl', "0x0000000000001000", 127, "0x0000000000000800"); - testBinary64('rotr', "0x0000000000001000", 127, "0x0000000000002000"); - testBinary64('rotr', 40, 0, 40); - testBinary64('rotl', 40, 0, 40); - testBinary64('and', 42, 0, 0); - testBinary64('and', "0x0000000012345678", "0xffff0000ffff0000", "0x0000000012340000"); + testBinary64('shl', 40, 2, 160); + testBinary64('shr_s', -40, 2, -10); + testBinary64('shr_s', "0xff00ff0000000", 28, 0xff00ff); + testBinary64('shr_s', "0xff00ff0000000", 30, 0x3fc03f); + testBinary64('shr_s', "0xff00ff0000000", 31, 0x1fe01f); + testBinary64('shr_s', "0xff00ff0000000", 32, 0x0ff00f); + + testBinary64('shr_u', -40, 2, "0x3ffffffffffffff6"); + testBinary64('shr_u', "0x8ffff00ff0000000", 30, "0x23fffc03f"); + testBinary64('shr_u', "0x8ffff00ff0000000", 31, "0x11fffe01f"); + testBinary64('shr_u', "0x8ffff00ff0000000", 32, "0x08ffff00f"); + testBinary64('shr_u', "0x8ffff00ff0000000", 56, 0x8f); + + testBinary64('and', 42, 0, 0); + testBinary64('and', 42, 6, 2); + testBinary64('and', "0x0000000012345678", "0xffff0000ffff0000", "0x0000000012340000"); + testBinary64('and', "0x8765432112345678", "0xffff0000ffff0000", "0x8765000012340000"); + + // Rotations. + testBinary64('rotl', 40, 0, 0x28); + testBinary64('rotl', 40, 2, 0xA0); + testBinary64('rotl', 40, 8, 0x2800); + testBinary64('rotl', 40, 30, "0xA00000000"); + testBinary64('rotl', 40, 31, "0x1400000000"); + testBinary64('rotl', 40, 32, "0x2800000000"); + + testBinary64('rotl', "0x1234567812345678", 4, "0x2345678123456781"); + testBinary64('rotl', "0x1234567812345678", 30, "0x048D159E048D159E"); + testBinary64('rotl', "0x1234567812345678", 31, "0x091A2B3C091A2B3C"); + testBinary64('rotl', "0x1234567812345678", 32, "0x1234567812345678"); + + testBinary64('rotl', "0x0000000000001000", 127, "0x0000000000000800"); + + testBinary64('rotr', 40, 0, 0x28); + testBinary64('rotr', 40, 2, 0x0A); + testBinary64('rotr', 40, 30, "0xA000000000"); + testBinary64('rotr', 40, 31, "0x5000000000"); + testBinary64('rotr', 40, 32, "0x2800000000"); + + testBinary64('rotr', "0x1234567812345678", 4, "0x8123456781234567"); + testBinary64('rotr', "0x1234567812345678", 30, "0x48D159E048D159E0"); + testBinary64('rotr', "0x1234567812345678", 31, "0x2468ACF02468ACF0"); + testBinary64('rotr', "0x1234567812345678", 32, "0x1234567812345678"); + testBinary64('rotr', "0x1234567812345678", 60, "0x2345678123456781"); + + testBinary64('rotr', "0x0000000000001000", 127, "0x0000000000002000"); + + // Comparisons. testComparison64('eq', 40, 40, 1); testComparison64('ne', 40, 40, 0); testComparison64('lt_s', 40, 40, 0); diff --git a/js/src/jit-test/tests/wasm/regress/null-metadata-filename.js b/js/src/jit-test/tests/wasm/regress/null-metadata-filename.js new file mode 100644 index 000000000000..8789182c2510 --- /dev/null +++ b/js/src/jit-test/tests/wasm/regress/null-metadata-filename.js @@ -0,0 +1,9 @@ +if (typeof enableSPSProfiling === 'undefined' || !isAsmJSCompilationAvailable()) + quit(); + +enableSPSProfiling(); +var code = evaluate("(function() { 'use asm'; function g() { return 43 } return g })", { + fileName: null +}); + +assertEq(code()(), 43); diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp index e20a844a3056..d7f9b6e5bb82 100644 --- a/js/src/jit/IonBuilder.cpp +++ b/js/src/jit/IonBuilder.cpp @@ -4729,6 +4729,9 @@ IonBuilder::getSingletonPrototype(JSFunction* target) MDefinition* IonBuilder::createThisScriptedSingleton(JSFunction* target, MDefinition* callee) { + if (!target->hasScript()) + return nullptr; + // Get the singleton prototype (if exists) JSObject* proto = getSingletonPrototype(target); if (!proto) diff --git a/js/src/jit/x86/MacroAssembler-x86-inl.h b/js/src/jit/x86/MacroAssembler-x86-inl.h index 546873f01001..91db82c6e297 100644 --- a/js/src/jit/x86/MacroAssembler-x86-inl.h +++ b/js/src/jit/x86/MacroAssembler-x86-inl.h @@ -539,7 +539,7 @@ MacroAssembler::rotateLeft64(Imm32 count, Register64 src, Register64 dest, Regis MOZ_ASSERT(src == dest, "defineReuseInput"); int32_t amount = count.value & 0x3f; - if (amount % 0x1f != 0) { + if ((amount & 0x1f) != 0) { movl(dest.high, temp); shldl(Imm32(amount & 0x1f), dest.low, dest.high); shldl(Imm32(amount & 0x1f), temp, dest.low); diff --git a/js/src/jsapi-tests/testGCExactRooting.cpp b/js/src/jsapi-tests/testGCExactRooting.cpp index 912e049d514f..afa7aa5c24be 100644 --- a/js/src/jsapi-tests/testGCExactRooting.cpp +++ b/js/src/jsapi-tests/testGCExactRooting.cpp @@ -57,19 +57,10 @@ struct MyContainer }; namespace js { -template <> -struct RootedBase { - HeapPtr& obj() { return static_cast*>(this)->get().obj; } - HeapPtr& str() { return static_cast*>(this)->get().str; } -}; -template <> -struct PersistentRootedBase { - HeapPtr& obj() { - return static_cast*>(this)->get().obj; - } - HeapPtr& str() { - return static_cast*>(this)->get().str; - } +template +struct MutableWrappedPtrOperations { + HeapPtr& obj() { return static_cast(this)->get().obj; } + HeapPtr& str() { return static_cast(this)->get().str; } }; } // namespace js diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 2a82566f189b..7f4e18a42cf0 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -2569,10 +2569,14 @@ struct JS_PUBLIC_API(PropertyDescriptor) { void trace(JSTracer* trc); }; -template -class PropertyDescriptorOperations +} // namespace JS + +namespace js { + +template +class WrappedPtrOperations { - const PropertyDescriptor& desc() const { return static_cast(this)->get(); } + const JS::PropertyDescriptor& desc() const { return static_cast(this)->get(); } bool has(unsigned bit) const { MOZ_ASSERT(bit != 0); @@ -2701,10 +2705,11 @@ class PropertyDescriptorOperations } }; -template -class MutablePropertyDescriptorOperations : public PropertyDescriptorOperations +template +class MutableWrappedPtrOperations + : public js::WrappedPtrOperations { - PropertyDescriptor& desc() { return static_cast(this)->get(); } + JS::PropertyDescriptor& desc() { return static_cast(this)->get(); } public: void clear() { @@ -2715,7 +2720,7 @@ class MutablePropertyDescriptorOperations : public PropertyDescriptorOperations< value().setUndefined(); } - void initFields(HandleObject obj, HandleValue v, unsigned attrs, + void initFields(JS::HandleObject obj, JS::HandleValue v, unsigned attrs, JSGetterOp getterOp, JSSetterOp setterOp) { MOZ_ASSERT(getterOp != JS_PropertyStub); MOZ_ASSERT(setterOp != JS_StrictPropertyStub); @@ -2727,7 +2732,7 @@ class MutablePropertyDescriptorOperations : public PropertyDescriptorOperations< setSetter(setterOp); } - void assign(PropertyDescriptor& other) { + void assign(JS::PropertyDescriptor& other) { object().set(other.obj); setAttributes(other.attrs); setGetter(other.getter); @@ -2735,7 +2740,7 @@ class MutablePropertyDescriptorOperations : public PropertyDescriptorOperations< value().set(other.value); } - void setDataDescriptor(HandleValue v, unsigned attrs) { + void setDataDescriptor(JS::HandleValue v, unsigned attrs) { MOZ_ASSERT((attrs & ~(JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY | @@ -2810,26 +2815,7 @@ class MutablePropertyDescriptorOperations : public PropertyDescriptorOperations< } }; -} /* namespace JS */ - -namespace js { - -template <> -class RootedBase - : public JS::MutablePropertyDescriptorOperations> -{}; - -template <> -class HandleBase - : public JS::PropertyDescriptorOperations> -{}; - -template <> -class MutableHandleBase - : public JS::MutablePropertyDescriptorOperations> -{}; - -} /* namespace js */ +} // namespace js namespace JS { diff --git a/js/src/jscompartment.cpp b/js/src/jscompartment.cpp index e8d42c67fc1a..65e9183316a7 100644 --- a/js/src/jscompartment.cpp +++ b/js/src/jscompartment.cpp @@ -571,7 +571,10 @@ JSCompartment::getNonSyntacticLexicalEnvironment(JSObject* enclosing) const bool JSCompartment::addToVarNames(JSContext* cx, JS::Handle name) { - if (varNames_.put(name.get())) + MOZ_ASSERT(name); + MOZ_ASSERT(!isAtomsCompartment()); + + if (varNames_.put(name)) return true; ReportOutOfMemory(cx); @@ -720,8 +723,9 @@ JSCompartment::sweepAfterMinorGC(JSTracer* trc) { globalWriteBarriered = 0; - if (innerViews.needsSweepAfterMinorGC()) - innerViews.sweepAfterMinorGC(); + InnerViewTable& table = innerViews.get(); + if (table.needsSweepAfterMinorGC()) + table.sweepAfterMinorGC(); crossCompartmentWrappers.sweepAfterMinorGC(trc); } @@ -803,6 +807,12 @@ JSCompartment::sweepCrossCompartmentWrappers() crossCompartmentWrappers.sweep(); } +void +JSCompartment::sweepVarNames() +{ + varNames_.sweep(); +} + namespace { struct TraceRootFunctor { JSTracer* trc; diff --git a/js/src/jscompartment.h b/js/src/jscompartment.h index f8fa1afd5d0c..622d3abc7dbf 100644 --- a/js/src/jscompartment.h +++ b/js/src/jscompartment.h @@ -654,6 +654,7 @@ struct JSCompartment void sweepDebugEnvironments(); void sweepNativeIterators(); void sweepTemplateObjects(); + void sweepVarNames(); void purge(); void clearTables(); diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index f7abe56fcd17..6b3f108098c8 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -4870,6 +4870,8 @@ MAKE_GC_SWEEP_TASK(SweepMiscTask); SweepAtomsTask::run() { runtime->sweepAtoms(); + for (CompartmentsIter comp(runtime, SkipAtoms); !comp.done(); comp.next()) + comp->sweepVarNames(); } /* virtual */ void diff --git a/js/src/jsobj.h b/js/src/jsobj.h index 5a559a02fa8e..b354c6aaae4a 100644 --- a/js/src/jsobj.h +++ b/js/src/jsobj.h @@ -592,21 +592,23 @@ class JSObject : public js::gc::Cell void operator=(const JSObject& other) = delete; }; -template +template +template MOZ_ALWAYS_INLINE JS::Handle -js::RootedBase::as() const +js::RootedBase::as() const { - const JS::Rooted& self = *static_cast*>(this); - MOZ_ASSERT(self->is()); + const Wrapper& self = *static_cast(this); + MOZ_ASSERT(self->template is()); return Handle::fromMarkedLocation(reinterpret_cast(self.address())); } +template template MOZ_ALWAYS_INLINE JS::Handle -js::HandleBase::as() const +js::HandleBase::as() const { const JS::Handle& self = *static_cast*>(this); - MOZ_ASSERT(self->is()); + MOZ_ASSERT(self->template is()); return Handle::fromMarkedLocation(reinterpret_cast(self.address())); } diff --git a/js/src/vm/ArrayBufferObject.cpp b/js/src/vm/ArrayBufferObject.cpp index a2131646a3b8..0af076a78bfb 100644 --- a/js/src/vm/ArrayBufferObject.cpp +++ b/js/src/vm/ArrayBufferObject.cpp @@ -350,7 +350,7 @@ ArrayBufferObject::detach(JSContext* cx, Handle buffer, // Update all views of the buffer to account for the buffer having been // detached, and clear the buffer's data and list of views. - auto& innerViews = cx->compartment()->innerViews; + auto& innerViews = cx->compartment()->innerViews.get(); if (InnerViewTable::ViewVector* views = innerViews.maybeViewsUnbarriered(buffer)) { for (size_t i = 0; i < views->length(); i++) NoteViewBufferWasDetached((*views)[i], newContents, cx); @@ -425,7 +425,7 @@ ArrayBufferObject::changeContents(JSContext* cx, BufferContents newContents, setNewData(cx->runtime()->defaultFreeOp(), newContents, ownsState); // Update all views. - auto& innerViews = cx->compartment()->innerViews; + auto& innerViews = cx->compartment()->innerViews.get(); if (InnerViewTable::ViewVector* views = innerViews.maybeViewsUnbarriered(this)) { for (size_t i = 0; i < views->length(); i++) changeViewContents(cx, (*views)[i], oldDataPointer, newContents); diff --git a/js/src/vm/ArrayBufferObject.h b/js/src/vm/ArrayBufferObject.h index 52d4fab17257..1c7731bb50e0 100644 --- a/js/src/vm/ArrayBufferObject.h +++ b/js/src/vm/ArrayBufferObject.h @@ -555,7 +555,6 @@ class InnerViewTable typedef Vector ViewVector; friend class ArrayBufferObject; - friend class WeakCacheBase; private: struct MapGCPolicy { @@ -616,23 +615,15 @@ class InnerViewTable size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf); }; -template <> -class WeakCacheBase +template +class MutableWrappedPtrOperations + : public WrappedPtrOperations { InnerViewTable& table() { - return static_cast*>(this)->get(); - } - const InnerViewTable& table() const { - return static_cast*>(this)->get(); + return static_cast(this)->get(); } public: - InnerViewTable::ViewVector* maybeViewsUnbarriered(ArrayBufferObject* obj) { - return table().maybeViewsUnbarriered(obj); - } - void removeViews(ArrayBufferObject* obj) { table().removeViews(obj); } - void sweepAfterMinorGC() { table().sweepAfterMinorGC(); } - bool needsSweepAfterMinorGC() const { return table().needsSweepAfterMinorGC(); } size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) { return table().sizeOfExcludingThis(mallocSizeOf); } diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp index e0b0166649a6..dc3af33b7c51 100644 --- a/js/src/vm/Interpreter.cpp +++ b/js/src/vm/Interpreter.cpp @@ -1538,11 +1538,7 @@ GetSuperEnvFunction(JSContext* cx, InterpreterRegs& regs) */ template -class ReservedRootedBase { -}; - -template -class ReservedRooted : public ReservedRootedBase +class ReservedRooted : public RootedBase> { Rooted* savedRoot; @@ -1570,14 +1566,6 @@ class ReservedRooted : public ReservedRootedBase DECLARE_POINTER_ASSIGN_OPS(ReservedRooted, T) }; -template <> -class ReservedRootedBase : public ValueOperations> -{}; - -template <> -class ReservedRootedBase : public ScopeCastOperation> -{}; - static MOZ_NEVER_INLINE bool Interpret(JSContext* cx, RunState& state) { diff --git a/js/src/vm/JSONParser.h b/js/src/vm/JSONParser.h index 797aaca5f1b9..b964c3db30d2 100644 --- a/js/src/vm/JSONParser.h +++ b/js/src/vm/JSONParser.h @@ -256,10 +256,13 @@ class MOZ_STACK_CLASS JSONParser : public JSONParserBase void operator=(const JSONParser& other) = delete; }; -template -struct RootedBase> { +template +class MutableWrappedPtrOperations, Wrapper> + : public WrappedPtrOperations, Wrapper> +{ + public: bool parse(MutableHandleValue vp) { - return static_cast>*>(this)->get().parse(vp); + return static_cast(this)->get().parse(vp); } }; diff --git a/js/src/vm/SavedStacks.h b/js/src/vm/SavedStacks.h index 57b56081bfb4..4298d9301698 100644 --- a/js/src/vm/SavedStacks.h +++ b/js/src/vm/SavedStacks.h @@ -266,24 +266,6 @@ class SavedStacks { uint32_t column; }; - template - struct LocationValueOperations { - JSAtom* source() const { return loc().source; } - size_t line() const { return loc().line; } - uint32_t column() const { return loc().column; } - private: - const LocationValue& loc() const { return static_cast(this)->get(); } - }; - - template - struct MutableLocationValueOperations : public LocationValueOperations { - void setSource(JSAtom* v) { loc().source = v; } - void setLine(size_t v) { loc().line = v; } - void setColumn(uint32_t v) { loc().column = v; } - private: - LocationValue& loc() { return static_cast(this)->get(); } - }; - private: struct PCLocationHasher : public DefaultHasher { using ScriptPtrHasher = DefaultHasher; @@ -314,15 +296,32 @@ class SavedStacks { MutableHandle locationp); }; -template <> -class RootedBase - : public SavedStacks::MutableLocationValueOperations> -{}; +template +struct WrappedPtrOperations +{ + JSAtom* source() const { return loc().source; } + size_t line() const { return loc().line; } + uint32_t column() const { return loc().column; } -template <> -class MutableHandleBase - : public SavedStacks::MutableLocationValueOperations> -{}; + private: + const SavedStacks::LocationValue& loc() const { + return static_cast(this)->get(); + } +}; + +template +struct MutableWrappedPtrOperations + : public WrappedPtrOperations +{ + void setSource(JSAtom* v) { loc().source = v; } + void setLine(size_t v) { loc().line = v; } + void setColumn(uint32_t v) { loc().column = v; } + + private: + SavedStacks::LocationValue& loc() { + return static_cast(this)->get(); + } +}; UTF8CharsZ BuildUTF8StackString(JSContext* cx, HandleObject stack); diff --git a/js/src/vm/Scope.h b/js/src/vm/Scope.h index 4945b3597572..847f507c88f8 100644 --- a/js/src/vm/Scope.h +++ b/js/src/vm/Scope.h @@ -22,6 +22,7 @@ namespace js { class ModuleObject; +class Scope; enum class BindingKind : uint8_t { @@ -185,6 +186,21 @@ class BindingLocation } }; +// +// Allow using is and as on Rooted and Handle. +// +template +class WrappedPtrOperations +{ + public: + template + JS::Handle as() const { + const Wrapper& self = *static_cast(this); + MOZ_ASSERT_IF(self, self->template is()); + return Handle::fromMarkedLocation(reinterpret_cast(self.address())); + } +}; + // // The base class of all Scopes. // @@ -1328,10 +1344,10 @@ class MOZ_STACK_CLASS ScopeIter // Specializations of Rooted containers for the iterators. // -template -class BindingIterOperations +template +class WrappedPtrOperations { - const BindingIter& iter() const { return static_cast(this)->get(); } + const BindingIter& iter() const { return static_cast(this)->get(); } public: bool done() const { return iter().done(); } @@ -1351,19 +1367,20 @@ class BindingIterOperations uint32_t nextEnvironmentSlot() const { return iter().nextEnvironmentSlot(); } }; -template -class MutableBindingIterOperations : public BindingIterOperations +template +class MutableWrappedPtrOperations + : public WrappedPtrOperations { - BindingIter& iter() { return static_cast(this)->get(); } + BindingIter& iter() { return static_cast(this)->get(); } public: void operator++(int) { iter().operator++(1); } }; -template -class ScopeIterOperations +template +class WrappedPtrOperations { - const ScopeIter& iter() const { return static_cast(this)->get(); } + const ScopeIter& iter() const { return static_cast(this)->get(); } public: bool done() const { return iter().done(); } @@ -1374,69 +1391,16 @@ class ScopeIterOperations bool hasSyntacticEnvironment() const { return iter().hasSyntacticEnvironment(); } }; -template -class MutableScopeIterOperations : public ScopeIterOperations +template +class MutableWrappedPtrOperations + : public WrappedPtrOperations { - ScopeIter& iter() { return static_cast(this)->get(); } + ScopeIter& iter() { return static_cast(this)->get(); } public: void operator++(int) { iter().operator++(1); } }; -#define SPECIALIZE_ROOTING_CONTAINERS(Iter, BaseIter) \ - template <> \ - class RootedBase \ - : public Mutable##BaseIter##Operations> \ - { }; \ - \ - template <> \ - class MutableHandleBase \ - : public Mutable##BaseIter##Operations> \ - { }; \ - \ - template <> \ - class HandleBase \ - : public BaseIter##Operations> \ - { }; \ - \ - template <> \ - class PersistentRootedBase \ - : public Mutable##BaseIter##Operations> \ - { } - -SPECIALIZE_ROOTING_CONTAINERS(BindingIter, BindingIter); -SPECIALIZE_ROOTING_CONTAINERS(PositionalFormalParameterIter, BindingIter); -SPECIALIZE_ROOTING_CONTAINERS(ScopeIter, ScopeIter); - -#undef SPECIALIZE_ROOTING_CONTAINERS - -// -// Allow using is and as on Rooted and Handle. -// - -template -struct ScopeCastOperation -{ - template - JS::Handle as() const { - const Outer& self = *static_cast(this); - MOZ_ASSERT_IF(self, self->template is()); - return Handle::fromMarkedLocation(reinterpret_cast(self.address())); - } -}; - -template <> -class RootedBase : public ScopeCastOperation> -{ }; - -template <> -class HandleBase : public ScopeCastOperation> -{ }; - -template <> -class MutableHandleBase : public ScopeCastOperation> -{ }; - } // namespace js namespace JS { diff --git a/js/src/vm/Shape.h b/js/src/vm/Shape.h index 9f67a3018da5..5ad2b86dbe44 100644 --- a/js/src/vm/Shape.h +++ b/js/src/vm/Shape.h @@ -1242,9 +1242,10 @@ struct InitialShapeEntry bool needsSweep() { Shape* ushape = shape.unbarrieredGet(); - JSObject* protoObj = proto.proto().raw(); + TaggedProto uproto = proto.proto().unbarrieredGet(); + JSObject* protoObj = uproto.raw(); return (gc::IsAboutToBeFinalizedUnbarriered(&ushape) || - (proto.proto().isObject() && gc::IsAboutToBeFinalizedUnbarriered(&protoObj))); + (uproto.isObject() && gc::IsAboutToBeFinalizedUnbarriered(&protoObj))); } }; @@ -1334,9 +1335,10 @@ struct StackShape void trace(JSTracer* trc); }; -template -class StackShapeOperations { - const StackShape& ss() const { return static_cast(this)->get(); } +template +class WrappedPtrOperations +{ + const StackShape& ss() const { return static_cast(this)->get(); } public: bool hasSlot() const { return ss().hasSlot(); } @@ -1348,9 +1350,11 @@ class StackShapeOperations { uint8_t attrs() const { return ss().attrs; } }; -template -class MutableStackShapeOperations : public StackShapeOperations { - StackShape& ss() { return static_cast(this)->get(); } +template +class MutableWrappedPtrOperations + : public WrappedPtrOperations +{ + StackShape& ss() { return static_cast(this)->get(); } public: void updateGetterSetter(GetterOp rawGetter, SetterOp rawSetter) { @@ -1361,19 +1365,6 @@ class MutableStackShapeOperations : public StackShapeOperations { void setAttrs(uint8_t attrs) { ss().attrs = attrs; } }; -template <> -class RootedBase : public MutableStackShapeOperations> -{}; - -template <> -class HandleBase : public StackShapeOperations> -{}; - -template <> -class MutableHandleBase - : public MutableStackShapeOperations> -{}; - inline Shape::Shape(const StackShape& other, uint32_t nfixed) : base_(other.base), diff --git a/js/src/vm/TaggedProto.h b/js/src/vm/TaggedProto.h index 51dcbc3830e8..48c74a26620c 100644 --- a/js/src/vm/TaggedProto.h +++ b/js/src/vm/TaggedProto.h @@ -78,11 +78,11 @@ struct InternalBarrierMethods } }; -template -class TaggedProtoOperations +template +class WrappedPtrOperations { const TaggedProto& value() const { - return static_cast(this)->get(); + return static_cast(this)->get(); } public: @@ -96,18 +96,6 @@ class TaggedProtoOperations uint64_t uniqueId() const { return value().uniqueId(); } }; -template <> -class HandleBase : public TaggedProtoOperations> -{}; - -template <> -class RootedBase : public TaggedProtoOperations> -{}; - -template <> -class BarrieredBaseMixins : public TaggedProtoOperations> -{}; - // If the TaggedProto is a JSObject pointer, convert to that type and call |f| // with the pointer. If the TaggedProto is lazy, calls F::defaultValue. template diff --git a/js/src/wasm/WasmCode.cpp b/js/src/wasm/WasmCode.cpp index cdba2782af4c..131109d86a5b 100644 --- a/js/src/wasm/WasmCode.cpp +++ b/js/src/wasm/WasmCode.cpp @@ -778,10 +778,18 @@ Code::ensureProfilingState(JSRuntime* rt, bool newProfilingEnabled) MOZ_ASSERT(bytecodeStr); UTF8Bytes name; - if (!getFuncName(codeRange.funcIndex(), &name) || - !name.append(" (", 2) || - !name.append(metadata_->filename.get(), strlen(metadata_->filename.get())) || - !name.append(':') || + if (!getFuncName(codeRange.funcIndex(), &name) || !name.append(" (", 2)) + return false; + + if (const char* filename = metadata_->filename.get()) { + if (!name.append(filename, strlen(filename))) + return false; + } else { + if (!name.append('?')) + return false; + } + + if (!name.append(':') || !name.append(bytecodeStr, strlen(bytecodeStr)) || !name.append(")\0", 2)) { diff --git a/layout/generic/nsTextFrameUtils.cpp b/layout/generic/nsTextFrameUtils.cpp index e814383c624c..8562839cc8b6 100644 --- a/layout/generic/nsTextFrameUtils.cpp +++ b/layout/generic/nsTextFrameUtils.cpp @@ -15,8 +15,7 @@ using namespace mozilla; -static bool -IsDiscardable(char16_t ch, uint32_t* aFlags) +static bool IsDiscardable(char16_t ch, uint32_t* aFlags) { // Unlike IS_DISCARDABLE, we don't discard \r. \r will be ignored by gfxTextRun // and discarding it would force us to copy text in many cases of preformatted @@ -28,8 +27,7 @@ IsDiscardable(char16_t ch, uint32_t* aFlags) return IsBidiControl(ch); } -static bool -IsDiscardable(uint8_t ch, uint32_t* aFlags) +static bool IsDiscardable(uint8_t ch, uint32_t* aFlags) { if (ch == CH_SHY) { *aFlags |= nsTextFrameUtils::TEXT_HAS_SHY; @@ -38,159 +36,25 @@ IsDiscardable(uint8_t ch, uint32_t* aFlags) return false; } -static bool -IsSegmentBreak(char16_t aCh) -{ - return aCh == '\n' || aCh == '\r'; -} - -static bool -IsSpaceOrTab(char16_t aCh) -{ - return aCh == ' ' || aCh == '\t'; -} - -static bool -IsSpaceOrTabOrSegmentBreak(char16_t aCh) -{ - return IsSpaceOrTab(aCh) || IsSegmentBreak(aCh); -} - -template -static CharT* -TransformWhiteSpaces(const CharT* aText, uint32_t aLength, - uint32_t aBegin, uint32_t aEnd, - bool aHasSegmentBreak, - bool& aInWhitespace, - CharT* aOutput, - uint32_t& aFlags, - nsTextFrameUtils::CompressionMode aCompression, - gfxSkipChars* aSkipChars) -{ - MOZ_ASSERT(aCompression == nsTextFrameUtils::COMPRESS_WHITESPACE || - aCompression == nsTextFrameUtils::COMPRESS_WHITESPACE_NEWLINE, - "whitespaces should be skippable!!"); - // Get the context preceding/following this white space range. - // For 8-bit text (sizeof CharT == 1), the checks here should get optimized - // out, and isSegmentBreakSkippable should be initialized to be 'false'. - bool isSegmentBreakSkippable = - sizeof(CharT) > 1 && - ((aBegin > 0 && IS_ZERO_WIDTH_SPACE(aText[aBegin - 1])) || - (aEnd < aLength && IS_ZERO_WIDTH_SPACE(aText[aEnd]))); - if (sizeof(CharT) > 1 && !isSegmentBreakSkippable && - aBegin > 0 && aEnd < aLength) { - uint32_t ucs4before; - uint32_t ucs4after; - if (aBegin > 1 && - NS_IS_LOW_SURROGATE(aText[aBegin - 1]) && - NS_IS_HIGH_SURROGATE(aText[aBegin - 2])) { - ucs4before = SURROGATE_TO_UCS4(aText[aBegin - 2], aText[aBegin - 1]); - } else { - ucs4before = aText[aBegin - 1]; - } - if (aEnd + 1 < aLength && - NS_IS_HIGH_SURROGATE(aText[aEnd]) && - NS_IS_LOW_SURROGATE(aText[aEnd + 1])) { - ucs4after = SURROGATE_TO_UCS4(aText[aEnd], aText[aEnd + 1]); - } else { - ucs4after = aText[aEnd]; - } - // Discard newlines between characters that have F, W, or H - // EastAsianWidth property and neither side is Hangul. - isSegmentBreakSkippable = IsSegmentBreakSkipChar(ucs4before) && - IsSegmentBreakSkipChar(ucs4after); - } - - for (uint32_t i = aBegin; i < aEnd; ++i) { - CharT ch = aText[i]; - bool keepChar = false; - bool keepTransformedWhiteSpace = false; - if (IsDiscardable(ch, &aFlags)) { - aSkipChars->SkipChar(); - continue; - } - if (IsSpaceOrTab(ch)) { - if (aHasSegmentBreak) { - // If white-space is set to normal, nowrap, or pre-line, white space - // characters are considered collapsible and all spaces and tabs - // immediately preceding or following a segment break are removed. - aSkipChars->SkipChar(); - continue; - } - - if (aInWhitespace) { - aSkipChars->SkipChar(); - continue; - } else { - keepTransformedWhiteSpace = true; - } - } else { - // Apply Segment Break Transformation Rules (CSS Text 3 - 4.1.2) for - // segment break characters. - if (aCompression == nsTextFrameUtils::COMPRESS_WHITESPACE || - // XXX: According to CSS Text 3, a lone CR should not always be - // kept, but still go through the Segment Break Transformation - // Rules. However, this is what current modern browser engines - // (webkit/blink/edge) do. So, once we can get some clarity - // from the specification issue, we should either remove the - // lone CR condition here, or leave it here with this comment - // being rephrased. - // Please see https://github.com/w3c/csswg-drafts/issues/855. - ch == '\r') { - keepChar = true; - } else { - // aCompression == COMPRESS_WHITESPACE_NEWLINE - - // Any collapsible segment break immediately following another - // collapsible segment break is removed. Then the remaining segment - // break is either transformed into a space (U+0020) or removed - // depending on the context before and after the break. - if (isSegmentBreakSkippable || aInWhitespace) { - aSkipChars->SkipChar(); - continue; - } - isSegmentBreakSkippable = true; - keepTransformedWhiteSpace = true; - } - } - - if (keepChar) { - *aOutput++ = ch; - aSkipChars->KeepChar(); - aInWhitespace = IsSpaceOrTab(ch); - } else if (keepTransformedWhiteSpace) { - if (ch != ' ') { - aFlags |= nsTextFrameUtils::TEXT_WAS_TRANSFORMED; - } - *aOutput++ = ' '; - aSkipChars->KeepChar(); - aInWhitespace = true; - } else { - MOZ_ASSERT_UNREACHABLE("Should've skipped the character!!"); - } - } - return aOutput; -} - -template -CharT* -nsTextFrameUtils::TransformText(const CharT* aText, uint32_t aLength, - CharT* aOutput, +char16_t* +nsTextFrameUtils::TransformText(const char16_t* aText, uint32_t aLength, + char16_t* aOutput, CompressionMode aCompression, uint8_t* aIncomingFlags, gfxSkipChars* aSkipChars, uint32_t* aAnalysisFlags) { uint32_t flags = 0; - CharT* outputStart = aOutput; + char16_t* outputStart = aOutput; bool lastCharArabic = false; + if (aCompression == COMPRESS_NONE || aCompression == COMPRESS_NONE_TRANSFORM_TO_SPACE) { // Skip discardables. uint32_t i; for (i = 0; i < aLength; ++i) { - CharT ch = aText[i]; + char16_t ch = aText[i]; if (IsDiscardable(ch, &flags)) { aSkipChars->SkipChar(); } else { @@ -221,72 +85,68 @@ nsTextFrameUtils::TransformText(const CharT* aText, uint32_t aLength, bool inWhitespace = (*aIncomingFlags & INCOMING_WHITESPACE) != 0; uint32_t i; for (i = 0; i < aLength; ++i) { - CharT ch = aText[i]; - // CSS Text 3 - 4.1. The White Space Processing Rules - // White space processing in CSS affects only the document white space - // characters: spaces (U+0020), tabs (U+0009), and segment breaks. - // Since we need the context of segment breaks and their surrounding - // white spaces to proceed the white space processing, a consecutive run - // of spaces/tabs/segment breaks is collected in a first pass loop, then - // we apply the collapsing and transformation rules to this run in a - // second pass loop. - if (IsSpaceOrTabOrSegmentBreak(ch)) { - bool keepLastSpace = false; - bool hasSegmentBreak = IsSegmentBreak(ch); - uint32_t countTrailingDiscardables = 0; - uint32_t j; - for (j = i + 1; j < aLength && - (IsSpaceOrTabOrSegmentBreak(aText[j]) || - IsDiscardable(aText[j], &flags)); - j++) { - if (IsSegmentBreak(aText[j])) { - hasSegmentBreak = true; + char16_t ch = aText[i]; + bool nowInWhitespace; + if (ch == ' ' && + (i + 1 >= aLength || + !IsSpaceCombiningSequenceTail(&aText[i + 1], aLength - (i + 1)))) { + nowInWhitespace = true; + } else if (ch == '\n' && aCompression == COMPRESS_WHITESPACE_NEWLINE) { + if ((i > 0 && IS_ZERO_WIDTH_SPACE(aText[i - 1])) || + (i + 1 < aLength && IS_ZERO_WIDTH_SPACE(aText[i + 1]))) { + aSkipChars->SkipChar(); + continue; + } + uint32_t ucs4before; + uint32_t ucs4after; + if (i > 1 && + NS_IS_LOW_SURROGATE(aText[i - 1]) && + NS_IS_HIGH_SURROGATE(aText[i - 2])) { + ucs4before = SURROGATE_TO_UCS4(aText[i - 2], aText[i - 1]); + } else if (i > 0) { + ucs4before = aText[i - 1]; + } + if (i + 2 < aLength && + NS_IS_HIGH_SURROGATE(aText[i + 1]) && + NS_IS_LOW_SURROGATE(aText[i + 2])) { + ucs4after = SURROGATE_TO_UCS4(aText[i + 1], aText[i + 2]); + } else if (i + 1 < aLength) { + ucs4after = aText[i + 1]; + } + if (i > 0 && IsSegmentBreakSkipChar(ucs4before) && + i + 1 < aLength && IsSegmentBreakSkipChar(ucs4after)) { + // Discard newlines between characters that have F, W, or H + // EastAsianWidth property and neither side is Hangul. + aSkipChars->SkipChar(); + continue; + } + nowInWhitespace = true; + } else { + nowInWhitespace = ch == '\t'; + } + + if (!nowInWhitespace) { + if (IsDiscardable(ch, &flags)) { + aSkipChars->SkipChar(); + nowInWhitespace = inWhitespace; + } else { + *aOutput++ = ch; + aSkipChars->KeepChar(); + lastCharArabic = IS_ARABIC_CHAR(ch); + } + } else { + if (inWhitespace) { + aSkipChars->SkipChar(); + } else { + if (ch != ' ') { + flags |= TEXT_WAS_TRANSFORMED; } - } - // Exclude trailing discardables before checking space combining - // sequence tail. - for (; IsDiscardable(aText[j - 1], &flags); j--) { - countTrailingDiscardables++; - } - // If the last white space is followed by a combining sequence tail, - // exclude it from the range of TransformWhiteSpaces. - if (sizeof(CharT) > 1 && aText[j - 1] == ' ' && j < aLength && - IsSpaceCombiningSequenceTail(&aText[j], aLength - j)) { - keepLastSpace = true; - j--; - } - if (j > i) { - aOutput = TransformWhiteSpaces(aText, aLength, i, j, hasSegmentBreak, - inWhitespace, aOutput, flags, - aCompression, aSkipChars); - } - // We need to keep KeepChar()/SkipChar() in order, so process the - // last white space first, then process the trailing discardables. - if (keepLastSpace) { - keepLastSpace = false; *aOutput++ = ' '; aSkipChars->KeepChar(); - lastCharArabic = false; - j++; } - for (; countTrailingDiscardables > 0; countTrailingDiscardables--) { - aSkipChars->SkipChar(); - j++; - } - i = j - 1; - continue; } - // Process characters other than the document white space characters. - if (IsDiscardable(ch, &flags)) { - aSkipChars->SkipChar(); - } else { - *aOutput++ = ch; - aSkipChars->KeepChar(); - } - lastCharArabic = IS_ARABIC_CHAR(ch); - inWhitespace = false; + inWhitespace = nowInWhitespace; } - if (lastCharArabic) { *aIncomingFlags |= INCOMING_ARABICCHAR; } else { @@ -305,28 +165,85 @@ nsTextFrameUtils::TransformText(const CharT* aText, uint32_t aLength, *aAnalysisFlags = flags; return aOutput; } -/* - * NOTE: This template is part of public API of nsTextFrameUtils, while - * its function body is not available in the header. It may stop working - * (fail to resolve symbol in link time) once its callsites are moved to a - * different translation unit (e.g. a different unified source file). - * Explicit instantiating this function template with `uint8_t` and `char16_t` - * could prevent us from the potential risk. - */ -template uint8_t* + +uint8_t* nsTextFrameUtils::TransformText(const uint8_t* aText, uint32_t aLength, uint8_t* aOutput, CompressionMode aCompression, uint8_t* aIncomingFlags, gfxSkipChars* aSkipChars, - uint32_t* aAnalysisFlags); -template char16_t* -nsTextFrameUtils::TransformText(const char16_t* aText, uint32_t aLength, - char16_t* aOutput, - CompressionMode aCompression, - uint8_t* aIncomingFlags, - gfxSkipChars* aSkipChars, - uint32_t* aAnalysisFlags); + uint32_t* aAnalysisFlags) +{ + uint32_t flags = 0; + uint8_t* outputStart = aOutput; + + if (aCompression == COMPRESS_NONE || + aCompression == COMPRESS_NONE_TRANSFORM_TO_SPACE) { + // Skip discardables. + uint32_t i; + for (i = 0; i < aLength; ++i) { + uint8_t ch = aText[i]; + if (IsDiscardable(ch, &flags)) { + aSkipChars->SkipChar(); + } else { + aSkipChars->KeepChar(); + if (aCompression == COMPRESS_NONE_TRANSFORM_TO_SPACE) { + if (ch == '\t' || ch == '\n') { + ch = ' '; + flags |= TEXT_WAS_TRANSFORMED; + } + } else { + // aCompression == COMPRESS_NONE + if (ch == '\t') { + flags |= TEXT_HAS_TAB; + } + } + *aOutput++ = ch; + } + } + *aIncomingFlags &= ~(INCOMING_ARABICCHAR | INCOMING_WHITESPACE); + } else { + bool inWhitespace = (*aIncomingFlags & INCOMING_WHITESPACE) != 0; + uint32_t i; + for (i = 0; i < aLength; ++i) { + uint8_t ch = aText[i]; + bool nowInWhitespace = ch == ' ' || ch == '\t' || + (ch == '\n' && aCompression == COMPRESS_WHITESPACE_NEWLINE); + if (!nowInWhitespace) { + if (IsDiscardable(ch, &flags)) { + aSkipChars->SkipChar(); + nowInWhitespace = inWhitespace; + } else { + *aOutput++ = ch; + aSkipChars->KeepChar(); + } + } else { + if (inWhitespace) { + aSkipChars->SkipChar(); + } else { + if (ch != ' ') { + flags |= TEXT_WAS_TRANSFORMED; + } + *aOutput++ = ' '; + aSkipChars->KeepChar(); + } + } + inWhitespace = nowInWhitespace; + } + *aIncomingFlags &= ~INCOMING_ARABICCHAR; + if (inWhitespace) { + *aIncomingFlags |= INCOMING_WHITESPACE; + } else { + *aIncomingFlags &= ~INCOMING_WHITESPACE; + } + } + + if (outputStart + aLength != aOutput) { + flags |= TEXT_WAS_TRANSFORMED; + } + *aAnalysisFlags = flags; + return aOutput; +} uint32_t nsTextFrameUtils::ComputeApproximateLengthWithWhitespaceCompression( diff --git a/layout/generic/nsTextFrameUtils.h b/layout/generic/nsTextFrameUtils.h index 22c232f17121..eecc0d93f22d 100644 --- a/layout/generic/nsTextFrameUtils.h +++ b/layout/generic/nsTextFrameUtils.h @@ -87,10 +87,6 @@ public: ) ); } - static bool - IsSpaceCombiningSequenceTail(const uint8_t* aChars, int32_t aLength) { - return false; - } enum CompressionMode { COMPRESS_NONE, @@ -104,7 +100,7 @@ public: * compressed. A preformatted tab is sent to the text run as a single space. * (Tab spacing must be performed by textframe later.) Certain other * characters are discarded. - * + * * @param aCompression control what is compressed to a * single space character: no compression, compress spaces (not followed * by combining mark) and tabs, compress those plus newlines, or @@ -113,13 +109,19 @@ public: * or an Arabic character preceding this text. We set it to indicate if * there's an Arabic character or whitespace preceding the end of this text. */ - template - static CharT* TransformText(const CharT* aText, uint32_t aLength, - CharT* aOutput, - CompressionMode aCompression, - uint8_t* aIncomingFlags, - gfxSkipChars* aSkipChars, - uint32_t* aAnalysisFlags); + static char16_t* TransformText(const char16_t* aText, uint32_t aLength, + char16_t* aOutput, + CompressionMode aCompression, + uint8_t* aIncomingFlags, + gfxSkipChars* aSkipChars, + uint32_t* aAnalysisFlags); + + static uint8_t* TransformText(const uint8_t* aText, uint32_t aLength, + uint8_t* aOutput, + CompressionMode aCompression, + uint8_t* aIncomingFlags, + gfxSkipChars* aSkipChars, + uint32_t* aAnalysisFlags); static void AppendLineBreakOffset(nsTArray* aArray, uint32_t aOffset) diff --git a/layout/painting/nsDisplayList.h b/layout/painting/nsDisplayList.h index 55e1f2739728..075a135d6648 100644 --- a/layout/painting/nsDisplayList.h +++ b/layout/painting/nsDisplayList.h @@ -4450,6 +4450,9 @@ public: virtual bool ShouldBuildLayerEvenIfInvisible(nsDisplayListBuilder* aBuilder) override { + if (!mList.GetChildren()->GetTop()) { + return false; + } return mList.GetChildren()->GetTop()->ShouldBuildLayerEvenIfInvisible(aBuilder); } @@ -4476,7 +4479,9 @@ public: virtual void DoUpdateBoundsPreserves3D(nsDisplayListBuilder* aBuilder) override { - static_cast(mList.GetChildren()->GetTop())->DoUpdateBoundsPreserves3D(aBuilder); + if (mList.GetChildren()->GetTop()) { + static_cast(mList.GetChildren()->GetTop())->DoUpdateBoundsPreserves3D(aBuilder); + } } private: diff --git a/layout/reftests/w3c-css/submitted/text3/reftest.list b/layout/reftests/w3c-css/submitted/text3/reftest.list index 8c532eaf7d34..2712e4363bba 100644 --- a/layout/reftests/w3c-css/submitted/text3/reftest.list +++ b/layout/reftests/w3c-css/submitted/text3/reftest.list @@ -6,62 +6,3 @@ == text-align-match-parent-root-rtl.html text-align-match-parent-root-rtl-ref.html == text-word-spacing-001.html text-word-spacing-ref.html - -== segment-break-transformation-removable-1.html segment-break-transformation-removable-ref.html -== segment-break-transformation-removable-2.html segment-break-transformation-removable-ref.html -== segment-break-transformation-removable-3.html segment-break-transformation-removable-ref.html -== segment-break-transformation-removable-4.html segment-break-transformation-removable-ref.html -== segment-break-transformation-unremovable-1.html segment-break-transformation-unremovable-ref.html -== segment-break-transformation-unremovable-2.html segment-break-transformation-unremovable-ref.html -== segment-break-transformation-unremovable-3.html segment-break-transformation-unremovable-ref.html -== segment-break-transformation-unremovable-4.html segment-break-transformation-unremovable-ref.html - -== segment-break-transformation-rules-001.html segment-break-transformation-rules-001-ref.html -== segment-break-transformation-rules-002.html segment-break-transformation-rules-002-ref.html -== segment-break-transformation-rules-003.html segment-break-transformation-rules-003-ref.html -== segment-break-transformation-rules-004.html segment-break-transformation-rules-004-ref.html -== segment-break-transformation-rules-005.html segment-break-transformation-rules-005-ref.html -== segment-break-transformation-rules-006.html segment-break-transformation-rules-006-ref.html -== segment-break-transformation-rules-007.html segment-break-transformation-rules-007-ref.html -== segment-break-transformation-rules-008.html segment-break-transformation-rules-008-ref.html -== segment-break-transformation-rules-009.html segment-break-transformation-rules-009-ref.html -== segment-break-transformation-rules-010.html segment-break-transformation-rules-010-ref.html -== segment-break-transformation-rules-011.html segment-break-transformation-rules-011-ref.html -== segment-break-transformation-rules-012.html segment-break-transformation-rules-012-ref.html -== segment-break-transformation-rules-013.html segment-break-transformation-rules-013-ref.html -== segment-break-transformation-rules-014.html segment-break-transformation-rules-014-ref.html -== segment-break-transformation-rules-015.html segment-break-transformation-rules-015-ref.html -== segment-break-transformation-rules-016.html segment-break-transformation-rules-016-ref.html -== segment-break-transformation-rules-017.html segment-break-transformation-rules-017-ref.html -== segment-break-transformation-rules-018.html segment-break-transformation-rules-018-ref.html -== segment-break-transformation-rules-019.html segment-break-transformation-rules-019-ref.html -== segment-break-transformation-rules-020.html segment-break-transformation-rules-020-ref.html -== segment-break-transformation-rules-021.html segment-break-transformation-rules-021-ref.html -== segment-break-transformation-rules-022.html segment-break-transformation-rules-022-ref.html -== segment-break-transformation-rules-023.html segment-break-transformation-rules-023-ref.html -== segment-break-transformation-rules-024.html segment-break-transformation-rules-024-ref.html -== segment-break-transformation-rules-025.html segment-break-transformation-rules-025-ref.html -== segment-break-transformation-rules-026.html segment-break-transformation-rules-026-ref.html -== segment-break-transformation-rules-027.html segment-break-transformation-rules-027-ref.html -== segment-break-transformation-rules-028.html segment-break-transformation-rules-028-ref.html -== segment-break-transformation-rules-029.html segment-break-transformation-rules-029-ref.html -== segment-break-transformation-rules-030.html segment-break-transformation-rules-030-ref.html -== segment-break-transformation-rules-031.html segment-break-transformation-rules-031-ref.html -== segment-break-transformation-rules-032.html segment-break-transformation-rules-032-ref.html -== segment-break-transformation-rules-033.html segment-break-transformation-rules-033-ref.html -== segment-break-transformation-rules-034.html segment-break-transformation-rules-034-ref.html -== segment-break-transformation-rules-035.html segment-break-transformation-rules-035-ref.html -== segment-break-transformation-rules-036.html segment-break-transformation-rules-036-ref.html -== segment-break-transformation-rules-037.html segment-break-transformation-rules-037-ref.html -== segment-break-transformation-rules-038.html segment-break-transformation-rules-038-ref.html -== segment-break-transformation-rules-039.html segment-break-transformation-rules-039-ref.html -== segment-break-transformation-rules-040.html segment-break-transformation-rules-040-ref.html -== segment-break-transformation-rules-041.html segment-break-transformation-rules-041-ref.html -== segment-break-transformation-rules-042.html segment-break-transformation-rules-042-ref.html -== segment-break-transformation-rules-043.html segment-break-transformation-rules-043-ref.html -== segment-break-transformation-rules-044.html segment-break-transformation-rules-044-ref.html -== segment-break-transformation-rules-045.html segment-break-transformation-rules-045-ref.html -== segment-break-transformation-rules-046.html segment-break-transformation-rules-046-ref.html -== segment-break-transformation-rules-047.html segment-break-transformation-rules-047-ref.html -== segment-break-transformation-rules-048.html segment-break-transformation-rules-048-ref.html -== segment-break-transformation-rules-049.html segment-break-transformation-rules-049-ref.html diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-removable-1.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-removable-1.html deleted file mode 100644 index 913529808647..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-removable-1.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -CSS Text 4.1.2. Segment Break Transformation Rules - - - - - - - - - -
Test passes if there is no white space between 2nd and 3rd CJK character. - -

一些 中文

- -

一些​ 中文

- -

一些 ​中文

- -

一些​ 언문

-
- - diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-removable-2.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-removable-2.html deleted file mode 100644 index 0ff5b0b0d403..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-removable-2.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -CSS Text 4.1.2. Segment Break Transformation Rules - - - - - - - - - -
Test passes if there is no white space between 2nd and 3rd CJK character. - -

一些 中文

- -

一些​ 中文

- -

一些 ​中文

- -

一些​ 언문

-
- - diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-removable-3.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-removable-3.html deleted file mode 100644 index 25f8aac430ac..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-removable-3.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - -CSS Text 4.1.2. Segment Break Transformation Rules - - - - - - - - - -
Test passes if there is no white space between 2nd and 3rd CJK character. - -

一些 中文

- -

一些​ 中文

- -

一些 ​中文

- -

一些​ 언문

-
- - diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-removable-4.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-removable-4.html deleted file mode 100644 index b6284c0b8cb2..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-removable-4.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - -CSS Text 4.1.2. Segment Break Transformation Rules - - - - - - - - - -
Test passes if there is no white space between 2nd and 3rd CJK character. - -

一些 中文

- -

一些​ 中文

- -

一些 ​中文

- -

一些​ 언문

-
- - diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-removable-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-removable-ref.html deleted file mode 100644 index 5964fa593df3..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-removable-ref.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - -CSS Text 4.1.2. Segment Break Transformation Rules - - - - - - -
Test passes if there is no white space between 2nd and 3rd CJK character. - -

一些中文

- -

一些中文

- -

一些中文

- -

一些언문

-
- - diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-001-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-001-ref.html deleted file mode 100644 index f66bccefcb75..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-001-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is NO white space between the two strings below. -

FULLWIDTHFULLWIDTH

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-001.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-001.html deleted file mode 100644 index 494f9f2dbfdb..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-001.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is NO white space between the two strings below. -

FULLWIDTH FULLWIDTH

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-002-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-002-ref.html deleted file mode 100644 index b01ea124e4a9..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-002-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is NO white space between the two strings below. -

FULLWIDTHテスト

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-002.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-002.html deleted file mode 100644 index 90db29adef33..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-002.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is NO white space between the two strings below. -

FULLWIDTH テスト

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-003-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-003-ref.html deleted file mode 100644 index c82aa1c18462..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-003-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is NO white space between the two strings below. -

FULLWIDTH測試

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-003.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-003.html deleted file mode 100644 index efc7b6024416..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-003.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is NO white space between the two strings below. -

FULLWIDTH 測試

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-004-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-004-ref.html deleted file mode 100644 index 5b94f905d348..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-004-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

FULLWIDTH narrow

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-004.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-004.html deleted file mode 100644 index ba21e80989b8..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-004.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

FULLWIDTH narrow

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-005-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-005-ref.html deleted file mode 100644 index 7899dbaa0e78..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-005-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

FULLWIDTH ■

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-005.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-005.html deleted file mode 100644 index c45b706455a7..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-005.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

FULLWIDTH ■

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-006-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-006-ref.html deleted file mode 100644 index 02845041f154..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-006-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

FULLWIDTH آزمون

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-006.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-006.html deleted file mode 100644 index 7906002ad721..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-006.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

FULLWIDTH آزمون

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-007-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-007-ref.html deleted file mode 100644 index 82a674ba2bb7..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-007-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

FULLWIDTH 테스트

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-007.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-007.html deleted file mode 100644 index ffeb131275df..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-007.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

FULLWIDTH 테스트

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-008-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-008-ref.html deleted file mode 100644 index fdb0abe18be3..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-008-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is NO white space between the two strings below. -

テストFULLWIDTH

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-008.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-008.html deleted file mode 100644 index c4d016835e70..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-008.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is NO white space between the two strings below. -

テスト FULLWIDTH

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-009-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-009-ref.html deleted file mode 100644 index 225a033ea36f..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-009-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is NO white space between the two strings below. -

テストテスト

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-009.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-009.html deleted file mode 100644 index 7b3fa31adac5..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-009.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is NO white space between the two strings below. -

テスト テスト

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-010-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-010-ref.html deleted file mode 100644 index ff1f441f83e2..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-010-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is NO white space between the two strings below. -

テスト測試

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-010.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-010.html deleted file mode 100644 index a4aa917b551a..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-010.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is NO white space between the two strings below. -

テスト 測試

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-011-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-011-ref.html deleted file mode 100644 index 5df8d43d2e4a..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-011-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

テスト narrow

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-011.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-011.html deleted file mode 100644 index 25fae5d0aa6e..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-011.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

テスト narrow

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-012-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-012-ref.html deleted file mode 100644 index dfec0f4646a3..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-012-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

テスト ■

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-012.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-012.html deleted file mode 100644 index cddc783f2ef0..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-012.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

テスト ■

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-013-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-013-ref.html deleted file mode 100644 index b0b9ad58b9eb..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-013-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

テスト آزمون

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-013.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-013.html deleted file mode 100644 index 3157f7f7c0ec..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-013.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

テスト آزمون

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-014-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-014-ref.html deleted file mode 100644 index 040b4410b34d..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-014-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

テスト 테스트

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-014.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-014.html deleted file mode 100644 index 732ed7e074e2..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-014.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

テスト 테스트

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-015-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-015-ref.html deleted file mode 100644 index 2a2815893292..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-015-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is NO white space between the two strings below. -

測試FULLWIDTH

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-015.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-015.html deleted file mode 100644 index d9cf41cf2947..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-015.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is NO white space between the two strings below. -

測試 FULLWIDTH

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-016-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-016-ref.html deleted file mode 100644 index 339aaa4ab9cb..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-016-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is NO white space between the two strings below. -

測試テスト

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-016.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-016.html deleted file mode 100644 index f61b08c16ac6..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-016.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is NO white space between the two strings below. -

測試 テスト

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-017-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-017-ref.html deleted file mode 100644 index ede6f889dad1..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-017-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is NO white space between the two strings below. -

測試測試

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-017.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-017.html deleted file mode 100644 index 6fc77afd453e..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-017.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is NO white space between the two strings below. -

測試 測試

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-018-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-018-ref.html deleted file mode 100644 index a4ac3be9762e..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-018-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

測試 narrow

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-018.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-018.html deleted file mode 100644 index b8fa0fe94a2a..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-018.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

測試 narrow

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-019-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-019-ref.html deleted file mode 100644 index a4106d7bd3e2..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-019-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

測試 ■

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-019.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-019.html deleted file mode 100644 index 916307b50a5c..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-019.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

測試 ■

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-020-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-020-ref.html deleted file mode 100644 index 95224a24a84e..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-020-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

測試 آزمون

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-020.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-020.html deleted file mode 100644 index 91aaa4648a96..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-020.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

測試 آزمون

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-021-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-021-ref.html deleted file mode 100644 index 55c414a206f2..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-021-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

測試 테스트

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-021.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-021.html deleted file mode 100644 index d8be051ae33c..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-021.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

測試 테스트

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-022-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-022-ref.html deleted file mode 100644 index 1dc537bc341d..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-022-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

narrow FULLWIDTH

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-022.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-022.html deleted file mode 100644 index c6a64144934c..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-022.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

narrow FULLWIDTH

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-023-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-023-ref.html deleted file mode 100644 index 0fe815bbebb3..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-023-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

narrow テスト

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-023.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-023.html deleted file mode 100644 index 09d6ea4e37d0..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-023.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

narrow テスト

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-024-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-024-ref.html deleted file mode 100644 index 096aab333daa..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-024-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

narrow 測試

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-024.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-024.html deleted file mode 100644 index 72c5cefda255..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-024.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

narrow 測試

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-025-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-025-ref.html deleted file mode 100644 index 1e797d5194e8..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-025-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

narrow narrow

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-025.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-025.html deleted file mode 100644 index 54b5c8f85af3..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-025.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

narrow narrow

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-026-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-026-ref.html deleted file mode 100644 index 269ef7a4f19e..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-026-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

narrow ■

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-026.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-026.html deleted file mode 100644 index 90e82b7d1e40..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-026.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

narrow ■

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-027-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-027-ref.html deleted file mode 100644 index bf678c7c20fe..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-027-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

narrow آزمون

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-027.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-027.html deleted file mode 100644 index 9ade4003566f..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-027.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

narrow آزمون

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-028-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-028-ref.html deleted file mode 100644 index 642e21f334d1..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-028-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

narrow 테스트

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-028.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-028.html deleted file mode 100644 index 927e652e8dc6..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-028.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

narrow 테스트

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-029-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-029-ref.html deleted file mode 100644 index 69b43f61e705..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-029-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

■ FULLWIDTH

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-029.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-029.html deleted file mode 100644 index 0c0a066fcd8d..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-029.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

■ FULLWIDTH

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-030-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-030-ref.html deleted file mode 100644 index 3c3cc2658a43..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-030-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

■ テスト

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-030.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-030.html deleted file mode 100644 index fad7d22abf8d..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-030.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

■ テスト

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-031-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-031-ref.html deleted file mode 100644 index 4902bf1e7848..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-031-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

■ 測試

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-031.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-031.html deleted file mode 100644 index 3b6916cd8ebd..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-031.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

■ 測試

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-032-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-032-ref.html deleted file mode 100644 index a2bd3b472b9b..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-032-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

■ narrow

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-032.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-032.html deleted file mode 100644 index fdb3670efe0c..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-032.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

■ narrow

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-033-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-033-ref.html deleted file mode 100644 index 0b3ab3e92868..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-033-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

■ ■

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-033.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-033.html deleted file mode 100644 index de2af2fdf9bb..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-033.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

■ ■

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-034-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-034-ref.html deleted file mode 100644 index 3c55aa257b1c..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-034-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

■ آزمون

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-034.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-034.html deleted file mode 100644 index b6e4ea7756b3..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-034.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

■ آزمون

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-035-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-035-ref.html deleted file mode 100644 index 5160d4a7c9fe..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-035-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

■ 테스트

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-035.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-035.html deleted file mode 100644 index 816de856b550..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-035.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

■ 테스트

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-036-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-036-ref.html deleted file mode 100644 index f15f8c68530a..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-036-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

آزمون FULLWIDTH

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-036.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-036.html deleted file mode 100644 index 993dcabaddfd..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-036.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

آزمون FULLWIDTH

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-037-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-037-ref.html deleted file mode 100644 index 9716239f3de6..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-037-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

آزمون テスト

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-037.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-037.html deleted file mode 100644 index 25003a8eae2d..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-037.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

آزمون テスト

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-038-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-038-ref.html deleted file mode 100644 index a24b5d429690..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-038-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

آزمون 測試

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-038.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-038.html deleted file mode 100644 index 49907c5007c6..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-038.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

آزمون 測試

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-039-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-039-ref.html deleted file mode 100644 index b20aa3ba938f..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-039-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

آزمون narrow

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-039.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-039.html deleted file mode 100644 index ac6f153e4d95..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-039.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

آزمون narrow

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-040-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-040-ref.html deleted file mode 100644 index 1efeb6813289..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-040-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

آزمون ■

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-040.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-040.html deleted file mode 100644 index 78c5f7282862..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-040.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

آزمون ■

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-041-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-041-ref.html deleted file mode 100644 index 21fe9aa30519..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-041-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

آزمون آزمون

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-041.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-041.html deleted file mode 100644 index 7315d074071d..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-041.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

آزمون آزمون

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-042-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-042-ref.html deleted file mode 100644 index f164d1bd3b7e..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-042-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

آزمون 테스트

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-042.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-042.html deleted file mode 100644 index dc3b85c1758e..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-042.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

آزمون 테스트

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-043-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-043-ref.html deleted file mode 100644 index 657ea9dd04fd..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-043-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

테스트 FULLWIDTH

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-043.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-043.html deleted file mode 100644 index 327c9aa748a0..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-043.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

테스트 FULLWIDTH

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-044-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-044-ref.html deleted file mode 100644 index 93cb2234e73b..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-044-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

테스트 テスト

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-044.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-044.html deleted file mode 100644 index 4b0a468d767d..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-044.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

테스트 テスト

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-045-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-045-ref.html deleted file mode 100644 index 7839b74dad4c..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-045-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

테스트 測試

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-045.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-045.html deleted file mode 100644 index ab6376964253..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-045.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

테스트 測試

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-046-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-046-ref.html deleted file mode 100644 index 5a457be71b33..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-046-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

테스트 narrow

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-046.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-046.html deleted file mode 100644 index dac5830248da..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-046.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

테스트 narrow

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-047-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-047-ref.html deleted file mode 100644 index c3e890c66b12..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-047-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

테스트 ■

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-047.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-047.html deleted file mode 100644 index 60897786b44e..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-047.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

테스트 ■

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-048-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-048-ref.html deleted file mode 100644 index e27b09d3fad1..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-048-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

테스트 آزمون

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-048.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-048.html deleted file mode 100644 index 60a2f7f6db77..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-048.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

테스트 آزمون

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-049-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-049-ref.html deleted file mode 100644 index f1cce478a10a..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-049-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

테스트 테스트

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-049.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-049.html deleted file mode 100644 index 5fddc1a0e408..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-rules-049.html +++ /dev/null @@ -1,13 +0,0 @@ - - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is ONE white space between the two strings below. -

테스트 테스트

-
diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-unremovable-1.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-unremovable-1.html deleted file mode 100644 index 4af93c96eeb7..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-unremovable-1.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - -CSS Text 4.1.2. Segment Break Transformation Rules - - - - - - - - - -
Test passes if there is one white space between 2nd and 3rd CJK character. - -

一些 언문

-
- - diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-unremovable-2.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-unremovable-2.html deleted file mode 100644 index 88bbcba94a63..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-unremovable-2.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - -CSS Text 4.1.2. Segment Break Transformation Rules - - - - - - - - - -
Test passes if there is one white space between 2nd and 3rd CJK character. - -

一些 언문

-
- - diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-unremovable-3.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-unremovable-3.html deleted file mode 100644 index e1d28d13f4e0..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-unremovable-3.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - -CSS Text 4.1.2. Segment Break Transformation Rules - - - - - - - - - -
Test passes if there is one white space between 2nd and 3rd CJK character. - -

一些 언문

-
- - diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-unremovable-4.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-unremovable-4.html deleted file mode 100644 index 1934ce9d6f07..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-unremovable-4.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - -CSS Text 4.1.2. Segment Break Transformation Rules - - - - - - - - - -
Test passes if there is one white space between 2nd and 3rd CJK character. - -

一些 언문

-
- - diff --git a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-unremovable-ref.html b/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-unremovable-ref.html deleted file mode 100644 index 589da00bbb4a..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/segment-break-transformation-unremovable-ref.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - -CSS Text 4.1.2. Segment Break Transformation Rules - - - - - - -
Test passes if there is one white space between 2nd and 3rd CJK character. - -

一些 언문

-
- - diff --git a/layout/reftests/w3c-css/submitted/text3/support/generate-segment-break-transformation-rules-tests.py b/layout/reftests/w3c-css/submitted/text3/support/generate-segment-break-transformation-rules-tests.py deleted file mode 100644 index c45db7c99f93..000000000000 --- a/layout/reftests/w3c-css/submitted/text3/support/generate-segment-break-transformation-rules-tests.py +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env python -# - * - coding: UTF-8 - * - - -""" -This script generates tests segment-break-transformation-rules-001 ~ 049 which -cover all possible combinations of characters at two sides of segment breaks. -More specifically, there are seven types of characters involve in these rules: - -1. East Asian Full-width (F) -2. East Asian Half-width (H) -3. East Asian Wide (W) except Hangul -4. East Asian Narrow (Na) -5. East Asian Ambiguous (A) -6. Not East Asian (Neutral) -7. Hangul - -So there are 49 different combinations. It outputs a list of all -tests it generated in the format of Mozilla reftest.list to the stdout. -""" - -from __future__ import unicode_literals - -TEST_FILE = 'segment-break-transformation-rules-{:03}.html' -TEST_TEMPLATE = ''' - -CSS Reftest Test: Segment Break Transformation Rules - - - - - - - -
Pass if there is {expect} white space between the two strings below. -

{prevchar} {nextchar}

-
-''' - -REF_FILE = 'segment-break-transformation-rules-{:03}-ref.html' -REF_TEMPLATE_REMOVE = ''' - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is NO white space between the two strings below. -

{0}{1}

-
-''' -REF_TEMPLATE_KEEP = ''' - -CSS Reftest Reference: Segment Break Transformation Rules - - - - -
Pass if there is ONE white space between the two strings below. -

{0}{2}{1}

-
-''' - -CHAR_SET = [ - ('East Asian Full-width (F)', 'FULLWIDTH'), - ('East Asian Half-width (H)', 'テスト'), - ('East Asian Wide (W) except Hangul', '測試'), - ('East Asian Narrow (Na)', 'narrow'), - ('East Asian Ambiguous (A)', '■'), - ('Not East Asian (Neutral)', 'آزمون'), - ('Hangul', '테스트'), - ] - -def write_file(filename, content): - with open(filename, 'wb') as f: - f.write(content.encode('UTF-8')) - -print("# START tests from {}".format(__file__)) -global idx -idx = 0 -for i, (prevtype, prevchars) in enumerate(CHAR_SET): - for j, (nextype, nextchars) in enumerate(CHAR_SET): - idx += 1 - reffilename = REF_FILE.format(idx) - testfilename = TEST_FILE.format(idx) - # According to CSS Text 3 - 4.1.2. Segment Break Transformation Rules, - # if the East Asian Width property of both the character before and - # after the segment break is F, W, or H (not A), and neither side is - # Hangul, then the segment break is removed. Otherwise, the segment - # break is converted to a space (U+0020). - if i < 3 and j < 3: - write_file(reffilename, - REF_TEMPLATE_REMOVE.format(prevchars, nextchars)) - write_file(testfilename, - TEST_TEMPLATE.format(index=idx, prev=prevtype, - next=nextype, - prevchar=prevchars, - nextchar=nextchars, - expect='NO')) - else: - write_file(reffilename, - REF_TEMPLATE_KEEP.format(prevchars, nextchars, ' ')) - write_file(testfilename, - TEST_TEMPLATE.format(index=idx, prev=prevtype, - next=nextype, - prevchar=prevchars, - nextchar=nextchars, - expect='ONE')) - print("== {} {}".format(testfilename, reffilename)) -print("# END tests from {}".format(__file__)) diff --git a/media/mtransport/test/runnable_utils_unittest.cpp b/media/mtransport/test/runnable_utils_unittest.cpp index 28ca57aa1401..5f08f4917ac6 100644 --- a/media/mtransport/test/runnable_utils_unittest.cpp +++ b/media/mtransport/test/runnable_utils_unittest.cpp @@ -12,7 +12,6 @@ #include "nsCOMPtr.h" #include "nsNetCID.h" #include "nsXPCOM.h" -#include "nsXPCOMGlue.h" #include "mozilla/RefPtr.h" #include "nsIComponentManager.h" diff --git a/media/mtransport/test/sockettransportservice_unittest.cpp b/media/mtransport/test/sockettransportservice_unittest.cpp index 43746c908bbc..a7edaa193de3 100644 --- a/media/mtransport/test/sockettransportservice_unittest.cpp +++ b/media/mtransport/test/sockettransportservice_unittest.cpp @@ -12,7 +12,6 @@ #include "nsCOMPtr.h" #include "nsNetCID.h" #include "nsXPCOM.h" -#include "nsXPCOMGlue.h" #include "nsIComponentManager.h" #include "nsIComponentRegistrar.h" diff --git a/netwerk/base/LoadInfo.cpp b/netwerk/base/LoadInfo.cpp index 1091a68da6d6..3fdd1284710a 100644 --- a/netwerk/base/LoadInfo.cpp +++ b/netwerk/base/LoadInfo.cpp @@ -95,8 +95,9 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadingPrincipal, // if the load is sandboxed, we can not also inherit the principal if (mSecurityFlags & nsILoadInfo::SEC_SANDBOXED) { - mSecurityFlags ^= nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL; - mForceInheritPrincipalDropped = true; + mForceInheritPrincipalDropped = + (mSecurityFlags & nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL); + mSecurityFlags &= ~nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL; } if (aLoadingContext) { @@ -245,8 +246,9 @@ LoadInfo::LoadInfo(nsPIDOMWindowOuter* aOuterWindow, // if the load is sandboxed, we can not also inherit the principal if (mSecurityFlags & nsILoadInfo::SEC_SANDBOXED) { - mSecurityFlags ^= nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL; - mForceInheritPrincipalDropped = true; + mForceInheritPrincipalDropped = + (mSecurityFlags & nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL); + mSecurityFlags &= ~nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL; } // NB: Ignore the current inner window since we're navigating away from it. diff --git a/netwerk/base/nsILoadInfo.idl b/netwerk/base/nsILoadInfo.idl index 78433c8b88dc..0b32406ebe89 100644 --- a/netwerk/base/nsILoadInfo.idl +++ b/netwerk/base/nsILoadInfo.idl @@ -63,8 +63,9 @@ interface nsILoadInfo : nsISupports */ /* - * Enforce the same origin policy where data: loads inherit - * the principal. + * Enforce the same origin policy where data: loads inherit the principal. + * See the documentation for principalToInherit, which describes exactly what + * principal is inherited. */ const unsigned long SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS = (1<<0); @@ -74,8 +75,10 @@ interface nsILoadInfo : nsISupports const unsigned long SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED = (1<<1); /** - * Allow loads from other origins. Loads from data: will inherit - * the principal of the origin that triggered the load. + * Allow loads from other origins. Loads from data: will inherit the + * principal. See the documentation for principalToInherit, which describes + * exactly what principal is inherited. + * * Commonly used by plain ,