MozReview-Commit-ID: 2zUGojOEVNi
This commit is contained in:
Wes Kocher 2017-03-23 16:05:15 -07:00
Родитель cc9886af29 f65c241343
Коммит 1087616d0e
161 изменённых файлов: 2208 добавлений и 1580 удалений

Просмотреть файл

@ -1,10 +1,6 @@
# Always ignore node_modules.
**/node_modules/**/*.*
# Include these to speed up ESLint, see bug 1347906.
.hg
.git
# Exclude expected objdirs.
obj*/**

Просмотреть файл

@ -630,7 +630,7 @@
init for other error types .-->
<div id="certificateErrorReporting">
<p class="toggle-container-with-text">
<input type="checkbox" id="automaticallyReportInFuture" />
<input type="checkbox" id="automaticallyReportInFuture" role="checkbox" />
<label for="automaticallyReportInFuture" id="automaticallyReportInFuture">&errorReporting.automatic2;</label>
</p>
</div>

Просмотреть файл

@ -49,7 +49,7 @@
<h2>&tabCrashed.requestReport;</h2>
<div class="checkbox-with-label">
<input type="checkbox" id="sendReport"/>
<input type="checkbox" id="sendReport" role="checkbox"/>
<label for="sendReport">&tabCrashed.sendReport2;</label>
</div>
@ -59,13 +59,13 @@
</li>
<li class="checkbox-with-label">
<input type="checkbox" id="includeURL"/>
<input type="checkbox" id="includeURL" role="checkbox"/>
<label for="includeURL">&tabCrashed.includeURL2;</label>
</li>
<li id="requestEmail" hidden="true">
<div class="checkbox-with-label">
<input type="checkbox" id="emailMe"/>
<input type="checkbox" id="emailMe" role="checkbox"/>
<label for="emailMe">&tabCrashed.emailMe;</label>
</div>
<input type="text" id="email" placeholder="&tabCrashed.emailPlaceholder;"/>
@ -75,7 +75,7 @@
<div id="requestAutoSubmit" hidden="true">
<h2>&tabCrashed.requestAutoSubmit2;</h2>
<div class="checkbox-with-label">
<input type="checkbox" id="autoSubmit"/>
<input type="checkbox" id="autoSubmit" role="checkbox"/>
<label for="autoSubmit">&tabCrashed.autoSubmit2;</label>
</div>
</div>

Просмотреть файл

@ -21,13 +21,13 @@
onclick="checkForMiddleClick(this, event);"/>
<menuitem id="context-reload"
class="menuitem-iconic"
tooltiptext="&reloadButton.tooltip;"
tooltip="dynamic-shortcut-tooltip"
aria-label="&reloadCmd.label;"
oncommand="gContextMenu.reload(event);"
onclick="checkForMiddleClick(this, event);"/>
<menuitem id="context-stop"
class="menuitem-iconic"
tooltiptext="&stopButton.tooltip;"
tooltip="dynamic-shortcut-tooltip"
aria-label="&stopCmd.label;"
command="Browser:Stop"/>
<menuitem id="context-bookmarkpage"

Просмотреть файл

@ -5474,19 +5474,29 @@ var gHomeButton = {
const nodeToTooltipMap = {
"bookmarks-menu-button": "bookmarksMenuButton.tooltip",
"context-reload": "reloadButton.tooltip",
"context-stop": "stopButton.tooltip",
"downloads-button": "downloads.tooltip",
"fullscreen-button": "fullscreenButton.tooltip",
"new-window-button": "newWindowButton.tooltip",
"new-tab-button": "newTabButton.tooltip",
"tabs-newtab-button": "newTabButton.tooltip",
"fullscreen-button": "fullscreenButton.tooltip",
"downloads-button": "downloads.tooltip",
"urlbar-reload-button": "reloadButton.tooltip",
"urlbar-stop-button": "stopButton.tooltip",
"urlbar-zoom-button": "urlbar-zoom-button.tooltip",
};
const nodeToShortcutMap = {
"bookmarks-menu-button": "manBookmarkKb",
"context-reload": "key_reload",
"context-stop": "key_stop",
"downloads-button": "key_openDownloads",
"fullscreen-button": "key_fullScreen",
"new-window-button": "key_newNavigator",
"new-tab-button": "key_newNavigatorTab",
"tabs-newtab-button": "key_newNavigatorTab",
"fullscreen-button": "key_fullScreen",
"downloads-button": "key_openDownloads"
"urlbar-reload-button": "key_reload",
"urlbar-stop-button": "key_stop",
"urlbar-zoom-button": "key_fullZoomReset",
};
if (AppConstants.platform == "macosx") {

Просмотреть файл

@ -776,7 +776,7 @@
onclick="ReaderParent.buttonClick(event);"/>
<toolbarbutton id="urlbar-zoom-button"
onclick="FullZoom.reset();"
tooltiptext="&urlbar.zoomReset.tooltip;"
tooltip="dynamic-shortcut-tooltip"
hidden="true"/>
</hbox>
<hbox id="userContext-icons" hidden="true">
@ -791,11 +791,11 @@
class="chromeclass-toolbar-additional"
command="Browser:ReloadOrDuplicate"
onclick="checkForMiddleClick(this, event);"
tooltiptext="&reloadButton.tooltip;"/>
tooltip="dynamic-shortcut-tooltip"/>
<toolbarbutton id="urlbar-stop-button"
class="chromeclass-toolbar-additional"
command="Browser:Stop"
tooltiptext="&stopButton.tooltip;"/>
tooltip="dynamic-shortcut-tooltip"/>
</textbox>
</hbox>
</toolbaritem>

Просмотреть файл

@ -2194,6 +2194,7 @@
var aDisallowInheritPrincipal;
var aOpener;
var aCreateLazyBrowser;
var aSkipBackgroundNotify;
if (arguments.length == 2 &&
typeof arguments[1] == "object" &&
!(arguments[1] instanceof Ci.nsIURI)) {
@ -2220,6 +2221,7 @@
aOpener = params.opener;
aIsPrerendered = params.isPrerendered;
aCreateLazyBrowser = params.createLazyBrowser;
aSkipBackgroundNotify = params.skipBackgroundNotify;
}
// if we're adding tabs, we're past interrupt mode, ditch the owner
@ -2254,6 +2256,11 @@
}
t.setAttribute("onerror", "this.removeAttribute('image');");
if (aSkipBackgroundNotify) {
t.setAttribute("skipbackgroundnotify", true);
}
t.className = "tabbrowser-tab";
this.tabContainer._unlockTabSizing();
@ -2656,12 +2663,11 @@
!aSkipPermitUnload &&
aTab.linkedPanel &&
!aAdoptedByTab) {
TelemetryStopwatch.start("FX_TAB_CLOSE_PERMIT_UNLOAD_TIME_MS", aTab);
// We need to block while calling permitUnload() because it
// processes the event queue and may lead to another removeTab()
// call before permitUnload() returns.
TelemetryStopwatch.start("FX_TAB_CLOSE_PERMIT_UNLOAD_TIME_MS", aTab);
aTab._pendingPermitUnload = true;
let {permitUnload, timedOut} = browser.permitUnload();
delete aTab._pendingPermitUnload;
@ -2672,8 +2678,6 @@
// so we don't (try to) close the same tab again. Of course, we
// also stop if the unload was cancelled by the user:
if (aTab.closing || (!timedOut && !permitUnload)) {
// NB: deliberately keep the _closedDuringPermitUnload set to
// true so we keep exiting early in case of multiple calls.
return false;
}
}
@ -6313,10 +6317,10 @@
selected.left - scrollRect.left);
}
if (!this._animateElement.hasAttribute("notifybgtab")) {
this._animateElement.setAttribute("notifybgtab", "true");
if (!this._animateElement.hasAttribute("highlight")) {
this._animateElement.setAttribute("highlight", "true");
setTimeout(function(ele) {
ele.removeAttribute("notifybgtab");
ele.removeAttribute("highlight");
}, 150, this._animateElement);
}
]]></body>
@ -6404,7 +6408,7 @@
if (tab.getAttribute("selected") == "true") {
this._fillTrailingGap();
this._handleTabSelect();
} else {
} else if (!tab.hasAttribute("skipbackgroundnotify")) {
this._notifyBackgroundTab(tab);
}

Просмотреть файл

@ -91,6 +91,15 @@ const DISABLED_OPTGROUP_AND_OPTIONS =
' <option value="Two" selected="true">{"end": "true"}</option>' +
"</select></body></html>";
const SELECT_CHANGES_COLOR_ON_FOCUS =
"<html><head><style>" +
" select:focus { background-color: orange; color: black; }" +
"</style></head>" +
"<body><select id='one'>" +
' <option>{"color": "rgb(0, 0, 0)", "backgroundColor": "rgba(0, 0, 0, 0)"}</option>' +
' <option selected="true">{"end": "true"}</option>' +
"</select></body></html>";
function getSystemColor(color) {
// Need to convert system color to RGB color.
let textarea = document.createElementNS("http://www.w3.org/1999/xhtml", "textarea");
@ -279,3 +288,12 @@ add_task(function* test_disabled_optgroup_and_options() {
yield testSelectColors(DISABLED_OPTGROUP_AND_OPTIONS, 17,
{skipSelectColorTest: true});
});
add_task(function* test_disabled_optgroup_and_options() {
let options = {
selectColor: "rgb(0, 0, 0)",
selectBgColor: "rgb(255, 165, 0)"
};
yield testSelectColors(SELECT_CHANGES_COLOR_ON_FOCUS, 2, options);
});

Просмотреть файл

@ -12,29 +12,39 @@ add_task(function* () {
const BASE = "http://mochi.test:8888/browser/browser/components/extensions/test/browser/";
const URL = BASE + "file_bypass_cache.sjs";
function awaitLoad(tabId) {
return new Promise(resolve => {
browser.tabs.onUpdated.addListener(function listener(tabId_, changed, tab) {
if (tabId == tabId_ && changed.status == "complete" && tab.url == URL) {
browser.tabs.onUpdated.removeListener(listener);
resolve();
}
});
let tabId = null;
let loadPromise, resolveLoad;
function resetLoad() {
loadPromise = new Promise(resolve => {
resolveLoad = resolve;
});
}
function awaitLoad() {
return loadPromise.then(() => {
resetLoad();
});
}
resetLoad();
browser.tabs.onUpdated.addListener(function listener(tabId_, changed, tab) {
if (tabId == tabId_ && changed.status == "complete" && tab.url == URL) {
resolveLoad();
}
});
try {
let tab = await browser.tabs.create({url: URL});
await awaitLoad(tab.id);
tabId = tab.id;
await awaitLoad();
await browser.tabs.reload(tab.id, {bypassCache: false});
await awaitLoad(tab.id);
await awaitLoad();
let [textContent] = await browser.tabs.executeScript(tab.id, {code: "document.body.textContent"});
browser.test.assertEq("", textContent, "`textContent` should be empty when bypassCache=false");
await browser.tabs.reload(tab.id, {bypassCache: true});
await awaitLoad(tab.id);
await awaitLoad();
[textContent] = await browser.tabs.executeScript(tab.id, {code: "document.body.textContent"});

Просмотреть файл

@ -888,7 +888,7 @@ PlacesController.prototype = {
PlacesUtils.asQuery(node.parent).queryOptions.queryType ==
Ci.nsINavHistoryQueryOptions.QUERY_TYPE_HISTORY) {
// This is a uri node inside an history query.
PlacesUtils.history.removePage(node.uri).catch(Components.utils.reportError);
PlacesUtils.history.remove(node.uri).catch(Components.utils.reportError);
// History deletes are not undoable, so we don't have a transaction.
} else if (node.itemId == -1 &&
PlacesUtils.nodeIsQuery(node) &&

Просмотреть файл

@ -331,9 +331,7 @@ var gPrivacyPane = {
pref.value = false;
// select the remember history option if needed
let rememberHistoryCheckbox = document.getElementById("rememberHistory");
if (!rememberHistoryCheckbox.checked)
rememberHistoryCheckbox.checked = true;
document.getElementById("places.history.enabled").value = true;
// select the remember forms history option
document.getElementById("browser.formfill.enable").value = true;

Просмотреть файл

@ -331,9 +331,7 @@ var gPrivacyPane = {
pref.value = false;
// select the remember history option if needed
let rememberHistoryCheckbox = document.getElementById("rememberHistory");
if (!rememberHistoryCheckbox.checked)
rememberHistoryCheckbox.checked = true;
document.getElementById("places.history.enabled").value = true;
// select the remember forms history option
document.getElementById("browser.formfill.enable").value = true;

Просмотреть файл

@ -3222,8 +3222,9 @@ var SessionStoreInternal = {
(tabbrowser.tabs[t].getAttribute("usercontextid") == (userContextId || ""));
let tab = reuseExisting ? this._maybeUpdateBrowserRemoteness(tabbrowser.tabs[t])
: tabbrowser.addTab("about:blank",
{skipAnimation: true,
userContextId});
{ skipAnimation: true,
userContextId,
skipBackgroundNotify: true });
// If we inserted a new tab because the userContextId didn't match with the
// open tab, even though `t < openTabCount`, we need to remove that open tab

Просмотреть файл

@ -14,7 +14,8 @@ this.EXPORTED_SYMBOLS = ["TabAttributes"];
// 'pending' is used internal by sessionstore and managed accordingly.
// 'iconLoadingPrincipal' is same as 'image' that it should be handled by
// using the gBrowser.getIcon()/setIcon() methods.
const ATTRIBUTES_TO_SKIP = new Set(["image", "muted", "pending", "iconLoadingPrincipal"]);
const ATTRIBUTES_TO_SKIP = new Set(["image", "muted", "pending", "iconLoadingPrincipal",
"skipbackgroundnotify"]);
// A set of tab attributes to persist. We will read a given list of tab
// attributes when collecting tab data and will re-set those attributes when

Просмотреть файл

@ -8,6 +8,6 @@ ac_add_options --disable-crashreporter
ac_add_options --disable-elf-hack
MOZ_CODE_COVERAGE=1
export CFLAGS="-fprofile-arcs -ftest-coverage"
export CXXFLAGS="-fprofile-arcs -ftest-coverage"
export LDFLAGS="-fprofile-arcs -ftest-coverage -lgcov -L$TOOLTOOL_DIR/gtk3/usr/local/lib"
export CFLAGS="--coverage"
export CXXFLAGS="--coverage"
export LDFLAGS="--coverage -L$TOOLTOOL_DIR/gtk3/usr/local/lib"

Просмотреть файл

@ -1,12 +0,0 @@
if [ -n "$ENABLE_RELEASE_PROMOTION" ]; then
MOZ_AUTOMATION_UPLOAD_SYMBOLS=${MOZ_AUTOMATION_UPLOAD_SYMBOLS-1}
MOZ_AUTOMATION_UPDATE_PACKAGING=1
fi
. "$topsrcdir/browser/config/mozconfigs/macosx-universal/common-opt"
ac_add_options --enable-official-branding
ac_add_options --enable-verify-mar
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

Просмотреть файл

@ -1,18 +0,0 @@
# This file is sourced by the nightly, beta, and release mozconfigs.
. $topsrcdir/build/macosx/universal/mozconfig
# Universal builds override the default of browser (bug 575283 comment 29)
ac_add_options --enable-application=browser
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --with-google-api-keyfile=/builds/gapi.data
ac_add_options --with-mozilla-api-keyfile=/builds/mozilla-desktop-geoloc-api.key
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
export MOZ_TELEMETRY_REPORTING=1
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1

Просмотреть файл

@ -1,22 +0,0 @@
. "$topsrcdir/browser/config/mozconfigs/common"
. "$topsrcdir/build/macosx/mozconfig.common"
ac_add_options --with-l10n-base=../../l10n
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --with-branding=browser/branding/nightly
if test "${MOZ_UPDATE_CHANNEL}" = "nightly"; then
ac_add_options --with-macbundlename-prefix=Firefox
fi
export MOZILLA_OFFICIAL=1
# Enable Telemetry
export MOZ_TELEMETRY_REPORTING=1
# Don't autoclobber l10n, as this can lead to missing binaries and broken builds
# Bug 1283438
mk_add_options AUTOCLOBBER=
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

Просмотреть файл

@ -1,20 +0,0 @@
. "$topsrcdir/browser/config/mozconfigs/macosx-universal/common-opt"
ac_add_options --disable-install-strip
ac_add_options --enable-verify-mar
ac_add_options --enable-profiling
ac_add_options --enable-instruments
# Cross-universal builds fail when dtrace is enabled
if test `uname -s` != Linux; then
ac_add_options --enable-dtrace
fi
if test "${MOZ_UPDATE_CHANNEL}" = "nightly"; then
ac_add_options --with-macbundlename-prefix=Firefox
fi
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

Просмотреть файл

@ -1,19 +0,0 @@
# This make file should be identical to the beta mozconfig, apart from the
# safeguard below
if [ -n "$ENABLE_RELEASE_PROMOTION" ]; then
MOZ_AUTOMATION_UPLOAD_SYMBOLS=${MOZ_AUTOMATION_UPLOAD_SYMBOLS-1}
MOZ_AUTOMATION_UPDATE_PACKAGING=1
fi
. "$topsrcdir/browser/config/mozconfigs/macosx-universal/common-opt"
ac_add_options --enable-official-branding
ac_add_options --enable-verify-mar
# safeguard against someone forgetting to re-set EARLY_BETA_OR_EARLIER in
# defines.sh during the beta cycle
export BUILDING_RELEASE=1
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

Просмотреть файл

@ -198,10 +198,8 @@ These should match what Safari and other Apple applications use on OS X Lion. --
<!ENTITY backForwardButtonMenu.tooltip "Right-click or pull down to show history">
<!ENTITY backForwardButtonMenuMac.tooltip "Pull down to show history">
<!ENTITY reloadCmd.label "Reload">
<!ENTITY reloadButton.tooltip "Reload current page">
<!ENTITY stopCmd.label "Stop">
<!ENTITY stopCmd.macCommandKey ".">
<!ENTITY stopButton.tooltip "Stop loading this page">
<!ENTITY goEndCap.tooltip "Go to the address in the Location Bar">
<!ENTITY printButton.label "Print">
<!ENTITY printButton.tooltip "Print this page">
@ -234,8 +232,6 @@ These should match what Safari and other Apple applications use on OS X Lion. --
<!ENTITY urlbar.openHistoryPopup.tooltip "Show history">
<!ENTITY urlbar.zoomReset.tooltip "Reset zoom level">
<!ENTITY searchItem.title "Search">
<!-- Toolbar items -->

Просмотреть файл

@ -386,6 +386,15 @@ tabHistory.goForward=Go forward to this page
# URL Bar
pasteAndGo.label=Paste & Go
# LOCALIZATION NOTE (reloadButton.tooltip):
# %S is the keyboard shortcut for reloading the current page
reloadButton.tooltip=Reload current page (%S)
# LOCALIZATION NOTE (stopButton.tooltip):
# %S is the keyboard shortcut for stopping loading the page
stopButton.tooltip=Stop loading this page (%S)
# LOCALIZATION NOTE (urlbar-zoom-button.tooltip):
# %S is the keyboard shortcut for resetting the zoom level to 100%
urlbar-zoom-button.tooltip=Reset zoom level (%S)
# LOCALIZATION NOTE(zoom-button.label): %S is the current page zoom level,
# %% will be displayed as a single % character (% is commonly used to define

Просмотреть файл

@ -1376,7 +1376,7 @@ html|span.ac-emphasize-text-url {
transition: 1s background-color ease-out;
}
.tabbrowser-arrowscrollbox > .scrollbutton-down[notifybgtab] {
.tabbrowser-arrowscrollbox > .scrollbutton-down[highlight] {
background-color: Highlight;
transition: none;
}

Просмотреть файл

@ -2591,7 +2591,7 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
transition: 1s background-color ease-out;
}
.tabbrowser-arrowscrollbox > .scrollbutton-down[notifybgtab] {
.tabbrowser-arrowscrollbox > .scrollbutton-down[highlight] {
background-color: Highlight;
transition: none;
}

Просмотреть файл

@ -1934,7 +1934,7 @@ html|span.ac-emphasize-text-url {
transition: 1s background-color ease-out;
}
.tabbrowser-arrowscrollbox > .scrollbutton-down[notifybgtab] {
.tabbrowser-arrowscrollbox > .scrollbutton-down[highlight] {
background-color: Highlight;
transition: none;
}

Просмотреть файл

@ -2,6 +2,7 @@ altgraph.pth:python/altgraph
marionette_driver.pth:testing/marionette/client
marionette_harness.pth:testing/marionette/harness
browsermobproxy.pth:testing/marionette/harness/marionette_harness/runner/mixins/browsermob-proxy-py
six.pth:testing/web-platform/tests/tools/six
wptserve.pth:testing/web-platform/tests/tools/wptserve
blessings.pth:python/blessings
configobj.pth:python/configobj

125
devtools/bootstrap.js поставляемый
Просмотреть файл

@ -10,6 +10,24 @@
const Cu = Components.utils;
const Ci = Components.interfaces;
const {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
const {NetUtil} = Cu.import("resource://gre/modules/NetUtil.jsm", {});
let prefs = {
// Enable dump as some errors are only printed on the stdout
"browser.dom.window.dump.enabled": true,
// Enable the browser toolbox and various chrome-only features
"devtools.chrome.enabled": true,
"devtools.debugger.remote-enabled": true,
// Disable the prompt to ease usage of the browser toolbox
"devtools.debugger.prompt-connection": false,
};
// Values of debug pref before overriding them
let originalPrefValues = {};
// MultiWindowKeyListener instance for Ctrl+Alt+R key
let listener;
// nsIURI to the addon root folder
let resourceURI;
function actionOccurred(id) {
let {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
@ -18,6 +36,54 @@ function actionOccurred(id) {
telemetry.actionOccurred(id);
}
// Synchronously fetch the content of a given URL
function readURI(uri) {
let stream = NetUtil.newChannel({
uri: NetUtil.newURI(uri, "UTF-8"),
loadUsingSystemPrincipal: true}
).open2();
let count = stream.available();
let data = NetUtil.readInputStreamToString(stream, count, {
charset: "UTF-8"
});
stream.close();
return data;
}
// Read a preference file and set all of its defined pref as default values
// (This replicate the behavior of preferences files from mozilla-central)
function processPrefFile(url) {
let content = readURI(url);
content.match(/pref\("[^"]+",\s*.+\s*\)/g).forEach(item => {
let m = item.match(/pref\("([^"]+)",\s*(.+)\s*\)/);
let name = m[1];
let val = m[2];
// Prevent overriding prefs that have been changed by the user
if (Services.prefs.prefHasUserValue(name)) {
return;
}
let defaultBranch = Services.prefs.getDefaultBranch("");
if ((val.startsWith("\"") && val.endsWith("\"")) ||
(val.startsWith("'") && val.endsWith("'"))) {
defaultBranch.setCharPref(name, val.substr(1, val.length - 2));
} else if (val.match(/[0-9]+/)) {
defaultBranch.setIntPref(name, parseInt(val, 10));
} else if (val == "true" || val == "false") {
defaultBranch.setBoolPref(name, val == "true");
} else {
console.log("Unable to match preference type for value:", val);
}
});
}
function setPrefs() {
processPrefFile(resourceURI.spec + "./client/preferences/devtools.js");
processPrefFile(resourceURI.spec + "./client/preferences/debugger.js");
}
// Helper to listen to a key on all windows
function MultiWindowKeyListener({ keyCode, ctrlKey, altKey, callback }) {
let keyListener = function (event) {
@ -76,20 +142,22 @@ let getTopLevelWindow = function (window) {
function reload(event) {
// We automatically reload the toolbox if we are on a browser tab
// with a toolbox already opened
let top = getTopLevelWindow(event.view);
let isBrowser = top.location.href.includes("/browser.xul");
let reloadToolbox = false;
if (isBrowser && top.gBrowser) {
// We do not use any devtools code before the call to Loader.jsm reload as
// any attempt to use Loader.jsm to load a module will instanciate a new
// Loader.
let nbox = top.gBrowser.getNotificationBox();
reloadToolbox =
top.document.getAnonymousElementByAttribute(nbox, "class",
"devtools-toolbox-bottom-iframe") ||
top.document.getAnonymousElementByAttribute(nbox, "class",
"devtools-toolbox-side-iframe") ||
Services.wm.getMostRecentWindow("devtools:toolbox");
if (event) {
let top = getTopLevelWindow(event.view);
let isBrowser = top.location.href.includes("/browser.xul");
if (isBrowser && top.gBrowser) {
// We do not use any devtools code before the call to Loader.jsm reload as
// any attempt to use Loader.jsm to load a module will instanciate a new
// Loader.
let nbox = top.gBrowser.getNotificationBox();
reloadToolbox =
top.document.getAnonymousElementByAttribute(nbox, "class",
"devtools-toolbox-bottom-iframe") ||
top.document.getAnonymousElementByAttribute(nbox, "class",
"devtools-toolbox-side-iframe") ||
Services.wm.getMostRecentWindow("devtools:toolbox");
}
}
let browserConsole = Services.wm.getMostRecentWindow("devtools:webconsole");
let reopenBrowserConsole = false;
@ -136,6 +204,10 @@ function reload(event) {
Cu.unload("resource://devtools/client/responsivedesign/responsivedesign.jsm");
Cu.unload("resource://devtools/client/shared/widgets/AbstractTreeItem.jsm");
Cu.unload("resource://devtools/shared/deprecated-sync-thenables.js");
// Update the preferences before starting new code
setPrefs();
const {devtools} = Cu.import("resource://devtools/shared/Loader.jsm", {});
devtools.require("devtools/client/framework/devtools-browser");
@ -178,6 +250,7 @@ function reload(event) {
setTimeout(() => {
let { TargetFactory } = devtools.require("devtools/client/framework/target");
let { gDevTools } = devtools.require("devtools/client/framework/devtools");
let top = getTopLevelWindow(event.view);
let target = TargetFactory.forTab(top.gBrowser.selectedTab);
gDevTools.showToolbox(target);
}, 1000);
@ -194,20 +267,11 @@ function reload(event) {
actionOccurred("reloadAddonReload");
}
let prefs = {
// Enable dump as some errors are only printed on the stdout
"browser.dom.window.dump.enabled": true,
// Enable the browser toolbox and various chrome-only features
"devtools.chrome.enabled": true,
"devtools.debugger.remote-enabled": true,
// Disable the prompt to ease usage of the browser toolbox
"devtools.debugger.prompt-connection": false,
};
let originalPrefValues = {};
let listener;
function startup() {
function startup(data) {
dump("DevTools addon started.\n");
resourceURI = data.resourceURI;
listener = new MultiWindowKeyListener({
keyCode: Ci.nsIDOMKeyEvent.DOM_VK_R, ctrlKey: true, altKey: true,
callback: reload
@ -225,6 +289,8 @@ function startup() {
originalPrefValues[name] = userValue;
}
}
reload();
}
function shutdown() {
listener.stop();
@ -240,6 +306,11 @@ function shutdown() {
}
}
function install() {
actionOccurred("reloadAddonInstalled");
try {
actionOccurred("reloadAddonInstalled");
} catch (e) {
// When installing on Firefox builds without devtools, telemetry doesn't
// work yet and throws.
}
}
function uninstall() {}

Просмотреть файл

@ -77,6 +77,7 @@ module.exports = createClass({
type: "checkbox",
checked: !debugDisabled,
onChange: this.onEnableAddonDebuggingChange,
role: "checkbox",
}),
dom.label({
className: "addons-debugging-label",

Просмотреть файл

@ -93,8 +93,13 @@ function Toolbox(target, selectedTool, hostType, contentWindow, frameId) {
this._toolPanels = new Map();
this._telemetry = new Telemetry();
// TODO: This approach to source maps uses server-side source maps, which we are
// replacing with client-side source maps. Do not use this in new code paths.
// To be removed in bug 1349354. Read more about ongoing work with source maps:
// https://docs.google.com/document/d/19TKnMJD3CMBzwByNE4aBBVWnl-AEan8Sf4hxi6J-eps/edit
if (Services.prefs.getBoolPref("devtools.source-map.locations.enabled")) {
this._sourceMapService = new SourceMapService(this._target);
this._deprecatedServerSourceMapService = new SourceMapService(this._target);
}
this._initInspector = null;
@ -520,6 +525,23 @@ Toolbox.prototype = {
return this.browserRequire("devtools/client/framework/components/toolbox-controller");
},
/**
* A common access point for the client-side mapping service for source maps that
* any panel can use.
*/
get sourceMapService() {
if (!Services.prefs.getBoolPref("devtools.source-map.client-service.enabled")) {
return null;
}
if (this._sourceMapService) {
return this._sourceMapService;
}
// Uses browser loader to access the `Worker` global.
this._sourceMapService =
this.browserRequire("devtools/client/shared/source-map/index");
return this._sourceMapService;
},
// Return HostType id for telemetry
_getTelemetryHostId: function () {
switch (this.hostType) {
@ -2260,8 +2282,14 @@ Toolbox.prototype = {
this._applyServiceWorkersTestingSettings);
this._lastFocusedElement = null;
if (this._deprecatedServerSourceMapService) {
this._deprecatedServerSourceMapService.destroy();
this._deprecatedServerSourceMapService = null;
}
if (this._sourceMapService) {
this._sourceMapService.destroy();
this._sourceMapService.destroyWorker();
this._sourceMapService = null;
}

Просмотреть файл

@ -13,6 +13,7 @@ const {
const { connect } = require("devtools/client/shared/vendor/react-redux");
const { findDOMNode } = require("devtools/client/shared/vendor/react-dom");
const Actions = require("../actions/index");
const { getLongString } = require("../utils/client");
const { Prefs } = require("../utils/prefs");
const { getFormDataSections } = require("../utils/request-utils");
const { getSelectedRequest } = require("../selectors/index");
@ -69,7 +70,7 @@ const MonitorPanel = createClass({
requestHeaders,
requestHeadersFromUploadStream,
requestPostData,
window.gNetwork.getString.bind(window.gNetwork),
getLongString,
).then((newFormDataSections) => {
updateRequest(
request.id,

Просмотреть файл

@ -269,7 +269,6 @@ HarBuilder.prototype = {
file.requestHeaders,
file.requestHeadersFromUploadStream,
file.requestPostData,
this._options.getString
).then(formDataSections => {
formDataSections.forEach(section => {
let paramsArray = parseQueryString(section);

Просмотреть файл

@ -13,6 +13,8 @@ const {
formDataURI,
} = require("./utils/request-utils");
const {
getLongString,
getWebConsoleClient,
onFirefoxConnect,
onFirefoxDisconnect,
} = require("./utils/client");
@ -87,7 +89,6 @@ var NetMonitorController = {
if (this._target.isTabActor) {
this.tabClient = this._target.activeTab;
}
this.webConsoleClient = this._target.activeConsole;
let connectTimeline = () => {
// Don't start up waiting for timeline markers if the server isn't
@ -103,6 +104,9 @@ var NetMonitorController = {
onFirefoxConnect(this._target);
this._target.on("close", this._onTabDetached);
this.webConsoleClient = getWebConsoleClient();
this.NetworkEventsHandler = new NetworkEventsHandler();
this.NetworkEventsHandler.connect();
window.emit(EVENTS.CONNECTED);
@ -369,7 +373,6 @@ var NetMonitorController = {
function NetworkEventsHandler() {
this.addRequest = this.addRequest.bind(this);
this.updateRequest = this.updateRequest.bind(this);
this.getString = this.getString.bind(this);
this._onNetworkEvent = this._onNetworkEvent.bind(this);
this._onNetworkEventUpdate = this._onNetworkEventUpdate.bind(this);
this._onDocLoadingMarker = this._onDocLoadingMarker.bind(this);
@ -512,7 +515,7 @@ NetworkEventsHandler.prototype = {
let request = getRequestById(gStore.getState(), action.id);
if (requestHeaders && requestHeaders.headers && requestHeaders.headers.length) {
let headers = await fetchHeaders(requestHeaders, this.getString);
let headers = await fetchHeaders(requestHeaders, getLongString);
if (headers) {
await gStore.dispatch(Actions.updateRequest(
action.id,
@ -523,7 +526,7 @@ NetworkEventsHandler.prototype = {
}
if (responseHeaders && responseHeaders.headers && responseHeaders.headers.length) {
let headers = await fetchHeaders(responseHeaders, this.getString);
let headers = await fetchHeaders(responseHeaders, getLongString);
if (headers) {
await gStore.dispatch(Actions.updateRequest(
action.id,
@ -536,7 +539,7 @@ NetworkEventsHandler.prototype = {
if (request && responseContent && responseContent.content) {
let { mimeType } = request;
let { text, encoding } = responseContent.content;
let response = await this.getString(text);
let response = await getLongString(text);
let payload = {};
if (mimeType.includes("image/")) {
@ -557,7 +560,7 @@ NetworkEventsHandler.prototype = {
// them as a separate property, different from the classic headers.
if (requestPostData && requestPostData.postData) {
let { text } = requestPostData.postData;
let postData = await this.getString(text);
let postData = await getLongString(text);
const headers = CurlUtils.getHeadersFromMultipartText(postData);
const headersSize = headers.reduce((acc, { name, value }) => {
return acc + name.length + value.length + 2;
@ -582,7 +585,7 @@ NetworkEventsHandler.prototype = {
if (typeof cookies[Symbol.iterator] === "function") {
for (let cookie of cookies) {
reqCookies.push(Object.assign({}, cookie, {
value: await this.getString(cookie.value),
value: await getLongString(cookie.value),
}));
}
if (reqCookies.length) {
@ -603,7 +606,7 @@ NetworkEventsHandler.prototype = {
if (typeof cookies[Symbol.iterator] === "function") {
for (let cookie of cookies) {
resCookies.push(Object.assign({}, cookie, {
value: await this.getString(cookie.value),
value: await getLongString(cookie.value),
}));
}
if (resCookies.length) {
@ -800,35 +803,7 @@ NetworkEventsHandler.prototype = {
}).then(() => {
window.emit(EVENTS.RECEIVED_EVENT_TIMINGS, response.from);
});
},
/**
* Fetches the full text of a LongString.
*
* @param object | string stringGrip
* The long string grip containing the corresponding actor.
* If you pass in a plain string (by accident or because you're lazy),
* then a promise of the same string is simply returned.
* @return object Promise
* A promise that is resolved when the full string contents
* are available, or rejected if something goes wrong.
*/
getString: function (stringGrip) {
// FIXME: this.webConsoleClient will be undefined in mochitest,
// so we return string instantly to skip undefined error
if (typeof stringGrip === "string") {
return Promise.resolve(stringGrip);
}
return this.webConsoleClient.getString(stringGrip);
}
};
/**
* Preliminary setup for the NetMonitorController object.
*/
NetMonitorController.NetworkEventsHandler = new NetworkEventsHandler();
window.NetMonitorController = NetMonitorController;
window.gNetwork = NetMonitorController.NetworkEventsHandler;
exports.NetMonitorController = NetMonitorController;

Просмотреть файл

@ -11,6 +11,7 @@ const Menu = require("devtools/client/framework/menu");
const MenuItem = require("devtools/client/framework/menu-item");
const clipboardHelper = require("devtools/shared/platform/clipboard");
const { HarExporter } = require("./har/har-exporter");
const { getLongString } = require("./utils/client");
const { L10N } = require("./utils/l10n");
const {
formDataURI,
@ -146,7 +147,8 @@ RequestListContextMenu.prototype = {
menu.append(new MenuItem({
type: "separator",
visible: !!selectedRequest,
visible: !!(window.NetMonitorController.supportsCustomRequest &&
selectedRequest && !selectedRequest.isCustom),
}));
menu.append(new MenuItem({
@ -221,7 +223,7 @@ RequestListContextMenu.prototype = {
selected.requestHeaders,
selected.requestHeadersFromUploadStream,
selected.requestPostData,
window.gNetwork.getString.bind(window.gNetwork));
getLongString);
let params = [];
formDataSections.forEach(section => {
@ -238,7 +240,7 @@ RequestListContextMenu.prototype = {
// Fall back to raw payload.
if (!string) {
let postData = selected.requestPostData.postData.text;
string = await window.gNetwork.getString(postData);
string = await getLongString(postData);
if (Services.appinfo.OS !== "WINNT") {
string = string.replace(/\r/g, "");
}
@ -264,14 +266,14 @@ RequestListContextMenu.prototype = {
// Fetch header values.
for (let { name, value } of selected.requestHeaders.headers) {
let text = await window.gNetwork.getString(value);
let text = await getLongString(value);
data.headers.push({ name: name, value: text });
}
// Fetch the request payload.
if (selected.requestPostData) {
let postData = selected.requestPostData.postData.text;
data.postDataText = await window.gNetwork.getString(postData);
data.postDataText = await getLongString(postData);
}
clipboardHelper.copyString(Curl.generateCommand(data));
@ -305,7 +307,7 @@ RequestListContextMenu.prototype = {
copyImageAsDataUri() {
const { mimeType, text, encoding } = this.selectedRequest.responseContent.content;
window.gNetwork.getString(text).then(string => {
getLongString(text).then(string => {
let data = formDataURI(mimeType, encoding, string);
clipboardHelper.copyString(data);
});
@ -317,7 +319,7 @@ RequestListContextMenu.prototype = {
copyResponse() {
const { text } = this.selectedRequest.responseContent.content;
window.gNetwork.getString(text).then(string => {
getLongString(text).then(string => {
clipboardHelper.copyString(string);
});
},
@ -341,7 +343,7 @@ RequestListContextMenu.prototype = {
let title = form.title || form.url;
return {
getString: window.gNetwork.getString.bind(window.gNetwork),
getString: getLongString,
items: this.sortedRequests,
title: title
};

Просмотреть файл

@ -8,6 +8,7 @@ const {
setImageTooltip,
getImageDimensions,
} = require("devtools/client/shared/widgets/tooltip/ImageTooltipHelper");
const { getLongString } = require("./utils/client");
const { WEBCONSOLE_L10N } = require("./utils/l10n");
const { formDataURI } = require("./utils/request-utils");
@ -23,7 +24,7 @@ async function setTooltipImageContent(tooltip, itemEl, requestItem) {
return false;
}
let string = await window.gNetwork.getString(text);
let string = await getLongString(text);
let src = formDataURI(mimeType, encoding, string);
let maxDim = REQUESTS_TOOLTIP_IMAGE_MAX_DIM;
let { naturalWidth, naturalHeight } = await getImageDimensions(tooltip.doc, src);

Просмотреть файл

@ -13,9 +13,10 @@ add_task(function* () {
let { tab, monitor } = yield initNetMonitor(CURL_UTILS_URL);
info("Starting test... ");
let { gStore, windowRequire, gNetwork } = monitor.panelWin;
let { gStore, windowRequire } = monitor.panelWin;
let Actions = windowRequire("devtools/client/netmonitor/actions/index");
let { getSortedRequests } = windowRequire("devtools/client/netmonitor/selectors/index");
let { getLongString } = windowRequire("devtools/client/netmonitor/utils/client");
gStore.dispatch(Actions.batchEnable(false));
@ -32,20 +33,20 @@ add_task(function* () {
multipartForm: getSortedRequests(gStore.getState()).get(3),
};
let data = yield createCurlData(requests.get, gNetwork);
let data = yield createCurlData(requests.get, getLongString);
testFindHeader(data);
data = yield createCurlData(requests.post, gNetwork);
data = yield createCurlData(requests.post, getLongString);
testIsUrlEncodedRequest(data);
testWritePostDataTextParams(data);
data = yield createCurlData(requests.multipart, gNetwork);
data = yield createCurlData(requests.multipart, getLongString);
testIsMultipartRequest(data);
testGetMultipartBoundary(data);
testMultiPartHeaders(data);
testRemoveBinaryDataFromMultipartText(data);
data = yield createCurlData(requests.multipartForm, gNetwork);
data = yield createCurlData(requests.multipartForm, getLongString);
testMultiPartHeaders(data);
testGetHeadersFromMultipartText({
@ -214,7 +215,7 @@ function testEscapeStringWin() {
"Newlines should be escaped.");
}
function* createCurlData(selected, network, controller) {
function* createCurlData(selected, getLongString) {
let { url, method, httpVersion } = selected;
// Create a sanitized object for the Curl command generator.
@ -228,14 +229,14 @@ function* createCurlData(selected, network, controller) {
// Fetch header values.
for (let { name, value } of selected.requestHeaders.headers) {
let text = yield network.getString(value);
let text = yield getLongString(value);
data.headers.push({ name: name, value: text });
}
// Fetch the request payload.
if (selected.requestPostData) {
let postData = selected.requestPostData.postData.text;
data.postDataText = yield network.getString(postData);
data.postDataText = yield getLongString(postData);
}
return data;

Просмотреть файл

@ -10,6 +10,8 @@ const Services = require("Services");
const Actions = require("../actions/index");
const { EVENTS } = require("../constants");
let activeConsole;
/**
* Called for each location change in the monitored tab.
*
@ -45,6 +47,7 @@ function willNavigate(type) {
* @param {Object} tabTarget
*/
function onFirefoxConnect(tabTarget) {
activeConsole = tabTarget.activeConsole;
tabTarget.on("navigate", navigated);
tabTarget.on("will-navigate", willNavigate);
}
@ -55,11 +58,44 @@ function onFirefoxConnect(tabTarget) {
* @param {Object} tabTarget
*/
function onFirefoxDisconnect(tabTarget) {
activeConsole = null;
tabTarget.off("navigate", navigated);
tabTarget.off("will-navigate", willNavigate);
}
/**
* Retrieve webconsole object
*
* @returns {Object} webConsole
*/
function getWebConsoleClient() {
return activeConsole;
}
/**
* Fetches the full text of a LongString.
*
* @param object | string stringGrip
* The long string grip containing the corresponding actor.
* If you pass in a plain string (by accident or because you're lazy),
* then a promise of the same string is simply returned.
* @return object Promise
* A promise that is resolved when the full string contents
* are available, or rejected if something goes wrong.
*/
function getLongString(stringGrip) {
// FIXME: this.webConsoleClient will be undefined in mochitest,
// so we return string instantly to skip undefined error
if (typeof stringGrip === "string") {
return Promise.resolve(stringGrip);
}
return activeConsole.getString(stringGrip);
}
module.exports = {
getLongString,
getWebConsoleClient,
onFirefoxConnect,
onFirefoxDisconnect,
};

Просмотреть файл

@ -13,10 +13,9 @@
* @param {object} headers - the "requestHeaders".
* @param {object} uploadHeaders - the "requestHeadersFromUploadStream".
* @param {object} postData - the "requestPostData".
* @param {function} getString - callback to retrieve a string from a LongStringGrip.
* @return {array} a promise list that is resolved with the extracted form data.
*/
async function getFormDataSections(headers, uploadHeaders, postData, getString) {
async function getFormDataSections(headers, uploadHeaders, postData, getLongString) {
let formDataSections = [];
let requestHeaders = headers.headers;
@ -29,11 +28,11 @@ async function getFormDataSections(headers, uploadHeaders, postData, getString)
let contentTypeLongString = contentTypeHeader ? contentTypeHeader.value : "";
let contentType = await getString(contentTypeLongString);
let contentType = await getLongString(contentTypeLongString);
if (contentType.includes("x-www-form-urlencoded")) {
let postDataLongString = postData.postData.text;
let text = await getString(postDataLongString);
let text = await getLongString(postDataLongString);
for (let section of text.split(/\r\n|\r|\n/)) {
// Before displaying it, make sure this section of the POST data
@ -51,12 +50,11 @@ async function getFormDataSections(headers, uploadHeaders, postData, getString)
* Fetch headers full content from actor server
*
* @param {object} headers - a object presents headers data
* @param {function} getString - callback to retrieve a string from a LongStringGrip
* @return {object} a headers object with updated content payload
*/
async function fetchHeaders(headers, getString) {
async function fetchHeaders(headers, getLongString) {
for (let { value } of headers.headers) {
headers.headers.value = await getString(value);
headers.headers.value = await getLongString(value);
}
return headers;
}

Просмотреть файл

@ -301,9 +301,16 @@ pref("devtools.webconsole.new-frontend-enabled", true);
pref("devtools.webconsole.new-frontend-enabled", false);
#endif
// Enable the experimental support for source maps in console (work in progress)
// Enable the server-side mapping service for source maps in console (deprecated)
// NOTE: This approach to source maps uses server-side source maps, which we are
// replacing with client-side source maps. Do not use this in new code paths.
// To be removed in bug 1349354. Read more about ongoing work with source maps:
// https://docs.google.com/document/d/19TKnMJD3CMBzwByNE4aBBVWnl-AEan8Sf4hxi6J-eps/edit
pref("devtools.source-map.locations.enabled", false);
// Enable client-side mapping service for source maps
pref("devtools.source-map.client-service.enabled", true);
// The number of lines that are displayed in the web console.
pref("devtools.hud.loglimit", 1000);

Просмотреть файл

@ -17,8 +17,9 @@ const BROWSER_BASED_DIRS = [
"resource://devtools/client/inspector/grids",
"resource://devtools/client/inspector/layout",
"resource://devtools/client/jsonview",
"resource://devtools/client/shared/vendor",
"resource://devtools/client/shared/source-map",
"resource://devtools/client/shared/redux",
"resource://devtools/client/shared/vendor",
];
const COMMON_LIBRARY_DIRS = [

Просмотреть файл

@ -85,7 +85,8 @@ NewConsoleOutputWrapper.prototype = {
return panel.panelWin.NetMonitorController.inspectRequest(requestId);
});
},
sourceMapService: this.toolbox ? this.toolbox._sourceMapService : null,
sourceMapService:
this.toolbox ? this.toolbox._deprecatedServerSourceMapService : null,
openLink: url => this.jsterm.hud.owner.openLink(url),
createElement: nodename => {
return this.document.createElementNS("http://www.w3.org/1999/xhtml", nodename);

Просмотреть файл

@ -2624,7 +2624,7 @@ WebConsoleFrame.prototype = {
frame: { source, line, column },
showEmptyPathAsHost: true,
onClick,
sourceMapService: toolbox ? toolbox._sourceMapService : null,
sourceMapService: toolbox ? toolbox._deprecatedServerSourceMapService : null,
}), locationNode);
return locationNode;

Просмотреть файл

@ -5,7 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files('*'):
BUG_COMPONENT = ('Core', 'Video/Audio: Recording')
BUG_COMPONENT = ('Core', 'Audio/Video: Recording')
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
DIRS += ['fmp4_muxer']

Просмотреть файл

@ -5,7 +5,6 @@
#include "nsFont.h"
#include "gfxFont.h" // for gfxFontStyle
#include "gfxFontConstants.h" // for NS_FONT_KERNING_AUTO, etc
#include "gfxFontFeatures.h" // for gfxFontFeature, etc
#include "gfxFontUtils.h" // for TRUETYPE_TAG
#include "nsCRT.h" // for nsCRT
@ -20,37 +19,14 @@ using namespace mozilla;
nsFont::nsFont(const FontFamilyList& aFontlist, nscoord aSize)
: fontlist(aFontlist)
, size(aSize)
{
Init();
size = aSize;
}
nsFont::nsFont(FontFamilyType aGenericType, nscoord aSize)
: fontlist(aGenericType)
, size(aSize)
{
Init();
size = aSize;
}
void
nsFont::Init()
{
style = NS_FONT_STYLE_NORMAL;
weight = NS_FONT_WEIGHT_NORMAL;
stretch = NS_FONT_STRETCH_NORMAL;
systemFont = false;
smoothing = NS_FONT_SMOOTHING_AUTO;
sizeAdjust = -1.0f;
kerning = NS_FONT_KERNING_AUTO;
synthesis = NS_FONT_SYNTHESIS_WEIGHT | NS_FONT_SYNTHESIS_STYLE;
variantAlternates = 0;
variantCaps = NS_FONT_VARIANT_CAPS_NORMAL;
variantEastAsian = 0;
variantLigatures = 0;
variantNumeric = 0;
variantPosition = NS_FONT_VARIANT_POSITION_NORMAL;
variantWidth = NS_FONT_VARIANT_WIDTH_NORMAL;
}
nsFont::nsFont(const nsFont& aOther) = default;

Просмотреть файл

@ -9,6 +9,7 @@
#include <stdint.h> // for uint8_t, uint16_t
#include <sys/types.h> // for int16_t
#include "gfxFontFamilyList.h"
#include "gfxFontConstants.h" // for NS_FONT_KERNING_AUTO, etc
#include "gfxFontFeatures.h"
#include "gfxFontVariations.h"
#include "mozilla/RefPtr.h" // for RefPtr
@ -46,52 +47,52 @@ struct nsFont {
mozilla::FontFamilyList fontlist;
// The style of font (normal, italic, oblique; see gfxFontConstants.h)
uint8_t style;
uint8_t style = NS_FONT_STYLE_NORMAL;
// Force this font to not be considered a 'generic' font, even if
// the name is the same as a CSS generic font family.
bool systemFont;
bool systemFont = false;
// Variant subproperties
uint8_t variantCaps;
uint8_t variantNumeric;
uint8_t variantPosition;
uint8_t variantWidth;
uint8_t variantCaps = NS_FONT_VARIANT_CAPS_NORMAL;
uint8_t variantNumeric = 0;
uint8_t variantPosition = NS_FONT_VARIANT_POSITION_NORMAL;
uint8_t variantWidth = NS_FONT_VARIANT_WIDTH_NORMAL;
uint16_t variantLigatures;
uint16_t variantEastAsian;
uint16_t variantLigatures = 0;
uint16_t variantEastAsian = 0;
// Some font-variant-alternates property values require
// font-specific settings defined via @font-feature-values rules.
// These are resolved *after* font matching occurs.
// -- bitmask for both enumerated and functional propvals
uint16_t variantAlternates;
uint16_t variantAlternates = 0;
// Smoothing - controls subpixel-antialiasing (currently OSX only)
uint8_t smoothing;
uint8_t smoothing = NS_FONT_SMOOTHING_AUTO;
// The weight of the font; see gfxFontConstants.h.
uint16_t weight;
uint16_t weight = NS_FONT_WEIGHT_NORMAL;
// The stretch of the font (the sum of various NS_FONT_STRETCH_*
// constants; see gfxFontConstants.h).
int16_t stretch;
int16_t stretch = NS_FONT_STRETCH_NORMAL;
// Kerning
uint8_t kerning;
uint8_t kerning = NS_FONT_KERNING_AUTO;
// Synthesis setting, controls use of fake bolding/italics
uint8_t synthesis;
uint8_t synthesis = NS_FONT_SYNTHESIS_WEIGHT | NS_FONT_SYNTHESIS_STYLE;
// The logical size of the font, in nscoord units
nscoord size;
nscoord size = 0;
// The aspect-value (ie., the ratio actualsize:actualxheight) that any
// actual physical font created from this font structure must have when
// rendering or measuring a string. A value of -1.0 means no adjustment
// needs to be done; otherwise the value must be nonnegative.
float sizeAdjust;
float sizeAdjust = -1.0f;
// -- list of value tags for font-specific alternate features
nsTArray<gfxAlternateValue> alternateValues;
@ -108,7 +109,7 @@ struct nsFont {
// Language system tag, to override document language;
// this is an OpenType "language system" tag represented as a 32-bit integer
// (see http://www.microsoft.com/typography/otspec/languagetags.htm).
nsString languageOverride;
uint32_t languageOverride = 0;
// initialize the font with a fontlist
nsFont(const mozilla::FontFamilyList& aFontlist, nscoord aSize);
@ -142,9 +143,6 @@ struct nsFont {
void AddFontFeaturesToStyle(gfxFontStyle *aStyle) const;
void AddFontVariationsToStyle(gfxFontStyle *aStyle) const;
protected:
void Init(); // helper method for initialization
};
#define NS_FONT_VARIANT_NORMAL 0

Просмотреть файл

@ -3862,29 +3862,8 @@ gfxFont::RemoveGlyphChangeObserver(GlyphChangeObserver *aObserver)
mGlyphChangeObservers->RemoveEntry(aObserver);
}
#define DEFAULT_PIXEL_FONT_SIZE 16.0f
/*static*/ uint32_t
gfxFontStyle::ParseFontLanguageOverride(const nsString& aLangTag)
{
if (!aLangTag.Length() || aLangTag.Length() > 4) {
return NO_FONT_LANGUAGE_OVERRIDE;
}
uint32_t index, result = 0;
for (index = 0; index < aLangTag.Length(); ++index) {
char16_t ch = aLangTag[index];
if (!nsCRT::IsAscii(ch)) { // valid tags are pure ASCII
return NO_FONT_LANGUAGE_OVERRIDE;
}
result = (result << 8) + ch;
}
while (index++ < 4) {
result = (result << 8) + 0x20;
}
return result;
}
gfxFontStyle::gfxFontStyle() :
language(nsGkAtoms::x_western),
size(DEFAULT_PIXEL_FONT_SIZE), sizeAdjust(-1.0f), baselineOffset(0.0f),
@ -3907,10 +3886,10 @@ gfxFontStyle::gfxFontStyle(uint8_t aStyle, uint16_t aWeight, int16_t aStretch,
bool aPrinterFont,
bool aAllowWeightSynthesis,
bool aAllowStyleSynthesis,
const nsString& aLanguageOverride):
uint32_t aLanguageOverride):
language(aLanguage),
size(aSize), sizeAdjust(aSizeAdjust), baselineOffset(0.0f),
languageOverride(ParseFontLanguageOverride(aLanguageOverride)),
languageOverride(aLanguageOverride),
weight(aWeight), stretch(aStretch),
style(aStyle),
variantCaps(NS_FONT_VARIANT_CAPS_NORMAL),

Просмотреть файл

@ -81,7 +81,7 @@ struct gfxFontStyle {
float aSizeAdjust, bool aSystemFont,
bool aPrinterFont,
bool aWeightSynthesis, bool aStyleSynthesis,
const nsString& aLanguageOverride);
uint32_t aLanguageOverride);
// the language (may be an internal langGroup code rather than an actual
// language code) specified in the document or element's lang property,
@ -216,8 +216,6 @@ struct gfxFontStyle {
(variationSettings == other.variationSettings) &&
(languageOverride == other.languageOverride);
}
static uint32_t ParseFontLanguageOverride(const nsString& aLangTag);
};
struct gfxTextRange {

Просмотреть файл

@ -206,7 +206,7 @@ public:
// weight - [100, 900] (multiples of 100)
// stretch = [NS_FONT_STRETCH_ULTRA_CONDENSED, NS_FONT_STRETCH_ULTRA_EXPANDED]
// italic style = constants in gfxFontConstants.h, e.g. NS_FONT_STYLE_NORMAL
// language override = result of calling gfxFontStyle::ParseFontLanguageOverride
// language override = result of calling nsRuleNode::ParseFontLanguageOverride
// TODO: support for unicode ranges not yet implemented
virtual already_AddRefed<gfxUserFontEntry> CreateUserFontEntry(
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,

Просмотреть файл

@ -4150,7 +4150,8 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
ExprAddrOf(ExprVar(p.var().name + 'Copy')),
msgexpr, ExprAddrOf(itervar),
errfn, p.bareType(side).name,
p.name)
sentinelKey=p.name,
errfnSentinel=errfnSentinel())
for p in params ]
+ [ self.endRead(msgvar, itervar) ]
# Move the message back to its source before sending.

Просмотреть файл

@ -1859,6 +1859,8 @@ PresShell::Initialize(nscoord aWidth, nscoord aHeight)
Preferences::GetInt("nglayout.initialpaint.delay",
PAINTLOCK_EVENT_DELAY);
mPaintSuppressionTimer->SetTarget(
mDocument->EventTargetFor(TaskCategory::Other));
mPaintSuppressionTimer->InitWithNamedFuncCallback(
sPaintSuppressionCallback, this, delay, nsITimer::TYPE_ONE_SHOT,
"PresShell::sPaintSuppressionCallback");
@ -2005,16 +2007,21 @@ PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight, nscoord a
}
if (mAsyncResizeEventTimer) {
mAsyncResizeTimerIsActive = true;
mAsyncResizeEventTimer->InitWithFuncCallback(AsyncResizeEventCallback,
this, 15,
nsITimer::TYPE_ONE_SHOT);
mAsyncResizeEventTimer->SetTarget(
mDocument->EventTargetFor(TaskCategory::Other));
mAsyncResizeEventTimer->InitWithNamedFuncCallback(AsyncResizeEventCallback,
this, 15,
nsITimer::TYPE_ONE_SHOT,
"AsyncResizeEventCallback");
}
} else {
RefPtr<nsRunnableMethod<PresShell> > resizeEvent =
NewRunnableMethod("PresShell::FireResizeEvent",
this, &PresShell::FireResizeEvent);
if (NS_SUCCEEDED(NS_DispatchToCurrentThread(resizeEvent))) {
mResizeEvent = resizeEvent;
RefPtr<nsRunnableMethod<PresShell>> event =
NewRunnableMethod(this, &PresShell::FireResizeEvent);
nsresult rv = mDocument->Dispatch("PresShell::FireResizeEvent",
TaskCategory::Other,
do_AddRef(event));
if (NS_SUCCEEDED(rv)) {
mResizeEvent = event;
SetNeedStyleFlush();
}
}
@ -3687,28 +3694,6 @@ PresShell::GetRectVisibility(nsIFrame* aFrame,
return nsRectVisibility_kVisible;
}
class PaintTimerCallBack final : public nsITimerCallback
{
public:
explicit PaintTimerCallBack(PresShell* aShell) : mShell(aShell) {}
NS_DECL_ISUPPORTS
NS_IMETHOD Notify(nsITimer* aTimer) final
{
mShell->SetNextPaintCompressed();
mShell->ScheduleViewManagerFlush();
return NS_OK;
}
private:
~PaintTimerCallBack() {}
PresShell* mShell;
};
NS_IMPL_ISUPPORTS(PaintTimerCallBack, nsITimerCallback)
void
PresShell::ScheduleViewManagerFlush(PaintType aType)
{
@ -3716,9 +3701,24 @@ PresShell::ScheduleViewManagerFlush(PaintType aType)
// Delay paint for 1 second.
static const uint32_t kPaintDelayPeriod = 1000;
if (!mDelayedPaintTimer) {
nsTimerCallbackFunc
PaintTimerCallBack = [](nsITimer* aTimer, void* aClosure) {
// The passed-in PresShell is always alive here. Because if PresShell
// died, mDelayedPaintTimer->Cancel() would be called during the
// destruction and this callback would never be invoked.
auto self = static_cast<PresShell*>(aClosure);
self->SetNextPaintCompressed();
self->ScheduleViewManagerFlush();
};
mDelayedPaintTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
RefPtr<PaintTimerCallBack> cb = new PaintTimerCallBack(this);
mDelayedPaintTimer->InitWithCallback(cb, kPaintDelayPeriod, nsITimer::TYPE_ONE_SHOT);
mDelayedPaintTimer->SetTarget(
mDocument->EventTargetFor(TaskCategory::Other));
mDelayedPaintTimer->InitWithNamedFuncCallback(PaintTimerCallBack,
this,
kPaintDelayPeriod,
nsITimer::TYPE_ONE_SHOT,
"PaintTimerCallBack");
}
return;
}
@ -6256,11 +6256,15 @@ PresShell::ScheduleApproximateFrameVisibilityUpdateNow()
return;
}
RefPtr<nsRunnableMethod<PresShell> > ev =
NewRunnableMethod("PresShell::UpdateApproximateFrameVisibility",
this, &PresShell::UpdateApproximateFrameVisibility);
if (NS_SUCCEEDED(NS_DispatchToCurrentThread(ev))) {
mUpdateApproximateFrameVisibilityEvent = ev;
RefPtr<nsRunnableMethod<PresShell>> event =
NewRunnableMethod(this, &PresShell::UpdateApproximateFrameVisibility);
nsresult rv =
mDocument->Dispatch("PresShell::UpdateApproximateFrameVisibility",
TaskCategory::Other,
do_AddRef(event));
if (NS_SUCCEEDED(rv)) {
mUpdateApproximateFrameVisibilityEvent = event;
}
}
@ -9170,10 +9174,13 @@ PresShell::ScheduleReflowOffTimer()
if (!mReflowContinueTimer) {
mReflowContinueTimer = do_CreateInstance("@mozilla.org/timer;1");
mReflowContinueTimer->SetTarget(
mDocument->EventTargetFor(TaskCategory::Other));
if (!mReflowContinueTimer ||
NS_FAILED(mReflowContinueTimer->
InitWithFuncCallback(sReflowContinueCallback, this, 30,
nsITimer::TYPE_ONE_SHOT))) {
InitWithNamedFuncCallback(sReflowContinueCallback, this, 30,
nsITimer::TYPE_ONE_SHOT,
"sReflowContinueCallback"))) {
return false;
}
}

Просмотреть файл

@ -158,8 +158,12 @@ ZoomConstraintsClient::Observe(nsISupports* aSubject, const char* aTopic, const
// We need to run this later because all the pref change listeners need
// to execute before we can be guaranteed that gfxPrefs::ForceUserScalable()
// returns the updated value.
NS_DispatchToMainThread(NewRunnableMethod(
this, &ZoomConstraintsClient::RefreshZoomConstraints));
RefPtr<nsRunnableMethod<ZoomConstraintsClient>> event =
NewRunnableMethod(this, &ZoomConstraintsClient::RefreshZoomConstraints);
mDocument->Dispatch("ZoomConstraintsClient::RefreshZoomConstraints",
TaskCategory::Other,
event.forget());
}
return NS_OK;
}

Просмотреть файл

@ -1741,7 +1741,7 @@ nsCSSFrameConstructor::CreateGeneratedContent(nsFrameConstructorState& aState,
case eStyleContentType_Counter:
case eStyleContentType_Counters: {
nsCSSValue::Array* counters = data.GetCounters();
nsCSSValue::ThreadSafeArray* counters = data.GetCounters();
nsCounterList* counterList = mCounterManager.CounterListFor(
nsDependentString(counters->Item(0).GetStringBufferValue()));

Просмотреть файл

@ -79,7 +79,7 @@ struct nsCounterUseNode : public nsCounterNode {
// The same structure passed through the style system: an array
// containing the values in the counter() or counters() in the order
// given in the CSS spec.
RefPtr<nsCSSValue::Array> mCounterFunction;
RefPtr<nsCSSValue::ThreadSafeArray> mCounterFunction;
nsPresContext* mPresContext;
RefPtr<mozilla::CounterStyle> mCounterStyle;
@ -89,7 +89,7 @@ struct nsCounterUseNode : public nsCounterNode {
// args go directly to member variables here and of nsGenConNode
nsCounterUseNode(nsPresContext* aPresContext,
nsCSSValue::Array* aCounterFunction,
nsCSSValue::ThreadSafeArray* aCounterFunction,
uint32_t aContentIndex, bool aAllCounters)
: nsCounterNode(aContentIndex, USE)
, mCounterFunction(aCounterFunction)

Просмотреть файл

@ -2135,7 +2135,11 @@ nsDocumentViewer::Show(void)
// Notify observers that a new page has been shown. This will get run
// from the event loop after we actually draw the page.
NS_DispatchToMainThread(new nsDocumentShownDispatcher(mDocument));
RefPtr<nsDocumentShownDispatcher> event =
new nsDocumentShownDispatcher(mDocument);
mDocument->Dispatch("nsDocumentShownDispatcher",
TaskCategory::Other,
event.forget());
return NS_OK;
}
@ -4627,4 +4631,3 @@ nsDocumentShownDispatcher::Run()
}
return NS_OK;
}

Просмотреть файл

@ -1086,7 +1086,9 @@ nsPresContext::Observe(nsISupports* aSubject,
if (!nsCRT::strcmp(aTopic, "charset")) {
RefPtr<CharSetChangingRunnable> runnable =
new CharSetChangingRunnable(this, NS_LossyConvertUTF16toASCII(aData));
return NS_DispatchToCurrentThread(runnable);
return Document()->Dispatch("CharSetChangingRunnable",
TaskCategory::Other,
runnable.forget());
}
NS_WARNING("unrecognized topic in nsPresContext::Observe");
@ -1743,7 +1745,10 @@ nsPresContext::ThemeChanged()
nsCOMPtr<nsIRunnable> ev =
NewRunnableMethod(this, &nsPresContext::ThemeChangedInternal);
if (NS_SUCCEEDED(NS_DispatchToCurrentThread(ev))) {
nsresult rv = Document()->Dispatch("nsPresContext::ThemeChangedInternal",
TaskCategory::Other,
ev.forget());
if (NS_SUCCEEDED(rv)) {
mPendingThemeChanged = true;
}
}
@ -1803,7 +1808,10 @@ nsPresContext::SysColorChanged()
sLookAndFeelChanged = true;
nsCOMPtr<nsIRunnable> ev =
NewRunnableMethod(this, &nsPresContext::SysColorChangedInternal);
if (NS_SUCCEEDED(NS_DispatchToCurrentThread(ev))) {
nsresult rv = Document()->Dispatch("nsPresContext::SysColorChangedInternal",
TaskCategory::Other,
ev.forget());
if (NS_SUCCEEDED(rv)) {
mPendingSysColorChanged = true;
}
}
@ -1835,7 +1843,11 @@ nsPresContext::UIResolutionChanged()
if (!mPendingUIResolutionChanged) {
nsCOMPtr<nsIRunnable> ev =
NewRunnableMethod(this, &nsPresContext::UIResolutionChangedInternal);
if (NS_SUCCEEDED(NS_DispatchToCurrentThread(ev))) {
nsresult rv =
Document()->Dispatch("nsPresContext::UIResolutionChangedInternal",
TaskCategory::Other,
ev.forget());
if (NS_SUCCEEDED(rv)) {
mPendingUIResolutionChanged = true;
}
}
@ -2091,7 +2103,11 @@ nsPresContext::PostMediaFeatureValuesChangedEvent()
nsCOMPtr<nsIRunnable> ev =
NewRunnableMethod("nsPresContext::HandleMediaFeatureValuesChangedEvent",
this, &nsPresContext::HandleMediaFeatureValuesChangedEvent);
if (NS_SUCCEEDED(NS_DispatchToCurrentThread(ev))) {
nsresult rv =
Document()->Dispatch("nsPresContext::HandleMediaFeatureValuesChangedEvent",
TaskCategory::Other,
ev.forget());
if (NS_SUCCEEDED(rv)) {
mPendingMediaFeatureValuesChanged = true;
mShell->SetNeedStyleFlush();
}
@ -2277,7 +2293,11 @@ nsPresContext::RebuildCounterStyles()
nsCOMPtr<nsIRunnable> ev =
NewRunnableMethod("nsPresContext::HandleRebuildCounterStyles",
this, &nsPresContext::HandleRebuildCounterStyles);
if (NS_SUCCEEDED(NS_DispatchToCurrentThread(ev))) {
nsresult rv =
Document()->Dispatch("nsPresContext::HandleRebuildCounterStyles",
TaskCategory::Other,
ev.forget());
if (NS_SUCCEEDED(rv)) {
mPostedFlushCounterStyles = true;
}
}
@ -2671,6 +2691,7 @@ nsPresContext::CreateTimer(nsTimerCallbackFunc aCallback,
uint32_t aDelay)
{
nsCOMPtr<nsITimer> timer = do_CreateInstance("@mozilla.org/timer;1");
timer->SetTarget(Document()->EventTargetFor(TaskCategory::Other));
if (timer) {
nsresult rv = timer->InitWithNamedFuncCallback(aCallback, this, aDelay,
nsITimer::TYPE_ONE_SHOT,
@ -3263,12 +3284,14 @@ nsRootPresContext::EnsureEventualDidPaintEvent(uint64_t aTransactionId)
}
nsCOMPtr<nsITimer> timer = do_CreateInstance("@mozilla.org/timer;1");
timer->SetTarget(Document()->EventTargetFor(TaskCategory::Other));
if (timer) {
RefPtr<nsRootPresContext> self = this;
nsresult rv = timer->InitWithCallback(NewTimerCallback([self, aTransactionId](){
nsAutoScriptBlocker blockScripts;
self->NotifyDidPaintForSubtree(aTransactionId);
}), 100, nsITimer::TYPE_ONE_SHOT);
nsresult rv = timer->InitWithCallback(
NewNamedTimerCallback([self, aTransactionId](){
nsAutoScriptBlocker blockScripts;
self->NotifyDidPaintForSubtree(aTransactionId);
}, "NotifyDidPaintForSubtree"), 100, nsITimer::TYPE_ONE_SHOT);
if (NS_SUCCEEDED(rv)) {
NotifyDidPaintTimer* t = mNotifyDidPaintTimers.AppendElement();
@ -3306,7 +3329,9 @@ nsRootPresContext::AddWillPaintObserver(nsIRunnable* aRunnable)
{
if (!mWillPaintFallbackEvent.IsPending()) {
mWillPaintFallbackEvent = new RunWillPaintObservers(this);
NS_DispatchToMainThread(mWillPaintFallbackEvent.get());
Document()->Dispatch("RunWillPaintObservers",
TaskCategory::Other,
do_AddRef(mWillPaintFallbackEvent.get()));
}
mWillPaintObservers.AppendElement(aRunnable);
}

Просмотреть файл

@ -1437,11 +1437,17 @@ nsRefreshDriver::SetHighPrecisionTimersEnabled(bool aEnable)
nsCOMPtr<nsITimer> timer = do_CreateInstance(NS_TIMER_CONTRACTID);
if (timer) {
if (nsPresContext* pc = GetPresContext()) {
timer->SetTarget(
pc->Document()->EventTargetFor(TaskCategory::Other));
}
timer.forget(&sDisableHighPrecisionTimersTimer);
sDisableHighPrecisionTimersTimer->InitWithFuncCallback(DisableHighPrecisionTimersCallback,
nullptr,
90 * 1000,
nsITimer::TYPE_ONE_SHOT);
sDisableHighPrecisionTimersTimer->
InitWithNamedFuncCallback(DisableHighPrecisionTimersCallback,
nullptr,
90 * 1000,
nsITimer::TYPE_ONE_SHOT,
"DisableHighPrecisionTimersCallback");
} else {
// might happen if we're shutting down XPCOM; just drop the time period down
// immediately
@ -2111,8 +2117,17 @@ nsRefreshDriver::Thaw()
// updates our mMostRecentRefresh, but the DoRefresh call won't run
// and notify our observers until we get back to the event loop.
// Thus MostRecentRefresh() will lie between now and the DoRefresh.
NS_DispatchToCurrentThread(NewRunnableMethod(this, &nsRefreshDriver::DoRefresh));
EnsureTimerStarted();
RefPtr<nsRunnableMethod<nsRefreshDriver>> event =
NewRunnableMethod(this, &nsRefreshDriver::DoRefresh);
nsPresContext* pc = GetPresContext();
if (pc) {
pc->Document()->Dispatch("nsRefreshDriver::DoRefresh",
TaskCategory::Other,
event.forget());
EnsureTimerStarted();
} else {
NS_ERROR("Thawing while document is being destroyed");
}
}
}
}

Просмотреть файл

@ -65,7 +65,7 @@ with Files('nsPluginFrame.*'):
BUG_COMPONENT = ('Core', 'Plug-ins')
with Files('nsVideoFrame.*'):
BUG_COMPONENT = ('Core', 'Video/Audio')
BUG_COMPONENT = ('Core', 'Audio/Video')
with Files('*Selection*'):
BUG_COMPONENT = ('Core', 'Selection')

Просмотреть файл

@ -5,7 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files('**'):
BUG_COMPONENT = ('Core', 'Video/Audio')
BUG_COMPONENT = ('Core', 'Audio/Video')
# media/webrtc/signaling/test/common.build uses the gkmedias library,
# expecting at least some of what it contains to be linked, but not libxul,

Просмотреть файл

@ -373,7 +373,7 @@ fails == 315920-7a.html 315920-7a.html
fails == 315920-7b.html 315920-7b.html
fails == 315920-7c.html 315920-7c.html
fails == 315920-8a.html 315920-8a.html
== 315920-8b.html 315920-8b.html
fails == 315920-8b.html 315920-8b.html # bug 1349909
fails == 315920-9.html 315920-9.html
== 315920-10.html 315920-10.html
fails == 315920-11.html 315920-11.html
@ -381,15 +381,15 @@ fails == 315920-12a.html 315920-12a.html
fails == 315920-12b.html 315920-12b.html
fails == 315920-12c.html 315920-12c.html
fails == 315920-13a.html 315920-13a.html
== 315920-13b.html 315920-13b.html
fails == 315920-13b.html 315920-13b.html # bug 1349909
fails == 315920-14.html 315920-14.html
== 315920-15.html 315920-15.html
fails == 315920-16.html 315920-16.html
fails == 315920-17.html 315920-17.html
skip-if(stylo) == 315920-18a.html 315920-18a.html # bug 1338982, which makes this timing-dependent
skip-if(stylo) == 315920-18b.html 315920-18b.html # bug 1338982, which makes this timing-dependent
skip-if(stylo) == 315920-18c.html 315920-18c.html # bug 1338982, which makes this timing-dependent
skip-if(stylo) == 315920-18d.html 315920-18d.html # bug 1338982, which makes this timing-dependent
== 315920-18a.html 315920-18a.html
== 315920-18b.html 315920-18b.html
== 315920-18c.html 315920-18c.html
== 315920-18d.html 315920-18d.html
fails == 315920-18e.html 315920-18e.html
fails == 315920-18f.html 315920-18f.html
fails == 315920-18g.html 315920-18g.html

Просмотреть файл

@ -91,10 +91,10 @@ fails == float-in-rtl-vrl-4d.html float-in-rtl-vrl-4d.html
fails == orthogonal-floats-1c.html orthogonal-floats-1c.html
fails == orthogonal-floats-1d.html orthogonal-floats-1d.html
fails pref(layout.css.float-logical-values.enabled,true) == logical-float-side-1.html logical-float-side-1.html
fails pref(layout.css.float-logical-values.enabled,true) == logical-float-side-2.html logical-float-side-2.html
fails pref(layout.css.float-logical-values.enabled,true) == logical-float-side-3.html logical-float-side-3.html
fails pref(layout.css.float-logical-values.enabled,true) == logical-float-side-4.html logical-float-side-4.html
pref(layout.css.float-logical-values.enabled,true) == logical-float-side-1.html logical-float-side-1.html
pref(layout.css.float-logical-values.enabled,true) == logical-float-side-2.html logical-float-side-2.html
pref(layout.css.float-logical-values.enabled,true) == logical-float-side-3.html logical-float-side-3.html
pref(layout.css.float-logical-values.enabled,true) == logical-float-side-4.html logical-float-side-4.html
fails == float-in-rtl-slr-1a.html float-in-rtl-slr-1a.html
fails == float-in-rtl-slr-1b.html float-in-rtl-slr-1b.html

Просмотреть файл

@ -210,7 +210,7 @@ with Files('native-theme/**'):
with Files('object/**'):
BUG_COMPONENT = ('Core', 'DOM')
with Files('ogg-video/**'):
BUG_COMPONENT = ('Core', 'Video/Audio')
BUG_COMPONENT = ('Core', 'Audio/Video')
with Files('outline/**'):
BUG_COMPONENT = ('Core', 'Layout')
with Files('pagination/**'):
@ -308,7 +308,7 @@ with Files('w3c-css/submitted/variables/**'):
with Files('webcomponents/**'):
BUG_COMPONENT = ('Core', 'DOM')
with Files('webm-video/**'):
BUG_COMPONENT = ('Core', 'Video/Audio')
BUG_COMPONENT = ('Core', 'Audio/Video')
with Files('writing-mode/**'):
BUG_COMPONENT = ('Core', 'Layout: Block and Inline')
with Files('xul/**'):

Просмотреть файл

@ -1042,7 +1042,7 @@ FontFaceSet::FindOrCreateUserFontEntryFromFontFace(const nsAString& aFamilyName,
} else if (unit == eCSSUnit_String) {
nsString stringValue;
val.GetStringValue(stringValue);
languageOverride = gfxFontStyle::ParseFontLanguageOverride(stringValue);
languageOverride = nsRuleNode::ParseFontLanguageOverride(stringValue);
} else {
NS_ASSERTION(unit == eCSSUnit_Null,
"@font-face font-language-override has unexpected unit");

Просмотреть файл

@ -958,7 +958,7 @@ void
Gecko_SetContentDataArray(nsStyleContentData* aContent,
nsStyleContentType aType, uint32_t aLen)
{
nsCSSValue::Array* arr = nsCSSValue::Array::Create(aLen);
nsCSSValue::ThreadSafeArray* arr = nsCSSValue::ThreadSafeArray::Create(aLen);
aContent->SetCounters(aType, arr);
}

Просмотреть файл

@ -8026,8 +8026,8 @@ CSSParserImpl::ParseCounter(nsCSSValue& aValue)
break;
}
RefPtr<nsCSSValue::Array> val =
nsCSSValue::Array::Create(unit == eCSSUnit_Counter ? 2 : 3);
RefPtr<nsCSSValue::ThreadSafeArray> val =
nsCSSValue::ThreadSafeArray::Create(unit == eCSSUnit_Counter ? 2 : 3);
val->Item(0).SetStringValue(mToken.mIdent, eCSSUnit_Ident);
@ -8058,7 +8058,7 @@ CSSParserImpl::ParseCounter(nsCSSValue& aValue)
break;
}
aValue.SetArrayValue(val, unit);
aValue.SetThreadSafeArrayValue(val, unit);
return true;
}

Просмотреть файл

@ -172,6 +172,10 @@ nsCSSValue::nsCSSValue(const nsCSSValue& aCopy)
mValue.mArray = aCopy.mValue.mArray;
mValue.mArray->AddRef();
}
else if (UnitHasThreadSafeArrayValue()) {
mValue.mThreadSafeArray = aCopy.mValue.mThreadSafeArray;
mValue.mThreadSafeArray->AddRef();
}
else if (eCSSUnit_URL == mUnit) {
mValue.mURL = aCopy.mValue.mURL;
mValue.mURL->AddRef();
@ -288,6 +292,9 @@ bool nsCSSValue::operator==(const nsCSSValue& aOther) const
else if (UnitHasArrayValue()) {
return *mValue.mArray == *aOther.mValue.mArray;
}
else if (UnitHasThreadSafeArrayValue()) {
return *mValue.mThreadSafeArray == *aOther.mValue.mThreadSafeArray;
}
else if (eCSSUnit_URL == mUnit) {
return mValue.mURL->Equals(*aOther.mValue.mURL);
}
@ -436,6 +443,9 @@ void nsCSSValue::DoReset()
DO_RELEASE(mComplexColor);
} else if (UnitHasArrayValue()) {
DO_RELEASE(mArray);
} else if (UnitHasThreadSafeArrayValue()) {
// ThreadSafe arrays are ok to release on any thread.
mValue.mThreadSafeArray->Release();
} else if (eCSSUnit_URL == mUnit) {
DO_RELEASE(mURL);
} else if (eCSSUnit_Image == mUnit) {
@ -571,6 +581,15 @@ void nsCSSValue::SetArrayValue(nsCSSValue::Array* aValue, nsCSSUnit aUnit)
mValue.mArray->AddRef();
}
void nsCSSValue::SetThreadSafeArrayValue(nsCSSValue::ThreadSafeArray* aValue, nsCSSUnit aUnit)
{
Reset();
mUnit = aUnit;
MOZ_ASSERT(UnitHasThreadSafeArrayValue(), "bad unit");
mValue.mThreadSafeArray = aValue;
mValue.mThreadSafeArray->AddRef();
}
void nsCSSValue::SetURLValue(mozilla::css::URLValue* aValue)
{
Reset();
@ -1339,10 +1358,29 @@ nsCSSValue::AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
nsStyleUtil::AppendEscapedCSSIdent(buffer, aResult);
}
}
else if (eCSSUnit_Array <= unit && unit <= eCSSUnit_Symbols) {
else if (eCSSUnit_Counter <= unit && unit <= eCSSUnit_Counters) {
switch (unit) {
case eCSSUnit_Counter: aResult.AppendLiteral("counter("); break;
case eCSSUnit_Counters: aResult.AppendLiteral("counters("); break;
default: MOZ_ASSERT_UNREACHABLE("bad enum");
}
nsCSSValue::ThreadSafeArray *array = GetThreadSafeArrayValue();
bool mark = false;
for (size_t i = 0, i_end = array->Count(); i < i_end; ++i) {
if (mark && array->Item(i).GetUnit() != eCSSUnit_Null) {
aResult.AppendLiteral(", ");
}
nsCSSPropertyID prop = (i == array->Count() - 1)
? eCSSProperty_list_style_type : aProperty;
if (array->Item(i).GetUnit() != eCSSUnit_Null) {
array->Item(i).AppendToString(prop, aResult, aSerialization);
mark = true;
}
}
}
else if (eCSSUnit_Array <= unit && unit <= eCSSUnit_Symbols) {
switch (unit) {
case eCSSUnit_Cubic_Bezier: aResult.AppendLiteral("cubic-bezier("); break;
case eCSSUnit_Steps: aResult.AppendLiteral("steps("); break;
case eCSSUnit_Symbols: aResult.AppendLiteral("symbols("); break;
@ -1386,10 +1424,7 @@ nsCSSValue::AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
}
continue;
}
nsCSSPropertyID prop =
((eCSSUnit_Counter <= unit && unit <= eCSSUnit_Counters) &&
i == array->Count() - 1)
? eCSSProperty_list_style_type : aProperty;
nsCSSPropertyID prop = aProperty;
if (array->Item(i).GetUnit() != eCSSUnit_Null) {
array->Item(i).AppendToString(prop, aResult, aSerialization);
mark = true;
@ -2775,16 +2810,6 @@ nsCSSValuePairList_heap::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf
return n;
}
size_t
nsCSSValue::Array::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{
size_t n = aMallocSizeOf(this);
for (size_t i = 0; i < mCount; i++) {
n += mArray[i].SizeOfExcludingThis(aMallocSizeOf);
}
return n;
}
css::URLValueData::URLValueData(already_AddRefed<PtrHolder<nsIURI>> aURI,
nsStringBuffer* aString,
already_AddRefed<PtrHolder<nsIURI>> aBaseURI,

Просмотреть файл

@ -443,9 +443,9 @@ enum nsCSSUnit {
eCSSUnit_Font_Format = 16, // (char16_t*) a font format name
eCSSUnit_Element = 17, // (char16_t*) an element id
eCSSUnit_Array = 20, // (nsCSSValue::Array*) a list of values
eCSSUnit_Counter = 21, // (nsCSSValue::Array*) a counter(string,[string]) value
eCSSUnit_Counters = 22, // (nsCSSValue::Array*) a counters(string,string[,string]) value
eCSSUnit_Counter = 20, // (nsCSSValue::ThreadSafeArray*) a counter(string,[string]) value
eCSSUnit_Counters = 21, // (nsCSSValue::ThreadSafeArray*) a counters(string,string[,string]) value
eCSSUnit_Array = 22, // (nsCSSValue::Array*) a list of values
eCSSUnit_Cubic_Bezier = 23, // (nsCSSValue::Array*) a list of float values
eCSSUnit_Steps = 24, // (nsCSSValue::Array*) a list of (integer, enumerated)
eCSSUnit_Symbols = 25, // (nsCSSValue::Array*) a symbols(enumerated, symbols) value
@ -582,6 +582,8 @@ class nsCSSValue {
public:
struct Array;
friend struct Array;
struct ThreadSafeArray;
friend struct ThreadSafeArray;
friend struct mozilla::css::URLValueData;
@ -679,6 +681,8 @@ public:
bool UnitHasStringValue() const
{ return eCSSUnit_String <= mUnit && mUnit <= eCSSUnit_Element; }
bool UnitHasThreadSafeArrayValue() const
{ return eCSSUnit_Counter <= mUnit && mUnit <= eCSSUnit_Counters; }
bool UnitHasArrayValue() const
{ return eCSSUnit_Array <= mUnit && mUnit <= eCSSUnit_Calc_Divided; }
@ -783,6 +787,12 @@ public:
return mValue.mArray;
}
ThreadSafeArray* GetThreadSafeArrayValue() const
{
MOZ_ASSERT(UnitHasThreadSafeArrayValue(), "not a threadsafe array value");
return mValue.mThreadSafeArray;
}
nsIURI* GetURLValue() const
{
MOZ_ASSERT(mUnit == eCSSUnit_URL || mUnit == eCSSUnit_Image,
@ -922,6 +932,7 @@ public:
void SetComplexColorValue(
already_AddRefed<mozilla::css::ComplexColorValue> aValue);
void SetArrayValue(nsCSSValue::Array* aArray, nsCSSUnit aUnit);
void SetThreadSafeArrayValue(nsCSSValue::ThreadSafeArray* aArray, nsCSSUnit aUnit);
void SetURLValue(mozilla::css::URLValue* aURI);
void SetImageValue(mozilla::css::ImageValue* aImage);
void SetGradientValue(nsCSSValueGradient* aGradient);
@ -1022,6 +1033,7 @@ protected:
nscolor mColor;
nsIAtom* MOZ_OWNING_REF mAtom;
Array* MOZ_OWNING_REF mArray;
ThreadSafeArray* MOZ_OWNING_REF mThreadSafeArray;
mozilla::css::URLValue* MOZ_OWNING_REF mURL;
mozilla::css::ImageValue* MOZ_OWNING_REF mImage;
mozilla::css::GridTemplateAreasValue* MOZ_OWNING_REF mGridTemplateAreas;
@ -1041,113 +1053,104 @@ protected:
} mValue;
};
struct nsCSSValue::Array final {
// return |Array| with reference count of zero
static Array* Create(size_t aItemCount) {
return new (aItemCount) Array(aItemCount);
}
nsCSSValue& operator[](size_t aIndex) {
MOZ_ASSERT(aIndex < mCount, "out of range");
return mArray[aIndex];
}
const nsCSSValue& operator[](size_t aIndex) const {
MOZ_ASSERT(aIndex < mCount, "out of range");
return mArray[aIndex];
}
nsCSSValue& Item(size_t aIndex) { return (*this)[aIndex]; }
const nsCSSValue& Item(size_t aIndex) const { return (*this)[aIndex]; }
size_t Count() const { return mCount; }
// callers depend on the items being contiguous
nsCSSValue* ItemStorage() {
return this->First();
}
bool operator==(const Array& aOther) const
{
if (mCount != aOther.mCount)
return false;
for (size_t i = 0; i < mCount; ++i)
if ((*this)[i] != aOther[i])
return false;
return true;
}
// XXXdholbert This uses a size_t ref count. Should we use a variant
// of NS_INLINE_DECL_REFCOUNTING that takes a type as an argument?
void AddRef() {
if (mRefCnt == size_t(-1)) { // really want SIZE_MAX
NS_WARNING("refcount overflow, leaking nsCSSValue::Array");
return;
}
++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "nsCSSValue::Array", sizeof(*this));
}
void Release() {
if (mRefCnt == size_t(-1)) { // really want SIZE_MAX
NS_WARNING("refcount overflow, leaking nsCSSValue::Array");
return;
}
--mRefCnt;
NS_LOG_RELEASE(this, mRefCnt, "nsCSSValue::Array");
if (mRefCnt == 0)
delete this;
}
private:
size_t mRefCnt;
const size_t mCount;
// This must be the last sub-object, since we extend this array to
// be of size mCount; it needs to be a sub-object so it gets proper
// alignment.
nsCSSValue mArray[1];
void* operator new(size_t aSelfSize, size_t aItemCount) CPP_THROW_NEW {
MOZ_ASSERT(aItemCount > 0, "cannot have a 0 item count");
return ::operator new(aSelfSize + sizeof(nsCSSValue) * (aItemCount - 1));
}
void operator delete(void* aPtr) { ::operator delete(aPtr); }
nsCSSValue* First() { return mArray; }
const nsCSSValue* First() const { return mArray; }
#define CSSVALUE_LIST_FOR_EXTRA_VALUES(var) \
for (nsCSSValue *var = First() + 1, *var##_end = First() + mCount; \
var != var##_end; ++var)
explicit Array(size_t aItemCount)
: mRefCnt(0)
, mCount(aItemCount)
{
CSSVALUE_LIST_FOR_EXTRA_VALUES(val) {
new (val) nsCSSValue();
}
}
~Array()
{
CSSVALUE_LIST_FOR_EXTRA_VALUES(val) {
val->~nsCSSValue();
}
}
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
#undef CSSVALUE_LIST_FOR_EXTRA_VALUES
private:
Array(const Array& aOther) = delete;
Array& operator=(const Array& aOther) = delete;
// We use this macro to declare equivalent logic for Array and ThreadSafeArray.
// It would be much nicer to use a superclass, but the dynamically-sized nature
// of the interesting part of the class makes that tricky.
#define DECLARE_CSS_ARRAY(className, refcntMacro) \
struct nsCSSValue::className final { \
\
/* return this class with reference count of zero */ \
static className* Create(size_t aItemCount) { \
return new (aItemCount) className(aItemCount); \
} \
\
nsCSSValue& operator[](size_t aIndex) { \
MOZ_ASSERT(aIndex < mCount, "out of range"); \
return mArray[aIndex]; \
} \
\
const nsCSSValue& operator[](size_t aIndex) const { \
MOZ_ASSERT(aIndex < mCount, "out of range"); \
return mArray[aIndex]; \
} \
\
nsCSSValue& Item(size_t aIndex) { return (*this)[aIndex]; } \
const nsCSSValue& Item(size_t aIndex) const { return (*this)[aIndex]; } \
\
size_t Count() const { return mCount; } \
\
/* callers depend on the items being contiguous */ \
nsCSSValue* ItemStorage() { \
return this->First(); \
} \
\
bool operator==(const className& aOther) const \
{ \
if (mCount != aOther.mCount) \
return false; \
for (size_t i = 0; i < mCount; ++i) \
if ((*this)[i] != aOther[i]) \
return false; \
return true; \
} \
\
refcntMacro(className); \
private: \
\
const size_t mCount; \
/* This must be the last sub-object, since we extend this array to */ \
/* be of size mCount; it needs to be a sub-object so it gets proper */ \
/* alignment. */ \
nsCSSValue mArray[1]; \
\
void* operator new(size_t aSelfSize, size_t aItemCount) CPP_THROW_NEW { \
MOZ_ASSERT(aItemCount > 0, "cannot have a 0 item count"); \
return ::operator new(aSelfSize + sizeof(nsCSSValue) * (aItemCount - 1)); \
} \
\
void operator delete(void* aPtr) { ::operator delete(aPtr); } \
\
nsCSSValue* First() { return mArray; } \
\
const nsCSSValue* First() const { return mArray; } \
\
explicit className(size_t aItemCount) \
: mCount(aItemCount) \
{ \
for (nsCSSValue *val = First() + 1, *val_end = First() + mCount; \
val != val_end; ++val) \
{ \
new (val) nsCSSValue(); \
} \
} \
\
~className() \
{ \
for (nsCSSValue *val = First() + 1, *val_end = First() + mCount; \
val != val_end; ++val) \
{ \
val->~nsCSSValue(); \
} \
} \
\
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const \
{ \
size_t n = aMallocSizeOf(this); \
for (size_t i = 0; i < mCount; i++) { \
n += mArray[i].SizeOfExcludingThis(aMallocSizeOf); \
} \
return n; \
} \
\
private: \
className(const className& aOther) = delete; \
className& operator=(const className& aOther) = delete; \
};
DECLARE_CSS_ARRAY(Array, NS_INLINE_DECL_REFCOUNTING)
DECLARE_CSS_ARRAY(ThreadSafeArray, NS_INLINE_DECL_THREADSAFE_REFCOUNTING)
#undef DECLARE_CSS_ARRAY
// Prefer nsCSSValue::Array for lists of fixed size.
struct nsCSSValueList {
nsCSSValueList() : mNext(nullptr) { MOZ_COUNT_CTOR(nsCSSValueList); }

Просмотреть файл

@ -1315,7 +1315,7 @@ nsComputedDOMStyle::DoGetContent()
str.AppendLiteral("counters(");
}
// WRITE ME
nsCSSValue::Array* a = data.GetCounters();
nsCSSValue::ThreadSafeArray* a = data.GetCounters();
nsStyleUtil::AppendEscapedCSSIdent(
nsDependentString(a->Item(0).GetStringBufferValue()), str);
@ -1799,18 +1799,38 @@ nsComputedDOMStyle::DoGetFontKerning()
return val.forget();
}
static void
SerializeLanguageOverride(uint32_t aLanguageOverride, nsAString& aResult)
{
aResult.Truncate();
uint32_t i;
for (i = 0; i < 4 ; i++) {
char16_t ch = aLanguageOverride >> 24;
MOZ_ASSERT(nsCRT::IsAscii(ch),
"Invalid tags, we should've handled this during computing!");
aResult.Append(ch);
aLanguageOverride = aLanguageOverride << 8;
}
// strip trailing whitespaces
while (i > 0 && aResult[i - 1] == ' ') {
i--;
}
aResult.Truncate(i);
}
already_AddRefed<CSSValue>
nsComputedDOMStyle::DoGetFontLanguageOverride()
{
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
const nsStyleFont* font = StyleFont();
if (font->mFont.languageOverride.IsEmpty()) {
if (font->mFont.languageOverride == 0) {
val->SetIdent(eCSSKeyword_normal);
} else {
nsAutoString str;
nsStyleUtil::AppendEscapedCSSString(font->mFont.languageOverride, str);
val->SetString(str);
nsAutoString serializedStr, escapedStr;
SerializeLanguageOverride(font->mFont.languageOverride, serializedStr);
nsStyleUtil::AppendEscapedCSSString(serializedStr, escapedStr);
val->SetString(escapedStr);
}
return val.forget();
}

Просмотреть файл

@ -29,6 +29,7 @@
#include "nsAlgorithm.h" // for clamped()
#include "nscore.h"
#include "nsCRT.h" // for IsAscii()
#include "nsIWidget.h"
#include "nsIPresShell.h"
#include "nsFontMetrics.h"
@ -4035,11 +4036,13 @@ nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext,
aFont->mFont.languageOverride = aParentFont->mFont.languageOverride;
} else if (eCSSUnit_Normal == languageOverrideValue->GetUnit() ||
eCSSUnit_Initial == languageOverrideValue->GetUnit()) {
aFont->mFont.languageOverride.Truncate();
aFont->mFont.languageOverride = NO_FONT_LANGUAGE_OVERRIDE;
} else if (eCSSUnit_System_Font == languageOverrideValue->GetUnit()) {
aFont->mFont.languageOverride = systemFont.languageOverride;
} else if (eCSSUnit_String == languageOverrideValue->GetUnit()) {
languageOverrideValue->GetStringValue(aFont->mFont.languageOverride);
nsAutoString lang;
languageOverrideValue->GetStringValue(lang);
aFont->mFont.languageOverride = ParseFontLanguageOverride(lang);
}
// -moz-min-font-size-ratio: percent, inherit
@ -4408,6 +4411,26 @@ nsRuleNode::ComputeFontData(void* aStartStruct,
COMPUTE_END_INHERITED(Font, font)
}
/*static*/ uint32_t
nsRuleNode::ParseFontLanguageOverride(const nsAString& aLangTag)
{
if (!aLangTag.Length() || aLangTag.Length() > 4) {
return NO_FONT_LANGUAGE_OVERRIDE;
}
uint32_t index, result = 0;
for (index = 0; index < aLangTag.Length(); ++index) {
char16_t ch = aLangTag[index];
if (!nsCRT::IsAscii(ch)) { // valid tags are pure ASCII
return NO_FONT_LANGUAGE_OVERRIDE;
}
result = (result << 8) + ch;
}
while (index++ < 4) {
result = (result << 8) + 0x20;
}
return result;
}
template <typename T>
inline uint32_t ListLength(const T* aList)
{
@ -9004,7 +9027,7 @@ nsRuleNode::ComputeContentData(void* aStartStruct,
nsStyleContentType type =
unit == eCSSUnit_Counter ? eStyleContentType_Counter
: eStyleContentType_Counters;
data.SetCounters(type, value.GetArrayValue());
data.SetCounters(type, value.GetThreadSafeArrayValue());
break;
}
case eCSSUnit_Enumerated:

Просмотреть файл

@ -1040,6 +1040,8 @@ public:
nsPresContext* aPresContext,
nsFontSizeType aFontSizeType = eFontSize_HTML);
static uint32_t ParseFontLanguageOverride(const nsAString& aLangTag);
/**
* @param aValue The color value, returned from nsCSSParser::ParseColorString
* @param aPresContext Presentation context whose preferences are used

Просмотреть файл

@ -3020,7 +3020,7 @@ public:
return mContent.mString;
}
nsCSSValue::Array* GetCounters() const
nsCSSValue::ThreadSafeArray* GetCounters() const
{
MOZ_ASSERT(mType == eStyleContentType_Counter ||
mType == eStyleContentType_Counters);
@ -3061,7 +3061,7 @@ public:
mContent.mString = NS_strdup(aString);
}
void SetCounters(nsStyleContentType aType, nsCSSValue::Array* aCounters)
void SetCounters(nsStyleContentType aType, nsCSSValue::ThreadSafeArray* aCounters)
{
MOZ_ASSERT(aType == eStyleContentType_Counter ||
aType == eStyleContentType_Counters);
@ -3094,7 +3094,9 @@ private:
union {
char16_t *mString;
nsStyleImageRequest* mImage;
nsCSSValue::Array* mCounters;
// NB: We need threadsafe refcounts here to enable inheritance in the
// parallel style traversal.
nsCSSValue::ThreadSafeArray* mCounters;
} mContent;
};

Просмотреть файл

@ -161,7 +161,7 @@ to mochitest command.
* test_value_storage.html `-colors` [96]
* test_shorthand_property_getters.html `-colors` [1]
* -moz-box-ordinal-group servo/servo#16000
* test_value_storage.html `-box-` [94]
* test_value_storage.html `-box-` [6]
* -moz-force-broken-image-icon servo/servo#16001
* test_compute_data_with_start_struct.html `-moz-force-broken-image-icon` [2]
* test_inherit_computation.html `-moz-force-broken-image-icon` [2]
@ -361,8 +361,6 @@ to mochitest command.
* ... `for '-webkit-mask-position` [188]
* ... `for '-webkit-mask` [45]
* test_shorthand_property_getters.html `background-position` [1]
* box-shadow wrong order of &lt;length&gt; values servo/servo#15203
* test_value_storage.html `box-shadow` [44]
* color value not canonicalized servo/servo#15397
* test_shorthand_property_getters.html `should condense to canonical case` [2]
* background-position invalid 3-value form **issue to be filed**

Просмотреть файл

@ -5,7 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files('*'):
BUG_COMPONENT = ('Core', 'Video/Audio')
BUG_COMPONENT = ('Core', 'Audio/Video')
EXPORTS.ogg += [
'include/ogg/config_types.h',

Просмотреть файл

@ -5,7 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files('*'):
BUG_COMPONENT = ('Core', 'Video/Audio')
BUG_COMPONENT = ('Core', 'Audio/Video')
EXPORTS.opus += [
'include/opus.h',

Просмотреть файл

@ -5,7 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files('*'):
BUG_COMPONENT = ('Core', 'Video/Audio')
BUG_COMPONENT = ('Core', 'Audio/Video')
EXPORTS.theora += [
'include/theora/codec.h',

Просмотреть файл

@ -5,7 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files('*'):
BUG_COMPONENT = ('Core', 'Video/Audio')
BUG_COMPONENT = ('Core', 'Audio/Video')
DIRS += ['include/tremor', 'lib']

Просмотреть файл

@ -5,7 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files('*'):
BUG_COMPONENT = ('Core', 'Video/Audio')
BUG_COMPONENT = ('Core', 'Audio/Video')
EXPORTS.vorbis += [
'include/vorbis/codec.h',

Просмотреть файл

@ -5,7 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files('*'):
BUG_COMPONENT = ('Core', 'Video/Audio')
BUG_COMPONENT = ('Core', 'Audio/Video')
include('sources.mozbuild')

Просмотреть файл

@ -5,7 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files('*'):
BUG_COMPONENT = ('Core', 'Video/Audio')
BUG_COMPONENT = ('Core', 'Audio/Video')
EXPORTS.psshparser += [
'PsshParser.h',

Просмотреть файл

@ -642,13 +642,13 @@ TestScanSigned8()
Input<int8_t> u;
PoisonInput(u);
sscanf("-17", "%" SCNd8, &u.i);
MOZ_RELEASE_ASSERT(u.i == -17);
sscanf("-17", "%" SCNd8, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == -17);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("042", "%" SCNi8, &u.i);
MOZ_RELEASE_ASSERT(u.i == 042);
sscanf("042", "%" SCNi8, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 042);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
#endif
}
@ -659,13 +659,13 @@ TestScanSigned16()
Input<int16_t> u;
PoisonInput(u);
sscanf("-1742", "%" SCNd16, &u.i);
MOZ_RELEASE_ASSERT(u.i == -1742);
sscanf("-1742", "%" SCNd16, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == -1742);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("04217", "%" SCNi16, &u.i);
MOZ_RELEASE_ASSERT(u.i == 04217);
sscanf("04217", "%" SCNi16, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 04217);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}
@ -675,13 +675,13 @@ TestScanSigned32()
Input<int32_t> u;
PoisonInput(u);
sscanf("-174257", "%" SCNd32, &u.i);
MOZ_RELEASE_ASSERT(u.i == -174257);
sscanf("-174257", "%" SCNd32, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == -174257);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("0423571", "%" SCNi32, &u.i);
MOZ_RELEASE_ASSERT(u.i == 0423571);
sscanf("0423571", "%" SCNi32, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 0423571);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}
@ -691,13 +691,13 @@ TestScanSigned64()
Input<int64_t> u;
PoisonInput(u);
sscanf("-17425238927232", "%" SCNd64, &u.i);
MOZ_RELEASE_ASSERT(u.i == -INT64_C(17425238927232));
sscanf("-17425238927232", "%" SCNd64, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == -INT64_C(17425238927232));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("042333576571", "%" SCNi64, &u.i);
MOZ_RELEASE_ASSERT(u.i == INT64_C(042333576571));
sscanf("042333576571", "%" SCNi64, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == INT64_C(042333576571));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}
@ -717,13 +717,13 @@ TestScanSignedLeast8()
Input<int_least8_t> u;
PoisonInput(u);
sscanf("-17", "%" SCNdLEAST8, &u.i);
MOZ_RELEASE_ASSERT(u.i == -17);
sscanf("-17", "%" SCNdLEAST8, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == -17);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("042", "%" SCNiLEAST8, &u.i);
MOZ_RELEASE_ASSERT(u.i == 042);
sscanf("042", "%" SCNiLEAST8, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 042);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
#endif
}
@ -734,13 +734,13 @@ TestScanSignedLeast16()
Input<int_least16_t> u;
PoisonInput(u);
sscanf("-1742", "%" SCNdLEAST16, &u.i);
MOZ_RELEASE_ASSERT(u.i == -1742);
sscanf("-1742", "%" SCNdLEAST16, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == -1742);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("04217", "%" SCNiLEAST16, &u.i);
MOZ_RELEASE_ASSERT(u.i == 04217);
sscanf("04217", "%" SCNiLEAST16, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 04217);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}
@ -750,13 +750,13 @@ TestScanSignedLeast32()
Input<int_least32_t> u;
PoisonInput(u);
sscanf("-174257", "%" SCNdLEAST32, &u.i);
MOZ_RELEASE_ASSERT(u.i == -174257);
sscanf("-174257", "%" SCNdLEAST32, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == -174257);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("0423571", "%" SCNiLEAST32, &u.i);
MOZ_RELEASE_ASSERT(u.i == 0423571);
sscanf("0423571", "%" SCNiLEAST32, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 0423571);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}
@ -766,13 +766,13 @@ TestScanSignedLeast64()
Input<int_least64_t> u;
PoisonInput(u);
sscanf("-17425238927232", "%" SCNdLEAST64, &u.i);
MOZ_RELEASE_ASSERT(u.i == -INT64_C(17425238927232));
sscanf("-17425238927232", "%" SCNdLEAST64, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == -INT64_C(17425238927232));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("042333576571", "%" SCNiLEAST64, &u.i);
MOZ_RELEASE_ASSERT(u.i == INT64_C(042333576571));
sscanf("042333576571", "%" SCNiLEAST64, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == INT64_C(042333576571));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}
@ -792,13 +792,13 @@ TestScanSignedFast8()
Input<int_fast8_t> u;
PoisonInput(u);
sscanf("-17", "%" SCNdFAST8, &u.i);
MOZ_RELEASE_ASSERT(u.i == -17);
sscanf("-17", "%" SCNdFAST8, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == -17);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("042", "%" SCNiFAST8, &u.i);
MOZ_RELEASE_ASSERT(u.i == 042);
sscanf("042", "%" SCNiFAST8, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 042);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
#endif
}
@ -809,13 +809,13 @@ TestScanSignedFast16()
Input<int_fast16_t> u;
PoisonInput(u);
sscanf("-1742", "%" SCNdFAST16, &u.i);
MOZ_RELEASE_ASSERT(u.i == -1742);
sscanf("-1742", "%" SCNdFAST16, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == -1742);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("04217", "%" SCNiFAST16, &u.i);
MOZ_RELEASE_ASSERT(u.i == 04217);
sscanf("04217", "%" SCNiFAST16, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 04217);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}
@ -825,13 +825,13 @@ TestScanSignedFast32()
Input<int_fast32_t> u;
PoisonInput(u);
sscanf("-174257", "%" SCNdFAST32, &u.i);
MOZ_RELEASE_ASSERT(u.i == -174257);
sscanf("-174257", "%" SCNdFAST32, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == -174257);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("0423571", "%" SCNiFAST32, &u.i);
MOZ_RELEASE_ASSERT(u.i == 0423571);
sscanf("0423571", "%" SCNiFAST32, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 0423571);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}
@ -841,13 +841,13 @@ TestScanSignedFast64()
Input<int_fast64_t> u;
PoisonInput(u);
sscanf("-17425238927232", "%" SCNdFAST64, &u.i);
MOZ_RELEASE_ASSERT(u.i == -INT64_C(17425238927232));
sscanf("-17425238927232", "%" SCNdFAST64, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == -INT64_C(17425238927232));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("042333576571", "%" SCNiFAST64, &u.i);
MOZ_RELEASE_ASSERT(u.i == INT64_C(042333576571));
sscanf("042333576571", "%" SCNiFAST64, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == INT64_C(042333576571));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}
@ -866,13 +866,13 @@ TestScanSignedMax()
Input<intmax_t> u;
PoisonInput(u);
sscanf("-432157943248732", "%" SCNdMAX, &u.i);
MOZ_RELEASE_ASSERT(u.i == -INTMAX_C(432157943248732));
sscanf("-432157943248732", "%" SCNdMAX, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == -INTMAX_C(432157943248732));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("04233357236571", "%" SCNiMAX, &u.i);
MOZ_RELEASE_ASSERT(u.i == INTMAX_C(04233357236571));
sscanf("04233357236571", "%" SCNiMAX, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == INTMAX_C(04233357236571));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}
@ -882,13 +882,13 @@ TestScanSignedPtr()
Input<intptr_t> u;
PoisonInput(u);
sscanf("12345678", "%" SCNdPTR, &u.i);
MOZ_RELEASE_ASSERT(u.i == intptr_t(reinterpret_cast<void*>(12345678)));
sscanf("12345678", "%" SCNdPTR, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == intptr_t(reinterpret_cast<void*>(12345678)));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("04233357236", "%" SCNiPTR, &u.i);
MOZ_RELEASE_ASSERT(u.i == intptr_t(reinterpret_cast<void*>(04233357236)));
sscanf("04233357236", "%" SCNiPTR, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == intptr_t(reinterpret_cast<void*>(04233357236)));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}
@ -919,18 +919,18 @@ TestScanUnsigned8()
Input<uint8_t> u;
PoisonInput(u);
sscanf("17", "%" SCNo8, &u.i);
MOZ_RELEASE_ASSERT(u.i == 017);
sscanf("17", "%" SCNo8, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 017);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("42", "%" SCNu8, &u.i);
MOZ_RELEASE_ASSERT(u.i == 42);
sscanf("42", "%" SCNu8, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 42);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("2A", "%" SCNx8, &u.i);
MOZ_RELEASE_ASSERT(u.i == 0x2A);
sscanf("2A", "%" SCNx8, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 0x2A);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
#endif
}
@ -941,18 +941,18 @@ TestScanUnsigned16()
Input<uint16_t> u;
PoisonInput(u);
sscanf("1742", "%" SCNo16, &u.i);
MOZ_RELEASE_ASSERT(u.i == 01742);
sscanf("1742", "%" SCNo16, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 01742);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("4217", "%" SCNu16, &u.i);
MOZ_RELEASE_ASSERT(u.i == 4217);
sscanf("4217", "%" SCNu16, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 4217);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("2ABC", "%" SCNx16, &u.i);
MOZ_RELEASE_ASSERT(u.i == 0x2ABC);
sscanf("2ABC", "%" SCNx16, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 0x2ABC);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}
@ -962,18 +962,18 @@ TestScanUnsigned32()
Input<uint32_t> u;
PoisonInput(u);
sscanf("17421742", "%" SCNo32, &u.i);
MOZ_RELEASE_ASSERT(u.i == 017421742);
sscanf("17421742", "%" SCNo32, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 017421742);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("4217867", "%" SCNu32, &u.i);
MOZ_RELEASE_ASSERT(u.i == 4217867);
sscanf("4217867", "%" SCNu32, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 4217867);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("2ABCBEEF", "%" SCNx32, &u.i);
MOZ_RELEASE_ASSERT(u.i == 0x2ABCBEEF);
sscanf("2ABCBEEF", "%" SCNx32, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 0x2ABCBEEF);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}
@ -983,18 +983,18 @@ TestScanUnsigned64()
Input<uint64_t> u;
PoisonInput(u);
sscanf("17421742173", "%" SCNo64, &u.i);
MOZ_RELEASE_ASSERT(u.i == UINT64_C(017421742173));
sscanf("17421742173", "%" SCNo64, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == UINT64_C(017421742173));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("421786713579", "%" SCNu64, &u.i);
MOZ_RELEASE_ASSERT(u.i == UINT64_C(421786713579));
sscanf("421786713579", "%" SCNu64, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == UINT64_C(421786713579));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("DEADBEEF7457E", "%" SCNx64, &u.i);
MOZ_RELEASE_ASSERT(u.i == UINT64_C(0xDEADBEEF7457E));
sscanf("DEADBEEF7457E", "%" SCNx64, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == UINT64_C(0xDEADBEEF7457E));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}
@ -1014,18 +1014,18 @@ TestScanUnsignedLeast8()
Input<uint_least8_t> u;
PoisonInput(u);
sscanf("17", "%" SCNoLEAST8, &u.i);
MOZ_RELEASE_ASSERT(u.i == 017);
sscanf("17", "%" SCNoLEAST8, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 017);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("42", "%" SCNuLEAST8, &u.i);
MOZ_RELEASE_ASSERT(u.i == 42);
sscanf("42", "%" SCNuLEAST8, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 42);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("2A", "%" SCNxLEAST8, &u.i);
MOZ_RELEASE_ASSERT(u.i == 0x2A);
sscanf("2A", "%" SCNxLEAST8, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 0x2A);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
#endif
}
@ -1036,18 +1036,18 @@ TestScanUnsignedLeast16()
Input<uint_least16_t> u;
PoisonInput(u);
sscanf("1742", "%" SCNoLEAST16, &u.i);
MOZ_RELEASE_ASSERT(u.i == 01742);
sscanf("1742", "%" SCNoLEAST16, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 01742);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("4217", "%" SCNuLEAST16, &u.i);
MOZ_RELEASE_ASSERT(u.i == 4217);
sscanf("4217", "%" SCNuLEAST16, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 4217);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("2ABC", "%" SCNxLEAST16, &u.i);
MOZ_RELEASE_ASSERT(u.i == 0x2ABC);
sscanf("2ABC", "%" SCNxLEAST16, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 0x2ABC);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}
@ -1057,18 +1057,18 @@ TestScanUnsignedLeast32()
Input<uint_least32_t> u;
PoisonInput(u);
sscanf("17421742", "%" SCNoLEAST32, &u.i);
MOZ_RELEASE_ASSERT(u.i == 017421742);
sscanf("17421742", "%" SCNoLEAST32, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 017421742);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("4217867", "%" SCNuLEAST32, &u.i);
MOZ_RELEASE_ASSERT(u.i == 4217867);
sscanf("4217867", "%" SCNuLEAST32, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 4217867);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("2ABCBEEF", "%" SCNxLEAST32, &u.i);
MOZ_RELEASE_ASSERT(u.i == 0x2ABCBEEF);
sscanf("2ABCBEEF", "%" SCNxLEAST32, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 0x2ABCBEEF);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}
@ -1078,18 +1078,18 @@ TestScanUnsignedLeast64()
Input<uint_least64_t> u;
PoisonInput(u);
sscanf("17421742173", "%" SCNoLEAST64, &u.i);
MOZ_RELEASE_ASSERT(u.i == UINT64_C(017421742173));
sscanf("17421742173", "%" SCNoLEAST64, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == UINT64_C(017421742173));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("421786713579", "%" SCNuLEAST64, &u.i);
MOZ_RELEASE_ASSERT(u.i == UINT64_C(421786713579));
sscanf("421786713579", "%" SCNuLEAST64, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == UINT64_C(421786713579));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("DEADBEEF7457E", "%" SCNxLEAST64, &u.i);
MOZ_RELEASE_ASSERT(u.i == UINT64_C(0xDEADBEEF7457E));
sscanf("DEADBEEF7457E", "%" SCNxLEAST64, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == UINT64_C(0xDEADBEEF7457E));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}
@ -1109,18 +1109,18 @@ TestScanUnsignedFast8()
Input<uint_fast8_t> u;
PoisonInput(u);
sscanf("17", "%" SCNoFAST8, &u.i);
MOZ_RELEASE_ASSERT(u.i == 017);
sscanf("17", "%" SCNoFAST8, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 017);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("42", "%" SCNuFAST8, &u.i);
MOZ_RELEASE_ASSERT(u.i == 42);
sscanf("42", "%" SCNuFAST8, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 42);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("2A", "%" SCNxFAST8, &u.i);
MOZ_RELEASE_ASSERT(u.i == 0x2A);
sscanf("2A", "%" SCNxFAST8, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 0x2A);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
#endif
}
@ -1131,18 +1131,18 @@ TestScanUnsignedFast16()
Input<uint_fast16_t> u;
PoisonInput(u);
sscanf("1742", "%" SCNoFAST16, &u.i);
MOZ_RELEASE_ASSERT(u.i == 01742);
sscanf("1742", "%" SCNoFAST16, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 01742);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("4217", "%" SCNuFAST16, &u.i);
MOZ_RELEASE_ASSERT(u.i == 4217);
sscanf("4217", "%" SCNuFAST16, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 4217);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("2ABC", "%" SCNxFAST16, &u.i);
MOZ_RELEASE_ASSERT(u.i == 0x2ABC);
sscanf("2ABC", "%" SCNxFAST16, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 0x2ABC);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}
@ -1152,18 +1152,18 @@ TestScanUnsignedFast32()
Input<uint_fast32_t> u;
PoisonInput(u);
sscanf("17421742", "%" SCNoFAST32, &u.i);
MOZ_RELEASE_ASSERT(u.i == 017421742);
sscanf("17421742", "%" SCNoFAST32, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 017421742);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("4217867", "%" SCNuFAST32, &u.i);
MOZ_RELEASE_ASSERT(u.i == 4217867);
sscanf("4217867", "%" SCNuFAST32, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 4217867);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("2ABCBEEF", "%" SCNxFAST32, &u.i);
MOZ_RELEASE_ASSERT(u.i == 0x2ABCBEEF);
sscanf("2ABCBEEF", "%" SCNxFAST32, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == 0x2ABCBEEF);
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}
@ -1173,18 +1173,18 @@ TestScanUnsignedFast64()
Input<uint_fast64_t> u;
PoisonInput(u);
sscanf("17421742173", "%" SCNoFAST64, &u.i);
MOZ_RELEASE_ASSERT(u.i == UINT64_C(017421742173));
sscanf("17421742173", "%" SCNoFAST64, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == UINT64_C(017421742173));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("421786713579", "%" SCNuFAST64, &u.i);
MOZ_RELEASE_ASSERT(u.i == UINT64_C(421786713579));
sscanf("421786713579", "%" SCNuFAST64, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == UINT64_C(421786713579));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("DEADBEEF7457E", "%" SCNxFAST64, &u.i);
MOZ_RELEASE_ASSERT(u.i == UINT64_C(0xDEADBEEF7457E));
sscanf("DEADBEEF7457E", "%" SCNxFAST64, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == UINT64_C(0xDEADBEEF7457E));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}
@ -1203,18 +1203,18 @@ TestScanUnsignedMax()
Input<uintmax_t> u;
PoisonInput(u);
sscanf("14220563454333534", "%" SCNoMAX, &u.i);
MOZ_RELEASE_ASSERT(u.i == UINTMAX_C(432157943248732));
sscanf("14220563454333534", "%" SCNoMAX, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == UINTMAX_C(432157943248732));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("432157943248732", "%" SCNuMAX, &u.i);
MOZ_RELEASE_ASSERT(u.i == UINTMAX_C(432157943248732));
sscanf("432157943248732", "%" SCNuMAX, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == UINTMAX_C(432157943248732));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("4c337ca791", "%" SCNxMAX, &u.i);
MOZ_RELEASE_ASSERT(u.i == UINTMAX_C(327281321873));
sscanf("4c337ca791", "%" SCNxMAX, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == UINTMAX_C(327281321873));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}
@ -1224,18 +1224,18 @@ TestScanUnsignedPtr()
Input<uintptr_t> u;
PoisonInput(u);
sscanf("57060516", "%" SCNoPTR, &u.i);
MOZ_RELEASE_ASSERT(u.i == uintptr_t(reinterpret_cast<void*>(12345678)));
sscanf("57060516", "%" SCNoPTR, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == uintptr_t(reinterpret_cast<void*>(12345678)));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("87654321", "%" SCNuPTR, &u.i);
MOZ_RELEASE_ASSERT(u.i == uintptr_t(reinterpret_cast<void*>(87654321)));
sscanf("87654321", "%" SCNuPTR, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == uintptr_t(reinterpret_cast<void*>(87654321)));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
PoisonInput(u);
sscanf("4c3a791", "%" SCNxPTR, &u.i);
MOZ_RELEASE_ASSERT(u.i == uintptr_t(reinterpret_cast<void*>(0x4c3a791)));
sscanf("4c3a791", "%" SCNxPTR, &u.mI);
MOZ_RELEASE_ASSERT(u.mI == uintptr_t(reinterpret_cast<void*>(0x4c3a791)));
MOZ_RELEASE_ASSERT(ExtraBitsUntouched(u));
}

Просмотреть файл

@ -318,11 +318,4 @@ public class AppConstants {
// (bug 1266820) Temporarily disabled since no one is working on it.
public static final boolean SCREENSHOTS_IN_BOOKMARKS_ENABLED = false;
public static final boolean MOZ_ANDROID_ACTIVITY_STREAM =
//#ifdef MOZ_ANDROID_ACTIVITY_STREAM
true;
//#else
false;
//#endif
}

Просмотреть файл

@ -37,8 +37,7 @@ def main(output_file, input_filename):
CONFIG.update(buildconfig.substs)
DEFINES = {}
for var in ('MOZ_ANDROID_ACTIVITY_STREAM'
'MOZ_ANDROID_ANR_REPORTER',
for var in ('MOZ_ANDROID_ANR_REPORTER',
'MOZ_ANDROID_BEAM',
'MOZ_ANDROID_CUSTOM_TABS',
'MOZ_ANDROID_DOWNLOADS_INTEGRATION',

Просмотреть файл

@ -59,6 +59,12 @@ public class Experiments {
// Make new activity stream panel available (to replace top sites) (Bug 1313316)
public static final String ACTIVITY_STREAM = "activity-stream";
// Show a setting in "experimental features" for enabling/disabling activity stream.
public static final String ACTIVITY_STREAM_SETTING = "activity-stream-setting";
// Enable Activity stream by default for users in the "opt out" group.
public static final String ACTIVITY_STREAM_OPT_OUT = "activity-stream-opt-out";
// Tabs tray: Arrange tabs in two columns in portrait mode
public static final String COMPACT_TABS = "compact-tabs";

Просмотреть файл

@ -6,6 +6,7 @@
package org.mozilla.gecko.activitystream;
import android.content.Context;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.AsyncTask;
import android.text.TextUtils;
@ -48,35 +49,98 @@ public class ActivityStream {
"edit"
);
public static boolean isEnabled(Context context) {
if (!isUserEligible(context)) {
// If the user is not eligible then disable activity stream. Even if it has been
// enabled before.
return false;
}
return GeckoSharedPrefs.forApp(context)
.getBoolean(GeckoPreferences.PREFS_ACTIVITY_STREAM, false);
/**
* Returns true if the user has made an active decision: Enabling or disabling Activity Stream.
*/
public static boolean hasUserEnabledOrDisabled(Context context) {
final SharedPreferences preferences = GeckoSharedPrefs.forApp(context);
return preferences.contains(GeckoPreferences.PREFS_ACTIVITY_STREAM);
}
/**
* Is the user eligible to use activity stream or should we hide it from settings etc.?
* Set the user's decision: Enable or disable Activity Stream.
*/
public static boolean isUserEligible(Context context) {
if (AppConstants.MOZ_ANDROID_ACTIVITY_STREAM) {
// If the build flag is enabled then just show the option to the user.
return true;
public static void setUserEnabled(Context context, boolean value) {
GeckoSharedPrefs.forApp(context).edit()
.putBoolean(GeckoPreferences.PREFS_ACTIVITY_STREAM, value)
.apply();
}
/**
* Returns true if Activity Stream has been enabled by the user. Before calling this method
* hasUserEnabledOrDisabled() should be used to determine whether the user actually has made
* a decision.
*/
public static boolean isEnabledByUser(Context context) {
final SharedPreferences preferences = GeckoSharedPrefs.forApp(context);
if (!preferences.contains(GeckoPreferences.PREFS_ACTIVITY_STREAM)) {
throw new IllegalStateException("User hasn't made a decision. Call hasUserEnabledOrDisabled() before calling this method");
}
if (AppConstants.NIGHTLY_BUILD && SwitchBoard.isInExperiment(context, Experiments.ACTIVITY_STREAM)) {
// If this is a nightly build and the user is part of the activity stream experiment then
// the option should be visible too. The experiment is limited to Nightly too but I want
// to make really sure that this isn't riding the trains accidentally.
return true;
return preferences.getBoolean(GeckoPreferences.PREFS_ACTIVITY_STREAM, /* should not be used */ false);
}
/**
* Is Activity Stream enabled by an A/B experiment?
*/
public static boolean isEnabledByExperiment(Context context) {
// For users in the "opt out" group Activity Stream is enabled by default.
return SwitchBoard.isInExperiment(context, Experiments.ACTIVITY_STREAM_OPT_OUT);
}
/**
* Is Activity Stream enabled? Either actively by the user or by an experiment?
*/
public static boolean isEnabled(Context context) {
// (1) Can Activity Steam be enabled on this device?
if (!canBeEnabled(context)) {
return false;
}
// For everyone else activity stream is not available yet.
return false;
// (2) Has Activity Stream be enabled/disabled by the user?
if (hasUserEnabledOrDisabled(context)) {
return isEnabledByUser(context);
}
// (3) Is Activity Stream enabled by an experiment?
return isEnabledByExperiment(context);
}
/**
* Can the user enable/disable Activity Stream (Returns true) or is this completely controlled by us?
*/
public static boolean isUserSwitchable(Context context) {
// (1) Can Activity Steam be enabled on this device?
if (!canBeEnabled(context)) {
return false;
}
// (2) Is the user part of the experiment for showing the settings UI?
return SwitchBoard.isInExperiment(context, Experiments.ACTIVITY_STREAM_SETTING);
}
/**
* This method returns true if Activity Stream can be enabled - by the user or an experiment.
* Whether a setting shows up or whether the user is in an experiment group is evaluated
* separately from this method. However if this methods returns false then Activity Stream
* should never be visible/enabled - no matter what build or what experiments are active.
*/
public static boolean canBeEnabled(Context context) {
if (!AppConstants.NIGHTLY_BUILD) {
// If this is not a Nightly build then hide Activity Stream completely. We can control
// this via the Switchboard experiment too but I want to make really sure that this
// isn't riding the trains accidentally.
return false;
}
if (!SwitchBoard.isInExperiment(context, Experiments.ACTIVITY_STREAM)) {
// This is our kill switch. If the user is not part of this experiment then show no
// Activity Stream UI.
return false;
}
// Activity stream can be enabled. Whether it is depends on other experiments and settings.
return true;
}
/**

Просмотреть файл

@ -0,0 +1,72 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.activitystream;
import android.content.Context;
import android.preference.SwitchPreference;
import android.util.AttributeSet;
import org.mozilla.gecko.GeckoAppShell;
import org.mozilla.gecko.util.ThreadUtils;
/**
* A custom switch preference that is used while we allow users to opt-out from using Activity Stream.
*/
public class ActivityStreamPreference extends SwitchPreference {
@SuppressWarnings("unused") // Used from XML
public ActivityStreamPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
init(context);
}
@SuppressWarnings("unused") // Used from XML
public ActivityStreamPreference(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context);
}
@SuppressWarnings("unused") // Used from XML
public ActivityStreamPreference(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
@SuppressWarnings("unused") // Used from XML
public ActivityStreamPreference(Context context) {
super(context);
init(context);
}
private void init(Context context) {
// The SwitchPreference shouldn't do any persistence itself. We want to avoid that a value
// is written that is not set by the user but set from an experiment.
setPersistent(false);
setChecked(ActivityStream.isEnabled(context));
}
@Override
public boolean isPersistent() {
// Just be absolutely sure that no one re-sets this value since calling init().
return false;
}
@Override
protected void onClick() {
super.onClick();
ActivityStream.setUserEnabled(getContext(), isChecked());
// We require a restart for this change to take effect. This is not nice, but this setting
// is not something we want to ship outside of Nightly anyways.
ThreadUtils.postDelayedToUiThread(new Runnable() {
@Override
public void run() {
GeckoAppShell.scheduleRestart();
}
}, 1000);
}
}

Просмотреть файл

@ -168,7 +168,7 @@ public class GeckoPreferences
public static final String PREFS_READ_PARTNER_CUSTOMIZATIONS_PROVIDER = NON_PREF_PREFIX + "distribution.read_partner_customizations_provider";
public static final String PREFS_READ_PARTNER_BOOKMARKS_PROVIDER = NON_PREF_PREFIX + "distribution.read_partner_bookmarks_provider";
public static final String PREFS_CUSTOM_TABS = NON_PREF_PREFIX + "customtabs";
public static final String PREFS_ACTIVITY_STREAM = NON_PREF_PREFIX + "activitystream";
public static final String PREFS_ACTIVITY_STREAM = NON_PREF_PREFIX + "experiments.activitystream";
public static final String PREFS_CATEGORY_EXPERIMENTAL_FEATURES = NON_PREF_PREFIX + "category_experimental";
public static final String PREFS_COMPACT_TABS = NON_PREF_PREFIX + "compact_tabs";
public static final String PREFS_SHOW_QUIT_MENU = NON_PREF_PREFIX + "distribution.show_quit_menu";
@ -714,7 +714,6 @@ public class GeckoPreferences
i--;
continue;
} else if (PREFS_CATEGORY_EXPERIMENTAL_FEATURES.equals(key)
&& !AppConstants.MOZ_ANDROID_ACTIVITY_STREAM
&& !AppConstants.MOZ_ANDROID_CUSTOM_TABS) {
preferences.removePreference(pref);
i--;
@ -915,7 +914,8 @@ public class GeckoPreferences
preferences.removePreference(pref);
i--;
continue;
} else if (PREFS_ACTIVITY_STREAM.equals(key) && !ActivityStream.isUserEligible(this)) {
} else if (PREFS_ACTIVITY_STREAM.equals(key)
&& !ActivityStream.isUserSwitchable(this)) {
preferences.removePreference(pref);
i--;
continue;
@ -1241,13 +1241,6 @@ public class GeckoPreferences
}
} else if (PREFS_NOTIFICATIONS_CONTENT.equals(prefName)) {
FeedService.setup(this);
} else if (PREFS_ACTIVITY_STREAM.equals(prefName)) {
ThreadUtils.postDelayedToUiThread(new Runnable() {
@Override
public void run() {
GeckoAppShell.scheduleRestart();
}
}, 1000);
} else if (HANDLERS.containsKey(prefName)) {
PrefHandler handler = HANDLERS.get(prefName);
handler.onChange(this, preference, newValue);

Просмотреть файл

@ -1123,8 +1123,7 @@ for var in ('MOZ_ANDROID_ANR_REPORTER', 'MOZ_DEBUG',
'MOZ_ANDROID_DOWNLOADS_INTEGRATION', 'MOZ_INSTALL_TRACKING',
'MOZ_ANDROID_GCM', 'MOZ_ANDROID_EXCLUDE_FONTS', 'MOZ_LOCALE_SWITCHER',
'MOZ_ANDROID_BEAM', 'MOZ_ANDROID_DOWNLOAD_CONTENT_SERVICE',
'MOZ_SWITCHBOARD', 'MOZ_ANDROID_CUSTOM_TABS',
'MOZ_ANDROID_ACTIVITY_STREAM'):
'MOZ_SWITCHBOARD', 'MOZ_ANDROID_CUSTOM_TABS'):
if CONFIG[var]:
DEFINES[var] = 1

Просмотреть файл

@ -84,10 +84,10 @@
android:key="android.not_a_preference.category_experimental"
android:title="@string/pref_category_experimental">
<SwitchPreference android:key="android.not_a_preference.activitystream"
<org.mozilla.gecko.activitystream.ActivityStreamPreference
android:key="android.not_a_preference.experiments.activitystream"
android:title="@string/pref_activity_stream"
android:summary="@string/pref_activity_stream_summary"
android:defaultValue="false" />
android:summary="@string/pref_activity_stream_summary" />
<SwitchPreference android:key="android.not_a_preference.customtabs"

Просмотреть файл

@ -4080,10 +4080,8 @@ Tab.prototype = {
this.browser.addEventListener("pagehide", listener, true);
}
if (AppConstants.NIGHTLY_BUILD || AppConstants.MOZ_ANDROID_ACTIVITY_STREAM) {
if (!docURI.startsWith("about:")) {
WebsiteMetadata.parseAsynchronously(this.browser.contentDocument);
}
if (!docURI.startsWith("about:")) {
WebsiteMetadata.parseAsynchronously(this.browser.contentDocument);
}
break;

Просмотреть файл

@ -48,13 +48,6 @@ project_flag('MOZ_SWITCHBOARD',
help='Include Switchboard A/B framework on Android',
default=True)
option(env='MOZ_ANDROID_ACTIVITY_STREAM',
help='Enable Activity Stream on Android (replacing the default HomePager)',
default=False)
set_config('MOZ_ANDROID_ACTIVITY_STREAM',
depends_if('MOZ_ANDROID_ACTIVITY_STREAM')(lambda _: True))
option(env='MOZ_ANDROID_PACKAGE_INSTALL_BOUNCER',
help='Build and package the install bouncer APK',
default=True)

Просмотреть файл

@ -144,6 +144,7 @@ DEBIAN_DISTROS = (
'Elementary OS',
'Elementary',
'"elementary OS"',
'"elementary"'
)

Просмотреть файл

@ -99,11 +99,11 @@ PasswordEngine.prototype = {
},
pullAllChanges() {
let changeset = new Changeset();
let changes = {};
for (let [id, info] of Object.entries(this._store.getAllIDs())) {
changeset.set(id, info.timePasswordChanged);
changes[id] = info.timePasswordChanged / 1000;
}
return changeset;
return changes;
}
};

Просмотреть файл

@ -0,0 +1,135 @@
Cu.import("resource://services-sync/engines/passwords.js");
Cu.import("resource://services-sync/service.js");
Cu.import("resource://testing-common/services/sync/utils.js");
const LoginInfo = Components.Constructor(
"@mozilla.org/login-manager/loginInfo;1", Ci.nsILoginInfo, "init");
const PropertyBag = Components.Constructor(
"@mozilla.org/hash-property-bag;1", Ci.nsIWritablePropertyBag);
function serverForEngine(engine) {
let clientsEngine = Service.clientsEngine;
return serverForUsers({"foo": "password"}, {
meta: {
global: {
syncID: Service.syncID,
storageVersion: STORAGE_VERSION,
engines: {
clients: {
version: clientsEngine.version,
syncID: clientsEngine.syncID,
},
[engine.name]: {
version: engine.version,
syncID: engine.syncID,
},
},
},
},
crypto: {
keys: encryptPayload({
id: "keys",
// Generate a fake default key bundle to avoid resetting the client
// before the first sync.
default: [
Svc.Crypto.generateRandomKey(),
Svc.Crypto.generateRandomKey(),
],
}),
},
[engine.name]: {},
});
}
add_task(async function test_password_engine() {
_("Basic password sync test");
let engine = Service.engineManager.get("passwords");
let store = engine._store;
let server = serverForEngine(engine);
await SyncTestingInfrastructure(server);
let collection = server.user("foo").collection("passwords");
generateNewKeys(Service.collectionKeys);
enableValidationPrefs();
_("Add new login to upload during first sync");
let newLogin;
{
let login = new LoginInfo("https://example.com", "", null, "username",
"password", "", "");
Services.logins.addLogin(login);
let logins = Services.logins.findLogins({}, "https://example.com", "", "");
equal(logins.length, 1, "Should find new login in login manager");
newLogin = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
// Insert a server record that's older, so that we prefer the local one.
let rec = new LoginRec("passwords", newLogin.guid);
rec.formSubmitURL = newLogin.formSubmitURL;
rec.httpRealm = newLogin.httpRealm;
rec.hostname = newLogin.hostname;
rec.username = newLogin.username;
rec.password = "sekrit";
let remotePasswordChangeTime = Date.now() - 1 * 60 * 60 * 24 * 1000;
rec.timeCreated = remotePasswordChangeTime;
rec.timePasswordChanged = remotePasswordChangeTime;
collection.insert(newLogin.guid, encryptPayload(rec.cleartext),
remotePasswordChangeTime / 1000);
}
_("Add login with older password change time to replace during first sync");
let oldLogin;
{
let login = new LoginInfo("https://mozilla.com", "", null, "us3r",
"0ldpa55", "", "");
Services.logins.addLogin(login);
let props = new PropertyBag();
let localPasswordChangeTime = Date.now() - 1 * 60 * 60 * 24 * 1000;
props.setProperty("timePasswordChanged", localPasswordChangeTime);
Services.logins.modifyLogin(login, props);
let logins = Services.logins.findLogins({}, "https://mozilla.com", "", "");
equal(logins.length, 1, "Should find old login in login manager");
oldLogin = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
equal(oldLogin.timePasswordChanged, localPasswordChangeTime);
let rec = new LoginRec("passwords", oldLogin.guid);
rec.hostname = oldLogin.hostname;
rec.formSubmitURL = oldLogin.formSubmitURL;
rec.httpRealm = oldLogin.httpRealm;
rec.username = oldLogin.username;
// Change the password and bump the password change time to ensure we prefer
// the remote one during reconciliation.
rec.password = "n3wpa55";
rec.usernameField = oldLogin.usernameField;
rec.passwordField = oldLogin.usernameField;
rec.timeCreated = oldLogin.timeCreated;
rec.timePasswordChanged = Date.now();
collection.insert(oldLogin.guid, encryptPayload(rec.cleartext));
}
Svc.Obs.notify("weave:engine:start-tracking");
try {
await sync_engine_and_validate_telem(engine, false);
let newRec = JSON.parse(JSON.parse(
collection.payload(newLogin.guid)).ciphertext);
equal(newRec.password, "password",
"Should update remote password for newer login");
let logins = Services.logins.findLogins({}, "https://mozilla.com", "", "");
equal(logins[0].password, "n3wpa55",
"Should update local password for older login");
} finally {
store.wipe();
Svc.Prefs.resetBranch("");
Service.recordManager.clearCache();
await promiseStopServer(server);
Svc.Obs.notify("weave:engine:stop-tracking");
}
});

Просмотреть файл

@ -160,6 +160,7 @@ skip-if = debug
# Too many intermittent "ASSERTION: thread pool wasn't shutdown: '!mPool'" (bug 804479)
skip-if = debug
[test_places_guid_downgrade.js]
[test_password_engine.js]
[test_password_store.js]
[test_password_validator.js]
[test_password_tracker.js]

146
servo/Cargo.lock сгенерированный
Просмотреть файл

@ -29,13 +29,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "android_glue"
version = "0.2.1"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "android_injected_glue"
version = "0.2.1"
source = "git+https://github.com/mmatyas/android-rs-injected-glue#d3223d1273d0dafcf06d6a6405fedfffbf257300"
version = "0.2.2"
source = "git+https://github.com/mmatyas/android-rs-injected-glue#1995be2c692d8d1f4c82d387c06c56451721cc38"
[[package]]
name = "angle"
@ -96,8 +96,8 @@ dependencies = [
[[package]]
name = "azure"
version = "0.14.0"
source = "git+https://github.com/servo/rust-azure#07a57c4b32cd111cbc4ee1ff80a98a3f3ec3fbec"
version = "0.15.0"
source = "git+https://github.com/servo/rust-azure#4e65796956dc1f144a966b972ab601b3315ac833"
dependencies = [
"cmake 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -108,7 +108,7 @@ dependencies = [
"libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
"servo-egl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"servo-freetype-sys 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"servo-skia 0.30000003.0 (registry+https://github.com/rust-lang/crates.io-index)",
"servo-skia 0.30000004.1 (registry+https://github.com/rust-lang/crates.io-index)",
"x11 2.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -274,17 +274,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "canvas"
version = "0.0.1"
dependencies = [
"azure 0.14.0 (git+https://github.com/servo/rust-azure)",
"azure 0.15.0 (git+https://github.com/servo/rust-azure)",
"canvas_traits 0.0.1",
"cssparser 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
"offscreen_gl_context 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"offscreen_gl_context 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)",
"servo_config 0.0.1",
"webrender_traits 0.25.0 (git+https://github.com/servo/webrender)",
"webrender_traits 0.26.0 (git+https://github.com/servo/webrender)",
]
[[package]]
@ -298,7 +298,7 @@ dependencies = [
"ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_traits 0.25.0 (git+https://github.com/servo/webrender)",
"webrender_traits 0.26.0 (git+https://github.com/servo/webrender)",
]
[[package]]
@ -325,10 +325,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "cgl"
version = "0.1.5"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gleam 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -406,7 +406,7 @@ version = "0.0.1"
dependencies = [
"euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx_traits 0.0.1",
"gleam 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
@ -419,8 +419,8 @@ dependencies = [
"servo_url 0.0.1",
"style_traits 0.0.1",
"time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender 0.24.0 (git+https://github.com/servo/webrender)",
"webrender_traits 0.25.0 (git+https://github.com/servo/webrender)",
"webrender 0.25.0 (git+https://github.com/servo/webrender)",
"webrender_traits 0.26.0 (git+https://github.com/servo/webrender)",
]
[[package]]
@ -443,7 +443,7 @@ dependencies = [
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net_traits 0.0.1",
"offscreen_gl_context 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"offscreen_gl_context 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)",
"profile_traits 0.0.1",
"script_traits 0.0.1",
"serde 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
@ -453,7 +453,7 @@ dependencies = [
"servo_remutex 0.0.1",
"servo_url 0.0.1",
"style_traits 0.0.1",
"webrender_traits 0.25.0 (git+https://github.com/servo/webrender)",
"webrender_traits 0.26.0 (git+https://github.com/servo/webrender)",
"webvr_traits 0.0.1",
]
@ -685,7 +685,7 @@ dependencies = [
"compositing 0.0.1",
"devtools 0.0.1",
"euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin_app 0.0.1",
"libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
"libservo 0.0.1",
@ -698,7 +698,7 @@ dependencies = [
"servo_geometry 0.0.1",
"servo_url 0.0.1",
"style_traits 0.0.1",
"webrender_traits 0.25.0 (git+https://github.com/servo/webrender)",
"webrender_traits 0.26.0 (git+https://github.com/servo/webrender)",
"x11 2.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -980,7 +980,7 @@ dependencies = [
"time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
"truetype 0.26.0 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_traits 0.25.0 (git+https://github.com/servo/webrender)",
"webrender_traits 0.26.0 (git+https://github.com/servo/webrender)",
"xi-unicode 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1025,7 +1025,7 @@ dependencies = [
[[package]]
name = "gleam"
version = "0.2.32"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gl_generator 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1045,7 +1045,7 @@ dependencies = [
"compositing 0.0.1",
"euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net_traits 0.0.1",
@ -1053,13 +1053,13 @@ dependencies = [
"osmesa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"servo-egl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"servo-glutin 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"servo-glutin 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"servo_config 0.0.1",
"servo_geometry 0.0.1",
"servo_url 0.0.1",
"style_traits 0.0.1",
"user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_traits 0.25.0 (git+https://github.com/servo/webrender)",
"webrender_traits 0.26.0 (git+https://github.com/servo/webrender)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"x11 2.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1241,12 +1241,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "io-surface"
version = "0.6.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cgl 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"leaky-cow 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1370,7 +1370,7 @@ dependencies = [
"style_traits 0.0.1",
"unicode-bidi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_traits 0.25.0 (git+https://github.com/servo/webrender)",
"webrender_traits 0.26.0 (git+https://github.com/servo/webrender)",
]
[[package]]
@ -1410,7 +1410,7 @@ dependencies = [
"servo_geometry 0.0.1",
"servo_url 0.0.1",
"style 0.0.1",
"webrender_traits 0.25.0 (git+https://github.com/servo/webrender)",
"webrender_traits 0.26.0 (git+https://github.com/servo/webrender)",
]
[[package]]
@ -1424,7 +1424,7 @@ dependencies = [
"profile_traits 0.0.1",
"script_traits 0.0.1",
"servo_url 0.0.1",
"webrender_traits 0.25.0 (git+https://github.com/servo/webrender)",
"webrender_traits 0.26.0 (git+https://github.com/servo/webrender)",
]
[[package]]
@ -1491,7 +1491,7 @@ dependencies = [
"euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gaol 0.0.1 (git+https://github.com/servo/gaol)",
"gfx 0.0.1",
"gleam 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"layout_thread 0.0.1",
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1509,8 +1509,8 @@ dependencies = [
"style 0.0.1",
"style_traits 0.0.1",
"webdriver_server 0.0.1",
"webrender 0.24.0 (git+https://github.com/servo/webrender)",
"webrender_traits 0.25.0 (git+https://github.com/servo/webrender)",
"webrender 0.25.0 (git+https://github.com/servo/webrender)",
"webrender_traits 0.26.0 (git+https://github.com/servo/webrender)",
"webvr 0.0.1",
"webvr_traits 0.0.1",
]
@ -1659,7 +1659,7 @@ dependencies = [
"heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_traits 0.25.0 (git+https://github.com/servo/webrender)",
"webrender_traits 0.26.0 (git+https://github.com/servo/webrender)",
]
[[package]]
@ -1701,7 +1701,7 @@ dependencies = [
"unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_traits 0.25.0 (git+https://github.com/servo/webrender)",
"webrender_traits 0.26.0 (git+https://github.com/servo/webrender)",
]
[[package]]
@ -1760,7 +1760,7 @@ dependencies = [
"servo_url 0.0.1",
"url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_traits 0.25.0 (git+https://github.com/servo/webrender)",
"webrender_traits 0.26.0 (git+https://github.com/servo/webrender)",
]
[[package]]
@ -1841,15 +1841,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "offscreen_gl_context"
version = "0.6.1"
version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cgl 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gl_generator 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2275,7 +2275,7 @@ dependencies = [
"msg 0.0.1",
"net_traits 0.0.1",
"num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
"offscreen_gl_context 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"offscreen_gl_context 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)",
"open 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2306,7 +2306,7 @@ dependencies = [
"tinyfiledialogs 2.5.9 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_traits 0.25.0 (git+https://github.com/servo/webrender)",
"webrender_traits 0.26.0 (git+https://github.com/servo/webrender)",
"webvr 0.0.1",
"webvr_traits 0.0.1",
"xml5ever 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2371,7 +2371,7 @@ dependencies = [
"libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net_traits 0.0.1",
"offscreen_gl_context 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"offscreen_gl_context 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)",
"profile_traits 0.0.1",
"rustc-serialize 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2436,7 +2436,7 @@ dependencies = [
name = "servo"
version = "0.0.1"
dependencies = [
"android_injected_glue 0.2.1 (git+https://github.com/mmatyas/android-rs-injected-glue)",
"android_injected_glue 0.2.2 (git+https://github.com/mmatyas/android-rs-injected-glue)",
"backtrace 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"browserhtml 0.1.17 (git+https://github.com/browserhtml/browserhtml?branch=crate)",
"compiletest_helper 0.0.1",
@ -2494,11 +2494,11 @@ dependencies = [
[[package]]
name = "servo-glutin"
version = "0.9.0"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"android_glue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cgl 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"android_glue 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cocoa 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-graphics 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2520,21 +2520,21 @@ dependencies = [
[[package]]
name = "servo-skia"
version = "0.30000003.0"
version = "0.30000004.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cgl 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cmake 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"expat-sys 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"glx 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"io-surface 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"io-surface 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
"servo-egl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"servo-fontconfig-sys 4.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"servo-freetype-sys 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"servo-glutin 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"servo-glutin 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"x11 2.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -3179,8 +3179,8 @@ dependencies = [
[[package]]
name = "webrender"
version = "0.24.0"
source = "git+https://github.com/servo/webrender#e30fb2914928c0e596d8632ed234647c0fd1492e"
version = "0.25.0"
source = "git+https://github.com/servo/webrender#0794911f97cae92496fca992d7430da696fa24eb"
dependencies = [
"app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bincode 1.0.0-alpha2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -3194,31 +3194,31 @@ dependencies = [
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"freetype 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gamma-lut 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
"offscreen_gl_context 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"offscreen_gl_context 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)",
"thread_profiler 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"threadpool 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_traits 0.25.0 (git+https://github.com/servo/webrender)",
"webrender_traits 0.26.0 (git+https://github.com/servo/webrender)",
]
[[package]]
name = "webrender_traits"
version = "0.25.0"
source = "git+https://github.com/servo/webrender#e30fb2914928c0e596d8632ed234647c0fd1492e"
version = "0.26.0"
source = "git+https://github.com/servo/webrender#0794911f97cae92496fca992d7430da696fa24eb"
dependencies = [
"app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-graphics 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"dwrote 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"offscreen_gl_context 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"offscreen_gl_context 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -3232,7 +3232,7 @@ dependencies = [
"msg 0.0.1",
"script_traits 0.0.1",
"servo_config 0.0.1",
"webrender_traits 0.25.0 (git+https://github.com/servo/webrender)",
"webrender_traits 0.26.0 (git+https://github.com/servo/webrender)",
"webvr_traits 0.0.1",
]
@ -3326,8 +3326,8 @@ dependencies = [
"checksum adler32 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "57be033eb4100070a93a9400a725839cda9c415244f808b0357e72b9e003d5ba"
"checksum aho-corasick 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0638fd549427caa90c499814196d1b9e3725eb4d15d7339d6de073a680ed0ca2"
"checksum alloc-no-stdlib 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b21f6ad9c9957eb5d70c3dee16d31c092b3cab339628f821766b05e6833d72b8"
"checksum android_glue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e2b80445d331077679dfc6f3014f3e9ab7083e588423d35041d3fc017198189"
"checksum android_injected_glue 0.2.1 (git+https://github.com/mmatyas/android-rs-injected-glue)" = "<none>"
"checksum android_glue 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d8289e9637439939cc92b1995b0972117905be88bc28116c86b64d6e589bcd38"
"checksum android_injected_glue 0.2.2 (git+https://github.com/mmatyas/android-rs-injected-glue)" = "<none>"
"checksum angle 0.1.2 (git+https://github.com/servo/angle?branch=servo)" = "<none>"
"checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6"
"checksum app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5a0c3b5be4ed53affe3e1a162b2e7ef9979bcaac80daa9026e9d7988c41e0e83"
@ -3335,7 +3335,7 @@ dependencies = [
"checksum aster 0.38.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2c9b49e42a449c0b79d8acb91db37621de0978064dca7d3288ddcf030123e5b3"
"checksum atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb2dcb6e6d35f20276943cc04bb98e538b348d525a04ac79c10021561d202f21"
"checksum audio-video-metadata 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3b6ef29ee98ad95a37f34547fd7fb40724772294110ed6ca0445fc2e964c29d1"
"checksum azure 0.14.0 (git+https://github.com/servo/rust-azure)" = "<none>"
"checksum azure 0.15.0 (git+https://github.com/servo/rust-azure)" = "<none>"
"checksum backtrace 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f551bc2ddd53aea015d453ef0b635af89444afa5ed2405dd0b2062ad5d600d80"
"checksum backtrace-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d192fd129132fbc97497c1f2ec2c2c5174e376b95f535199ef4fe0a293d33842"
"checksum bincode 1.0.0-alpha2 (registry+https://github.com/rust-lang/crates.io-index)" = "62650bb5651ba8f0580cebf4ef255d791b8b0ef53800322661e1bb5791d42966"
@ -3355,7 +3355,7 @@ dependencies = [
"checksum caseless 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8950b075cff75cdabadee97148a8b5816c7cf62e5948a6005b5255d564b42fe7"
"checksum cexpr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "393a5f0088efbe41f9d1fcd062f24e83c278608420e62109feb2c8abee07de7d"
"checksum cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c"
"checksum cgl 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "8bdd78cca65a739cb5475dbf6b6bbb49373e327f4a6f2b499c0f98632df38c10"
"checksum cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "86765cb42c2a2c497e142af72517c1b4d7ae5bb2f25dfa77a5c69642f2342d89"
"checksum clang-sys 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f98f0715ff67f27ca6a2f8f0ffc2a56f8edbc7acd57489c29eadc3a15c4eafe"
"checksum clap 2.20.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7db281b0520e97fbd15cd615dcd8f8bcad0c26f5f7d5effe705f090f39e9a758"
"checksum cmake 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "e1acc68a3f714627af38f9f5d09706a28584ba60dfe2cca68f40bf779f941b25"
@ -3407,7 +3407,7 @@ dependencies = [
"checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685"
"checksum gif 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "01c7c19a035de94bd7afbaa62c241aadfbdf1a70f560b348d2312eafa566ca16"
"checksum gl_generator 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1d8edc81c5ae84605a62f5dac661a2313003b26d59839f81d47d46cf0f16a55"
"checksum gleam 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)" = "9590e0e578d528a080c5abac678e7efbe349a73c7316faafd4073edf5f462d01"
"checksum gleam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2958396a0a358d2de747b31329f5ae2229070602b0f51edd5d682f92c307c332"
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
"checksum glx 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b280007fa9c7442cfd1e0b1addb8d1a59240267110e8705f8f7e2c7bfb7e2f72"
"checksum harfbuzz-sys 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "6b76113246f5c089dcf272cf89c3f61168a4d77b50ec5b2c1fab8c628c9ea762"
@ -3425,7 +3425,7 @@ dependencies = [
"checksum image 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "979bad0502082fd60053a490282e87d6c89650942e3a270e0d4c83569c7f5899"
"checksum immeta 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0b9260463a221bfe3f02100c56e2d14c050d5ffe7e44a43d0a1b2b1f2b523502"
"checksum inflate 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e7e0062d2dc2f17d2f13750d95316ae8a2ff909af0fda957084f5defd87c43bb"
"checksum io-surface 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "10d25285115b9d34be1328fdc5af15d34174472a9f23d1994d2d14a7ec8c537a"
"checksum io-surface 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c35a3278fa52fb070fdc874dfd057163e6c21e0a9295f87f54daee9dd5530b43"
"checksum iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "29d062ee61fccdf25be172e70f34c9f6efc597e1fb8f6526e8437b2046ab26be"
"checksum ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dc12beb3f43e226410d7f26a77aec73efbf0c11875a8131adc09f30a8219f22e"
"checksum itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eb2f404fbc66fd9aac13e998248505e7ecb2ad8e44ab6388684c5fb11c6c251c"
@ -3468,7 +3468,7 @@ dependencies = [
"checksum num_cpus 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a18c392466409c50b87369414a2680c93e739aedeb498eb2bff7d7eb569744e2"
"checksum objc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "877f30f37acef6749b1841cceab289707f211aecfc756553cd63976190e6cc2e"
"checksum odds 0.2.25 (registry+https://github.com/rust-lang/crates.io-index)" = "c3df9b730298cea3a1c3faa90b7e2f9df3a9c400d0936d6015e6165734eefcba"
"checksum offscreen_gl_context 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ac875ea951d7d695a1cc8c370777d6a0e2b7355ca49506034683df09b24b1bc"
"checksum offscreen_gl_context 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)" = "21ae15594e1c0b39fd4c79d0062b437904a274bed8b5e363e3e3c89312fd50fd"
"checksum ogg 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "013b78ceb7fb82555a2f8a95d8e40866fe64a5d15b83c51b3e1fdd40cd903ed3"
"checksum ogg_metadata 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1753e64956b3afd900f788bf6d2e9d0986df39168be86f4b47ec2058d0c2f7"
"checksum open 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3478ed1686bd1300c8a981a940abc92b06fac9cbef747f4c668d4e032ff7b842"
@ -3517,8 +3517,8 @@ dependencies = [
"checksum servo-fontconfig 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "93f799b649b4a2bf362398910eca35240704c7e765e780349b2bb1070d892262"
"checksum servo-fontconfig-sys 4.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a0af4a4d7746467921486e5c5420f815cc016a6bf5574210d8e9c00f4afae224"
"checksum servo-freetype-sys 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9232032c2e85118c0282c6562c84cab12316e655491ba0a5d1905b2320060d1b"
"checksum servo-glutin 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "51b682e1eef598db6048b64face7ea79fd55fe70d171cb92d2a44a89db7bdf34"
"checksum servo-skia 0.30000003.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e7107296909e71f69a7e8b95becf3efe3e1838e556430b3efc9dc91aea65ddf2"
"checksum servo-glutin 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17f541bd4b5a709d5133349e731379c6d74c3946f3b509d4fa8204f1833f9067"
"checksum servo-skia 0.30000004.1 (registry+https://github.com/rust-lang/crates.io-index)" = "22ba980da523e91b9d2f7da9fb35f721138a1e604b8d8191e56f403e4760a9e4"
"checksum servo-websocket 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a7445fde9aacb9a1f493652ab02ac0fb7a8bfe1e6cd762f7bd44b839a5d5e4c"
"checksum sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cc30b1e1e8c40c121ca33b86c23308a090d19974ef001b4bf6e61fd1a0fb095c"
"checksum shared_library 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fb04126b6fcfd2710fb5b6d18f4207b6c535f2850a7e1a43bcd526d44f30a79a"
@ -3574,8 +3574,8 @@ dependencies = [
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
"checksum walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bb08f9e670fab86099470b97cd2b252d6527f0b3cc1401acdb595ffc9dd288ff"
"checksum webdriver 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cdc28802daddee94267a657ffeac2593a33881fb7a3a44fedd320b1319efcaf6"
"checksum webrender 0.24.0 (git+https://github.com/servo/webrender)" = "<none>"
"checksum webrender_traits 0.25.0 (git+https://github.com/servo/webrender)" = "<none>"
"checksum webrender 0.25.0 (git+https://github.com/servo/webrender)" = "<none>"
"checksum webrender_traits 0.26.0 (git+https://github.com/servo/webrender)" = "<none>"
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
"checksum ws 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "04614a58714f3fd4a8b1da4bcae9f031c532d35988c3d39627619248113f8be8"

Просмотреть файл

@ -14,10 +14,10 @@ azure = {git = "https://github.com/servo/rust-azure"}
canvas_traits = {path = "../canvas_traits"}
cssparser = "0.12"
euclid = "0.11"
gleam = "0.2.8"
gleam = "0.4"
ipc-channel = "0.7"
log = "0.3.5"
num-traits = "0.1.32"
offscreen_gl_context = "0.6"
offscreen_gl_context = "0.8"
servo_config = {path = "../config"}
webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]}

Просмотреть файл

@ -22,17 +22,20 @@ enum GLContextWrapper {
impl GLContextWrapper {
fn new(size: Size2D<i32>,
attributes: GLContextAttributes) -> Result<GLContextWrapper, &'static str> {
attributes: GLContextAttributes,
gl_type: gl::GlType) -> Result<GLContextWrapper, &'static str> {
if opts::get().should_use_osmesa() {
let ctx = GLContext::<OSMesaContext>::new(size,
attributes,
ColorAttachmentType::Texture,
gl_type,
None);
ctx.map(GLContextWrapper::OSMesa)
} else {
let ctx = GLContext::<NativeGLContext>::new(size,
attributes,
ColorAttachmentType::Texture,
gl_type,
None);
ctx.map(GLContextWrapper::Native)
}
@ -62,6 +65,17 @@ impl GLContextWrapper {
}
}
fn gl(&self) -> &gl::Gl {
match *self {
GLContextWrapper::Native(ref ctx) => {
ctx.gl()
}
GLContextWrapper::OSMesa(ref ctx) => {
ctx.gl()
}
}
}
pub fn make_current(&self) {
match *self {
GLContextWrapper::Native(ref ctx) => {
@ -97,9 +111,10 @@ pub struct WebGLPaintThread {
fn create_readback_painter(size: Size2D<i32>,
attrs: GLContextAttributes,
webrender_api: webrender_traits::RenderApi)
webrender_api: webrender_traits::RenderApi,
gl_type: gl::GlType)
-> Result<(WebGLPaintThread, GLLimits), String> {
let context = try!(GLContextWrapper::new(size, attrs));
let context = try!(GLContextWrapper::new(size, attrs, gl_type));
let limits = context.get_limits();
let image_key = webrender_api.generate_image_key();
let painter = WebGLPaintThread {
@ -113,7 +128,8 @@ fn create_readback_painter(size: Size2D<i32>,
impl WebGLPaintThread {
fn new(size: Size2D<i32>,
attrs: GLContextAttributes,
webrender_api_sender: webrender_traits::RenderApiSender)
webrender_api_sender: webrender_traits::RenderApiSender,
gl_type: gl::GlType)
-> Result<(WebGLPaintThread, GLLimits), String> {
let wr_api = webrender_api_sender.create_api();
let device_size = webrender_traits::DeviceIntSize::from_untyped(&size);
@ -127,7 +143,7 @@ impl WebGLPaintThread {
},
Err(msg) => {
warn!("Initial context creation failed, falling back to readback: {}", msg);
create_readback_painter(size, attrs, wr_api)
create_readback_painter(size, attrs, wr_api, gl_type)
}
}
}
@ -165,7 +181,8 @@ impl WebGLPaintThread {
let (sender, receiver) = ipc::channel::<CanvasMsg>().unwrap();
let (result_chan, result_port) = channel();
thread::Builder::new().name("WebGLThread".to_owned()).spawn(move || {
let mut painter = match WebGLPaintThread::new(size, attrs, webrender_api_sender) {
let gl_type = gl::GlType::default();
let mut painter = match WebGLPaintThread::new(size, attrs, webrender_api_sender, gl_type) {
Ok((thread, limits)) => {
result_chan.send(Ok(limits)).unwrap();
thread
@ -212,14 +229,14 @@ impl WebGLPaintThread {
fn send_data(&mut self, chan: IpcSender<CanvasData>) {
match self.data {
WebGLPaintTaskData::Readback(_, ref webrender_api, image_key) => {
WebGLPaintTaskData::Readback(ref ctx, ref webrender_api, image_key) => {
let width = self.size.width as usize;
let height = self.size.height as usize;
let mut pixels = gl::read_pixels(0, 0,
self.size.width as gl::GLsizei,
self.size.height as gl::GLsizei,
gl::RGBA, gl::UNSIGNED_BYTE);
let mut pixels = ctx.gl().read_pixels(0, 0,
self.size.width as gl::GLsizei,
self.size.height as gl::GLsizei,
gl::RGBA, gl::UNSIGNED_BYTE);
// flip image vertically (texture is upside down)
let orig_pixels = pixels.clone();
let stride = width * 4;
@ -267,7 +284,7 @@ impl WebGLPaintThread {
self.size = try!(context.resize(size));
} else {
self.size = size;
unsafe { gl::Scissor(0, 0, size.width, size.height); }
context.gl().scissor(0, 0, size.width, size.height);
}
}
WebGLPaintTaskData::WebRender(ref api, id) => {

Просмотреть файл

@ -12,7 +12,7 @@ path = "lib.rs"
[dependencies]
euclid = "0.11"
gfx_traits = {path = "../gfx_traits"}
gleam = "0.2.8"
gleam = "0.4"
image = "0.12"
ipc-channel = "0.7"
log = "0.3.5"

Просмотреть файл

@ -14,7 +14,6 @@ use euclid::scale_factor::ScaleFactor;
use euclid::size::TypedSize2D;
use gfx_traits::{Epoch, ScrollRootId};
use gleam::gl;
use gleam::gl::types::{GLint, GLsizei};
use image::{DynamicImage, ImageFormat, RgbImage};
use ipc_channel::ipc::{self, IpcSender, IpcSharedMemory};
use msg::constellation_msg::{Key, KeyModifiers, KeyState, CONTROL};
@ -40,7 +39,7 @@ use style_traits::viewport::ViewportConstraints;
use time::{precise_time_ns, precise_time_s};
use touch::{TouchHandler, TouchAction};
use webrender;
use webrender_traits::{self, ScrollEventPhase, ServoScrollRootId, LayoutPoint, ScrollLocation};
use webrender_traits::{self, LayoutPoint, ScrollEventPhase, ScrollLayerId, ScrollLocation};
use windowing::{self, MouseWindowEvent, WindowEvent, WindowMethods, WindowNavigateMsg};
#[derive(Debug, PartialEq)]
@ -77,9 +76,9 @@ trait ConvertScrollRootIdFromWebRender {
fn from_webrender(&self) -> ScrollRootId;
}
impl ConvertScrollRootIdFromWebRender for webrender_traits::ServoScrollRootId {
impl ConvertScrollRootIdFromWebRender for usize {
fn from_webrender(&self) -> ScrollRootId {
ScrollRootId(self.0)
ScrollRootId(*self)
}
}
@ -208,6 +207,9 @@ pub struct IOCompositor<Window: WindowMethods> {
/// The webrender interface, if enabled.
webrender_api: webrender_traits::RenderApi,
/// GL functions interface (may be GL or GLES)
gl: Rc<gl::Gl>,
}
#[derive(Copy, Clone)]
@ -291,34 +293,34 @@ impl RenderTargetInfo {
}
}
fn initialize_png(width: usize, height: usize) -> RenderTargetInfo {
let framebuffer_ids = gl::gen_framebuffers(1);
gl::bind_framebuffer(gl::FRAMEBUFFER, framebuffer_ids[0]);
fn initialize_png(gl: &gl::Gl, width: usize, height: usize) -> RenderTargetInfo {
let framebuffer_ids = gl.gen_framebuffers(1);
gl.bind_framebuffer(gl::FRAMEBUFFER, framebuffer_ids[0]);
let texture_ids = gl::gen_textures(1);
gl::bind_texture(gl::TEXTURE_2D, texture_ids[0]);
let texture_ids = gl.gen_textures(1);
gl.bind_texture(gl::TEXTURE_2D, texture_ids[0]);
gl::tex_image_2d(gl::TEXTURE_2D, 0, gl::RGB as GLint, width as GLsizei,
height as GLsizei, 0, gl::RGB, gl::UNSIGNED_BYTE, None);
gl::tex_parameter_i(gl::TEXTURE_2D, gl::TEXTURE_MAG_FILTER, gl::NEAREST as GLint);
gl::tex_parameter_i(gl::TEXTURE_2D, gl::TEXTURE_MIN_FILTER, gl::NEAREST as GLint);
gl.tex_image_2d(gl::TEXTURE_2D, 0, gl::RGB as gl::GLint, width as gl::GLsizei,
height as gl::GLsizei, 0, gl::RGB, gl::UNSIGNED_BYTE, None);
gl.tex_parameter_i(gl::TEXTURE_2D, gl::TEXTURE_MAG_FILTER, gl::NEAREST as gl::GLint);
gl.tex_parameter_i(gl::TEXTURE_2D, gl::TEXTURE_MIN_FILTER, gl::NEAREST as gl::GLint);
gl::framebuffer_texture_2d(gl::FRAMEBUFFER, gl::COLOR_ATTACHMENT0, gl::TEXTURE_2D,
texture_ids[0], 0);
gl.framebuffer_texture_2d(gl::FRAMEBUFFER, gl::COLOR_ATTACHMENT0, gl::TEXTURE_2D,
texture_ids[0], 0);
gl::bind_texture(gl::TEXTURE_2D, 0);
gl.bind_texture(gl::TEXTURE_2D, 0);
let renderbuffer_ids = gl::gen_renderbuffers(1);
let renderbuffer_ids = gl.gen_renderbuffers(1);
let depth_rb = renderbuffer_ids[0];
gl::bind_renderbuffer(gl::RENDERBUFFER, depth_rb);
gl::renderbuffer_storage(gl::RENDERBUFFER,
gl::DEPTH_COMPONENT24,
width as gl::GLsizei,
height as gl::GLsizei);
gl::framebuffer_renderbuffer(gl::FRAMEBUFFER,
gl::DEPTH_ATTACHMENT,
gl::RENDERBUFFER,
depth_rb);
gl.bind_renderbuffer(gl::RENDERBUFFER, depth_rb);
gl.renderbuffer_storage(gl::RENDERBUFFER,
gl::DEPTH_COMPONENT24,
width as gl::GLsizei,
height as gl::GLsizei);
gl.framebuffer_renderbuffer(gl::FRAMEBUFFER,
gl::DEPTH_ATTACHMENT,
gl::RENDERBUFFER,
depth_rb);
RenderTargetInfo {
framebuffer_ids: framebuffer_ids,
@ -373,6 +375,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
};
IOCompositor {
gl: window.gl(),
window: window,
port: state.receiver,
root_pipeline: None,
@ -791,10 +794,8 @@ impl<Window: WindowMethods> IOCompositor<Window> {
pipeline_id: PipelineId,
scroll_root_id: ScrollRootId,
point: Point2D<f32>) {
self.webrender_api.scroll_layers_with_scroll_root_id(
LayoutPoint::from_untyped(&point),
pipeline_id.to_webrender(),
ServoScrollRootId(scroll_root_id.0));
let id = ScrollLayerId::new(scroll_root_id.0, pipeline_id.to_webrender());
self.webrender_api.scroll_layer_with_id(LayoutPoint::from_untyped(&point), id);
}
fn handle_window_message(&mut self, event: WindowEvent) {
@ -1386,13 +1387,18 @@ impl<Window: WindowMethods> IOCompositor<Window> {
fn send_viewport_rects(&self) {
let mut stacking_context_scroll_states_per_pipeline = HashMap::new();
for scroll_layer_state in self.webrender_api.get_scroll_layer_state() {
let external_id = match scroll_layer_state.id.external_id() {
Some(id) => id,
None => continue,
};
let stacking_context_scroll_state = StackingContextScrollState {
scroll_root_id: scroll_layer_state.scroll_root_id.from_webrender(),
scroll_root_id: external_id.from_webrender(),
scroll_offset: scroll_layer_state.scroll_offset.to_untyped(),
};
let pipeline_id = scroll_layer_state.pipeline_id;
stacking_context_scroll_states_per_pipeline
.entry(pipeline_id)
.entry(scroll_layer_state.id.pipeline_id())
.or_insert(vec![])
.push(stacking_context_scroll_state);
}
@ -1529,7 +1535,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
let render_target_info = match target {
CompositeTarget::Window => RenderTargetInfo::empty(),
_ => initialize_png(width, height)
_ => initialize_png(&*self.gl, width, height)
};
profile(ProfilerCategory::Compositing, None, self.time_profiler_chan.clone(), || {
@ -1593,16 +1599,16 @@ impl<Window: WindowMethods> IOCompositor<Window> {
width: usize,
height: usize)
-> RgbImage {
let mut pixels = gl::read_pixels(0, 0,
width as gl::GLsizei,
height as gl::GLsizei,
gl::RGB, gl::UNSIGNED_BYTE);
let mut pixels = self.gl.read_pixels(0, 0,
width as gl::GLsizei,
height as gl::GLsizei,
gl::RGB, gl::UNSIGNED_BYTE);
gl::bind_framebuffer(gl::FRAMEBUFFER, 0);
self.gl.bind_framebuffer(gl::FRAMEBUFFER, 0);
gl::delete_buffers(&render_target_info.texture_ids);
gl::delete_renderbuffers(&render_target_info.renderbuffer_ids);
gl::delete_frame_buffers(&render_target_info.framebuffer_ids);
self.gl.delete_buffers(&render_target_info.texture_ids);
self.gl.delete_renderbuffers(&render_target_info.renderbuffer_ids);
self.gl.delete_framebuffers(&render_target_info.framebuffer_ids);
// flip image vertically (texture is upside down)
let orig_pixels = pixels.clone();

Просмотреть файл

@ -10,12 +10,14 @@ use euclid::point::TypedPoint2D;
use euclid::rect::TypedRect;
use euclid::scale_factor::ScaleFactor;
use euclid::size::TypedSize2D;
use gleam::gl;
use msg::constellation_msg::{Key, KeyModifiers, KeyState};
use net_traits::net_error_list::NetError;
use script_traits::{DevicePixel, MouseButton, TouchEventType, TouchId, TouchpadPressurePhase};
use servo_geometry::DeviceIndependentPixel;
use servo_url::ServoUrl;
use std::fmt::{Debug, Error, Formatter};
use std::rc::Rc;
use style_traits::cursor::Cursor;
use webrender_traits::ScrollLocation;
@ -168,4 +170,7 @@ pub trait WindowMethods {
/// Add a favicon
fn set_favicon(&self, url: ServoUrl);
/// Return the GL function pointer trait.
fn gl(&self) -> Rc<gl::Gl>;
}

Просмотреть файл

@ -25,7 +25,7 @@ layout_traits = {path = "../layout_traits"}
log = "0.3.5"
msg = {path = "../msg"}
net_traits = {path = "../net_traits"}
offscreen_gl_context = "0.6"
offscreen_gl_context = "0.8"
profile_traits = {path = "../profile_traits"}
script_traits = {path = "../script_traits"}
serde = "0.9"

Просмотреть файл

@ -434,6 +434,7 @@ impl StackingContext {
pub fn to_display_list_items(self) -> (DisplayItem, DisplayItem) {
let mut base_item = BaseDisplayItem::empty();
base_item.stacking_context_id = self.id;
base_item.scroll_root_id = self.parent_scroll_id;
let pop_item = DisplayItem::PopStackingContext(Box::new(
PopStackingContextItem {

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше