Merge mozilla-central to mozilla-inbound r=merge

This commit is contained in:
Dorel Luca 2018-01-18 11:49:19 +02:00
Родитель 65c6ae3237 a066bff27d
Коммит a6794c3a54
186 изменённых файлов: 1911 добавлений и 1127 удалений

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

@ -149,10 +149,10 @@ GPATH
^testing/talos/talos/mitmproxy/mitmproxy
^testing/talos/talos/mitmproxy/mitmweb
# Ignore talos speedometer files; source is copied from in-tree /third_party
# into testing/talos/talos/tests/webkit/PerformanceTests/Speedometer when
# talos speedometer test is run locally
^testing/talos/talos/tests/webkit/PerformanceTests/Speedometer
# Ignore talos webkit benchmark files; source is copied from in-tree /third_party
# into testing/talos/talos/tests/webkit/PerformanceTests/ when run locally
# i.e. speedometer, motionmark, stylebench
^testing/talos/talos/tests/webkit/PerformanceTests
# Ignore toolchains.json created by tooltool.
^toolchains\.json

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

@ -9,6 +9,9 @@ with Files("**"):
SPHINX_TREES['sslerrorreport'] = 'content/docs/sslerrorreport'
with Files('content/docs/sslerrorreport/**'):
SCHEDULES.exclusive = ['docs']
MOCHITEST_MANIFESTS += [
'content/test/general/mochitest.ini',
]

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

@ -259,6 +259,10 @@ var gPrivacyPane = {
gPrivacyPane._updateSanitizeSettingsButton.bind(gPrivacyPane));
Preferences.get("browser.privatebrowsing.autostart").on("change",
gPrivacyPane.updatePrivacyMicroControls.bind(gPrivacyPane));
Preferences.get("privacy.trackingprotection.enabled").on("change",
gPrivacyPane.trackingProtectionReadPrefs.bind(gPrivacyPane));
Preferences.get("privacy.trackingprotection.pbmode.enabled").on("change",
gPrivacyPane.trackingProtectionReadPrefs.bind(gPrivacyPane));
setEventListener("historyMode", "command", function() {
gPrivacyPane.updateHistoryModePane();
gPrivacyPane.updateHistoryModePrefs();

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

@ -71,7 +71,7 @@ var gSearchPane = {
document.getElementById("showSearchSuggestionsFirstCheckbox");
pref.on("change", () => {
this.syncFromShowSearchSuggestionsFirstPref(checkbox, pref);
this._syncFromShowSearchSuggestionsFirstPref(checkbox, pref);
});
this._syncFromShowSearchSuggestionsFirstPref(checkbox, pref);

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

@ -27,6 +27,14 @@ add_task(async function openWithSearchSuggestionsShownFirst() {
HISTORY_FIRST_PREF_VALUE,
"Pref should now be set to show history first");
// Clear the pref.
Services.prefs.clearUserPref(PREF_NAME);
// The checkbox should have become checked again.
Assert.equal(checkbox.checked, true,
"Checkbox should become checked after clearing pref");
// Clean up.
gBrowser.removeCurrentTab();
});
@ -49,5 +57,14 @@ add_task(async function openWithHistoryShownFirst() {
Assert.equal(Services.prefs.getCharPref(PREF_NAME, ""), "",
"Pref should now be cleared to show search suggestions first");
// Set the pref again.
Services.prefs.setCharPref(PREF_NAME, HISTORY_FIRST_PREF_VALUE);
// The checkbox should have become unchecked again.
Assert.equal(checkbox.checked, false,
"Checkbox should become unchecked after setting pref");
// Clean up.
gBrowser.removeCurrentTab();
Services.prefs.clearUserPref(PREF_NAME);
});

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

@ -12,6 +12,10 @@ Components.utils.import("resource://gre/modules/osfile.jsm");
const Ci = Components.interfaces;
// Refrences to the progress listeners to keep them from being gc'ed
// before they are called.
const progressListeners = new Map();
function loadContentWindow(webNavigation, uri) {
return new Promise((resolve, reject) => {
webNavigation.loadURI(uri, Ci.nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null);
@ -31,6 +35,7 @@ function loadContentWindow(webNavigation, uri) {
}
let contentWindow = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
progressListeners.delete(progressListener);
webProgress.removeProgressListener(progressListener);
contentWindow.addEventListener("load", (event) => {
resolve(contentWindow);
@ -39,6 +44,7 @@ function loadContentWindow(webNavigation, uri) {
QueryInterface: XPCOMUtils.generateQI(["nsIWebProgressListener",
"nsISupportsWeakReference"])
};
progressListeners.set(progressListener, progressListener);
webProgress.addProgressListener(progressListener,
Ci.nsIWebProgress.NOTIFY_LOCATION);
});

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

@ -19,3 +19,6 @@ EXTRA_JS_MODULES.experiments += [
XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell/xpcshell.ini']
SPHINX_TREES['experiments'] = 'docs'
with Files('docs/**'):
SCHEDULES.exclusive = ['docs']

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

@ -8,6 +8,9 @@ CONFIGURE_SUBST_FILES += ['installer/Makefile']
SPHINX_TREES['browser'] = 'docs'
with Files('docs/**'):
SCHEDULES.exclusive = ['docs']
DIRS += [
'base',
'components',

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

@ -1268,6 +1268,19 @@ toolbarpaletteitem[place="menu-panel"] > .subviewbutton-nav::after {
margin-inline-end: 0;
}
%ifdef XP_WIN
/* Overrides from menu.css to prevent items in the bookmarks popup from being too tall.
These won't be necessary once menu.css is loaded as a UA style (Bug 1420229). */
#BMB_bookmarksPopup .subviewbutton > .menu-iconic-left {
padding-top: 0;
-moz-appearance: none;
}
#BMB_bookmarksPopup .subviewbutton {
-moz-appearance: none;
}
%endif
menuitem[checked="true"].subviewbutton > .menu-iconic-left {
visibility: hidden;
}

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

@ -10,6 +10,9 @@ with Files('**'):
# This cannot be named "build" because of bug 922191.
SPHINX_TREES['buildsystem'] = 'docs'
with Files('docs/**'):
SCHEDULES.exclusive = ['docs']
if CONFIG['OS_ARCH'] == 'WINNT':
DIRS += ['win32']
if CONFIG['WIN64_CARGO_LINKER']:

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

@ -0,0 +1,16 @@
%include build/sparse-profiles/mach
[include]
path:taskcluster/
# Result from `grep -hr %include taskcluster/docker | grep -v " taskcluster/" | sort -u`
path:build/unix/build-gtk3/build-gtk3.sh
path:build/valgrind/valgrind-epochs.patch
path:python/mozbuild/mozbuild/action/tooltool.py
path:testing/config/tooltool-manifests/linux64/releng.manifest
path:testing/mozharness/external_tools/robustcheckout.py
path:tools/lint/eslint/eslint-plugin-mozilla/manifest.tt
path:tools/lint/eslint/manifest.tt
path:tools/lint/python/flake8_requirements.txt
path:tools/lint/tox/tox_requirements.txt

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

@ -284,6 +284,16 @@
fun:_ZN52_$LT$selectors..parser..SelectorList*
}
# Conditional jump or move depends on uninitialised value(s)
# at 0x118720EA: <core::slice::Iter<'a, T> as core::iter::iterator::Iterator>::all::{{closure}} (mod.rs:1173)
# by 0x11871EF6: style::media_queries::MediaList::evaluate (mod.rs:1277)
{
Bug 1430608 nsMediaFeatures, January 2018
Memcheck:Cond
fun:_ZN91_$LT$core..slice..Iter$LT$$u27$a$C$$u20$T$GT$$u20$as$u20$core..iter..iterator..Iterator$GT$3all*
fun:_ZN5style13media_queries9MediaList8evaluate17he4027f6becef129cE
}
###################################################
# For valgrind-mochitest ("tc-M-V [tier 2]") runs on taskcluster.
# See bug 1248365.

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

@ -229,6 +229,7 @@ def main(*args, **kwargs):
args.extend([
'--verbose',
'-p', 'mozlog.pytest_mozlog.plugin',
'-p', 'no:cacheprovider',
module.__file__,
])
sys.exit(pytest.main(args))

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

@ -864,6 +864,12 @@ cargo_rustc_flags += -C lto
endif
endif
# Disable incremental Rust compilation in automation builds, where
# the lack of environmental continuity makes it unhelpful.
ifdef MOZ_AUTOMATION
cargo_incremental := CARGO_INCREMENTAL=0
endif
rustflags_override = RUSTFLAGS='$(MOZ_RUST_DEFAULT_FLAGS) $(RUSTFLAGS)'
ifdef MOZ_MSVCBITS
@ -905,6 +911,7 @@ $(if $(findstring n,$(filter-out --%, $(MAKEFLAGS))),,+)env $(environment_cleane
PKG_CONFIG_ALLOW_CROSS=1 \
RUST_BACKTRACE=full \
MOZ_TOPOBJDIR=$(topobjdir) \
$(cargo_incremental) \
$(2) \
$(CARGO) $(1) $(cargo_build_flags)
endef

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

@ -25,8 +25,6 @@ support-files =
test-bug_923281_test2.js
test-bug_939783_console_trace_duplicates.html
test-bug-585956-console-trace.html
test-bug-593003-iframe-wrong-hud-iframe.html
test-bug-593003-iframe-wrong-hud.html
test-bug-595934-canvas-css.html
test-bug-595934-canvas-css.js
test-bug-595934-css-loader.css
@ -127,6 +125,8 @@ support-files =
test-iframe1.html
test-iframe2.html
test-iframe3.html
test-iframe-wrong-hud-iframe.html
test-iframe-wrong-hud.html
test-image.png
test-inspect-cross-domain-objects-frame.html
test-inspect-cross-domain-objects-top.html
@ -282,7 +282,6 @@ skip-if = true # Bug 1404382
[browser_webconsole_hpkp_invalid-headers.js]
[browser_webconsole_hsts_invalid-headers.js]
[browser_webconsole_iframe_wrong_hud.js]
skip-if = true # Bug 1404378
[browser_webconsole_ineffective_iframe_sandbox_warning.js]
skip-if = true # Bug 1404883
# old console skip-if = (os == 'win' && bits == 64) # Bug 1390001

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

@ -5,66 +5,38 @@
"use strict";
// See Bug 593003.
// Ensure that iframes are not associated with the wrong hud. See Bug 593003.
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"test/test-bug-593003-iframe-wrong-hud.html";
"new-console-output/test/mochitest/test-iframe-wrong-hud.html";
const TEST_IFRAME_URI = "http://example.com/browser/devtools/client/" +
"webconsole/test/test-bug-593003-iframe-wrong-" +
"hud-iframe.html";
const TEST_IFRAME_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-iframe-wrong-hud-iframe.html";
const TEST_DUMMY_URI = "http://example.com/browser/devtools/client/" +
"webconsole/test/test-console.html";
const TEST_DUMMY_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-console.html";
add_task(function* () {
add_task(async function () {
await pushPref("devtools.webconsole.filter.net", true);
const tab1 = await addTab(TEST_URI);
const hud1 = await openConsole(tab1);
let tab1 = (yield loadTab(TEST_URI)).tab;
yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function* () {
content.console.log("FOO");
});
yield openConsole();
let tab2 = (yield loadTab(TEST_DUMMY_URI)).tab;
yield openConsole(gBrowser.selectedTab);
const tab2 = await addTab(TEST_DUMMY_URI);
await openConsole(gBrowser.selectedTab);
info("Reloading tab 1");
yield reloadTab(tab1);
info("Checking for messages");
yield checkMessages(tab1, tab2);
info("Cleaning up");
yield closeConsole(tab1);
yield closeConsole(tab2);
});
function* reloadTab(tab) {
let loaded = BrowserTestUtils.browserLoaded(tab.linkedBrowser);
tab.linkedBrowser.reload();
yield loaded;
}
function* checkMessages(tab1, tab2) {
let hud1 = yield openConsole(tab1);
let outputNode1 = hud1.outputNode;
await reloadTab(tab1);
info("Waiting for messages");
yield waitForMessages({
webconsole: hud1,
messages: [{
text: TEST_IFRAME_URI,
category: CATEGORY_NETWORK,
severity: SEVERITY_LOG,
}]
});
await waitFor(() => findMessage(hud1, TEST_IFRAME_URI, ".message.network"));
let hud2 = yield openConsole(tab2);
let outputNode2 = hud2.outputNode;
const hud2 = await openConsole(tab2);
is(findMessage(hud2, TEST_IFRAME_URI), null,
"iframe network request is not displayed in tab2");
});
isnot(outputNode1, outputNode2,
"the two HUD outputNodes must be different");
let msg = "Didn't find the iframe network request in tab2";
testLogEntry(outputNode2, TEST_IFRAME_URI, msg, true, true);
function reloadTab(tab) {
let loaded = BrowserTestUtils.browserLoaded(tab.linkedBrowser);
tab.linkedBrowser.reload();
return loaded;
}

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

@ -9,6 +9,6 @@
<body>
<p>WebConsole test: iframe associated to the wrong HUD.</p>
<iframe
src="http://example.com/browser/devtools/client/webconsole/test/test-bug-593003-iframe-wrong-hud-iframe.html"></iframe>
src="http://example.com/browser/devtools/client/webconsole/new-console-output/test/mochitest/test-iframe-wrong-hud-iframe.html"></iframe>
</body>
</html>

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

@ -50,6 +50,9 @@ const ProfilerManager = (function () {
// How many subscribers there
_profilerStatusSubscribers: 0,
// Has the profiler ever been started by the actor?
started: false,
/**
* The nsIProfiler is target agnostic and interacts with the whole platform.
* Therefore, special care needs to be given to make sure different profiler
@ -124,6 +127,7 @@ const ProfilerManager = (function () {
Cu.reportError(`Could not start the profiler module: ${e.message}`);
return { started: false, reason: e, currentTime };
}
this.started = true;
this._updateProfilerStatusPolling();
@ -139,8 +143,12 @@ const ProfilerManager = (function () {
// Since this is used as a root actor, and the profiler module interacts
// with the whole platform, we need to avoid a case in which the profiler
// is stopped when there might be other clients still profiling.
if (this.length <= 1) {
// Also check for `started` to only stop the profiler when the actor
// actually started it. This is to prevent stopping the profiler initiated
// by some other code, like Talos.
if (this.length <= 1 && this.started) {
nsIProfilerModule.StopProfiler();
this.started = false;
}
this._updateProfilerStatusPolling();
return { started: false };

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

@ -1164,6 +1164,7 @@ exports.CSS_PROPERTIES = {
],
"values": [
"bottom",
"calc",
"center",
"inherit",
"initial",
@ -2486,6 +2487,7 @@ exports.CSS_PROPERTIES = {
],
"values": [
"bottom",
"calc",
"center",
"inherit",
"initial",
@ -7427,6 +7429,7 @@ exports.CSS_PROPERTIES = {
],
"values": [
"bottom",
"calc",
"center",
"inherit",
"initial",
@ -7991,6 +7994,7 @@ exports.CSS_PROPERTIES = {
],
"values": [
"bottom",
"calc",
"center",
"inherit",
"initial",

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

@ -352,7 +352,7 @@ public:
* is canceled, it will be released by its owning element and may not still
* exist when we would normally go to queue events on the next tick.
*/
virtual void MaybeQueueCancelEvent(StickyTimeDuration aActiveTime) {};
virtual void MaybeQueueCancelEvent(const StickyTimeDuration& aActiveTime) {};
protected:
void SilentlySetCurrentTime(const TimeDuration& aNewCurrentTime);

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

@ -4024,10 +4024,9 @@ nsDocument::CreateShell(nsPresContext* aContext, nsViewManager* aViewManager,
}
RefPtr<PresShell> shell = new PresShell;
shell->Init(this, aContext, aViewManager, aStyleSet);
// Note: we don't hold a ref to the shell (it holds a ref to us)
mPresShell = shell;
shell->Init(this, aContext, aViewManager, aStyleSet);
// Make sure to never paint if we belong to an invisible DocShell.
nsCOMPtr<nsIDocShell> docShell(mDocumentContainer);

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

@ -2215,6 +2215,16 @@ public:
mIsBeingUsedAsImage = true;
}
bool IsSVGGlyphsDocument() const
{
return mIsSVGGlyphsDocument;
}
void SetIsSVGGlyphsDocument()
{
mIsSVGGlyphsDocument = true;
}
bool IsResourceDoc() const {
return IsBeingUsedAsImage() || // Are we a helper-doc for an SVG image?
mHasDisplayDocument; // Are we an external resource doc?
@ -3542,6 +3552,9 @@ protected:
// created.
bool mIsShadowDOMEnabled : 1;
// True if this document is for an SVG-in-OpenType font.
bool mIsSVGGlyphsDocument : 1;
// Whether <style scoped> support is enabled in this document.
enum { eScopedStyle_Unknown, eScopedStyle_Disabled, eScopedStyle_Enabled };
unsigned int mIsScopedStyleEnabled : 2;

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

@ -149,8 +149,15 @@ include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
SPHINX_TREES['webidl'] = 'docs'
with Files('docs/**'):
SCHEDULES.exclusive = ['docs']
SPHINX_PYTHON_PACKAGE_DIRS += ['mozwebidlcodegen']
with Files('mozwebidlcodegen/**.py'):
SCHEDULES.inclusive += ['docs']
if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']:
# This is needed for Window.webidl
DEFINES['HAVE_SIDEBAR'] = True

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

@ -201,7 +201,6 @@ include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'../workers',
'/', # Allow including relpaths from root.
'/dom/base',
'/dom/html',
'/dom/svg',

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

@ -49,10 +49,10 @@ skip-if(Android)
skip-if(Android) == webgl-color-test.html?frame=1&aa&________&premult&_____ wrapper.html?colors-no-alpha.png
skip-if(Android) == webgl-color-test.html?frame=1&__&preserve&premult&_____ wrapper.html?colors-no-alpha.png
skip-if(Android) == webgl-color-test.html?frame=1&aa&preserve&premult&_____ wrapper.html?colors-no-alpha.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) fails-if(webrender) == webgl-color-test.html?frame=1&__&________&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) fails-if(webrender) == webgl-color-test.html?frame=1&aa&________&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) fails-if(webrender) == webgl-color-test.html?frame=1&__&preserve&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) fails-if(webrender) == webgl-color-test.html?frame=1&aa&preserve&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) == webgl-color-test.html?frame=1&__&________&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) == webgl-color-test.html?frame=1&aa&________&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) == webgl-color-test.html?frame=1&__&preserve&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) == webgl-color-test.html?frame=1&aa&preserve&_______&alpha wrapper.html?colors-non-premult.png
skip-if(Android) == webgl-color-test.html?frame=1&__&________&premult&alpha wrapper.html?colors-premult.png
skip-if(Android) == webgl-color-test.html?frame=1&aa&________&premult&alpha wrapper.html?colors-premult.png
skip-if(Android) == webgl-color-test.html?frame=1&__&preserve&premult&alpha wrapper.html?colors-premult.png
@ -66,10 +66,10 @@ skip-if(Android)
skip-if(Android) == webgl-color-test.html?frame=6&aa&________&premult&_____ wrapper.html?colors-no-alpha.png
skip-if(Android) == webgl-color-test.html?frame=6&__&preserve&premult&_____ wrapper.html?colors-no-alpha.png
skip-if(Android) == webgl-color-test.html?frame=6&aa&preserve&premult&_____ wrapper.html?colors-no-alpha.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) fails-if(webrender) == webgl-color-test.html?frame=6&__&________&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) fails-if(webrender) == webgl-color-test.html?frame=6&aa&________&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) fails-if(webrender) == webgl-color-test.html?frame=6&__&preserve&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) fails-if(webrender) == webgl-color-test.html?frame=6&aa&preserve&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) == webgl-color-test.html?frame=6&__&________&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) == webgl-color-test.html?frame=6&aa&________&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) == webgl-color-test.html?frame=6&__&preserve&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) == webgl-color-test.html?frame=6&aa&preserve&_______&alpha wrapper.html?colors-non-premult.png
skip-if(Android) == webgl-color-test.html?frame=6&__&________&premult&alpha wrapper.html?colors-premult.png
skip-if(Android) == webgl-color-test.html?frame=6&aa&________&premult&alpha wrapper.html?colors-premult.png
skip-if(Android) == webgl-color-test.html?frame=6&__&preserve&premult&alpha wrapper.html?colors-premult.png
@ -83,10 +83,10 @@ skip-if(Android)
skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&aa&________&premult&_____ wrapper.html?colors-no-alpha.png
skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&__&preserve&premult&_____ wrapper.html?colors-no-alpha.png
skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&aa&preserve&premult&_____ wrapper.html?colors-no-alpha.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) fails-if(webrender) == webgl-color-test.html?frame=1&readback&__&________&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) fails-if(webrender) == webgl-color-test.html?frame=1&readback&aa&________&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) fails-if(webrender) == webgl-color-test.html?frame=1&readback&__&preserve&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) fails-if(webrender) == webgl-color-test.html?frame=1&readback&aa&preserve&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&__&________&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&aa&________&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&__&preserve&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&aa&preserve&_______&alpha wrapper.html?colors-non-premult.png
skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&__&________&premult&alpha wrapper.html?colors-premult.png
skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&aa&________&premult&alpha wrapper.html?colors-premult.png
skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=1&readback&__&preserve&premult&alpha wrapper.html?colors-premult.png
@ -100,10 +100,10 @@ skip-if(Android)
skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&________&premult&_____ wrapper.html?colors-no-alpha.png
skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&preserve&premult&_____ wrapper.html?colors-no-alpha.png
skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&preserve&premult&_____ wrapper.html?colors-no-alpha.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) fails-if(webrender) == webgl-color-test.html?frame=6&readback&__&________&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) fails-if(webrender) == webgl-color-test.html?frame=6&readback&aa&________&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) fails-if(webrender) == webgl-color-test.html?frame=6&readback&__&preserve&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) fails-if(webrender) == webgl-color-test.html?frame=6&readback&aa&preserve&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&________&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&________&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&preserve&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(winWidget&&layersGPUAccelerated&&!d3d11) skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&preserve&_______&alpha wrapper.html?colors-non-premult.png
skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&________&premult&alpha wrapper.html?colors-premult.png
skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&________&premult&alpha wrapper.html?colors-premult.png
skip-if(Android) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&preserve&premult&alpha wrapper.html?colors-premult.png

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

@ -56,6 +56,15 @@ DecoderTraits::IsHttpLiveStreamingType(const MediaContainerType& aType)
mimeType == MEDIAMIMETYPE("audio/x-mpegurl");
}
/* static */ bool
DecoderTraits::IsMatroskaType(const MediaContainerType& aType)
{
const auto& mimeType = aType.Type();
// https://matroska.org/technical/specs/notes.html
return mimeType == MEDIAMIMETYPE("audio/x-matroska") ||
mimeType == MEDIAMIMETYPE("video/x-matroska");
}
/* static */ bool
DecoderTraits::IsMP4SupportedType(const MediaContainerType& aType,
DecoderDoctorDiagnostics* aDiagnostics)
@ -141,6 +150,8 @@ CanHandleMediaType(const MediaContainerType& aType,
if (DecoderTraits::IsHttpLiveStreamingType(aType)) {
Telemetry::Accumulate(Telemetry::MEDIA_HLS_CANPLAY_REQUESTED, true);
} else if (DecoderTraits::IsMatroskaType(aType)) {
Telemetry::Accumulate(Telemetry::MEDIA_MKV_CANPLAY_REQUESTED, true);
}
if (aType.ExtendedType().HaveCodecs()) {

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

@ -53,6 +53,9 @@ public:
// Returns true if aType is MIME type of hls.
static bool IsHttpLiveStreamingType(const MediaContainerType& aType);
// Returns true if aType is matroska type.
static bool IsMatroskaType(const MediaContainerType& aType);
static bool IsSupportedType(const MediaContainerType& aType);
};

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

@ -2689,7 +2689,7 @@ MediaDecoderStateMachine::MediaDecoderStateMachine(MediaDecoder* aDecoder,
"MDSM::mTaskQueue", /* aSupportsTailDispatch = */ true)),
mWatchManager(this, mTaskQueue),
mDispatchedStateMachine(false),
mDelayedScheduler(mTaskQueue),
mDelayedScheduler(mTaskQueue, true /*aFuzzy*/),
mCurrentFrameID(0),
mReader(new ReaderProxy(mTaskQueue, aReader)),
mPlaybackRate(1.0),

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

@ -18,11 +18,12 @@ namespace mozilla {
NS_IMPL_ADDREF(MediaTimer)
NS_IMPL_RELEASE_WITH_DESTROY(MediaTimer, DispatchDestroy())
MediaTimer::MediaTimer()
MediaTimer::MediaTimer(bool aFuzzy)
: mMonitor("MediaTimer Monitor")
, mTimer(NS_NewTimer())
, mCreationTimeStamp(TimeStamp::Now())
, mUpdateScheduled(false)
, mFuzzy(aFuzzy)
{
TIMER_LOG("MediaTimer::MediaTimer");
@ -114,6 +115,19 @@ MediaTimer::Update()
UpdateLocked();
}
bool
MediaTimer::IsExpired(const TimeStamp& aTarget, const TimeStamp& aNow)
{
MOZ_ASSERT(OnMediaTimerThread());
mMonitor.AssertCurrentThreadOwns();
// Treat this timer as expired in fuzzy mode even if it is fired
// slightly (< 1ms) before the schedule target. So we don't need to schedule a
// timer with very small timeout again when the client doesn't need a high-res
// timer.
TimeStamp t = mFuzzy ? aTarget - TimeDuration::FromMilliseconds(1) : aTarget;
return t <= aNow;
}
void
MediaTimer::UpdateLocked()
{
@ -125,7 +139,7 @@ MediaTimer::UpdateLocked()
// Resolve all the promises whose time is up.
TimeStamp now = TimeStamp::Now();
while (!mEntries.empty() && mEntries.top().mTimeStamp <= now) {
while (!mEntries.empty() && IsExpired(mEntries.top().mTimeStamp, now)) {
mEntries.top().mPromise->Resolve(true, __func__);
DebugOnly<TimeStamp> poppedTimeStamp = mEntries.top().mTimeStamp;
mEntries.pop();

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

@ -36,7 +36,7 @@ typedef MozPromise<bool, bool, /* IsExclusive = */ true> MediaTimerPromise;
class MediaTimer
{
public:
MediaTimer();
explicit MediaTimer(bool aFuzzy = false);
// We use a release with a custom Destroy().
NS_IMETHOD_(MozExternalRefCountType) AddRef(void);
@ -54,6 +54,7 @@ private:
void ScheduleUpdate();
void Update();
void UpdateLocked();
bool IsExpired(const TimeStamp& aTarget, const TimeStamp& aNow);
static void TimerCallback(nsITimer* aTimer, void* aClosure);
void TimerFired();
@ -111,13 +112,14 @@ private:
}
bool mUpdateScheduled;
const bool mFuzzy;
};
// Class for managing delayed dispatches on target thread.
class DelayedScheduler {
public:
explicit DelayedScheduler(AbstractThread* aTargetThread)
: mTargetThread(aTargetThread), mMediaTimer(new MediaTimer())
explicit DelayedScheduler(AbstractThread* aTargetThread, bool aFuzzy = false)
: mTargetThread(aTargetThread), mMediaTimer(new MediaTimer(aFuzzy))
{
MOZ_ASSERT(mTargetThread);
}

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

@ -14,6 +14,7 @@
* http://www.w3.org/TR/beacon/#sec-beacon-method
* https://html.spec.whatwg.org/#navigatorconcurrenthardware
* http://wicg.github.io/netinfo/#extensions-to-the-navigator-interface
* https://w3c.github.io/webappsec-credential-management/#framework-credential-management
*
* © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
* Opera Software ASA. You are granted a license to use, reproduce
@ -311,7 +312,8 @@ interface NavigatorConcurrentHardware {
readonly attribute unsigned long long hardwareConcurrency;
};
// https://w3c.github.io/webappsec-credential-management/#framework-credential-management
partial interface Navigator {
[Pref="security.webauth.webauthn", SameObject]
[Pref="security.webauth.webauthn", SecureContext, SameObject]
readonly attribute CredentialsContainer credentials;
};

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

@ -614,7 +614,7 @@ BufferTextureHost::PushDisplayItems(wr::DisplayListBuilder& aBuilder,
{
if (GetFormat() != gfx::SurfaceFormat::YUV) {
MOZ_ASSERT(aImageKeys.length() == 1);
aBuilder.PushImage(aBounds, aClip, true, aFilter, aImageKeys[0]);
aBuilder.PushImage(aBounds, aClip, true, aFilter, aImageKeys[0], !(mFlags & TextureFlags::NON_PREMULTIPLIED));
} else {
MOZ_ASSERT(aImageKeys.length() == 3);
const YCbCrDescriptor& desc = mDescriptor.get_YCbCrDescriptor();

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

@ -1141,7 +1141,7 @@ DXGITextureHostD3D11::PushDisplayItems(wr::DisplayListBuilder& aBuilder,
case gfx::SurfaceFormat::B8G8R8A8:
case gfx::SurfaceFormat::B8G8R8X8: {
MOZ_ASSERT(aImageKeys.length() == 1);
aBuilder.PushImage(aBounds, aClip, true, aFilter, aImageKeys[0]);
aBuilder.PushImage(aBounds, aClip, true, aFilter, aImageKeys[0], !(mFlags & TextureFlags::NON_PREMULTIPLIED));
break;
}
case gfx::SurfaceFormat::NV12: {

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

@ -214,7 +214,7 @@ MacIOSurfaceTextureHostOGL::PushDisplayItems(wr::DisplayListBuilder& aBuilder,
case gfx::SurfaceFormat::B8G8R8X8: {
MOZ_ASSERT(aImageKeys.length() == 1);
MOZ_ASSERT(mSurface->GetPlaneCount() == 0);
aBuilder.PushImage(aBounds, aClip, true, aFilter, aImageKeys[0]);
aBuilder.PushImage(aBounds, aClip, true, aFilter, aImageKeys[0], !(mFlags & TextureFlags::NON_PREMULTIPLIED));
break;
}
case gfx::SurfaceFormat::YUV422: {

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

@ -40,3 +40,6 @@ if CONFIG['ENABLE_TESTS']:
TEST_DIRS += ['tests']
SPHINX_TREES['gfx'] = 'docs'
with Files('docs/**'):
SCHEDULES.exclusive = ['docs']

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

@ -157,11 +157,8 @@ gfxSVGGlyphsDocument::SetupPresentation()
nsCOMPtr<nsIPresShell> presShell;
rv = viewer->GetPresShell(getter_AddRefs(presShell));
NS_ENSURE_SUCCESS(rv, rv);
nsPresContext* presContext = presShell->GetPresContext();
presContext->SetIsGlyph(true);
if (!presShell->DidInitialize()) {
nsRect rect = presContext->GetVisibleArea();
nsRect rect = presShell->GetPresContext()->GetVisibleArea();
rv = presShell->Initialize(rect.Width(), rect.Height());
NS_ENSURE_SUCCESS(rv, rv);
}
@ -395,6 +392,7 @@ gfxSVGGlyphsDocument::ParseDocument(const uint8_t *aBuffer, uint32_t aBufLen)
// Set this early because various decisions during page-load depend on it.
document->SetIsBeingUsedAsImage();
document->SetIsSVGGlyphsDocument();
document->SetReadyStateInternal(nsIDocument::READYSTATE_UNINITIALIZED);
nsCOMPtr<nsIStreamListener> listener;

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

@ -1032,12 +1032,13 @@ DisplayListBuilder::PushImage(const wr::LayoutRect& aBounds,
const wr::LayoutRect& aClip,
bool aIsBackfaceVisible,
wr::ImageRendering aFilter,
wr::ImageKey aImage)
wr::ImageKey aImage,
bool aPremultipliedAlpha)
{
wr::LayoutSize size;
size.width = aBounds.size.width;
size.height = aBounds.size.height;
PushImage(aBounds, aClip, aIsBackfaceVisible, size, size, aFilter, aImage);
PushImage(aBounds, aClip, aIsBackfaceVisible, size, size, aFilter, aImage, aPremultipliedAlpha);
}
void
@ -1047,13 +1048,14 @@ DisplayListBuilder::PushImage(const wr::LayoutRect& aBounds,
const wr::LayoutSize& aStretchSize,
const wr::LayoutSize& aTileSpacing,
wr::ImageRendering aFilter,
wr::ImageKey aImage)
wr::ImageKey aImage,
bool aPremultipliedAlpha)
{
WRDL_LOG("PushImage b=%s cl=%s s=%s t=%s\n", mWrState,
Stringify(aBounds).c_str(),
Stringify(aClip).c_str(), Stringify(aStretchSize).c_str(),
Stringify(aTileSpacing).c_str());
wr_dp_push_image(mWrState, aBounds, aClip, aIsBackfaceVisible, aStretchSize, aTileSpacing, aFilter, aImage);
wr_dp_push_image(mWrState, aBounds, aClip, aIsBackfaceVisible, aStretchSize, aTileSpacing, aFilter, aImage, aPremultipliedAlpha);
}
void

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

@ -324,7 +324,8 @@ public:
const wr::LayoutRect& aClip,
bool aIsBackfaceVisible,
wr::ImageRendering aFilter,
wr::ImageKey aImage);
wr::ImageKey aImage,
bool aPremultipliedAlpha = true);
void PushImage(const wr::LayoutRect& aBounds,
const wr::LayoutRect& aClip,
@ -332,7 +333,8 @@ public:
const wr::LayoutSize& aStretchSize,
const wr::LayoutSize& aTileSpacing,
wr::ImageRendering aFilter,
wr::ImageKey aImage);
wr::ImageKey aImage,
bool aPremultipliedAlpha = true);
void PushYCbCrPlanarImage(const wr::LayoutRect& aBounds,
const wr::LayoutRect& aClip,

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

@ -1598,19 +1598,25 @@ pub extern "C" fn wr_dp_push_image(state: &mut WrState,
stretch_size: LayoutSize,
tile_spacing: LayoutSize,
image_rendering: ImageRendering,
key: WrImageKey) {
key: WrImageKey,
premultiplied_alpha: bool) {
debug_assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
let mut prim_info = LayoutPrimitiveInfo::with_clip_rect(bounds, clip.into());
prim_info.is_backface_visible = is_backface_visible;
prim_info.tag = state.current_tag;
let alpha_type = if premultiplied_alpha {
AlphaType::PremultipliedAlpha
} else {
AlphaType::Alpha
};
state.frame_builder
.dl_builder
.push_image(&prim_info,
stretch_size,
tile_spacing,
image_rendering,
AlphaType::PremultipliedAlpha,
alpha_type,
key);
}

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

@ -1178,7 +1178,8 @@ void wr_dp_push_image(WrState *aState,
LayoutSize aStretchSize,
LayoutSize aTileSpacing,
ImageRendering aImageRendering,
WrImageKey aKey)
WrImageKey aKey,
bool aPremultipliedAlpha)
WR_FUNC;
WR_INLINE

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

@ -562,6 +562,8 @@ GeckoRestyleManager::ProcessPendingRestyles()
NS_PRECONDITION(PresContext()->Document(), "No document? Pshaw!");
NS_PRECONDITION(!nsContentUtils::IsSafeToRunScript(),
"Missing a script blocker!");
MOZ_ASSERT(!PresContext()->HasPendingMediaQueryUpdates(),
"Someone forgot to update media queries?");
// First do any queued-up frame creation. (We should really
// merge this into the rest of the process, though; see bug 827239.)

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

@ -959,7 +959,7 @@ PresShell::Init(nsIDocument* aDocument,
// calling Init, since various subroutines need to find the style set off
// the PresContext during initialization.
mStyleSet = aStyleSet;
mStyleSet->Init(aPresContext, mDocument->BindingManager());
mStyleSet->Init(aPresContext);
// Notify our prescontext that it now has a compatibility mode. Note that
// this MUST happen after we set up our style set but before we create any
@ -1954,13 +1954,11 @@ PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight,
WritingMode wm = rootFrame->GetWritingMode();
const bool shrinkToFit = aOptions == ResizeReflowOptions::eBSizeLimit;
NS_PRECONDITION(shrinkToFit ||
(wm.IsVertical() ? aWidth : aHeight) !=
NS_UNCONSTRAINEDSIZE,
"unconstrained bsize only usable with eBSizeLimit");
NS_PRECONDITION((wm.IsVertical() ? aHeight : aWidth) !=
NS_UNCONSTRAINEDSIZE,
"unconstrained isize not allowed");
MOZ_ASSERT(shrinkToFit ||
(wm.IsVertical() ? aWidth : aHeight) != NS_UNCONSTRAINEDSIZE,
"unconstrained bsize only usable with eBSizeLimit");
MOZ_ASSERT((wm.IsVertical() ? aHeight : aWidth) != NS_UNCONSTRAINEDSIZE,
"unconstrained isize not allowed");
bool isBSizeChanging = wm.IsVertical() ? aOldWidth != aWidth
: aOldHeight != aHeight;
nscoord targetWidth = aWidth;
@ -1975,20 +1973,36 @@ PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight,
isBSizeChanging = true;
}
mPresContext->SetVisibleArea(nsRect(0, 0, targetWidth, targetHeight));
const bool suppressingResizeReflow =
GetPresContext()->SuppressingResizeReflow();
RefPtr<nsViewManager> viewManager = mViewManager;
nsCOMPtr<nsIPresShell> kungFuDeathGrip(this);
if (!GetPresContext()->SuppressingResizeReflow()) {
// Have to make sure that the content notifications are flushed before we
// start messing with the frame model; otherwise we can get content doubling.
mDocument->FlushPendingNotifications(FlushType::ContentAndNotify);
if (!suppressingResizeReflow && shrinkToFit) {
// Make sure that style is flushed before setting the pres context
// VisibleArea if we're shrinking to fit.
//
// Otherwise we may end up with bogus viewport units resolved against the
// unconstrained bsize, or restyling the whole document resolving viewport
// units against targetWidth, which may end up doing wasteful work.
mDocument->FlushPendingNotifications(FlushType::Frames);
}
// Make sure style is up to date
{
nsAutoScriptBlocker scriptBlocker;
mPresContext->RestyleManager()->ProcessPendingRestyles();
if (!mIsDestroying) {
mPresContext->SetVisibleArea(nsRect(0, 0, targetWidth, targetHeight));
}
if (!mIsDestroying && !suppressingResizeReflow) {
if (!shrinkToFit) {
// Flush styles _now_ (with the correct visible area) if not computing the
// shrink-to-fit size.
//
// We've asserted above that sizes are not unconstrained, so this is going
// to be the final size, which means that we'll get the (correct) final
// styles now, and avoid a further potentially-wasteful full recascade on
// the next flush.
mDocument->FlushPendingNotifications(FlushType::Frames);
}
rootFrame = mFrameConstructor->GetRootFrame();

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

@ -1093,13 +1093,18 @@ ServoRestyleManager::SnapshotFor(Element* aElement)
void
ServoRestyleManager::DoProcessPendingRestyles(ServoTraversalFlags aFlags)
{
MOZ_ASSERT(PresContext()->Document(), "No document? Pshaw!");
nsPresContext* presContext = PresContext();
MOZ_ASSERT(presContext->Document(), "No document? Pshaw!");
MOZ_ASSERT(!presContext->HasPendingMediaQueryUpdates(),
"Someone forgot to update media queries?");
MOZ_ASSERT(!nsContentUtils::IsSafeToRunScript(), "Missing a script blocker!");
MOZ_ASSERT(!mInStyleRefresh, "Reentrant call?");
if (MOZ_UNLIKELY(!PresContext()->PresShell()->DidInitialize())) {
if (MOZ_UNLIKELY(!presContext->PresShell()->DidInitialize())) {
// PresShell::FlushPendingNotifications doesn't early-return in the case
// where the PreShell hasn't yet been initialized (and therefore we haven't
// where the PresShell hasn't yet been initialized (and therefore we haven't
// yet done the initial style traversal of the DOM tree). We should arguably
// fix up the callers and assert against this case, but we just detect and
// handle it for now.
@ -1112,11 +1117,11 @@ ServoRestyleManager::DoProcessPendingRestyles(ServoTraversalFlags aFlags)
AnimationsWithDestroyedFrame animationsWithDestroyedFrame(this);
ServoStyleSet* styleSet = StyleSet();
nsIDocument* doc = PresContext()->Document();
nsIDocument* doc = presContext->Document();
// Ensure the refresh driver is active during traversal to avoid mutating
// mActiveTimer and mMostRecentRefresh time.
PresContext()->RefreshDriver()->MostRecentRefresh();
presContext->RefreshDriver()->MostRecentRefresh();
// Perform the Servo traversal, and the post-traversal if required. We do this
@ -1140,7 +1145,7 @@ ServoRestyleManager::DoProcessPendingRestyles(ServoTraversalFlags aFlags)
// Recreate style contexts, and queue up change hints (which also handle
// lazy frame construction).
{
AutoRestyleTimelineMarker marker(mPresContext->GetDocShell(), false);
AutoRestyleTimelineMarker marker(presContext->GetDocShell(), false);
DocumentStyleRootIterator iter(doc->GetServoRestyleRoot());
while (Element* root = iter.GetNextStyleRoot()) {
nsTArray<nsIFrame*> wrappersToRestyle;
@ -1159,7 +1164,7 @@ ServoRestyleManager::DoProcessPendingRestyles(ServoTraversalFlags aFlags)
// iterate until there's nothing left.
{
AutoTimelineMarker marker(
mPresContext->GetDocShell(), "StylesApplyChanges");
presContext->GetDocShell(), "StylesApplyChanges");
ReentrantChangeList newChanges;
mReentrantChanges = &newChanges;
while (!currentChanges.IsEmpty()) {

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

@ -223,6 +223,13 @@ public:
mozilla::StyleSetHandle StyleSet() const { return GetPresShell()->StyleSet(); }
#ifdef DEBUG
bool HasPendingMediaQueryUpdates() const
{
return mPendingMediaFeatureValuesChanged;
}
#endif
nsFrameManager* FrameManager()
{ return PresShell()->FrameManager(); }
@ -1124,14 +1131,6 @@ public:
void NotifyNonBlankPaint();
bool IsGlyph() const {
return mIsGlyph;
}
void SetIsGlyph(bool aValue) {
mIsGlyph = aValue;
}
bool UsesRootEMUnits() const {
return mUsesRootEMUnits;
}

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

@ -234,6 +234,14 @@ function do_test() {
var values = InspectorUtils.getCSSValuesForProperty(prop);
ok(values.includes("match-parent"), "property text-align includes match-parent");
// Regression test for bug 1255402.
var expected = [ "inherit", "initial", "unset", "left", "right",
"top", "center", "bottom", "calc" ];
for (prop of ["object-position", "perspective-origin"]) {
var values = InspectorUtils.getCSSValuesForProperty(prop);
ok(testValues(values, expected), "property " + prop + "'s values");
}
SimpleTest.finish();
}

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

@ -81,7 +81,7 @@ public:
// For markers for animations, we have already set the markers in
// ServoRestyleManager::PostRestyleEventForAnimations so that we don't need
// to care about animation restyles here.
: mTimelineMarker(aSet->mPresContext->GetDocShell(), false)
: mTimelineMarker(aSet->mDocument->GetDocShell(), false)
, mSetInServoTraversal(aSet)
{
MOZ_ASSERT(!aSet->StylistNeedsUpdate());
@ -96,7 +96,7 @@ private:
ServoStyleSet::ServoStyleSet(Kind aKind)
: mKind(aKind)
, mPresContext(nullptr)
, mDocument(nullptr)
, mAuthorStyleDisabled(false)
, mStylistState(StylistState::NotDirty)
, mUserFontSetUpdateGeneration(0)
@ -120,7 +120,7 @@ ServoStyleSet::CreateXBLServoStyleSet(
const nsTArray<RefPtr<ServoStyleSheet>>& aNewSheets)
{
auto set = MakeUnique<ServoStyleSet>(Kind::ForXBL);
set->Init(aPresContext, nullptr);
set->Init(aPresContext);
// The XBL style sheets aren't document level sheets, but we need to
// decide a particular SheetType to add them to style set. This type
@ -131,24 +131,39 @@ ServoStyleSet::CreateXBLServoStyleSet(
// Update stylist immediately.
set->UpdateStylist();
// The PresContext of the bound document could be destroyed anytime later,
// which shouldn't be used for XBL styleset, so we clear it here to avoid
// dangling pointer.
set->mPresContext = nullptr;
// XBL resources are shared for a given URL, even across documents, so we
// can't safely keep this reference.
set->mDocument = nullptr;
return set;
}
void
ServoStyleSet::Init(nsPresContext* aPresContext, nsBindingManager* aBindingManager)
nsPresContext*
ServoStyleSet::GetPresContext()
{
mPresContext = aPresContext;
if (!mDocument) {
return nullptr;
}
auto* shell = mDocument->GetShell();
if (!shell) {
return nullptr;
}
return shell->GetPresContext();
}
void
ServoStyleSet::Init(nsPresContext* aPresContext)
{
mDocument = aPresContext->Document();
MOZ_ASSERT(GetPresContext() == aPresContext);
mLastPresContextUsesXBLStyleSet = aPresContext;
mRawSet.reset(Servo_StyleSet_Init(aPresContext));
mBindingManager = aBindingManager;
mPresContext->DeviceContext()->InitFontCache();
aPresContext->DeviceContext()->InitFontCache();
// Now that we have an mRawSet, go ahead and notify about whatever stylesheets
// we have so far.
@ -179,19 +194,15 @@ ServoStyleSet::Shutdown()
ClearNonInheritingStyleContexts();
mRawSet = nullptr;
mStyleRuleMap = nullptr;
// Also drop the reference to the pres context to avoid notifications from our
// stylesheets to dereference a null restyle manager, see bug 1422634.
//
// We should really fix bug 154199...
mPresContext = nullptr;
}
void
ServoStyleSet::InvalidateStyleForCSSRuleChanges()
{
MOZ_ASSERT(StylistNeedsUpdate());
mPresContext->RestyleManager()->AsServo()->PostRestyleEventForCSSRuleChanges();
if (nsPresContext* pc = GetPresContext()) {
pc->RestyleManager()->AsServo()->PostRestyleEventForCSSRuleChanges();
}
}
bool
@ -218,10 +229,12 @@ ServoStyleSet::MediumFeaturesChanged(bool aViewportChanged)
bool viewportUnitsUsed = false;
bool rulesChanged = MediumFeaturesChangedRules(&viewportUnitsUsed);
if (mBindingManager &&
mBindingManager->MediumFeaturesChanged(mPresContext)) {
SetStylistXBLStyleSheetsDirty();
rulesChanged = true;
if (nsPresContext* pc = GetPresContext()) {
if (mDocument->BindingManager()->MediumFeaturesChanged(pc)) {
// TODO(emilio): We could technically just restyle the bound elements.
SetStylistXBLStyleSheetsDirty();
rulesChanged = true;
}
}
if (rulesChanged) {
@ -296,7 +309,7 @@ ServoStyleSet::AddSizeOfIncludingThis(nsWindowSizes& aSizes) const
// - mNonInheritingStyleContexts
//
// The following members are not measured:
// - mPresContext, because it a non-owning pointer
// - mDocument, because it a non-owning pointer
}
bool
@ -346,17 +359,18 @@ ServoStyleSet::ResolveStyleFor(Element* aElement,
const ServoElementSnapshotTable&
ServoStyleSet::Snapshots()
{
return mPresContext->RestyleManager()->AsServo()->Snapshots();
MOZ_ASSERT(GetPresContext(), "Styling a document without a shell?");
return GetPresContext()->RestyleManager()->AsServo()->Snapshots();
}
void
ServoStyleSet::ResolveMappedAttrDeclarationBlocks()
{
if (nsHTMLStyleSheet* sheet = mPresContext->Document()->GetAttributeStyleSheet()) {
if (nsHTMLStyleSheet* sheet = mDocument->GetAttributeStyleSheet()) {
sheet->CalculateMappedServoDeclarations();
}
mPresContext->Document()->ResolveScheduledSVGPresAttrs();
mDocument->ResolveScheduledSVGPresAttrs();
}
void
@ -365,7 +379,7 @@ ServoStyleSet::PreTraverseSync()
// Get the Document's root element to ensure that the cache is valid before
// calling into the (potentially-parallel) Servo traversal, where a cache hit
// is necessary to avoid a data race when updating the cache.
mozilla::Unused << mPresContext->Document()->GetRootElement();
mozilla::Unused << mDocument->GetRootElement();
ResolveMappedAttrDeclarationBlocks();
@ -373,11 +387,14 @@ ServoStyleSet::PreTraverseSync()
LookAndFeel::NativeInit();
if (gfxUserFontSet* userFontSet = mPresContext->Document()->GetUserFontSet()) {
nsPresContext* presContext = GetPresContext();
MOZ_ASSERT(presContext,
"For now, we don't call into here without a pres context");
if (gfxUserFontSet* userFontSet = mDocument->GetUserFontSet()) {
// Ensure that the @font-face data is not stale
uint64_t generation = userFontSet->GetGeneration();
if (generation != mUserFontSetUpdateGeneration) {
mPresContext->DeviceContext()->UpdateFontCacheUserFonts(userFontSet);
presContext->DeviceContext()->UpdateFontCacheUserFonts(userFontSet);
mUserFontSetUpdateGeneration = generation;
}
@ -400,7 +417,7 @@ ServoStyleSet::PreTraverseSync()
}
UpdateStylistIfNeeded();
mPresContext->CacheAllLangs();
presContext->CacheAllLangs();
}
void
@ -411,18 +428,18 @@ ServoStyleSet::PreTraverse(ServoTraversalFlags aFlags, Element* aRoot)
// Process animation stuff that we should avoid doing during the parallel
// traversal.
nsSMILAnimationController* smilController =
mPresContext->Document()->HasAnimationController()
? mPresContext->Document()->GetAnimationController()
mDocument->HasAnimationController()
? mDocument->GetAnimationController()
: nullptr;
MOZ_ASSERT(GetPresContext());
if (aRoot) {
mPresContext->EffectCompositor()
->PreTraverseInSubtree(aFlags, aRoot);
GetPresContext()->EffectCompositor()->PreTraverseInSubtree(aFlags, aRoot);
if (smilController) {
smilController->PreTraverseInSubtree(aRoot);
}
} else {
mPresContext->EffectCompositor()->PreTraverse(aFlags);
GetPresContext()->EffectCompositor()->PreTraverse(aFlags);
if (smilController) {
smilController->PreTraverse();
}
@ -814,8 +831,8 @@ ServoStyleSet::StyleSheetAt(SheetType aType, int32_t aIndex) const
void
ServoStyleSet::AppendAllXBLStyleSheets(nsTArray<StyleSheet*>& aArray) const
{
if (mBindingManager) {
mBindingManager->AppendAllSheets(aArray);
if (mDocument) {
mDocument->BindingManager()->AppendAllSheets(aArray);
}
}
@ -921,8 +938,9 @@ ServoStyleSet::ProbePseudoElementStyle(Element* aOriginatingElement,
bool
ServoStyleSet::StyleDocument(ServoTraversalFlags aFlags)
{
nsIDocument* doc = mPresContext->Document();
if (!doc->GetServoRestyleRoot()) {
MOZ_ASSERT(GetPresContext(), "Styling a document without a shell?");
if (!mDocument->GetServoRestyleRoot()) {
return false;
}
@ -934,7 +952,7 @@ ServoStyleSet::StyleDocument(ServoTraversalFlags aFlags)
// NAC subtree roots.
bool postTraversalRequired = false;
Element* rootElement = doc->GetRootElement();
Element* rootElement = mDocument->GetRootElement();
MOZ_ASSERT_IF(rootElement, rootElement->HasServoData());
if (ShouldTraverseInParallel()) {
@ -942,7 +960,7 @@ ServoStyleSet::StyleDocument(ServoTraversalFlags aFlags)
}
// Do the first traversal.
DocumentStyleRootIterator iter(doc->GetServoRestyleRoot());
DocumentStyleRootIterator iter(mDocument->GetServoRestyleRoot());
while (Element* root = iter.GetNextStyleRoot()) {
MOZ_ASSERT(MayTraverseFrom(root));
@ -956,15 +974,15 @@ ServoStyleSet::StyleDocument(ServoTraversalFlags aFlags)
root->HasAnyOfFlags(Element::kAllServoDescendantBits | NODE_NEEDS_FRAME);
if (parent) {
MOZ_ASSERT(root == doc->GetServoRestyleRoot());
MOZ_ASSERT(root == mDocument->GetServoRestyleRoot());
if (parent->HasDirtyDescendantsForServo()) {
// If any style invalidation was triggered in our siblings, then we may
// need to post-traverse them, even if the root wasn't restyled after
// all.
uint32_t existingBits = doc->GetServoRestyleRootDirtyBits();
uint32_t existingBits = mDocument->GetServoRestyleRootDirtyBits();
// We need to propagate the existing bits to the parent.
parent->SetFlags(existingBits);
doc->SetServoRestyleRoot(
mDocument->SetServoRestyleRoot(
parent,
existingBits | ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO);
postTraversalRequired = true;
@ -984,8 +1002,8 @@ ServoStyleSet::StyleDocument(ServoTraversalFlags aFlags)
// values once at the begin of a tick. As a result, even if the previous
// traversal caused, for example, the font-size to change, the SMIL style
// won't be updated until the next tick anyway.
if (mPresContext->EffectCompositor()->PreTraverse(aFlags)) {
nsINode* styleRoot = doc->GetServoRestyleRoot();
if (GetPresContext()->EffectCompositor()->PreTraverse(aFlags)) {
nsINode* styleRoot = mDocument->GetServoRestyleRoot();
Element* root = styleRoot->IsElement() ? styleRoot->AsElement() : rootElement;
postTraversalRequired |=
@ -1000,6 +1018,7 @@ ServoStyleSet::StyleDocument(ServoTraversalFlags aFlags)
void
ServoStyleSet::StyleNewSubtree(Element* aRoot)
{
MOZ_ASSERT(GetPresContext());
MOZ_ASSERT(!aRoot->HasServoData());
PreTraverseSync();
AutoPrepareTraversal guard(this);
@ -1019,7 +1038,7 @@ ServoStyleSet::StyleNewSubtree(Element* aRoot)
// starting, which requires traversing them again. Mark the elements
// that need animation processing, then do a forgetful traversal to
// update the styles and clear the animation bits.
if (mPresContext->EffectCompositor()->PreTraverseInSubtree(flags, aRoot)) {
if (GetPresContext()->EffectCompositor()->PreTraverseInSubtree(flags, aRoot)) {
postTraversalRequired =
Servo_TraverseSubtree(aRoot, mRawSet.get(), &snapshots,
ServoTraversalFlags::AnimationOnly |
@ -1050,10 +1069,11 @@ ServoStyleSet::SetStylistStyleSheetsDirty()
// We need to invalidate cached style in getComputedStyle for undisplayed
// elements, since we don't know if any of the style sheet change that we
// do would affect undisplayed elements.
if (mPresContext) {
// XBL sheets don't have a pres context, but invalidating the restyle generation
// in that case is handled by SetXBLStyleSheetsDirty in the "master" stylist.
mPresContext->RestyleManager()->AsServo()->IncrementUndisplayedRestyleGeneration();
if (nsPresContext* presContext = GetPresContext()) {
// XBL sheets don't have a pres context, but invalidating the restyle
// generation in that case is handled by SetXBLStyleSheetsDirty in the
// "master" stylist.
presContext->RestyleManager()->AsServo()->IncrementUndisplayedRestyleGeneration();
}
}
@ -1065,8 +1085,8 @@ ServoStyleSet::SetStylistXBLStyleSheetsDirty()
// We need to invalidate cached style in getComputedStyle for undisplayed
// elements, since we don't know if any of the style sheet change that we
// do would affect undisplayed elements.
MOZ_ASSERT(mPresContext);
mPresContext->RestyleManager()->AsServo()->IncrementUndisplayedRestyleGeneration();
MOZ_ASSERT(GetPresContext());
GetPresContext()->RestyleManager()->AsServo()->IncrementUndisplayedRestyleGeneration();
}
void
@ -1102,7 +1122,7 @@ ServoStyleSet::RuleChanged(ServoStyleSheet& aSheet, css::Rule* aRule)
void
ServoStyleSet::AssertTreeIsClean()
{
DocumentStyleRootIterator iter(mPresContext->Document());
DocumentStyleRootIterator iter(mDocument);
while (Element* root = iter.GetNextStyleRoot()) {
Servo_AssertTreeIsClean(root);
}
@ -1275,7 +1295,9 @@ ServoStyleSet::ResolveStyleLazilyInternal(Element* aElement,
CSSPseudoElementType aPseudoType,
StyleRuleInclusion aRuleInclusion)
{
mPresContext->EffectCompositor()->PreTraverse(aElement, aPseudoType);
MOZ_ASSERT(GetPresContext(),
"For now, no style resolution without a pres context");
GetPresContext()->EffectCompositor()->PreTraverse(aElement, aPseudoType);
MOZ_ASSERT(!StylistNeedsUpdate());
AutoSetInServoTraversal guard(this);
@ -1313,7 +1335,7 @@ ServoStyleSet::ResolveStyleLazilyInternal(Element* aElement,
mRawSet.get(),
/* aIgnoreExistingStyles = */ false).Consume();
if (mPresContext->EffectCompositor()->PreTraverse(aElement, aPseudoType)) {
if (GetPresContext()->EffectCompositor()->PreTraverse(aElement, aPseudoType)) {
computedValues =
Servo_ResolveStyleLazily(elementForStyleResolution,
pseudoTypeForStyleResolution,
@ -1323,7 +1345,7 @@ ServoStyleSet::ResolveStyleLazilyInternal(Element* aElement,
/* aIgnoreExistingStyles = */ false).Consume();
}
MOZ_DIAGNOSTIC_ASSERT(computedValues->PresContext() == mPresContext ||
MOZ_DIAGNOSTIC_ASSERT(computedValues->PresContext() == GetPresContext() ||
aElement->OwnerDoc()->GetBFCacheEntry());
return computedValues.forget();
@ -1340,6 +1362,8 @@ ServoStyleSet::AppendFontFaceRules(nsTArray<nsFontFaceRuleContainer>& aArray)
nsCSSCounterStyleRule*
ServoStyleSet::CounterStyleRuleForName(nsAtom* aName)
{
// FIXME(emilio): This should probably call UpdateStylistIfNeeded, or
// otherwise assert?
return Servo_StyleSet_GetCounterStyleRule(mRawSet.get(), aName);
}
@ -1372,15 +1396,14 @@ ServoStyleSet::UpdateStylist()
// There's no need to compute invalidations and such for an XBL styleset,
// since they are loaded and unloaded synchronously, and they don't have to
// deal with dynamic content changes.
Element* root =
IsMaster() ? mPresContext->Document()->GetDocumentElement() : nullptr;
Element* root = IsMaster() ? mDocument->GetRootElement() : nullptr;
Servo_StyleSet_FlushStyleSheets(mRawSet.get(), root);
}
if (MOZ_UNLIKELY(mStylistState & StylistState::XBLStyleSheetsDirty)) {
MOZ_ASSERT(IsMaster(), "Only master styleset can mark XBL stylesets dirty!");
mBindingManager->UpdateBoundContentBindingsForServo(mPresContext);
MOZ_ASSERT(GetPresContext(), "How did they get dirty?");
mDocument->BindingManager()->UpdateBoundContentBindingsForServo(GetPresContext());
}
mStylistState = StylistState::NotDirty;
@ -1417,7 +1440,8 @@ ServoStyleSet::MayTraverseFrom(const Element* aElement)
bool
ServoStyleSet::ShouldTraverseInParallel() const
{
return mPresContext->PresShell()->IsActive();
MOZ_ASSERT(mDocument->GetShell(), "Styling a document without a shell?");
return mDocument->GetShell()->IsActive();
}
void

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

@ -132,7 +132,7 @@ public:
CreateXBLServoStyleSet(nsPresContext* aPresContext,
const nsTArray<RefPtr<ServoStyleSheet>>& aNewSheets);
void Init(nsPresContext* aPresContext, nsBindingManager* aBindingManager);
void Init(nsPresContext* aPresContext);
void BeginShutdown() {}
void Shutdown();
@ -600,13 +600,27 @@ private:
const Kind mKind;
// Nullptr if this is an XBL style set, or if we've been already detached from
// our shell.
nsPresContext* MOZ_NON_OWNING_REF mPresContext = nullptr;
// The owner document of this style set. Null if this is an XBL style set.
//
// TODO(emilio): This should become a DocumentOrShadowRoot, and be owned by it
// directly instead of the shell, eventually.
nsIDocument* mDocument;
const nsPresContext* GetPresContext() const {
return const_cast<ServoStyleSet*>(this)->GetPresContext();
}
/**
* Return the associated pres context if we're the master style set and we
* have an associated pres shell.
*/
nsPresContext* GetPresContext();
// Because XBL style set could be used by multiple PresContext, we need to
// store the last PresContext pointer which uses this XBL styleset for
// computing medium rule changes.
//
// FIXME(emilio): This is a hack, and is broken. See bug 1406875.
void* MOZ_NON_OWNING_REF mLastPresContextUsesXBLStyleSet = nullptr;
UniquePtr<RawServoStyleSet> mRawSet;
@ -635,9 +649,6 @@ private:
// Constructed lazily when requested by devtools.
UniquePtr<ServoStyleRuleMap> mStyleRuleMap;
// This can be null if we are used to hold XBL style sheets.
RefPtr<nsBindingManager> mBindingManager;
static ServoStyleSet* sInServoTraversal;
};

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

@ -115,7 +115,7 @@ public:
// nsStyleSet or ServoStyleSet. See corresponding comments in
// nsStyleSet.h for descriptions of these methods.
inline void Init(nsPresContext* aPresContext, nsBindingManager* aBindingManager);
inline void Init(nsPresContext* aPresContext);
inline void BeginShutdown();
inline void Shutdown();
inline bool GetAuthorStyleDisabled() const;

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

@ -44,10 +44,9 @@ StyleSetHandle::Ptr::Delete()
}
void
StyleSetHandle::Ptr::Init(nsPresContext* aPresContext,
nsBindingManager* aBindingManager)
StyleSetHandle::Ptr::Init(nsPresContext* aPresContext)
{
FORWARD(Init, (aPresContext, aBindingManager));
FORWARD(Init, (aPresContext));
}
void

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

@ -29,6 +29,7 @@
#include "nsDOMMutationObserver.h"
#include "nsIPresShell.h"
#include "nsIPresShellInlines.h"
#include "nsRFPService.h"
#include <algorithm> // std::stable_sort
#include <math.h>
@ -164,7 +165,7 @@ CSSAnimation::HasLowerCompositeOrderThan(const CSSAnimation& aOther) const
}
void
CSSAnimation::QueueEvents(StickyTimeDuration aActiveTime)
CSSAnimation::QueueEvents(const StickyTimeDuration& aActiveTime)
{
// If the animation is pending, we ignore animation events until we finish
// pending.
@ -193,7 +194,7 @@ CSSAnimation::QueueEvents(StickyTimeDuration aActiveTime)
return;
}
const StickyTimeDuration zeroDuration;
static constexpr StickyTimeDuration zeroDuration = StickyTimeDuration();
uint64_t currentIteration = 0;
ComputedTiming::AnimationPhase currentPhase;
StickyTimeDuration intervalStartTime;
@ -235,12 +236,16 @@ CSSAnimation::QueueEvents(StickyTimeDuration aActiveTime)
AutoTArray<AnimationEventInfo, 2> events;
auto appendAnimationEvent = [&](EventMessage aMessage,
StickyTimeDuration aElapsedTime,
TimeStamp aTimeStamp) {
const StickyTimeDuration& aElapsedTime,
const TimeStamp& aTimeStamp) {
double elapsedTime = aElapsedTime.ToSeconds();
if (aMessage == eAnimationCancel) {
elapsedTime = nsRFPService::ReduceTimePrecisionAsSecs(elapsedTime);
}
events.AppendElement(AnimationEventInfo(mOwningElement.Target(),
aMessage,
mAnimationName,
aElapsedTime,
elapsedTime,
aTimeStamp,
this));
};

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

@ -14,7 +14,6 @@
#include "mozilla/Keyframe.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/TimeStamp.h"
#include "nsRFPService.h"
class nsIGlobalObject;
class nsStyleContext;
@ -44,7 +43,7 @@ struct AnimationEventInfo {
AnimationEventInfo(const NonOwningAnimationTarget& aTarget,
EventMessage aMessage,
nsAtom* aAnimationName,
const StickyTimeDuration& aElapsedTime,
double aElapsedTime,
const TimeStamp& aTimeStamp,
dom::Animation* aAnimation)
: mElement(aTarget.mElement)
@ -54,8 +53,7 @@ struct AnimationEventInfo {
{
// XXX Looks like nobody initialize WidgetEvent::time
aAnimationName->ToString(mEvent.mAnimationName);
mEvent.mElapsedTime =
nsRFPService::ReduceTimePrecisionAsSecs(aElapsedTime.ToSeconds());
mEvent.mElapsedTime = aElapsedTime;
mEvent.mPseudoElement =
AnimationCollection<dom::CSSAnimation>::PseudoTypeAsString(
aTarget.mPseudoType);
@ -152,7 +150,7 @@ public:
}
void Tick() override;
void QueueEvents(StickyTimeDuration aActiveTime = StickyTimeDuration());
void QueueEvents(const StickyTimeDuration& aActiveTime = StickyTimeDuration());
bool IsStylePaused() const { return mIsStylePaused; }
@ -181,7 +179,7 @@ public:
// reflect changes to that markup.
bool IsTiedToMarkup() const { return mOwningElement.IsSet(); }
void MaybeQueueCancelEvent(StickyTimeDuration aActiveTime) override {
void MaybeQueueCancelEvent(const StickyTimeDuration& aActiveTime) override {
QueueEvents(aActiveTime);
}

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

@ -3035,7 +3035,7 @@ CSS_PROP_POSITION(
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_STORES_CALC,
"",
0,
VARIANT_CALC,
kImageLayerPositionKTable,
offsetof(nsStylePosition, mObjectPosition),
eStyleAnimType_Custom)
@ -3528,7 +3528,7 @@ CSS_PROP_DISPLAY(
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
"",
0,
VARIANT_CALC,
kImageLayerPositionKTable,
CSS_PROP_NO_OFFSET,
eStyleAnimType_Custom)

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

@ -85,130 +85,145 @@ const OperatingSystemVersionInfo osVersionStrings[] = {
};
#endif
static nsPresContext*
GetPresContext(nsIDocument* aDocument)
{
nsIPresShell* presShell = aDocument->GetShell();
if (!presShell) {
return nullptr;
}
return presShell->GetPresContext();
}
// A helper for four features below
static nsSize
GetSize(nsPresContext* aPresContext)
GetSize(nsIDocument* aDocument)
{
nsSize size;
if (aPresContext->IsRootPaginatedDocument())
nsPresContext* pc = GetPresContext(aDocument);
// Per spec, return a 0x0 viewport if we're not being rendered. See:
//
// * https://github.com/w3c/csswg-drafts/issues/571
// * https://github.com/whatwg/html/issues/1813
//
if (!pc) {
return { };
}
if (pc->IsRootPaginatedDocument()) {
// We want the page size, including unprintable areas and margins.
size = aPresContext->GetPageSize();
else
size = aPresContext->GetVisibleArea().Size();
return size;
//
// FIXME(emilio, bug 1414600): Not quite!
return pc->GetPageSize();
}
return pc->GetVisibleArea().Size();
}
static void
GetWidth(nsPresContext* aPresContext, const nsMediaFeature*,
GetWidth(nsIDocument* aDocument, const nsMediaFeature*,
nsCSSValue& aResult)
{
nsSize size = GetSize(aPresContext);
float pixelWidth = aPresContext->AppUnitsToFloatCSSPixels(size.width);
aResult.SetFloatValue(pixelWidth, eCSSUnit_Pixel);
nsSize size = GetSize(aDocument);
aResult.SetFloatValue(CSSPixel::FromAppUnits(size.width), eCSSUnit_Pixel);
}
static void
GetHeight(nsPresContext* aPresContext, const nsMediaFeature*,
GetHeight(nsIDocument* aDocument, const nsMediaFeature*,
nsCSSValue& aResult)
{
nsSize size = GetSize(aPresContext);
float pixelHeight = aPresContext->AppUnitsToFloatCSSPixels(size.height);
aResult.SetFloatValue(pixelHeight, eCSSUnit_Pixel);
}
inline static nsDeviceContext*
GetDeviceContextFor(nsPresContext* aPresContext)
{
// It would be nice to call
// nsLayoutUtils::GetDeviceContextForScreenInfo here, except for two
// things: (1) it can flush, and flushing is bad here, and (2) it
// doesn't really get us consistency in multi-monitor situations
// *anyway*.
return aPresContext->DeviceContext();
nsSize size = GetSize(aDocument);
aResult.SetFloatValue(CSSPixel::FromAppUnits(size.height), eCSSUnit_Pixel);
}
static bool
ShouldResistFingerprinting(nsPresContext* aPresContext)
ShouldResistFingerprinting(nsIDocument* aDocument)
{
return nsContentUtils::ShouldResistFingerprinting(aPresContext->GetDocShell());
return nsContentUtils::ShouldResistFingerprinting(aDocument->GetDocShell());
}
static bool
IsDeviceSizePageSize(nsIDocument* aDocument)
{
nsIDocShell* docShell = aDocument->GetDocShell();
if (!docShell) {
return false;
}
return docShell->GetDeviceSizeIsPageSize();
}
// A helper for three features below.
static nsSize
GetDeviceSize(nsPresContext* aPresContext)
GetDeviceSize(nsIDocument* aDocument)
{
nsSize size;
if (ShouldResistFingerprinting(aDocument) || IsDeviceSizePageSize(aDocument)) {
return GetSize(aDocument);
}
if (ShouldResistFingerprinting(aPresContext) || aPresContext->IsDeviceSizePageSize()) {
size = GetSize(aPresContext);
} else if (aPresContext->IsRootPaginatedDocument()) {
nsPresContext* pc = GetPresContext(aDocument);
// NOTE(emilio): We should probably figure out how to return an appropriate
// device size here, though in a multi-screen world that makes no sense
// really.
if (!pc) {
return { };
}
if (pc->IsRootPaginatedDocument()) {
// We want the page size, including unprintable areas and margins.
// XXX The spec actually says we want the "page sheet size", but
// how is that different?
size = aPresContext->GetPageSize();
} else {
GetDeviceContextFor(aPresContext)->
GetDeviceSurfaceDimensions(size.width, size.height);
return pc->GetPageSize();
}
nsSize size;
pc->DeviceContext()->GetDeviceSurfaceDimensions(size.width, size.height);
return size;
}
static void
GetDeviceWidth(nsPresContext* aPresContext, const nsMediaFeature*,
GetDeviceWidth(nsIDocument* aDocument, const nsMediaFeature*,
nsCSSValue& aResult)
{
nsSize size = GetDeviceSize(aPresContext);
float pixelWidth = aPresContext->AppUnitsToFloatCSSPixels(size.width);
aResult.SetFloatValue(pixelWidth, eCSSUnit_Pixel);
nsSize size = GetDeviceSize(aDocument);
aResult.SetFloatValue(CSSPixel::FromAppUnits(size.width), eCSSUnit_Pixel);
}
static void
GetDeviceHeight(nsPresContext* aPresContext, const nsMediaFeature*,
GetDeviceHeight(nsIDocument* aDocument, const nsMediaFeature*,
nsCSSValue& aResult)
{
nsSize size = GetDeviceSize(aPresContext);
float pixelHeight = aPresContext->AppUnitsToFloatCSSPixels(size.height);
aResult.SetFloatValue(pixelHeight, eCSSUnit_Pixel);
nsSize size = GetDeviceSize(aDocument);
aResult.SetFloatValue(CSSPixel::FromAppUnits(size.height), eCSSUnit_Pixel);
}
static void
GetOrientation(nsPresContext* aPresContext, const nsMediaFeature*,
GetOrientation(nsIDocument* aDocument, const nsMediaFeature*,
nsCSSValue& aResult)
{
nsSize size = GetSize(aPresContext);
int32_t orientation;
if (size.width > size.height) {
orientation = NS_STYLE_ORIENTATION_LANDSCAPE;
} else {
// Per spec, square viewports should be 'portrait'
orientation = NS_STYLE_ORIENTATION_PORTRAIT;
}
nsSize size = GetSize(aDocument);
// Per spec, square viewports should be 'portrait'
int32_t orientation = size.width > size.height
? NS_STYLE_ORIENTATION_LANDSCAPE : NS_STYLE_ORIENTATION_PORTRAIT;
aResult.SetIntValue(orientation, eCSSUnit_Enumerated);
}
static void
GetDeviceOrientation(nsPresContext* aPresContext, const nsMediaFeature*,
GetDeviceOrientation(nsIDocument* aDocument, const nsMediaFeature*,
nsCSSValue& aResult)
{
nsSize size = GetDeviceSize(aPresContext);
int32_t orientation;
if (size.width > size.height) {
orientation = NS_STYLE_ORIENTATION_LANDSCAPE;
} else {
// Per spec, square viewports should be 'portrait'
orientation = NS_STYLE_ORIENTATION_PORTRAIT;
}
nsSize size = GetDeviceSize(aDocument);
// Per spec, square viewports should be 'portrait'
int32_t orientation = size.width > size.height
? NS_STYLE_ORIENTATION_LANDSCAPE : NS_STYLE_ORIENTATION_PORTRAIT;
aResult.SetIntValue(orientation, eCSSUnit_Enumerated);
}
static void
GetIsResourceDocument(nsPresContext* aPresContext, const nsMediaFeature*,
GetIsResourceDocument(nsIDocument* aDocument, const nsMediaFeature*,
nsCSSValue& aResult)
{
nsIDocument* doc = aPresContext->Document();
aResult.SetIntValue(doc && doc->IsResourceDoc() ? 1 : 0, eCSSUnit_Integer);
aResult.SetIntValue(aDocument->IsResourceDoc() ? 1 : 0, eCSSUnit_Integer);
}
// Helper for two features below
@ -224,32 +239,46 @@ MakeArray(const nsSize& aSize, nsCSSValue& aResult)
}
static void
GetAspectRatio(nsPresContext* aPresContext, const nsMediaFeature*,
GetAspectRatio(nsIDocument* aDocument, const nsMediaFeature*,
nsCSSValue& aResult)
{
MakeArray(GetSize(aPresContext), aResult);
MakeArray(GetSize(aDocument), aResult);
}
static void
GetDeviceAspectRatio(nsPresContext* aPresContext, const nsMediaFeature*,
GetDeviceAspectRatio(nsIDocument* aDocument, const nsMediaFeature*,
nsCSSValue& aResult)
{
MakeArray(GetDeviceSize(aPresContext), aResult);
MakeArray(GetDeviceSize(aDocument), aResult);
}
static nsDeviceContext*
GetDeviceContextFor(nsIDocument* aDocument)
{
nsPresContext* pc = GetPresContext(aDocument);
if (!pc) {
return nullptr;
}
// It would be nice to call nsLayoutUtils::GetDeviceContextForScreenInfo here,
// except for two things: (1) it can flush, and flushing is bad here, and (2)
// it doesn't really get us consistency in multi-monitor situations *anyway*.
return pc->DeviceContext();
}
static void
GetColor(nsPresContext* aPresContext, const nsMediaFeature*,
GetColor(nsIDocument* aDocument, const nsMediaFeature*,
nsCSSValue& aResult)
{
uint32_t depth = 24; // Use depth of 24 when resisting fingerprinting.
// Use depth of 24 when resisting fingerprinting, or when we're not being
// rendered.
uint32_t depth = 24;
if (!ShouldResistFingerprinting(aPresContext)) {
// FIXME: This implementation is bogus. nsDeviceContext
// doesn't provide reliable information (should be fixed in bug
// 424386).
// FIXME: On a monochrome device, return 0!
nsDeviceContext *dx = GetDeviceContextFor(aPresContext);
dx->GetDepth(depth);
if (!ShouldResistFingerprinting(aDocument)) {
if (nsDeviceContext* dx = GetDeviceContextFor(aDocument)) {
// FIXME: On a monochrome device, return 0!
dx->GetDepth(depth);
}
}
// The spec says to use bits *per color component*, so divide by 3,
@ -260,7 +289,7 @@ GetColor(nsPresContext* aPresContext, const nsMediaFeature*,
}
static void
GetColorIndex(nsPresContext* aPresContext, const nsMediaFeature*,
GetColorIndex(nsIDocument* aDocument, const nsMediaFeature*,
nsCSSValue& aResult)
{
// We should return zero if the device does not use a color lookup
@ -273,7 +302,7 @@ GetColorIndex(nsPresContext* aPresContext, const nsMediaFeature*,
}
static void
GetMonochrome(nsPresContext* aPresContext, const nsMediaFeature*,
GetMonochrome(nsIDocument* aDocument, const nsMediaFeature*,
nsCSSValue& aResult)
{
// For color devices we should return 0.
@ -283,7 +312,7 @@ GetMonochrome(nsPresContext* aPresContext, const nsMediaFeature*,
}
static void
GetResolution(nsPresContext* aPresContext, const nsMediaFeature*,
GetResolution(nsIDocument* aDocument, const nsMediaFeature*,
nsCSSValue& aResult)
{
// We're returning resolution in terms of device pixels per css pixel, since
@ -291,23 +320,23 @@ GetResolution(nsPresContext* aPresContext, const nsMediaFeature*,
// introducing precision error from conversion to and from less-used
// physical units like inches.
float dppx;
float dppx = 1.;
if (!ShouldResistFingerprinting(aPresContext)) {
// Get the actual device pixel ratio, which also takes zoom into account.
dppx = float(nsPresContext::AppUnitsPerCSSPixel()) /
aPresContext->AppUnitsPerDevPixel();
} else {
// We are resisting fingerprinting, so pretend we have a device pixel ratio
// of 1. In that case, we simply report the zoom level.
dppx = aPresContext->GetDeviceFullZoom();
if (nsDeviceContext* dx = GetDeviceContextFor(aDocument)) {
if (ShouldResistFingerprinting(aDocument)) {
dppx = dx->GetFullZoom();
} else {
// Get the actual device pixel ratio, which also takes zoom into account.
dppx =
float(nsPresContext::AppUnitsPerCSSPixel()) / dx->AppUnitsPerDevPixel();
}
}
aResult.SetFloatValue(dppx, eCSSUnit_Pixel);
}
static void
GetScan(nsPresContext* aPresContext, const nsMediaFeature*,
GetScan(nsIDocument* aDocument, const nsMediaFeature*,
nsCSSValue& aResult)
{
// Since Gecko doesn't support the 'tv' media type, the 'scan'
@ -315,35 +344,27 @@ GetScan(nsPresContext* aPresContext, const nsMediaFeature*,
aResult.Reset();
}
static nsIDocument*
TopDocument(nsIDocument* aDocument)
{
nsIDocument* current = aDocument;
while (nsIDocument* parent = current->GetParentDocument()) {
current = parent;
}
return current;
}
static void
GetDisplayMode(nsPresContext* aPresContext, const nsMediaFeature*,
GetDisplayMode(nsIDocument* aDocument, const nsMediaFeature*,
nsCSSValue& aResult)
{
nsCOMPtr<nsISupports> container;
RefPtr<nsIDocShell> docShell;
nsIDocument* rootDocument = TopDocument(aDocument);
if (!aPresContext) {
aResult.SetIntValue(NS_STYLE_DISPLAY_MODE_BROWSER, eCSSUnit_Enumerated);
return;
}
if (aPresContext) {
// Calling GetRootPresContext() can be slow, so make sure to call it
// just once.
nsRootPresContext* root = aPresContext->GetRootPresContext();
if (root && root->Document()) {
container = root->Document()->GetContainer();
docShell = root->GetDocShell();
}
}
nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(container);
if (baseWindow) {
nsCOMPtr<nsISupports> container = rootDocument->GetContainer();
if (nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(container)) {
nsCOMPtr<nsIWidget> mainWidget;
baseWindow->GetMainWidget(getter_AddRefs(mainWidget));
nsSizeMode mode = mainWidget ? mainWidget->SizeMode() : nsSizeMode_Normal;
if (mode == nsSizeMode_Fullscreen) {
if (mainWidget && mainWidget->SizeMode() == nsSizeMode_Fullscreen) {
aResult.SetIntValue(NS_STYLE_DISPLAY_MODE_FULLSCREEN, eCSSUnit_Enumerated);
return;
}
@ -356,7 +377,7 @@ GetDisplayMode(nsPresContext* aPresContext, const nsMediaFeature*,
"nsIDocShell display modes must mach nsStyleConsts.h");
uint32_t displayMode = NS_STYLE_DISPLAY_MODE_BROWSER;
if (docShell) {
if (nsIDocShell* docShell = rootDocument->GetDocShell()) {
docShell->GetDisplayMode(&displayMode);
}
@ -364,7 +385,7 @@ GetDisplayMode(nsPresContext* aPresContext, const nsMediaFeature*,
}
static void
GetGrid(nsPresContext* aPresContext, const nsMediaFeature*,
GetGrid(nsIDocument* aDocument, const nsMediaFeature*,
nsCSSValue& aResult)
{
// Gecko doesn't support grid devices (e.g., ttys), so the 'grid'
@ -373,19 +394,32 @@ GetGrid(nsPresContext* aPresContext, const nsMediaFeature*,
}
static void
GetDevicePixelRatio(nsPresContext* aPresContext, const nsMediaFeature*,
GetDevicePixelRatio(nsIDocument* aDocument, const nsMediaFeature*,
nsCSSValue& aResult)
{
if (!ShouldResistFingerprinting(aPresContext)) {
float ratio = aPresContext->CSSPixelsToDevPixels(1.0f);
aResult.SetFloatValue(ratio, eCSSUnit_Number);
} else {
if (ShouldResistFingerprinting(aDocument)) {
aResult.SetFloatValue(1.0, eCSSUnit_Number);
return;
}
nsIPresShell* presShell = aDocument->GetShell();
if (!presShell) {
aResult.SetFloatValue(1.0, eCSSUnit_Number);
return;
}
nsPresContext* pc = presShell->GetPresContext();
if (!pc) {
aResult.SetFloatValue(1.0, eCSSUnit_Number);
return;
}
float ratio = pc->CSSPixelsToDevPixels(1.0f);
aResult.SetFloatValue(ratio, eCSSUnit_Number);
}
static void
GetTransform3d(nsPresContext* aPresContext, const nsMediaFeature*,
GetTransform3d(nsIDocument* aDocument, const nsMediaFeature*,
nsCSSValue& aResult)
{
// Gecko supports 3d transforms, so this feature is always 1.
@ -409,7 +443,7 @@ GetWindowsThemeIdentifier()
#endif
static void
GetSystemMetric(nsPresContext* aPresContext, const nsMediaFeature* aFeature,
GetSystemMetric(nsIDocument* aDocument, const nsMediaFeature* aFeature,
nsCSSValue& aResult)
{
aResult.Reset();
@ -420,8 +454,7 @@ GetSystemMetric(nsPresContext* aPresContext, const nsMediaFeature* aFeature,
MOZ_ASSERT(!isAccessibleFromContentPages ||
*aFeature->mName == nsGkAtoms::_moz_touch_enabled);
if (isAccessibleFromContentPages &&
ShouldResistFingerprinting(aPresContext)) {
if (isAccessibleFromContentPages && ShouldResistFingerprinting(aDocument)) {
// If "privacy.resistFingerprinting" is enabled, then we simply don't
// return any system-backed media feature values. (No spoofed values
// returned.)
@ -437,13 +470,13 @@ GetSystemMetric(nsPresContext* aPresContext, const nsMediaFeature* aFeature,
}
static void
GetWindowsTheme(nsPresContext* aPresContext, const nsMediaFeature* aFeature,
GetWindowsTheme(nsIDocument* aDocument, const nsMediaFeature* aFeature,
nsCSSValue& aResult)
{
aResult.Reset();
MOZ_ASSERT(aFeature->mReqFlags & nsMediaFeature::eUserAgentAndChromeOnly);
if (ShouldResistFingerprinting(aPresContext)) {
if (ShouldResistFingerprinting(aDocument)) {
return;
}
@ -466,13 +499,13 @@ GetWindowsTheme(nsPresContext* aPresContext, const nsMediaFeature* aFeature,
}
static void
GetOperatingSystemVersion(nsPresContext* aPresContext, const nsMediaFeature* aFeature,
GetOperatingSystemVersion(nsIDocument* aDocument, const nsMediaFeature* aFeature,
nsCSSValue& aResult)
{
aResult.Reset();
MOZ_ASSERT(aFeature->mReqFlags & nsMediaFeature::eUserAgentAndChromeOnly);
if (ShouldResistFingerprinting(aPresContext)) {
if (ShouldResistFingerprinting(aDocument)) {
return;
}
@ -493,11 +526,11 @@ GetOperatingSystemVersion(nsPresContext* aPresContext, const nsMediaFeature* aFe
}
static void
GetIsGlyph(nsPresContext* aPresContext, const nsMediaFeature* aFeature,
nsCSSValue& aResult)
GetIsGlyph(nsIDocument* aDocument, const nsMediaFeature* aFeature,
nsCSSValue& aResult)
{
MOZ_ASSERT(aFeature->mReqFlags & nsMediaFeature::eUserAgentAndChromeOnly);
aResult.SetIntValue(aPresContext->IsGlyph() ? 1 : 0, eCSSUnit_Integer);
aResult.SetIntValue(aDocument->IsSVGGlyphsDocument() ? 1 : 0, eCSSUnit_Integer);
}
/* static */ void

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

@ -12,11 +12,11 @@
#include "nsCSSProps.h"
class nsAtom;
class nsPresContext;
class nsIDocument;
class nsCSSValue;
struct nsMediaFeature;
typedef void (*nsMediaFeatureValueGetter)(nsPresContext* aPresContext,
typedef void (*nsMediaFeatureValueGetter)(nsIDocument* aDocument,
const nsMediaFeature* aFeature,
nsCSSValue& aResult);

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

@ -29,7 +29,7 @@ int32_t DoCompare(Numeric a, Numeric b)
}
bool
nsMediaExpression::Matches(nsPresContext *aPresContext,
nsMediaExpression::Matches(nsPresContext* aPresContext,
const nsCSSValue& aActualValue) const
{
const nsCSSValue& actual = aActualValue;
@ -221,7 +221,7 @@ nsMediaQueryResultCacheKey::Matches(nsPresContext* aPresContext) const
const FeatureEntry *entry = &mFeatureCache[i];
nsCSSValue actual;
entry->mFeature->mGetter(aPresContext, entry->mFeature, actual);
entry->mFeature->mGetter(aPresContext->Document(), entry->mFeature, actual);
for (uint32_t j = 0; j < entry->mExpressions.Length(); ++j) {
const ExpressionEntry &eentry = entry->mExpressions[j];
@ -476,7 +476,7 @@ nsMediaQuery::Matches(nsPresContext* aPresContext,
for (uint32_t i = 0, i_end = mExpressions.Length(); match && i < i_end; ++i) {
const nsMediaExpression &expr = mExpressions[i];
nsCSSValue actual;
expr.mFeature->mGetter(aPresContext, expr.mFeature, actual);
expr.mFeature->mGetter(aPresContext->Document(), expr.mFeature, actual);
match = expr.Matches(aPresContext, actual);
if (aKey) {

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

@ -274,15 +274,15 @@ nsStyleSet::AddSizeOfIncludingThis(nsWindowSizes& aSizes) const
}
void
nsStyleSet::Init(nsPresContext* aPresContext, nsBindingManager* aBindingManager)
nsStyleSet::Init(nsPresContext* aPresContext)
{
mFirstLineRule = new nsEmptyStyleRule;
mFirstLetterRule = new nsEmptyStyleRule;
mPlaceholderRule = new nsEmptyStyleRule;
mDisableTextZoomStyleRule = new nsDisableTextZoomStyleRule;
mBindingManager = aPresContext->Document()->BindingManager();
mRuleTree = nsRuleNode::CreateRootNode(aPresContext);
mBindingManager = aBindingManager;
// Make an explicit GatherRuleProcessors call for the levels that
// don't have style sheets. The other levels will have their calls
@ -2702,9 +2702,6 @@ nsStyleSet::EnsureUniqueInnerOnCSSSheets()
if (mBindingManager) {
AutoTArray<StyleSheet*, 32> sheets;
// XXXheycam stylo: AppendAllSheets will need to be able to return either
// CSSStyleSheets or ServoStyleSheets, on request (and then here requesting
// CSSStyleSheets).
mBindingManager->AppendAllSheets(sheets);
for (StyleSheet* sheet : sheets) {
MOZ_ASSERT(sheet->IsGecko(), "stylo: AppendAllSheets shouldn't give us "

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

@ -110,7 +110,7 @@ class nsStyleSet final
void AddSizeOfIncludingThis(nsWindowSizes& aSizes) const;
void Init(nsPresContext* aPresContext, nsBindingManager* aBindingManager);
void Init(nsPresContext* aPresContext);
nsRuleNode* GetRuleTree() { return mRuleTree; }

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

@ -32,6 +32,7 @@
#include "nsCSSProps.h"
#include "nsCSSPseudoElements.h"
#include "nsDisplayList.h"
#include "nsRFPService.h"
#include "nsStyleChangeList.h"
#include "nsStyleSet.h"
#include "mozilla/RestyleManager.h"
@ -201,7 +202,7 @@ CSSTransition::UpdateTiming(SeekFlag aSeekFlag, SyncNotifyFlag aSyncNotifyFlag)
}
void
CSSTransition::QueueEvents(StickyTimeDuration aActiveTime)
CSSTransition::QueueEvents(const StickyTimeDuration& aActiveTime)
{
if (!mOwningElement.IsSet()) {
return;
@ -212,7 +213,7 @@ CSSTransition::QueueEvents(StickyTimeDuration aActiveTime)
return;
}
const StickyTimeDuration zeroDuration = StickyTimeDuration();
static constexpr StickyTimeDuration zeroDuration = StickyTimeDuration();
TransitionPhase currentPhase;
StickyTimeDuration intervalStartTime;
@ -251,12 +252,16 @@ CSSTransition::QueueEvents(StickyTimeDuration aActiveTime)
AutoTArray<TransitionEventInfo, 3> events;
auto appendTransitionEvent = [&](EventMessage aMessage,
StickyTimeDuration aElapsedTime,
TimeStamp aTimeStamp) {
const StickyTimeDuration& aElapsedTime,
const TimeStamp& aTimeStamp) {
double elapsedTime = aElapsedTime.ToSeconds();
if (aMessage == eTransitionCancel) {
elapsedTime = nsRFPService::ReduceTimePrecisionAsSecs(elapsedTime);
}
events.AppendElement(TransitionEventInfo(mOwningElement.Target(),
aMessage,
TransitionProperty(),
aElapsedTime,
elapsedTime,
aTimeStamp,
this));
};

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

@ -218,7 +218,7 @@ public:
const TimeDuration& aStartTime,
double aPlaybackRate);
void MaybeQueueCancelEvent(StickyTimeDuration aActiveTime) override {
void MaybeQueueCancelEvent(const StickyTimeDuration& aActiveTime) override {
QueueEvents(aActiveTime);
}
@ -233,7 +233,7 @@ protected:
void UpdateTiming(SeekFlag aSeekFlag,
SyncNotifyFlag aSyncNotifyFlag) override;
void QueueEvents(StickyTimeDuration activeTime = StickyTimeDuration());
void QueueEvents(const StickyTimeDuration& activeTime = StickyTimeDuration());
enum class TransitionPhase;
@ -310,7 +310,7 @@ struct TransitionEventInfo {
TransitionEventInfo(const NonOwningAnimationTarget& aTarget,
EventMessage aMessage,
nsCSSPropertyID aProperty,
StickyTimeDuration aDuration,
double aElapsedTime,
const TimeStamp& aTimeStamp,
dom::Animation* aAnimation)
: mElement(aTarget.mElement)
@ -321,7 +321,7 @@ struct TransitionEventInfo {
// XXX Looks like nobody initialize WidgetEvent::time
mEvent.mPropertyName =
NS_ConvertUTF8toUTF16(nsCSSProps::GetStringValue(aProperty));
mEvent.mElapsedTime = aDuration.ToSeconds();
mEvent.mElapsedTime = aElapsedTime;
mEvent.mPseudoElement =
AnimationCollection<dom::CSSTransition>::PseudoTypeAsString(
aTarget.mPseudoType);

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

@ -260,7 +260,7 @@ nsSVGDisplayContainerFrame::PaintSVG(gfxContext& aContext,
{
NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
(mState & NS_FRAME_IS_NONDISPLAY) ||
PresContext()->IsGlyph(),
PresContext()->Document()->IsSVGGlyphsDocument(),
"If display lists are enabled, only painting of non-display "
"SVG should take this code path");

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

@ -657,7 +657,7 @@ nsSVGUtils::PaintFrameWithEffects(nsIFrame *aFrame,
{
NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
(aFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY) ||
aFrame->PresContext()->IsGlyph(),
aFrame->PresContext()->Document()->IsSVGGlyphsDocument(),
"If display lists are enabled, only painting of non-display "
"SVG should take this code path");

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

@ -21,7 +21,6 @@ DisableStlWrapping()
LOCAL_INCLUDES += [
'../',
'/',
'/ipc/chromium/src/',
'/media/libopus/celt/',
'/media/libopus/include',

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

@ -67,3 +67,6 @@ TEST_DIRS += [
]
SPHINX_TREES['fennec'] = 'docs'
with Files('docs/**'):
SCHEDULES.exclusive = ['docs']

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

@ -56,7 +56,16 @@ with Files('**/Makefile.in'):
FINAL = True
with Files("**/*.js"):
SCHEDULES.inclusive += ['test-verify']
SCHEDULES.inclusive += ['test-verify', 'docs']
with Files("**/*.jsm"):
SCHEDULES.inclusive += ['docs']
with Files("**/*.rst"):
SCHEDULES.inclusive += ['docs']
with Files("**/*.md"):
SCHEDULES.inclusive += ['docs']
with Files("**/*.html"):
SCHEDULES.inclusive += ['test-verify']

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

@ -37,8 +37,14 @@ SPHINX_PYTHON_PACKAGE_DIRS += [
'mozversioncontrol/mozversioncontrol',
]
with Files('**.py'):
SCHEDULES.inclusive += ['docs']
SPHINX_TREES['mach'] = 'mach/docs'
with Files('mach/docs/**'):
SCHEDULES.exclusive = ['docs']
PYTHON_UNITTEST_MANIFESTS += [
'mach/mach/test/python.ini',
'mozbuild/dumbmake/test/python.ini',

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

@ -447,7 +447,7 @@ class BaseBootstrapper(object):
return LooseVersion(match.group(1))
def _hg_cleanenv(self):
def _hg_cleanenv(self, load_hgrc=False):
""" Returns a copy of the current environment updated with the HGPLAIN
and HGRCPATH environment variables.
@ -459,7 +459,8 @@ class BaseBootstrapper(object):
"""
env = os.environ.copy()
env[b'HGPLAIN'] = b'1'
env[b'HGRCPATH'] = b''
if not load_hgrc:
env[b'HGRCPATH'] = b''
return env

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

@ -320,8 +320,10 @@ class Bootstrapper(object):
state_dir_available = os.path.exists(state_dir)
# We need to enable the loading of hgrc in case extensions are
# required to open the repo.
r = current_firefox_checkout(check_output=self.instance.check_output,
env=self.instance._hgplain_env(),
env=self.instance._hg_cleanenv(load_hgrc=True),
hg=self.instance.which('hg'))
(checkout_type, checkout_root) = r

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

@ -848,10 +848,9 @@ class Schedules(object):
elif other._exclusive == schedules.EXCLUSIVE_COMPONENTS:
rv._exclusive = self._exclusive
else:
msg = 'Two Files sections have set SCHEDULES.exclusive to different' \
'values; these cannot be combined: {} and {}'
msg = msg.format(self._exclusive, other._exclusive)
raise ValueError(msg)
# in a case where two SCHEDULES.exclusive set different values, take
# the later one; this acts the way we expect assignment to work.
rv._exclusive = other._exclusive
return rv

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

@ -1121,11 +1121,17 @@ class TreeMetadataEmitter(LoggingMixin):
local_includes = []
for local_include in context.get('LOCAL_INCLUDES', []):
full_path = local_include.full_path
if (not isinstance(local_include, ObjDirPath) and
not os.path.exists(local_include.full_path)):
not os.path.exists(full_path)):
raise SandboxValidationError('Path specified in LOCAL_INCLUDES '
'does not exist: %s (resolved to %s)' % (local_include,
local_include.full_path), context)
full_path), context)
if (full_path == context.config.topsrcdir or
full_path == context.config.topobjdir):
raise SandboxValidationError('Path specified in LOCAL_INCLUDES '
'is not allowed: %s (resolved to %s)' % (local_include,
full_path), context)
include_obj = LocalInclude(context, local_include)
local_includes.append(include_obj.path.full_path)
yield include_obj

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

@ -11,7 +11,12 @@ from __future__ import absolute_import, unicode_literals, print_function
# TODO: ideally these lists could be specified in moz.build itself
# Inclusive components are those which are scheduled when certain files are
# changed, but do not run by default. These are generally added to
# `SCHEDULES.inclusive` using `+=`, but can also be used as exclusive
# components for files which *only* affect the named component.
INCLUSIVE_COMPONENTS = [
'docs',
'py-lint',
'js-lint',
'yaml-lint',
@ -23,6 +28,10 @@ INCLUSIVE_COMPONENTS = [
]
INCLUSIVE_COMPONENTS = sorted(INCLUSIVE_COMPONENTS)
# Exclusive components are those which are scheduled by default, but for which
# some files *only* affect that component. For example, most files affect all
# platforms, but platform-specific files exclusively affect a single platform.
# These components are assigned to `SCHEDULES.exclusive` with `=`.
EXCLUSIVE_COMPONENTS = [
# os families
'android',

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

@ -0,0 +1,5 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
LOCAL_INCLUDES += ['!/']

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

@ -0,0 +1,5 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
LOCAL_INCLUDES += ['/']

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

@ -7,7 +7,7 @@ with Files('*.win'):
with Files('*.osx'):
SCHEDULES.exclusive = ['macosx']
with Files('bad.osx'):
with Files('win.and.osx'):
# this conflicts with the previous clause and will cause an error
# when read
SCHEDULES.exclusive = ['macosx', 'windows']

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

@ -972,6 +972,22 @@ class TestEmitterBasic(unittest.TestCase):
self.assertEqual(local_includes, expected)
def test_local_includes_invalid(self):
"""Test that invalid LOCAL_INCLUDES are properly detected."""
reader = self.reader('local_includes-invalid/srcdir')
with self.assertRaisesRegexp(
SandboxValidationError,
'Path specified in LOCAL_INCLUDES is not allowed:'):
objs = self.read_topsrcdir(reader)
reader = self.reader('local_includes-invalid/objdir')
with self.assertRaisesRegexp(
SandboxValidationError,
'Path specified in LOCAL_INCLUDES is not allowed:'):
objs = self.read_topsrcdir(reader)
def test_generated_includes(self):
"""Test that GENERATED_INCLUDES is emitted correctly."""
reader = self.reader('generated_includes')

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

@ -484,6 +484,7 @@ class TestBuildReader(unittest.TestCase):
def test_schedules(self):
reader = self.reader('schedules')
info = reader.files_info([
'win.and.osx',
'somefile',
'foo.win',
'foo.osx',
@ -513,13 +514,10 @@ class TestBuildReader(unittest.TestCase):
self.assertEqual(set(info['subd/yaml.py']['SCHEDULES'].components),
set(schedules.EXCLUSIVE_COMPONENTS + ['py-lint', 'yaml-lint']))
def test_schedules_conflicting_excludes(self):
reader = self.reader('schedules')
# bad.osx is defined explicitly, and matches *.osx, and the two have
# conflicting SCHEDULES.exclusive settings
with self.assertRaisesRegexp(ValueError, r"Two Files sections"):
reader.files_info(['bad.osx'])
# win.and.osx is defined explicitly, and matches *.osx, and the two have
# conflicting SCHEDULES.exclusive settings, so the later one is used
self.assertEqual(set(info['win.and.osx']['SCHEDULES'].exclusive),
set(['macosx', 'windows']))
if __name__ == '__main__':
main()

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

@ -289,6 +289,11 @@ function getScopeKey(scopeArray) {
return normalizedScopes.sort().join("|");
}
function getPropertyDescriptor(obj, prop) {
return Object.getOwnPropertyDescriptor(obj, prop) ||
getPropertyDescriptor(Object.getPrototypeOf(obj), prop);
}
/**
* Copies properties from a given object to another object.
*
@ -296,33 +301,26 @@ function getScopeKey(scopeArray) {
* The object we read property descriptors from.
* @param to (object)
* The object that we set property descriptors on.
* @param options (object) (optional)
* {keys: [...]}
* Lets the caller pass the names of all properties they want to be
* copied. Will copy all properties of the given source object by
* default.
* {bind: object}
* Lets the caller specify the object that will be used to .bind()
* all function properties we find to. Will bind to the given target
* object by default.
* @param thisObj (object)
* The object that will be used to .bind() all function properties we find to.
* @param keys ([...])
* The names of all properties to be copied.
*/
function copyObjectProperties(from, to, opts = {}) {
let keys = (opts && opts.keys) || Object.keys(from);
let thisArg = (opts && opts.bind) || to;
function copyObjectProperties(from, to, thisObj, keys) {
for (let prop of keys) {
let desc = Object.getOwnPropertyDescriptor(from, prop);
// Look for the prop in the prototype chain.
let desc = getPropertyDescriptor(from, prop);
if (typeof(desc.value) == "function") {
desc.value = desc.value.bind(thisArg);
desc.value = desc.value.bind(thisObj);
}
if (desc.get) {
desc.get = desc.get.bind(thisArg);
desc.get = desc.get.bind(thisObj);
}
if (desc.set) {
desc.set = desc.set.bind(thisArg);
desc.set = desc.set.bind(thisObj);
}
Object.defineProperty(to, prop, desc);
@ -337,20 +335,15 @@ function urlsafeBase64Encode(key) {
* The public API's constructor.
*/
this.FxAccounts = function(mockInternal) {
let internal = new FxAccountsInternal();
let external = {};
let internal;
// Copy all public properties to the 'external' object.
let prototype = FxAccountsInternal.prototype;
let options = {keys: publicProperties, bind: internal};
copyObjectProperties(prototype, external, options);
// Copy all of the mock's properties to the internal object.
if (mockInternal && !mockInternal.onlySetInternal) {
copyObjectProperties(mockInternal, internal);
}
if (mockInternal) {
if (!mockInternal) {
internal = new FxAccountsInternal();
copyObjectProperties(FxAccountsInternal.prototype, external, internal, publicProperties);
} else {
internal = Object.create(FxAccountsInternal.prototype, Object.getOwnPropertyDescriptors(mockInternal));
copyObjectProperties(internal, external, internal, publicProperties);
// Exposes the internal object for testing only.
external.internal = internal;
}
@ -1238,7 +1231,7 @@ FxAccountsInternal.prototype = {
const response = await this.checkEmailStatus(sessionToken, { reason: why });
log.debug("checkEmailStatus -> " + JSON.stringify(response));
if (response && response.verified) {
await this.onPollEmailSuccess(currentState, why);
await this.onPollEmailSuccess(currentState);
return;
}
} catch (error) {
@ -1286,7 +1279,7 @@ FxAccountsInternal.prototype = {
}, nextPollMs);
},
async onPollEmailSuccess(currentState, why) {
async onPollEmailSuccess(currentState) {
try {
await currentState.updateUserAccountData({ verified: true });
const accountData = await currentState.getUserAccountData();
@ -1297,9 +1290,6 @@ FxAccountsInternal.prototype = {
}
// Tell FxAccountsManager to clear its cache
await this.notifyObservers(ON_FXA_UPDATE_NOTIFICATION, ONVERIFIED_NOTIFICATION);
// Record how we determined the account was verified
Services.telemetry.scalarSet("services.sync.fxa_verification_method",
why == "push" ? "push" : "poll");
} catch (e) {
log.error(e);
}

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

@ -281,7 +281,7 @@ dependencies = [
"cssparser 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.18 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
@ -354,7 +354,7 @@ name = "cgl"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gleam 0.4.18 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -453,7 +453,7 @@ version = "0.0.1"
dependencies = [
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx_traits 0.0.1",
"gleam 0.4.18 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
@ -795,7 +795,7 @@ dependencies = [
"compositing 0.0.1",
"devtools 0.0.1",
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.18 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin_app 0.0.1",
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"libservo 0.0.1",
@ -1142,7 +1142,7 @@ dependencies = [
[[package]]
name = "gleam"
version = "0.4.18"
version = "0.4.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gl_generator 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1162,7 +1162,7 @@ dependencies = [
"compositing 0.0.1",
"euclid 0.16.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.4.18 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)",
"libservo 0.0.1",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
@ -1362,7 +1362,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.18 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.19 (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.33 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1626,7 +1626,7 @@ dependencies = [
"euclid 0.16.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.4.18 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"layout_thread 0.0.1",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2137,7 +2137,7 @@ dependencies = [
"core-foundation 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gl_generator 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.18 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libloading 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2566,7 +2566,7 @@ dependencies = [
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"gecko-media 0.1.0 (git+https://github.com/servo/gecko-media.git)",
"gleam 0.4.18 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)",
"half 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2873,7 +2873,7 @@ dependencies = [
"cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
"expat-sys 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.18 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)",
"glx 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"io-surface 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
@ -3561,7 +3561,7 @@ dependencies = [
[[package]]
name = "webrender"
version = "0.56.1"
source = "git+https://github.com/servo/webrender#2acfa55f11f51427a6b62b3fc93252365288d1a5"
source = "git+https://github.com/servo/webrender#2547f6fe91da018cd3374acd661effb5f8fbe022"
dependencies = [
"app_units 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"bincode 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -3574,7 +3574,7 @@ dependencies = [
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
"freetype 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.18 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
@ -3589,7 +3589,7 @@ dependencies = [
[[package]]
name = "webrender_api"
version = "0.56.1"
source = "git+https://github.com/servo/webrender#2acfa55f11f51427a6b62b3fc93252365288d1a5"
source = "git+https://github.com/servo/webrender#2547f6fe91da018cd3374acd661effb5f8fbe022"
dependencies = [
"app_units 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"bincode 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -3856,7 +3856,7 @@ dependencies = [
"checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685"
"checksum gif 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8a80d6fe9e52f637df9afd4779449a7be17c39cc9c35b01589bb833f956ba596"
"checksum gl_generator 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f5c19cde55637681450c92f7a05ea16c78e2b6d0587e601ec1ebdab6960854b"
"checksum gleam 0.4.18 (registry+https://github.com/rust-lang/crates.io-index)" = "437fdf7818d999b299e159611d7bb733fc7bcee683640ec2275b7d38a70688dd"
"checksum gleam 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)" = "4f756699879522bc654ecc44ad42ad14c59803c2dacfa5a67a7fc27257a8b4e9"
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
"checksum glx 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ac56da48dff37e91aa7bf6a47af1de951ef4666dd3dd85de1bd804334c5f933c"
"checksum gvr-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "92de62505f21ed0ce04f36cb0dca582a100fc4204d392e6b97bba2a15f9d24b3"

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

@ -166,6 +166,7 @@ impl WebRenderDisplayItemConverter for DisplayItem {
item.stretch_size.to_layout(),
item.tile_spacing.to_layout(),
item.image_rendering.to_layout(),
webrender_api::AlphaType::PremultipliedAlpha,
id,
);
}

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

@ -35,6 +35,12 @@ pub unsafe fn trace(tracer: *mut JSTracer) {
})
}
pub fn is_execution_stack_empty() -> bool {
STACK.with(|stack| {
stack.borrow().is_empty()
})
}
/// RAII struct that pushes and pops entries from the script settings stack.
pub struct AutoEntryScript {
global: DomRoot<GlobalScope>,

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

@ -364,6 +364,8 @@ pub struct Document {
tti_window: DomRefCell<InteractiveWindow>,
/// RAII canceller for Fetch
canceller: FetchCanceller,
/// https://html.spec.whatwg.org/multipage/#throw-on-dynamic-markup-insertion-counter
throw_on_dynamic_markup_insertion_counter: Cell<u64>,
}
#[derive(JSTraceable, MallocSizeOf)]
@ -1894,7 +1896,12 @@ impl Document {
pub fn can_invoke_script(&self) -> bool {
match self.get_current_parser() {
Some(parser) => parser.parser_is_not_active(),
Some(parser) => {
// It is safe to run script if the parser is not actively parsing,
// or if it is impossible to interact with the token stream.
parser.parser_is_not_active() ||
self.throw_on_dynamic_markup_insertion_counter.get() > 0
}
None => true,
}
}
@ -2053,6 +2060,16 @@ impl Document {
let global_scope = self.window.upcast::<GlobalScope>();
global_scope.script_to_constellation_chan().send(msg).unwrap();
}
pub fn increment_throw_on_dynamic_markup_insertion_counter(&self) {
let counter = self.throw_on_dynamic_markup_insertion_counter.get();
self.throw_on_dynamic_markup_insertion_counter.set(counter + 1);
}
pub fn decrement_throw_on_dynamic_markup_insertion_counter(&self) {
let counter = self.throw_on_dynamic_markup_insertion_counter.get();
self.throw_on_dynamic_markup_insertion_counter.set(counter - 1);
}
}
#[derive(MallocSizeOf, PartialEq)]
@ -2294,6 +2311,7 @@ impl Document {
interactive_time: DomRefCell::new(interactive_time),
tti_window: DomRefCell::new(InteractiveWindow::new()),
canceller: canceller,
throw_on_dynamic_markup_insertion_counter: Cell::new(0),
}
}
@ -3717,7 +3735,9 @@ impl DocumentMethods for Document {
}
// Step 2.
// TODO: handle throw-on-dynamic-markup-insertion counter.
if self.throw_on_dynamic_markup_insertion_counter.get() > 0 {
return Err(Error::InvalidState);
}
if !self.is_active() {
// Step 3.
@ -3863,7 +3883,10 @@ impl DocumentMethods for Document {
}
// Step 2.
// TODO: handle throw-on-dynamic-markup-insertion counter.
if self.throw_on_dynamic_markup_insertion_counter.get() > 0 {
return Err(Error::InvalidState);
}
if !self.is_active() {
// Step 3.
return Ok(());
@ -3910,7 +3933,9 @@ impl DocumentMethods for Document {
}
// Step 2.
// TODO: handle throw-on-dynamic-markup-insertion counter.
if self.throw_on_dynamic_markup_insertion_counter.get() > 0 {
return Err(Error::InvalidState);
}
let parser = match self.get_current_parser() {
Some(ref parser) if parser.is_script_created() => DomRoot::from_ref(&**parser),

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

@ -12,14 +12,15 @@ use dom::bindings::str::DOMString;
use dom::comment::Comment;
use dom::document::Document;
use dom::documenttype::DocumentType;
use dom::element::{CustomElementCreationMode, Element, ElementCreator};
use dom::element::{Element, ElementCreator};
use dom::htmlformelement::{FormControlElementHelpers, HTMLFormElement};
use dom::htmlscriptelement::HTMLScriptElement;
use dom::htmltemplateelement::HTMLTemplateElement;
use dom::node::Node;
use dom::processinginstruction::ProcessingInstruction;
use dom::servoparser::{ElementAttribute, create_element_for_token, ParsingAlgorithm};
use dom::virtualmethods::vtable_for;
use html5ever::{Attribute as HtmlAttribute, ExpandedName, LocalName, QualName};
use html5ever::{Attribute as HtmlAttribute, ExpandedName, QualName};
use html5ever::buffer_queue::BufferQueue;
use html5ever::tendril::{SendTendril, StrTendril, Tendril};
use html5ever::tendril::fmt::UTF8;
@ -335,20 +336,18 @@ impl Tokenizer {
self.insert_node(contents, Dom::from_ref(template.Content().upcast()));
}
ParseOperation::CreateElement { node, name, attrs, current_line } => {
let is = attrs.iter()
.find(|attr| attr.name.local.eq_str_ignore_ascii_case("is"))
.map(|attr| LocalName::from(&*attr.value));
let elem = Element::create(name,
is,
&*self.document,
ElementCreator::ParserCreated(current_line),
CustomElementCreationMode::Synchronous);
for attr in attrs {
elem.set_attribute_from_parser(attr.name, DOMString::from(attr.value), None);
}
self.insert_node(node, Dom::from_ref(elem.upcast()));
let attrs = attrs
.into_iter()
.map(|attr| ElementAttribute::new(attr.name, DOMString::from(attr.value)))
.collect();
let element = create_element_for_token(
name,
attrs,
&*self.document,
ElementCreator::ParserCreated(current_line),
ParsingAlgorithm::Normal
);
self.insert_node(node, Dom::from_ref(element.upcast()));
}
ParseOperation::CreateComment { text, node } => {
let comment = Comment::new(DOMString::from(text), document);

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

@ -16,7 +16,7 @@ use dom::htmlscriptelement::HTMLScriptElement;
use dom::htmltemplateelement::HTMLTemplateElement;
use dom::node::Node;
use dom::processinginstruction::ProcessingInstruction;
use dom::servoparser::Sink;
use dom::servoparser::{ParsingAlgorithm, Sink};
use html5ever::QualName;
use html5ever::buffer_queue::BufferQueue;
use html5ever::serialize::{AttrRef, Serialize, Serializer};
@ -39,13 +39,15 @@ impl Tokenizer {
pub fn new(
document: &Document,
url: ServoUrl,
fragment_context: Option<super::FragmentContext>)
fragment_context: Option<super::FragmentContext>,
parsing_algorithm: ParsingAlgorithm)
-> Self {
let sink = Sink {
base_url: url,
document: Dom::from_ref(document),
current_line: 1,
script: Default::default(),
parsing_algorithm: parsing_algorithm,
};
let options = TreeBuilderOpts {

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

@ -13,6 +13,7 @@ use dom::bindings::inheritance::Castable;
use dom::bindings::refcounted::Trusted;
use dom::bindings::reflector::{Reflector, reflect_dom_object};
use dom::bindings::root::{Dom, DomRoot, MutNullableDom, RootedReference};
use dom::bindings::settings_stack::is_execution_stack_empty;
use dom::bindings::str::DOMString;
use dom::characterdata::CharacterData;
use dom::comment::Comment;
@ -101,6 +102,26 @@ enum LastChunkState {
NotReceived,
}
pub struct ElementAttribute {
name: QualName,
value: DOMString
}
#[derive(Clone, Copy, JSTraceable, MallocSizeOf, PartialEq)]
pub enum ParsingAlgorithm {
Normal,
Fragment,
}
impl ElementAttribute {
pub fn new(name: QualName, value: DOMString) -> ElementAttribute {
ElementAttribute {
name: name,
value: value
}
}
}
impl ServoParser {
pub fn parser_is_not_active(&self) -> bool {
self.can_write() || self.tokenizer.try_borrow_mut().is_ok()
@ -114,7 +135,7 @@ impl ServoParser {
ParserKind::Normal)
} else {
ServoParser::new(document,
Tokenizer::Html(self::html::Tokenizer::new(document, url, None)),
Tokenizer::Html(self::html::Tokenizer::new(document, url, None, ParsingAlgorithm::Normal)),
LastChunkState::NotReceived,
ParserKind::Normal)
};
@ -160,7 +181,8 @@ impl ServoParser {
let parser = ServoParser::new(&document,
Tokenizer::Html(self::html::Tokenizer::new(&document,
url,
Some(fragment_context))),
Some(fragment_context),
ParsingAlgorithm::Fragment)),
LastChunkState::Received,
ParserKind::Normal);
parser.parse_string_chunk(String::from(input));
@ -173,10 +195,17 @@ impl ServoParser {
}
pub fn parse_html_script_input(document: &Document, url: ServoUrl, type_: &str) {
let parser = ServoParser::new(document,
Tokenizer::Html(self::html::Tokenizer::new(document, url, None)),
LastChunkState::NotReceived,
ParserKind::ScriptCreated);
let parser = ServoParser::new(
document,
Tokenizer::Html(self::html::Tokenizer::new(
document,
url,
None,
ParsingAlgorithm::Normal,
)),
LastChunkState::NotReceived,
ParserKind::ScriptCreated,
);
document.set_current_parser(Some(&parser));
if !type_.eq_ignore_ascii_case("text/html") {
parser.parse_string_chunk("<pre>\n".to_owned());
@ -748,6 +777,7 @@ pub struct Sink {
document: Dom<Document>,
current_line: u64,
script: MutNullableDom<HTMLScriptElement>,
parsing_algorithm: ParsingAlgorithm,
}
impl Sink {
@ -795,21 +825,18 @@ impl TreeSink for Sink {
fn create_element(&mut self, name: QualName, attrs: Vec<Attribute>, _flags: ElementFlags)
-> Dom<Node> {
let is = attrs.iter()
.find(|attr| attr.name.local.eq_str_ignore_ascii_case("is"))
.map(|attr| LocalName::from(&*attr.value));
let elem = Element::create(name,
is,
&*self.document,
ElementCreator::ParserCreated(self.current_line),
CustomElementCreationMode::Synchronous);
for attr in attrs {
elem.set_attribute_from_parser(attr.name, DOMString::from(String::from(attr.value)), None);
}
Dom::from_ref(elem.upcast())
let attrs = attrs
.into_iter()
.map(|attr| ElementAttribute::new(attr.name, DOMString::from(String::from(attr.value))))
.collect();
let element = create_element_for_token(
name,
attrs,
&*self.document,
ElementCreator::ParserCreated(self.current_line),
self.parsing_algorithm,
);
Dom::from_ref(element.upcast())
}
fn create_comment(&mut self, text: StrTendril) -> Dom<Node> {
@ -950,3 +977,64 @@ impl TreeSink for Sink {
vtable_for(&node).pop();
}
}
/// https://html.spec.whatwg.org/multipage/#create-an-element-for-the-token
fn create_element_for_token(
name: QualName,
attrs: Vec<ElementAttribute>,
document: &Document,
creator: ElementCreator,
parsing_algorithm: ParsingAlgorithm,
) -> DomRoot<Element> {
// Step 3.
let is = attrs.iter()
.find(|attr| attr.name.local.eq_str_ignore_ascii_case("is"))
.map(|attr| LocalName::from(&*attr.value));
// Step 4.
let definition = document.lookup_custom_element_definition(&name.ns, &name.local, is.as_ref());
// Step 5.
let will_execute_script = definition.is_some() && parsing_algorithm != ParsingAlgorithm::Fragment;
// Step 6.
if will_execute_script {
// Step 6.1.
document.increment_throw_on_dynamic_markup_insertion_counter();
// Step 6.2
if is_execution_stack_empty() {
document.window().upcast::<GlobalScope>().perform_a_microtask_checkpoint();
}
// Step 6.3
ScriptThread::push_new_element_queue()
}
// Step 7.
let creation_mode = if will_execute_script {
CustomElementCreationMode::Synchronous
} else {
CustomElementCreationMode::Asynchronous
};
let element = Element::create(name, is, document, creator, creation_mode);
// Step 8.
for attr in attrs {
element.set_attribute_from_parser(attr.name, attr.value, None);
}
// Step 9.
if will_execute_script {
// Steps 9.1 - 9.2.
ScriptThread::pop_current_element_queue();
// Step 9.3.
document.decrement_throw_on_dynamic_markup_insertion_counter();
}
// TODO: Step 10.
// TODO: Step 11.
// Step 12 is handled in `associate_with_form`.
// Step 13.
element
}

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

@ -9,7 +9,7 @@ use dom::bindings::trace::JSTraceable;
use dom::document::Document;
use dom::htmlscriptelement::HTMLScriptElement;
use dom::node::Node;
use dom::servoparser::Sink;
use dom::servoparser::{ParsingAlgorithm, Sink};
use js::jsapi::JSTracer;
use servo_url::ServoUrl;
use xml5ever::buffer_queue::BufferQueue;
@ -30,6 +30,7 @@ impl Tokenizer {
document: Dom::from_ref(document),
current_line: 1,
script: Default::default(),
parsing_algorithm: ParsingAlgorithm::Normal,
};
let tb = XmlTreeBuilder::new(sink, Default::default());

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

@ -31,7 +31,7 @@ use std::fmt;
use std::fmt::Debug;
use std::hash::Hash;
use std::ops::Deref;
use stylist::{StyleRuleCascadeData, Stylist};
use stylist::{CascadeData, Stylist};
use traversal_flags::TraversalFlags;
/// An opaque handle to a node, which, unlike UnsafeNode, cannot be transformed
@ -772,12 +772,12 @@ pub trait TElement
fn each_applicable_non_document_style_rule_data<'a, F>(&self, mut f: F) -> bool
where
Self: 'a,
F: FnMut(AtomicRef<'a, StyleRuleCascadeData>, QuirksMode),
F: FnMut(AtomicRef<'a, CascadeData>, QuirksMode),
{
let cut_off_inheritance = self.each_xbl_stylist(|stylist| {
let quirks_mode = stylist.quirks_mode();
f(
AtomicRef::map(stylist, |stylist| stylist.normal_author_cascade_data()),
AtomicRef::map(stylist, |stylist| stylist.author_cascade_data()),
quirks_mode,
)
});
@ -786,12 +786,10 @@ pub trait TElement
while let Some(slot) = current {
slot.each_xbl_stylist(|stylist| {
let quirks_mode = stylist.quirks_mode();
if stylist.slotted_author_cascade_data().is_some() {
f(
AtomicRef::map(stylist, |stylist| stylist.slotted_author_cascade_data().unwrap()),
quirks_mode,
)
}
f(
AtomicRef::map(stylist, |stylist| stylist.author_cascade_data()),
quirks_mode,
)
});
current = slot.assigned_slot();

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

@ -2216,8 +2216,6 @@ cfg_if! {
pub static nsGkAtoms_prefix: *mut nsStaticAtom;
#[link_name = "_ZN9nsGkAtoms7preloadE"]
pub static nsGkAtoms_preload: *mut nsStaticAtom;
#[link_name = "_ZN9nsGkAtoms11prerenderedE"]
pub static nsGkAtoms_prerendered: *mut nsStaticAtom;
#[link_name = "_ZN9nsGkAtoms15mozpresentationE"]
pub static nsGkAtoms_mozpresentation: *mut nsStaticAtom;
#[link_name = "_ZN9nsGkAtoms8preserveE"]
@ -7391,8 +7389,6 @@ cfg_if! {
pub static nsGkAtoms_prefix: *mut nsStaticAtom;
#[link_name = "?preload@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
pub static nsGkAtoms_preload: *mut nsStaticAtom;
#[link_name = "?prerendered@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
pub static nsGkAtoms_prerendered: *mut nsStaticAtom;
#[link_name = "?mozpresentation@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
pub static nsGkAtoms_mozpresentation: *mut nsStaticAtom;
#[link_name = "?preserve@nsGkAtoms@@2PEAVnsStaticAtom@@EA"]
@ -12566,8 +12562,6 @@ cfg_if! {
pub static nsGkAtoms_prefix: *mut nsStaticAtom;
#[link_name = "\x01?preload@nsGkAtoms@@2PAVnsStaticAtom@@A"]
pub static nsGkAtoms_preload: *mut nsStaticAtom;
#[link_name = "\x01?prerendered@nsGkAtoms@@2PAVnsStaticAtom@@A"]
pub static nsGkAtoms_prerendered: *mut nsStaticAtom;
#[link_name = "\x01?mozpresentation@nsGkAtoms@@2PAVnsStaticAtom@@A"]
pub static nsGkAtoms_mozpresentation: *mut nsStaticAtom;
#[link_name = "\x01?preserve@nsGkAtoms@@2PAVnsStaticAtom@@A"]
@ -17744,8 +17738,6 @@ macro_rules! atom {
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_prefix as *mut _) } }};
("preload") =>
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_preload as *mut _) } }};
("prerendered") =>
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_prerendered as *mut _) } }};
("mozpresentation") =>
{{ #[allow(unsafe_code)] #[allow(unused_unsafe)]unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_mozpresentation as *mut _) } }};
("preserve") =>

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

@ -501,8 +501,6 @@ extern "C" {
pub fn Servo_SourceSizeList_Drop ( ptr : RawServoSourceSizeListOwned , ) ;
} extern "C" {
pub fn Gecko_RecordTraversalStatistics ( total : u32 , parallel : u32 , total_t : u32 , parallel_t : u32 , total_s : u32 , parallel_s : u32 , ) ;
} extern "C" {
pub fn Gecko_IsInDocument ( node : RawGeckoNodeBorrowed , ) -> bool ;
} extern "C" {
pub fn Gecko_IsSignificantChild ( node : RawGeckoNodeBorrowed , text_is_significant : bool , whitespace_is_significant : bool , ) -> bool ;
} extern "C" {
@ -753,8 +751,6 @@ extern "C" {
pub fn Gecko_CalcStyleDifference ( old_style : ServoStyleContextBorrowed , new_style : ServoStyleContextBorrowed , any_style_changed : * mut bool , reset_only_changed : * mut bool , ) -> u32 ;
} extern "C" {
pub fn Gecko_GetElementSnapshot ( table : * const ServoElementSnapshotTable , element : RawGeckoElementBorrowed , ) -> * const ServoElementSnapshot ;
} extern "C" {
pub fn Gecko_DropElementSnapshot ( snapshot : ServoElementSnapshotOwned , ) ;
} extern "C" {
pub fn Gecko_HaveSeenPtr ( table : * mut SeenPtrs , ptr : * const :: std :: os :: raw :: c_void , ) -> bool ;
} extern "C" {
@ -977,8 +973,6 @@ extern "C" {
pub fn Gecko_IsDocumentBody ( element : RawGeckoElementBorrowed , ) -> bool ;
} extern "C" {
pub fn Gecko_GetLookAndFeelSystemColor ( color_id : i32 , pres_context : RawGeckoPresContextBorrowed , ) -> nscolor ;
} extern "C" {
pub fn Gecko_MatchStringArgPseudo ( element : RawGeckoElementBorrowed , type_ : CSSPseudoClassType , ident : * const u16 , ) -> bool ;
} extern "C" {
pub fn Gecko_AddPropertyToSet ( arg1 : nsCSSPropertyIDSetBorrowedMut , arg2 : nsCSSPropertyID , ) ;
} extern "C" {

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

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

@ -684,9 +684,11 @@ impl Expression {
pub fn matches(&self, device: &Device, quirks_mode: QuirksMode) -> bool {
let mut css_value = nsCSSValue::null();
unsafe {
(self.feature.mGetter.unwrap())(device.pres_context,
self.feature,
&mut css_value)
(self.feature.mGetter.unwrap())(
device.pres_context().mDocument.raw::<structs::nsIDocument>(),
self.feature,
&mut css_value,
)
};
let value = match MediaExpressionValue::from_css_value(self, &css_value) {

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

@ -10,7 +10,7 @@ use invalidation::element::invalidator::{DescendantInvalidationLists, Invalidati
use invalidation::element::invalidator::{Invalidation, InvalidationProcessor};
use invalidation::element::state_and_attributes;
use selectors::matching::{MatchingContext, MatchingMode, QuirksMode, VisitedHandlingMode};
use stylist::StyleRuleCascadeData;
use stylist::CascadeData;
/// A struct holding the members necessary to invalidate document state
/// selectors.
@ -30,20 +30,20 @@ impl Default for InvalidationMatchingData {
/// An invalidation processor for style changes due to state and attribute
/// changes.
pub struct DocumentStateInvalidationProcessor<'a, E: TElement> {
pub struct DocumentStateInvalidationProcessor<'a, E: TElement, I> {
// TODO(emilio): We might want to just run everything for every possible
// binding along with the document data, or just apply the XBL stuff to the
// bound subtrees.
rules: &'a StyleRuleCascadeData,
rules: I,
matching_context: MatchingContext<'a, E::Impl>,
document_states_changed: DocumentState,
}
impl<'a, E: TElement> DocumentStateInvalidationProcessor<'a, E> {
impl<'a, E: TElement, I> DocumentStateInvalidationProcessor<'a, E, I> {
/// Creates a new DocumentStateInvalidationProcessor.
#[inline]
pub fn new(
rules: &'a StyleRuleCascadeData,
rules: I,
document_states_changed: DocumentState,
quirks_mode: QuirksMode,
) -> Self {
@ -63,7 +63,11 @@ impl<'a, E: TElement> DocumentStateInvalidationProcessor<'a, E> {
}
}
impl<'a, E: TElement> InvalidationProcessor<'a, E> for DocumentStateInvalidationProcessor<'a, E> {
impl<'a, E, I> InvalidationProcessor<'a, E> for DocumentStateInvalidationProcessor<'a, E, I>
where
E: TElement,
I: Iterator<Item = &'a CascadeData>,
{
fn collect_invalidations(
&mut self,
_element: E,
@ -71,14 +75,15 @@ impl<'a, E: TElement> InvalidationProcessor<'a, E> for DocumentStateInvalidation
_descendant_invalidations: &mut DescendantInvalidationLists<'a>,
_sibling_invalidations: &mut InvalidationVector<'a>,
) -> bool {
let map = self.rules.invalidation_map();
for cascade_data in &mut self.rules {
let map = cascade_data.invalidation_map();
for dependency in &map.document_state_selectors {
if !dependency.state.intersects(self.document_states_changed) {
continue;
}
for dependency in &map.document_state_selectors {
if !dependency.state.intersects(self.document_states_changed) {
continue;
self_invalidations.push(Invalidation::new(&dependency.selector, 0));
}
self_invalidations.push(Invalidation::new(&dependency.selector, 0));
}
false

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

@ -534,6 +534,20 @@ where
let mut any_descendant = false;
// NOTE(emilio): This should not be needed for Shadow DOM for normal
// element state / attribute invalidations (it's needed for XBL though,
// due to the weird way the anon content there works (it doesn't block
// combinators)).
//
// However, it's needed as of right now for document state invalidation,
// were we rely on iterating every element that ends up in the composed
// doc.
//
// Also, we could avoid having that special-case for document state
// invalidations if we invalidate for document state changes per
// subtree, though that's kind of annoying because we need to invalidate
// the shadow host subtree (to handle :host and ::slotted), and the
// actual shadow tree (to handle all other rules in the ShadowRoot).
if let Some(anon_content) = self.element.xbl_binding_anonymous_content() {
any_descendant |=
self.invalidate_dom_descendants_of(anon_content, invalidations);

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

@ -24,7 +24,7 @@ use selectors::matching::{MatchingContext, MatchingMode, VisitedHandlingMode};
use selectors::matching::matches_selector;
use smallvec::SmallVec;
use stylesheets::origin::{Origin, OriginSet};
use stylist::StyleRuleCascadeData;
use stylist::CascadeData;
#[derive(Debug, PartialEq)]
enum VisitedDependent {
@ -57,7 +57,7 @@ where
/// changes.
pub struct StateAndAttrInvalidationProcessor<'a, 'b: 'a, E: TElement> {
shared_context: &'a SharedStyleContext<'b>,
shadow_rule_datas: &'a [(AtomicRef<'b, StyleRuleCascadeData>, QuirksMode)],
shadow_rule_datas: &'a [(AtomicRef<'b, CascadeData>, QuirksMode)],
cut_off_inheritance: bool,
element: E,
data: &'a mut ElementData,
@ -68,7 +68,7 @@ impl<'a, 'b: 'a, E: TElement> StateAndAttrInvalidationProcessor<'a, 'b, E> {
/// Creates a new StateAndAttrInvalidationProcessor.
pub fn new(
shared_context: &'a SharedStyleContext<'b>,
shadow_rule_datas: &'a [(AtomicRef<'b, StyleRuleCascadeData>, QuirksMode)],
shadow_rule_datas: &'a [(AtomicRef<'b, CascadeData>, QuirksMode)],
cut_off_inheritance: bool,
element: E,
data: &'a mut ElementData,
@ -255,11 +255,11 @@ where
OriginSet::all()
};
self.shared_context.stylist.each_normal_rule_cascade_data(|cascade_data, origin| {
for (cascade_data, origin) in self.shared_context.stylist.iter_origins() {
if document_origins.contains(origin.into()) {
collector.collect_dependencies_in_invalidation_map(cascade_data.invalidation_map());
}
});
}
for &(ref data, quirks_mode) in self.shadow_rule_datas {
// FIXME(emilio): Replace with assert / remove when we figure

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

@ -680,7 +680,36 @@ impl LonghandId {
/// Returns true if the property is one that is ignored when document
/// colors are disabled.
fn is_ignored_when_document_colors_disabled(&self) -> bool {
fn is_ignored_when_document_colors_disabled(
&self,
cascade_level: CascadeLevel,
pseudo: Option<<&PseudoElement>,
) -> bool {
let is_ua_or_user_rule = matches!(
cascade_level,
CascadeLevel::UANormal |
CascadeLevel::UserNormal |
CascadeLevel::UserImportant |
CascadeLevel::UAImportant
);
if is_ua_or_user_rule {
return false;
}
let is_style_attribute = matches!(
cascade_level,
CascadeLevel::StyleAttributeNormal |
CascadeLevel::StyleAttributeImportant
);
// Don't override colors on pseudo-element's style attributes. The
// background-color on ::-moz-color-swatch is an example. Those are set
// as an author style (via the style attribute), but it's pretty
// important for it to show up for obvious reasons :)
if pseudo.is_some() && is_style_attribute {
return false;
}
matches!(*self,
${" | ".join([("LonghandId::" + p.camel_case)
for p in data.longhands if p.ignored_when_colors_disabled])}
@ -3383,12 +3412,11 @@ where
// marked as ignored in that mode, unless they come from a UA or
// user style sheet.
if ignore_colors &&
longhand_id.is_ignored_when_document_colors_disabled() &&
!matches!(cascade_level,
CascadeLevel::UANormal |
CascadeLevel::UserNormal |
CascadeLevel::UserImportant |
CascadeLevel::UAImportant) {
longhand_id.is_ignored_when_document_colors_disabled(
cascade_level,
context.builder.pseudo
)
{
let non_transparent_background = match *declaration {
PropertyDeclaration::BackgroundColor(ref color) => {
// Treat background-color a bit differently. If the specified

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

@ -188,7 +188,8 @@ struct DocumentCascadeData {
per_origin: PerOrigin<()>,
}
struct DocumentCascadeDataIter<'a> {
/// An iterator over the cascade data of a given document.
pub struct DocumentCascadeDataIter<'a> {
iter: PerOriginIter<'a, ()>,
cascade_data: &'a DocumentCascadeData,
}
@ -436,6 +437,18 @@ impl Stylist {
}
}
/// Returns the cascade data for the author level.
#[inline]
pub fn author_cascade_data(&self) -> &CascadeData {
&self.cascade_data.author
}
/// Iterate through all the cascade datas from the document.
#[inline]
pub fn iter_origins(&self) -> DocumentCascadeDataIter {
self.cascade_data.iter_origins()
}
/// Iterate over the extra data in origin order.
#[inline]
pub fn iter_extra_data_origins(&self) -> ExtraStyleDataIterator {
@ -466,30 +479,22 @@ impl Stylist {
/// Returns the number of revalidation_selectors.
pub fn num_revalidation_selectors(&self) -> usize {
self.cascade_data.iter_origins()
.map(|(data, _)| {
data.normal_rule_data.selectors_for_cache_revalidation.len() +
data.slotted_rule_data.as_ref().map_or(0, |d| {
d.selectors_for_cache_revalidation.len()
})
}).sum()
.map(|(data, _)| data.selectors_for_cache_revalidation.len())
.sum()
}
/// Returns the number of entries in invalidation maps.
pub fn num_invalidations(&self) -> usize {
self.cascade_data.iter_origins()
.map(|(data, _)| {
data.normal_rule_data.invalidation_map.len() +
data.slotted_rule_data.as_ref().map_or(0, |d| d.invalidation_map.len())
}).sum()
.map(|(data, _)| data.invalidation_map.len())
.sum()
}
/// Returns whether the given DocumentState bit is relied upon by a selector
/// of some rule.
pub fn has_document_state_dependency(&self, state: DocumentState) -> bool {
self.cascade_data.iter_origins()
.any(|(d, _)| {
d.normal_rule_data.has_document_state_dependency(state)
})
.any(|(d, _)| d.document_state_dependencies.intersects(state))
}
/// Flush the list of stylesheets if they changed, ensuring the stylist is
@ -605,24 +610,14 @@ impl Stylist {
self.stylesheets.remove_stylesheet(Some(&self.device), sheet, guard)
}
/// Executes `f` on each of the normal rule cascade datas in this styleset.
pub fn each_normal_rule_cascade_data<'a, F>(&'a self, mut f: F)
where
F: FnMut(&'a StyleRuleCascadeData, Origin),
{
for (data, origin) in self.cascade_data.iter_origins() {
f(&data.normal_rule_data, origin);
}
}
/// Returns whether for any of the applicable style rule data a given
/// condition is true.
pub fn any_applicable_rule_data<E, F>(&self, element: E, mut f: F) -> bool
where
E: TElement,
F: FnMut(&StyleRuleCascadeData, QuirksMode) -> bool,
F: FnMut(&CascadeData, QuirksMode) -> bool,
{
if f(&self.cascade_data.user_agent.cascade_data.normal_rule_data, self.quirks_mode()) {
if f(&self.cascade_data.user_agent.cascade_data, self.quirks_mode()) {
return true;
}
@ -636,8 +631,8 @@ impl Stylist {
return maybe;
}
f(&self.cascade_data.author.normal_rule_data, self.quirks_mode()) ||
f(&self.cascade_data.user.normal_rule_data, self.quirks_mode())
f(&self.cascade_data.author, self.quirks_mode()) ||
f(&self.cascade_data.user, self.quirks_mode())
}
/// Computes the style for a given "precomputed" pseudo-element, taking the
@ -1446,18 +1441,6 @@ impl Stylist {
})
}
/// Returns the cascade data for the normal rules.
#[inline]
pub fn normal_author_cascade_data(&self) -> &StyleRuleCascadeData {
&self.cascade_data.author.normal_rule_data
}
/// Returns the cascade data for the slotted rules in this scope, if any.
#[inline]
pub fn slotted_author_cascade_data(&self) -> Option<&StyleRuleCascadeData> {
self.cascade_data.author.slotted_rule_data.as_ref().map(|d| &**d)
}
/// Returns the registered `@keyframes` animation for the specified name.
///
/// FIXME(emilio): This needs to account for the element rules.
@ -1498,7 +1481,7 @@ impl Stylist {
// this in the caller by asserting that the bitvecs are same-length.
let mut results = SmallBitVec::new();
for (data, _) in self.cascade_data.iter_origins() {
data.normal_rule_data.selectors_for_cache_revalidation.lookup(
data.selectors_for_cache_revalidation.lookup(
element,
self.quirks_mode,
|selector_and_hashes| {
@ -1918,7 +1901,7 @@ impl ElementAndPseudoRules {
}
#[inline]
fn borrow_for_pseudo(&self, pseudo: Option<&PseudoElement>) -> Option<&SelectorMap<Rule>> {
fn rules(&self, pseudo: Option<&PseudoElement>) -> Option<&SelectorMap<Rule>> {
match pseudo {
Some(pseudo) => self.pseudos_map.get(&pseudo.canonical()).map(|p| &**p),
None => Some(&self.element_map),
@ -1938,12 +1921,26 @@ impl ElementAndPseudoRules {
}
}
/// Cascade data generated from style rules.
#[derive(Debug)]
/// Data resulting from performing the CSS cascade that is specific to a given
/// origin.
///
/// FIXME(emilio): Consider renaming and splitting in `CascadeData` and
/// `InvalidationData`? That'd make `clear_cascade_data()` clearer.
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
pub struct StyleRuleCascadeData {
/// The actual style rules.
rules: ElementAndPseudoRules,
#[derive(Debug)]
pub struct CascadeData {
/// The data coming from normal style rules that apply to elements at this
/// cascade level.
normal_rules: ElementAndPseudoRules,
/// The data coming from ::slotted() pseudo-element rules.
///
/// We need to store them separately because an element needs to match
/// ::slotted() pseudo-element rules in different shadow roots.
///
/// In particular, we need to go through all the style data in all the
/// containing style scopes starting from the closest assigned slot.
slotted_rules: Option<Box<ElementAndPseudoRules>>,
/// The invalidation map for these rules.
invalidation_map: InvalidationMap,
@ -1985,142 +1982,6 @@ pub struct StyleRuleCascadeData {
/// tree-structural state like child index and pseudos).
#[cfg_attr(feature = "servo", ignore_malloc_size_of = "Arc")]
selectors_for_cache_revalidation: SelectorMap<RevalidationSelectorAndHashes>,
}
impl StyleRuleCascadeData {
#[inline(always)]
fn insert(
&mut self,
rule: Rule,
pseudo_element: Option<&PseudoElement>,
quirks_mode: QuirksMode,
rebuild_kind: SheetRebuildKind,
) -> Result<(), FailedAllocationError> {
if rebuild_kind.should_rebuild_invalidation() {
self.invalidation_map.note_selector(&rule.selector, quirks_mode)?;
let mut visitor = StylistSelectorVisitor {
needs_revalidation: false,
passed_rightmost_selector: false,
attribute_dependencies: &mut self.attribute_dependencies,
style_attribute_dependency: &mut self.style_attribute_dependency,
state_dependencies: &mut self.state_dependencies,
document_state_dependencies: &mut self.document_state_dependencies,
mapped_ids: &mut self.mapped_ids,
};
rule.selector.visit(&mut visitor);
if visitor.needs_revalidation {
self.selectors_for_cache_revalidation.insert(
RevalidationSelectorAndHashes::new(
rule.selector.clone(),
rule.hashes.clone(),
),
quirks_mode
)?;
}
}
self.rules.insert(rule, pseudo_element, quirks_mode)
}
/// Returns the invalidation map.
#[inline]
pub fn invalidation_map(&self) -> &InvalidationMap {
&self.invalidation_map
}
#[cfg(feature = "gecko")]
fn add_size_of(&self, ops: &mut MallocSizeOfOps, sizes: &mut ServoStyleSetSizes) {
self.rules.add_size_of(ops, sizes);
sizes.mInvalidationMap += self.invalidation_map.size_of(ops);
sizes.mRevalidationSelectors += self.selectors_for_cache_revalidation.size_of(ops);
}
fn clear_cascade_data(&mut self) {
self.rules.clear();
}
fn clear(&mut self) {
self.clear_cascade_data();
self.invalidation_map.clear();
self.attribute_dependencies.clear();
self.style_attribute_dependency = false;
self.state_dependencies = ElementState::empty();
self.document_state_dependencies = DocumentState::empty();
self.mapped_ids.clear();
self.selectors_for_cache_revalidation.clear();
}
/// Returns whether the given attribute might appear in an attribute
/// selector of some rule.
#[inline]
pub fn might_have_attribute_dependency(
&self,
local_name: &LocalName,
) -> bool {
if *local_name == local_name!("style") {
return self.style_attribute_dependency
}
self.attribute_dependencies.might_contain_hash(local_name.get_hash())
}
/// Returns whether the given ElementState bit is relied upon by a selector
/// of some rule.
#[inline]
pub fn has_state_dependency(&self, state: ElementState) -> bool {
self.state_dependencies.intersects(state)
}
/// Returns whether the given DocumentState bit is relied upon by a selector
/// of some rule in the stylist.
#[inline]
fn has_document_state_dependency(&self, state: DocumentState) -> bool {
self.document_state_dependencies.intersects(state)
}
}
impl StyleRuleCascadeData {
fn new() -> Self {
Self {
rules: ElementAndPseudoRules::default(),
invalidation_map: InvalidationMap::new(),
attribute_dependencies: NonCountingBloomFilter::new(),
style_attribute_dependency: false,
state_dependencies: ElementState::empty(),
document_state_dependencies: DocumentState::empty(),
mapped_ids: NonCountingBloomFilter::new(),
selectors_for_cache_revalidation: SelectorMap::new(),
}
}
#[inline]
fn rules(&self, pseudo: Option<&PseudoElement>) -> Option<&SelectorMap<Rule>> {
self.rules.borrow_for_pseudo(pseudo)
}
}
/// Data resulting from performing the CSS cascade that is specific to a given
/// origin.
///
/// FIXME(emilio): Consider renaming and splitting in `CascadeData` and
/// `InvalidationData`? That'd make `clear_cascade_data()` clearer.
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
#[derive(Debug)]
struct CascadeData {
/// The data coming from normal style rules that apply to elements at this
/// cascade level.
normal_rule_data: StyleRuleCascadeData,
/// The data coming from ::slotted() pseudo-element rules.
///
/// We need to store them separately because an element needs to match
/// ::slotted() pseudo-element rules in different shadow roots.
///
/// In particular, we need to go through all the style data in all the
/// containing style scopes starting from the closest assigned slot.
slotted_rule_data: Option<Box<StyleRuleCascadeData>>,
/// A map with all the animations at this `CascadeData`'s origin, indexed
/// by name.
@ -2146,8 +2007,15 @@ struct CascadeData {
impl CascadeData {
fn new() -> Self {
Self {
normal_rule_data: StyleRuleCascadeData::new(),
slotted_rule_data: None,
normal_rules: ElementAndPseudoRules::default(),
slotted_rules: None,
invalidation_map: InvalidationMap::new(),
attribute_dependencies: NonCountingBloomFilter::new(),
style_attribute_dependency: false,
state_dependencies: ElementState::empty(),
document_state_dependencies: DocumentState::empty(),
mapped_ids: NonCountingBloomFilter::new(),
selectors_for_cache_revalidation: SelectorMap::new(),
animations: Default::default(),
extra_data: ExtraStyleData::default(),
effective_media_query_results: EffectiveMediaQueryResults::new(),
@ -2157,14 +2025,39 @@ impl CascadeData {
}
}
/// Returns the invalidation map.
pub fn invalidation_map(&self) -> &InvalidationMap {
&self.invalidation_map
}
/// Returns whether the given ElementState bit is relied upon by a selector
/// of some rule.
#[inline]
pub fn has_state_dependency(&self, state: ElementState) -> bool {
self.state_dependencies.intersects(state)
}
/// Returns whether the given attribute might appear in an attribute
/// selector of some rule.
#[inline]
pub fn might_have_attribute_dependency(
&self,
local_name: &LocalName,
) -> bool {
if *local_name == local_name!("style") {
return self.style_attribute_dependency
}
self.attribute_dependencies.might_contain_hash(local_name.get_hash())
}
#[inline]
fn normal_rules(&self, pseudo: Option<&PseudoElement>) -> Option<&SelectorMap<Rule>> {
self.normal_rule_data.rules(pseudo)
self.normal_rules.rules(pseudo)
}
#[inline]
fn slotted_rules(&self, pseudo: Option<&PseudoElement>) -> Option<&SelectorMap<Rule>> {
self.slotted_rule_data.as_ref().and_then(|d| d.rules(pseudo))
self.slotted_rules.as_ref().and_then(|d| d.rules(pseudo))
}
/// Collects all the applicable media query results into `results`.
@ -2270,19 +2163,43 @@ impl CascadeData {
self.rules_source_order
);
let style_rule_cascade_data = if selector.is_slotted() {
self.slotted_rule_data.get_or_insert_with(|| {
Box::new(StyleRuleCascadeData::new())
if rebuild_kind.should_rebuild_invalidation() {
self.invalidation_map.note_selector(&rule.selector, quirks_mode)?;
let mut visitor = StylistSelectorVisitor {
needs_revalidation: false,
passed_rightmost_selector: false,
attribute_dependencies: &mut self.attribute_dependencies,
style_attribute_dependency: &mut self.style_attribute_dependency,
state_dependencies: &mut self.state_dependencies,
document_state_dependencies: &mut self.document_state_dependencies,
mapped_ids: &mut self.mapped_ids,
};
rule.selector.visit(&mut visitor);
if visitor.needs_revalidation {
self.selectors_for_cache_revalidation.insert(
RevalidationSelectorAndHashes::new(
rule.selector.clone(),
rule.hashes.clone(),
),
quirks_mode
)?;
}
}
let rules = if selector.is_slotted() {
self.slotted_rules.get_or_insert_with(|| {
Box::new(Default::default())
})
} else {
&mut self.normal_rule_data
&mut self.normal_rules
};
style_rule_cascade_data.insert(
rules.insert(
rule,
pseudo_element,
quirks_mode,
rebuild_kind,
)?;
}
self.rules_source_order += 1;
@ -2435,9 +2352,9 @@ impl CascadeData {
/// Clears the cascade data, but not the invalidation data.
fn clear_cascade_data(&mut self) {
self.normal_rule_data.clear_cascade_data();
if let Some(ref mut slotted_rule_data) = self.slotted_rule_data {
slotted_rule_data.clear_cascade_data();
self.normal_rules.clear();
if let Some(ref mut slotted_rules) = self.slotted_rules {
slotted_rules.clear();
}
self.animations.clear();
self.extra_data.clear();
@ -2448,20 +2365,25 @@ impl CascadeData {
fn clear(&mut self) {
self.clear_cascade_data();
self.normal_rule_data.clear();
if let Some(ref mut slotted_rule_data) = self.slotted_rule_data {
slotted_rule_data.clear();
}
self.invalidation_map.clear();
self.attribute_dependencies.clear();
self.style_attribute_dependency = false;
self.state_dependencies = ElementState::empty();
self.document_state_dependencies = DocumentState::empty();
self.mapped_ids.clear();
self.selectors_for_cache_revalidation.clear();
self.effective_media_query_results.clear();
}
/// Measures heap usage.
#[cfg(feature = "gecko")]
fn add_size_of(&self, ops: &mut MallocSizeOfOps, sizes: &mut ServoStyleSetSizes) {
self.normal_rule_data.add_size_of(ops, sizes);
if let Some(ref slotted_rules) = self.slotted_rule_data {
self.normal_rules.add_size_of(ops, sizes);
if let Some(ref slotted_rules) = self.slotted_rules {
slotted_rules.add_size_of(ops, sizes);
}
sizes.mInvalidationMap += self.invalidation_map.size_of(ops);
sizes.mRevalidationSelectors += self.selectors_for_cache_revalidation.size_of(ops);
sizes.mOther += self.animations.size_of(ops);
sizes.mOther += self.effective_media_query_results.size_of(ops);
sizes.mOther += self.extra_data.size_of(ops);

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

@ -9,6 +9,7 @@ use malloc_size_of::MallocSizeOfOps;
use selectors::{Element, NthIndexCache};
use selectors::matching::{MatchingContext, MatchingMode, matches_selector};
use servo_arc::{Arc, ArcBorrow, RawOffsetArc};
use smallvec::SmallVec;
use std::cell::RefCell;
use std::env;
use std::fmt::Write;
@ -1774,7 +1775,6 @@ pub unsafe extern "C" fn Servo_SelectorList_QueryAll(
content_list: *mut structs::nsSimpleContentList,
may_use_invalidation: bool,
) {
use smallvec::SmallVec;
use std::borrow::Borrow;
use style::dom_apis::{self, MayUseInvalidation, QueryAll};
@ -2391,10 +2391,10 @@ pub extern "C" fn Servo_ComputedValues_EqualCustomProperties(
}
#[no_mangle]
pub extern "C" fn Servo_ComputedValues_GetStyleRuleList(values: ServoStyleContextBorrowed,
rules: RawGeckoServoStyleRuleListBorrowedMut) {
use smallvec::SmallVec;
pub extern "C" fn Servo_ComputedValues_GetStyleRuleList(
values: ServoStyleContextBorrowed,
rules: RawGeckoServoStyleRuleListBorrowedMut,
) {
let rule_node = match values.rules {
Some(ref r) => r,
None => return,
@ -4930,6 +4930,40 @@ pub extern "C" fn Servo_ParseCounterStyleName(
}
}
#[no_mangle]
pub unsafe extern "C" fn Servo_InvalidateStyleForDocStateChanges(
root: RawGeckoElementBorrowed,
raw_style_sets: *const nsTArray<RawServoStyleSetBorrowed>,
states_changed: u64,
) {
use style::invalidation::element::document_state::DocumentStateInvalidationProcessor;
use style::invalidation::element::invalidator::TreeStyleInvalidator;
let mut borrows = SmallVec::<[_; 20]>::with_capacity((*raw_style_sets).len());
for style_set in &**raw_style_sets {
borrows.push(PerDocumentStyleData::from_ffi(*style_set).borrow());
}
let root = GeckoElement(root);
let mut processor = DocumentStateInvalidationProcessor::new(
borrows.iter().flat_map(|b| b.stylist.iter_origins().map(|(data, _origin)| data)),
DocumentState::from_bits_truncate(states_changed),
root.as_node().owner_doc().quirks_mode(),
);
let result = TreeStyleInvalidator::new(
root,
/* stack_limit_checker = */ None,
&mut processor,
).invalidate();
debug_assert!(!result.has_invalidated_siblings(), "How in the world?");
if result.has_invalidated_descendants() {
bindings::Gecko_NoteDirtySubtreeForInvalidation(root.0);
} else if result.has_invalidated_self() {
bindings::Gecko_NoteDirtyElement(root.0);
}
}
#[no_mangle]
pub extern "C" fn Servo_ParseCounterStyleDescriptor(
descriptor: nsCSSCounterDesc,

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

@ -7,7 +7,7 @@ android-test/opt:
platform: android-4-0-armv7-api16/opt
kind: build
tier: 1
symbol: tc-A(test)
symbol: A(test)
worker-type: aws-provisioner-v1/gecko-{level}-b-android
worker:
docker-image: {in-tree: android-build}
@ -54,7 +54,7 @@ android-lint/opt:
platform: android-4-0-armv7-api16/opt
kind: build
tier: 1
symbol: tc-A(lint)
symbol: A(lint)
worker-type: aws-provisioner-v1/gecko-{level}-b-android
worker:
docker-image: {in-tree: android-build}
@ -113,7 +113,7 @@ android-checkstyle/opt:
platform: android-4-0-armv7-api16/opt
kind: build
tier: 1
symbol: tc-A(checkstyle)
symbol: A(checkstyle)
worker-type: aws-provisioner-v1/gecko-{level}-b-android
worker:
docker-image: {in-tree: android-build}
@ -165,7 +165,7 @@ android-findbugs/opt:
platform: android-4-0-armv7-api16/opt
kind: build
tier: 1
symbol: tc-A(findbugs)
symbol: A(findbugs)
worker-type: aws-provisioner-v1/gecko-{level}-b-android
worker:
docker-image: {in-tree: android-build}
@ -216,7 +216,7 @@ android-geckoview-docs/opt:
platform: android-4-0-armv7-api16/opt
kind: build
tier: 3
symbol: tc-A(gv-docs)
symbol: A(gv-docs)
run-on-projects: [mozilla-central]
worker-type: aws-provisioner-v1/gecko-{level}-b-android
worker:

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

@ -5,7 +5,7 @@ android-api-16/debug:
job-name: android-api-16-debug
treeherder:
platform: android-4-0-armv7-api16/debug
symbol: tc(B)
symbol: B
worker-type: aws-provisioner-v1/gecko-{level}-b-android
worker:
docker-image: {in-tree: android-build}
@ -52,7 +52,7 @@ android-x86/opt:
job-name: android-x86-opt
treeherder:
platform: android-4-2-x86/opt
symbol: tc(B)
symbol: B
worker-type: aws-provisioner-v1/gecko-{level}-b-android
worker:
docker-image: {in-tree: android-build}
@ -109,7 +109,7 @@ android-x86-nightly/opt:
type: nightly
treeherder:
platform: android-4-2-x86/opt
symbol: tc(N)
symbol: N
worker-type: aws-provisioner-v1/gecko-{level}-b-android
worker:
docker-image: {in-tree: android-build}
@ -162,7 +162,7 @@ android-api-16/opt:
job-name: android-api-16-opt
treeherder:
platform: android-4-0-armv7-api16/opt
symbol: tc(B)
symbol: B
worker-type: aws-provisioner-v1/gecko-{level}-b-android
worker:
docker-image: {in-tree: android-build}
@ -214,7 +214,7 @@ android-api-16-nightly/opt:
type: nightly-with-multi-l10n
treeherder:
platform: android-4-0-armv7-api16/opt
symbol: tc(N)
symbol: N
worker-type: aws-provisioner-v1/gecko-{level}-b-android
worker:
docker-image: {in-tree: android-build}
@ -262,7 +262,7 @@ android-x86-old-id/opt:
job-name: android-x86-old-id-opt
treeherder:
platform: android-4-2-x86-old-id/opt
symbol: tc(B)
symbol: B
worker-type: aws-provisioner-v1/gecko-{level}-b-android
worker:
docker-image: {in-tree: android-build}
@ -318,7 +318,7 @@ android-x86-old-id-nightly/opt:
type: nightly
treeherder:
platform: android-4-2-x86-old-id/opt
symbol: tc(N)
symbol: N
worker-type: aws-provisioner-v1/gecko-{level}-b-android
worker:
docker-image: {in-tree: android-build}
@ -372,7 +372,7 @@ android-api-16-old-id/opt:
job-name: android-api-16-old-id-opt
treeherder:
platform: android-4-0-armv7-api16-old-id/opt
symbol: tc(B)
symbol: B
worker-type: aws-provisioner-v1/gecko-{level}-b-android
worker:
docker-image: {in-tree: android-build}
@ -423,7 +423,7 @@ android-api-16-old-id-nightly/opt:
type: nightly-with-multi-l10n
treeherder:
platform: android-4-0-armv7-api16-old-id/opt
symbol: tc(N)
symbol: N
worker-type: aws-provisioner-v1/gecko-{level}-b-android
worker:
docker-image: {in-tree: android-build}
@ -472,7 +472,7 @@ android-api-16-gradle/opt:
job-name: android-api-16-gradle-opt
treeherder:
platform: android-api-16-gradle/opt
symbol: tc(Bng)
symbol: Bng
tier: 1
worker-type: aws-provisioner-v1/gecko-{level}-b-android
worker:
@ -518,7 +518,7 @@ android-aarch64/opt:
job-name: android-aarch64-opt
treeherder:
platform: android-5-0-aarch64/opt
symbol: tc(B)
symbol: B
worker-type: aws-provisioner-v1/gecko-{level}-b-android
worker:
docker-image: {in-tree: android-build}
@ -570,7 +570,7 @@ android-aarch64-nightly/opt:
type: nightly
treeherder:
platform: android-5-0-aarch64/opt
symbol: tc(N)
symbol: N
worker-type: aws-provisioner-v1/gecko-{level}-b-android
worker:
docker-image: {in-tree: android-build}

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

@ -5,7 +5,7 @@ linux64/opt:
job-name: linux64-opt
treeherder:
platform: linux64/opt
symbol: tc(B)
symbol: B
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
max-run-time: 36000
@ -33,7 +33,7 @@ linux64-dmd/opt:
job-name: linux64-dmd-opt
treeherder:
platform: linux64-dmd/opt
symbol: tc(Bdmd)
symbol: Bdmd
tier: 2
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
@ -64,7 +64,7 @@ linux64/pgo:
job-name: linux64-pgo
treeherder:
platform: linux64/pgo
symbol: tc(B)
symbol: B
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
max-run-time: 36000
@ -93,7 +93,7 @@ linux64-fuzzing/debug:
job-name: linux64-fuzzing-debug
treeherder:
platform: linux64/debug
symbol: tc(Bf)
symbol: Bf
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
max-run-time: 36000
@ -124,7 +124,7 @@ linux64/debug:
job-name: linux64-debug
treeherder:
platform: linux64/debug
symbol: tc(B)
symbol: B
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
max-run-time: 36000
@ -158,7 +158,7 @@ linux64-devedition-nightly/opt:
type: nightly
treeherder:
platform: linux64-devedition/opt
symbol: tc(N)
symbol: N
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
max-run-time: 36000
@ -190,7 +190,7 @@ linux64-base-toolchains/opt:
job-name: linux64-base-toolchains-opt
treeherder:
platform: linux64/opt
symbol: tc(Bb)
symbol: Bb
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
max-run-time: 36000
@ -220,7 +220,7 @@ linux64-base-toolchains/debug:
job-name: linux64-base-toolchains-debug
treeherder:
platform: linux64/debug
symbol: tc(Bb)
symbol: Bb
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
max-run-time: 36000
@ -251,7 +251,7 @@ linux/opt:
job-name: linux-opt
treeherder:
platform: linux32/opt
symbol: tc(B)
symbol: B
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
max-run-time: 36000
@ -279,7 +279,7 @@ linux/debug:
job-name: linux-debug
treeherder:
platform: linux32/debug
symbol: tc(B)
symbol: B
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
max-run-time: 36000
@ -308,7 +308,7 @@ linux/pgo:
job-name: linux-pgo
treeherder:
platform: linux32/pgo
symbol: tc(B)
symbol: B
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
max-run-time: 36000
@ -337,7 +337,7 @@ linux-rusttests/opt:
job-name: linux-rusttests-opt
treeherder:
platform: linux32/opt
symbol: tc(BR)
symbol: BR
tier: 2
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
@ -371,7 +371,7 @@ linux-rusttests/debug:
job-name: linux-rusttests-debug
treeherder:
platform: linux32/debug
symbol: tc(BR)
symbol: BR
tier: 2
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
@ -410,7 +410,7 @@ linux-devedition-nightly/opt:
type: nightly
treeherder:
platform: linux32-devedition/opt
symbol: tc(N)
symbol: N
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
max-run-time: 36000
@ -447,7 +447,7 @@ linux-nightly/opt:
type: nightly
treeherder:
platform: linux32/opt
symbol: tc(N)
symbol: N
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
max-run-time: 36000
@ -477,7 +477,7 @@ linux64-asan/opt:
job-name: linux64-asan-opt
treeherder:
platform: linux64/asan
symbol: tc(Bo)
symbol: Bo
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
env:
@ -509,7 +509,7 @@ linux64-asan-fuzzing/opt:
job-name: linux64-fuzzing-asan-opt
treeherder:
platform: linux64/asan
symbol: tc(Bof)
symbol: Bof
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
env:
@ -540,7 +540,7 @@ linux64-asan-reporter/opt:
job-name: linux64-asan-reporter-opt
treeherder:
platform: linux64/asan
symbol: tc(BoR)
symbol: BoR
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
env:
@ -571,7 +571,7 @@ linux64-asan/debug:
job-name: linux64-asan-debug
treeherder:
platform: linux64/asan
symbol: tc(Bd)
symbol: Bd
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
env:
@ -607,7 +607,7 @@ linux64-nightly/opt:
type: nightly
treeherder:
platform: linux64/opt
symbol: tc(N)
symbol: N
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
max-run-time: 36000
@ -636,7 +636,7 @@ linux64-noopt/debug:
job-name: linux64-noopt-debug
treeherder:
platform: linux64-noopt/debug
symbol: tc(B)
symbol: B
tier: 2
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
@ -668,7 +668,7 @@ linux64-rusttests/opt:
job-name: linux64-rusttests-opt
treeherder:
platform: linux64/opt
symbol: tc(BR)
symbol: BR
tier: 2
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
@ -702,7 +702,7 @@ linux64-rusttests/debug:
job-name: linux64-rusttests-debug
treeherder:
platform: linux64/debug
symbol: tc(BR)
symbol: BR
tier: 2
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
@ -736,7 +736,7 @@ linux64-jsdcov/opt:
job-name: linux64-jsdcov-opt
treeherder:
platform: linux64-jsdcov/opt
symbol: tc(B)
symbol: B
tier: 2
run-on-projects: []
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
@ -766,7 +766,7 @@ linux64-ccov/opt:
job-name: linux64-ccov-opt
treeherder:
platform: linux64-ccov/opt
symbol: tc(B)
symbol: B
tier: 2
run-on-projects: []
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
@ -796,7 +796,7 @@ linux64-add-on-devel/opt:
job-name: linux64-add-on-devel
treeherder:
platform: linux64-add-on-devel/opt
symbol: tc(B)
symbol: B
tier: 2
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:

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

@ -5,7 +5,7 @@ macosx64/debug:
job-name: macosx64-debug
treeherder:
platform: osx-cross/debug
symbol: tc(B)
symbol: B
tier: 1
worker-type: aws-provisioner-v1/gecko-{level}-b-macosx64
worker:
@ -38,7 +38,7 @@ macosx64/opt:
job-name: macosx64-opt
treeherder:
platform: osx-cross/opt
symbol: tc(B)
symbol: B
tier: 1
worker-type: aws-provisioner-v1/gecko-{level}-b-macosx64
worker:
@ -70,7 +70,7 @@ macosx64-dmd/opt:
job-name: macosx64-dmd-opt
treeherder:
platform: osx-10-10-dmd/opt
symbol: tc(Bdmd)
symbol: Bdmd
tier: 2
worker-type: aws-provisioner-v1/gecko-{level}-b-macosx64
worker:
@ -110,7 +110,7 @@ macosx64-devedition-nightly/opt:
type: nightly
treeherder:
platform: osx-cross-devedition/opt
symbol: tc(N)
symbol: N
tier: 1
worker-type: aws-provisioner-v1/gecko-{level}-b-macosx64
worker:
@ -146,7 +146,7 @@ macosx64-noopt/debug:
job-name: macosx64-noopt-debug
treeherder:
platform: osx-cross-noopt/debug
symbol: tc(B)
symbol: B
tier: 2
worker-type: aws-provisioner-v1/gecko-{level}-b-macosx64
worker:
@ -182,7 +182,7 @@ macosx64-add-on-devel/opt:
job-name: macosx64-add-on-devel
treeherder:
platform: osx-cross-add-on-devel/opt
symbol: tc(B)
symbol: B
tier: 2
worker-type: aws-provisioner-v1/gecko-{level}-b-macosx64
worker:
@ -222,7 +222,7 @@ macosx64-nightly/opt:
type: nightly
treeherder:
platform: osx-cross/opt
symbol: tc(N)
symbol: N
tier: 1
worker-type: aws-provisioner-v1/gecko-{level}-b-macosx64
worker:

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