From 7f847e5b32d5d63b6007b31b3e053614a4e23685 Mon Sep 17 00:00:00 2001 From: Shih-Chiang Chien Date: Wed, 10 May 2017 11:06:05 +0800 Subject: [PATCH 01/56] Bug 1363421 - Part 1, lazy load HTTP protocol handler to improve start-up performance. r=mcmanus system-info might need to be construct while creating nsHttpHandler and it might take up to 30ms. Lazy loading the DEFAULT_UA can delay the creation of nsHttpHandler after start-up. MozReview-Commit-ID: FtIpKjcY38r --HG-- extra : rebase_source : 8061ed3ce6c42955e52f494166958f5b63ab940b --- netwerk/protocol/http/UserAgentOverrides.jsm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/netwerk/protocol/http/UserAgentOverrides.jsm b/netwerk/protocol/http/UserAgentOverrides.jsm index dc3b908d91d0..a9b071356bc1 100644 --- a/netwerk/protocol/http/UserAgentOverrides.jsm +++ b/netwerk/protocol/http/UserAgentOverrides.jsm @@ -14,11 +14,15 @@ Components.utils.import("resource://gre/modules/Services.jsm"); Components.utils.import("resource://gre/modules/UserAgentUpdates.jsm"); const PREF_OVERRIDES_ENABLED = "general.useragent.site_specific_overrides"; -const DEFAULT_UA = Cc["@mozilla.org/network/protocol;1?name=http"] - .getService(Ci.nsIHttpProtocolHandler) - .userAgent; const MAX_OVERRIDE_FOR_HOST_CACHE_SIZE = 250; +// lazy load nsHttpHandler to improve startup performance. +XPCOMUtils.defineLazyGetter(this, "DEFAULT_UA", function() { + return Cc["@mozilla.org/network/protocol;1?name=http"] + .getService(Ci.nsIHttpProtocolHandler) + .userAgent; +}); + var gPrefBranch; var gOverrides = new Map; var gUpdatedOverrides; From 0131b8b8314355190cdd8df2124a28b71363d083 Mon Sep 17 00:00:00 2001 From: Shih-Chiang Chien Date: Tue, 16 May 2017 12:11:12 +0800 Subject: [PATCH 02/56] Bug 1363421 - Part 2, delay the initialization of UserAgentOverrides.jsm until first nsHttpChannel is created. r=mcmanus UAOverridesBootstrapper.js is introduced to delay the initialization of UserAgentOverrides.jsm until the creation of the first nsHttpChannel. Uninit will be triggered at profile-change-net-teardown because no network traffice after this point. MozReview-Commit-ID: F8Lpn6RyZEm --HG-- extra : rebase_source : 7c3649b50ad8594dc0968961fbbd2766d0d98b0a --- browser/components/nsBrowserGlue.js | 7 +--- browser/installer/package-manifest.in | 2 ++ mobile/android/chrome/content/browser.js | 1 - mobile/android/installer/package-manifest.in | 2 ++ .../protocol/http/UAOverridesBootstrapper.js | 36 +++++++++++++++++++ .../http/UAOverridesBootstrapper.manifest | 3 ++ netwerk/protocol/http/UserAgentOverrides.jsm | 26 ++++++++------ netwerk/protocol/http/moz.build | 2 ++ netwerk/protocol/http/nsHttpHandler.cpp | 18 ++++++++++ netwerk/protocol/http/nsHttpHandler.h | 2 ++ 10 files changed, 82 insertions(+), 17 deletions(-) create mode 100644 netwerk/protocol/http/UAOverridesBootstrapper.js create mode 100644 netwerk/protocol/http/UAOverridesBootstrapper.manifest diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index 7d22fbc5fff3..959cd47d320c 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -37,7 +37,7 @@ XPCOMUtils.defineLazyGetter(this, "WeaveService", () => RemotePrompt:false, SessionStore:false, ShellService:false, SimpleServiceDiscovery:false, TabCrashHandler:false, Task:false, UITour:false, WebChannel:false, - WindowsRegistry:false, webrtcUI:false, UserAgentOverrides: false */ + WindowsRegistry:false, webrtcUI:false */ /** * IF YOU ADD OR REMOVE FROM THIS LIST, PLEASE UPDATE THE LIST ABOVE AS WELL. @@ -92,7 +92,6 @@ let initializedModules = {}; ["WebChannel", "resource://gre/modules/WebChannel.jsm"], ["WindowsRegistry", "resource://gre/modules/WindowsRegistry.jsm"], ["webrtcUI", "resource:///modules/webrtcUI.jsm", "init"], - ["UserAgentOverrides", "resource://gre/modules/UserAgentOverrides.jsm"], ].forEach(([name, resource, init]) => { if (init) { XPCOMUtils.defineLazyGetter(this, name, () => { @@ -516,8 +515,6 @@ BrowserGlue.prototype = { // and e10s are active together. E10SAccessibilityCheck.init(); } - - UserAgentOverrides.init(); }, // cleanup (called on application shutdown) @@ -561,8 +558,6 @@ BrowserGlue.prototype = { os.removeObserver(this, "browser-search-engine-modified"); os.removeObserver(this, "flash-plugin-hang"); os.removeObserver(this, "xpi-signature-changed"); - - UserAgentOverrides.uninit(); }, _onAppDefaults: function BG__onAppDefaults() { diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index ca31998c2057..b9dd49fba7f9 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -361,6 +361,8 @@ @RESPATH@/components/BrowserElementParent.js @RESPATH@/components/FeedProcessor.manifest @RESPATH@/components/FeedProcessor.js +@RESPATH@/components/UAOverridesBootstrapper.js +@RESPATH@/components/UAOverridesBootstrapper.manifest @RESPATH@/components/WellKnownOpportunisticUtils.js @RESPATH@/components/WellKnownOpportunisticUtils.manifest #ifndef XP_MACOSX diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index af2706776645..6873f7597caa 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -458,7 +458,6 @@ var BrowserApp = { CharacterEncoding.init(); ActivityObserver.init(); RemoteDebugger.init(); - UserAgentOverrides.init(); DesktopUserAgent.init(); Distribution.init(); Tabs.init(); diff --git a/mobile/android/installer/package-manifest.in b/mobile/android/installer/package-manifest.in index bce4468630eb..41827d93e74c 100644 --- a/mobile/android/installer/package-manifest.in +++ b/mobile/android/installer/package-manifest.in @@ -277,6 +277,8 @@ @BINPATH@/components/BrowserElementParent.js @BINPATH@/components/FeedProcessor.manifest @BINPATH@/components/FeedProcessor.js +@BINPATH@/components/UAOverridesBootstrapper.js +@BINPATH@/components/UAOverridesBootstrapper.manifest @BINPATH@/components/WellKnownOpportunisticUtils.js @BINPATH@/components/WellKnownOpportunisticUtils.manifest @BINPATH@/components/mozProtocolHandler.js diff --git a/netwerk/protocol/http/UAOverridesBootstrapper.js b/netwerk/protocol/http/UAOverridesBootstrapper.js new file mode 100644 index 000000000000..5b0e76f120d4 --- /dev/null +++ b/netwerk/protocol/http/UAOverridesBootstrapper.js @@ -0,0 +1,36 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const Ci = Components.interfaces; +const Cu = Components.utils; + +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); +Cu.import("resource://gre/modules/Services.jsm"); +Cu.import("resource://gre/modules/UserAgentOverrides.jsm"); + +function UAOverridesBootstrapper() { + this.init(); +} + +UAOverridesBootstrapper.prototype = { + init: function uaob_init() { + Services.obs.addObserver(this, "profile-change-net-teardown", false); + UserAgentOverrides.init(); + }, + + observe: function uaob_observe(aSubject, aTopic, aData) { + if (aTopic == "profile-change-net-teardown") { + Services.obs.removeObserver(this, "profile-change-net-teardown"); + UserAgentOverrides.uninit(); + } + }, + + QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]), + classID: Components.ID("{965b0ca8-155b-11e7-93ae-92361f002671}") +}; + +const components = [UAOverridesBootstrapper]; +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/netwerk/protocol/http/UAOverridesBootstrapper.manifest b/netwerk/protocol/http/UAOverridesBootstrapper.manifest new file mode 100644 index 000000000000..979095949ee3 --- /dev/null +++ b/netwerk/protocol/http/UAOverridesBootstrapper.manifest @@ -0,0 +1,3 @@ +# UAOverridesBootstrapper.js +component {965b0ca8-155b-11e7-93ae-92361f002671} UAOverridesBootstrapper.js process=main +contract @mozilla.org/network/ua-overrides-bootstrapper;1 {965b0ca8-155b-11e7-93ae-92361f002671} process=main diff --git a/netwerk/protocol/http/UserAgentOverrides.jsm b/netwerk/protocol/http/UserAgentOverrides.jsm index a9b071356bc1..404a9369065b 100644 --- a/netwerk/protocol/http/UserAgentOverrides.jsm +++ b/netwerk/protocol/http/UserAgentOverrides.jsm @@ -49,18 +49,24 @@ this.UserAgentOverrides = { // The http-on-useragent-request notification is disallowed in content processes. } - UserAgentUpdates.init(function(overrides) { - gOverrideForHostCache.clear(); - if (overrides) { - for (let domain in overrides) { - overrides[domain] = getUserAgentFromOverride(overrides[domain]); + try { + UserAgentUpdates.init(function(overrides) { + gOverrideForHostCache.clear(); + if (overrides) { + for (let domain in overrides) { + overrides[domain] = getUserAgentFromOverride(overrides[domain]); + } + overrides.get = function(key) { return this[key]; }; } - overrides.get = function(key) { return this[key]; }; - } - gUpdatedOverrides = overrides; - }); + gUpdatedOverrides = overrides; + }); + + buildOverrides(); + } catch (e) { + // UserAgentOverrides is initialized before profile is ready. + // UA override might not work correctly. + } - buildOverrides(); gInitialized = true; }, diff --git a/netwerk/protocol/http/moz.build b/netwerk/protocol/http/moz.build index 5c68901968cc..bff97f0043e0 100644 --- a/netwerk/protocol/http/moz.build +++ b/netwerk/protocol/http/moz.build @@ -119,6 +119,8 @@ LOCAL_INCLUDES += [ ] EXTRA_COMPONENTS += [ + 'UAOverridesBootstrapper.js', + 'UAOverridesBootstrapper.manifest', 'WellKnownOpportunisticUtils.js', 'WellKnownOpportunisticUtils.manifest', ] diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp index b65abbc68396..949cc7ce0981 100644 --- a/netwerk/protocol/http/nsHttpHandler.cpp +++ b/netwerk/protocol/http/nsHttpHandler.cpp @@ -333,6 +333,19 @@ nsHttpHandler::SetFastOpenOSSupport() mFastOpenSupported ? "" : "not")); } +void +nsHttpHandler::EnsureUAOverridesInit() +{ + MOZ_ASSERT(XRE_IsParentProcess()); + MOZ_ASSERT(NS_IsMainThread()); + + nsresult rv; + nsCOMPtr bootstrapper + = do_GetService("@mozilla.org/network/ua-overrides-bootstrapper;1", &rv); + MOZ_ASSERT(bootstrapper); + MOZ_ASSERT(NS_SUCCEEDED(rv)); +} + nsHttpHandler::~nsHttpHandler() { LOG(("Deleting nsHttpHandler [this=%p]\n", this)); @@ -2103,6 +2116,11 @@ nsHttpHandler::NewProxiedChannel2(nsIURI *uri, net_EnsurePSMInit(); } + if (XRE_IsParentProcess()) { + // Load UserAgentOverrides.jsm before any HTTP request is issued. + EnsureUAOverridesInit(); + } + uint64_t channelId; rv = NewChannelId(channelId); NS_ENSURE_SUCCESS(rv, rv); diff --git a/netwerk/protocol/http/nsHttpHandler.h b/netwerk/protocol/http/nsHttpHandler.h index abdd310adba7..95cf307a3e7e 100644 --- a/netwerk/protocol/http/nsHttpHandler.h +++ b/netwerk/protocol/http/nsHttpHandler.h @@ -403,6 +403,8 @@ private: void NotifyObservers(nsIHttpChannel *chan, const char *event); void SetFastOpenOSSupport(); + + void EnsureUAOverridesInit(); private: // cached services From e60859ca4a888770eeb05ebe35ec207d8cd89879 Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Sat, 20 May 2017 17:09:00 +0800 Subject: [PATCH 03/56] Bug 1366441 - Enable dom.animations-api.core.enabled for test_animation_observers_sync.html. r=hiro MozReview-Commit-ID: 92PN6ABOFPm --HG-- extra : rebase_source : 8e350c51aa9153088adabd104d6b7e053d8325d1 --- .../chrome/test_animation_observers_sync.html | 1727 +++++++++-------- 1 file changed, 869 insertions(+), 858 deletions(-) diff --git a/dom/animation/test/chrome/test_animation_observers_sync.html b/dom/animation/test/chrome/test_animation_observers_sync.html index 310180975e45..ba40f208dc88 100644 --- a/dom/animation/test/chrome/test_animation_observers_sync.html +++ b/dom/animation/test/chrome/test_animation_observers_sync.html @@ -88,17 +88,858 @@ function createPseudo(test, element, type) { return anim.effect.target; } -[ { subtree: false }, - { subtree: true } -].forEach(aOptions => { +function runTest() { + [ { subtree: false }, + { subtree: true } + ].forEach(aOptions => { + test(t => { + var div = addDiv(t); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var anim = div.animate({ opacity: [ 0, 1 ] }, 200 * MS_PER_SEC); + + assert_equals_records(observer.takeRecords(), + [{ added: [anim], changed: [], removed: [] }], + "records after animation is added"); + + anim.effect.timing.duration = 100 * MS_PER_SEC; + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [anim], removed: [] }], + "records after duration is changed"); + + anim.effect.timing.duration = 100 * MS_PER_SEC; + assert_equals_records(observer.takeRecords(), + [], "records after assigning same value"); + + anim.currentTime = anim.effect.timing.duration * 2; + anim.finish(); + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [], removed: [anim] }], + "records after animation end"); + + anim.effect.timing.duration = anim.effect.timing.duration * 3; + assert_equals_records(observer.takeRecords(), + [{ added: [anim], changed: [], removed: [] }], + "records after animation restarted"); + + anim.effect.timing.duration = "auto"; + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [], removed: [anim] }], + "records after duration set \"auto\""); + + anim.effect.timing.duration = "auto"; + assert_equals_records(observer.takeRecords(), + [], "records after assigning same value \"auto\""); + }, "change_duration_and_currenttime"); + + test(t => { + var div = addDiv(t); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var anim = div.animate({ opacity: [ 0, 1 ] }, 100 * MS_PER_SEC); + + assert_equals_records(observer.takeRecords(), + [{ added: [anim], changed: [], removed: [] }], + "records after animation is added"); + + anim.effect.timing.endDelay = 10 * MS_PER_SEC; + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [anim], removed: [] }], + "records after endDelay is changed"); + + anim.effect.timing.endDelay = 10 * MS_PER_SEC; + assert_equals_records(observer.takeRecords(), + [], "records after assigning same value"); + + anim.currentTime = 109 * MS_PER_SEC; + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [], removed: [anim] }], + "records after currentTime during endDelay"); + + anim.effect.timing.endDelay = -110 * MS_PER_SEC; + assert_equals_records(observer.takeRecords(), + [], "records after assigning negative value"); + }, "change_enddelay_and_currenttime"); + + test(t => { + var div = addDiv(t); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var anim = div.animate({ opacity: [ 0, 1 ] }, + { duration: 100 * MS_PER_SEC, + endDelay: -100 * MS_PER_SEC }); + assert_equals_records(observer.takeRecords(), + [], "records after animation is added"); + }, "zero_end_time"); + + test(t => { + var div = addDiv(t); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var anim = div.animate({ opacity: [ 0, 1 ] }, 100 * MS_PER_SEC); + + assert_equals_records(observer.takeRecords(), + [{ added: [anim], changed: [], removed: [] }], + "records after animation is added"); + + anim.effect.timing.iterations = 2; + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [anim], removed: [] }], + "records after iterations is changed"); + + anim.effect.timing.iterations = 2; + assert_equals_records(observer.takeRecords(), + [], "records after assigning same value"); + + anim.effect.timing.iterations = 0; + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [], removed: [anim] }], + "records after animation end"); + + anim.effect.timing.iterations = Infinity; + assert_equals_records(observer.takeRecords(), + [{ added: [anim], changed: [], removed: [] }], + "records after animation restarted"); + }, "change_iterations"); + + test(t => { + var div = addDiv(t); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var anim = div.animate({ opacity: [ 0, 1 ] }, 100 * MS_PER_SEC); + + assert_equals_records(observer.takeRecords(), + [{ added: [anim], changed: [], removed: [] }], + "records after animation is added"); + + anim.effect.timing.delay = 100; + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [anim], removed: [] }], + "records after delay is changed"); + + anim.effect.timing.delay = 100; + assert_equals_records(observer.takeRecords(), + [], "records after assigning same value"); + + anim.effect.timing.delay = -100 * MS_PER_SEC; + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [], removed: [anim] }], + "records after animation end"); + + anim.effect.timing.delay = 0; + assert_equals_records(observer.takeRecords(), + [{ added: [anim], changed: [], removed: [] }], + "records after animation restarted"); + }, "change_delay"); + + test(t => { + var div = addDiv(t); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var anim = div.animate({ opacity: [ 0, 1 ] }, + { duration: 100 * MS_PER_SEC, + easing: "steps(2, start)" }); + + assert_equals_records(observer.takeRecords(), + [{ added: [anim], changed: [], removed: [] }], + "records after animation is added"); + + anim.effect.timing.easing = "steps(2, end)"; + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [anim], removed: [] }], + "records after easing is changed"); + + anim.effect.timing.easing = "steps(2, end)"; + assert_equals_records(observer.takeRecords(), + [], "records after assigning same value"); + }, "change_easing"); + + test(t => { + var div = addDiv(t); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var anim = div.animate({ opacity: [ 0, 1 ] }, + { duration: 100, delay: -100 }); + assert_equals_records(observer.takeRecords(), + [], "records after assigning negative value"); + }, "negative_delay_in_constructor"); + + test(t => { + var div = addDiv(t); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var effect = new KeyframeEffectReadOnly(null, + { opacity: [ 0, 1 ] }, + { duration: 100 * MS_PER_SEC }); + var anim = new Animation(effect, document.timeline); + anim.play(); + assert_equals_records(observer.takeRecords(), + [], "no records after animation is added"); + }, "create_animation_without_target"); + + test(t => { + var div = addDiv(t); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var anim = div.animate({ opacity: [ 0, 1 ] }, + { duration: 100 * MS_PER_SEC }); + assert_equals_records(observer.takeRecords(), + [{ added: [anim], changed: [], removed: [] }], + "records after animation is added"); + + anim.effect.target = div; + assert_equals_records(observer.takeRecords(), + [], "no records after setting the same target"); + + anim.effect.target = null; + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [], removed: [anim] }], + "records after setting null"); + + anim.effect.target = null; + assert_equals_records(observer.takeRecords(), + [], "records after setting redundant null"); + }, "set_redundant_animation_target"); + + test(t => { + var div = addDiv(t); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var anim = div.animate({ opacity: [ 0, 1 ] }, + { duration: 100 * MS_PER_SEC }); + assert_equals_records(observer.takeRecords(), + [{ added: [anim], changed: [], removed: [] }], + "records after animation is added"); + + anim.effect = null; + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [], removed: [anim] }], + "records after animation is removed"); + }, "set_null_animation_effect"); + + test(t => { + var div = addDiv(t); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var anim = new Animation(); + anim.play(); + anim.effect = new KeyframeEffect(div, { opacity: [ 0, 1 ] }, + 100 * MS_PER_SEC); + assert_equals_records(observer.takeRecords(), + [{ added: [anim], changed: [], removed: [] }], + "records after animation is added"); + }, "set_effect_on_null_effect_animation"); + + test(t => { + var div = addDiv(t); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var anim = div.animate({ marginLeft: [ "0px", "100px" ] }, + 100 * MS_PER_SEC); + assert_equals_records(observer.takeRecords(), + [{ added: [anim], changed: [], removed: [] }], + "records after animation is added"); + + anim.effect = new KeyframeEffect(div, { opacity: [ 0, 1 ] }, + 100 * MS_PER_SEC); + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [anim], removed: [] }], + "records after replace effects"); + }, "replace_effect_targeting_on_the_same_element"); + + test(t => { + var div = addDiv(t); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var anim = div.animate({ marginLeft: [ "0px", "100px" ] }, + 100 * MS_PER_SEC); + assert_equals_records(observer.takeRecords(), + [{ added: [anim], changed: [], removed: [] }], + "records after animation is added"); + + anim.currentTime = 60 * MS_PER_SEC; + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [anim], removed: [] }], + "records after animation is changed"); + + anim.effect = new KeyframeEffect(div, { opacity: [ 0, 1 ] }, + 50 * MS_PER_SEC); + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [], removed: [anim] }], + "records after replacing effects"); + }, "replace_effect_targeting_on_the_same_element_not_in_effect"); + + test(t => { + var div = addDiv(t); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var anim = div.animate([ { marginLeft: "0px" }, + { marginLeft: "-20px" }, + { marginLeft: "100px" }, + { marginLeft: "50px" } ], + { duration: 100 * MS_PER_SEC }); + assert_equals_records(observer.takeRecords(), + [{ added: [anim], changed: [], removed: [] }], + "records after animation is added"); + + anim.effect.spacing = "paced(margin-left)"; + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [anim], removed: [] }], + "records after animation is changed"); + }, "set_spacing"); + + test(t => { + var div = addDiv(t); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var anim = div.animate([ { marginLeft: "0px" }, + { marginLeft: "-20px" }, + { marginLeft: "100px" }, + { marginLeft: "50px" } ], + { duration: 100 * MS_PER_SEC, + spacing: "paced(margin-left)" }); + assert_equals_records(observer.takeRecords(), + [{ added: [anim], changed: [], removed: [] }], + "records after animation is added"); + + anim.effect.spacing = "paced(animation-duration)"; + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [anim], removed: [] }], + "records after setting a non-animatable paced property"); + }, "set_spacing_on_a_non-animatable_property"); + + test(t => { + var div = addDiv(t); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var anim = div.animate([ { marginLeft: "0px" }, + { marginLeft: "-20px" }, + { marginLeft: "100px" }, + { marginLeft: "50px" } ], + { duration: 100 * MS_PER_SEC, + spacing: "paced(margin-left)" }); + assert_equals_records(observer.takeRecords(), + [{ added: [anim], changed: [], removed: [] }], + "records after animation is added"); + + anim.effect.spacing = "paced(margin-left)"; + assert_equals_records(observer.takeRecords(), + [], "no record after setting the same spacing"); + }, "set_the_same_spacing"); + + test(t => { + var div = addDiv(t); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var anim = div.animate({ }, 100 * MS_PER_SEC); + assert_equals_records(observer.takeRecords(), + [{ added: [anim], changed: [], removed: [] }], + "records after animation is added"); + + anim.effect.composite = "add"; + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [anim], removed: [] }], + "records after composite is changed"); + + anim.effect.composite = "add"; + assert_equals_records(observer.takeRecords(), + [], "no record after setting the same composite"); + + }, "set_composite"); + + // Test that starting a single animation that is cancelled by calling + // cancel() dispatches an added notification and then a removed + // notification. + test(t => { + var div = addDiv(t, { style: "animation: anim 100s forwards" }); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var animations = div.getAnimations(); + assert_equals(animations.length, 1, + "getAnimations().length after animation start"); + + assert_equals_records(observer.takeRecords(), + [{ added: animations, changed: [], removed: [] }], + "records after animation start"); + + animations[0].cancel(); + + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [], removed: animations }], + "records after animation end"); + + // Re-trigger the animation. + animations[0].play(); + + // Single MutationRecord for the Animation (re-)addition. + assert_equals_records(observer.takeRecords(), + [{ added: animations, changed: [], removed: [] }], + "records after animation start"); + }, "single_animation_cancelled_api"); + + // Test that updating a property on the Animation object dispatches a changed + // notification. + [ + { prop: "playbackRate", val: 0.5 }, + { prop: "startTime", val: 50 * MS_PER_SEC }, + { prop: "currentTime", val: 50 * MS_PER_SEC }, + ].forEach(function(aChangeTest) { + test(t => { + // We use a forwards fill mode so that even if the change we make causes + // the animation to become finished, it will still be "relevant" so we + // won't mark it as removed. + var div = addDiv(t, { style: "animation: anim 100s forwards" }); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var animations = div.getAnimations(); + assert_equals(animations.length, 1, + "getAnimations().length after animation start"); + + assert_equals_records(observer.takeRecords(), + [{ added: animations, changed: [], removed: [] }], + "records after animation start"); + + // Update the property. + animations[0][aChangeTest.prop] = aChangeTest.val; + + // Make a redundant change. + animations[0][aChangeTest.prop] = animations[0][aChangeTest.prop]; + + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: animations, removed: [] }], + "records after animation property change"); + }, `single_animation_api_change_${aChangeTest.prop}`); + }); + + // Test that making a redundant change to currentTime while an Animation + // is pause-pending still generates a change MutationRecord since setting + // the currentTime to any value in this state aborts the pending pause. + test(t => { + var div = addDiv(t, { style: "animation: anim 100s" }); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var animations = div.getAnimations(); + assert_equals(animations.length, 1, + "getAnimations().length after animation start"); + + assert_equals_records(observer.takeRecords(), + [{ added: animations, changed: [], removed: [] }], + "records after animation start"); + + animations[0].pause(); + + // We are now pause-pending. Even if we make a redundant change to the + // currentTime, we should still get a change record because setting the + // currentTime while pause-pending has the effect of cancelling a pause. + animations[0].currentTime = animations[0].currentTime; + + // Two MutationRecords for the Animation changes: one for pausing, one + // for aborting the pause. + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: animations, removed: [] }, + { added: [], changed: animations, removed: [] }], + "records after pausing then seeking"); + }, "change_currentTime_while_pause_pending"); + + // Test that calling finish() on a forwards-filling Animation dispatches + // a changed notification. + test(t => { + var div = addDiv(t, { style: "animation: anim 100s forwards" }); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var animations = div.getAnimations(); + assert_equals(animations.length, 1, + "getAnimations().length after animation start"); + + assert_equals_records(observer.takeRecords(), + [{ added: animations, changed: [], removed: [] }], + "records after animation start"); + + animations[0].finish(); + + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: animations, removed: [] }], + "records after finish()"); + + // Redundant finish. + animations[0].finish(); + + // Ensure no change records. + assert_equals_records(observer.takeRecords(), + [], "records after redundant finish()"); + }, "finish_with_forwards_fill"); + + // Test that calling finish() on an Animation that does not fill forwards, + // dispatches a removal notification. + test(t => { + var div = addDiv(t, { style: "animation: anim 100s" }); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var animations = div.getAnimations(); + assert_equals(animations.length, 1, + "getAnimations().length after animation start"); + + assert_equals_records(observer.takeRecords(), + [{ added: animations, changed: [], removed: [] }], + "records after animation start"); + + animations[0].finish(); + + // Single MutationRecord for the Animation removal. + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [], removed: animations }], + "records after finishing"); + }, "finish_without_fill"); + + // Test that calling finish() on a forwards-filling Animation dispatches + test(t => { + var div = addDiv(t, { style: "animation: anim 100s" }); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var animation = div.getAnimations()[0]; + assert_equals_records(observer.takeRecords(), + [{ added: [animation], changed: [], removed: []}], + "records after creation"); + animation.id = "new id"; + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [animation], removed: []}], + "records after id is changed"); + + animation.id = "new id"; + assert_equals_records(observer.takeRecords(), + [], "records after assigning same value with id"); + }, "change_id"); + + // Test that calling reverse() dispatches a changed notification. + test(t => { + var div = addDiv(t, { style: "animation: anim 100s both" }); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var animations = div.getAnimations(); + assert_equals(animations.length, 1, + "getAnimations().length after animation start"); + + assert_equals_records(observer.takeRecords(), + [{ added: animations, changed: [], removed: [] }], + "records after animation start"); + + animations[0].reverse(); + + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: animations, removed: [] }], + "records after calling reverse()"); + }, "reverse"); + + // Test that calling reverse() does *not* dispatch a changed notification + // when playbackRate == 0. + test(t => { + var div = addDiv(t, { style: "animation: anim 100s both" }); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var animations = div.getAnimations(); + assert_equals(animations.length, 1, + "getAnimations().length after animation start"); + + assert_equals_records(observer.takeRecords(), + [{ added: animations, changed: [], removed: [] }], + "records after animation start"); + + // Seek to the middle and set playbackRate to zero. + animations[0].currentTime = 50 * MS_PER_SEC; + animations[0].playbackRate = 0; + + // Two MutationRecords, one for each change. + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: animations, removed: [] }, + { added: [], changed: animations, removed: [] }], + "records after seeking and setting playbackRate"); + + animations[0].reverse(); + + // We should get no notifications. + assert_equals_records(observer.takeRecords(), + [], "records after calling reverse()"); + }, "reverse_with_zero_playbackRate"); + + // Test that reverse() on an Animation does *not* dispatch a changed + // notification when it throws an exception. + test(t => { + // Start an infinite animation + var div = addDiv(t, { style: "animation: anim 10s infinite" }); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var animations = div.getAnimations(); + assert_equals(animations.length, 1, + "getAnimations().length after animation start"); + + assert_equals_records(observer.takeRecords(), + [{ added: animations, changed: [], removed: [] }], + "records after animation start"); + + // Shift the animation into the future such that when we call reverse + // it will try to seek to the (infinite) end. + animations[0].startTime = 100 * MS_PER_SEC; + + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: animations, removed: [] }], + "records after adjusting startTime"); + + // Reverse: should throw + assert_throws('InvalidStateError', () => { + animations[0].reverse(); + }, 'reverse() on future infinite animation throws an exception'); + + // We should get no notifications. + assert_equals_records(observer.takeRecords(), + [], "records after calling reverse()"); + }, "reverse_with_exception"); + + // Test that attempting to start an animation that should already be finished + // does not send any notifications. + test(t => { + // Start an animation that should already be finished. + var div = addDiv(t, { style: "animation: anim 1s -2s;" }); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + // The animation should cause no Animations to be created. + var animations = div.getAnimations(); + assert_equals(animations.length, 0, + "getAnimations().length after animation start"); + + // And we should get no notifications. + assert_equals_records(observer.takeRecords(), + [], "records after attempted animation start"); + }, "already_finished"); + + test(t => { + var div = addDiv(t, { style: "animation: anim 100s, anotherAnim 100s" }); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var animations = div.getAnimations(); + + assert_equals_records(observer.takeRecords(), + [{ added: animations, changed: [], removed: []}], + "records after creation"); + + div.style.animation = "anotherAnim 100s, anim 100s"; + animations = div.getAnimations(); + + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: animations, removed: []}], + "records after the order is changed"); + + div.style.animation = "anotherAnim 100s, anim 100s"; + + assert_equals_records(observer.takeRecords(), + [], "no records after applying the same order"); + }, "animtion_order_change"); + + test(t => { + var div = addDiv(t); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var anim = div.animate({ opacity: [ 0, 1 ] }, + { duration: 100 * MS_PER_SEC, + iterationComposite: 'replace' }); + + assert_equals_records(observer.takeRecords(), + [{ added: [anim], changed: [], removed: [] }], + "records after animation is added"); + + anim.effect.iterationComposite = 'accumulate'; + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [anim], removed: [] }], + "records after iterationComposite is changed"); + + anim.effect.iterationComposite = 'accumulate'; + assert_equals_records(observer.takeRecords(), + [], "no record after setting the same iterationComposite"); + + }, "set_iterationComposite"); + + test(t => { + var div = addDiv(t); + var observer = + setupSynchronousObserver(t, + aOptions.subtree ? div.parentNode : div, + aOptions.subtree); + + var anim = div.animate({ opacity: [ 0, 1 ] }, + { duration: 100 * MS_PER_SEC }); + + assert_equals_records(observer.takeRecords(), + [{ added: [anim], changed: [], removed: [] }], + "records after animation is added"); + + anim.effect.setKeyframes({ opacity: 0.1 }); + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [anim], removed: [] }], + "records after keyframes are changed"); + + anim.effect.setKeyframes({ opacity: 0.1 }); + assert_equals_records(observer.takeRecords(), + [], "no record after setting the same keyframes"); + + anim.effect.setKeyframes(null); + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [anim], removed: [] }], + "records after keyframes are set to empty"); + + }, "set_keyframes"); + + }); + test(t => { var div = addDiv(t); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); + var observer = setupSynchronousObserver(t, div, true); - var anim = div.animate({ opacity: [ 0, 1 ] }, 200 * MS_PER_SEC); + var child = document.createElement("div"); + div.appendChild(child); + + var anim1 = div.animate({ marginLeft: [ "0px", "50px" ] }, + 100 * MS_PER_SEC); + var anim2 = child.animate({ marginLeft: [ "0px", "100px" ] }, + 50 * MS_PER_SEC); + assert_equals_records(observer.takeRecords(), + [{ added: [anim1], changed: [], removed: [] }, + { added: [anim2], changed: [], removed: [] }], + "records after animation is added"); + + // After setting a new effect, we remove the current animation, anim1, + // because it is no longer attached to |div|, and then remove the previous + // animation, anim2. Finally, add back the anim1 which is in effect on + // |child| now. In addition, we sort them by tree order and they are + // batched. + anim1.effect = anim2.effect; + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [], removed: [anim1] }, // div + { added: [anim1], changed: [], removed: [anim2] }], // child + "records after animation effects are changed"); + }, "set_effect_with_previous_animation"); + + test(t => { + var div = addDiv(t); + var observer = setupSynchronousObserver(t, document, true); + + var anim = div.animate({ opacity: [ 0, 1 ] }, + { duration: 100 * MS_PER_SEC }); + + var newTarget = document.createElement("div"); + + assert_equals_records(observer.takeRecords(), + [{ added: [anim], changed: [], removed: [] }], + "records after animation is added"); + + anim.effect.target = null; + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [], removed: [anim] }], + "records after setting null"); + + anim.effect.target = div; + assert_equals_records(observer.takeRecords(), + [{ added: [anim], changed: [], removed: [] }], + "records after setting a target"); + + anim.effect.target = addDiv(t); + assert_equals_records(observer.takeRecords(), + [{ added: [], changed: [], removed: [anim] }, + { added: [anim], changed: [], removed: [] }], + "records after setting a different target"); + }, "set_animation_target"); + + test(t => { + var div = addDiv(t); + var pseudoTarget = createPseudo(t, div, 'before'); + var observer = setupSynchronousObserver(t, div, true); + + var anim = pseudoTarget.animate({ opacity: [ 0, 1 ] }, 200 * MS_PER_SEC); assert_equals_records(observer.takeRecords(), [{ added: [anim], changed: [], removed: [] }], @@ -132,868 +973,38 @@ function createPseudo(test, element, type) { anim.effect.timing.duration = "auto"; assert_equals_records(observer.takeRecords(), [], "records after assigning same value \"auto\""); - }, "change_duration_and_currenttime"); + }, "change_duration_and_currenttime_on_pseudo_elements"); test(t => { var div = addDiv(t); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var anim = div.animate({ opacity: [ 0, 1 ] }, 100 * MS_PER_SEC); - - assert_equals_records(observer.takeRecords(), - [{ added: [anim], changed: [], removed: [] }], - "records after animation is added"); - - anim.effect.timing.endDelay = 10 * MS_PER_SEC; - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [anim], removed: [] }], - "records after endDelay is changed"); - - anim.effect.timing.endDelay = 10 * MS_PER_SEC; - assert_equals_records(observer.takeRecords(), - [], "records after assigning same value"); - - anim.currentTime = 109 * MS_PER_SEC; - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [], removed: [anim] }], - "records after currentTime during endDelay"); - - anim.effect.timing.endDelay = -110 * MS_PER_SEC; - assert_equals_records(observer.takeRecords(), - [], "records after assigning negative value"); - }, "change_enddelay_and_currenttime"); - - test(t => { - var div = addDiv(t); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var anim = div.animate({ opacity: [ 0, 1 ] }, - { duration: 100 * MS_PER_SEC, - endDelay: -100 * MS_PER_SEC }); - assert_equals_records(observer.takeRecords(), - [], "records after animation is added"); - }, "zero_end_time"); - - test(t => { - var div = addDiv(t); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var anim = div.animate({ opacity: [ 0, 1 ] }, 100 * MS_PER_SEC); - - assert_equals_records(observer.takeRecords(), - [{ added: [anim], changed: [], removed: [] }], - "records after animation is added"); - - anim.effect.timing.iterations = 2; - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [anim], removed: [] }], - "records after iterations is changed"); - - anim.effect.timing.iterations = 2; - assert_equals_records(observer.takeRecords(), - [], "records after assigning same value"); - - anim.effect.timing.iterations = 0; - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [], removed: [anim] }], - "records after animation end"); - - anim.effect.timing.iterations = Infinity; - assert_equals_records(observer.takeRecords(), - [{ added: [anim], changed: [], removed: [] }], - "records after animation restarted"); - }, "change_iterations"); - - test(t => { - var div = addDiv(t); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var anim = div.animate({ opacity: [ 0, 1 ] }, 100 * MS_PER_SEC); - - assert_equals_records(observer.takeRecords(), - [{ added: [anim], changed: [], removed: [] }], - "records after animation is added"); - - anim.effect.timing.delay = 100; - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [anim], removed: [] }], - "records after delay is changed"); - - anim.effect.timing.delay = 100; - assert_equals_records(observer.takeRecords(), - [], "records after assigning same value"); - - anim.effect.timing.delay = -100 * MS_PER_SEC; - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [], removed: [anim] }], - "records after animation end"); - - anim.effect.timing.delay = 0; - assert_equals_records(observer.takeRecords(), - [{ added: [anim], changed: [], removed: [] }], - "records after animation restarted"); - }, "change_delay"); - - test(t => { - var div = addDiv(t); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var anim = div.animate({ opacity: [ 0, 1 ] }, - { duration: 100 * MS_PER_SEC, - easing: "steps(2, start)" }); - - assert_equals_records(observer.takeRecords(), - [{ added: [anim], changed: [], removed: [] }], - "records after animation is added"); - - anim.effect.timing.easing = "steps(2, end)"; - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [anim], removed: [] }], - "records after easing is changed"); - - anim.effect.timing.easing = "steps(2, end)"; - assert_equals_records(observer.takeRecords(), - [], "records after assigning same value"); - }, "change_easing"); - - test(t => { - var div = addDiv(t); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var anim = div.animate({ opacity: [ 0, 1 ] }, - { duration: 100, delay: -100 }); - assert_equals_records(observer.takeRecords(), - [], "records after assigning negative value"); - }, "negative_delay_in_constructor"); - - test(t => { - var div = addDiv(t); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var effect = new KeyframeEffectReadOnly(null, - { opacity: [ 0, 1 ] }, - { duration: 100 * MS_PER_SEC }); - var anim = new Animation(effect, document.timeline); - anim.play(); - assert_equals_records(observer.takeRecords(), - [], "no records after animation is added"); - }, "create_animation_without_target"); - - test(t => { - var div = addDiv(t); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); + var pseudoTarget = createPseudo(t, div, 'before'); + var observer = setupSynchronousObserver(t, div, false); var anim = div.animate({ opacity: [ 0, 1 ] }, { duration: 100 * MS_PER_SEC }); + var pAnim = pseudoTarget.animate({ opacity: [ 0, 1 ] }, + { duration: 100 * MS_PER_SEC }); + assert_equals_records(observer.takeRecords(), [{ added: [anim], changed: [], removed: [] }], "records after animation is added"); - anim.effect.target = div; - assert_equals_records(observer.takeRecords(), - [], "no records after setting the same target"); + anim.finish(); + pAnim.finish(); - anim.effect.target = null; assert_equals_records(observer.takeRecords(), [{ added: [], changed: [], removed: [anim] }], - "records after setting null"); - - anim.effect.target = null; - assert_equals_records(observer.takeRecords(), - [], "records after setting redundant null"); - }, "set_redundant_animation_target"); - - test(t => { - var div = addDiv(t); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var anim = div.animate({ opacity: [ 0, 1 ] }, - { duration: 100 * MS_PER_SEC }); - assert_equals_records(observer.takeRecords(), - [{ added: [anim], changed: [], removed: [] }], - "records after animation is added"); - - anim.effect = null; - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [], removed: [anim] }], - "records after animation is removed"); - }, "set_null_animation_effect"); - - test(t => { - var div = addDiv(t); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var anim = new Animation(); - anim.play(); - anim.effect = new KeyframeEffect(div, { opacity: [ 0, 1 ] }, - 100 * MS_PER_SEC); - assert_equals_records(observer.takeRecords(), - [{ added: [anim], changed: [], removed: [] }], - "records after animation is added"); - }, "set_effect_on_null_effect_animation"); - - test(t => { - var div = addDiv(t); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var anim = div.animate({ marginLeft: [ "0px", "100px" ] }, - 100 * MS_PER_SEC); - assert_equals_records(observer.takeRecords(), - [{ added: [anim], changed: [], removed: [] }], - "records after animation is added"); - - anim.effect = new KeyframeEffect(div, { opacity: [ 0, 1 ] }, - 100 * MS_PER_SEC); - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [anim], removed: [] }], - "records after replace effects"); - }, "replace_effect_targeting_on_the_same_element"); - - test(t => { - var div = addDiv(t); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var anim = div.animate({ marginLeft: [ "0px", "100px" ] }, - 100 * MS_PER_SEC); - assert_equals_records(observer.takeRecords(), - [{ added: [anim], changed: [], removed: [] }], - "records after animation is added"); - - anim.currentTime = 60 * MS_PER_SEC; - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [anim], removed: [] }], - "records after animation is changed"); - - anim.effect = new KeyframeEffect(div, { opacity: [ 0, 1 ] }, - 50 * MS_PER_SEC); - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [], removed: [anim] }], - "records after replacing effects"); - }, "replace_effect_targeting_on_the_same_element_not_in_effect"); - - test(t => { - var div = addDiv(t); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var anim = div.animate([ { marginLeft: "0px" }, - { marginLeft: "-20px" }, - { marginLeft: "100px" }, - { marginLeft: "50px" } ], - { duration: 100 * MS_PER_SEC }); - assert_equals_records(observer.takeRecords(), - [{ added: [anim], changed: [], removed: [] }], - "records after animation is added"); - - anim.effect.spacing = "paced(margin-left)"; - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [anim], removed: [] }], - "records after animation is changed"); - }, "set_spacing"); - - test(t => { - var div = addDiv(t); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var anim = div.animate([ { marginLeft: "0px" }, - { marginLeft: "-20px" }, - { marginLeft: "100px" }, - { marginLeft: "50px" } ], - { duration: 100 * MS_PER_SEC, - spacing: "paced(margin-left)" }); - assert_equals_records(observer.takeRecords(), - [{ added: [anim], changed: [], removed: [] }], - "records after animation is added"); - - anim.effect.spacing = "paced(animation-duration)"; - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [anim], removed: [] }], - "records after setting a non-animatable paced property"); - }, "set_spacing_on_a_non-animatable_property"); - - test(t => { - var div = addDiv(t); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var anim = div.animate([ { marginLeft: "0px" }, - { marginLeft: "-20px" }, - { marginLeft: "100px" }, - { marginLeft: "50px" } ], - { duration: 100 * MS_PER_SEC, - spacing: "paced(margin-left)" }); - assert_equals_records(observer.takeRecords(), - [{ added: [anim], changed: [], removed: [] }], - "records after animation is added"); - - anim.effect.spacing = "paced(margin-left)"; - assert_equals_records(observer.takeRecords(), - [], "no record after setting the same spacing"); - }, "set_the_same_spacing"); - - test(t => { - var div = addDiv(t); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var anim = div.animate({ }, 100 * MS_PER_SEC); - assert_equals_records(observer.takeRecords(), - [{ added: [anim], changed: [], removed: [] }], - "records after animation is added"); - - anim.effect.composite = "add"; - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [anim], removed: [] }], - "records after composite is changed"); - - anim.effect.composite = "add"; - assert_equals_records(observer.takeRecords(), - [], "no record after setting the same composite"); - - }, "set_composite"); - - // Test that starting a single animation that is cancelled by calling - // cancel() dispatches an added notification and then a removed - // notification. - test(t => { - var div = addDiv(t, { style: "animation: anim 100s forwards" }); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var animations = div.getAnimations(); - assert_equals(animations.length, 1, - "getAnimations().length after animation start"); - - assert_equals_records(observer.takeRecords(), - [{ added: animations, changed: [], removed: [] }], - "records after animation start"); - - animations[0].cancel(); - - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [], removed: animations }], - "records after animation end"); - - // Re-trigger the animation. - animations[0].play(); - - // Single MutationRecord for the Animation (re-)addition. - assert_equals_records(observer.takeRecords(), - [{ added: animations, changed: [], removed: [] }], - "records after animation start"); - }, "single_animation_cancelled_api"); - - // Test that updating a property on the Animation object dispatches a changed - // notification. - [ - { prop: "playbackRate", val: 0.5 }, - { prop: "startTime", val: 50 * MS_PER_SEC }, - { prop: "currentTime", val: 50 * MS_PER_SEC }, - ].forEach(function(aChangeTest) { - test(t => { - // We use a forwards fill mode so that even if the change we make causes - // the animation to become finished, it will still be "relevant" so we - // won't mark it as removed. - var div = addDiv(t, { style: "animation: anim 100s forwards" }); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var animations = div.getAnimations(); - assert_equals(animations.length, 1, - "getAnimations().length after animation start"); - - assert_equals_records(observer.takeRecords(), - [{ added: animations, changed: [], removed: [] }], - "records after animation start"); - - // Update the property. - animations[0][aChangeTest.prop] = aChangeTest.val; - - // Make a redundant change. - animations[0][aChangeTest.prop] = animations[0][aChangeTest.prop]; - - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: animations, removed: [] }], - "records after animation property change"); - }, `single_animation_api_change_${aChangeTest.prop}`); - }); - - // Test that making a redundant change to currentTime while an Animation - // is pause-pending still generates a change MutationRecord since setting - // the currentTime to any value in this state aborts the pending pause. - test(t => { - var div = addDiv(t, { style: "animation: anim 100s" }); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var animations = div.getAnimations(); - assert_equals(animations.length, 1, - "getAnimations().length after animation start"); - - assert_equals_records(observer.takeRecords(), - [{ added: animations, changed: [], removed: [] }], - "records after animation start"); - - animations[0].pause(); - - // We are now pause-pending. Even if we make a redundant change to the - // currentTime, we should still get a change record because setting the - // currentTime while pause-pending has the effect of cancelling a pause. - animations[0].currentTime = animations[0].currentTime; - - // Two MutationRecords for the Animation changes: one for pausing, one - // for aborting the pause. - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: animations, removed: [] }, - { added: [], changed: animations, removed: [] }], - "records after pausing then seeking"); - }, "change_currentTime_while_pause_pending"); - - // Test that calling finish() on a forwards-filling Animation dispatches - // a changed notification. - test(t => { - var div = addDiv(t, { style: "animation: anim 100s forwards" }); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var animations = div.getAnimations(); - assert_equals(animations.length, 1, - "getAnimations().length after animation start"); - - assert_equals_records(observer.takeRecords(), - [{ added: animations, changed: [], removed: [] }], - "records after animation start"); - - animations[0].finish(); - - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: animations, removed: [] }], - "records after finish()"); - - // Redundant finish. - animations[0].finish(); - - // Ensure no change records. - assert_equals_records(observer.takeRecords(), - [], "records after redundant finish()"); - }, "finish_with_forwards_fill"); - - // Test that calling finish() on an Animation that does not fill forwards, - // dispatches a removal notification. - test(t => { - var div = addDiv(t, { style: "animation: anim 100s" }); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var animations = div.getAnimations(); - assert_equals(animations.length, 1, - "getAnimations().length after animation start"); - - assert_equals_records(observer.takeRecords(), - [{ added: animations, changed: [], removed: [] }], - "records after animation start"); - - animations[0].finish(); - - // Single MutationRecord for the Animation removal. - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [], removed: animations }], - "records after finishing"); - }, "finish_without_fill"); - - // Test that calling finish() on a forwards-filling Animation dispatches - test(t => { - var div = addDiv(t, { style: "animation: anim 100s" }); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var animation = div.getAnimations()[0]; - assert_equals_records(observer.takeRecords(), - [{ added: [animation], changed: [], removed: []}], - "records after creation"); - animation.id = "new id"; - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [animation], removed: []}], - "records after id is changed"); - - animation.id = "new id"; - assert_equals_records(observer.takeRecords(), - [], "records after assigning same value with id"); - }, "change_id"); - - // Test that calling reverse() dispatches a changed notification. - test(t => { - var div = addDiv(t, { style: "animation: anim 100s both" }); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var animations = div.getAnimations(); - assert_equals(animations.length, 1, - "getAnimations().length after animation start"); - - assert_equals_records(observer.takeRecords(), - [{ added: animations, changed: [], removed: [] }], - "records after animation start"); - - animations[0].reverse(); - - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: animations, removed: [] }], - "records after calling reverse()"); - }, "reverse"); - - // Test that calling reverse() does *not* dispatch a changed notification - // when playbackRate == 0. - test(t => { - var div = addDiv(t, { style: "animation: anim 100s both" }); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var animations = div.getAnimations(); - assert_equals(animations.length, 1, - "getAnimations().length after animation start"); - - assert_equals_records(observer.takeRecords(), - [{ added: animations, changed: [], removed: [] }], - "records after animation start"); - - // Seek to the middle and set playbackRate to zero. - animations[0].currentTime = 50 * MS_PER_SEC; - animations[0].playbackRate = 0; - - // Two MutationRecords, one for each change. - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: animations, removed: [] }, - { added: [], changed: animations, removed: [] }], - "records after seeking and setting playbackRate"); - - animations[0].reverse(); - - // We should get no notifications. - assert_equals_records(observer.takeRecords(), - [], "records after calling reverse()"); - }, "reverse_with_zero_playbackRate"); - - // Test that reverse() on an Animation does *not* dispatch a changed - // notification when it throws an exception. - test(t => { - // Start an infinite animation - var div = addDiv(t, { style: "animation: anim 10s infinite" }); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var animations = div.getAnimations(); - assert_equals(animations.length, 1, - "getAnimations().length after animation start"); - - assert_equals_records(observer.takeRecords(), - [{ added: animations, changed: [], removed: [] }], - "records after animation start"); - - // Shift the animation into the future such that when we call reverse - // it will try to seek to the (infinite) end. - animations[0].startTime = 100 * MS_PER_SEC; - - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: animations, removed: [] }], - "records after adjusting startTime"); - - // Reverse: should throw - assert_throws('InvalidStateError', () => { - animations[0].reverse(); - }, 'reverse() on future infinite animation throws an exception'); - - // We should get no notifications. - assert_equals_records(observer.takeRecords(), - [], "records after calling reverse()"); - }, "reverse_with_exception"); - - // Test that attempting to start an animation that should already be finished - // does not send any notifications. - test(t => { - // Start an animation that should already be finished. - var div = addDiv(t, { style: "animation: anim 1s -2s;" }); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - // The animation should cause no Animations to be created. - var animations = div.getAnimations(); - assert_equals(animations.length, 0, - "getAnimations().length after animation start"); - - // And we should get no notifications. - assert_equals_records(observer.takeRecords(), - [], "records after attempted animation start"); - }, "already_finished"); - - test(t => { - var div = addDiv(t, { style: "animation: anim 100s, anotherAnim 100s" }); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var animations = div.getAnimations(); - - assert_equals_records(observer.takeRecords(), - [{ added: animations, changed: [], removed: []}], - "records after creation"); - - div.style.animation = "anotherAnim 100s, anim 100s"; - animations = div.getAnimations(); - - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: animations, removed: []}], - "records after the order is changed"); - - div.style.animation = "anotherAnim 100s, anim 100s"; - - assert_equals_records(observer.takeRecords(), - [], "no records after applying the same order"); - }, "animtion_order_change"); - - test(t => { - var div = addDiv(t); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var anim = div.animate({ opacity: [ 0, 1 ] }, - { duration: 100 * MS_PER_SEC, - iterationComposite: 'replace' }); - - assert_equals_records(observer.takeRecords(), - [{ added: [anim], changed: [], removed: [] }], - "records after animation is added"); - - anim.effect.iterationComposite = 'accumulate'; - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [anim], removed: [] }], - "records after iterationComposite is changed"); - - anim.effect.iterationComposite = 'accumulate'; - assert_equals_records(observer.takeRecords(), - [], "no record after setting the same iterationComposite"); - - }, "set_iterationComposite"); - - test(t => { - var div = addDiv(t); - var observer = - setupSynchronousObserver(t, - aOptions.subtree ? div.parentNode : div, - aOptions.subtree); - - var anim = div.animate({ opacity: [ 0, 1 ] }, - { duration: 100 * MS_PER_SEC }); - - assert_equals_records(observer.takeRecords(), - [{ added: [anim], changed: [], removed: [] }], - "records after animation is added"); - - anim.effect.setKeyframes({ opacity: 0.1 }); - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [anim], removed: [] }], - "records after keyframes are changed"); - - anim.effect.setKeyframes({ opacity: 0.1 }); - assert_equals_records(observer.takeRecords(), - [], "no record after setting the same keyframes"); - - anim.effect.setKeyframes(null); - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [anim], removed: [] }], - "records after keyframes are set to empty"); - - }, "set_keyframes"); - -}); - -test(t => { - var div = addDiv(t); - var observer = setupSynchronousObserver(t, div, true); - - var child = document.createElement("div"); - div.appendChild(child); - - var anim1 = div.animate({ marginLeft: [ "0px", "50px" ] }, - 100 * MS_PER_SEC); - var anim2 = child.animate({ marginLeft: [ "0px", "100px" ] }, - 50 * MS_PER_SEC); - assert_equals_records(observer.takeRecords(), - [{ added: [anim1], changed: [], removed: [] }, - { added: [anim2], changed: [], removed: [] }], - "records after animation is added"); - - // After setting a new effect, we remove the current animation, anim1, - // because it is no longer attached to |div|, and then remove the previous - // animation, anim2. Finally, add back the anim1 which is in effect on - // |child| now. In addition, we sort them by tree order and they are - // batched. - anim1.effect = anim2.effect; - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [], removed: [anim1] }, // div - { added: [anim1], changed: [], removed: [anim2] }], // child - "records after animation effects are changed"); -}, "set_effect_with_previous_animation"); - -test(t => { - var div = addDiv(t); - var observer = setupSynchronousObserver(t, document, true); - - var anim = div.animate({ opacity: [ 0, 1 ] }, - { duration: 100 * MS_PER_SEC }); - - var newTarget = document.createElement("div"); - - assert_equals_records(observer.takeRecords(), - [{ added: [anim], changed: [], removed: [] }], - "records after animation is added"); - - anim.effect.target = null; - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [], removed: [anim] }], - "records after setting null"); - - anim.effect.target = div; - assert_equals_records(observer.takeRecords(), - [{ added: [anim], changed: [], removed: [] }], - "records after setting a target"); - - anim.effect.target = addDiv(t); - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [], removed: [anim] }, - { added: [anim], changed: [], removed: [] }], - "records after setting a different target"); -}, "set_animation_target"); - -test(t => { - var div = addDiv(t); - var pseudoTarget = createPseudo(t, div, 'before'); - var observer = setupSynchronousObserver(t, div, true); - - var anim = pseudoTarget.animate({ opacity: [ 0, 1 ] }, 200 * MS_PER_SEC); - - assert_equals_records(observer.takeRecords(), - [{ added: [anim], changed: [], removed: [] }], - "records after animation is added"); - - anim.effect.timing.duration = 100 * MS_PER_SEC; - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [anim], removed: [] }], - "records after duration is changed"); - - anim.effect.timing.duration = 100 * MS_PER_SEC; - assert_equals_records(observer.takeRecords(), - [], "records after assigning same value"); - - anim.currentTime = anim.effect.timing.duration * 2; - anim.finish(); - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [], removed: [anim] }], - "records after animation end"); - - anim.effect.timing.duration = anim.effect.timing.duration * 3; - assert_equals_records(observer.takeRecords(), - [{ added: [anim], changed: [], removed: [] }], - "records after animation restarted"); - - anim.effect.timing.duration = "auto"; - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [], removed: [anim] }], - "records after duration set \"auto\""); - - anim.effect.timing.duration = "auto"; - assert_equals_records(observer.takeRecords(), - [], "records after assigning same value \"auto\""); -}, "change_duration_and_currenttime_on_pseudo_elements"); - -test(t => { - var div = addDiv(t); - var pseudoTarget = createPseudo(t, div, 'before'); - var observer = setupSynchronousObserver(t, div, false); - - var anim = div.animate({ opacity: [ 0, 1 ] }, - { duration: 100 * MS_PER_SEC }); - var pAnim = pseudoTarget.animate({ opacity: [ 0, 1 ] }, - { duration: 100 * MS_PER_SEC }); - - assert_equals_records(observer.takeRecords(), - [{ added: [anim], changed: [], removed: [] }], - "records after animation is added"); - - anim.finish(); - pAnim.finish(); - - assert_equals_records(observer.takeRecords(), - [{ added: [], changed: [], removed: [anim] }], - "records after animation is finished"); -}, "exclude_animations_targeting_pseudo_elements"); + "records after animation is finished"); + }, "exclude_animations_targeting_pseudo_elements"); +} + +setup({explicit_done: true}); +SpecialPowers.pushPrefEnv( + { set: [["dom.animations-api.core.enabled", true]] }, + function() { + runTest(); + done(); + } +); From 56e549e4af4b221f4ce6cd050e9b96fed0a0b460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 19 May 2017 23:56:02 +0200 Subject: [PATCH 04/56] Bug 1364871: Factor out some code from UpdateStyleOfChildAnonBox into UpdateStyleOfOwnedChildFrame. r=heycam MozReview-Commit-ID: 24U6PmmqCeP --HG-- extra : rebase_source : bf726211d064f7e6274100267d9b1b341c2a2f95 --- layout/generic/nsFrame.cpp | 27 ++++++++++++++++++++------- layout/generic/nsIFrame.h | 12 ++++++++++++ 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index c520fe3bb88f..16f7bf329b97 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -10238,17 +10238,32 @@ nsFrame::UpdateStyleOfChildAnonBox(nsIFrame* aChildFrame, RefPtr newContext = aStyleSet.ResolveInheritingAnonymousBoxStyle(pseudo, StyleContext()); + nsChangeHint childHint = + UpdateStyleOfOwnedChildFrame(aChildFrame, newContext, aChangeList); + + // Now that we've updated the style on aChildFrame, check whether it itself + // has anon boxes to deal with. + aChildFrame->UpdateStyleOfOwnedAnonBoxes(aStyleSet, aChangeList, childHint); +} + +nsChangeHint +nsIFrame::UpdateStyleOfOwnedChildFrame(nsIFrame* aChildFrame, + nsStyleContext* aNewStyleContext, + nsStyleChangeList& aChangeList) +{ // Figure out whether we have an actual change. It's important that we do // this, for several reasons: // // 1) Even if all the child's changes are due to properties it inherits from // us, it's possible that no one ever asked us for those style structs and // hence changes to them aren't reflected in aHintForThisFrame at all. - // 2) Extensions can add/remove stylesheets that change the styles of - // anonymous boxed directly. + // + // 2) Content can change stylesheets that change the styles of pseudos, and + // extensions can add/remove stylesheets that change the styles of + // anonymous boxes directly. uint32_t equalStructs, samePointerStructs; // Not used, actually. nsChangeHint childHint = aChildFrame->StyleContext()->CalcStyleDifference( - newContext, + aNewStyleContext, &equalStructs, &samePointerStructs); if (childHint) { @@ -10261,12 +10276,10 @@ nsFrame::UpdateStyleOfChildAnonBox(nsIFrame* aChildFrame, } for (nsIFrame* kid = aChildFrame; kid; kid = kid->GetNextContinuation()) { - kid->SetStyleContext(newContext); + kid->SetStyleContext(aNewStyleContext); } - // Now that we've updated the style on aChildFrame, check whether it itself - // has anon boxes to deal with. - aChildFrame->UpdateStyleOfOwnedAnonBoxes(aStyleSet, aChangeList, childHint); + return childHint; } /* static */ void diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index 2ec9dd92bc16..4c2e4fd84b7f 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -3262,6 +3262,18 @@ public: } } + // A helper both for UpdateStyleOfChildAnonBox, and to update frame-backed + // pseudo-elements in ServoRestyleManager. + // + // This gets a style context that will be the new style context for + // `aChildFrame`, and takes care of updating it, calling CalcStyleDifference, + // and adding to the change list as appropriate. + // + // Returns the generated change hint for the frame. + nsChangeHint UpdateStyleOfOwnedChildFrame(nsIFrame* aChildFrame, + nsStyleContext* aNewStyleContext, + nsStyleChangeList& aChangeList); + /** * Hook subclasses can override to actually implement updating of style of * owned anon boxes. From cbebceac222a8bc72e5e674fd53b10c790e4ce2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 19 May 2017 23:58:22 +0200 Subject: [PATCH 05/56] Bug 1364871: Add a function to update frame pseudo-element styles during the post-traversal, and restyle bullet frames. r=heycam MozReview-Commit-ID: 9m0jqmxjOb6 --HG-- extra : rebase_source : 2d0b8dbcf451b8e9bc69759681dbce1f35ad28c5 --- layout/base/ServoRestyleManager.cpp | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/layout/base/ServoRestyleManager.cpp b/layout/base/ServoRestyleManager.cpp index 27052c26a890..ba49cefdf4a0 100644 --- a/layout/base/ServoRestyleManager.cpp +++ b/layout/base/ServoRestyleManager.cpp @@ -12,6 +12,8 @@ #include "mozilla/Unused.h" #include "mozilla/dom/ChildIterator.h" #include "mozilla/dom/ElementInlines.h" +#include "nsBlockFrame.h" +#include "nsBulletFrame.h" #include "nsContentUtils.h" #include "nsCSSFrameConstructor.h" #include "nsPrintfCString.h" @@ -203,6 +205,38 @@ struct ServoRestyleManager::TextPostTraversalState } }; +static void +UpdateBlockFramePseudoElements(nsBlockFrame* aFrame, + ServoStyleSet& aStyleSet, + nsChangeHint aChangeHintForFrame, + nsStyleChangeList& aChangeList) +{ + if (nsBulletFrame* bullet = aFrame->GetBullet()) { + RefPtr newContext = + aStyleSet.ResolvePseudoElementStyle( + aFrame->GetContent()->AsElement(), + bullet->StyleContext()->GetPseudoType(), + aFrame->StyleContext(), + /* aPseudoElement = */ nullptr); + + aFrame->UpdateStyleOfOwnedChildFrame(bullet, newContext, aChangeList); + } +} + +static void +UpdateFramePseudoElementStyles(nsIFrame* aFrame, + ServoStyleSet& aStyleSet, + nsChangeHint aChangeHintForFrame, + nsStyleChangeList& aChangeList) +{ + if (aFrame->IsFrameOfType(nsIFrame::eBlockFrame)) { + UpdateBlockFramePseudoElements(static_cast(aFrame), + aStyleSet, + aChangeHintForFrame, + aChangeList); + } +} + void ServoRestyleManager::ProcessPostTraversal(Element* aElement, nsStyleContext* aParentContext, @@ -314,6 +348,7 @@ ServoRestyleManager::ProcessPostTraversal(Element* aElement, if (styleFrame) { styleFrame->UpdateStyleOfOwnedAnonBoxes(*aStyleSet, aChangeList, changeHint); + UpdateFramePseudoElementStyles(styleFrame, *aStyleSet, changeHint, aChangeList); } } From cd98f069a230912a911bb4532999f198941758ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 19 May 2017 23:59:23 +0200 Subject: [PATCH 06/56] Bug 1364871: Restyle ::backdrop too. r=heycam MozReview-Commit-ID: BGWRiaeZiD8 --HG-- extra : rebase_source : a3ebd025ca9a9d7a03a5aeec95e0d40791c9af7c --- layout/base/ServoRestyleManager.cpp | 47 ++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/layout/base/ServoRestyleManager.cpp b/layout/base/ServoRestyleManager.cpp index ba49cefdf4a0..3b63216cc911 100644 --- a/layout/base/ServoRestyleManager.cpp +++ b/layout/base/ServoRestyleManager.cpp @@ -14,6 +14,7 @@ #include "mozilla/dom/ElementInlines.h" #include "nsBlockFrame.h" #include "nsBulletFrame.h" +#include "nsPlaceholderFrame.h" #include "nsContentUtils.h" #include "nsCSSFrameConstructor.h" #include "nsPrintfCString.h" @@ -208,7 +209,6 @@ struct ServoRestyleManager::TextPostTraversalState static void UpdateBlockFramePseudoElements(nsBlockFrame* aFrame, ServoStyleSet& aStyleSet, - nsChangeHint aChangeHintForFrame, nsStyleChangeList& aChangeList) { if (nsBulletFrame* bullet = aFrame->GetBullet()) { @@ -223,18 +223,57 @@ UpdateBlockFramePseudoElements(nsBlockFrame* aFrame, } } +static void +UpdateBackdropIfNeeded(nsIFrame* aFrame, + ServoStyleSet& aStyleSet, + nsStyleChangeList& aChangeList) +{ + const nsStyleDisplay* display = aFrame->StyleContext()->StyleDisplay(); + if (display->mTopLayer != NS_STYLE_TOP_LAYER_TOP) { + return; + } + + // Elements in the top layer are guaranteed to have absolute or fixed + // position per https://fullscreen.spec.whatwg.org/#new-stacking-layer. + MOZ_ASSERT(display->IsAbsolutelyPositionedStyle()); + + nsIFrame* backdropPlaceholder = + aFrame->GetChildList(nsIFrame::kBackdropList).FirstChild(); + if (!backdropPlaceholder) { + return; + } + + MOZ_ASSERT(backdropPlaceholder->IsPlaceholderFrame()); + nsIFrame* backdropFrame = + nsPlaceholderFrame::GetRealFrameForPlaceholder(backdropPlaceholder); + MOZ_ASSERT(backdropFrame->IsBackdropFrame()); + MOZ_ASSERT(backdropFrame->StyleContext()->GetPseudoType() == + CSSPseudoElementType::backdrop); + + RefPtr newContext = + aStyleSet.ResolvePseudoElementStyle( + aFrame->GetContent()->AsElement(), + CSSPseudoElementType::backdrop, + aFrame->StyleContext(), + /* aPseudoElement = */ nullptr); + + aFrame->UpdateStyleOfOwnedChildFrame(backdropFrame, + newContext, + aChangeList); +} + static void UpdateFramePseudoElementStyles(nsIFrame* aFrame, ServoStyleSet& aStyleSet, - nsChangeHint aChangeHintForFrame, nsStyleChangeList& aChangeList) { if (aFrame->IsFrameOfType(nsIFrame::eBlockFrame)) { UpdateBlockFramePseudoElements(static_cast(aFrame), aStyleSet, - aChangeHintForFrame, aChangeList); } + + UpdateBackdropIfNeeded(aFrame, aStyleSet, aChangeList); } void @@ -348,7 +387,7 @@ ServoRestyleManager::ProcessPostTraversal(Element* aElement, if (styleFrame) { styleFrame->UpdateStyleOfOwnedAnonBoxes(*aStyleSet, aChangeList, changeHint); - UpdateFramePseudoElementStyles(styleFrame, *aStyleSet, changeHint, aChangeList); + UpdateFramePseudoElementStyles(styleFrame, *aStyleSet, aChangeList); } } From b0e5579ecb5bf2fea35f2860be48d571d350ab23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 20 May 2017 03:26:24 +0200 Subject: [PATCH 07/56] Bug 1364871: Revert workaround added in bug 1328319. r=heycam MozReview-Commit-ID: 804TV5qW3Xh --HG-- extra : rebase_source : ccd88cde5128551e799302a11bbe98be89698718 --- layout/base/nsPresContext.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index 85f10eb894ce..71a1c73c7476 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -2311,14 +2311,8 @@ nsPresContext::FlushCounterStyles() PresShell()->NotifyCounterStylesAreDirty(); PostRebuildAllStyleDataEvent(NS_STYLE_HINT_REFLOW, eRestyle_ForceDescendants); - if (mShell->StyleSet()->IsGecko()) { - RefreshDriver()->AddPostRefreshObserver( - new CounterStyleCleaner(RefreshDriver(), mCounterStyleManager)); - } else { - NS_WARNING("stylo: Pseudo-element ::-moz-list-{number,bullet} are not " - "restyled properly, so we cannot clean up retired objects. " - "See bug 1364871."); - } + RefreshDriver()->AddPostRefreshObserver( + new CounterStyleCleaner(RefreshDriver(), mCounterStyleManager)); } mCounterStylesDirty = false; } From 122b52b9c466fde0f7f104c64c079dc9cef5f673 Mon Sep 17 00:00:00 2001 From: Mantaroh Yoshinaga Date: Sat, 20 May 2017 01:52:52 -0500 Subject: [PATCH 08/56] servo: Merge #16942 - Make font-stretch animatable (from mantaroh:font-stretch); r=hiro This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1357663 --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] There are tests for these changes, a test case will be landed in web-platform-tests in https://bugzilla.mozilla.org/show_bug.cgi?id=1357663 Source-Repo: https://github.com/servo/servo Source-Revision: 2c3a03b254c696d7be7a3d85ae5957628db63206 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : e202adc3bf501a8aa4bd529c323b7ef70c978764 --- servo/components/style/properties/data.py | 9 ++++ .../components/style/properties/gecko.mako.rs | 24 ++++++--- .../helpers/animated_properties.mako.rs | 49 +++++++++++++++++++ .../style/properties/longhand/font.mako.rs | 5 +- 4 files changed, 78 insertions(+), 9 deletions(-) diff --git a/servo/components/style/properties/data.py b/servo/components/style/properties/data.py index 8bb1fc869884..5b18424ebee3 100644 --- a/servo/components/style/properties/data.py +++ b/servo/components/style/properties/data.py @@ -127,6 +127,15 @@ class Keyword(object): def maybe_cast(self, type_str): return "as " + type_str if self.needs_cast() else "" + def casted_constant_name(self, value, cast_type): + if cast_type is None: + raise TypeError("We should specify the cast_type.") + + if self.gecko_enum_prefix is None: + return cast_type.upper() + "_" + self.gecko_constant(value) + else: + return cast_type.upper() + "_" + self.gecko_constant(value).upper().replace("::", "_") + def arg_to_bool(arg): if isinstance(arg, bool): diff --git a/servo/components/style/properties/gecko.mako.rs b/servo/components/style/properties/gecko.mako.rs index 4fd410c161f6..1f6957ba86fa 100644 --- a/servo/components/style/properties/gecko.mako.rs +++ b/servo/components/style/properties/gecko.mako.rs @@ -274,14 +274,25 @@ def set_gecko_property(ffi_name, expr): } -<%def name="impl_keyword_clone(ident, gecko_ffi_name, keyword)"> +<%def name="impl_keyword_clone(ident, gecko_ffi_name, keyword, cast_type='u8')"> #[allow(non_snake_case)] pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { use properties::longhands::${ident}::computed_value::T as Keyword; // FIXME(bholley): Align binary representations and ditch |match| for cast + static_asserts - match ${get_gecko_property(gecko_ffi_name)} ${keyword.maybe_cast("u32")} { + + // Some constant macros in the gecko are defined as negative integer(e.g. font-stretch). + // And they are convert to signed integer in Rust bindings. We need to cast then + // as signed type when we have both signed/unsigned integer in order to use them + // as match's arms. + // Also, to use same implementation here we use casted constant if we have only singed values. + % for value in keyword.values_for('gecko'): + const ${keyword.casted_constant_name(value, cast_type)} : ${cast_type} = + structs::${keyword.gecko_constant(value)} as ${cast_type}; + % endfor + + match ${get_gecko_property(gecko_ffi_name)} as ${cast_type} { % for value in keyword.values_for('gecko'): - structs::${keyword.gecko_constant(value)} => Keyword::${to_rust_ident(value)}, + ${keyword.casted_constant_name(value, cast_type)} => Keyword::${to_rust_ident(value)}, % endfor % if keyword.gecko_inexhaustive: x => panic!("Found unexpected value in style struct for ${ident} property: {:?}", x), @@ -334,11 +345,11 @@ fn color_to_nscolor_zero_currentcolor(color: Color) -> structs::nscolor { } -<%def name="impl_keyword(ident, gecko_ffi_name, keyword, need_clone, **kwargs)"> -<%call expr="impl_keyword_setter(ident, gecko_ffi_name, keyword, **kwargs)"> +<%def name="impl_keyword(ident, gecko_ffi_name, keyword, need_clone, cast_type='u8', **kwargs)"> +<%call expr="impl_keyword_setter(ident, gecko_ffi_name, keyword, cast_type, **kwargs)"> <%call expr="impl_simple_copy(ident, gecko_ffi_name)"> %if need_clone: -<%call expr="impl_keyword_clone(ident, gecko_ffi_name, keyword)"> +<%call expr="impl_keyword_clone(ident, gecko_ffi_name, keyword, cast_type)"> % endif @@ -2010,6 +2021,7 @@ fn static_assert() { "-moz-grid-group -moz-grid-line -moz-stack -moz-inline-stack -moz-deck " + "-moz-popup -moz-groupbox", gecko_enum_prefix="StyleDisplay", + gecko_inexhaustive="True", gecko_strip_moz_prefix=False) %> pub fn set_display(&mut self, v: longhands::display::computed_value::T) { diff --git a/servo/components/style/properties/helpers/animated_properties.mako.rs b/servo/components/style/properties/helpers/animated_properties.mako.rs index 071454dd2ba8..11fa3956a8a2 100644 --- a/servo/components/style/properties/helpers/animated_properties.mako.rs +++ b/servo/components/style/properties/helpers/animated_properties.mako.rs @@ -17,6 +17,7 @@ use properties::{CSSWideKeyword, PropertyDeclaration}; use properties::longhands; use properties::longhands::background_size::computed_value::T as BackgroundSizeList; use properties::longhands::font_weight::computed_value::T as FontWeight; +use properties::longhands::font_stretch::computed_value::T as FontStretch; use properties::longhands::line_height::computed_value::T as LineHeight; use properties::longhands::text_shadow::computed_value::T as TextShadowList; use properties::longhands::text_shadow::computed_value::TextShadow; @@ -1360,6 +1361,54 @@ impl Animatable for FontWeight { } } +/// https://drafts.csswg.org/css-fonts/#font-stretch-prop +impl Animatable for FontStretch { + #[inline] + fn add_weighted(&self, other: &Self, self_portion: f64, other_portion: f64) -> Result { + let from = f64::from(*self); + let to = f64::from(*other); + let interpolated_mapped_index = ((from * self_portion + to * other_portion) + 0.5).floor(); + Ok(interpolated_mapped_index.into()) + } + + #[inline] + fn compute_distance(&self, other: &Self) -> Result { + let from = f64::from(*self); + let to = f64::from(*other); + from.compute_distance(&to) + } +} + +/// We should treat font stretch as real number in order to interpolate this property. +/// https://drafts.csswg.org/css-fonts-3/#font-stretch-animation +impl From for f64 { + fn from(stretch: FontStretch) -> f64 { + use self::FontStretch::*; + match stretch { + ultra_condensed => 1.0, + extra_condensed => 2.0, + condensed => 3.0, + semi_condensed => 4.0, + normal => 5.0, + semi_expanded => 6.0, + expanded => 7.0, + extra_expanded => 8.0, + ultra_expanded => 9.0, + } + } +} + +impl Into for f64 { + fn into(self) -> FontStretch { + use properties::longhands::font_stretch::computed_value::T::*; + debug_assert!(self >= 1.0 && self <= 9.0); + static FONT_STRETCH_ENUM_MAP: [FontStretch; 9] = + [ ultra_condensed, extra_condensed, condensed, semi_condensed, normal, + semi_expanded, expanded, extra_expanded, ultra_expanded ]; + FONT_STRETCH_ENUM_MAP[(self - 1.0) as usize] + } +} + /// https://drafts.csswg.org/css-transitions/#animtype-simple-list impl Animatable for generic_position::Position { #[inline] diff --git a/servo/components/style/properties/longhand/font.mako.rs b/servo/components/style/properties/longhand/font.mako.rs index 9461d1a688fd..45687818d095 100644 --- a/servo/components/style/properties/longhand/font.mako.rs +++ b/servo/components/style/properties/longhand/font.mako.rs @@ -1178,7 +1178,6 @@ ${helpers.single_keyword_system("font-variant-caps", } -// FIXME: This prop should be animatable ${helpers.single_keyword_system("font-stretch", "normal ultra-condensed extra-condensed condensed \ semi-condensed semi-expanded expanded extra-expanded \ @@ -1187,14 +1186,14 @@ ${helpers.single_keyword_system("font-stretch", gecko_constant_prefix="NS_FONT_STRETCH", cast_type='i16', spec="https://drafts.csswg.org/css-fonts/#propdef-font-stretch", - animation_value_type="none")} + animation_value_type="ComputedValue")} ${helpers.single_keyword_system("font-kerning", "auto none normal", products="gecko", gecko_ffi_name="mFont.kerning", gecko_constant_prefix="NS_FONT_KERNING", - spec="https://drafts.csswg.org/css-fonts/#propdef-font-stretch", + spec="https://drafts.csswg.org/css-fonts/#propdef-font-kerning", animation_value_type="none")} /// FIXME: Implement proper handling of each values. From 240f3de631fbe5c6de71352fe58d3ad5fe82c280 Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Sat, 20 May 2017 07:24:21 -0500 Subject: [PATCH 09/56] servo: Merge #16963 - stylo: Bug 1334036 - Enable animations running on compositor (from BorisChiou:stylo/animation/omta); r=emilio These are interdependent patches of Bug 1334036, which enables off-main thread animations. We add one FFI to get the property id set which overriding animations, so we can make sure the cascade result is correct for off-main thread animations. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix [Bug 1334036](https://bugzilla.mozilla.org/show_bug.cgi?id=1334036) - [X] These changes do not require tests because we support off-main thread animation only on Gecko, and there are enough test cases there. Source-Repo: https://github.com/servo/servo Source-Revision: 5a012cc9b15890fe8ad132e941d8f896b405472c --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : f72aef04d69022c20bedbbb075d1385bfd15729a --- servo/components/script/layout_wrapper.rs | 5 +- servo/components/style/data.rs | 19 + .../style/gecko/generated/bindings.rs | 25 + .../style/gecko/generated/structs_debug.rs | 1268 +++++++++-------- .../style/gecko/generated/structs_release.rs | 1268 +++++++++-------- servo/components/style/matching.rs | 105 +- .../components/style/properties/gecko.mako.rs | 6 +- .../style/properties/properties.mako.rs | 4 +- servo/components/style/rule_tree/mod.rs | 38 +- servo/components/style/traversal.rs | 8 +- servo/ports/geckolib/glue.rs | 64 +- 11 files changed, 1543 insertions(+), 1267 deletions(-) diff --git a/servo/components/script/layout_wrapper.rs b/servo/components/script/layout_wrapper.rs index 62e5158f3216..fca0f0949eba 100644 --- a/servo/components/script/layout_wrapper.rs +++ b/servo/components/script/layout_wrapper.rs @@ -486,7 +486,10 @@ impl<'le> TElement for ServoLayoutElement<'le> { } fn has_animations(&self) -> bool { - unreachable!("this should be only called on gecko"); + // We use this function not only for Gecko but also for Servo to know if this element has + // animations, so we maybe try to get the important rules of this element. This is used for + // off-main thread animations, but we don't support it on Servo, so return false directly. + false } fn has_css_animations(&self) -> bool { diff --git a/servo/components/style/data.rs b/servo/components/style/data.rs index af3d57e0a72d..c1ea08653172 100644 --- a/servo/components/style/data.rs +++ b/servo/components/style/data.rs @@ -13,6 +13,7 @@ use properties::longhands::display::computed_value as display; use restyle_hints::{RESTYLE_DESCENDANTS, RESTYLE_LATER_SIBLINGS, RESTYLE_SELF, RestyleHint}; use rule_tree::StrongRuleNode; use selector_parser::{EAGER_PSEUDO_COUNT, PseudoElement, RestyleDamage}; +use shared_lock::StylesheetGuards; #[cfg(feature = "servo")] use std::collections::HashMap; use std::fmt; #[cfg(feature = "servo")] use std::hash::BuildHasherDefault; @@ -506,6 +507,24 @@ impl ElementData { true } + /// Return true if important rules are different. + /// We use this to make sure the cascade of off-main thread animations is correct. + /// Note: Ignore custom properties for now because we only support opacity and transform + /// properties for animations running on compositor. Actually, we only care about opacity + /// and transform for now, but it's fine to compare all properties and let the user + /// the check which properties do they want. + /// If it costs too much, get_properties_overriding_animations() should return a set + /// containing only opacity and transform properties. + pub fn important_rules_are_different(&self, + rules: &StrongRuleNode, + guards: &StylesheetGuards) -> bool { + debug_assert!(self.has_styles()); + let (important_rules, _custom) = + self.styles().primary.rules.get_properties_overriding_animations(&guards); + let (other_important_rules, _custom) = rules.get_properties_overriding_animations(&guards); + important_rules != other_important_rules + } + /// Returns true if the Element has a RestyleData. pub fn has_restyle(&self) -> bool { self.restyle.is_some() diff --git a/servo/components/style/gecko/generated/bindings.rs b/servo/components/style/gecko/generated/bindings.rs index f086bbbb49f2..a07176ee2088 100644 --- a/servo/components/style/gecko/generated/bindings.rs +++ b/servo/components/style/gecko/generated/bindings.rs @@ -10,6 +10,7 @@ use gecko_bindings::structs::mozilla::css::URLValue; use gecko_bindings::structs::mozilla::Side; use gecko_bindings::structs::RawGeckoAnimationPropertySegment; use gecko_bindings::structs::RawGeckoComputedTiming; +use gecko_bindings::structs::RawGeckoCSSPropertyIDList; use gecko_bindings::structs::RawGeckoDocument; use gecko_bindings::structs::RawGeckoElement; use gecko_bindings::structs::RawGeckoKeyframeList; @@ -48,6 +49,7 @@ use gecko_bindings::structs::nsCSSCounterStyleRule; use gecko_bindings::structs::nsCSSFontFaceRule; use gecko_bindings::structs::nsCSSKeyword; use gecko_bindings::structs::nsCSSPropertyID; +use gecko_bindings::structs::nsCSSPropertyIDSet; use gecko_bindings::structs::nsCSSShadowArray; use gecko_bindings::structs::nsCSSUnit; use gecko_bindings::structs::nsCSSValue; @@ -316,6 +318,10 @@ pub type RawGeckoPresContextBorrowed<'a> = &'a RawGeckoPresContext; pub type RawGeckoPresContextBorrowedOrNull<'a> = Option<&'a RawGeckoPresContext>; pub type RawGeckoStyleAnimationListBorrowed<'a> = &'a RawGeckoStyleAnimationList; pub type RawGeckoStyleAnimationListBorrowedOrNull<'a> = Option<&'a RawGeckoStyleAnimationList>; +pub type nsCSSPropertyIDSetBorrowed<'a> = &'a nsCSSPropertyIDSet; +pub type nsCSSPropertyIDSetBorrowedOrNull<'a> = Option<&'a nsCSSPropertyIDSet>; +pub type nsCSSPropertyIDSetBorrowedMut<'a> = &'a mut nsCSSPropertyIDSet; +pub type nsCSSPropertyIDSetBorrowedMutOrNull<'a> = Option<&'a mut nsCSSPropertyIDSet>; pub type nsCSSValueBorrowed<'a> = &'a nsCSSValue; pub type nsCSSValueBorrowedOrNull<'a> = Option<&'a nsCSSValue>; pub type nsCSSValueBorrowedMut<'a> = &'a mut nsCSSValue; @@ -352,6 +358,10 @@ pub type RawGeckoServoStyleRuleListBorrowed<'a> = &'a RawGeckoServoStyleRuleList pub type RawGeckoServoStyleRuleListBorrowedOrNull<'a> = Option<&'a RawGeckoServoStyleRuleList>; pub type RawGeckoServoStyleRuleListBorrowedMut<'a> = &'a mut RawGeckoServoStyleRuleList; pub type RawGeckoServoStyleRuleListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoServoStyleRuleList>; +pub type RawGeckoCSSPropertyIDListBorrowed<'a> = &'a RawGeckoCSSPropertyIDList; +pub type RawGeckoCSSPropertyIDListBorrowedOrNull<'a> = Option<&'a RawGeckoCSSPropertyIDList>; +pub type RawGeckoCSSPropertyIDListBorrowedMut<'a> = &'a mut RawGeckoCSSPropertyIDList; +pub type RawGeckoCSSPropertyIDListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoCSSPropertyIDList>; extern "C" { pub fn Gecko_EnsureTArrayCapacity(aArray: *mut ::std::os::raw::c_void, @@ -1177,6 +1187,9 @@ extern "C" { extern "C" { pub fn Gecko_NewCSSValueSharedList(len: u32) -> *mut nsCSSValueSharedList; } +extern "C" { + pub fn Gecko_NewNoneTransform() -> *mut nsCSSValueSharedList; +} extern "C" { pub fn Gecko_CSSValue_GetArrayItem(css_value: nsCSSValueBorrowedMut, index: i32) -> nsCSSValueBorrowedMut; @@ -1363,6 +1376,10 @@ extern "C" { ident: *const u16, set_slow_selector: *mut bool) -> bool; } +extern "C" { + pub fn Gecko_AddPropertyToSet(arg1: nsCSSPropertyIDSetBorrowedMut, + arg2: nsCSSPropertyID); +} extern "C" { pub fn Gecko_Construct_Default_nsStyleFont(ptr: *mut nsStyleFont, pres_context: @@ -2076,6 +2093,14 @@ extern "C" { pub fn Servo_Property_IsDiscreteAnimatable(property: nsCSSPropertyID) -> bool; } +extern "C" { + pub fn Servo_GetProperties_Overriding_Animation(arg1: + RawGeckoElementBorrowed, + arg2: + RawGeckoCSSPropertyIDListBorrowed, + arg3: + nsCSSPropertyIDSetBorrowedMut); +} extern "C" { pub fn Servo_AnimationValues_Interpolate(from: RawServoAnimationValueBorrowed, diff --git a/servo/components/style/gecko/generated/structs_debug.rs b/servo/components/style/gecko/generated/structs_debug.rs index 2f8b574b2090..f5492e5bfe8a 100644 --- a/servo/components/style/gecko/generated/structs_debug.rs +++ b/servo/components/style/gecko/generated/structs_debug.rs @@ -3797,9 +3797,20 @@ pub mod root { _unused: [u8; 0], } #[repr(C)] - #[derive(Debug, Copy, Clone)] + #[derive(Debug)] pub struct EventHandlerNonNull { - _unused: [u8; 0], + pub _base: root::mozilla::dom::CallbackFunction, + } + #[test] + fn bindgen_test_layout_EventHandlerNonNull() { + assert_eq!(::std::mem::size_of::() , + 56usize , concat ! ( + "Size of: " , stringify ! ( EventHandlerNonNull ) + )); + assert_eq! (::std::mem::align_of::() , + 8usize , concat ! ( + "Alignment of " , stringify ! ( + EventHandlerNonNull ) )); } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -6395,7 +6406,11 @@ pub mod root { } #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum TraversalRestyleBehavior { Normal = 0, ForReconstruct = 1, } + pub enum TraversalRestyleBehavior { + Normal = 0, + ForReconstruct = 1, + ForAnimationOnly = 2, + } pub const UpdateAnimationsTasks_CSSAnimations: root::mozilla::UpdateAnimationsTasks = 1; @@ -6928,7 +6943,7 @@ pub mod root { _unused: [u8; 0], } #[test] - fn __bindgen_test_layout_StaticRefPtr_instantiation_118261() { + fn __bindgen_test_layout_StaticRefPtr_instantiation_119008() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -7693,6 +7708,7 @@ pub mod root { pub _mOwningThread: root::nsAutoOwningThread, pub mPresContext: *mut root::nsPresContext, pub mElementsToRestyle: [u64; 12usize], + pub mIsInPreTraverse: bool, pub mRuleProcessors: [u64; 4usize], } pub type EffectCompositor_HasThreadSafeRefCnt = @@ -7729,6 +7745,12 @@ pub mod root { Standard = 1, Layer = 2, } + #[repr(i32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum EffectCompositor_AnimationRestyleType { + Throttled = 0, + Full = 1, + } #[repr(C)] #[derive(Debug)] pub struct EffectCompositor_AnimationStyleRuleProcessor { @@ -7799,7 +7821,7 @@ pub mod root { pub const EffectCompositor_kCascadeLevelCount: usize = 2; #[test] fn bindgen_test_layout_EffectCompositor() { - assert_eq!(::std::mem::size_of::() , 152usize , + assert_eq!(::std::mem::size_of::() , 160usize , concat ! ( "Size of: " , stringify ! ( EffectCompositor ) )); assert_eq! (::std::mem::align_of::() , 8usize , @@ -7834,7 +7856,14 @@ pub mod root { mElementsToRestyle ) )); assert_eq! (unsafe { & ( * ( 0 as * const EffectCompositor ) ) . - mRuleProcessors as * const _ as usize } , 120usize , + mIsInPreTraverse as * const _ as usize } , 120usize , + concat ! ( + "Alignment of field: " , stringify ! ( + EffectCompositor ) , "::" , stringify ! ( + mIsInPreTraverse ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const EffectCompositor ) ) . + mRuleProcessors as * const _ as usize } , 128usize , concat ! ( "Alignment of field: " , stringify ! ( EffectCompositor ) , "::" , stringify ! ( @@ -9169,7 +9198,7 @@ pub mod root { ( mValue ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_155741() { + fn __bindgen_test_layout_DefaultDelete_instantiation_156786() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -11590,7 +11619,7 @@ pub mod root { pub _address: u8, } #[test] - fn __bindgen_test_layout_nsCharTraits_instantiation_52974() { + fn __bindgen_test_layout_nsCharTraits_instantiation_53553() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -11601,7 +11630,7 @@ pub mod root { root::nsCharTraits ) )); } #[test] - fn __bindgen_test_layout_nsCharTraits_instantiation_52978() { + fn __bindgen_test_layout_nsCharTraits_instantiation_53557() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -13074,7 +13103,7 @@ pub mod root { } pub type nsCOMPtr_element_type = T; #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_62108() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_62693() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -23809,489 +23838,491 @@ pub mod root { eCSSKeyword_hz = 274, eCSSKeyword_icon = 275, eCSSKeyword_ignore = 276, - eCSSKeyword_in = 277, - eCSSKeyword_interlace = 278, - eCSSKeyword_inactive = 279, - eCSSKeyword_inactiveborder = 280, - eCSSKeyword_inactivecaption = 281, - eCSSKeyword_inactivecaptiontext = 282, - eCSSKeyword_infinite = 283, - eCSSKeyword_infobackground = 284, - eCSSKeyword_infotext = 285, - eCSSKeyword_inherit = 286, - eCSSKeyword_initial = 287, - eCSSKeyword_inline = 288, - eCSSKeyword_inline_axis = 289, - eCSSKeyword_inline_block = 290, - eCSSKeyword_inline_end = 291, - eCSSKeyword_inline_flex = 292, - eCSSKeyword_inline_grid = 293, - eCSSKeyword_inline_start = 294, - eCSSKeyword_inline_table = 295, - eCSSKeyword_inset = 296, - eCSSKeyword_inside = 297, - eCSSKeyword_inter_character = 298, - eCSSKeyword_inter_word = 299, - eCSSKeyword_interpolatematrix = 300, - eCSSKeyword_accumulatematrix = 301, - eCSSKeyword_intersect = 302, - eCSSKeyword_isolate = 303, - eCSSKeyword_isolate_override = 304, - eCSSKeyword_invert = 305, - eCSSKeyword_italic = 306, - eCSSKeyword_japanese_formal = 307, - eCSSKeyword_japanese_informal = 308, - eCSSKeyword_jis78 = 309, - eCSSKeyword_jis83 = 310, - eCSSKeyword_jis90 = 311, - eCSSKeyword_jis04 = 312, - eCSSKeyword_justify = 313, - eCSSKeyword_keep_all = 314, - eCSSKeyword_khz = 315, - eCSSKeyword_korean_hangul_formal = 316, - eCSSKeyword_korean_hanja_formal = 317, - eCSSKeyword_korean_hanja_informal = 318, - eCSSKeyword_landscape = 319, - eCSSKeyword_large = 320, - eCSSKeyword_larger = 321, - eCSSKeyword_last = 322, - eCSSKeyword_last_baseline = 323, - eCSSKeyword_layout = 324, - eCSSKeyword_left = 325, - eCSSKeyword_legacy = 326, - eCSSKeyword_lighten = 327, - eCSSKeyword_lighter = 328, - eCSSKeyword_line_through = 329, - eCSSKeyword_linear = 330, - eCSSKeyword_lining_nums = 331, - eCSSKeyword_list_item = 332, - eCSSKeyword_local = 333, - eCSSKeyword_logical = 334, - eCSSKeyword_looped = 335, - eCSSKeyword_lowercase = 336, - eCSSKeyword_lr = 337, - eCSSKeyword_lr_tb = 338, - eCSSKeyword_ltr = 339, - eCSSKeyword_luminance = 340, - eCSSKeyword_luminosity = 341, - eCSSKeyword_mandatory = 342, - eCSSKeyword_manipulation = 343, - eCSSKeyword_manual = 344, - eCSSKeyword_margin_box = 345, - eCSSKeyword_markers = 346, - eCSSKeyword_match_parent = 347, - eCSSKeyword_match_source = 348, - eCSSKeyword_matrix = 349, - eCSSKeyword_matrix3d = 350, - eCSSKeyword_max_content = 351, - eCSSKeyword_medium = 352, - eCSSKeyword_menu = 353, - eCSSKeyword_menutext = 354, - eCSSKeyword_message_box = 355, - eCSSKeyword_middle = 356, - eCSSKeyword_min_content = 357, - eCSSKeyword_minmax = 358, - eCSSKeyword_mix = 359, - eCSSKeyword_mixed = 360, - eCSSKeyword_mm = 361, - eCSSKeyword_monospace = 362, - eCSSKeyword_move = 363, - eCSSKeyword_ms = 364, - eCSSKeyword_multiply = 365, - eCSSKeyword_n_resize = 366, - eCSSKeyword_narrower = 367, - eCSSKeyword_ne_resize = 368, - eCSSKeyword_nesw_resize = 369, - eCSSKeyword_no_clip = 370, - eCSSKeyword_no_close_quote = 371, - eCSSKeyword_no_common_ligatures = 372, - eCSSKeyword_no_contextual = 373, - eCSSKeyword_no_discretionary_ligatures = 374, - eCSSKeyword_no_drag = 375, - eCSSKeyword_no_drop = 376, - eCSSKeyword_no_historical_ligatures = 377, - eCSSKeyword_no_open_quote = 378, - eCSSKeyword_no_repeat = 379, - eCSSKeyword_none = 380, - eCSSKeyword_normal = 381, - eCSSKeyword_not_allowed = 382, - eCSSKeyword_nowrap = 383, - eCSSKeyword_numeric = 384, - eCSSKeyword_ns_resize = 385, - eCSSKeyword_nw_resize = 386, - eCSSKeyword_nwse_resize = 387, - eCSSKeyword_oblique = 388, - eCSSKeyword_oldstyle_nums = 389, - eCSSKeyword_opacity = 390, - eCSSKeyword_open = 391, - eCSSKeyword_open_quote = 392, - eCSSKeyword_optional = 393, - eCSSKeyword_ordinal = 394, - eCSSKeyword_ornaments = 395, - eCSSKeyword_outset = 396, - eCSSKeyword_outside = 397, - eCSSKeyword_over = 398, - eCSSKeyword_overlay = 399, - eCSSKeyword_overline = 400, - eCSSKeyword_paint = 401, - eCSSKeyword_padding_box = 402, - eCSSKeyword_painted = 403, - eCSSKeyword_pan_x = 404, - eCSSKeyword_pan_y = 405, - eCSSKeyword_paused = 406, - eCSSKeyword_pc = 407, - eCSSKeyword_perspective = 408, - eCSSKeyword_petite_caps = 409, - eCSSKeyword_physical = 410, - eCSSKeyword_plaintext = 411, - eCSSKeyword_pointer = 412, - eCSSKeyword_polygon = 413, - eCSSKeyword_portrait = 414, - eCSSKeyword_pre = 415, - eCSSKeyword_pre_wrap = 416, - eCSSKeyword_pre_line = 417, - eCSSKeyword_preserve_3d = 418, - eCSSKeyword_progress = 419, - eCSSKeyword_progressive = 420, - eCSSKeyword_proportional_nums = 421, - eCSSKeyword_proportional_width = 422, - eCSSKeyword_proximity = 423, - eCSSKeyword_pt = 424, - eCSSKeyword_px = 425, - eCSSKeyword_rad = 426, - eCSSKeyword_read_only = 427, - eCSSKeyword_read_write = 428, - eCSSKeyword_relative = 429, - eCSSKeyword_repeat = 430, - eCSSKeyword_repeat_x = 431, - eCSSKeyword_repeat_y = 432, - eCSSKeyword_reverse = 433, - eCSSKeyword_ridge = 434, - eCSSKeyword_right = 435, - eCSSKeyword_rl = 436, - eCSSKeyword_rl_tb = 437, - eCSSKeyword_rotate = 438, - eCSSKeyword_rotate3d = 439, - eCSSKeyword_rotatex = 440, - eCSSKeyword_rotatey = 441, - eCSSKeyword_rotatez = 442, - eCSSKeyword_round = 443, - eCSSKeyword_row = 444, - eCSSKeyword_row_resize = 445, - eCSSKeyword_row_reverse = 446, - eCSSKeyword_rtl = 447, - eCSSKeyword_ruby = 448, - eCSSKeyword_ruby_base = 449, - eCSSKeyword_ruby_base_container = 450, - eCSSKeyword_ruby_text = 451, - eCSSKeyword_ruby_text_container = 452, - eCSSKeyword_running = 453, - eCSSKeyword_s = 454, - eCSSKeyword_s_resize = 455, - eCSSKeyword_safe = 456, - eCSSKeyword_saturate = 457, - eCSSKeyword_saturation = 458, - eCSSKeyword_scale = 459, - eCSSKeyword_scale_down = 460, - eCSSKeyword_scale3d = 461, - eCSSKeyword_scalex = 462, - eCSSKeyword_scaley = 463, - eCSSKeyword_scalez = 464, - eCSSKeyword_screen = 465, - eCSSKeyword_script = 466, - eCSSKeyword_scroll = 467, - eCSSKeyword_scrollbar = 468, - eCSSKeyword_scrollbar_small = 469, - eCSSKeyword_scrollbar_horizontal = 470, - eCSSKeyword_scrollbar_vertical = 471, - eCSSKeyword_se_resize = 472, - eCSSKeyword_select_after = 473, - eCSSKeyword_select_all = 474, - eCSSKeyword_select_before = 475, - eCSSKeyword_select_menu = 476, - eCSSKeyword_select_same = 477, - eCSSKeyword_self_end = 478, - eCSSKeyword_self_start = 479, - eCSSKeyword_semi_condensed = 480, - eCSSKeyword_semi_expanded = 481, - eCSSKeyword_separate = 482, - eCSSKeyword_sepia = 483, - eCSSKeyword_serif = 484, - eCSSKeyword_sesame = 485, - eCSSKeyword_show = 486, - eCSSKeyword_sideways = 487, - eCSSKeyword_sideways_lr = 488, - eCSSKeyword_sideways_right = 489, - eCSSKeyword_sideways_rl = 490, - eCSSKeyword_simp_chinese_formal = 491, - eCSSKeyword_simp_chinese_informal = 492, - eCSSKeyword_simplified = 493, - eCSSKeyword_skew = 494, - eCSSKeyword_skewx = 495, - eCSSKeyword_skewy = 496, - eCSSKeyword_slashed_zero = 497, - eCSSKeyword_slice = 498, - eCSSKeyword_small = 499, - eCSSKeyword_small_caps = 500, - eCSSKeyword_small_caption = 501, - eCSSKeyword_smaller = 502, - eCSSKeyword_smooth = 503, - eCSSKeyword_soft = 504, - eCSSKeyword_soft_light = 505, - eCSSKeyword_solid = 506, - eCSSKeyword_space_around = 507, - eCSSKeyword_space_between = 508, - eCSSKeyword_space_evenly = 509, - eCSSKeyword_span = 510, - eCSSKeyword_spell_out = 511, - eCSSKeyword_square = 512, - eCSSKeyword_stacked_fractions = 513, - eCSSKeyword_start = 514, - eCSSKeyword_static = 515, - eCSSKeyword_standalone = 516, - eCSSKeyword_status_bar = 517, - eCSSKeyword_step_end = 518, - eCSSKeyword_step_start = 519, - eCSSKeyword_sticky = 520, - eCSSKeyword_stretch = 521, - eCSSKeyword_stretch_to_fit = 522, - eCSSKeyword_stretched = 523, - eCSSKeyword_strict = 524, - eCSSKeyword_stroke = 525, - eCSSKeyword_stroke_box = 526, - eCSSKeyword_style = 527, - eCSSKeyword_styleset = 528, - eCSSKeyword_stylistic = 529, - eCSSKeyword_sub = 530, - eCSSKeyword_subgrid = 531, - eCSSKeyword_subtract = 532, - eCSSKeyword_super = 533, - eCSSKeyword_sw_resize = 534, - eCSSKeyword_swash = 535, - eCSSKeyword_swap = 536, - eCSSKeyword_table = 537, - eCSSKeyword_table_caption = 538, - eCSSKeyword_table_cell = 539, - eCSSKeyword_table_column = 540, - eCSSKeyword_table_column_group = 541, - eCSSKeyword_table_footer_group = 542, - eCSSKeyword_table_header_group = 543, - eCSSKeyword_table_row = 544, - eCSSKeyword_table_row_group = 545, - eCSSKeyword_tabular_nums = 546, - eCSSKeyword_tailed = 547, - eCSSKeyword_tb = 548, - eCSSKeyword_tb_rl = 549, - eCSSKeyword_text = 550, - eCSSKeyword_text_bottom = 551, - eCSSKeyword_text_top = 552, - eCSSKeyword_thick = 553, - eCSSKeyword_thin = 554, - eCSSKeyword_threeddarkshadow = 555, - eCSSKeyword_threedface = 556, - eCSSKeyword_threedhighlight = 557, - eCSSKeyword_threedlightshadow = 558, - eCSSKeyword_threedshadow = 559, - eCSSKeyword_titling_caps = 560, - eCSSKeyword_toggle = 561, - eCSSKeyword_top = 562, - eCSSKeyword_top_outside = 563, - eCSSKeyword_trad_chinese_formal = 564, - eCSSKeyword_trad_chinese_informal = 565, - eCSSKeyword_traditional = 566, - eCSSKeyword_translate = 567, - eCSSKeyword_translate3d = 568, - eCSSKeyword_translatex = 569, - eCSSKeyword_translatey = 570, - eCSSKeyword_translatez = 571, - eCSSKeyword_transparent = 572, - eCSSKeyword_triangle = 573, - eCSSKeyword_tri_state = 574, - eCSSKeyword_ultra_condensed = 575, - eCSSKeyword_ultra_expanded = 576, - eCSSKeyword_under = 577, - eCSSKeyword_underline = 578, - eCSSKeyword_unicase = 579, - eCSSKeyword_unsafe = 580, - eCSSKeyword_unset = 581, - eCSSKeyword_uppercase = 582, - eCSSKeyword_upright = 583, - eCSSKeyword_vertical = 584, - eCSSKeyword_vertical_lr = 585, - eCSSKeyword_vertical_rl = 586, - eCSSKeyword_vertical_text = 587, - eCSSKeyword_view_box = 588, - eCSSKeyword_visible = 589, - eCSSKeyword_visiblefill = 590, - eCSSKeyword_visiblepainted = 591, - eCSSKeyword_visiblestroke = 592, - eCSSKeyword_w_resize = 593, - eCSSKeyword_wait = 594, - eCSSKeyword_wavy = 595, - eCSSKeyword_weight = 596, - eCSSKeyword_wider = 597, - eCSSKeyword_window = 598, - eCSSKeyword_windowframe = 599, - eCSSKeyword_windowtext = 600, - eCSSKeyword_words = 601, - eCSSKeyword_wrap = 602, - eCSSKeyword_wrap_reverse = 603, - eCSSKeyword_write_only = 604, - eCSSKeyword_x_large = 605, - eCSSKeyword_x_small = 606, - eCSSKeyword_xx_large = 607, - eCSSKeyword_xx_small = 608, - eCSSKeyword_zoom_in = 609, - eCSSKeyword_zoom_out = 610, - eCSSKeyword_radio = 611, - eCSSKeyword_checkbox = 612, - eCSSKeyword_button_bevel = 613, - eCSSKeyword_toolbox = 614, - eCSSKeyword_toolbar = 615, - eCSSKeyword_toolbarbutton = 616, - eCSSKeyword_toolbargripper = 617, - eCSSKeyword_dualbutton = 618, - eCSSKeyword_toolbarbutton_dropdown = 619, - eCSSKeyword_button_arrow_up = 620, - eCSSKeyword_button_arrow_down = 621, - eCSSKeyword_button_arrow_next = 622, - eCSSKeyword_button_arrow_previous = 623, - eCSSKeyword_separator = 624, - eCSSKeyword_splitter = 625, - eCSSKeyword_statusbar = 626, - eCSSKeyword_statusbarpanel = 627, - eCSSKeyword_resizerpanel = 628, - eCSSKeyword_resizer = 629, - eCSSKeyword_listbox = 630, - eCSSKeyword_listitem = 631, - eCSSKeyword_numbers = 632, - eCSSKeyword_number_input = 633, - eCSSKeyword_treeview = 634, - eCSSKeyword_treeitem = 635, - eCSSKeyword_treetwisty = 636, - eCSSKeyword_treetwistyopen = 637, - eCSSKeyword_treeline = 638, - eCSSKeyword_treeheader = 639, - eCSSKeyword_treeheadercell = 640, - eCSSKeyword_treeheadersortarrow = 641, - eCSSKeyword_progressbar = 642, - eCSSKeyword_progressbar_vertical = 643, - eCSSKeyword_progresschunk = 644, - eCSSKeyword_progresschunk_vertical = 645, - eCSSKeyword_tab = 646, - eCSSKeyword_tabpanels = 647, - eCSSKeyword_tabpanel = 648, - eCSSKeyword_tab_scroll_arrow_back = 649, - eCSSKeyword_tab_scroll_arrow_forward = 650, - eCSSKeyword_tooltip = 651, - eCSSKeyword_spinner = 652, - eCSSKeyword_spinner_upbutton = 653, - eCSSKeyword_spinner_downbutton = 654, - eCSSKeyword_spinner_textfield = 655, - eCSSKeyword_scrollbarbutton_up = 656, - eCSSKeyword_scrollbarbutton_down = 657, - eCSSKeyword_scrollbarbutton_left = 658, - eCSSKeyword_scrollbarbutton_right = 659, - eCSSKeyword_scrollbartrack_horizontal = 660, - eCSSKeyword_scrollbartrack_vertical = 661, - eCSSKeyword_scrollbarthumb_horizontal = 662, - eCSSKeyword_scrollbarthumb_vertical = 663, - eCSSKeyword_sheet = 664, - eCSSKeyword_textfield = 665, - eCSSKeyword_textfield_multiline = 666, - eCSSKeyword_caret = 667, - eCSSKeyword_searchfield = 668, - eCSSKeyword_menubar = 669, - eCSSKeyword_menupopup = 670, - eCSSKeyword_menuitem = 671, - eCSSKeyword_checkmenuitem = 672, - eCSSKeyword_radiomenuitem = 673, - eCSSKeyword_menucheckbox = 674, - eCSSKeyword_menuradio = 675, - eCSSKeyword_menuseparator = 676, - eCSSKeyword_menuarrow = 677, - eCSSKeyword_menuimage = 678, - eCSSKeyword_menuitemtext = 679, - eCSSKeyword_menulist = 680, - eCSSKeyword_menulist_button = 681, - eCSSKeyword_menulist_text = 682, - eCSSKeyword_menulist_textfield = 683, - eCSSKeyword_meterbar = 684, - eCSSKeyword_meterchunk = 685, - eCSSKeyword_minimal_ui = 686, - eCSSKeyword_range = 687, - eCSSKeyword_range_thumb = 688, - eCSSKeyword_sans_serif = 689, - eCSSKeyword_sans_serif_bold_italic = 690, - eCSSKeyword_sans_serif_italic = 691, - eCSSKeyword_scale_horizontal = 692, - eCSSKeyword_scale_vertical = 693, - eCSSKeyword_scalethumb_horizontal = 694, - eCSSKeyword_scalethumb_vertical = 695, - eCSSKeyword_scalethumbstart = 696, - eCSSKeyword_scalethumbend = 697, - eCSSKeyword_scalethumbtick = 698, - eCSSKeyword_groupbox = 699, - eCSSKeyword_checkbox_container = 700, - eCSSKeyword_radio_container = 701, - eCSSKeyword_checkbox_label = 702, - eCSSKeyword_radio_label = 703, - eCSSKeyword_button_focus = 704, - eCSSKeyword__moz_win_media_toolbox = 705, - eCSSKeyword__moz_win_communications_toolbox = 706, - eCSSKeyword__moz_win_browsertabbar_toolbox = 707, - eCSSKeyword__moz_win_mediatext = 708, - eCSSKeyword__moz_win_communicationstext = 709, - eCSSKeyword__moz_win_glass = 710, - eCSSKeyword__moz_win_borderless_glass = 711, - eCSSKeyword__moz_window_titlebar = 712, - eCSSKeyword__moz_window_titlebar_maximized = 713, - eCSSKeyword__moz_window_frame_left = 714, - eCSSKeyword__moz_window_frame_right = 715, - eCSSKeyword__moz_window_frame_bottom = 716, - eCSSKeyword__moz_window_button_close = 717, - eCSSKeyword__moz_window_button_minimize = 718, - eCSSKeyword__moz_window_button_maximize = 719, - eCSSKeyword__moz_window_button_restore = 720, - eCSSKeyword__moz_window_button_box = 721, - eCSSKeyword__moz_window_button_box_maximized = 722, - eCSSKeyword__moz_mac_help_button = 723, - eCSSKeyword__moz_win_exclude_glass = 724, - eCSSKeyword__moz_mac_vibrancy_light = 725, - eCSSKeyword__moz_mac_vibrancy_dark = 726, - eCSSKeyword__moz_mac_disclosure_button_closed = 727, - eCSSKeyword__moz_mac_disclosure_button_open = 728, - eCSSKeyword__moz_mac_source_list = 729, - eCSSKeyword__moz_mac_source_list_selection = 730, - eCSSKeyword__moz_mac_active_source_list_selection = 731, - eCSSKeyword_alphabetic = 732, - eCSSKeyword_bevel = 733, - eCSSKeyword_butt = 734, - eCSSKeyword_central = 735, - eCSSKeyword_crispedges = 736, - eCSSKeyword_evenodd = 737, - eCSSKeyword_geometricprecision = 738, - eCSSKeyword_hanging = 739, - eCSSKeyword_ideographic = 740, - eCSSKeyword_linearrgb = 741, - eCSSKeyword_mathematical = 742, - eCSSKeyword_miter = 743, - eCSSKeyword_no_change = 744, - eCSSKeyword_non_scaling_stroke = 745, - eCSSKeyword_nonzero = 746, - eCSSKeyword_optimizelegibility = 747, - eCSSKeyword_optimizequality = 748, - eCSSKeyword_optimizespeed = 749, - eCSSKeyword_reset_size = 750, - eCSSKeyword_srgb = 751, - eCSSKeyword_symbolic = 752, - eCSSKeyword_symbols = 753, - eCSSKeyword_text_after_edge = 754, - eCSSKeyword_text_before_edge = 755, - eCSSKeyword_use_script = 756, - eCSSKeyword__moz_crisp_edges = 757, - eCSSKeyword_space = 758, - eCSSKeyword_COUNT = 759, + eCSSKeyword_ignore_horizontal = 277, + eCSSKeyword_ignore_vertical = 278, + eCSSKeyword_in = 279, + eCSSKeyword_interlace = 280, + eCSSKeyword_inactive = 281, + eCSSKeyword_inactiveborder = 282, + eCSSKeyword_inactivecaption = 283, + eCSSKeyword_inactivecaptiontext = 284, + eCSSKeyword_infinite = 285, + eCSSKeyword_infobackground = 286, + eCSSKeyword_infotext = 287, + eCSSKeyword_inherit = 288, + eCSSKeyword_initial = 289, + eCSSKeyword_inline = 290, + eCSSKeyword_inline_axis = 291, + eCSSKeyword_inline_block = 292, + eCSSKeyword_inline_end = 293, + eCSSKeyword_inline_flex = 294, + eCSSKeyword_inline_grid = 295, + eCSSKeyword_inline_start = 296, + eCSSKeyword_inline_table = 297, + eCSSKeyword_inset = 298, + eCSSKeyword_inside = 299, + eCSSKeyword_inter_character = 300, + eCSSKeyword_inter_word = 301, + eCSSKeyword_interpolatematrix = 302, + eCSSKeyword_accumulatematrix = 303, + eCSSKeyword_intersect = 304, + eCSSKeyword_isolate = 305, + eCSSKeyword_isolate_override = 306, + eCSSKeyword_invert = 307, + eCSSKeyword_italic = 308, + eCSSKeyword_japanese_formal = 309, + eCSSKeyword_japanese_informal = 310, + eCSSKeyword_jis78 = 311, + eCSSKeyword_jis83 = 312, + eCSSKeyword_jis90 = 313, + eCSSKeyword_jis04 = 314, + eCSSKeyword_justify = 315, + eCSSKeyword_keep_all = 316, + eCSSKeyword_khz = 317, + eCSSKeyword_korean_hangul_formal = 318, + eCSSKeyword_korean_hanja_formal = 319, + eCSSKeyword_korean_hanja_informal = 320, + eCSSKeyword_landscape = 321, + eCSSKeyword_large = 322, + eCSSKeyword_larger = 323, + eCSSKeyword_last = 324, + eCSSKeyword_last_baseline = 325, + eCSSKeyword_layout = 326, + eCSSKeyword_left = 327, + eCSSKeyword_legacy = 328, + eCSSKeyword_lighten = 329, + eCSSKeyword_lighter = 330, + eCSSKeyword_line_through = 331, + eCSSKeyword_linear = 332, + eCSSKeyword_lining_nums = 333, + eCSSKeyword_list_item = 334, + eCSSKeyword_local = 335, + eCSSKeyword_logical = 336, + eCSSKeyword_looped = 337, + eCSSKeyword_lowercase = 338, + eCSSKeyword_lr = 339, + eCSSKeyword_lr_tb = 340, + eCSSKeyword_ltr = 341, + eCSSKeyword_luminance = 342, + eCSSKeyword_luminosity = 343, + eCSSKeyword_mandatory = 344, + eCSSKeyword_manipulation = 345, + eCSSKeyword_manual = 346, + eCSSKeyword_margin_box = 347, + eCSSKeyword_markers = 348, + eCSSKeyword_match_parent = 349, + eCSSKeyword_match_source = 350, + eCSSKeyword_matrix = 351, + eCSSKeyword_matrix3d = 352, + eCSSKeyword_max_content = 353, + eCSSKeyword_medium = 354, + eCSSKeyword_menu = 355, + eCSSKeyword_menutext = 356, + eCSSKeyword_message_box = 357, + eCSSKeyword_middle = 358, + eCSSKeyword_min_content = 359, + eCSSKeyword_minmax = 360, + eCSSKeyword_mix = 361, + eCSSKeyword_mixed = 362, + eCSSKeyword_mm = 363, + eCSSKeyword_monospace = 364, + eCSSKeyword_move = 365, + eCSSKeyword_ms = 366, + eCSSKeyword_multiply = 367, + eCSSKeyword_n_resize = 368, + eCSSKeyword_narrower = 369, + eCSSKeyword_ne_resize = 370, + eCSSKeyword_nesw_resize = 371, + eCSSKeyword_no_clip = 372, + eCSSKeyword_no_close_quote = 373, + eCSSKeyword_no_common_ligatures = 374, + eCSSKeyword_no_contextual = 375, + eCSSKeyword_no_discretionary_ligatures = 376, + eCSSKeyword_no_drag = 377, + eCSSKeyword_no_drop = 378, + eCSSKeyword_no_historical_ligatures = 379, + eCSSKeyword_no_open_quote = 380, + eCSSKeyword_no_repeat = 381, + eCSSKeyword_none = 382, + eCSSKeyword_normal = 383, + eCSSKeyword_not_allowed = 384, + eCSSKeyword_nowrap = 385, + eCSSKeyword_numeric = 386, + eCSSKeyword_ns_resize = 387, + eCSSKeyword_nw_resize = 388, + eCSSKeyword_nwse_resize = 389, + eCSSKeyword_oblique = 390, + eCSSKeyword_oldstyle_nums = 391, + eCSSKeyword_opacity = 392, + eCSSKeyword_open = 393, + eCSSKeyword_open_quote = 394, + eCSSKeyword_optional = 395, + eCSSKeyword_ordinal = 396, + eCSSKeyword_ornaments = 397, + eCSSKeyword_outset = 398, + eCSSKeyword_outside = 399, + eCSSKeyword_over = 400, + eCSSKeyword_overlay = 401, + eCSSKeyword_overline = 402, + eCSSKeyword_paint = 403, + eCSSKeyword_padding_box = 404, + eCSSKeyword_painted = 405, + eCSSKeyword_pan_x = 406, + eCSSKeyword_pan_y = 407, + eCSSKeyword_paused = 408, + eCSSKeyword_pc = 409, + eCSSKeyword_perspective = 410, + eCSSKeyword_petite_caps = 411, + eCSSKeyword_physical = 412, + eCSSKeyword_plaintext = 413, + eCSSKeyword_pointer = 414, + eCSSKeyword_polygon = 415, + eCSSKeyword_portrait = 416, + eCSSKeyword_pre = 417, + eCSSKeyword_pre_wrap = 418, + eCSSKeyword_pre_line = 419, + eCSSKeyword_preserve_3d = 420, + eCSSKeyword_progress = 421, + eCSSKeyword_progressive = 422, + eCSSKeyword_proportional_nums = 423, + eCSSKeyword_proportional_width = 424, + eCSSKeyword_proximity = 425, + eCSSKeyword_pt = 426, + eCSSKeyword_px = 427, + eCSSKeyword_rad = 428, + eCSSKeyword_read_only = 429, + eCSSKeyword_read_write = 430, + eCSSKeyword_relative = 431, + eCSSKeyword_repeat = 432, + eCSSKeyword_repeat_x = 433, + eCSSKeyword_repeat_y = 434, + eCSSKeyword_reverse = 435, + eCSSKeyword_ridge = 436, + eCSSKeyword_right = 437, + eCSSKeyword_rl = 438, + eCSSKeyword_rl_tb = 439, + eCSSKeyword_rotate = 440, + eCSSKeyword_rotate3d = 441, + eCSSKeyword_rotatex = 442, + eCSSKeyword_rotatey = 443, + eCSSKeyword_rotatez = 444, + eCSSKeyword_round = 445, + eCSSKeyword_row = 446, + eCSSKeyword_row_resize = 447, + eCSSKeyword_row_reverse = 448, + eCSSKeyword_rtl = 449, + eCSSKeyword_ruby = 450, + eCSSKeyword_ruby_base = 451, + eCSSKeyword_ruby_base_container = 452, + eCSSKeyword_ruby_text = 453, + eCSSKeyword_ruby_text_container = 454, + eCSSKeyword_running = 455, + eCSSKeyword_s = 456, + eCSSKeyword_s_resize = 457, + eCSSKeyword_safe = 458, + eCSSKeyword_saturate = 459, + eCSSKeyword_saturation = 460, + eCSSKeyword_scale = 461, + eCSSKeyword_scale_down = 462, + eCSSKeyword_scale3d = 463, + eCSSKeyword_scalex = 464, + eCSSKeyword_scaley = 465, + eCSSKeyword_scalez = 466, + eCSSKeyword_screen = 467, + eCSSKeyword_script = 468, + eCSSKeyword_scroll = 469, + eCSSKeyword_scrollbar = 470, + eCSSKeyword_scrollbar_small = 471, + eCSSKeyword_scrollbar_horizontal = 472, + eCSSKeyword_scrollbar_vertical = 473, + eCSSKeyword_se_resize = 474, + eCSSKeyword_select_after = 475, + eCSSKeyword_select_all = 476, + eCSSKeyword_select_before = 477, + eCSSKeyword_select_menu = 478, + eCSSKeyword_select_same = 479, + eCSSKeyword_self_end = 480, + eCSSKeyword_self_start = 481, + eCSSKeyword_semi_condensed = 482, + eCSSKeyword_semi_expanded = 483, + eCSSKeyword_separate = 484, + eCSSKeyword_sepia = 485, + eCSSKeyword_serif = 486, + eCSSKeyword_sesame = 487, + eCSSKeyword_show = 488, + eCSSKeyword_sideways = 489, + eCSSKeyword_sideways_lr = 490, + eCSSKeyword_sideways_right = 491, + eCSSKeyword_sideways_rl = 492, + eCSSKeyword_simp_chinese_formal = 493, + eCSSKeyword_simp_chinese_informal = 494, + eCSSKeyword_simplified = 495, + eCSSKeyword_skew = 496, + eCSSKeyword_skewx = 497, + eCSSKeyword_skewy = 498, + eCSSKeyword_slashed_zero = 499, + eCSSKeyword_slice = 500, + eCSSKeyword_small = 501, + eCSSKeyword_small_caps = 502, + eCSSKeyword_small_caption = 503, + eCSSKeyword_smaller = 504, + eCSSKeyword_smooth = 505, + eCSSKeyword_soft = 506, + eCSSKeyword_soft_light = 507, + eCSSKeyword_solid = 508, + eCSSKeyword_space_around = 509, + eCSSKeyword_space_between = 510, + eCSSKeyword_space_evenly = 511, + eCSSKeyword_span = 512, + eCSSKeyword_spell_out = 513, + eCSSKeyword_square = 514, + eCSSKeyword_stacked_fractions = 515, + eCSSKeyword_start = 516, + eCSSKeyword_static = 517, + eCSSKeyword_standalone = 518, + eCSSKeyword_status_bar = 519, + eCSSKeyword_step_end = 520, + eCSSKeyword_step_start = 521, + eCSSKeyword_sticky = 522, + eCSSKeyword_stretch = 523, + eCSSKeyword_stretch_to_fit = 524, + eCSSKeyword_stretched = 525, + eCSSKeyword_strict = 526, + eCSSKeyword_stroke = 527, + eCSSKeyword_stroke_box = 528, + eCSSKeyword_style = 529, + eCSSKeyword_styleset = 530, + eCSSKeyword_stylistic = 531, + eCSSKeyword_sub = 532, + eCSSKeyword_subgrid = 533, + eCSSKeyword_subtract = 534, + eCSSKeyword_super = 535, + eCSSKeyword_sw_resize = 536, + eCSSKeyword_swash = 537, + eCSSKeyword_swap = 538, + eCSSKeyword_table = 539, + eCSSKeyword_table_caption = 540, + eCSSKeyword_table_cell = 541, + eCSSKeyword_table_column = 542, + eCSSKeyword_table_column_group = 543, + eCSSKeyword_table_footer_group = 544, + eCSSKeyword_table_header_group = 545, + eCSSKeyword_table_row = 546, + eCSSKeyword_table_row_group = 547, + eCSSKeyword_tabular_nums = 548, + eCSSKeyword_tailed = 549, + eCSSKeyword_tb = 550, + eCSSKeyword_tb_rl = 551, + eCSSKeyword_text = 552, + eCSSKeyword_text_bottom = 553, + eCSSKeyword_text_top = 554, + eCSSKeyword_thick = 555, + eCSSKeyword_thin = 556, + eCSSKeyword_threeddarkshadow = 557, + eCSSKeyword_threedface = 558, + eCSSKeyword_threedhighlight = 559, + eCSSKeyword_threedlightshadow = 560, + eCSSKeyword_threedshadow = 561, + eCSSKeyword_titling_caps = 562, + eCSSKeyword_toggle = 563, + eCSSKeyword_top = 564, + eCSSKeyword_top_outside = 565, + eCSSKeyword_trad_chinese_formal = 566, + eCSSKeyword_trad_chinese_informal = 567, + eCSSKeyword_traditional = 568, + eCSSKeyword_translate = 569, + eCSSKeyword_translate3d = 570, + eCSSKeyword_translatex = 571, + eCSSKeyword_translatey = 572, + eCSSKeyword_translatez = 573, + eCSSKeyword_transparent = 574, + eCSSKeyword_triangle = 575, + eCSSKeyword_tri_state = 576, + eCSSKeyword_ultra_condensed = 577, + eCSSKeyword_ultra_expanded = 578, + eCSSKeyword_under = 579, + eCSSKeyword_underline = 580, + eCSSKeyword_unicase = 581, + eCSSKeyword_unsafe = 582, + eCSSKeyword_unset = 583, + eCSSKeyword_uppercase = 584, + eCSSKeyword_upright = 585, + eCSSKeyword_vertical = 586, + eCSSKeyword_vertical_lr = 587, + eCSSKeyword_vertical_rl = 588, + eCSSKeyword_vertical_text = 589, + eCSSKeyword_view_box = 590, + eCSSKeyword_visible = 591, + eCSSKeyword_visiblefill = 592, + eCSSKeyword_visiblepainted = 593, + eCSSKeyword_visiblestroke = 594, + eCSSKeyword_w_resize = 595, + eCSSKeyword_wait = 596, + eCSSKeyword_wavy = 597, + eCSSKeyword_weight = 598, + eCSSKeyword_wider = 599, + eCSSKeyword_window = 600, + eCSSKeyword_windowframe = 601, + eCSSKeyword_windowtext = 602, + eCSSKeyword_words = 603, + eCSSKeyword_wrap = 604, + eCSSKeyword_wrap_reverse = 605, + eCSSKeyword_write_only = 606, + eCSSKeyword_x_large = 607, + eCSSKeyword_x_small = 608, + eCSSKeyword_xx_large = 609, + eCSSKeyword_xx_small = 610, + eCSSKeyword_zoom_in = 611, + eCSSKeyword_zoom_out = 612, + eCSSKeyword_radio = 613, + eCSSKeyword_checkbox = 614, + eCSSKeyword_button_bevel = 615, + eCSSKeyword_toolbox = 616, + eCSSKeyword_toolbar = 617, + eCSSKeyword_toolbarbutton = 618, + eCSSKeyword_toolbargripper = 619, + eCSSKeyword_dualbutton = 620, + eCSSKeyword_toolbarbutton_dropdown = 621, + eCSSKeyword_button_arrow_up = 622, + eCSSKeyword_button_arrow_down = 623, + eCSSKeyword_button_arrow_next = 624, + eCSSKeyword_button_arrow_previous = 625, + eCSSKeyword_separator = 626, + eCSSKeyword_splitter = 627, + eCSSKeyword_statusbar = 628, + eCSSKeyword_statusbarpanel = 629, + eCSSKeyword_resizerpanel = 630, + eCSSKeyword_resizer = 631, + eCSSKeyword_listbox = 632, + eCSSKeyword_listitem = 633, + eCSSKeyword_numbers = 634, + eCSSKeyword_number_input = 635, + eCSSKeyword_treeview = 636, + eCSSKeyword_treeitem = 637, + eCSSKeyword_treetwisty = 638, + eCSSKeyword_treetwistyopen = 639, + eCSSKeyword_treeline = 640, + eCSSKeyword_treeheader = 641, + eCSSKeyword_treeheadercell = 642, + eCSSKeyword_treeheadersortarrow = 643, + eCSSKeyword_progressbar = 644, + eCSSKeyword_progressbar_vertical = 645, + eCSSKeyword_progresschunk = 646, + eCSSKeyword_progresschunk_vertical = 647, + eCSSKeyword_tab = 648, + eCSSKeyword_tabpanels = 649, + eCSSKeyword_tabpanel = 650, + eCSSKeyword_tab_scroll_arrow_back = 651, + eCSSKeyword_tab_scroll_arrow_forward = 652, + eCSSKeyword_tooltip = 653, + eCSSKeyword_spinner = 654, + eCSSKeyword_spinner_upbutton = 655, + eCSSKeyword_spinner_downbutton = 656, + eCSSKeyword_spinner_textfield = 657, + eCSSKeyword_scrollbarbutton_up = 658, + eCSSKeyword_scrollbarbutton_down = 659, + eCSSKeyword_scrollbarbutton_left = 660, + eCSSKeyword_scrollbarbutton_right = 661, + eCSSKeyword_scrollbartrack_horizontal = 662, + eCSSKeyword_scrollbartrack_vertical = 663, + eCSSKeyword_scrollbarthumb_horizontal = 664, + eCSSKeyword_scrollbarthumb_vertical = 665, + eCSSKeyword_sheet = 666, + eCSSKeyword_textfield = 667, + eCSSKeyword_textfield_multiline = 668, + eCSSKeyword_caret = 669, + eCSSKeyword_searchfield = 670, + eCSSKeyword_menubar = 671, + eCSSKeyword_menupopup = 672, + eCSSKeyword_menuitem = 673, + eCSSKeyword_checkmenuitem = 674, + eCSSKeyword_radiomenuitem = 675, + eCSSKeyword_menucheckbox = 676, + eCSSKeyword_menuradio = 677, + eCSSKeyword_menuseparator = 678, + eCSSKeyword_menuarrow = 679, + eCSSKeyword_menuimage = 680, + eCSSKeyword_menuitemtext = 681, + eCSSKeyword_menulist = 682, + eCSSKeyword_menulist_button = 683, + eCSSKeyword_menulist_text = 684, + eCSSKeyword_menulist_textfield = 685, + eCSSKeyword_meterbar = 686, + eCSSKeyword_meterchunk = 687, + eCSSKeyword_minimal_ui = 688, + eCSSKeyword_range = 689, + eCSSKeyword_range_thumb = 690, + eCSSKeyword_sans_serif = 691, + eCSSKeyword_sans_serif_bold_italic = 692, + eCSSKeyword_sans_serif_italic = 693, + eCSSKeyword_scale_horizontal = 694, + eCSSKeyword_scale_vertical = 695, + eCSSKeyword_scalethumb_horizontal = 696, + eCSSKeyword_scalethumb_vertical = 697, + eCSSKeyword_scalethumbstart = 698, + eCSSKeyword_scalethumbend = 699, + eCSSKeyword_scalethumbtick = 700, + eCSSKeyword_groupbox = 701, + eCSSKeyword_checkbox_container = 702, + eCSSKeyword_radio_container = 703, + eCSSKeyword_checkbox_label = 704, + eCSSKeyword_radio_label = 705, + eCSSKeyword_button_focus = 706, + eCSSKeyword__moz_win_media_toolbox = 707, + eCSSKeyword__moz_win_communications_toolbox = 708, + eCSSKeyword__moz_win_browsertabbar_toolbox = 709, + eCSSKeyword__moz_win_mediatext = 710, + eCSSKeyword__moz_win_communicationstext = 711, + eCSSKeyword__moz_win_glass = 712, + eCSSKeyword__moz_win_borderless_glass = 713, + eCSSKeyword__moz_window_titlebar = 714, + eCSSKeyword__moz_window_titlebar_maximized = 715, + eCSSKeyword__moz_window_frame_left = 716, + eCSSKeyword__moz_window_frame_right = 717, + eCSSKeyword__moz_window_frame_bottom = 718, + eCSSKeyword__moz_window_button_close = 719, + eCSSKeyword__moz_window_button_minimize = 720, + eCSSKeyword__moz_window_button_maximize = 721, + eCSSKeyword__moz_window_button_restore = 722, + eCSSKeyword__moz_window_button_box = 723, + eCSSKeyword__moz_window_button_box_maximized = 724, + eCSSKeyword__moz_mac_help_button = 725, + eCSSKeyword__moz_win_exclude_glass = 726, + eCSSKeyword__moz_mac_vibrancy_light = 727, + eCSSKeyword__moz_mac_vibrancy_dark = 728, + eCSSKeyword__moz_mac_disclosure_button_closed = 729, + eCSSKeyword__moz_mac_disclosure_button_open = 730, + eCSSKeyword__moz_mac_source_list = 731, + eCSSKeyword__moz_mac_source_list_selection = 732, + eCSSKeyword__moz_mac_active_source_list_selection = 733, + eCSSKeyword_alphabetic = 734, + eCSSKeyword_bevel = 735, + eCSSKeyword_butt = 736, + eCSSKeyword_central = 737, + eCSSKeyword_crispedges = 738, + eCSSKeyword_evenodd = 739, + eCSSKeyword_geometricprecision = 740, + eCSSKeyword_hanging = 741, + eCSSKeyword_ideographic = 742, + eCSSKeyword_linearrgb = 743, + eCSSKeyword_mathematical = 744, + eCSSKeyword_miter = 745, + eCSSKeyword_no_change = 746, + eCSSKeyword_non_scaling_stroke = 747, + eCSSKeyword_nonzero = 748, + eCSSKeyword_optimizelegibility = 749, + eCSSKeyword_optimizequality = 750, + eCSSKeyword_optimizespeed = 751, + eCSSKeyword_reset_size = 752, + eCSSKeyword_srgb = 753, + eCSSKeyword_symbolic = 754, + eCSSKeyword_symbols = 755, + eCSSKeyword_text_after_edge = 756, + eCSSKeyword_text_before_edge = 757, + eCSSKeyword_use_script = 758, + eCSSKeyword__moz_crisp_edges = 759, + eCSSKeyword_space = 760, + eCSSKeyword_COUNT = 761, } pub const nsCSSPropertyID_eCSSProperty_COUNT_no_shorthands: root::nsCSSPropertyID = @@ -28679,7 +28710,7 @@ pub mod root { ) , "::" , stringify ! ( mQuotePairs ) )); } #[test] - fn __bindgen_test_layout_StaticRefPtr_instantiation_151733() { + fn __bindgen_test_layout_StaticRefPtr_instantiation_152716() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -30777,6 +30808,11 @@ pub mod root { pub struct RawServoAnimationValue { _unused: [u8; 0], } + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct nsCSSPropertyIDSet { + _unused: [u8; 0], + } pub type RawGeckoNode = root::nsINode; pub type RawGeckoElement = root::mozilla::dom::Element; pub type RawGeckoDocument = root::nsIDocument; @@ -30796,6 +30832,8 @@ pub mod root { pub type RawGeckoComputedTiming = root::mozilla::ComputedTiming; pub type RawGeckoServoStyleRuleList = root::nsTArray<*const root::RawServoStyleRule>; + pub type RawGeckoCSSPropertyIDList = + root::nsTArray; pub type RawServoAnimationValueMapBorrowedMut = *mut root::RawServoAnimationValueMap; pub type RawGeckoNodeBorrowed = *const root::RawGeckoNode; @@ -30824,6 +30862,8 @@ pub mod root { *const root::RawGeckoComputedTiming; pub type RawGeckoServoStyleRuleListBorrowedMut = *mut root::RawGeckoServoStyleRuleList; + pub type RawGeckoCSSPropertyIDListBorrowed = + *const root::RawGeckoCSSPropertyIDList; /** * Utility class to provide scaling defined in a keySplines element. */ @@ -31957,7 +31997,7 @@ pub mod root { } pub type __builtin_va_list = [root::__va_list_tag; 1usize]; #[test] - fn __bindgen_test_layout_IntegralConstant_instantiation_173405() { + fn __bindgen_test_layout_IntegralConstant_instantiation_181735() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( u8 ) )); @@ -31966,7 +32006,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_IntegralConstant_instantiation_173409() { + fn __bindgen_test_layout_IntegralConstant_instantiation_181739() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( u8 ) )); @@ -31975,7 +32015,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsReadingIterator_instantiation_173626() { + fn __bindgen_test_layout_nsReadingIterator_instantiation_181956() { assert_eq!(::std::mem::size_of::>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31986,7 +32026,7 @@ pub mod root { root::nsReadingIterator ) )); } #[test] - fn __bindgen_test_layout_nsWritingIterator_instantiation_173630() { + fn __bindgen_test_layout_nsWritingIterator_instantiation_181960() { assert_eq!(::std::mem::size_of::>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31997,7 +32037,7 @@ pub mod root { root::nsWritingIterator ) )); } #[test] - fn __bindgen_test_layout_nsReadingIterator_instantiation_173703() { + fn __bindgen_test_layout_nsReadingIterator_instantiation_182033() { assert_eq!(::std::mem::size_of::>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32008,7 +32048,7 @@ pub mod root { root::nsReadingIterator<::std::os::raw::c_char> ) )); } #[test] - fn __bindgen_test_layout_nsWritingIterator_instantiation_173707() { + fn __bindgen_test_layout_nsWritingIterator_instantiation_182037() { assert_eq!(::std::mem::size_of::>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32019,7 +32059,7 @@ pub mod root { root::nsWritingIterator<::std::os::raw::c_char> ) )); } #[test] - fn __bindgen_test_layout_atomic_instantiation_175747() { + fn __bindgen_test_layout_atomic_instantiation_184077() { assert_eq!(::std::mem::size_of::() , 4usize , concat ! ( "Size of template specialization: " , stringify ! ( u32 ) )); @@ -32028,7 +32068,7 @@ pub mod root { u32 ) )); } #[test] - fn __bindgen_test_layout_atomic_instantiation_175755() { + fn __bindgen_test_layout_atomic_instantiation_184085() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( u64 ) )); @@ -32037,7 +32077,7 @@ pub mod root { u64 ) )); } #[test] - fn __bindgen_test_layout__bindgen_ty_id_176012_instantiation_176009() { + fn __bindgen_test_layout__bindgen_ty_id_184342_instantiation_184339() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( u8 ) )); @@ -32046,7 +32086,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout__bindgen_ty_id_176045_instantiation_176042() { + fn __bindgen_test_layout__bindgen_ty_id_184375_instantiation_184372() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( u8 ) )); @@ -32055,7 +32095,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_176313() { + fn __bindgen_test_layout_nsTArray_instantiation_184643() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32066,7 +32106,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_177145() { + fn __bindgen_test_layout_Handle_instantiation_185475() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32077,7 +32117,7 @@ pub mod root { root::JS::Handle<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_177161() { + fn __bindgen_test_layout_Handle_instantiation_185491() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32088,7 +32128,7 @@ pub mod root { root::JS::Handle ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_177171() { + fn __bindgen_test_layout_MutableHandle_instantiation_185501() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32099,7 +32139,7 @@ pub mod root { root::JS::MutableHandle<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_177187() { + fn __bindgen_test_layout_MutableHandle_instantiation_185517() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32110,7 +32150,7 @@ pub mod root { root::JS::MutableHandle ) )); } #[test] - fn __bindgen_test_layout_Rooted_instantiation_177190() { + fn __bindgen_test_layout_Rooted_instantiation_185520() { assert_eq!(::std::mem::size_of::<[u64; 3usize]>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32121,7 +32161,7 @@ pub mod root { [u64; 3usize] ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_177527() { + fn __bindgen_test_layout_DeletePolicy_instantiation_185857() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32132,7 +32172,7 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_182503() { + fn __bindgen_test_layout_nsTArray_instantiation_190833() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32143,7 +32183,7 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_182507() { + fn __bindgen_test_layout_nsTArray_instantiation_190837() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32154,7 +32194,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_182520() { + fn __bindgen_test_layout_nsTArray_instantiation_190850() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32165,7 +32205,7 @@ pub mod root { root::nsTArray<::std::os::raw::c_uint> ) )); } #[test] - fn __bindgen_test_layout_TenuredHeap_instantiation_183432() { + fn __bindgen_test_layout_TenuredHeap_instantiation_191764() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32176,7 +32216,7 @@ pub mod root { root::JS::TenuredHeap ) )); } #[test] - fn __bindgen_test_layout_Heap_instantiation_183522() { + fn __bindgen_test_layout_Heap_instantiation_191854() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32187,7 +32227,7 @@ pub mod root { root::JS::Heap<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_Heap_instantiation_183637() { + fn __bindgen_test_layout_Heap_instantiation_191969() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32198,7 +32238,7 @@ pub mod root { root::JS::Heap ) )); } #[test] - fn __bindgen_test_layout_TErrorResult_instantiation_183644() { + fn __bindgen_test_layout_TErrorResult_instantiation_191976() { assert_eq!(::std::mem::size_of::() , 32usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32209,7 +32249,7 @@ pub mod root { root::mozilla::binding_danger::TErrorResult ) )); } #[test] - fn __bindgen_test_layout_TErrorResult_instantiation_183660() { + fn __bindgen_test_layout_TErrorResult_instantiation_191992() { assert_eq!(::std::mem::size_of::() , 32usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32220,7 +32260,7 @@ pub mod root { root::mozilla::binding_danger::TErrorResult ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_183666() { + fn __bindgen_test_layout_already_AddRefed_instantiation_191998() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32231,7 +32271,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_183718() { + fn __bindgen_test_layout_already_AddRefed_instantiation_192050() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32242,7 +32282,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_184201() { + fn __bindgen_test_layout_RefPtr_instantiation_192533() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32253,7 +32293,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_184547() { + fn __bindgen_test_layout_already_AddRefed_instantiation_192879() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32264,7 +32304,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_184792() { + fn __bindgen_test_layout_already_AddRefed_instantiation_193124() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32275,7 +32315,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_184939() { + fn __bindgen_test_layout_already_AddRefed_instantiation_193271() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32286,7 +32326,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_189058() { + fn __bindgen_test_layout_DeletePolicy_instantiation_197390() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32297,7 +32337,7 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_189056() { + fn __bindgen_test_layout_UniquePtr_instantiation_197388() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32308,7 +32348,7 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_iterator_instantiation_189091() { + fn __bindgen_test_layout_iterator_instantiation_197423() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32319,7 +32359,7 @@ pub mod root { root::std::iterator ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_189647() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_197991() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32330,7 +32370,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_191240() { + fn __bindgen_test_layout_nsTArray_instantiation_199584() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32343,7 +32383,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_LinkedList_instantiation_191516() { + fn __bindgen_test_layout_LinkedList_instantiation_199860() { assert_eq!(::std::mem::size_of::() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32354,7 +32394,7 @@ pub mod root { root::mozilla::LinkedList ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_191532() { + fn __bindgen_test_layout_RefPtr_instantiation_199876() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32365,7 +32405,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_191531() { + fn __bindgen_test_layout_nsTArray_instantiation_199875() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32378,7 +32418,7 @@ pub mod root { )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_191561() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_199905() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32389,7 +32429,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_191560() { + fn __bindgen_test_layout_nsTArray_instantiation_199904() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32400,7 +32440,7 @@ pub mod root { root::nsTArray> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_191606() { + fn __bindgen_test_layout_already_AddRefed_instantiation_199950() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32411,7 +32451,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_191771() { + fn __bindgen_test_layout_already_AddRefed_instantiation_200115() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32422,7 +32462,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_192098() { + fn __bindgen_test_layout_already_AddRefed_instantiation_200442() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32433,7 +32473,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_192191() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_200535() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32444,7 +32484,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_192228() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_200572() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32455,7 +32495,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_192486() { + fn __bindgen_test_layout_DefaultDelete_instantiation_200830() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32466,7 +32506,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_192484() { + fn __bindgen_test_layout_UniquePtr_instantiation_200828() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32477,7 +32517,7 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_193034() { + fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_201389() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32490,7 +32530,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsDataHashtable_instantiation_193033() { + fn __bindgen_test_layout_nsDataHashtable_instantiation_201388() { assert_eq!(::std::mem::size_of::<[u64; 6usize]>() , 48usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32501,7 +32541,7 @@ pub mod root { [u64; 6usize] ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_193240() { + fn __bindgen_test_layout_nsTArray_instantiation_201595() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32512,7 +32552,7 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_SupportsWeakPtr_instantiation_193291() { + fn __bindgen_test_layout_SupportsWeakPtr_instantiation_201646() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( u64 ) )); @@ -32521,7 +32561,7 @@ pub mod root { u64 ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_193466() { + fn __bindgen_test_layout_nsTArray_instantiation_201826() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32532,7 +32572,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_193582() { + fn __bindgen_test_layout_DefaultDelete_instantiation_201942() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32543,7 +32583,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_193751() { + fn __bindgen_test_layout_nsTArray_instantiation_202111() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32554,7 +32594,7 @@ pub mod root { root::nsTArray> ) )); } #[test] - fn __bindgen_test_layout_nsPIDOMWindow_instantiation_194538() { + fn __bindgen_test_layout_nsPIDOMWindow_instantiation_202900() { assert_eq!(::std::mem::size_of::<[u64; 29usize]>() , 232usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32565,7 +32605,7 @@ pub mod root { [u64; 29usize] ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_194590() { + fn __bindgen_test_layout_already_AddRefed_instantiation_202992() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32576,7 +32616,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashtable_instantiation_194771() { + fn __bindgen_test_layout_nsRefPtrHashtable_instantiation_203182() { assert_eq!(::std::mem::size_of::<[u64; 6usize]>() , 48usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32587,7 +32627,7 @@ pub mod root { [u64; 6usize] ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_195278() { + fn __bindgen_test_layout_nsPtrHashKey_instantiation_203705() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32598,7 +32638,7 @@ pub mod root { root::nsPtrHashKey<::std::os::raw::c_void> ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_195286() { + fn __bindgen_test_layout_nsPtrHashKey_instantiation_203713() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32609,7 +32649,7 @@ pub mod root { root::nsPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_OwningNonNull_instantiation_195401() { + fn __bindgen_test_layout_OwningNonNull_instantiation_203828() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32620,7 +32660,7 @@ pub mod root { root::mozilla::OwningNonNull ) )); } #[test] - fn __bindgen_test_layout_PointTyped_instantiation_196480() { + fn __bindgen_test_layout_PointTyped_instantiation_204907() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32631,7 +32671,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_IntPointTyped_instantiation_196485() { + fn __bindgen_test_layout_IntPointTyped_instantiation_204912() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32642,7 +32682,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_SizeTyped_instantiation_196488() { + fn __bindgen_test_layout_SizeTyped_instantiation_204915() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32653,7 +32693,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_RectTyped_instantiation_196496() { + fn __bindgen_test_layout_RectTyped_instantiation_204923() { assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32664,7 +32704,7 @@ pub mod root { [u32; 4usize] ) )); } #[test] - fn __bindgen_test_layout_IntPointTyped_instantiation_196528() { + fn __bindgen_test_layout_IntPointTyped_instantiation_204955() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32675,7 +32715,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_IntSizeTyped_instantiation_196536() { + fn __bindgen_test_layout_IntSizeTyped_instantiation_204963() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32686,7 +32726,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_IntRectTyped_instantiation_196544() { + fn __bindgen_test_layout_IntRectTyped_instantiation_204971() { assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32697,7 +32737,7 @@ pub mod root { [u32; 4usize] ) )); } #[test] - fn __bindgen_test_layout_MarginTyped_instantiation_196711() { + fn __bindgen_test_layout_MarginTyped_instantiation_205138() { assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32708,7 +32748,7 @@ pub mod root { [u32; 4usize] ) )); } #[test] - fn __bindgen_test_layout_RectTyped_instantiation_196746() { + fn __bindgen_test_layout_RectTyped_instantiation_205173() { assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32719,7 +32759,7 @@ pub mod root { [u32; 4usize] ) )); } #[test] - fn __bindgen_test_layout_IntRectTyped_instantiation_196751() { + fn __bindgen_test_layout_IntRectTyped_instantiation_205178() { assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32730,7 +32770,7 @@ pub mod root { [u32; 4usize] ) )); } #[test] - fn __bindgen_test_layout_ScaleFactor_instantiation_196797() { + fn __bindgen_test_layout_ScaleFactor_instantiation_205224() { assert_eq!(::std::mem::size_of::() , 4usize , concat ! ( "Size of template specialization: " , stringify ! ( u32 ) )); @@ -32739,7 +32779,7 @@ pub mod root { u32 ) )); } #[test] - fn __bindgen_test_layout_ScaleFactors2D_instantiation_196897() { + fn __bindgen_test_layout_ScaleFactors2D_instantiation_205324() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32750,7 +32790,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_ScaleFactors2D_instantiation_196905() { + fn __bindgen_test_layout_ScaleFactors2D_instantiation_205332() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32761,7 +32801,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_ScaleFactors2D_instantiation_196949() { + fn __bindgen_test_layout_ScaleFactors2D_instantiation_205376() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32772,7 +32812,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_197579() { + fn __bindgen_test_layout_nsTArray_instantiation_206006() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32785,7 +32825,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_197595() { + fn __bindgen_test_layout_nsPtrHashKey_instantiation_206022() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32796,7 +32836,7 @@ pub mod root { root::nsPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_nsPIDOMWindow_instantiation_200803() { + fn __bindgen_test_layout_nsPIDOMWindow_instantiation_209296() { assert_eq!(::std::mem::size_of::<[u64; 29usize]>() , 232usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32807,7 +32847,7 @@ pub mod root { [u64; 29usize] ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_201439() { + fn __bindgen_test_layout_already_AddRefed_instantiation_209932() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32818,7 +32858,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_201530() { + fn __bindgen_test_layout_DefaultDelete_instantiation_210023() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32829,7 +32869,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashtable_instantiation_201534() { + fn __bindgen_test_layout_nsRefPtrHashtable_instantiation_210027() { assert_eq!(::std::mem::size_of::<[u64; 6usize]>() , 48usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32840,7 +32880,7 @@ pub mod root { [u64; 6usize] ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_202723() { + fn __bindgen_test_layout_already_AddRefed_instantiation_211216() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32851,7 +32891,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_203310() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_211803() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32862,7 +32902,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_204853() { + fn __bindgen_test_layout_nsTArray_instantiation_213346() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32873,7 +32913,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_204865() { + fn __bindgen_test_layout_RefPtr_instantiation_213358() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32886,7 +32926,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_204864() { + fn __bindgen_test_layout_nsTArray_instantiation_213357() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32899,7 +32939,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_204898() { + fn __bindgen_test_layout_nsPtrHashKey_instantiation_213391() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32910,7 +32950,7 @@ pub mod root { root::nsPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_204995() { + fn __bindgen_test_layout_UniquePtr_instantiation_213488() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32921,7 +32961,7 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_nsDataHashtable_instantiation_206793() { + fn __bindgen_test_layout_nsDataHashtable_instantiation_215281() { assert_eq!(::std::mem::size_of::<[u64; 6usize]>() , 48usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32932,7 +32972,7 @@ pub mod root { [u64; 6usize] ) )); } #[test] - fn __bindgen_test_layout_OwningNonNull_instantiation_206832() { + fn __bindgen_test_layout_OwningNonNull_instantiation_215320() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32945,7 +32985,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_206855() { + fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_215343() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32956,7 +32996,7 @@ pub mod root { root::nsRefPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_206891() { + fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_215379() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32967,7 +33007,7 @@ pub mod root { root::nsRefPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_207436() { + fn __bindgen_test_layout_DefaultDelete_instantiation_215942() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32978,7 +33018,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_207450() { + fn __bindgen_test_layout_already_AddRefed_instantiation_215956() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32989,7 +33029,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_nsMainThreadPtrHolder_instantiation_207454() { + fn __bindgen_test_layout_nsMainThreadPtrHolder_instantiation_215960() { assert_eq!(::std::mem::size_of::>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33000,7 +33040,7 @@ pub mod root { root::nsMainThreadPtrHolder ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_207528() { + fn __bindgen_test_layout_nsPtrHashKey_instantiation_216034() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33011,7 +33051,7 @@ pub mod root { root::nsPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_207815() { + fn __bindgen_test_layout_DefaultDelete_instantiation_216321() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33022,7 +33062,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_207813() { + fn __bindgen_test_layout_UniquePtr_instantiation_216319() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33033,7 +33073,7 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_207821() { + fn __bindgen_test_layout_DefaultDelete_instantiation_216327() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33044,7 +33084,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_207819() { + fn __bindgen_test_layout_UniquePtr_instantiation_216325() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33055,7 +33095,7 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_208164() { + fn __bindgen_test_layout_Maybe_instantiation_216670() { assert_eq!(::std::mem::size_of::<[u64; 2usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33066,7 +33106,7 @@ pub mod root { [u64; 2usize] ) )); } #[test] - fn __bindgen_test_layout_SupportsWeakPtr_instantiation_208331() { + fn __bindgen_test_layout_SupportsWeakPtr_instantiation_216837() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( u64 ) )); @@ -33075,7 +33115,7 @@ pub mod root { u64 ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_208492() { + fn __bindgen_test_layout_Maybe_instantiation_216995() { assert_eq!(::std::mem::size_of::<[u32; 3usize]>() , 12usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33086,7 +33126,7 @@ pub mod root { [u32; 3usize] ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_208507() { + fn __bindgen_test_layout_already_AddRefed_instantiation_217010() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33097,7 +33137,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_208515() { + fn __bindgen_test_layout_DefaultDelete_instantiation_217018() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33108,7 +33148,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_208513() { + fn __bindgen_test_layout_UniquePtr_instantiation_217016() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33119,7 +33159,7 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_208554() { + fn __bindgen_test_layout_DefaultDelete_instantiation_217057() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33130,7 +33170,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_pair_instantiation_208705() { + fn __bindgen_test_layout_pair_instantiation_217208() { assert_eq!(::std::mem::size_of::>() , 32usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33141,7 +33181,7 @@ pub mod root { root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_208704() { + fn __bindgen_test_layout_nsTArray_instantiation_217207() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( @@ -33156,7 +33196,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_209698() { + fn __bindgen_test_layout_RefPtr_instantiation_218230() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33167,7 +33207,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_BaseTimeDuration_instantiation_211420() { + fn __bindgen_test_layout_BaseTimeDuration_instantiation_222222() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33178,7 +33218,7 @@ pub mod root { root::mozilla::BaseTimeDuration ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_212012() { + fn __bindgen_test_layout_nsTArray_instantiation_222814() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33191,7 +33231,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_212274() { + fn __bindgen_test_layout_Maybe_instantiation_223076() { assert_eq!(::std::mem::size_of::<[u64; 2usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33202,7 +33242,7 @@ pub mod root { [u64; 2usize] ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_212281() { + fn __bindgen_test_layout_Maybe_instantiation_223083() { assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33213,7 +33253,7 @@ pub mod root { [u64; 5usize] ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_212456() { + fn __bindgen_test_layout_RefPtr_instantiation_223258() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33224,7 +33264,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_Sequence_instantiation_212700() { + fn __bindgen_test_layout_Sequence_instantiation_223502() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( u64 ) )); @@ -33233,7 +33273,7 @@ pub mod root { u64 ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_212999() { + fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_223801() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33244,7 +33284,7 @@ pub mod root { root::nsRefPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_nsClassHashtable_instantiation_212998() { + fn __bindgen_test_layout_nsClassHashtable_instantiation_223800() { assert_eq!(::std::mem::size_of::<[u64; 6usize]>() , 48usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33255,7 +33295,7 @@ pub mod root { [u64; 6usize] ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_214230() { + fn __bindgen_test_layout_nsTArray_instantiation_225054() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33266,7 +33306,7 @@ pub mod root { root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); } #[test] - fn __bindgen_test_layout_nsAutoPtr_instantiation_214268() { + fn __bindgen_test_layout_nsAutoPtr_instantiation_225092() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( diff --git a/servo/components/style/gecko/generated/structs_release.rs b/servo/components/style/gecko/generated/structs_release.rs index 78760c4956bd..5828157c0ca3 100644 --- a/servo/components/style/gecko/generated/structs_release.rs +++ b/servo/components/style/gecko/generated/structs_release.rs @@ -3700,9 +3700,20 @@ pub mod root { _unused: [u8; 0], } #[repr(C)] - #[derive(Debug, Copy, Clone)] + #[derive(Debug)] pub struct EventHandlerNonNull { - _unused: [u8; 0], + pub _base: root::mozilla::dom::CallbackFunction, + } + #[test] + fn bindgen_test_layout_EventHandlerNonNull() { + assert_eq!(::std::mem::size_of::() , + 48usize , concat ! ( + "Size of: " , stringify ! ( EventHandlerNonNull ) + )); + assert_eq! (::std::mem::align_of::() , + 8usize , concat ! ( + "Alignment of " , stringify ! ( + EventHandlerNonNull ) )); } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -6268,7 +6279,11 @@ pub mod root { } #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum TraversalRestyleBehavior { Normal = 0, ForReconstruct = 1, } + pub enum TraversalRestyleBehavior { + Normal = 0, + ForReconstruct = 1, + ForAnimationOnly = 2, + } pub const UpdateAnimationsTasks_CSSAnimations: root::mozilla::UpdateAnimationsTasks = 1; @@ -6803,7 +6818,7 @@ pub mod root { _unused: [u8; 0], } #[test] - fn __bindgen_test_layout_StaticRefPtr_instantiation_116395() { + fn __bindgen_test_layout_StaticRefPtr_instantiation_117293() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -7566,6 +7581,7 @@ pub mod root { pub mRefCnt: root::nsCycleCollectingAutoRefCnt, pub mPresContext: *mut root::nsPresContext, pub mElementsToRestyle: [u64; 10usize], + pub mIsInPreTraverse: bool, pub mRuleProcessors: [u64; 2usize], } pub type EffectCompositor_HasThreadSafeRefCnt = @@ -7602,6 +7618,12 @@ pub mod root { Standard = 1, Layer = 2, } + #[repr(i32)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum EffectCompositor_AnimationRestyleType { + Throttled = 0, + Full = 1, + } #[repr(C)] #[derive(Debug)] pub struct EffectCompositor_AnimationStyleRuleProcessor { @@ -7661,7 +7683,7 @@ pub mod root { pub const EffectCompositor_kCascadeLevelCount: usize = 2; #[test] fn bindgen_test_layout_EffectCompositor() { - assert_eq!(::std::mem::size_of::() , 112usize , + assert_eq!(::std::mem::size_of::() , 120usize , concat ! ( "Size of: " , stringify ! ( EffectCompositor ) )); assert_eq! (::std::mem::align_of::() , 8usize , @@ -7689,7 +7711,14 @@ pub mod root { mElementsToRestyle ) )); assert_eq! (unsafe { & ( * ( 0 as * const EffectCompositor ) ) . - mRuleProcessors as * const _ as usize } , 96usize , + mIsInPreTraverse as * const _ as usize } , 96usize , + concat ! ( + "Alignment of field: " , stringify ! ( + EffectCompositor ) , "::" , stringify ! ( + mIsInPreTraverse ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const EffectCompositor ) ) . + mRuleProcessors as * const _ as usize } , 104usize , concat ! ( "Alignment of field: " , stringify ! ( EffectCompositor ) , "::" , stringify ! ( @@ -8934,7 +8963,7 @@ pub mod root { ( mValue ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_153384() { + fn __bindgen_test_layout_DefaultDelete_instantiation_154690() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -11168,7 +11197,7 @@ pub mod root { pub _address: u8, } #[test] - fn __bindgen_test_layout_nsCharTraits_instantiation_51822() { + fn __bindgen_test_layout_nsCharTraits_instantiation_52494() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -11179,7 +11208,7 @@ pub mod root { root::nsCharTraits ) )); } #[test] - fn __bindgen_test_layout_nsCharTraits_instantiation_51826() { + fn __bindgen_test_layout_nsCharTraits_instantiation_52498() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -12816,7 +12845,7 @@ pub mod root { } pub type nsCOMPtr_element_type = T; #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_60935() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_61615() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -23431,489 +23460,491 @@ pub mod root { eCSSKeyword_hz = 274, eCSSKeyword_icon = 275, eCSSKeyword_ignore = 276, - eCSSKeyword_in = 277, - eCSSKeyword_interlace = 278, - eCSSKeyword_inactive = 279, - eCSSKeyword_inactiveborder = 280, - eCSSKeyword_inactivecaption = 281, - eCSSKeyword_inactivecaptiontext = 282, - eCSSKeyword_infinite = 283, - eCSSKeyword_infobackground = 284, - eCSSKeyword_infotext = 285, - eCSSKeyword_inherit = 286, - eCSSKeyword_initial = 287, - eCSSKeyword_inline = 288, - eCSSKeyword_inline_axis = 289, - eCSSKeyword_inline_block = 290, - eCSSKeyword_inline_end = 291, - eCSSKeyword_inline_flex = 292, - eCSSKeyword_inline_grid = 293, - eCSSKeyword_inline_start = 294, - eCSSKeyword_inline_table = 295, - eCSSKeyword_inset = 296, - eCSSKeyword_inside = 297, - eCSSKeyword_inter_character = 298, - eCSSKeyword_inter_word = 299, - eCSSKeyword_interpolatematrix = 300, - eCSSKeyword_accumulatematrix = 301, - eCSSKeyword_intersect = 302, - eCSSKeyword_isolate = 303, - eCSSKeyword_isolate_override = 304, - eCSSKeyword_invert = 305, - eCSSKeyword_italic = 306, - eCSSKeyword_japanese_formal = 307, - eCSSKeyword_japanese_informal = 308, - eCSSKeyword_jis78 = 309, - eCSSKeyword_jis83 = 310, - eCSSKeyword_jis90 = 311, - eCSSKeyword_jis04 = 312, - eCSSKeyword_justify = 313, - eCSSKeyword_keep_all = 314, - eCSSKeyword_khz = 315, - eCSSKeyword_korean_hangul_formal = 316, - eCSSKeyword_korean_hanja_formal = 317, - eCSSKeyword_korean_hanja_informal = 318, - eCSSKeyword_landscape = 319, - eCSSKeyword_large = 320, - eCSSKeyword_larger = 321, - eCSSKeyword_last = 322, - eCSSKeyword_last_baseline = 323, - eCSSKeyword_layout = 324, - eCSSKeyword_left = 325, - eCSSKeyword_legacy = 326, - eCSSKeyword_lighten = 327, - eCSSKeyword_lighter = 328, - eCSSKeyword_line_through = 329, - eCSSKeyword_linear = 330, - eCSSKeyword_lining_nums = 331, - eCSSKeyword_list_item = 332, - eCSSKeyword_local = 333, - eCSSKeyword_logical = 334, - eCSSKeyword_looped = 335, - eCSSKeyword_lowercase = 336, - eCSSKeyword_lr = 337, - eCSSKeyword_lr_tb = 338, - eCSSKeyword_ltr = 339, - eCSSKeyword_luminance = 340, - eCSSKeyword_luminosity = 341, - eCSSKeyword_mandatory = 342, - eCSSKeyword_manipulation = 343, - eCSSKeyword_manual = 344, - eCSSKeyword_margin_box = 345, - eCSSKeyword_markers = 346, - eCSSKeyword_match_parent = 347, - eCSSKeyword_match_source = 348, - eCSSKeyword_matrix = 349, - eCSSKeyword_matrix3d = 350, - eCSSKeyword_max_content = 351, - eCSSKeyword_medium = 352, - eCSSKeyword_menu = 353, - eCSSKeyword_menutext = 354, - eCSSKeyword_message_box = 355, - eCSSKeyword_middle = 356, - eCSSKeyword_min_content = 357, - eCSSKeyword_minmax = 358, - eCSSKeyword_mix = 359, - eCSSKeyword_mixed = 360, - eCSSKeyword_mm = 361, - eCSSKeyword_monospace = 362, - eCSSKeyword_move = 363, - eCSSKeyword_ms = 364, - eCSSKeyword_multiply = 365, - eCSSKeyword_n_resize = 366, - eCSSKeyword_narrower = 367, - eCSSKeyword_ne_resize = 368, - eCSSKeyword_nesw_resize = 369, - eCSSKeyword_no_clip = 370, - eCSSKeyword_no_close_quote = 371, - eCSSKeyword_no_common_ligatures = 372, - eCSSKeyword_no_contextual = 373, - eCSSKeyword_no_discretionary_ligatures = 374, - eCSSKeyword_no_drag = 375, - eCSSKeyword_no_drop = 376, - eCSSKeyword_no_historical_ligatures = 377, - eCSSKeyword_no_open_quote = 378, - eCSSKeyword_no_repeat = 379, - eCSSKeyword_none = 380, - eCSSKeyword_normal = 381, - eCSSKeyword_not_allowed = 382, - eCSSKeyword_nowrap = 383, - eCSSKeyword_numeric = 384, - eCSSKeyword_ns_resize = 385, - eCSSKeyword_nw_resize = 386, - eCSSKeyword_nwse_resize = 387, - eCSSKeyword_oblique = 388, - eCSSKeyword_oldstyle_nums = 389, - eCSSKeyword_opacity = 390, - eCSSKeyword_open = 391, - eCSSKeyword_open_quote = 392, - eCSSKeyword_optional = 393, - eCSSKeyword_ordinal = 394, - eCSSKeyword_ornaments = 395, - eCSSKeyword_outset = 396, - eCSSKeyword_outside = 397, - eCSSKeyword_over = 398, - eCSSKeyword_overlay = 399, - eCSSKeyword_overline = 400, - eCSSKeyword_paint = 401, - eCSSKeyword_padding_box = 402, - eCSSKeyword_painted = 403, - eCSSKeyword_pan_x = 404, - eCSSKeyword_pan_y = 405, - eCSSKeyword_paused = 406, - eCSSKeyword_pc = 407, - eCSSKeyword_perspective = 408, - eCSSKeyword_petite_caps = 409, - eCSSKeyword_physical = 410, - eCSSKeyword_plaintext = 411, - eCSSKeyword_pointer = 412, - eCSSKeyword_polygon = 413, - eCSSKeyword_portrait = 414, - eCSSKeyword_pre = 415, - eCSSKeyword_pre_wrap = 416, - eCSSKeyword_pre_line = 417, - eCSSKeyword_preserve_3d = 418, - eCSSKeyword_progress = 419, - eCSSKeyword_progressive = 420, - eCSSKeyword_proportional_nums = 421, - eCSSKeyword_proportional_width = 422, - eCSSKeyword_proximity = 423, - eCSSKeyword_pt = 424, - eCSSKeyword_px = 425, - eCSSKeyword_rad = 426, - eCSSKeyword_read_only = 427, - eCSSKeyword_read_write = 428, - eCSSKeyword_relative = 429, - eCSSKeyword_repeat = 430, - eCSSKeyword_repeat_x = 431, - eCSSKeyword_repeat_y = 432, - eCSSKeyword_reverse = 433, - eCSSKeyword_ridge = 434, - eCSSKeyword_right = 435, - eCSSKeyword_rl = 436, - eCSSKeyword_rl_tb = 437, - eCSSKeyword_rotate = 438, - eCSSKeyword_rotate3d = 439, - eCSSKeyword_rotatex = 440, - eCSSKeyword_rotatey = 441, - eCSSKeyword_rotatez = 442, - eCSSKeyword_round = 443, - eCSSKeyword_row = 444, - eCSSKeyword_row_resize = 445, - eCSSKeyword_row_reverse = 446, - eCSSKeyword_rtl = 447, - eCSSKeyword_ruby = 448, - eCSSKeyword_ruby_base = 449, - eCSSKeyword_ruby_base_container = 450, - eCSSKeyword_ruby_text = 451, - eCSSKeyword_ruby_text_container = 452, - eCSSKeyword_running = 453, - eCSSKeyword_s = 454, - eCSSKeyword_s_resize = 455, - eCSSKeyword_safe = 456, - eCSSKeyword_saturate = 457, - eCSSKeyword_saturation = 458, - eCSSKeyword_scale = 459, - eCSSKeyword_scale_down = 460, - eCSSKeyword_scale3d = 461, - eCSSKeyword_scalex = 462, - eCSSKeyword_scaley = 463, - eCSSKeyword_scalez = 464, - eCSSKeyword_screen = 465, - eCSSKeyword_script = 466, - eCSSKeyword_scroll = 467, - eCSSKeyword_scrollbar = 468, - eCSSKeyword_scrollbar_small = 469, - eCSSKeyword_scrollbar_horizontal = 470, - eCSSKeyword_scrollbar_vertical = 471, - eCSSKeyword_se_resize = 472, - eCSSKeyword_select_after = 473, - eCSSKeyword_select_all = 474, - eCSSKeyword_select_before = 475, - eCSSKeyword_select_menu = 476, - eCSSKeyword_select_same = 477, - eCSSKeyword_self_end = 478, - eCSSKeyword_self_start = 479, - eCSSKeyword_semi_condensed = 480, - eCSSKeyword_semi_expanded = 481, - eCSSKeyword_separate = 482, - eCSSKeyword_sepia = 483, - eCSSKeyword_serif = 484, - eCSSKeyword_sesame = 485, - eCSSKeyword_show = 486, - eCSSKeyword_sideways = 487, - eCSSKeyword_sideways_lr = 488, - eCSSKeyword_sideways_right = 489, - eCSSKeyword_sideways_rl = 490, - eCSSKeyword_simp_chinese_formal = 491, - eCSSKeyword_simp_chinese_informal = 492, - eCSSKeyword_simplified = 493, - eCSSKeyword_skew = 494, - eCSSKeyword_skewx = 495, - eCSSKeyword_skewy = 496, - eCSSKeyword_slashed_zero = 497, - eCSSKeyword_slice = 498, - eCSSKeyword_small = 499, - eCSSKeyword_small_caps = 500, - eCSSKeyword_small_caption = 501, - eCSSKeyword_smaller = 502, - eCSSKeyword_smooth = 503, - eCSSKeyword_soft = 504, - eCSSKeyword_soft_light = 505, - eCSSKeyword_solid = 506, - eCSSKeyword_space_around = 507, - eCSSKeyword_space_between = 508, - eCSSKeyword_space_evenly = 509, - eCSSKeyword_span = 510, - eCSSKeyword_spell_out = 511, - eCSSKeyword_square = 512, - eCSSKeyword_stacked_fractions = 513, - eCSSKeyword_start = 514, - eCSSKeyword_static = 515, - eCSSKeyword_standalone = 516, - eCSSKeyword_status_bar = 517, - eCSSKeyword_step_end = 518, - eCSSKeyword_step_start = 519, - eCSSKeyword_sticky = 520, - eCSSKeyword_stretch = 521, - eCSSKeyword_stretch_to_fit = 522, - eCSSKeyword_stretched = 523, - eCSSKeyword_strict = 524, - eCSSKeyword_stroke = 525, - eCSSKeyword_stroke_box = 526, - eCSSKeyword_style = 527, - eCSSKeyword_styleset = 528, - eCSSKeyword_stylistic = 529, - eCSSKeyword_sub = 530, - eCSSKeyword_subgrid = 531, - eCSSKeyword_subtract = 532, - eCSSKeyword_super = 533, - eCSSKeyword_sw_resize = 534, - eCSSKeyword_swash = 535, - eCSSKeyword_swap = 536, - eCSSKeyword_table = 537, - eCSSKeyword_table_caption = 538, - eCSSKeyword_table_cell = 539, - eCSSKeyword_table_column = 540, - eCSSKeyword_table_column_group = 541, - eCSSKeyword_table_footer_group = 542, - eCSSKeyword_table_header_group = 543, - eCSSKeyword_table_row = 544, - eCSSKeyword_table_row_group = 545, - eCSSKeyword_tabular_nums = 546, - eCSSKeyword_tailed = 547, - eCSSKeyword_tb = 548, - eCSSKeyword_tb_rl = 549, - eCSSKeyword_text = 550, - eCSSKeyword_text_bottom = 551, - eCSSKeyword_text_top = 552, - eCSSKeyword_thick = 553, - eCSSKeyword_thin = 554, - eCSSKeyword_threeddarkshadow = 555, - eCSSKeyword_threedface = 556, - eCSSKeyword_threedhighlight = 557, - eCSSKeyword_threedlightshadow = 558, - eCSSKeyword_threedshadow = 559, - eCSSKeyword_titling_caps = 560, - eCSSKeyword_toggle = 561, - eCSSKeyword_top = 562, - eCSSKeyword_top_outside = 563, - eCSSKeyword_trad_chinese_formal = 564, - eCSSKeyword_trad_chinese_informal = 565, - eCSSKeyword_traditional = 566, - eCSSKeyword_translate = 567, - eCSSKeyword_translate3d = 568, - eCSSKeyword_translatex = 569, - eCSSKeyword_translatey = 570, - eCSSKeyword_translatez = 571, - eCSSKeyword_transparent = 572, - eCSSKeyword_triangle = 573, - eCSSKeyword_tri_state = 574, - eCSSKeyword_ultra_condensed = 575, - eCSSKeyword_ultra_expanded = 576, - eCSSKeyword_under = 577, - eCSSKeyword_underline = 578, - eCSSKeyword_unicase = 579, - eCSSKeyword_unsafe = 580, - eCSSKeyword_unset = 581, - eCSSKeyword_uppercase = 582, - eCSSKeyword_upright = 583, - eCSSKeyword_vertical = 584, - eCSSKeyword_vertical_lr = 585, - eCSSKeyword_vertical_rl = 586, - eCSSKeyword_vertical_text = 587, - eCSSKeyword_view_box = 588, - eCSSKeyword_visible = 589, - eCSSKeyword_visiblefill = 590, - eCSSKeyword_visiblepainted = 591, - eCSSKeyword_visiblestroke = 592, - eCSSKeyword_w_resize = 593, - eCSSKeyword_wait = 594, - eCSSKeyword_wavy = 595, - eCSSKeyword_weight = 596, - eCSSKeyword_wider = 597, - eCSSKeyword_window = 598, - eCSSKeyword_windowframe = 599, - eCSSKeyword_windowtext = 600, - eCSSKeyword_words = 601, - eCSSKeyword_wrap = 602, - eCSSKeyword_wrap_reverse = 603, - eCSSKeyword_write_only = 604, - eCSSKeyword_x_large = 605, - eCSSKeyword_x_small = 606, - eCSSKeyword_xx_large = 607, - eCSSKeyword_xx_small = 608, - eCSSKeyword_zoom_in = 609, - eCSSKeyword_zoom_out = 610, - eCSSKeyword_radio = 611, - eCSSKeyword_checkbox = 612, - eCSSKeyword_button_bevel = 613, - eCSSKeyword_toolbox = 614, - eCSSKeyword_toolbar = 615, - eCSSKeyword_toolbarbutton = 616, - eCSSKeyword_toolbargripper = 617, - eCSSKeyword_dualbutton = 618, - eCSSKeyword_toolbarbutton_dropdown = 619, - eCSSKeyword_button_arrow_up = 620, - eCSSKeyword_button_arrow_down = 621, - eCSSKeyword_button_arrow_next = 622, - eCSSKeyword_button_arrow_previous = 623, - eCSSKeyword_separator = 624, - eCSSKeyword_splitter = 625, - eCSSKeyword_statusbar = 626, - eCSSKeyword_statusbarpanel = 627, - eCSSKeyword_resizerpanel = 628, - eCSSKeyword_resizer = 629, - eCSSKeyword_listbox = 630, - eCSSKeyword_listitem = 631, - eCSSKeyword_numbers = 632, - eCSSKeyword_number_input = 633, - eCSSKeyword_treeview = 634, - eCSSKeyword_treeitem = 635, - eCSSKeyword_treetwisty = 636, - eCSSKeyword_treetwistyopen = 637, - eCSSKeyword_treeline = 638, - eCSSKeyword_treeheader = 639, - eCSSKeyword_treeheadercell = 640, - eCSSKeyword_treeheadersortarrow = 641, - eCSSKeyword_progressbar = 642, - eCSSKeyword_progressbar_vertical = 643, - eCSSKeyword_progresschunk = 644, - eCSSKeyword_progresschunk_vertical = 645, - eCSSKeyword_tab = 646, - eCSSKeyword_tabpanels = 647, - eCSSKeyword_tabpanel = 648, - eCSSKeyword_tab_scroll_arrow_back = 649, - eCSSKeyword_tab_scroll_arrow_forward = 650, - eCSSKeyword_tooltip = 651, - eCSSKeyword_spinner = 652, - eCSSKeyword_spinner_upbutton = 653, - eCSSKeyword_spinner_downbutton = 654, - eCSSKeyword_spinner_textfield = 655, - eCSSKeyword_scrollbarbutton_up = 656, - eCSSKeyword_scrollbarbutton_down = 657, - eCSSKeyword_scrollbarbutton_left = 658, - eCSSKeyword_scrollbarbutton_right = 659, - eCSSKeyword_scrollbartrack_horizontal = 660, - eCSSKeyword_scrollbartrack_vertical = 661, - eCSSKeyword_scrollbarthumb_horizontal = 662, - eCSSKeyword_scrollbarthumb_vertical = 663, - eCSSKeyword_sheet = 664, - eCSSKeyword_textfield = 665, - eCSSKeyword_textfield_multiline = 666, - eCSSKeyword_caret = 667, - eCSSKeyword_searchfield = 668, - eCSSKeyword_menubar = 669, - eCSSKeyword_menupopup = 670, - eCSSKeyword_menuitem = 671, - eCSSKeyword_checkmenuitem = 672, - eCSSKeyword_radiomenuitem = 673, - eCSSKeyword_menucheckbox = 674, - eCSSKeyword_menuradio = 675, - eCSSKeyword_menuseparator = 676, - eCSSKeyword_menuarrow = 677, - eCSSKeyword_menuimage = 678, - eCSSKeyword_menuitemtext = 679, - eCSSKeyword_menulist = 680, - eCSSKeyword_menulist_button = 681, - eCSSKeyword_menulist_text = 682, - eCSSKeyword_menulist_textfield = 683, - eCSSKeyword_meterbar = 684, - eCSSKeyword_meterchunk = 685, - eCSSKeyword_minimal_ui = 686, - eCSSKeyword_range = 687, - eCSSKeyword_range_thumb = 688, - eCSSKeyword_sans_serif = 689, - eCSSKeyword_sans_serif_bold_italic = 690, - eCSSKeyword_sans_serif_italic = 691, - eCSSKeyword_scale_horizontal = 692, - eCSSKeyword_scale_vertical = 693, - eCSSKeyword_scalethumb_horizontal = 694, - eCSSKeyword_scalethumb_vertical = 695, - eCSSKeyword_scalethumbstart = 696, - eCSSKeyword_scalethumbend = 697, - eCSSKeyword_scalethumbtick = 698, - eCSSKeyword_groupbox = 699, - eCSSKeyword_checkbox_container = 700, - eCSSKeyword_radio_container = 701, - eCSSKeyword_checkbox_label = 702, - eCSSKeyword_radio_label = 703, - eCSSKeyword_button_focus = 704, - eCSSKeyword__moz_win_media_toolbox = 705, - eCSSKeyword__moz_win_communications_toolbox = 706, - eCSSKeyword__moz_win_browsertabbar_toolbox = 707, - eCSSKeyword__moz_win_mediatext = 708, - eCSSKeyword__moz_win_communicationstext = 709, - eCSSKeyword__moz_win_glass = 710, - eCSSKeyword__moz_win_borderless_glass = 711, - eCSSKeyword__moz_window_titlebar = 712, - eCSSKeyword__moz_window_titlebar_maximized = 713, - eCSSKeyword__moz_window_frame_left = 714, - eCSSKeyword__moz_window_frame_right = 715, - eCSSKeyword__moz_window_frame_bottom = 716, - eCSSKeyword__moz_window_button_close = 717, - eCSSKeyword__moz_window_button_minimize = 718, - eCSSKeyword__moz_window_button_maximize = 719, - eCSSKeyword__moz_window_button_restore = 720, - eCSSKeyword__moz_window_button_box = 721, - eCSSKeyword__moz_window_button_box_maximized = 722, - eCSSKeyword__moz_mac_help_button = 723, - eCSSKeyword__moz_win_exclude_glass = 724, - eCSSKeyword__moz_mac_vibrancy_light = 725, - eCSSKeyword__moz_mac_vibrancy_dark = 726, - eCSSKeyword__moz_mac_disclosure_button_closed = 727, - eCSSKeyword__moz_mac_disclosure_button_open = 728, - eCSSKeyword__moz_mac_source_list = 729, - eCSSKeyword__moz_mac_source_list_selection = 730, - eCSSKeyword__moz_mac_active_source_list_selection = 731, - eCSSKeyword_alphabetic = 732, - eCSSKeyword_bevel = 733, - eCSSKeyword_butt = 734, - eCSSKeyword_central = 735, - eCSSKeyword_crispedges = 736, - eCSSKeyword_evenodd = 737, - eCSSKeyword_geometricprecision = 738, - eCSSKeyword_hanging = 739, - eCSSKeyword_ideographic = 740, - eCSSKeyword_linearrgb = 741, - eCSSKeyword_mathematical = 742, - eCSSKeyword_miter = 743, - eCSSKeyword_no_change = 744, - eCSSKeyword_non_scaling_stroke = 745, - eCSSKeyword_nonzero = 746, - eCSSKeyword_optimizelegibility = 747, - eCSSKeyword_optimizequality = 748, - eCSSKeyword_optimizespeed = 749, - eCSSKeyword_reset_size = 750, - eCSSKeyword_srgb = 751, - eCSSKeyword_symbolic = 752, - eCSSKeyword_symbols = 753, - eCSSKeyword_text_after_edge = 754, - eCSSKeyword_text_before_edge = 755, - eCSSKeyword_use_script = 756, - eCSSKeyword__moz_crisp_edges = 757, - eCSSKeyword_space = 758, - eCSSKeyword_COUNT = 759, + eCSSKeyword_ignore_horizontal = 277, + eCSSKeyword_ignore_vertical = 278, + eCSSKeyword_in = 279, + eCSSKeyword_interlace = 280, + eCSSKeyword_inactive = 281, + eCSSKeyword_inactiveborder = 282, + eCSSKeyword_inactivecaption = 283, + eCSSKeyword_inactivecaptiontext = 284, + eCSSKeyword_infinite = 285, + eCSSKeyword_infobackground = 286, + eCSSKeyword_infotext = 287, + eCSSKeyword_inherit = 288, + eCSSKeyword_initial = 289, + eCSSKeyword_inline = 290, + eCSSKeyword_inline_axis = 291, + eCSSKeyword_inline_block = 292, + eCSSKeyword_inline_end = 293, + eCSSKeyword_inline_flex = 294, + eCSSKeyword_inline_grid = 295, + eCSSKeyword_inline_start = 296, + eCSSKeyword_inline_table = 297, + eCSSKeyword_inset = 298, + eCSSKeyword_inside = 299, + eCSSKeyword_inter_character = 300, + eCSSKeyword_inter_word = 301, + eCSSKeyword_interpolatematrix = 302, + eCSSKeyword_accumulatematrix = 303, + eCSSKeyword_intersect = 304, + eCSSKeyword_isolate = 305, + eCSSKeyword_isolate_override = 306, + eCSSKeyword_invert = 307, + eCSSKeyword_italic = 308, + eCSSKeyword_japanese_formal = 309, + eCSSKeyword_japanese_informal = 310, + eCSSKeyword_jis78 = 311, + eCSSKeyword_jis83 = 312, + eCSSKeyword_jis90 = 313, + eCSSKeyword_jis04 = 314, + eCSSKeyword_justify = 315, + eCSSKeyword_keep_all = 316, + eCSSKeyword_khz = 317, + eCSSKeyword_korean_hangul_formal = 318, + eCSSKeyword_korean_hanja_formal = 319, + eCSSKeyword_korean_hanja_informal = 320, + eCSSKeyword_landscape = 321, + eCSSKeyword_large = 322, + eCSSKeyword_larger = 323, + eCSSKeyword_last = 324, + eCSSKeyword_last_baseline = 325, + eCSSKeyword_layout = 326, + eCSSKeyword_left = 327, + eCSSKeyword_legacy = 328, + eCSSKeyword_lighten = 329, + eCSSKeyword_lighter = 330, + eCSSKeyword_line_through = 331, + eCSSKeyword_linear = 332, + eCSSKeyword_lining_nums = 333, + eCSSKeyword_list_item = 334, + eCSSKeyword_local = 335, + eCSSKeyword_logical = 336, + eCSSKeyword_looped = 337, + eCSSKeyword_lowercase = 338, + eCSSKeyword_lr = 339, + eCSSKeyword_lr_tb = 340, + eCSSKeyword_ltr = 341, + eCSSKeyword_luminance = 342, + eCSSKeyword_luminosity = 343, + eCSSKeyword_mandatory = 344, + eCSSKeyword_manipulation = 345, + eCSSKeyword_manual = 346, + eCSSKeyword_margin_box = 347, + eCSSKeyword_markers = 348, + eCSSKeyword_match_parent = 349, + eCSSKeyword_match_source = 350, + eCSSKeyword_matrix = 351, + eCSSKeyword_matrix3d = 352, + eCSSKeyword_max_content = 353, + eCSSKeyword_medium = 354, + eCSSKeyword_menu = 355, + eCSSKeyword_menutext = 356, + eCSSKeyword_message_box = 357, + eCSSKeyword_middle = 358, + eCSSKeyword_min_content = 359, + eCSSKeyword_minmax = 360, + eCSSKeyword_mix = 361, + eCSSKeyword_mixed = 362, + eCSSKeyword_mm = 363, + eCSSKeyword_monospace = 364, + eCSSKeyword_move = 365, + eCSSKeyword_ms = 366, + eCSSKeyword_multiply = 367, + eCSSKeyword_n_resize = 368, + eCSSKeyword_narrower = 369, + eCSSKeyword_ne_resize = 370, + eCSSKeyword_nesw_resize = 371, + eCSSKeyword_no_clip = 372, + eCSSKeyword_no_close_quote = 373, + eCSSKeyword_no_common_ligatures = 374, + eCSSKeyword_no_contextual = 375, + eCSSKeyword_no_discretionary_ligatures = 376, + eCSSKeyword_no_drag = 377, + eCSSKeyword_no_drop = 378, + eCSSKeyword_no_historical_ligatures = 379, + eCSSKeyword_no_open_quote = 380, + eCSSKeyword_no_repeat = 381, + eCSSKeyword_none = 382, + eCSSKeyword_normal = 383, + eCSSKeyword_not_allowed = 384, + eCSSKeyword_nowrap = 385, + eCSSKeyword_numeric = 386, + eCSSKeyword_ns_resize = 387, + eCSSKeyword_nw_resize = 388, + eCSSKeyword_nwse_resize = 389, + eCSSKeyword_oblique = 390, + eCSSKeyword_oldstyle_nums = 391, + eCSSKeyword_opacity = 392, + eCSSKeyword_open = 393, + eCSSKeyword_open_quote = 394, + eCSSKeyword_optional = 395, + eCSSKeyword_ordinal = 396, + eCSSKeyword_ornaments = 397, + eCSSKeyword_outset = 398, + eCSSKeyword_outside = 399, + eCSSKeyword_over = 400, + eCSSKeyword_overlay = 401, + eCSSKeyword_overline = 402, + eCSSKeyword_paint = 403, + eCSSKeyword_padding_box = 404, + eCSSKeyword_painted = 405, + eCSSKeyword_pan_x = 406, + eCSSKeyword_pan_y = 407, + eCSSKeyword_paused = 408, + eCSSKeyword_pc = 409, + eCSSKeyword_perspective = 410, + eCSSKeyword_petite_caps = 411, + eCSSKeyword_physical = 412, + eCSSKeyword_plaintext = 413, + eCSSKeyword_pointer = 414, + eCSSKeyword_polygon = 415, + eCSSKeyword_portrait = 416, + eCSSKeyword_pre = 417, + eCSSKeyword_pre_wrap = 418, + eCSSKeyword_pre_line = 419, + eCSSKeyword_preserve_3d = 420, + eCSSKeyword_progress = 421, + eCSSKeyword_progressive = 422, + eCSSKeyword_proportional_nums = 423, + eCSSKeyword_proportional_width = 424, + eCSSKeyword_proximity = 425, + eCSSKeyword_pt = 426, + eCSSKeyword_px = 427, + eCSSKeyword_rad = 428, + eCSSKeyword_read_only = 429, + eCSSKeyword_read_write = 430, + eCSSKeyword_relative = 431, + eCSSKeyword_repeat = 432, + eCSSKeyword_repeat_x = 433, + eCSSKeyword_repeat_y = 434, + eCSSKeyword_reverse = 435, + eCSSKeyword_ridge = 436, + eCSSKeyword_right = 437, + eCSSKeyword_rl = 438, + eCSSKeyword_rl_tb = 439, + eCSSKeyword_rotate = 440, + eCSSKeyword_rotate3d = 441, + eCSSKeyword_rotatex = 442, + eCSSKeyword_rotatey = 443, + eCSSKeyword_rotatez = 444, + eCSSKeyword_round = 445, + eCSSKeyword_row = 446, + eCSSKeyword_row_resize = 447, + eCSSKeyword_row_reverse = 448, + eCSSKeyword_rtl = 449, + eCSSKeyword_ruby = 450, + eCSSKeyword_ruby_base = 451, + eCSSKeyword_ruby_base_container = 452, + eCSSKeyword_ruby_text = 453, + eCSSKeyword_ruby_text_container = 454, + eCSSKeyword_running = 455, + eCSSKeyword_s = 456, + eCSSKeyword_s_resize = 457, + eCSSKeyword_safe = 458, + eCSSKeyword_saturate = 459, + eCSSKeyword_saturation = 460, + eCSSKeyword_scale = 461, + eCSSKeyword_scale_down = 462, + eCSSKeyword_scale3d = 463, + eCSSKeyword_scalex = 464, + eCSSKeyword_scaley = 465, + eCSSKeyword_scalez = 466, + eCSSKeyword_screen = 467, + eCSSKeyword_script = 468, + eCSSKeyword_scroll = 469, + eCSSKeyword_scrollbar = 470, + eCSSKeyword_scrollbar_small = 471, + eCSSKeyword_scrollbar_horizontal = 472, + eCSSKeyword_scrollbar_vertical = 473, + eCSSKeyword_se_resize = 474, + eCSSKeyword_select_after = 475, + eCSSKeyword_select_all = 476, + eCSSKeyword_select_before = 477, + eCSSKeyword_select_menu = 478, + eCSSKeyword_select_same = 479, + eCSSKeyword_self_end = 480, + eCSSKeyword_self_start = 481, + eCSSKeyword_semi_condensed = 482, + eCSSKeyword_semi_expanded = 483, + eCSSKeyword_separate = 484, + eCSSKeyword_sepia = 485, + eCSSKeyword_serif = 486, + eCSSKeyword_sesame = 487, + eCSSKeyword_show = 488, + eCSSKeyword_sideways = 489, + eCSSKeyword_sideways_lr = 490, + eCSSKeyword_sideways_right = 491, + eCSSKeyword_sideways_rl = 492, + eCSSKeyword_simp_chinese_formal = 493, + eCSSKeyword_simp_chinese_informal = 494, + eCSSKeyword_simplified = 495, + eCSSKeyword_skew = 496, + eCSSKeyword_skewx = 497, + eCSSKeyword_skewy = 498, + eCSSKeyword_slashed_zero = 499, + eCSSKeyword_slice = 500, + eCSSKeyword_small = 501, + eCSSKeyword_small_caps = 502, + eCSSKeyword_small_caption = 503, + eCSSKeyword_smaller = 504, + eCSSKeyword_smooth = 505, + eCSSKeyword_soft = 506, + eCSSKeyword_soft_light = 507, + eCSSKeyword_solid = 508, + eCSSKeyword_space_around = 509, + eCSSKeyword_space_between = 510, + eCSSKeyword_space_evenly = 511, + eCSSKeyword_span = 512, + eCSSKeyword_spell_out = 513, + eCSSKeyword_square = 514, + eCSSKeyword_stacked_fractions = 515, + eCSSKeyword_start = 516, + eCSSKeyword_static = 517, + eCSSKeyword_standalone = 518, + eCSSKeyword_status_bar = 519, + eCSSKeyword_step_end = 520, + eCSSKeyword_step_start = 521, + eCSSKeyword_sticky = 522, + eCSSKeyword_stretch = 523, + eCSSKeyword_stretch_to_fit = 524, + eCSSKeyword_stretched = 525, + eCSSKeyword_strict = 526, + eCSSKeyword_stroke = 527, + eCSSKeyword_stroke_box = 528, + eCSSKeyword_style = 529, + eCSSKeyword_styleset = 530, + eCSSKeyword_stylistic = 531, + eCSSKeyword_sub = 532, + eCSSKeyword_subgrid = 533, + eCSSKeyword_subtract = 534, + eCSSKeyword_super = 535, + eCSSKeyword_sw_resize = 536, + eCSSKeyword_swash = 537, + eCSSKeyword_swap = 538, + eCSSKeyword_table = 539, + eCSSKeyword_table_caption = 540, + eCSSKeyword_table_cell = 541, + eCSSKeyword_table_column = 542, + eCSSKeyword_table_column_group = 543, + eCSSKeyword_table_footer_group = 544, + eCSSKeyword_table_header_group = 545, + eCSSKeyword_table_row = 546, + eCSSKeyword_table_row_group = 547, + eCSSKeyword_tabular_nums = 548, + eCSSKeyword_tailed = 549, + eCSSKeyword_tb = 550, + eCSSKeyword_tb_rl = 551, + eCSSKeyword_text = 552, + eCSSKeyword_text_bottom = 553, + eCSSKeyword_text_top = 554, + eCSSKeyword_thick = 555, + eCSSKeyword_thin = 556, + eCSSKeyword_threeddarkshadow = 557, + eCSSKeyword_threedface = 558, + eCSSKeyword_threedhighlight = 559, + eCSSKeyword_threedlightshadow = 560, + eCSSKeyword_threedshadow = 561, + eCSSKeyword_titling_caps = 562, + eCSSKeyword_toggle = 563, + eCSSKeyword_top = 564, + eCSSKeyword_top_outside = 565, + eCSSKeyword_trad_chinese_formal = 566, + eCSSKeyword_trad_chinese_informal = 567, + eCSSKeyword_traditional = 568, + eCSSKeyword_translate = 569, + eCSSKeyword_translate3d = 570, + eCSSKeyword_translatex = 571, + eCSSKeyword_translatey = 572, + eCSSKeyword_translatez = 573, + eCSSKeyword_transparent = 574, + eCSSKeyword_triangle = 575, + eCSSKeyword_tri_state = 576, + eCSSKeyword_ultra_condensed = 577, + eCSSKeyword_ultra_expanded = 578, + eCSSKeyword_under = 579, + eCSSKeyword_underline = 580, + eCSSKeyword_unicase = 581, + eCSSKeyword_unsafe = 582, + eCSSKeyword_unset = 583, + eCSSKeyword_uppercase = 584, + eCSSKeyword_upright = 585, + eCSSKeyword_vertical = 586, + eCSSKeyword_vertical_lr = 587, + eCSSKeyword_vertical_rl = 588, + eCSSKeyword_vertical_text = 589, + eCSSKeyword_view_box = 590, + eCSSKeyword_visible = 591, + eCSSKeyword_visiblefill = 592, + eCSSKeyword_visiblepainted = 593, + eCSSKeyword_visiblestroke = 594, + eCSSKeyword_w_resize = 595, + eCSSKeyword_wait = 596, + eCSSKeyword_wavy = 597, + eCSSKeyword_weight = 598, + eCSSKeyword_wider = 599, + eCSSKeyword_window = 600, + eCSSKeyword_windowframe = 601, + eCSSKeyword_windowtext = 602, + eCSSKeyword_words = 603, + eCSSKeyword_wrap = 604, + eCSSKeyword_wrap_reverse = 605, + eCSSKeyword_write_only = 606, + eCSSKeyword_x_large = 607, + eCSSKeyword_x_small = 608, + eCSSKeyword_xx_large = 609, + eCSSKeyword_xx_small = 610, + eCSSKeyword_zoom_in = 611, + eCSSKeyword_zoom_out = 612, + eCSSKeyword_radio = 613, + eCSSKeyword_checkbox = 614, + eCSSKeyword_button_bevel = 615, + eCSSKeyword_toolbox = 616, + eCSSKeyword_toolbar = 617, + eCSSKeyword_toolbarbutton = 618, + eCSSKeyword_toolbargripper = 619, + eCSSKeyword_dualbutton = 620, + eCSSKeyword_toolbarbutton_dropdown = 621, + eCSSKeyword_button_arrow_up = 622, + eCSSKeyword_button_arrow_down = 623, + eCSSKeyword_button_arrow_next = 624, + eCSSKeyword_button_arrow_previous = 625, + eCSSKeyword_separator = 626, + eCSSKeyword_splitter = 627, + eCSSKeyword_statusbar = 628, + eCSSKeyword_statusbarpanel = 629, + eCSSKeyword_resizerpanel = 630, + eCSSKeyword_resizer = 631, + eCSSKeyword_listbox = 632, + eCSSKeyword_listitem = 633, + eCSSKeyword_numbers = 634, + eCSSKeyword_number_input = 635, + eCSSKeyword_treeview = 636, + eCSSKeyword_treeitem = 637, + eCSSKeyword_treetwisty = 638, + eCSSKeyword_treetwistyopen = 639, + eCSSKeyword_treeline = 640, + eCSSKeyword_treeheader = 641, + eCSSKeyword_treeheadercell = 642, + eCSSKeyword_treeheadersortarrow = 643, + eCSSKeyword_progressbar = 644, + eCSSKeyword_progressbar_vertical = 645, + eCSSKeyword_progresschunk = 646, + eCSSKeyword_progresschunk_vertical = 647, + eCSSKeyword_tab = 648, + eCSSKeyword_tabpanels = 649, + eCSSKeyword_tabpanel = 650, + eCSSKeyword_tab_scroll_arrow_back = 651, + eCSSKeyword_tab_scroll_arrow_forward = 652, + eCSSKeyword_tooltip = 653, + eCSSKeyword_spinner = 654, + eCSSKeyword_spinner_upbutton = 655, + eCSSKeyword_spinner_downbutton = 656, + eCSSKeyword_spinner_textfield = 657, + eCSSKeyword_scrollbarbutton_up = 658, + eCSSKeyword_scrollbarbutton_down = 659, + eCSSKeyword_scrollbarbutton_left = 660, + eCSSKeyword_scrollbarbutton_right = 661, + eCSSKeyword_scrollbartrack_horizontal = 662, + eCSSKeyword_scrollbartrack_vertical = 663, + eCSSKeyword_scrollbarthumb_horizontal = 664, + eCSSKeyword_scrollbarthumb_vertical = 665, + eCSSKeyword_sheet = 666, + eCSSKeyword_textfield = 667, + eCSSKeyword_textfield_multiline = 668, + eCSSKeyword_caret = 669, + eCSSKeyword_searchfield = 670, + eCSSKeyword_menubar = 671, + eCSSKeyword_menupopup = 672, + eCSSKeyword_menuitem = 673, + eCSSKeyword_checkmenuitem = 674, + eCSSKeyword_radiomenuitem = 675, + eCSSKeyword_menucheckbox = 676, + eCSSKeyword_menuradio = 677, + eCSSKeyword_menuseparator = 678, + eCSSKeyword_menuarrow = 679, + eCSSKeyword_menuimage = 680, + eCSSKeyword_menuitemtext = 681, + eCSSKeyword_menulist = 682, + eCSSKeyword_menulist_button = 683, + eCSSKeyword_menulist_text = 684, + eCSSKeyword_menulist_textfield = 685, + eCSSKeyword_meterbar = 686, + eCSSKeyword_meterchunk = 687, + eCSSKeyword_minimal_ui = 688, + eCSSKeyword_range = 689, + eCSSKeyword_range_thumb = 690, + eCSSKeyword_sans_serif = 691, + eCSSKeyword_sans_serif_bold_italic = 692, + eCSSKeyword_sans_serif_italic = 693, + eCSSKeyword_scale_horizontal = 694, + eCSSKeyword_scale_vertical = 695, + eCSSKeyword_scalethumb_horizontal = 696, + eCSSKeyword_scalethumb_vertical = 697, + eCSSKeyword_scalethumbstart = 698, + eCSSKeyword_scalethumbend = 699, + eCSSKeyword_scalethumbtick = 700, + eCSSKeyword_groupbox = 701, + eCSSKeyword_checkbox_container = 702, + eCSSKeyword_radio_container = 703, + eCSSKeyword_checkbox_label = 704, + eCSSKeyword_radio_label = 705, + eCSSKeyword_button_focus = 706, + eCSSKeyword__moz_win_media_toolbox = 707, + eCSSKeyword__moz_win_communications_toolbox = 708, + eCSSKeyword__moz_win_browsertabbar_toolbox = 709, + eCSSKeyword__moz_win_mediatext = 710, + eCSSKeyword__moz_win_communicationstext = 711, + eCSSKeyword__moz_win_glass = 712, + eCSSKeyword__moz_win_borderless_glass = 713, + eCSSKeyword__moz_window_titlebar = 714, + eCSSKeyword__moz_window_titlebar_maximized = 715, + eCSSKeyword__moz_window_frame_left = 716, + eCSSKeyword__moz_window_frame_right = 717, + eCSSKeyword__moz_window_frame_bottom = 718, + eCSSKeyword__moz_window_button_close = 719, + eCSSKeyword__moz_window_button_minimize = 720, + eCSSKeyword__moz_window_button_maximize = 721, + eCSSKeyword__moz_window_button_restore = 722, + eCSSKeyword__moz_window_button_box = 723, + eCSSKeyword__moz_window_button_box_maximized = 724, + eCSSKeyword__moz_mac_help_button = 725, + eCSSKeyword__moz_win_exclude_glass = 726, + eCSSKeyword__moz_mac_vibrancy_light = 727, + eCSSKeyword__moz_mac_vibrancy_dark = 728, + eCSSKeyword__moz_mac_disclosure_button_closed = 729, + eCSSKeyword__moz_mac_disclosure_button_open = 730, + eCSSKeyword__moz_mac_source_list = 731, + eCSSKeyword__moz_mac_source_list_selection = 732, + eCSSKeyword__moz_mac_active_source_list_selection = 733, + eCSSKeyword_alphabetic = 734, + eCSSKeyword_bevel = 735, + eCSSKeyword_butt = 736, + eCSSKeyword_central = 737, + eCSSKeyword_crispedges = 738, + eCSSKeyword_evenodd = 739, + eCSSKeyword_geometricprecision = 740, + eCSSKeyword_hanging = 741, + eCSSKeyword_ideographic = 742, + eCSSKeyword_linearrgb = 743, + eCSSKeyword_mathematical = 744, + eCSSKeyword_miter = 745, + eCSSKeyword_no_change = 746, + eCSSKeyword_non_scaling_stroke = 747, + eCSSKeyword_nonzero = 748, + eCSSKeyword_optimizelegibility = 749, + eCSSKeyword_optimizequality = 750, + eCSSKeyword_optimizespeed = 751, + eCSSKeyword_reset_size = 752, + eCSSKeyword_srgb = 753, + eCSSKeyword_symbolic = 754, + eCSSKeyword_symbols = 755, + eCSSKeyword_text_after_edge = 756, + eCSSKeyword_text_before_edge = 757, + eCSSKeyword_use_script = 758, + eCSSKeyword__moz_crisp_edges = 759, + eCSSKeyword_space = 760, + eCSSKeyword_COUNT = 761, } pub const nsCSSPropertyID_eCSSProperty_COUNT_no_shorthands: root::nsCSSPropertyID = @@ -28208,7 +28239,7 @@ pub mod root { ) , "::" , stringify ! ( mQuotePairs ) )); } #[test] - fn __bindgen_test_layout_StaticRefPtr_instantiation_149376() { + fn __bindgen_test_layout_StaticRefPtr_instantiation_150620() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -30306,6 +30337,11 @@ pub mod root { pub struct RawServoAnimationValue { _unused: [u8; 0], } + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct nsCSSPropertyIDSet { + _unused: [u8; 0], + } pub type RawGeckoNode = root::nsINode; pub type RawGeckoElement = root::mozilla::dom::Element; pub type RawGeckoDocument = root::nsIDocument; @@ -30325,6 +30361,8 @@ pub mod root { pub type RawGeckoComputedTiming = root::mozilla::ComputedTiming; pub type RawGeckoServoStyleRuleList = root::nsTArray<*const root::RawServoStyleRule>; + pub type RawGeckoCSSPropertyIDList = + root::nsTArray; pub type RawServoAnimationValueMapBorrowedMut = *mut root::RawServoAnimationValueMap; pub type RawGeckoNodeBorrowed = *const root::RawGeckoNode; @@ -30353,6 +30391,8 @@ pub mod root { *const root::RawGeckoComputedTiming; pub type RawGeckoServoStyleRuleListBorrowedMut = *mut root::RawGeckoServoStyleRuleList; + pub type RawGeckoCSSPropertyIDListBorrowed = + *const root::RawGeckoCSSPropertyIDList; /** * Utility class to provide scaling defined in a keySplines element. */ @@ -31486,7 +31526,7 @@ pub mod root { } pub type __builtin_va_list = [root::__va_list_tag; 1usize]; #[test] - fn __bindgen_test_layout_IntegralConstant_instantiation_170931() { + fn __bindgen_test_layout_IntegralConstant_instantiation_179522() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( u8 ) )); @@ -31495,7 +31535,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_IntegralConstant_instantiation_170935() { + fn __bindgen_test_layout_IntegralConstant_instantiation_179526() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( u8 ) )); @@ -31504,7 +31544,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsReadingIterator_instantiation_171149() { + fn __bindgen_test_layout_nsReadingIterator_instantiation_179740() { assert_eq!(::std::mem::size_of::>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31515,7 +31555,7 @@ pub mod root { root::nsReadingIterator ) )); } #[test] - fn __bindgen_test_layout_nsWritingIterator_instantiation_171153() { + fn __bindgen_test_layout_nsWritingIterator_instantiation_179744() { assert_eq!(::std::mem::size_of::>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31526,7 +31566,7 @@ pub mod root { root::nsWritingIterator ) )); } #[test] - fn __bindgen_test_layout_nsReadingIterator_instantiation_171226() { + fn __bindgen_test_layout_nsReadingIterator_instantiation_179817() { assert_eq!(::std::mem::size_of::>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31537,7 +31577,7 @@ pub mod root { root::nsReadingIterator<::std::os::raw::c_char> ) )); } #[test] - fn __bindgen_test_layout_nsWritingIterator_instantiation_171230() { + fn __bindgen_test_layout_nsWritingIterator_instantiation_179821() { assert_eq!(::std::mem::size_of::>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31548,7 +31588,7 @@ pub mod root { root::nsWritingIterator<::std::os::raw::c_char> ) )); } #[test] - fn __bindgen_test_layout_atomic_instantiation_173213() { + fn __bindgen_test_layout_atomic_instantiation_181804() { assert_eq!(::std::mem::size_of::() , 4usize , concat ! ( "Size of template specialization: " , stringify ! ( u32 ) )); @@ -31557,7 +31597,7 @@ pub mod root { u32 ) )); } #[test] - fn __bindgen_test_layout_atomic_instantiation_173221() { + fn __bindgen_test_layout_atomic_instantiation_181812() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( u64 ) )); @@ -31566,7 +31606,7 @@ pub mod root { u64 ) )); } #[test] - fn __bindgen_test_layout__bindgen_ty_id_173478_instantiation_173475() { + fn __bindgen_test_layout__bindgen_ty_id_182069_instantiation_182066() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( u8 ) )); @@ -31575,7 +31615,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout__bindgen_ty_id_173511_instantiation_173508() { + fn __bindgen_test_layout__bindgen_ty_id_182102_instantiation_182099() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( u8 ) )); @@ -31584,7 +31624,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_173779() { + fn __bindgen_test_layout_nsTArray_instantiation_182370() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31595,7 +31635,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_174604() { + fn __bindgen_test_layout_Handle_instantiation_183195() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31606,7 +31646,7 @@ pub mod root { root::JS::Handle<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_174620() { + fn __bindgen_test_layout_Handle_instantiation_183211() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31617,7 +31657,7 @@ pub mod root { root::JS::Handle ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_174630() { + fn __bindgen_test_layout_MutableHandle_instantiation_183221() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31628,7 +31668,7 @@ pub mod root { root::JS::MutableHandle<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_174646() { + fn __bindgen_test_layout_MutableHandle_instantiation_183237() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31639,7 +31679,7 @@ pub mod root { root::JS::MutableHandle ) )); } #[test] - fn __bindgen_test_layout_Rooted_instantiation_174649() { + fn __bindgen_test_layout_Rooted_instantiation_183240() { assert_eq!(::std::mem::size_of::<[u64; 3usize]>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31650,7 +31690,7 @@ pub mod root { [u64; 3usize] ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_174986() { + fn __bindgen_test_layout_DeletePolicy_instantiation_183577() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31661,7 +31701,7 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_179915() { + fn __bindgen_test_layout_nsTArray_instantiation_188506() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31672,7 +31712,7 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_179919() { + fn __bindgen_test_layout_nsTArray_instantiation_188510() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31683,7 +31723,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_179932() { + fn __bindgen_test_layout_nsTArray_instantiation_188523() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31694,7 +31734,7 @@ pub mod root { root::nsTArray<::std::os::raw::c_uint> ) )); } #[test] - fn __bindgen_test_layout_TenuredHeap_instantiation_180792() { + fn __bindgen_test_layout_TenuredHeap_instantiation_189393() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31705,7 +31745,7 @@ pub mod root { root::JS::TenuredHeap ) )); } #[test] - fn __bindgen_test_layout_Heap_instantiation_180882() { + fn __bindgen_test_layout_Heap_instantiation_189483() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31716,7 +31756,7 @@ pub mod root { root::JS::Heap<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_TErrorResult_instantiation_180992() { + fn __bindgen_test_layout_TErrorResult_instantiation_189593() { assert_eq!(::std::mem::size_of::() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31727,7 +31767,7 @@ pub mod root { root::mozilla::binding_danger::TErrorResult ) )); } #[test] - fn __bindgen_test_layout_TErrorResult_instantiation_181008() { + fn __bindgen_test_layout_TErrorResult_instantiation_189609() { assert_eq!(::std::mem::size_of::() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31738,7 +31778,7 @@ pub mod root { root::mozilla::binding_danger::TErrorResult ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_181014() { + fn __bindgen_test_layout_already_AddRefed_instantiation_189615() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31749,7 +31789,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_181066() { + fn __bindgen_test_layout_already_AddRefed_instantiation_189667() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31760,7 +31800,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_181540() { + fn __bindgen_test_layout_RefPtr_instantiation_190141() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31771,7 +31811,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_181886() { + fn __bindgen_test_layout_already_AddRefed_instantiation_190487() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31782,7 +31822,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_182129() { + fn __bindgen_test_layout_already_AddRefed_instantiation_190730() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31793,7 +31833,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_182276() { + fn __bindgen_test_layout_already_AddRefed_instantiation_190877() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31804,7 +31844,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_186364() { + fn __bindgen_test_layout_DeletePolicy_instantiation_194972() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31815,7 +31855,7 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_186362() { + fn __bindgen_test_layout_UniquePtr_instantiation_194970() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31826,7 +31866,7 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_iterator_instantiation_186397() { + fn __bindgen_test_layout_iterator_instantiation_195005() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31837,7 +31877,7 @@ pub mod root { root::std::iterator ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_186951() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_195571() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31848,7 +31888,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_Heap_instantiation_188204() { + fn __bindgen_test_layout_Heap_instantiation_196824() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31859,7 +31899,7 @@ pub mod root { root::JS::Heap ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_188546() { + fn __bindgen_test_layout_nsTArray_instantiation_197166() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31872,7 +31912,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_LinkedList_instantiation_188822() { + fn __bindgen_test_layout_LinkedList_instantiation_197442() { assert_eq!(::std::mem::size_of::() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31883,7 +31923,7 @@ pub mod root { root::mozilla::LinkedList ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_188838() { + fn __bindgen_test_layout_RefPtr_instantiation_197458() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31894,7 +31934,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_188837() { + fn __bindgen_test_layout_nsTArray_instantiation_197457() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31907,7 +31947,7 @@ pub mod root { )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_188867() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_197487() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31918,7 +31958,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_188866() { + fn __bindgen_test_layout_nsTArray_instantiation_197486() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31929,7 +31969,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_188912() { + fn __bindgen_test_layout_already_AddRefed_instantiation_197532() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31940,7 +31980,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_189077() { + fn __bindgen_test_layout_already_AddRefed_instantiation_197697() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31951,7 +31991,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_189404() { + fn __bindgen_test_layout_already_AddRefed_instantiation_198024() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31962,7 +32002,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_189497() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_198117() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31973,7 +32013,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_189534() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_198154() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31984,7 +32024,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_189790() { + fn __bindgen_test_layout_DefaultDelete_instantiation_198410() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31995,7 +32035,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_189788() { + fn __bindgen_test_layout_UniquePtr_instantiation_198408() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32006,7 +32046,7 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_190328() { + fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_198959() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32019,7 +32059,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsDataHashtable_instantiation_190327() { + fn __bindgen_test_layout_nsDataHashtable_instantiation_198958() { assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32030,7 +32070,7 @@ pub mod root { [u64; 5usize] ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_190532() { + fn __bindgen_test_layout_nsTArray_instantiation_199163() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32041,7 +32081,7 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_SupportsWeakPtr_instantiation_190579() { + fn __bindgen_test_layout_SupportsWeakPtr_instantiation_199210() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( u64 ) )); @@ -32050,7 +32090,7 @@ pub mod root { u64 ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_190751() { + fn __bindgen_test_layout_nsTArray_instantiation_199387() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32061,7 +32101,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_190867() { + fn __bindgen_test_layout_DefaultDelete_instantiation_199503() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32072,7 +32112,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_191033() { + fn __bindgen_test_layout_nsTArray_instantiation_199669() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32083,7 +32123,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_nsPIDOMWindow_instantiation_191820() { + fn __bindgen_test_layout_nsPIDOMWindow_instantiation_200458() { assert_eq!(::std::mem::size_of::<[u64; 28usize]>() , 224usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32094,7 +32134,7 @@ pub mod root { [u64; 28usize] ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_191872() { + fn __bindgen_test_layout_already_AddRefed_instantiation_200550() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32105,7 +32145,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashtable_instantiation_192053() { + fn __bindgen_test_layout_nsRefPtrHashtable_instantiation_200740() { assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32116,7 +32156,7 @@ pub mod root { [u64; 5usize] ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_192554() { + fn __bindgen_test_layout_nsPtrHashKey_instantiation_201257() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32127,7 +32167,7 @@ pub mod root { root::nsPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_OwningNonNull_instantiation_192669() { + fn __bindgen_test_layout_OwningNonNull_instantiation_201372() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32138,7 +32178,7 @@ pub mod root { root::mozilla::OwningNonNull ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_192954() { + fn __bindgen_test_layout_nsPtrHashKey_instantiation_201657() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32149,7 +32189,7 @@ pub mod root { root::nsPtrHashKey<::std::os::raw::c_void> ) )); } #[test] - fn __bindgen_test_layout_PointTyped_instantiation_193745() { + fn __bindgen_test_layout_PointTyped_instantiation_202448() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32160,7 +32200,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_IntPointTyped_instantiation_193750() { + fn __bindgen_test_layout_IntPointTyped_instantiation_202453() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32171,7 +32211,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_SizeTyped_instantiation_193753() { + fn __bindgen_test_layout_SizeTyped_instantiation_202456() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32182,7 +32222,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_RectTyped_instantiation_193761() { + fn __bindgen_test_layout_RectTyped_instantiation_202464() { assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32193,7 +32233,7 @@ pub mod root { [u32; 4usize] ) )); } #[test] - fn __bindgen_test_layout_IntPointTyped_instantiation_193793() { + fn __bindgen_test_layout_IntPointTyped_instantiation_202496() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32204,7 +32244,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_IntSizeTyped_instantiation_193801() { + fn __bindgen_test_layout_IntSizeTyped_instantiation_202504() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32215,7 +32255,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_IntRectTyped_instantiation_193809() { + fn __bindgen_test_layout_IntRectTyped_instantiation_202512() { assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32226,7 +32266,7 @@ pub mod root { [u32; 4usize] ) )); } #[test] - fn __bindgen_test_layout_MarginTyped_instantiation_193976() { + fn __bindgen_test_layout_MarginTyped_instantiation_202679() { assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32237,7 +32277,7 @@ pub mod root { [u32; 4usize] ) )); } #[test] - fn __bindgen_test_layout_RectTyped_instantiation_194011() { + fn __bindgen_test_layout_RectTyped_instantiation_202714() { assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32248,7 +32288,7 @@ pub mod root { [u32; 4usize] ) )); } #[test] - fn __bindgen_test_layout_IntRectTyped_instantiation_194016() { + fn __bindgen_test_layout_IntRectTyped_instantiation_202719() { assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32259,7 +32299,7 @@ pub mod root { [u32; 4usize] ) )); } #[test] - fn __bindgen_test_layout_ScaleFactor_instantiation_194062() { + fn __bindgen_test_layout_ScaleFactor_instantiation_202765() { assert_eq!(::std::mem::size_of::() , 4usize , concat ! ( "Size of template specialization: " , stringify ! ( u32 ) )); @@ -32268,7 +32308,7 @@ pub mod root { u32 ) )); } #[test] - fn __bindgen_test_layout_ScaleFactors2D_instantiation_194162() { + fn __bindgen_test_layout_ScaleFactors2D_instantiation_202865() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32279,7 +32319,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_ScaleFactors2D_instantiation_194170() { + fn __bindgen_test_layout_ScaleFactors2D_instantiation_202873() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32290,7 +32330,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_ScaleFactors2D_instantiation_194214() { + fn __bindgen_test_layout_ScaleFactors2D_instantiation_202917() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32301,7 +32341,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_194844() { + fn __bindgen_test_layout_nsTArray_instantiation_203547() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32314,7 +32354,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_194860() { + fn __bindgen_test_layout_nsPtrHashKey_instantiation_203563() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32325,7 +32365,7 @@ pub mod root { root::nsPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_nsPIDOMWindow_instantiation_197996() { + fn __bindgen_test_layout_nsPIDOMWindow_instantiation_206835() { assert_eq!(::std::mem::size_of::<[u64; 28usize]>() , 224usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32336,7 +32376,7 @@ pub mod root { [u64; 28usize] ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_198626() { + fn __bindgen_test_layout_already_AddRefed_instantiation_207465() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32347,7 +32387,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_198717() { + fn __bindgen_test_layout_DefaultDelete_instantiation_207556() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32358,7 +32398,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashtable_instantiation_198721() { + fn __bindgen_test_layout_nsRefPtrHashtable_instantiation_207560() { assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32369,7 +32409,7 @@ pub mod root { [u64; 5usize] ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_199910() { + fn __bindgen_test_layout_already_AddRefed_instantiation_208749() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32380,7 +32420,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_200497() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_209336() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32391,7 +32431,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_202040() { + fn __bindgen_test_layout_nsTArray_instantiation_210879() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32402,7 +32442,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_202052() { + fn __bindgen_test_layout_RefPtr_instantiation_210891() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32415,7 +32455,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_202051() { + fn __bindgen_test_layout_nsTArray_instantiation_210890() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32428,7 +32468,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_202085() { + fn __bindgen_test_layout_nsPtrHashKey_instantiation_210924() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32439,7 +32479,7 @@ pub mod root { root::nsPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_202182() { + fn __bindgen_test_layout_UniquePtr_instantiation_211021() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32450,7 +32490,7 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_nsDataHashtable_instantiation_203960() { + fn __bindgen_test_layout_nsDataHashtable_instantiation_212794() { assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32461,7 +32501,7 @@ pub mod root { [u64; 5usize] ) )); } #[test] - fn __bindgen_test_layout_OwningNonNull_instantiation_203999() { + fn __bindgen_test_layout_OwningNonNull_instantiation_212833() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32474,7 +32514,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_204022() { + fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_212856() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32485,7 +32525,7 @@ pub mod root { root::nsRefPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_204058() { + fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_212892() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32496,7 +32536,7 @@ pub mod root { root::nsRefPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_204603() { + fn __bindgen_test_layout_DefaultDelete_instantiation_213455() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32507,7 +32547,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_204617() { + fn __bindgen_test_layout_already_AddRefed_instantiation_213469() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32518,7 +32558,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_nsMainThreadPtrHolder_instantiation_204621() { + fn __bindgen_test_layout_nsMainThreadPtrHolder_instantiation_213473() { assert_eq!(::std::mem::size_of::>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32529,7 +32569,7 @@ pub mod root { root::nsMainThreadPtrHolder ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_204695() { + fn __bindgen_test_layout_nsPtrHashKey_instantiation_213547() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32540,7 +32580,7 @@ pub mod root { root::nsPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_204982() { + fn __bindgen_test_layout_DefaultDelete_instantiation_213834() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32551,7 +32591,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_204980() { + fn __bindgen_test_layout_UniquePtr_instantiation_213832() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32562,7 +32602,7 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_204988() { + fn __bindgen_test_layout_DefaultDelete_instantiation_213840() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32573,7 +32613,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_204986() { + fn __bindgen_test_layout_UniquePtr_instantiation_213838() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32584,7 +32624,7 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_205258() { + fn __bindgen_test_layout_Maybe_instantiation_214110() { assert_eq!(::std::mem::size_of::<[u64; 2usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32595,7 +32635,7 @@ pub mod root { [u64; 2usize] ) )); } #[test] - fn __bindgen_test_layout_SupportsWeakPtr_instantiation_205425() { + fn __bindgen_test_layout_SupportsWeakPtr_instantiation_214277() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( u64 ) )); @@ -32604,7 +32644,7 @@ pub mod root { u64 ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_205583() { + fn __bindgen_test_layout_Maybe_instantiation_214432() { assert_eq!(::std::mem::size_of::<[u32; 3usize]>() , 12usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32615,7 +32655,7 @@ pub mod root { [u32; 3usize] ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_205598() { + fn __bindgen_test_layout_already_AddRefed_instantiation_214447() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32626,7 +32666,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_205606() { + fn __bindgen_test_layout_DefaultDelete_instantiation_214455() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32637,7 +32677,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_205604() { + fn __bindgen_test_layout_UniquePtr_instantiation_214453() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32648,7 +32688,7 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_205645() { + fn __bindgen_test_layout_DefaultDelete_instantiation_214494() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32659,7 +32699,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_pair_instantiation_205796() { + fn __bindgen_test_layout_pair_instantiation_214645() { assert_eq!(::std::mem::size_of::>() , 32usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32670,7 +32710,7 @@ pub mod root { root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_205795() { + fn __bindgen_test_layout_nsTArray_instantiation_214644() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( @@ -32685,7 +32725,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_206789() { + fn __bindgen_test_layout_RefPtr_instantiation_215667() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32696,7 +32736,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_BaseTimeDuration_instantiation_208511() { + fn __bindgen_test_layout_BaseTimeDuration_instantiation_219659() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32707,7 +32747,7 @@ pub mod root { root::mozilla::BaseTimeDuration ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_209103() { + fn __bindgen_test_layout_nsTArray_instantiation_220251() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32720,7 +32760,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_209359() { + fn __bindgen_test_layout_Maybe_instantiation_220507() { assert_eq!(::std::mem::size_of::<[u64; 2usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32731,7 +32771,7 @@ pub mod root { [u64; 2usize] ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_209366() { + fn __bindgen_test_layout_Maybe_instantiation_220514() { assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32742,7 +32782,7 @@ pub mod root { [u64; 5usize] ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_209541() { + fn __bindgen_test_layout_RefPtr_instantiation_220689() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32753,7 +32793,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_Sequence_instantiation_209785() { + fn __bindgen_test_layout_Sequence_instantiation_220933() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( u64 ) )); @@ -32762,7 +32802,7 @@ pub mod root { u64 ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_210084() { + fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_221232() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32773,7 +32813,7 @@ pub mod root { root::nsRefPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_nsClassHashtable_instantiation_210083() { + fn __bindgen_test_layout_nsClassHashtable_instantiation_221231() { assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32784,7 +32824,7 @@ pub mod root { [u64; 5usize] ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_211313() { + fn __bindgen_test_layout_nsTArray_instantiation_222483() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32795,7 +32835,7 @@ pub mod root { root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); } #[test] - fn __bindgen_test_layout_nsAutoPtr_instantiation_211349() { + fn __bindgen_test_layout_nsAutoPtr_instantiation_222519() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( diff --git a/servo/components/style/matching.rs b/servo/components/style/matching.rs index 289a6fb19756..0c4e53cfc4c9 100644 --- a/servo/components/style/matching.rs +++ b/servo/components/style/matching.rs @@ -379,6 +379,39 @@ pub enum StyleSharingResult { StyleWasShared(usize), } +/// The result status for match primary rules. +#[derive(Debug)] +pub struct RulesMatchedResult { + /// Indicate that the rule nodes are changed. + rule_nodes_changed: bool, + /// Indicate that there are any changes of important rules overriding animations. + important_rules_overriding_animation_changed: bool, +} + +bitflags! { + /// Flags that represent the result of replace_rules. + pub flags RulesChanged: u8 { + /// Normal rules are changed. + const NORMAL_RULES_CHANGED = 0x01, + /// Important rules are changed. + const IMPORTANT_RULES_CHANGED = 0x02, + } +} + +impl RulesChanged { + /// Return true if there are any normal rules changed. + #[inline] + pub fn normal_rules_changed(&self) -> bool { + self.contains(NORMAL_RULES_CHANGED) + } + + /// Return true if there are any important rules changed. + #[inline] + pub fn important_rules_changed(&self) -> bool { + self.contains(IMPORTANT_RULES_CHANGED) + } +} + trait PrivateMatchMethods: TElement { /// Returns the closest parent element that doesn't have a display: contents /// style (and thus generates a box). @@ -536,7 +569,8 @@ trait PrivateMatchMethods: TElement { /// setting them on the ElementData. fn cascade_primary(&self, context: &mut StyleContext, - data: &mut ElementData) { + data: &mut ElementData, + important_rules_changed: bool) { // Collect some values. let (mut styles, restyle) = data.styles_and_restyle_mut(); let mut primary_style = &mut styles.primary; @@ -551,7 +585,8 @@ trait PrivateMatchMethods: TElement { self.process_animations(context, &mut old_values, &mut new_values, - primary_style); + primary_style, + important_rules_changed); } if let Some(old) = old_values { @@ -647,8 +682,9 @@ trait PrivateMatchMethods: TElement { context: &mut StyleContext, old_values: &mut Option>, new_values: &mut Arc, - primary_style: &ComputedStyle) { - use context::{CSS_ANIMATIONS, CSS_TRANSITIONS, EFFECT_PROPERTIES}; + primary_style: &ComputedStyle, + important_rules_changed: bool) { + use context::{CASCADE_RESULTS, CSS_ANIMATIONS, CSS_TRANSITIONS, EFFECT_PROPERTIES}; use context::UpdateAnimationsTasks; let mut tasks = UpdateAnimationsTasks::empty(); @@ -694,6 +730,9 @@ trait PrivateMatchMethods: TElement { if self.has_animations() { tasks.insert(EFFECT_PROPERTIES); + if important_rules_changed { + tasks.insert(CASCADE_RESULTS); + } } if !tasks.is_empty() { @@ -709,7 +748,8 @@ trait PrivateMatchMethods: TElement { context: &mut StyleContext, old_values: &mut Option>, new_values: &mut Arc, - _primary_style: &ComputedStyle) { + _primary_style: &ComputedStyle, + _important_rules_changed: bool) { use animation; let possibly_expired_animations = @@ -881,17 +921,14 @@ pub trait MatchMethods : TElement { { // Perform selector matching for the primary style. let mut relations = StyleRelations::empty(); - let _rule_node_changed = self.match_primary(context, - data, - &mut relations); + let result = self.match_primary(context, data, &mut relations); // Cascade properties and compute primary values. - self.cascade_primary(context, data); + self.cascade_primary(context, data, result.important_rules_overriding_animation_changed); // Match and cascade eager pseudo-elements. if !data.styles().is_display_none() { - let _pseudo_rule_nodes_changed = - self.match_pseudos(context, data); + let _pseudo_rule_nodes_changed = self.match_pseudos(context, data); self.cascade_pseudos(context, data); } @@ -925,20 +962,22 @@ pub trait MatchMethods : TElement { /// Performs the cascade, without matching. fn cascade_primary_and_pseudos(&self, context: &mut StyleContext, - mut data: &mut ElementData) + mut data: &mut ElementData, + important_rules_changed: bool) { - self.cascade_primary(context, &mut data); + self.cascade_primary(context, &mut data, important_rules_changed); self.cascade_pseudos(context, &mut data); } /// Runs selector matching to (re)compute the primary rule node for this element. /// - /// Returns whether the primary rule node changed. + /// Returns RulesMatchedResult which indicates whether the primary rule node changed + /// and whether the change includes important rules. fn match_primary(&self, context: &mut StyleContext, data: &mut ElementData, relations: &mut StyleRelations) - -> bool + -> RulesMatchedResult { let implemented_pseudo = self.implemented_pseudo_element(); if let Some(ref pseudo) = implemented_pseudo { @@ -977,7 +1016,16 @@ pub trait MatchMethods : TElement { } } - return data.set_primary_rules(rules); + let important_rules_changed = + self.has_animations() && + data.has_styles() && + data.important_rules_are_different(&rules, + &context.shared.guards); + + return RulesMatchedResult { + rule_nodes_changed: data.set_primary_rules(rules), + important_rules_overriding_animation_changed: important_rules_changed, + }; } } @@ -1015,7 +1063,15 @@ pub trait MatchMethods : TElement { &mut applicable_declarations, &context.shared.guards); - return data.set_primary_rules(primary_rule_node); + let important_rules_changed = self.has_animations() && + data.has_styles() && + data.important_rules_are_different(&primary_rule_node, + &context.shared.guards); + + RulesMatchedResult { + rule_nodes_changed: data.set_primary_rules(primary_rule_node), + important_rules_overriding_animation_changed: important_rules_changed, + } } /// Runs selector matching to (re)compute eager pseudo-element rule nodes @@ -1155,18 +1211,19 @@ pub trait MatchMethods : TElement { } /// Updates the rule nodes without re-running selector matching, using just - /// the rule tree. Returns true if the rule nodes changed. + /// the rule tree. Returns RulesChanged which indicates whether the rule nodes changed + /// and whether the important rules changed. fn replace_rules(&self, hint: RestyleHint, context: &StyleContext, data: &mut AtomicRefMut) - -> bool { + -> RulesChanged { use properties::PropertyDeclarationBlock; use shared_lock::Locked; let element_styles = &mut data.styles_mut(); let primary_rules = &mut element_styles.primary.rules; - let mut rule_node_changed = false; + let mut result = RulesChanged::empty(); { let mut replace_rule_node = |level: CascadeLevel, @@ -1176,7 +1233,11 @@ pub trait MatchMethods : TElement { .update_rule_at_level(level, pdb, path, &context.shared.guards); if let Some(n) = new_node { *path = n; - rule_node_changed = true; + if level.is_important() { + result.insert(IMPORTANT_RULES_CHANGED); + } else { + result.insert(NORMAL_RULES_CHANGED); + } } }; @@ -1224,7 +1285,7 @@ pub trait MatchMethods : TElement { } } - rule_node_changed + result } /// Attempts to share a style with another node. This method is unsafe diff --git a/servo/components/style/properties/gecko.mako.rs b/servo/components/style/properties/gecko.mako.rs index 1f6957ba86fa..8ac9bfd3861f 100644 --- a/servo/components/style/properties/gecko.mako.rs +++ b/servo/components/style/properties/gecko.mako.rs @@ -2241,7 +2241,7 @@ fn static_assert() { % endfor } - pub fn convert_transform(input: Vec, + pub fn convert_transform(input: &[longhands::transform::computed_value::ComputedOperation], output: &mut structs::root::RefPtr) { use gecko_bindings::structs::nsCSSKeyword::*; use gecko_bindings::sugar::refptr::RefPtr; @@ -2261,7 +2261,7 @@ fn static_assert() { let servo = iter.next().expect("Gecko_NewCSSValueSharedList should create a shared \ value list of the same length as the transform vector"); unsafe { - match servo { + match *servo { ${transform_function_arm("Matrix", "matrix3d", ["number"] * 16)} ${transform_function_arm("MatrixWithPercents", "matrix3d", ["number"] * 12 + ["lop"] * 2 + ["length"] + ["number"])} @@ -2287,7 +2287,7 @@ fn static_assert() { } return; }; - Self::convert_transform(vec, &mut self.gecko.mSpecifiedTransform); + Self::convert_transform(&vec, &mut self.gecko.mSpecifiedTransform); } pub fn copy_transform_from(&mut self, other: &Self) { diff --git a/servo/components/style/properties/properties.mako.rs b/servo/components/style/properties/properties.mako.rs index 01db4868011b..47022d30a6a1 100644 --- a/servo/components/style/properties/properties.mako.rs +++ b/servo/components/style/properties/properties.mako.rs @@ -250,7 +250,7 @@ pub mod animated_properties { } /// A set of longhand properties -#[derive(Clone)] +#[derive(Clone, PartialEq)] pub struct LonghandIdSet { storage: [u32; (${len(data.longhands)} - 1 + 32) / 32] } @@ -954,7 +954,7 @@ impl PropertyId { } } - /// Returns a property id from Gecko's nsCSSPropertyID. + /// Returns an nsCSSPropertyID. #[cfg(feature = "gecko")] #[allow(non_upper_case_globals)] pub fn to_nscsspropertyid(&self) -> Result { diff --git a/servo/components/style/rule_tree/mod.rs b/servo/components/style/rule_tree/mod.rs index ead9797ca141..bfc6c19bf966 100644 --- a/servo/components/style/rule_tree/mod.rs +++ b/servo/components/style/rule_tree/mod.rs @@ -8,7 +8,7 @@ #[cfg(feature = "servo")] use heapsize::HeapSizeOf; -use properties::{Importance, PropertyDeclarationBlock}; +use properties::{Importance, LonghandIdSet, PropertyDeclarationBlock}; use shared_lock::{Locked, StylesheetGuards, SharedRwLockReadGuard}; use smallvec::SmallVec; use std::io::{self, Write}; @@ -1092,6 +1092,42 @@ impl StrongRuleNode { .take_while(|node| node.cascade_level() >= CascadeLevel::SMILOverride) .any(|node| node.cascade_level().is_animation()) } + + /// Get a set of properties whose CascadeLevel are higher than Animations but not equal to + /// Transitions. If there are any custom properties, we set the boolean value of the returned + /// tuple to true. + pub fn get_properties_overriding_animations(&self, guards: &StylesheetGuards) + -> (LonghandIdSet, bool) { + use properties::PropertyDeclarationId; + + // We want to iterate over cascade levels that override the animations level, i.e. + // !important levels and the transitions level. However, we actually want to skip the + // transitions level because although it is higher in the cascade than animations, when + // both transitions and animations are present for a given element and property, transitions + // are suppressed so that they don't actually override animations. + let iter = self.self_and_ancestors() + .skip_while(|node| node.cascade_level() == CascadeLevel::Transitions) + .take_while(|node| node.cascade_level() > CascadeLevel::Animations); + let mut result = (LonghandIdSet::new(), false); + for node in iter { + let style = node.style_source().unwrap(); + for &(ref decl, important) in style.read(node.cascade_level().guard(guards)) + .declarations() + .iter() { + // Although we are only iterating over cascade levels that override animations, + // in a given property declaration block we can have a mixture of !important and + // non-!important declarations but only the !important declarations actually + // override animations. + if important.important() { + match decl.id() { + PropertyDeclarationId::Longhand(id) => result.0.insert(id), + PropertyDeclarationId::Custom(_) => result.1 = true + } + } + } + } + result + } } /// An iterator over a rule node and its ancestors. diff --git a/servo/components/style/traversal.rs b/servo/components/style/traversal.rs index 65f63cefb410..d91b81149fb2 100644 --- a/servo/components/style/traversal.rs +++ b/servo/components/style/traversal.rs @@ -747,12 +747,12 @@ fn compute_style(_traversal: &D, element.match_and_cascade(context, &mut data, StyleSharingBehavior::Allow); } CascadeWithReplacements(hint) => { - let _rule_nodes_changed = - element.replace_rules(hint, context, &mut data); - element.cascade_primary_and_pseudos(context, &mut data); + let rules_changed = element.replace_rules(hint, context, &mut data); + element.cascade_primary_and_pseudos(context, &mut data, + rules_changed.important_rules_changed()); } CascadeOnly => { - element.cascade_primary_and_pseudos(context, &mut data); + element.cascade_primary_and_pseudos(context, &mut data, false); } }; } diff --git a/servo/ports/geckolib/glue.rs b/servo/ports/geckolib/glue.rs index 58075cbd0635..a08068723f71 100644 --- a/servo/ports/geckolib/glue.rs +++ b/servo/ports/geckolib/glue.rs @@ -40,11 +40,14 @@ use style::gecko_bindings::bindings::{RawServoStyleSheetBorrowed, ServoComputedV use style::gecko_bindings::bindings::{RawServoStyleSheetStrong, ServoComputedValuesStrong}; use style::gecko_bindings::bindings::{RawServoSupportsRule, RawServoSupportsRuleBorrowed}; use style::gecko_bindings::bindings::{ServoCssRulesBorrowed, ServoCssRulesStrong}; -use style::gecko_bindings::bindings::{nsACString, nsAString}; +use style::gecko_bindings::bindings::{nsACString, nsAString, nsCSSPropertyIDSetBorrowedMut}; +use style::gecko_bindings::bindings::Gecko_AddPropertyToSet; use style::gecko_bindings::bindings::Gecko_GetOrCreateFinalKeyframe; use style::gecko_bindings::bindings::Gecko_GetOrCreateInitialKeyframe; use style::gecko_bindings::bindings::Gecko_GetOrCreateKeyframeAtStart; +use style::gecko_bindings::bindings::Gecko_NewNoneTransform; use style::gecko_bindings::bindings::RawGeckoAnimationPropertySegmentBorrowed; +use style::gecko_bindings::bindings::RawGeckoCSSPropertyIDListBorrowed; use style::gecko_bindings::bindings::RawGeckoComputedKeyframeValuesListBorrowedMut; use style::gecko_bindings::bindings::RawGeckoComputedTimingBorrowed; use style::gecko_bindings::bindings::RawGeckoElementBorrowed; @@ -247,20 +250,29 @@ pub extern "C" fn Servo_TraverseSubtree(root: RawGeckoElementBorrowed, debug!("Servo_TraverseSubtree: {:?}", element); let traversal_flags = match (root_behavior, restyle_behavior) { - (Root::Normal, Restyle::Normal) => TraversalFlags::empty(), - (Root::UnstyledChildrenOnly, Restyle::Normal) => UNSTYLED_CHILDREN_ONLY, + (Root::Normal, Restyle::Normal) | + (Root::Normal, Restyle::ForAnimationOnly) + => TraversalFlags::empty(), + (Root::UnstyledChildrenOnly, Restyle::Normal) | + (Root::UnstyledChildrenOnly, Restyle::ForAnimationOnly) + => UNSTYLED_CHILDREN_ONLY, (Root::Normal, Restyle::ForReconstruct) => FOR_RECONSTRUCT, _ => panic!("invalid combination of TraversalRootBehavior and TraversalRestyleBehavior"), }; - if element.has_animation_only_dirty_descendants() || - element.has_animation_restyle_hints() { + let needs_animation_only_restyle = element.has_animation_only_dirty_descendants() || + element.has_animation_restyle_hints(); + if needs_animation_only_restyle { traverse_subtree(element, raw_data, traversal_flags | ANIMATION_ONLY, unsafe { &*snapshots }); } + if restyle_behavior == Restyle::ForAnimationOnly { + return needs_animation_only_restyle; + } + traverse_subtree(element, raw_data, traversal_flags, @@ -449,7 +461,15 @@ pub extern "C" fn Servo_AnimationValue_GetTransform(value: RawServoAnimationValu { let value = AnimationValue::as_arc(&value); if let AnimationValue::Transform(ref servo_list) = **value { - style_structs::Box::convert_transform(servo_list.0.clone().unwrap(), unsafe { &mut *list }); + let list = unsafe { &mut *list }; + match servo_list.0 { + Some(ref servo_list) => { + style_structs::Box::convert_transform(servo_list, list); + }, + None => unsafe { + list.set_move(RefPtr::from_addrefed(Gecko_NewNoneTransform())); + } + } } else { panic!("The AnimationValue should be transform"); } @@ -1319,6 +1339,38 @@ pub extern "C" fn Servo_ParseEasing(easing: *const nsAString, } } +#[no_mangle] +pub extern "C" fn Servo_GetProperties_Overriding_Animation(element: RawGeckoElementBorrowed, + list: RawGeckoCSSPropertyIDListBorrowed, + set: nsCSSPropertyIDSetBorrowedMut) { + let element = GeckoElement(element); + let element_data = match element.borrow_data() { + Some(data) => data, + None => return + }; + let global_style_data = &*GLOBAL_STYLE_DATA; + let guard = global_style_data.shared_lock.read(); + let guards = StylesheetGuards::same(&guard); + let (overridden, custom) = + element_data.styles().primary.rules.get_properties_overriding_animations(&guards); + for p in list.iter() { + match PropertyId::from_nscsspropertyid(*p) { + Ok(property) => { + if let PropertyId::Longhand(id) = property { + if overridden.contains(id) { + unsafe { Gecko_AddPropertyToSet(set, *p) }; + } + } + }, + Err(_) => { + if *p == nsCSSPropertyID::eCSSPropertyExtra_variable && custom { + unsafe { Gecko_AddPropertyToSet(set, *p) }; + } + } + } + } +} + #[no_mangle] pub extern "C" fn Servo_ParseStyleAttribute(data: *const nsACString, raw_extra_data: *mut URLExtraData, From 3f5f72a1eb246b43e57bdea50f5f1de1bc861590 Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Fri, 28 Apr 2017 14:00:13 +0800 Subject: [PATCH 10/56] Bug 1334036 - Part 1: Avoid mutating mElementsToRestyle during pre-traversal. r=birtles During pre-traversal of EffectCompositor, we call MaybeUpdateCascadeResult(), which may add new element into mElementsToRestyle, as a result, we may iterate a mutated mElementsToRestyle. In this patch, we copy the element which needs update cascade results into another set and traverse this new set to call MaybeUpdateCascadeResult(). After that, do normal pre-traversal on mElementsToRestyle. MozReview-Commit-ID: 3uo6Ec5JNjp --HG-- extra : rebase_source : 3cdc3c3147f011074a884d85da2655e0ed4a3730 --- dom/animation/EffectCompositor.cpp | 69 +++++++++++++++++++++++------- 1 file changed, 54 insertions(+), 15 deletions(-) diff --git a/dom/animation/EffectCompositor.cpp b/dom/animation/EffectCompositor.cpp index 9865cca9a092..d9cfa350390f 100644 --- a/dom/animation/EffectCompositor.cpp +++ b/dom/animation/EffectCompositor.cpp @@ -960,24 +960,65 @@ EffectCompositor::PreTraverseInSubtree(Element* aRoot) MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(mPresContext->RestyleManager()->IsServo()); + using ElementsToRestyleIterType = + nsDataHashtable::Iterator; + auto getNeededRestyleTarget = [&](const ElementsToRestyleIterType& aIter) + -> NonOwningAnimationTarget { + NonOwningAnimationTarget returnTarget; + + // Ignore throttled restyle. + if (!aIter.Data()) { + return returnTarget; + } + + const NonOwningAnimationTarget& target = aIter.Key(); + + // Ignore restyles that aren't in the flattened tree subtree rooted at + // aRoot. + if (aRoot && + !nsContentUtils::ContentIsFlattenedTreeDescendantOf(target.mElement, + aRoot)) { + return returnTarget; + } + + returnTarget = target; + return returnTarget; + }; + bool foundElementsNeedingRestyle = false; + + nsTArray elementsWithCascadeUpdates; for (size_t i = 0; i < kCascadeLevelCount; ++i) { CascadeLevel cascadeLevel = CascadeLevel(i); - for (auto iter = mElementsToRestyle[cascadeLevel].Iter(); - !iter.Done(); iter.Next()) { - bool postedRestyle = iter.Data(); - // Ignore throttled restyle. - if (!postedRestyle) { + auto& elementSet = mElementsToRestyle[cascadeLevel]; + for (auto iter = elementSet.Iter(); !iter.Done(); iter.Next()) { + const NonOwningAnimationTarget& target = getNeededRestyleTarget(iter); + if (!target.mElement) { continue; } - NonOwningAnimationTarget target = iter.Key(); + EffectSet* effects = EffectSet::GetEffectSet(target.mElement, + target.mPseudoType); + if (!effects || !effects->CascadeNeedsUpdate()) { + continue; + } - // Ignore restyles that aren't in the flattened tree subtree rooted at - // aRoot. - if (aRoot && - !nsContentUtils::ContentIsFlattenedTreeDescendantOf(target.mElement, - aRoot)) { + elementsWithCascadeUpdates.AppendElement(target); + } + } + + for (const NonOwningAnimationTarget& target: elementsWithCascadeUpdates) { + MaybeUpdateCascadeResults(target.mElement, + target.mPseudoType); + } + elementsWithCascadeUpdates.Clear(); + + for (size_t i = 0; i < kCascadeLevelCount; ++i) { + CascadeLevel cascadeLevel = CascadeLevel(i); + auto& elementSet = mElementsToRestyle[cascadeLevel]; + for (auto iter = elementSet.Iter(); !iter.Done(); iter.Next()) { + const NonOwningAnimationTarget& target = getNeededRestyleTarget(iter); + if (!target.mElement) { continue; } @@ -993,16 +1034,14 @@ EffectCompositor::PreTraverseInSubtree(Element* aRoot) foundElementsNeedingRestyle = true; - EffectSet* effects = - EffectSet::GetEffectSet(target.mElement, target.mPseudoType); + EffectSet* effects = EffectSet::GetEffectSet(target.mElement, + target.mPseudoType); if (!effects) { // Drop EffectSets that have been destroyed. iter.Remove(); continue; } - MaybeUpdateCascadeResults(target.mElement, target.mPseudoType); - for (KeyframeEffectReadOnly* effect : *effects) { effect->GetAnimation()->WillComposeStyle(); } From 5561a718471454c7f1482ea40ca343121cabbf23 Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Wed, 17 May 2017 11:41:43 +0800 Subject: [PATCH 11/56] Bug 1334036 - Part 2: Restyle all elements with animations if there are non-animation restyles. r=birtles We restyle elements with non-animation restyles even if the animations are throttled. MozReview-Commit-ID: Exhd4qVx7su --HG-- extra : rebase_source : 1632bf949bb60a894372a425fd9173e1b718452d --- dom/animation/EffectCompositor.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/dom/animation/EffectCompositor.cpp b/dom/animation/EffectCompositor.cpp index d9cfa350390f..04c219d7b004 100644 --- a/dom/animation/EffectCompositor.cpp +++ b/dom/animation/EffectCompositor.cpp @@ -960,14 +960,20 @@ EffectCompositor::PreTraverseInSubtree(Element* aRoot) MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(mPresContext->RestyleManager()->IsServo()); + // We need to force flush all throttled animations if there are any + // non-animation restyles. + bool flushThrottledRestyles = aRoot && aRoot->HasDirtyDescendantsForServo(); + using ElementsToRestyleIterType = nsDataHashtable::Iterator; auto getNeededRestyleTarget = [&](const ElementsToRestyleIterType& aIter) -> NonOwningAnimationTarget { NonOwningAnimationTarget returnTarget; - // Ignore throttled restyle. - if (!aIter.Data()) { + // If aIter.Data() is false, the element only requested a throttled + // (skippable) restyle, so we can skip it if flushThrottledRestyles is not + // true. + if (!flushThrottledRestyles && !aIter.Data()) { return returnTarget; } @@ -1070,12 +1076,21 @@ EffectCompositor::PreTraverse(dom::Element* aElement, PseudoElementHashEntry::KeyType key = { aElement, aPseudoType }; + // We need to flush all throttled animation restyles too if there are + // any non-animation restyles. + Element* elementToRestyle = GetElementToRestyle(aElement, aPseudoType); + bool flushThrottledRestyles = elementToRestyle && + elementToRestyle->HasDirtyDescendantsForServo(); + for (size_t i = 0; i < kCascadeLevelCount; ++i) { CascadeLevel cascadeLevel = CascadeLevel(i); auto& elementSet = mElementsToRestyle[cascadeLevel]; - if (!elementSet.Get(key)) { - // Ignore throttled restyle and no restyle request. + // Skip if we don't have a restyle, or if we only have a throttled + // (skippable) restyle and we're not required to flush throttled restyles. + bool hasUnthrottledRestyle = false; + if (!elementSet.Get(key, &hasUnthrottledRestyle) || + (!flushThrottledRestyles && !hasUnthrottledRestyle)) { continue; } From f1f6a5d9dc1ccbc80898a4f4e7925293007fb805 Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Thu, 11 May 2017 13:08:35 +0800 Subject: [PATCH 12/56] Bug 1334036 - Part 3: Add a flag to represent we are in pre-traversal. r=birtles We need this flag to avoid assertion in PostRestyleForAnimation(), which may be called from MaybeUpdateCascadeResults() in pre-traversal. MozReview-Commit-ID: 46AfoIUb9o3 --HG-- extra : rebase_source : 3290d9954be43ffaeb94b501ac346622651c452a --- dom/animation/EffectCompositor.cpp | 9 ++++++++- dom/animation/EffectCompositor.h | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dom/animation/EffectCompositor.cpp b/dom/animation/EffectCompositor.cpp index 04c219d7b004..e1d55665de79 100644 --- a/dom/animation/EffectCompositor.cpp +++ b/dom/animation/EffectCompositor.cpp @@ -13,6 +13,7 @@ #include "mozilla/AnimationPerformanceWarning.h" #include "mozilla/AnimationTarget.h" #include "mozilla/AnimationUtils.h" +#include "mozilla/AutoRestore.h" #include "mozilla/EffectSet.h" #include "mozilla/LayerAnimationInfo.h" #include "mozilla/RestyleManager.h" @@ -315,7 +316,7 @@ EffectCompositor::PostRestyleForAnimation(dom::Element* aElement, MOZ_ASSERT(NS_IsMainThread(), "Restyle request during restyling should be requested only on " "the main-thread. e.g. after the parallel traversal"); - if (ServoStyleSet::IsInServoTraversal()) { + if (ServoStyleSet::IsInServoTraversal() || mIsInPreTraverse) { MOZ_ASSERT(hint == eRestyle_CSSAnimations || hint == eRestyle_CSSTransitions); @@ -960,6 +961,9 @@ EffectCompositor::PreTraverseInSubtree(Element* aRoot) MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(mPresContext->RestyleManager()->IsServo()); + AutoRestore guard(mIsInPreTraverse); + mIsInPreTraverse = true; + // We need to force flush all throttled animations if there are any // non-animation restyles. bool flushThrottledRestyles = aRoot && aRoot->HasDirtyDescendantsForServo(); @@ -1074,6 +1078,9 @@ EffectCompositor::PreTraverse(dom::Element* aElement, return found; } + AutoRestore guard(mIsInPreTraverse); + mIsInPreTraverse = true; + PseudoElementHashEntry::KeyType key = { aElement, aPseudoType }; // We need to flush all throttled animation restyles too if there are diff --git a/dom/animation/EffectCompositor.h b/dom/animation/EffectCompositor.h index f7e33a329156..6e420cd0a145 100644 --- a/dom/animation/EffectCompositor.h +++ b/dom/animation/EffectCompositor.h @@ -293,6 +293,8 @@ private: nsDataHashtable> mElementsToRestyle; + bool mIsInPreTraverse = false; + class AnimationStyleRuleProcessor final : public nsIStyleRuleProcessor { public: From c13897d8fe178f842ae4b516eb089b2c6d717813 Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Wed, 10 May 2017 13:46:36 +0800 Subject: [PATCH 13/56] Bug 1334036 - Part 4: Remove unused UpdateCascadeResults function. r=birtles,hiro We don't use the public UpdateCascadeResults method, so remove it. MozReview-Commit-ID: A2lWZaHWHTZ --HG-- extra : rebase_source : 35a1d77fdeba5a1db74d15f523dba78801b0b48e --- dom/animation/EffectCompositor.cpp | 13 ------------- dom/animation/EffectCompositor.h | 17 ++++++----------- 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/dom/animation/EffectCompositor.cpp b/dom/animation/EffectCompositor.cpp index e1d55665de79..0faeed0359fa 100644 --- a/dom/animation/EffectCompositor.cpp +++ b/dom/animation/EffectCompositor.cpp @@ -688,19 +688,6 @@ EffectCompositor::MaybeUpdateCascadeResults(dom::Element* aElement, MOZ_ASSERT(!effects->CascadeNeedsUpdate(), "Failed to update cascade state"); } -/* static */ void -EffectCompositor::UpdateCascadeResults(Element* aElement, - CSSPseudoElementType aPseudoType, - nsStyleContext* aStyleContext) -{ - EffectSet* effects = EffectSet::GetEffectSet(aElement, aPseudoType); - if (!effects) { - return; - } - - UpdateCascadeResults(*effects, aElement, aPseudoType, aStyleContext); -} - /* static */ Maybe EffectCompositor::GetAnimationElementAndPseudoForFrame(const nsIFrame* aFrame) { diff --git a/dom/animation/EffectCompositor.h b/dom/animation/EffectCompositor.h index 6e420cd0a145..cd1b1c446307 100644 --- a/dom/animation/EffectCompositor.h +++ b/dom/animation/EffectCompositor.h @@ -210,17 +210,6 @@ public: MaybeUpdateCascadeResults(dom::Element* aElement, CSSPseudoElementType aPseudoType); - // Update the mPropertiesWithImportantRules and - // mPropertiesForAnimationsLevel members of the corresponding EffectSet. - // - // This can be expensive so we should only call it if styles that apply - // above the animation level of the cascade might have changed. For all - // other cases we should call MaybeUpdateCascadeResults. - static void - UpdateCascadeResults(dom::Element* aElement, - CSSPseudoElementType aPseudoType, - nsStyleContext* aStyleContext); - // Helper to fetch the corresponding element and pseudo-type from a frame. // // For frames corresponding to pseudo-elements, the returned element is the @@ -274,6 +263,12 @@ private: EffectSet& aEffectSet, nsCSSPropertyIDSet& aPropertiesOverridden); + // Update the mPropertiesWithImportantRules and + // mPropertiesForAnimationsLevel members of the given EffectSet. + // + // This can be expensive so we should only call it if styles that apply + // above the animation level of the cascade might have changed. For all + // other cases we should call MaybeUpdateCascadeResults. static void UpdateCascadeResults(EffectSet& aEffectSet, dom::Element* aElement, From 1e2c865691f491a575a99f90a47fa1a5bb3152b4 Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Fri, 19 May 2017 15:58:47 +0800 Subject: [PATCH 14/56] Bug 1334036 - Part 5: Implement FFI for finding properties overriding animations. r=birtles,emilio We need to traverse rule tree to get the important rules, so we will not override them if they have animations running on compositor. MozReview-Commit-ID: 67NO2nIcUfq --HG-- extra : rebase_source : 24a4ea4ca10e00f409d94c81acacb3db72248b3f --- dom/animation/EffectCompositor.cpp | 104 ++++++++++++------ dom/animation/EffectCompositor.h | 38 +++++-- .../rootAnalysis/analyzeHeapWrites.js | 2 + layout/style/ServoBindingList.h | 4 + layout/style/ServoBindingTypes.h | 5 + layout/style/ServoBindings.cpp | 7 ++ layout/style/ServoBindings.h | 2 + layout/style/ServoBindings.toml | 5 + 8 files changed, 125 insertions(+), 42 deletions(-) diff --git a/dom/animation/EffectCompositor.cpp b/dom/animation/EffectCompositor.cpp index 0faeed0359fa..263a282f3049 100644 --- a/dom/animation/EffectCompositor.cpp +++ b/dom/animation/EffectCompositor.cpp @@ -18,6 +18,7 @@ #include "mozilla/LayerAnimationInfo.h" #include "mozilla/RestyleManager.h" #include "mozilla/RestyleManagerInlines.h" +#include "mozilla/ServoBindings.h" // Servo_GetProperties_Overriding_Animation #include "mozilla/ServoStyleSet.h" #include "mozilla/StyleAnimationValue.h" #include "mozilla/TypeTraits.h" // For Forward<> @@ -173,7 +174,12 @@ FindAnimationsForCompositor(const nsIFrame* aFrame, Maybe pseudoElement = EffectCompositor::GetAnimationElementAndPseudoForFrame(aFrame); if (pseudoElement) { - EffectCompositor::MaybeUpdateCascadeResults(pseudoElement->mElement, + StyleBackendType backend = + aFrame->StyleContext()->StyleSource().IsServoComputedValues() + ? StyleBackendType::Servo + : StyleBackendType::Gecko; + EffectCompositor::MaybeUpdateCascadeResults(backend, + pseudoElement->mElement, pseudoElement->mPseudoType, aFrame->StyleContext()); } @@ -386,7 +392,9 @@ EffectCompositor::MaybeUpdateAnimationRule(dom::Element* aElement, { // First update cascade results since that may cause some elements to // be marked as needing a restyle. - MaybeUpdateCascadeResults(aElement, aPseudoType, aStyleContext); + MaybeUpdateCascadeResults(StyleBackendType::Gecko, + aElement, aPseudoType, + aStyleContext); auto& elementsToRestyle = mElementsToRestyle[aCascadeLevel]; PseudoElementHashEntry::KeyType key = { aElement, aPseudoType }; @@ -587,7 +595,8 @@ EffectCompositor::AddStyleUpdatesTo(RestyleTracker& aTracker) } for (auto& pseudoElem : elementsToRestyle) { - MaybeUpdateCascadeResults(pseudoElem.mElement, + MaybeUpdateCascadeResults(StyleBackendType::Gecko, + pseudoElem.mElement, pseudoElem.mPseudoType, nullptr); @@ -648,7 +657,8 @@ EffectCompositor::ClearIsRunningOnCompositor(const nsIFrame *aFrame, } /* static */ void -EffectCompositor::MaybeUpdateCascadeResults(Element* aElement, +EffectCompositor::MaybeUpdateCascadeResults(StyleBackendType aBackendType, + Element* aElement, CSSPseudoElementType aPseudoType, nsStyleContext* aStyleContext) { @@ -657,17 +667,8 @@ EffectCompositor::MaybeUpdateCascadeResults(Element* aElement, return; } - nsStyleContext* styleContext = aStyleContext; - if (!styleContext) { - dom::Element* elementToRestyle = GetElementToRestyle(aElement, aPseudoType); - if (elementToRestyle) { - nsIFrame* frame = elementToRestyle->GetPrimaryFrame(); - if (frame) { - styleContext = frame->StyleContext(); - } - } - } - UpdateCascadeResults(*effects, aElement, aPseudoType, styleContext); + UpdateCascadeResults(aBackendType, *effects, aElement, aPseudoType, + aStyleContext); MOZ_ASSERT(!effects->CascadeNeedsUpdate(), "Failed to update cascade state"); } @@ -682,8 +683,8 @@ EffectCompositor::MaybeUpdateCascadeResults(dom::Element* aElement, return; } - // FIXME: Implement the rule node traversal for stylo in Bug 1334036. - UpdateCascadeResults(*effects, aElement, aPseudoType, nullptr); + UpdateCascadeResults(StyleBackendType::Servo, *effects, aElement, aPseudoType, + nullptr); MOZ_ASSERT(!effects->CascadeNeedsUpdate(), "Failed to update cascade state"); } @@ -765,12 +766,35 @@ EffectCompositor::ComposeAnimationRule(dom::Element* aElement, "EffectSet should not change while composing style"); } -/* static */ void -EffectCompositor::GetOverriddenProperties(nsStyleContext* aStyleContext, +/* static */ nsCSSPropertyIDSet +EffectCompositor::GetOverriddenProperties(StyleBackendType aBackendType, EffectSet& aEffectSet, - nsCSSPropertyIDSet& - aPropertiesOverridden) + Element* aElement, + CSSPseudoElementType aPseudoType, + nsStyleContext* aStyleContext) { + MOZ_ASSERT(aBackendType != StyleBackendType::Servo || aElement, + "Should have an element to get style data from if we are using" + " the Servo backend"); + + nsCSSPropertyIDSet result; + + Element* elementToRestyle = GetElementToRestyle(aElement, aPseudoType); + if (aBackendType == StyleBackendType::Gecko && !aStyleContext) { + if (elementToRestyle) { + nsIFrame* frame = elementToRestyle->GetPrimaryFrame(); + if (frame) { + aStyleContext = frame->StyleContext(); + } + } + + if (!aStyleContext) { + return result; + } + } else if (aBackendType == StyleBackendType::Servo && !elementToRestyle) { + return result; + } + AutoTArray propertiesToTrack; { nsCSSPropertyIDSet propertiesToTrackAsSet; @@ -792,16 +816,31 @@ EffectCompositor::GetOverriddenProperties(nsStyleContext* aStyleContext, } if (propertiesToTrack.IsEmpty()) { - return; + return result; } - nsRuleNode::ComputePropertiesOverridingAnimation(propertiesToTrack, - aStyleContext, - aPropertiesOverridden); + switch (aBackendType) { + case StyleBackendType::Servo: + Servo_GetProperties_Overriding_Animation(elementToRestyle, + &propertiesToTrack, + &result); + break; + case StyleBackendType::Gecko: + nsRuleNode::ComputePropertiesOverridingAnimation(propertiesToTrack, + aStyleContext, + result); + break; + + default: + MOZ_ASSERT_UNREACHABLE("Unsupported style backend"); + } + + return result; } /* static */ void -EffectCompositor::UpdateCascadeResults(EffectSet& aEffectSet, +EffectCompositor::UpdateCascadeResults(StyleBackendType aBackendType, + EffectSet& aEffectSet, Element* aElement, CSSPseudoElementType aPseudoType, nsStyleContext* aStyleContext) @@ -825,14 +864,11 @@ EffectCompositor::UpdateCascadeResults(EffectSet& aEffectSet, // We only do this for properties that we can animate on the compositor // since we will apply other properties on the main thread where the usual // cascade applies. - nsCSSPropertyIDSet overriddenProperties; - if (aStyleContext) { - // FIXME: Bug 1334036 (OMTA) will implement a FFI to get the properties - // overriding animation. - MOZ_ASSERT(!aStyleContext->StyleSource().IsServoComputedValues(), - "stylo: Not support get properties overriding animation yet."); - GetOverriddenProperties(aStyleContext, aEffectSet, overriddenProperties); - } + nsCSSPropertyIDSet overriddenProperties = + GetOverriddenProperties(aBackendType, + aEffectSet, + aElement, aPseudoType, + aStyleContext); // Returns a bitset the represents which properties from // LayerAnimationInfo::sRecords are present in |aPropertySet|. diff --git a/dom/animation/EffectCompositor.h b/dom/animation/EffectCompositor.h index cd1b1c446307..4dea61fc30c3 100644 --- a/dom/animation/EffectCompositor.h +++ b/dom/animation/EffectCompositor.h @@ -192,13 +192,19 @@ public: // but only if we have marked the cascade as needing an update due a // the change in the set of effects or a change in one of the effects' // "in effect" state. - // |aStyleContext| may be nullptr in which case we will use the - // nsStyleContext of the primary frame of the specified (pseudo-)element. + // + // When |aBackendType| is StyleBackendType::Gecko, |aStyleContext| is used to + // find overridden properties. If it is nullptr, the nsStyleContext of the + // primary frame of the specified (pseudo-)element, if available, is used. + // + // When |aBackendType| is StyleBackendType::Servo, we fetch the rule node + // from the |aElement| (i.e. |aStyleContext| is ignored). // // This method does NOT detect if other styles that apply above the // animation level of the cascade have changed. static void - MaybeUpdateCascadeResults(dom::Element* aElement, + MaybeUpdateCascadeResults(StyleBackendType aBackendType, + dom::Element* aElement, CSSPseudoElementType aPseudoType, nsStyleContext* aStyleContext); @@ -257,11 +263,22 @@ private: // Get the properties in |aEffectSet| that we are able to animate on the // compositor but which are also specified at a higher level in the cascade - // than the animations level in |aStyleContext|. - static void - GetOverriddenProperties(nsStyleContext* aStyleContext, + // than the animations level. + // + // When |aBackendType| is StyleBackendType::Gecko, we determine which + // properties are specified using the provided |aStyleContext| and + // |aElement| and |aPseudoType| are ignored. If |aStyleContext| is nullptr, + // we automatically look up the style context of primary frame of the + // (pseudo-)element. + // + // When |aBackendType| is StyleBackendType::Servo, we use the |StrongRuleNode| + // stored on the (pseudo-)element indicated by |aElement| and |aPseudoType|. + static nsCSSPropertyIDSet + GetOverriddenProperties(StyleBackendType aBackendType, EffectSet& aEffectSet, - nsCSSPropertyIDSet& aPropertiesOverridden); + dom::Element* aElement, + CSSPseudoElementType aPseudoType, + nsStyleContext* aStyleContext); // Update the mPropertiesWithImportantRules and // mPropertiesForAnimationsLevel members of the given EffectSet. @@ -269,8 +286,13 @@ private: // This can be expensive so we should only call it if styles that apply // above the animation level of the cascade might have changed. For all // other cases we should call MaybeUpdateCascadeResults. + // + // As with MaybeUpdateCascadeResults, |aStyleContext| is only used + // when |aBackendType| is StyleBackendType::Gecko. When |aBackendType| is + // StyleBackendType::Servo, it is ignored. static void - UpdateCascadeResults(EffectSet& aEffectSet, + UpdateCascadeResults(StyleBackendType aBackendType, + EffectSet& aEffectSet, dom::Element* aElement, CSSPseudoElementType aPseudoType, nsStyleContext* aStyleContext); diff --git a/js/src/devtools/rootAnalysis/analyzeHeapWrites.js b/js/src/devtools/rootAnalysis/analyzeHeapWrites.js index f80a5a680a20..1692b3571881 100644 --- a/js/src/devtools/rootAnalysis/analyzeHeapWrites.js +++ b/js/src/devtools/rootAnalysis/analyzeHeapWrites.js @@ -208,6 +208,7 @@ function treatAsSafeArgument(entry, varName, csuName) ["Gecko_StyleShapeSource_SetURLValue", "aShape", null], ["Gecko_nsFont_InitSystem", "aDest", null], ["Gecko_StyleTransition_SetUnsupportedProperty", "aTransition", null], + ["Gecko_AddPropertyToSet", "aPropertySet", "null"], ]; for (var [entryMatch, varMatch, csuMatch] of whitelist) { assert(entryMatch || varMatch || csuMatch); @@ -391,6 +392,7 @@ function ignoreContents(entry) /LookAndFeel::GetColor/, "Gecko_CopyStyleContentsFrom", "Gecko_CSSValue_SetAbsoluteLength", + /nsCSSPropertyIDSet::AddProperty/, ]; if (entry.matches(whitelist)) return true; diff --git a/layout/style/ServoBindingList.h b/layout/style/ServoBindingList.h index eb8f59555ebd..1d1c7e116330 100644 --- a/layout/style/ServoBindingList.h +++ b/layout/style/ServoBindingList.h @@ -214,6 +214,10 @@ SERVO_BINDING_FUNC(Servo_Property_IsAnimatable, bool, nsCSSPropertyID property) SERVO_BINDING_FUNC(Servo_Property_IsDiscreteAnimatable, bool, nsCSSPropertyID property) +SERVO_BINDING_FUNC(Servo_GetProperties_Overriding_Animation, void, + RawGeckoElementBorrowed, + RawGeckoCSSPropertyIDListBorrowed, + nsCSSPropertyIDSetBorrowedMut) // AnimationValues handling SERVO_BINDING_FUNC(Servo_AnimationValues_Interpolate, diff --git a/layout/style/ServoBindingTypes.h b/layout/style/ServoBindingTypes.h index 67a6d425c186..3060f874c141 100644 --- a/layout/style/ServoBindingTypes.h +++ b/layout/style/ServoBindingTypes.h @@ -10,6 +10,7 @@ #include "mozilla/RefPtr.h" #include "mozilla/ServoTypes.h" #include "mozilla/UniquePtr.h" +#include "nsCSSPropertyID.h" #include "nsStyleAutoArray.h" #include "nsTArray.h" @@ -35,6 +36,7 @@ struct PropertyStyleAnimationValuePair; using ComputedKeyframeValues = nsTArray; } // namespace mozilla +class nsCSSPropertyIDSet; class nsCSSValue; struct nsFontFaceRuleContainer; class nsIDocument; @@ -58,6 +60,7 @@ typedef nsTArray RawGeckoFontFaceRuleList; typedef mozilla::AnimationPropertySegment RawGeckoAnimationPropertySegment; typedef mozilla::ComputedTiming RawGeckoComputedTiming; typedef nsTArray RawGeckoServoStyleRuleList; +typedef nsTArray RawGeckoCSSPropertyIDList; // We have these helper types so that we can directly generate // things like &T or Borrowed on the Rust side in the function, providing @@ -139,6 +142,8 @@ DECL_BORROWED_MUT_REF_TYPE_FOR(RawGeckoFontFaceRuleList) DECL_BORROWED_REF_TYPE_FOR(RawGeckoAnimationPropertySegment) DECL_BORROWED_REF_TYPE_FOR(RawGeckoComputedTiming) DECL_BORROWED_MUT_REF_TYPE_FOR(RawGeckoServoStyleRuleList) +DECL_BORROWED_MUT_REF_TYPE_FOR(nsCSSPropertyIDSet) +DECL_BORROWED_REF_TYPE_FOR(RawGeckoCSSPropertyIDList) #undef DECL_ARC_REF_TYPE_FOR #undef DECL_OWNED_REF_TYPE_FOR diff --git a/layout/style/ServoBindings.cpp b/layout/style/ServoBindings.cpp index eabc8fe09c60..285d0186948a 100644 --- a/layout/style/ServoBindings.cpp +++ b/layout/style/ServoBindings.cpp @@ -2112,6 +2112,13 @@ Gecko_CSSFontFaceRule_GetCssText(const nsCSSFontFaceRule* aRule, aRule->GetCssText(*aResult); } +void +Gecko_AddPropertyToSet(nsCSSPropertyIDSetBorrowedMut aPropertySet, + nsCSSPropertyID aProperty) +{ + aPropertySet->AddProperty(aProperty); +} + NS_IMPL_FFI_REFCOUNTING(nsCSSFontFaceRule, CSSFontFaceRule); nsCSSCounterStyleRule* diff --git a/layout/style/ServoBindings.h b/layout/style/ServoBindings.h index 6aeaa6694d26..963ce0e08306 100644 --- a/layout/style/ServoBindings.h +++ b/layout/style/ServoBindings.h @@ -536,6 +536,8 @@ bool Gecko_MatchStringArgPseudo(RawGeckoElementBorrowed element, const char16_t* ident, bool* set_slow_selector); +void Gecko_AddPropertyToSet(nsCSSPropertyIDSetBorrowedMut, nsCSSPropertyID); + // Style-struct management. #define STYLE_STRUCT(name, checkdata_cb) \ void Gecko_Construct_Default_nsStyle##name( \ diff --git a/layout/style/ServoBindings.toml b/layout/style/ServoBindings.toml index 8ec996c2c358..30caf64c8453 100644 --- a/layout/style/ServoBindings.toml +++ b/layout/style/ServoBindings.toml @@ -159,6 +159,7 @@ whitelist-types = [ "nsCSSFontFaceRule", "nsCSSKeyword", "nsCSSPropertyID", + "nsCSSPropertyIDSet", "nsCSSProps", "nsCSSRect", "nsCSSRect_heap", @@ -315,6 +316,7 @@ structs-types = [ "mozilla::Side", "RawGeckoAnimationPropertySegment", "RawGeckoComputedTiming", + "RawGeckoCSSPropertyIDList", "RawGeckoDocument", "RawGeckoElement", "RawGeckoKeyframeList", @@ -353,6 +355,7 @@ structs-types = [ "nsCSSFontFaceRule", "nsCSSKeyword", "nsCSSPropertyID", + "nsCSSPropertyIDSet", "nsCSSShadowArray", "nsCSSUnit", "nsCSSValue", @@ -437,11 +440,13 @@ servo-immutable-borrow-types = [ "RawGeckoStyleAnimationList", ] servo-borrow-types = [ + "nsCSSPropertyIDSet", "nsCSSValue", "nsTimingFunction", "RawGeckoAnimationPropertySegment", "RawGeckoAnimationValueList", "RawGeckoComputedTiming", + "RawGeckoCSSPropertyIDList", "RawGeckoKeyframeList", "RawGeckoComputedKeyframeValuesList", "RawGeckoFontFaceRuleList", From 256a5c133a8a2a3da20f2a95b47c42e3b5fceddf Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Fri, 19 May 2017 16:04:40 +0800 Subject: [PATCH 15/56] Bug 1334036 - Part 6: Trigger restyle if important rules are changed. r=birtles,emilio If we add/remove important rules, we should call MaybeUpdateCascadeResults() to make sure EffectSet::mPropertiesWithImportantRules is correct, and so we can avoid that these important rules are overridden by animations running on compositor. Currently, we call MaybeUpdateCascadeResults only while iterating elements which needs to be restyled, so we should request a restyle on this element whose important rules are changed. MozReview-Commit-ID: 87MBQrirVto --HG-- extra : rebase_source : 8afa207f82ba4a803d41cad06cd7877207830d34 --- layout/style/ServoBindings.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/layout/style/ServoBindings.cpp b/layout/style/ServoBindings.cpp index 285d0186948a..37d250f508d4 100644 --- a/layout/style/ServoBindings.cpp +++ b/layout/style/ServoBindings.cpp @@ -541,10 +541,22 @@ Gecko_UpdateAnimations(RawGeckoElementBorrowed aElement, UpdateTransitions(const_cast(aElement), pseudoType, oldServoValues, servoValues); } + if (aTasks & UpdateAnimationsTasks::EffectProperties) { presContext->EffectCompositor()->UpdateEffectProperties( servoValues, const_cast(aElement), pseudoType); } + + if (aTasks & UpdateAnimationsTasks::CascadeResults) { + // This task will be scheduled if we detected any changes to !important + // rules. We post a restyle here so that we can update the cascade + // results in the pre-traversal of the next restyle. + presContext->EffectCompositor() + ->RequestRestyle(const_cast(aElement), + pseudoType, + EffectCompositor::RestyleType::Standard, + EffectCompositor::CascadeLevel::Animations); + } } } From 5ab8026281307b96e738a2ad7579bc47181ffb66 Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Thu, 11 May 2017 13:26:07 +0800 Subject: [PATCH 16/56] Bug 1334036 - Part 7: Merge two similiar MaybeUpdateCascadeResults functions. r=birtles MozReview-Commit-ID: 2NDdQRF3DQ8 --HG-- extra : rebase_source : b6b002e19a459acd644024a78532ab7923e3fc82 --- dom/animation/EffectCompositor.cpp | 26 +++++++------------------- dom/animation/EffectCompositor.h | 8 -------- 2 files changed, 7 insertions(+), 27 deletions(-) diff --git a/dom/animation/EffectCompositor.cpp b/dom/animation/EffectCompositor.cpp index 263a282f3049..15c0363ab628 100644 --- a/dom/animation/EffectCompositor.cpp +++ b/dom/animation/EffectCompositor.cpp @@ -673,22 +673,6 @@ EffectCompositor::MaybeUpdateCascadeResults(StyleBackendType aBackendType, MOZ_ASSERT(!effects->CascadeNeedsUpdate(), "Failed to update cascade state"); } -/* static */ void -EffectCompositor::MaybeUpdateCascadeResults(dom::Element* aElement, - CSSPseudoElementType aPseudoType) -{ - EffectSet* effects = EffectSet::GetEffectSet(aElement, aPseudoType); - MOZ_ASSERT(effects); - if (!effects->CascadeNeedsUpdate()) { - return; - } - - UpdateCascadeResults(StyleBackendType::Servo, *effects, aElement, aPseudoType, - nullptr); - - MOZ_ASSERT(!effects->CascadeNeedsUpdate(), "Failed to update cascade state"); -} - /* static */ Maybe EffectCompositor::GetAnimationElementAndPseudoForFrame(const nsIFrame* aFrame) { @@ -1041,8 +1025,10 @@ EffectCompositor::PreTraverseInSubtree(Element* aRoot) } for (const NonOwningAnimationTarget& target: elementsWithCascadeUpdates) { - MaybeUpdateCascadeResults(target.mElement, - target.mPseudoType); + MaybeUpdateCascadeResults(StyleBackendType::Servo, + target.mElement, + target.mPseudoType, + nullptr); } elementsWithCascadeUpdates.Clear(); @@ -1132,7 +1118,9 @@ EffectCompositor::PreTraverse(dom::Element* aElement, EffectSet* effects = EffectSet::GetEffectSet(aElement, aPseudoType); if (effects) { - MaybeUpdateCascadeResults(aElement, aPseudoType); + MaybeUpdateCascadeResults(StyleBackendType::Servo, + aElement, aPseudoType, + nullptr); for (KeyframeEffectReadOnly* effect : *effects) { effect->GetAnimation()->WillComposeStyle(); diff --git a/dom/animation/EffectCompositor.h b/dom/animation/EffectCompositor.h index 4dea61fc30c3..a26c795d0c6a 100644 --- a/dom/animation/EffectCompositor.h +++ b/dom/animation/EffectCompositor.h @@ -208,14 +208,6 @@ public: CSSPseudoElementType aPseudoType, nsStyleContext* aStyleContext); - // Variant of MaybeUpdateCascadeResults for the Servo backend. - // The Servo backend doesn't use an nsStyleContext to get the rule node - // to traverse the style tree to find !important rules and instead - // gets the rule node from |aElement|. - static void - MaybeUpdateCascadeResults(dom::Element* aElement, - CSSPseudoElementType aPseudoType); - // Helper to fetch the corresponding element and pseudo-type from a frame. // // For frames corresponding to pseudo-elements, the returned element is the From 9a42bdba220a3243f8143d230004cd4c5e4d8081 Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Tue, 2 May 2017 14:03:16 +0800 Subject: [PATCH 17/56] Bug 1334036 - Part 8: Add AddLayerChangesForAnimation in ServoRestyleManager. r=birtles Some changes to animations don't affect the computed style and yet still require the layer to be updated. Therefore, we also need to call AddLayerChangesForAnimation in ServoRestyleManager. In this patch, we factor out this function from GeckoRestyleManager, so we can reuse it. MozReview-Commit-ID: LL7D1oGS65l --HG-- extra : rebase_source : cd028a3d8f5dc251ec6615918a0f9569f0af44f5 --- layout/base/GeckoRestyleManager.cpp | 54 +------------------------- layout/base/GeckoRestyleManager.h | 2 - layout/base/RestyleManager.cpp | 60 +++++++++++++++++++++++++++++ layout/base/RestyleManager.h | 5 +++ layout/base/ServoRestyleManager.cpp | 11 ++++++ 5 files changed, 78 insertions(+), 54 deletions(-) diff --git a/layout/base/GeckoRestyleManager.cpp b/layout/base/GeckoRestyleManager.cpp index 8fa83edb525a..3fbc3b0cf6be 100644 --- a/layout/base/GeckoRestyleManager.cpp +++ b/layout/base/GeckoRestyleManager.cpp @@ -19,7 +19,6 @@ #include "AnimationCommon.h" // For GetLayerAnimationInfo #include "FrameLayerBuilder.h" #include "GeckoProfiler.h" -#include "LayerAnimationInfo.h" // For LayerAnimationInfo::sRecords #include "nsAutoPtr.h" #include "nsStyleChangeList.h" #include "nsRuleProcessorData.h" @@ -50,7 +49,6 @@ #include "nsSMILAnimationController.h" #include "nsCSSRuleProcessor.h" #include "ChildIterator.h" -#include "Layers.h" #ifdef ACCESSIBILITY #include "nsAccessibilityService.h" @@ -1226,54 +1224,6 @@ ElementRestyler::ElementRestyler(nsPresContext* aPresContext, "an ancestor?"); } -void -ElementRestyler::AddLayerChangesForAnimation() -{ - uint64_t frameGeneration = - GeckoRestyleManager::GetAnimationGenerationForFrame(mFrame); - - nsChangeHint hint = nsChangeHint(0); - for (const LayerAnimationInfo::Record& layerInfo : - LayerAnimationInfo::sRecords) { - Layer* layer = - FrameLayerBuilder::GetDedicatedLayer(mFrame, layerInfo.mLayerType); - if (layer && frameGeneration != layer->GetAnimationGeneration()) { - // If we have a transform layer but don't have any transform style, we - // probably just removed the transform but haven't destroyed the layer - // yet. In this case we will add the appropriate change hint - // (nsChangeHint_UpdateContainingBlock) when we compare style contexts - // so we can skip adding any change hint here. (If we *were* to add - // nsChangeHint_UpdateTransformLayer, ApplyRenderingChangeToTree would - // complain that we're updating a transform layer without a transform). - if (layerInfo.mLayerType == nsDisplayItem::TYPE_TRANSFORM && - !mFrame->StyleDisplay()->HasTransformStyle()) { - continue; - } - hint |= layerInfo.mChangeHint; - } - - // We consider it's the first paint for the frame if we have an animation - // for the property but have no layer. - // Note that in case of animations which has properties preventing running - // on the compositor, e.g., width or height, corresponding layer is not - // created at all, but even in such cases, we normally set valid change - // hint for such animations in each tick, i.e. restyles in each tick. As - // a result, we usually do restyles for such animations in every tick on - // the main-thread. The only animations which will be affected by this - // explicit change hint are animations that have opacity/transform but did - // not have those properies just before. e.g, setting transform by - // setKeyframes or changing target element from other target which prevents - // running on the compositor, etc. - if (!layer && - nsLayoutUtils::HasEffectiveAnimation(mFrame, layerInfo.mProperty)) { - hint |= layerInfo.mChangeHint; - } - } - if (hint) { - mChangeList->AppendChange(mFrame, mContent, hint); - } -} - void ElementRestyler::CaptureChange(nsStyleContext* aOldContext, nsStyleContext* aNewContext, @@ -1879,7 +1829,7 @@ ElementRestyler::Restyle(nsRestyleHint aRestyleHint) // Some changes to animations don't affect the computed style and yet still // require the layer to be updated. For example, pausing an animation via // the Web Animations API won't affect an element's style but still - // requires us to pull the animation off the layer. + // requires to update the animation on the layer. // // Although we only expect this code path to be called when computed style // is not changing, we can sometimes reach this at the end of a transition @@ -1887,7 +1837,7 @@ ElementRestyler::Restyle(nsRestyleHint aRestyleHint) // AddLayerChangesForAnimation checks if mFrame has a transform style or not, // we need to call it *after* calling RestyleSelf to ensure the animated // transform has been removed first. - AddLayerChangesForAnimation(); + RestyleManager::AddLayerChangesForAnimation(mFrame, mContent, *mChangeList); if (haveMoreContinuations && hintToRestore) { // If we have more continuations with different style (e.g., because diff --git a/layout/base/GeckoRestyleManager.h b/layout/base/GeckoRestyleManager.h index 4d45e5d33512..df54fcc8fd4d 100644 --- a/layout/base/GeckoRestyleManager.h +++ b/layout/base/GeckoRestyleManager.h @@ -584,8 +584,6 @@ private: /** * Helpers for Restyle(). */ - void AddLayerChangesForAnimation(); - bool MoveStyleContextsForContentChildren(nsIFrame* aParent, nsStyleContext* aOldContext, nsTArray& aContextsToMove); diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp index 4d787dc8506b..2f60c4dcca78 100644 --- a/layout/base/RestyleManager.cpp +++ b/layout/base/RestyleManager.cpp @@ -6,10 +6,14 @@ #include "mozilla/RestyleManager.h" #include "mozilla/RestyleManagerInlines.h" + +#include "Layers.h" +#include "LayerAnimationInfo.h" // For LayerAnimationInfo::sRecords #include "mozilla/StyleSetHandleInlines.h" #include "nsIFrame.h" #include "nsIPresShellInlines.h" + namespace mozilla { RestyleManager::RestyleManager(StyleBackendType aType, @@ -1771,6 +1775,62 @@ RestyleManager::IncrementAnimationGeneration() } } +/* static */ void +RestyleManager::AddLayerChangesForAnimation(nsIFrame* aFrame, + nsIContent* aContent, + nsStyleChangeList& + aChangeListToProcess) +{ + if (!aFrame || !aContent) { + return; + } + + uint64_t frameGeneration = + RestyleManager::GetAnimationGenerationForFrame(aFrame); + + nsChangeHint hint = nsChangeHint(0); + for (const LayerAnimationInfo::Record& layerInfo : + LayerAnimationInfo::sRecords) { + layers::Layer* layer = + FrameLayerBuilder::GetDedicatedLayer(aFrame, layerInfo.mLayerType); + if (layer && frameGeneration != layer->GetAnimationGeneration()) { + // If we have a transform layer but don't have any transform style, we + // probably just removed the transform but haven't destroyed the layer + // yet. In this case we will add the appropriate change hint + // (nsChangeHint_UpdateContainingBlock) when we compare style contexts + // so we can skip adding any change hint here. (If we *were* to add + // nsChangeHint_UpdateTransformLayer, ApplyRenderingChangeToTree would + // complain that we're updating a transform layer without a transform). + if (layerInfo.mLayerType == nsDisplayItem::TYPE_TRANSFORM && + !aFrame->StyleDisplay()->HasTransformStyle()) { + continue; + } + hint |= layerInfo.mChangeHint; + } + + // We consider it's the first paint for the frame if we have an animation + // for the property but have no layer. + // Note that in case of animations which has properties preventing running + // on the compositor, e.g., width or height, corresponding layer is not + // created at all, but even in such cases, we normally set valid change + // hint for such animations in each tick, i.e. restyles in each tick. As + // a result, we usually do restyles for such animations in every tick on + // the main-thread. The only animations which will be affected by this + // explicit change hint are animations that have opacity/transform but did + // not have those properies just before. e.g, setting transform by + // setKeyframes or changing target element from other target which prevents + // running on the compositor, etc. + if (!layer && + nsLayoutUtils::HasEffectiveAnimation(aFrame, layerInfo.mProperty)) { + hint |= layerInfo.mChangeHint; + } + } + + if (hint) { + aChangeListToProcess.AppendChange(aFrame, aContent, hint); + } +} + RestyleManager::AnimationsWithDestroyedFrame::AnimationsWithDestroyedFrame( RestyleManager* aRestyleManager) : mRestyleManager(aRestyleManager) diff --git a/layout/base/RestyleManager.h b/layout/base/RestyleManager.h index 5ad8c15fddd6..d77ce267eef7 100644 --- a/layout/base/RestyleManager.h +++ b/layout/base/RestyleManager.h @@ -194,6 +194,11 @@ public: // such as changes made through the Web Animations API. void IncrementAnimationGeneration(); + static void AddLayerChangesForAnimation(nsIFrame* aFrame, + nsIContent* aContent, + nsStyleChangeList& + aChangeListToProcess); + protected: RestyleManager(StyleBackendType aType, nsPresContext* aPresContext); diff --git a/layout/base/ServoRestyleManager.cpp b/layout/base/ServoRestyleManager.cpp index 3b63216cc911..0289b96e9167 100644 --- a/layout/base/ServoRestyleManager.cpp +++ b/layout/base/ServoRestyleManager.cpp @@ -389,6 +389,17 @@ ServoRestyleManager::ProcessPostTraversal(Element* aElement, styleFrame->UpdateStyleOfOwnedAnonBoxes(*aStyleSet, aChangeList, changeHint); UpdateFramePseudoElementStyles(styleFrame, *aStyleSet, aChangeList); } + + // Some changes to animations don't affect the computed style and yet still + // require the layer to be updated. For example, pausing an animation via + // the Web Animations API won't affect an element's style but still + // requires to update the animation on the layer. + // + // We can sometimes reach this when the animated style is being removed. + // Since AddLayerChangesForAnimation checks if |styleFrame| has a transform + // style or not, we need to call it *after* setting |newContext| to + // |styleFrame| to ensure the animated transform has been removed first. + AddLayerChangesForAnimation(styleFrame, aElement, aChangeList); } const bool descendantsNeedFrames = From 3ae8dacbdf636041fdc41292039df6d78b4f2bfd Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Fri, 19 May 2017 16:09:45 +0800 Subject: [PATCH 18/56] Bug 1334036 - Part 9: Add one FFI which return None transform. r=emilio This FFI is used by Servo_AnimationValue_GetTransform(), which needs to handle and return none transform properly. MozReview-Commit-ID: 49cFXE2BIbm --HG-- extra : rebase_source : 9def5e92dc6c0b60c2fb412228a50d7e2f5eb722 --- js/src/devtools/rootAnalysis/analyzeHeapWrites.js | 1 + layout/style/ServoBindings.cpp | 9 +++++++++ layout/style/ServoBindings.h | 1 + 3 files changed, 11 insertions(+) diff --git a/js/src/devtools/rootAnalysis/analyzeHeapWrites.js b/js/src/devtools/rootAnalysis/analyzeHeapWrites.js index 1692b3571881..86daf073f275 100644 --- a/js/src/devtools/rootAnalysis/analyzeHeapWrites.js +++ b/js/src/devtools/rootAnalysis/analyzeHeapWrites.js @@ -374,6 +374,7 @@ function ignoreContents(entry) "Gecko_GetOrCreateFinalKeyframe", "Gecko_NewStyleQuoteValues", "Gecko_NewCSSValueSharedList", + "Gecko_NewNoneTransform", "Gecko_NewGridTemplateAreasValue", /nsCSSValue::SetCalcValue/, /CSSValueSerializeCalcOps::Append/, diff --git a/layout/style/ServoBindings.cpp b/layout/style/ServoBindings.cpp index 37d250f508d4..4d26f8325668 100644 --- a/layout/style/ServoBindings.cpp +++ b/layout/style/ServoBindings.cpp @@ -1744,6 +1744,15 @@ Gecko_NewCSSValueSharedList(uint32_t aLen) return list.forget().take(); } +nsCSSValueSharedList* +Gecko_NewNoneTransform() +{ + RefPtr list = new nsCSSValueSharedList; + list->mHead = new nsCSSValueList; + list->mHead->mValue.SetNoneValue(); + return list.forget().take(); +} + void Gecko_CSSValue_SetAbsoluteLength(nsCSSValueBorrowedMut aCSSValue, nscoord aLen) { diff --git a/layout/style/ServoBindings.h b/layout/style/ServoBindings.h index 963ce0e08306..e91d0c3cc407 100644 --- a/layout/style/ServoBindings.h +++ b/layout/style/ServoBindings.h @@ -453,6 +453,7 @@ nsStyleQuoteValues* Gecko_NewStyleQuoteValues(uint32_t len); NS_DECL_THREADSAFE_FFI_REFCOUNTING(nsStyleQuoteValues, QuoteValues); nsCSSValueSharedList* Gecko_NewCSSValueSharedList(uint32_t len); +nsCSSValueSharedList* Gecko_NewNoneTransform(); // Getter for nsCSSValue nsCSSValueBorrowedMut Gecko_CSSValue_GetArrayItem(nsCSSValueBorrowedMut css_value, int32_t index); From 731ab384394a2179872d6c97024953545da9a650 Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Wed, 10 May 2017 11:06:19 +0800 Subject: [PATCH 19/56] Bug 1334036 - Part 10: Return AnimationValue for BaseStyle. r=hiro We need to retrieve the correct base style for Servo backend, so change the return value to AnimationValue and update KeyframeEffectReadOnly::BaseStyle(). MozReview-Commit-ID: 9FL3h1DLoJt --HG-- extra : rebase_source : 42284c5fe8b8135910cde44b0815eb475ca2f1cc --- dom/animation/KeyframeEffectReadOnly.cpp | 7 ++++--- dom/animation/KeyframeEffectReadOnly.h | 14 +++++++++++--- layout/base/nsLayoutUtils.cpp | 7 ++----- layout/painting/nsDisplayList.cpp | 6 ++---- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/dom/animation/KeyframeEffectReadOnly.cpp b/dom/animation/KeyframeEffectReadOnly.cpp index 1db386eec592..fceb60ce8779 100644 --- a/dom/animation/KeyframeEffectReadOnly.cpp +++ b/dom/animation/KeyframeEffectReadOnly.cpp @@ -427,7 +427,7 @@ KeyframeEffectReadOnly::GetUnderlyingStyle( // If we are composing with composite operation that is not 'replace' // and we have not composed style for the property yet, we have to get // the base style for the property. - result = BaseStyle(aProperty); + result = BaseStyle(aProperty).mGecko; } return result; @@ -1297,7 +1297,8 @@ KeyframeEffectReadOnly::GetKeyframes(JSContext*& aCx, // handle null nsCSSValues for longhand properties. DebugOnly uncomputeResult = StyleAnimationValue::UncomputeValue( - propertyValue.mProperty, Move(BaseStyle(propertyValue.mProperty)), + propertyValue.mProperty, + Move(BaseStyle(propertyValue.mProperty).mGecko), cssValue); MOZ_ASSERT(uncomputeResult, @@ -1848,7 +1849,7 @@ KeyframeEffectReadOnly::ContainsAnimatedScale(const nsIFrame* aFrame) const continue; } - StyleAnimationValue baseStyle = BaseStyle(prop.mProperty); + AnimationValue baseStyle = BaseStyle(prop.mProperty); if (baseStyle.IsNull()) { // If we failed to get the base style, we consider it has scale value // here just to be safe. diff --git a/dom/animation/KeyframeEffectReadOnly.h b/dom/animation/KeyframeEffectReadOnly.h index fbc294ed7763..edf21c862f04 100644 --- a/dom/animation/KeyframeEffectReadOnly.h +++ b/dom/animation/KeyframeEffectReadOnly.h @@ -279,10 +279,18 @@ public: // |aFrame| is used for calculation of scale values. bool ContainsAnimatedScale(const nsIFrame* aFrame) const; - StyleAnimationValue BaseStyle(nsCSSPropertyID aProperty) const + AnimationValue BaseStyle(nsCSSPropertyID aProperty) const { - StyleAnimationValue result; - DebugOnly hasProperty = mBaseStyleValues.Get(aProperty, &result); + AnimationValue result; + bool hasProperty = false; + if (mDocument->IsStyledByServo()) { + // We cannot use getters_AddRefs on RawServoAnimationValue because it is + // an incomplete type, so Get() doesn't work. Instead, use GetWeak, and + // then assign the raw pointer to a RefPtr. + result.mServo = mBaseStyleValuesForServo.GetWeak(aProperty, &hasProperty); + } else { + hasProperty = mBaseStyleValues.Get(aProperty, &result.mGecko); + } MOZ_ASSERT(hasProperty || result.IsNull()); return result; } diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 0586ef8da02b..31b6d9339e9d 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -633,12 +633,9 @@ GetMinAndMaxScaleForAnimationProperty(const nsIFrame* aFrame, // We need to factor in the scale of the base style if the base style // will be used on the compositor. - StyleAnimationValue baseStyle = effect->BaseStyle(prop.mProperty); + AnimationValue baseStyle = effect->BaseStyle(prop.mProperty); if (!baseStyle.IsNull()) { - // FIXME: Bug 1334036: We need to get the baseStyle for - // RawServoAnimationValue. - UpdateMinMaxScale(aFrame, AnimationValue(baseStyle), - aMinScale, aMaxScale); + UpdateMinMaxScale(aFrame, baseStyle, aMinScale, aMaxScale); } for (const AnimationPropertySegment& segment : prop.mSegments) { diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp index 28b8c36cfba9..71a515a29a77 100644 --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -566,13 +566,11 @@ AddAnimationForProperty(nsIFrame* aFrame, const AnimationProperty& aProperty, // If the animation is additive or accumulates, we need to pass its base value // to the compositor. - StyleAnimationValue baseStyle = + AnimationValue baseStyle = aAnimation->GetEffect()->AsKeyframeEffect()->BaseStyle(aProperty.mProperty); if (!baseStyle.IsNull()) { - // FIXME: Bug 1334036: We need to get the baseValue for - // RawServoAnimationValue. SetAnimatable(aProperty.mProperty, - AnimationValue(baseStyle), + baseStyle, aFrame, refBox, animation->baseStyle()); } else { From 38215cedeab87df356d7032ab240aad21edee875 Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Fri, 19 May 2017 16:16:41 +0800 Subject: [PATCH 20/56] Bug 1334036 - Part 11: Trigger animation-only restyle when we handle an event with coordinates. r=birtles,heycam We need to request an animation-only restyle to force flush all throttled animations on main thread when we handle an event with coordinates (e.g. mouse event). MozReview-Commit-ID: KkjeQVsLgTl --HG-- extra : rebase_source : 314408062e719e9f52df9a6726e2f3dad817bbef --- dom/animation/EffectCompositor.cpp | 22 ++++++++++------ dom/animation/EffectCompositor.h | 13 ++++++++-- layout/base/PresShell.cpp | 5 +--- layout/base/RestyleManager.h | 2 ++ layout/base/RestyleManagerInlines.h | 6 +++++ layout/base/ServoRestyleManager.cpp | 40 ++++++++++++++++++++++++----- layout/base/ServoRestyleManager.h | 4 +++ layout/style/ServoStyleSet.cpp | 39 ++++++++++++++++++++++++---- layout/style/ServoStyleSet.h | 14 +++++++++- layout/style/ServoTypes.h | 12 +++++---- 10 files changed, 125 insertions(+), 32 deletions(-) diff --git a/dom/animation/EffectCompositor.cpp b/dom/animation/EffectCompositor.cpp index 15c0363ab628..2e1b118dd5e3 100644 --- a/dom/animation/EffectCompositor.cpp +++ b/dom/animation/EffectCompositor.cpp @@ -957,13 +957,14 @@ EffectCompositor::SetPerformanceWarning( } bool -EffectCompositor::PreTraverse() +EffectCompositor::PreTraverse(AnimationRestyleType aRestyleType) { - return PreTraverseInSubtree(nullptr); + return PreTraverseInSubtree(nullptr, aRestyleType); } bool -EffectCompositor::PreTraverseInSubtree(Element* aRoot) +EffectCompositor::PreTraverseInSubtree(Element* aRoot, + AnimationRestyleType aRestyleType) { MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(mPresContext->RestyleManager()->IsServo()); @@ -971,9 +972,13 @@ EffectCompositor::PreTraverseInSubtree(Element* aRoot) AutoRestore guard(mIsInPreTraverse); mIsInPreTraverse = true; - // We need to force flush all throttled animations if there are any - // non-animation restyles. - bool flushThrottledRestyles = aRoot && aRoot->HasDirtyDescendantsForServo(); + // We need to force flush all throttled animations if we also have + // non-animation restyles (since we'll want the up-to-date animation style + // when we go to process them so we can trigger transitions correctly), and + // if we are currently flushing all throttled animation restyles. + bool flushThrottledRestyles = + (aRoot && aRoot->HasDirtyDescendantsForServo()) || + aRestyleType == AnimationRestyleType::Full; using ElementsToRestyleIterType = nsDataHashtable::Iterator; @@ -1092,8 +1097,9 @@ EffectCompositor::PreTraverse(dom::Element* aElement, PseudoElementHashEntry::KeyType key = { aElement, aPseudoType }; - // We need to flush all throttled animation restyles too if there are - // any non-animation restyles. + // We need to flush all throttled animation restyles too if we also have + // non-animation restyles (since we'll want the up-to-date animation style + // when we go to process them so we can trigger transitions correctly). Element* elementToRestyle = GetElementToRestyle(aElement, aPseudoType); bool flushThrottledRestyles = elementToRestyle && elementToRestyle->HasDirtyDescendantsForServo(); diff --git a/dom/animation/EffectCompositor.h b/dom/animation/EffectCompositor.h index a26c795d0c6a..816b7c2fcb68 100644 --- a/dom/animation/EffectCompositor.h +++ b/dom/animation/EffectCompositor.h @@ -227,18 +227,27 @@ public: nsCSSPropertyID aProperty, const AnimationPerformanceWarning& aWarning); + // The type which represents what kind of animation restyle we want. + enum class AnimationRestyleType { + Throttled, // Restyle elements that have posted animation restyles. + Full // Restyle all elements with animations (i.e. even if the + // animations are throttled). + }; + // Do a bunch of stuff that we should avoid doing during the parallel // traversal (e.g. changing member variables) for all elements that we expect // to restyle on the next traversal. + // // Returns true if there are elements needing a restyle for animation. - bool PreTraverse(); + bool PreTraverse(AnimationRestyleType aRestyleType); // Similar to the above but only for the (pseudo-)element. bool PreTraverse(dom::Element* aElement, CSSPseudoElementType aPseudoType); // Similar to the above but for all elements in the subtree rooted // at aElement. - bool PreTraverseInSubtree(dom::Element* aElement); + bool PreTraverseInSubtree(dom::Element* aElement, + AnimationRestyleType aRestyleType); private: ~EffectCompositor() = default; diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index 351891689995..52f9a596f10c 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -6946,10 +6946,7 @@ FlushThrottledStyles(nsIDocument *aDocument, void *aData) if (shell && shell->IsVisible()) { nsPresContext* presContext = shell->GetPresContext(); if (presContext) { - if (presContext->RestyleManager()->IsGecko()) { - // XXX stylo: ServoRestyleManager doesn't support animations yet. - presContext->RestyleManager()->AsGecko()->UpdateOnlyAnimationStyles(); - } + presContext->RestyleManager()->UpdateOnlyAnimationStyles(); } } diff --git a/layout/base/RestyleManager.h b/layout/base/RestyleManager.h index d77ce267eef7..196c9451e86c 100644 --- a/layout/base/RestyleManager.h +++ b/layout/base/RestyleManager.h @@ -180,6 +180,8 @@ public: const nsAttrValue* aOldValue); inline nsresult ReparentStyleContext(nsIFrame* aFrame); + inline void UpdateOnlyAnimationStyles(); + // Get a counter that increments on every style change, that we use to // track whether off-main-thread animations are up-to-date. uint64_t GetAnimationGeneration() const { return mAnimationGeneration; } diff --git a/layout/base/RestyleManagerInlines.h b/layout/base/RestyleManagerInlines.h index 0c6aabe824c1..6e2e70e58469 100644 --- a/layout/base/RestyleManagerInlines.h +++ b/layout/base/RestyleManagerInlines.h @@ -79,6 +79,12 @@ RestyleManager::ReparentStyleContext(nsIFrame* aFrame) MOZ_STYLO_FORWARD(ReparentStyleContext, (aFrame)); } +void +RestyleManager::UpdateOnlyAnimationStyles() +{ + MOZ_STYLO_FORWARD(UpdateOnlyAnimationStyles, ()); +} + } // namespace mozilla #endif // mozilla_RestyleManagerInlines_h diff --git a/layout/base/ServoRestyleManager.cpp b/layout/base/ServoRestyleManager.cpp index 0289b96e9167..8ff1dc181529 100644 --- a/layout/base/ServoRestyleManager.cpp +++ b/layout/base/ServoRestyleManager.cpp @@ -514,7 +514,8 @@ ServoRestyleManager::FrameForPseudoElement(const nsIContent* aContent, } void -ServoRestyleManager::ProcessPendingRestyles() +ServoRestyleManager::DoProcessPendingRestyles(TraversalRestyleBehavior + aRestyleBehavior) { MOZ_ASSERT(PresContext()->Document(), "No document? Pshaw!"); MOZ_ASSERT(!nsContentUtils::IsSafeToRunScript(), "Missing a script blocker!"); @@ -536,6 +537,8 @@ ServoRestyleManager::ProcessPendingRestyles() ServoStyleSet* styleSet = StyleSet(); nsIDocument* doc = PresContext()->Document(); + bool animationOnly = aRestyleBehavior == + TraversalRestyleBehavior::ForAnimationOnly; // Ensure the refresh driver is active during traversal to avoid mutating // mActiveTimer and mMostRecentRefresh time. @@ -546,12 +549,15 @@ ServoRestyleManager::ProcessPendingRestyles() // in a loop because certain rare paths in the frame constructor (like // uninstalling XBL bindings) can trigger additional style validations. mInStyleRefresh = true; - if (mHaveNonAnimationRestyles) { + if (mHaveNonAnimationRestyles && !animationOnly) { ++mAnimationGeneration; } - while (styleSet->StyleDocument()) { - ClearSnapshots(); + while (animationOnly ? styleSet->StyleDocumentForAnimationOnly() + : styleSet->StyleDocument()) { + if (!animationOnly) { + ClearSnapshots(); + } // Recreate style contexts, and queue up change hints (which also handle // lazy frame construction). @@ -582,12 +588,14 @@ ServoRestyleManager::ProcessPendingRestyles() IncrementRestyleGeneration(); } - ClearSnapshots(); FlushOverflowChangedTracker(); - mHaveNonAnimationRestyles = false; + if (!animationOnly) { + ClearSnapshots(); + styleSet->AssertTreeIsClean(); + mHaveNonAnimationRestyles = false; + } mInStyleRefresh = false; - styleSet->AssertTreeIsClean(); // Note: We are in the scope of |animationsWithDestroyedFrame|, so // |mAnimationsWithDestroyedFrame| is still valid. @@ -595,6 +603,24 @@ ServoRestyleManager::ProcessPendingRestyles() mAnimationsWithDestroyedFrame->StopAnimationsForElementsWithoutFrames(); } +void +ServoRestyleManager::ProcessPendingRestyles() +{ + DoProcessPendingRestyles(TraversalRestyleBehavior::Normal); +} + +void +ServoRestyleManager::UpdateOnlyAnimationStyles() +{ + // Bug 1365855: We also need to implement this for SMIL. + bool doCSS = PresContext()->EffectCompositor()->HasPendingStyleUpdates(); + if (!doCSS) { + return; + } + + DoProcessPendingRestyles(TraversalRestyleBehavior::ForAnimationOnly); +} + void ServoRestyleManager::RestyleForInsertOrChange(nsINode* aContainer, nsIContent* aChild) diff --git a/layout/base/ServoRestyleManager.h b/layout/base/ServoRestyleManager.h index f1dd644659e0..acd3fb02be0f 100644 --- a/layout/base/ServoRestyleManager.h +++ b/layout/base/ServoRestyleManager.h @@ -50,6 +50,8 @@ public: nsRestyleHint aRestyleHint); void ProcessPendingRestyles(); + void UpdateOnlyAnimationStyles(); + void ContentInserted(nsINode* aContainer, nsIContent* aChild); void ContentAppended(nsIContent* aContainer, nsIContent* aFirstNewContent); @@ -138,6 +140,8 @@ private: void ClearSnapshots(); ServoElementSnapshot& SnapshotFor(mozilla::dom::Element* aElement); + void DoProcessPendingRestyles(TraversalRestyleBehavior aRestyleBehavior); + // We use a separate data structure from nsStyleChangeList because we need a // frame to create nsStyleChangeList entries, and the primary frame may not be // attached yet. diff --git a/layout/style/ServoStyleSet.cpp b/layout/style/ServoStyleSet.cpp index 49db17121e81..62817ffbe6a7 100644 --- a/layout/style/ServoStyleSet.cpp +++ b/layout/style/ServoStyleSet.cpp @@ -270,7 +270,8 @@ ServoStyleSet::PreTraverseSync() } void -ServoStyleSet::PreTraverse(Element* aRoot) +ServoStyleSet::PreTraverse(Element* aRoot, + EffectCompositor::AnimationRestyleType aRestyleType) { PreTraverseSync(); @@ -279,12 +280,13 @@ ServoStyleSet::PreTraverse(Element* aRoot) nsSMILAnimationController* smilController = mPresContext->Document()->GetAnimationController(); if (aRoot) { - mPresContext->EffectCompositor()->PreTraverseInSubtree(aRoot); + mPresContext->EffectCompositor() + ->PreTraverseInSubtree(aRoot, aRestyleType); if (smilController) { smilController->PreTraverseInSubtree(aRoot); } } else { - mPresContext->EffectCompositor()->PreTraverse(); + mPresContext->EffectCompositor()->PreTraverse(aRestyleType); if (smilController) { smilController->PreTraverse(); } @@ -310,10 +312,18 @@ ServoStyleSet::PrepareAndTraverseSubtree( bool isInitial = !aRoot->HasServoData(); bool forReconstruct = aRestyleBehavior == TraversalRestyleBehavior::ForReconstruct; + bool forAnimationOnly = + aRestyleBehavior == TraversalRestyleBehavior::ForAnimationOnly; bool postTraversalRequired = Servo_TraverseSubtree( aRoot, mRawSet.get(), &snapshots, aRootBehavior, aRestyleBehavior); MOZ_ASSERT_IF(isInitial || forReconstruct, !postTraversalRequired); + // Don't need to trigger a second traversal if this restyle only needs + // animation-only restyle. + if (forAnimationOnly) { + return postTraversalRequired; + } + auto root = const_cast(aRoot); // If there are still animation restyles needed, trigger a second traversal to @@ -324,8 +334,10 @@ ServoStyleSet::PrepareAndTraverseSubtree( // traversal caused, for example, the font-size to change, the SMIL style // won't be updated until the next tick anyway. EffectCompositor* compositor = mPresContext->EffectCompositor(); - if (forReconstruct ? compositor->PreTraverseInSubtree(root) - : compositor->PreTraverse()) { + EffectCompositor::AnimationRestyleType restyleType = + EffectCompositor::AnimationRestyleType::Throttled; + if (forReconstruct ? compositor->PreTraverseInSubtree(root, restyleType) + : compositor->PreTraverse(restyleType)) { if (Servo_TraverseSubtree( aRoot, mRawSet.get(), &snapshots, aRootBehavior, aRestyleBehavior)) { MOZ_ASSERT(!forReconstruct); @@ -851,6 +863,23 @@ ServoStyleSet::StyleDocument() return postTraversalRequired; } +bool +ServoStyleSet::StyleDocumentForAnimationOnly() +{ + PreTraverse(nullptr, EffectCompositor::AnimationRestyleType::Full); + + bool postTraversalRequired = false; + DocumentStyleRootIterator iter(mPresContext->Document()); + while (Element* root = iter.GetNextStyleRoot()) { + if (PrepareAndTraverseSubtree(root, + TraversalRootBehavior::Normal, + TraversalRestyleBehavior::ForAnimationOnly)) { + postTraversalRequired = true; + } + } + return postTraversalRequired; +} + void ServoStyleSet::StyleNewSubtree(Element* aRoot) { diff --git a/layout/style/ServoStyleSet.h b/layout/style/ServoStyleSet.h index 047caf4d6d0f..f32b2648a09f 100644 --- a/layout/style/ServoStyleSet.h +++ b/layout/style/ServoStyleSet.h @@ -7,6 +7,7 @@ #ifndef mozilla_ServoStyleSet_h #define mozilla_ServoStyleSet_h +#include "mozilla/EffectCompositor.h" #include "mozilla/EnumeratedArray.h" #include "mozilla/EventStates.h" #include "mozilla/PostTraversalTask.h" @@ -245,6 +246,15 @@ public: */ bool StyleDocument(); + /** + * Performs a Servo animation-only traversal to compute style for all nodes + * with the animation-only dirty bit in the document. + * + * This will traverse all of the document's style roots (that is, its document + * element, and the roots of the document-level native anonymous content). + */ + bool StyleDocumentForAnimationOnly(); + /** * Eagerly styles a subtree of unstyled nodes that was just appended to the * tree. This is used in situations where we need the style immediately and @@ -422,7 +432,9 @@ private: * When aRoot is null, the entire document is pre-traversed. Otherwise, * only the subtree rooted at aRoot is pre-traversed. */ - void PreTraverse(dom::Element* aRoot = nullptr); + void PreTraverse(dom::Element* aRoot = nullptr, + EffectCompositor::AnimationRestyleType = + EffectCompositor::AnimationRestyleType::Throttled); // Subset of the pre-traverse steps that involve syncing up data void PreTraverseSync(); diff --git a/layout/style/ServoTypes.h b/layout/style/ServoTypes.h index b09eadf2985f..48367e8115f2 100644 --- a/layout/style/ServoTypes.h +++ b/layout/style/ServoTypes.h @@ -53,14 +53,16 @@ enum class TraversalRootBehavior { UnstyledChildrenOnly, }; -// Indicates whether the Servo style system should perform normal processing or -// whether it should traverse in a mode that doesn't generate any change hints, -// which is what's required when handling frame reconstruction. The change -// hints in this case are unneeded, since the old frames have already been -// destroyed. +// Indicates whether the Servo style system should perform normal processing, +// animation-only processing (so we can flush any throttled animation styles), +// or whether it should traverse in a mode that doesn't generate any change +// hints, which is what's required when handling frame reconstruction. +// The change hints in this case are unneeded, since the old frames have +// already been destroyed. enum class TraversalRestyleBehavior { Normal, ForReconstruct, + ForAnimationOnly, }; // Represents which tasks are performed in a SequentialTask of UpdateAnimations. From 9525862a923bbd9da9b892b35cec0cd1521cbaf8 Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Mon, 8 May 2017 11:22:13 +0800 Subject: [PATCH 21/56] Bug 1334036 - Part 12: Enable off-main thread animations. r=birtles Remove the unconditional return from FindAnimationsForCompositor(), so we can check if there is any property running on compositor. Also, enable a reftest and fix the mochitest expectation: 1. The expectation numbers of test_animations_omta.html in e10s and non-e10s are different, so skip non-e10s. 2. We pass all tests in test_animations_omta_start.html with e10s; however, got 3 test failures with non-e10s, so skip this file with non-e10s. MozReview-Commit-ID: IuOyAsUYguU --HG-- extra : rebase_source : 8f8549063f2d1907e95d0bab450e1b6f851f8c84 --- dom/animation/EffectCompositor.cpp | 10 ---------- layout/reftests/invalidation/reftest.list | 2 +- layout/style/test/mochitest.ini | 2 ++ layout/style/test/stylo-failures.md | 10 +--------- 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/dom/animation/EffectCompositor.cpp b/dom/animation/EffectCompositor.cpp index 2e1b118dd5e3..5d13f05af0e4 100644 --- a/dom/animation/EffectCompositor.cpp +++ b/dom/animation/EffectCompositor.cpp @@ -133,13 +133,6 @@ FindAnimationsForCompositor(const nsIFrame* aFrame, return false; } - // FIXME: Bug 1334036: stylo: Implement off-main-thread animations. - if (aFrame->StyleContext()->StyleSource().IsServoComputedValues()) { - NS_WARNING("stylo: return false in FindAnimationsForCompositor because " - "haven't supported compositor-driven animations yet"); - return false; - } - // First check for newly-started transform animations that should be // synchronized with geometric animations. We need to do this before any // other early returns (the one above is ok) since we can only check this @@ -288,9 +281,6 @@ EffectCompositor::RequestRestyle(dom::Element* aElement, } if (aRestyleType == RestyleType::Layer) { - // FIXME: Bug 1334036: we call RequestRestyle for both stylo and gecko, - // so we should make sure we use mAnimationGecneration properly on OMTA. - // Prompt layers to re-sync their animations. mPresContext->RestyleManager()->IncrementAnimationGeneration(); EffectSet* effectSet = EffectSet::GetEffectSet(aElement, aPseudoType); diff --git a/layout/reftests/invalidation/reftest.list b/layout/reftests/invalidation/reftest.list index bb106546c9a8..993332ed405b 100644 --- a/layout/reftests/invalidation/reftest.list +++ b/layout/reftests/invalidation/reftest.list @@ -48,7 +48,7 @@ fails-if(webrender) != transform-floating-point-invalidation.html about:blank fails-if(webrender) != transform-floating-point-invalidation.html?reverse about:blank fails-if(webrender) != nudge-to-integer-invalidation.html about:blank fails-if(webrender) != nudge-to-integer-invalidation.html?reverse about:blank -fails-if(webrender) skip-if(stylo) != clipped-animated-transform-1.html about:blank # Bug 1334036 (stylo) +fails-if(webrender) skip-if(stylo) != clipped-animated-transform-1.html about:blank # Bug 1352628 (stylo) fails-if(webrender) != paintedlayer-recycling-1.html about:blank fails-if(webrender) != paintedlayer-recycling-2.html about:blank pref(layers.single-tile.enabled,false) fails-if(webrender) != paintedlayer-recycling-3.html about:blank diff --git a/layout/style/test/mochitest.ini b/layout/style/test/mochitest.ini index 6b81a6b6dc87..9686c1163cb5 100644 --- a/layout/style/test/mochitest.ini +++ b/layout/style/test/mochitest.ini @@ -60,7 +60,9 @@ support-files = file_animations_effect_timing_iterations.html [test_animations_iterationstart.html] support-files = file_animations_iterationstart.html [test_animations_omta.html] +skip-if = (stylo && !e10s) # mochitest expectations are different with non-e10s, bug 1361938, bug 1361663 [test_animations_omta_start.html] +skip-if = (stylo && !e10s) # mochitest expectations are different with non-e10s, bug 1362292 [test_animations_pausing.html] support-files = file_animations_pausing.html [test_animations_playbackrate.html] diff --git a/layout/style/test/stylo-failures.md b/layout/style/test/stylo-failures.md index 56c8f985b49f..1e6b485fc7cb 100644 --- a/layout/style/test/stylo-failures.md +++ b/layout/style/test/stylo-failures.md @@ -42,15 +42,7 @@ to mochitest command. * inserting keyframes rule doesn't trigger restyle bug 1364799: * test_rule_insertion.html `@keyframes` [36] * OMTA - * test_animations_effect_timing_duration.html [1] - * test_animations_effect_timing_enddelay.html [1] - * test_animations_effect_timing_iterations.html [1] - * test_animations_iterationstart.html [1] - * test_animations_omta.html [1] - * test_animations_omta_start.html [1] - * test_animations_pausing.html [1] - * test_animations_playbackrate.html [1] - * test_animations_reverse.html [1] + * test_animations_omta.html: bug 1361938, bug 1361663 [88] * SMIL Animation * test_restyles_in_smil_animation.html [2] * CSSOM support: From 54f1632a2484580790f99fa64455936cb4ad5218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 20 May 2017 09:15:27 -0500 Subject: [PATCH 22/56] servo: Merge #16961 - style: Move some bloom filter code outside of matching.rs (from emilio:bloom-simplify); r=heycam Also simplify it, while we're at it. Source-Repo: https://github.com/servo/servo Source-Revision: 3ca7f4fc9296c2dd53e644ac25ddaa6411147d24 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 0ec48e70af2e9c085b3a59e662509dd49fafd00f --- servo/components/style/bloom.rs | 39 +++++++++++++++++++++--- servo/components/style/matching.rs | 49 ------------------------------ 2 files changed, 34 insertions(+), 54 deletions(-) diff --git a/servo/components/style/bloom.rs b/servo/components/style/bloom.rs index e8ba95aeb94d..7633d154fe82 100644 --- a/servo/components/style/bloom.rs +++ b/servo/components/style/bloom.rs @@ -8,7 +8,6 @@ #![deny(missing_docs)] use dom::{SendElement, TElement}; -use matching::MatchMethods; use selectors::bloom::BloomFilter; /// A struct that allows us to fast-reject deep descendant selectors avoiding @@ -50,6 +49,26 @@ pub struct StyleBloom { elements: Vec>, } +fn each_relevant_element_hash(element: E, mut f: F) + where E: TElement, + F: FnMut(u32), +{ + f(element.get_local_name().get_hash()); + f(element.get_namespace().get_hash()); + + if let Some(id) = element.get_id() { + f(id.get_hash()); + } + + // TODO: case-sensitivity depends on the document type and quirks mode. + // + // TODO(emilio): It's not clear whether that's relevant here though? + // Classes and ids should be normalized already I think. + element.each_class(|class| { + f(class.get_hash()) + }); +} + impl StyleBloom { /// Create an empty `StyleBloom`. pub fn new() -> Self { @@ -72,15 +91,26 @@ impl StyleBloom { assert!(element.parent_element().is_none()); } } - element.insert_into_bloom_filter(&mut *self.filter); + self.push_internal(element); + } + + /// Same as `push`, but without asserting, in order to use it from + /// `rebuild`. + fn push_internal(&mut self, element: E) { + each_relevant_element_hash(element, |hash| { + self.filter.insert_hash(hash); + }); self.elements.push(unsafe { SendElement::new(element) }); } /// Pop the last element in the bloom filter and return it. fn pop(&mut self) -> Option { let popped = self.elements.pop().map(|el| *el); + if let Some(popped) = popped { - popped.remove_from_bloom_filter(&mut self.filter); + each_relevant_element_hash(popped, |hash| { + self.filter.remove_hash(hash); + }) } popped @@ -103,8 +133,7 @@ impl StyleBloom { self.clear(); while let Some(parent) = element.parent_element() { - parent.insert_into_bloom_filter(&mut *self.filter); - self.elements.push(unsafe { SendElement::new(parent) }); + self.push_internal(parent); element = parent; } diff --git a/servo/components/style/matching.rs b/servo/components/style/matching.rs index 0c4e53cfc4c9..8c7629059907 100644 --- a/servo/components/style/matching.rs +++ b/servo/components/style/matching.rs @@ -1388,55 +1388,6 @@ pub trait MatchMethods : TElement { StyleSharingResult::CannotShare } - // The below two functions are copy+paste because I can't figure out how to - // write a function which takes a generic function. I don't think it can - // be done. - // - // Ideally, I'd want something like: - // - // > fn with_really_simple_selectors(&self, f: |&H|); - - - // In terms of `Component`s, these two functions will insert and remove: - // - `Component::LocalName` - // - `Component::Namepace` - // - `Component::ID` - // - `Component::Class` - - /// Inserts and removes the matching `Descendant` selectors from a bloom - /// filter. This is used to speed up CSS selector matching to remove - /// unnecessary tree climbs for `Descendant` queries. - /// - /// A bloom filter of the local names, namespaces, IDs, and classes is kept. - /// Therefore, each node must have its matching selectors inserted _after_ - /// its own selector matching and _before_ its children start. - fn insert_into_bloom_filter(&self, bf: &mut BloomFilter) { - bf.insert_hash(self.get_local_name().get_hash()); - bf.insert_hash(self.get_namespace().get_hash()); - if let Some(id) = self.get_id() { - bf.insert_hash(id.get_hash()); - } - // TODO: case-sensitivity depends on the document type and quirks mode - self.each_class(|class| { - bf.insert_hash(class.get_hash()) - }); - } - - /// After all the children are done css selector matching, this must be - /// called to reset the bloom filter after an `insert`. - fn remove_from_bloom_filter(&self, bf: &mut BloomFilter) { - bf.remove_hash(self.get_local_name().get_hash()); - bf.remove_hash(self.get_namespace().get_hash()); - if let Some(id) = self.get_id() { - bf.remove_hash(id.get_hash()); - } - - // TODO: case-sensitivity depends on the document type and quirks mode - self.each_class(|class| { - bf.remove_hash(class.get_hash()) - }); - } - /// Given the old and new style of this element, and whether it's a /// pseudo-element, compute the restyle damage used to determine which /// kind of layout or painting operations we'll need. From da6afce72656d022ac50d6a26e1c5fbba3c6006b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 20 May 2017 19:38:56 +0200 Subject: [PATCH 23/56] Bug 1364871: Update expectations. r=me MozReview-Commit-ID: 7vq5rb0Li2P --- layout/reftests/bugs/reftest.list | 2 +- layout/style/test/stylo-failures.md | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index 26fd3e76fc3c..a8a2996d8e3d 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -1857,7 +1857,7 @@ test-pref(layout.css.grid.enabled,true) == 1053035-1-grid.html 1053035-1-ref.htm == 1062792-1.html 1062792-1-ref.html == 1062963-floatmanager-reflow.html 1062963-floatmanager-reflow-ref.html test-pref(dom.webcomponents.enabled,true) == 1066554-1.html 1066554-1-ref.html -fails-if(stylo) == 1069716-1.html 1069716-1-ref.html +== 1069716-1.html 1069716-1-ref.html fails-if(webrender) == 1078262-1.html about:blank test-pref(layout.testing.overlay-scrollbars.always-visible,false) == 1081072-1.html 1081072-1-ref.html == 1081185-1.html 1081185-1-ref.html diff --git a/layout/style/test/stylo-failures.md b/layout/style/test/stylo-failures.md index 1e6b485fc7cb..c11f9671221c 100644 --- a/layout/style/test/stylo-failures.md +++ b/layout/style/test/stylo-failures.md @@ -60,7 +60,6 @@ to mochitest command. * test_computed_style.html `gradient`: -webkit-prefixed gradient values [13] * test_bug829816.html: counter-{reset,increment} serialization difference bug 1363968 [8] * dynamic change on \@counter-style rule bug 1363590 - * test_counter_style.html [11] * test_counter_style.html asserts [11] * test_counter_descriptor_storage.html asserts [110] * symbols() function and string value on list-style-type bug 1363596 From 7235e8b87844354bb86f263ea12d2dcf23869872 Mon Sep 17 00:00:00 2001 From: Jonathan Guillotte-Blouin Date: Mon, 15 May 2017 14:15:36 -0700 Subject: [PATCH 24/56] Bug 1365068 - Cleanup getListSuggestions. r=MattN MozReview-Commit-ID: 2FVelDjB4pV --HG-- extra : rebase_source : 541bef5b8c467894c6c0bb3c0ef4155cfea469ce --- .../satchel/nsInputListAutoComplete.js | 47 +++++++++---------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/toolkit/components/satchel/nsInputListAutoComplete.js b/toolkit/components/satchel/nsInputListAutoComplete.js index 6d39b43d936d..77e2bdaf248a 100644 --- a/toolkit/components/satchel/nsInputListAutoComplete.js +++ b/toolkit/components/satchel/nsInputListAutoComplete.js @@ -19,6 +19,7 @@ InputListAutoComplete.prototype = { let searchResult = values.length > 0 ? Ci.nsIAutoCompleteResult.RESULT_SUCCESS : Ci.nsIAutoCompleteResult.RESULT_NOMATCH; let defaultIndex = values.length > 0 ? 0 : -1; + return new FormAutoCompleteResult(aUntrimmedSearchString, searchResult, defaultIndex, "", values, labels, [], null); @@ -27,36 +28,34 @@ InputListAutoComplete.prototype = { getListSuggestions(aField) { let values = []; let labels = []; + if (!aField || !aField.list) { + return [values, labels]; + } - if (aField) { - let filter = !aField.hasAttribute("mozNoFilter"); - let lowerFieldValue = aField.value.toLowerCase(); + let filter = !aField.hasAttribute("mozNoFilter"); + let lowerFieldValue = aField.value.toLowerCase(); + let options = aField.list.options; - if (aField.list) { - let options = aField.list.options; - let length = options.length; - for (let i = 0; i < length; i++) { - let item = options.item(i); - let label = ""; - if (item.label) { - label = item.label; - } else if (item.text) { - label = item.text; - } else { - label = item.value; - } - - if (filter && label.toLowerCase().indexOf(lowerFieldValue) == -1) { - continue; - } - - labels.push(label); - values.push(item.value); - } + for (let item of options) { + let label = ""; + if (item.label) { + label = item.label; + } else if (item.text) { + label = item.text; + } else { + label = item.value; } + + if (filter && !label.toLowerCase().includes(lowerFieldValue)) { + continue; + } + + labels.push(label); + values.push(item.value); } return [values, labels]; + } }; From 969046c0094ca5a87e644604ebc598731f2bd53b Mon Sep 17 00:00:00 2001 From: Jonathan Guillotte-Blouin Date: Tue, 16 May 2017 15:56:28 -0700 Subject: [PATCH 25/56] Bug 1365068 - Added missing brackets & refactored some conditional statements. r=MattN MozReview-Commit-ID: 1eOkjI06RCJ --HG-- extra : rebase_source : 18068d1483d9127c06b858ce917f53dc41f4c58f --- toolkit/components/satchel/FormHistory.jsm | 49 ++++++---- .../components/satchel/FormHistoryStartup.js | 3 +- .../components/satchel/formSubmitListener.js | 36 +++++--- .../components/satchel/nsFormAutoComplete.js | 90 ++++++++++--------- .../satchel/nsFormFillController.cpp | 83 +++++++++++------ 5 files changed, 158 insertions(+), 103 deletions(-) diff --git a/toolkit/components/satchel/FormHistory.jsm b/toolkit/components/satchel/FormHistory.jsm index 405af3324cdd..851f6268c6b3 100644 --- a/toolkit/components/satchel/FormHistory.jsm +++ b/toolkit/components/satchel/FormHistory.jsm @@ -112,8 +112,9 @@ var Prefs = { get expireDays() { this.ensureInitialized(); return this._expireDays; }, ensureInitialized() { - if (this.initialized) + if (this.initialized) { return; + } this.initialized = true; @@ -234,15 +235,21 @@ function validateSearchData(aData, aDataType) { function makeQueryPredicates(aQueryData, delimiter = " AND ") { return Object.keys(aQueryData).map(function(field) { - if (field == "firstUsedStart") { - return "firstUsed >= :" + field; - } else if (field == "firstUsedEnd") { - return "firstUsed <= :" + field; - } else if (field == "lastUsedStart") { - return "lastUsed >= :" + field; - } else if (field == "lastUsedEnd") { - return "lastUsed <= :" + field; + switch (field) { + case "firstUsedStart": { + return "firstUsed >= :" + field; + } + case "firstUsedEnd": { + return "firstUsed <= :" + field; + } + case "lastUsedStart": { + return "lastUsed >= :" + field; + } + case "lastUsedEnd": { + return "lastUsed <= :" + field; + } } + return field + " = :" + field; }).join(delimiter); } @@ -352,8 +359,9 @@ function generateGUID() { let bytes = 0; for (let i = 1; bytes < 12 ; i += 2) { // Skip dashes - if (uuid[i] == "-") + if (uuid[i] == "-") { i++; + } let hexVal = parseInt(uuid[i] + uuid[i + 1], 16); raw += String.fromCharCode(hexVal); bytes++; @@ -396,8 +404,9 @@ var dbStmts = new Map(); * Creates a statement, wraps it, and then does parameter replacement */ function dbCreateAsyncStatement(aQuery, aParams, aBindingArrays) { - if (!aQuery) + if (!aQuery) { return null; + } let stmt = dbStmts.get(aQuery); if (!stmt) { @@ -633,10 +642,12 @@ function updateFormHistoryWrite(aChanges, aCallbacks) { case "remove": log("Remove from form history " + change); let delStmt = makeMoveToDeletedStatement(change.guid, now, change, bindingArrays); - if (delStmt && stmts.indexOf(delStmt) == -1) + if (delStmt && stmts.indexOf(delStmt) == -1) { stmts.push(delStmt); - if ("timeDeleted" in change) + } + if ("timeDeleted" in change) { delete change.timeDeleted; + } stmt = makeRemoveStatement(change, bindingArrays); notifications.push([ "formhistory-remove", change.guid ]); break; @@ -773,7 +784,9 @@ this.FormHistory = { search: function formHistorySearch(aSelectTerms, aSearchData, aCallbacks) { // if no terms selected, select everything - aSelectTerms = (aSelectTerms) ? aSelectTerms : validFields; + if (!aSelectTerms) { + aSelectTerms = validFields; + } validateSearchData(aSearchData, "Search"); let stmt = makeSearchStatement(aSearchData, aSelectTerms); @@ -844,12 +857,13 @@ this.FormHistory = { let searchFailed = false; function validIdentifier(change) { - // The identifier is only valid if one of either the guid or the (fieldname/value) are set + // The identifier is only valid if one of either the guid or the (fieldname/value) are set (so an X-OR) return Boolean(change.guid) != Boolean(change.fieldname && change.value); } - if (!("length" in aChanges)) + if (!("length" in aChanges)) { aChanges = [aChanges]; + } let isRemoveOperation = aChanges.every(change => change && change.op && change.op == "remove"); if (!Prefs.enabled && !isRemoveOperation) { @@ -1026,8 +1040,9 @@ this.FormHistory = { // Chicken and egg problem: Need the statement to escape the params we // pass to the function that gives us the statement. So, fix it up now. - if (searchString.length >= 1) + if (searchString.length >= 1) { stmt.params.valuePrefix = stmt.escapeStringForLIKE(searchString, "/") + "%"; + } if (searchString.length > 1) { let searchTokenCount = Math.min(searchTokens.length, MAX_SEARCH_TOKENS); for (let i = 0; i < searchTokenCount; i++) { diff --git a/toolkit/components/satchel/FormHistoryStartup.js b/toolkit/components/satchel/FormHistoryStartup.js index 793fa254a14c..09ae1f047b13 100644 --- a/toolkit/components/satchel/FormHistoryStartup.js +++ b/toolkit/components/satchel/FormHistoryStartup.js @@ -45,8 +45,9 @@ FormHistoryStartup.prototype = { pendingQuery: null, init() { - if (this.inited) + if (this.inited) { return; + } this.inited = true; Services.prefs.addObserver("browser.formfill.", this, true); diff --git a/toolkit/components/satchel/formSubmitListener.js b/toolkit/components/satchel/formSubmitListener.js index f05985776359..df3c6c4ddf79 100644 --- a/toolkit/components/satchel/formSubmitListener.js +++ b/toolkit/components/satchel/formSubmitListener.js @@ -40,11 +40,13 @@ var satchelFormListener = { ccNumber = ccNumber.replace(/[\-\s]/g, ""); let len = ccNumber.length; - if (len != 9 && len != 15 && len != 16) + if (len != 9 && len != 15 && len != 16) { return false; + } - if (!/^\d+$/.test(ccNumber)) + if (!/^\d+$/.test(ccNumber)) { return false; + } let total = 0; for (let i = 0; i < len; i++) { @@ -52,8 +54,9 @@ var satchelFormListener = { if (i % 2 == 1) { // Double it, add digits together if > 10 ch *= 2; - if (ch > 9) + if (ch > 9) { ch -= 9; + } } total += ch; } @@ -61,8 +64,9 @@ var satchelFormListener = { }, log(message) { - if (!this.debug) + if (!this.debug) { return; + } dump("satchelFormListener: " + message + "\n"); Services.console.logStringMessage("satchelFormListener: " + message); }, @@ -85,41 +89,44 @@ var satchelFormListener = { notify(form, domWin, actionURI, cancelSubmit) { try { - if (!this.enabled) - return; - - if (PrivateBrowsingUtils.isContentWindowPrivate(domWin)) + if (!this.enabled || PrivateBrowsingUtils.isContentWindowPrivate(domWin)) { return; + } this.log("Form submit observer notified."); if (form.hasAttribute("autocomplete") && - form.getAttribute("autocomplete").toLowerCase() == "off") + form.getAttribute("autocomplete").toLowerCase() == "off") { return; + } let entries = []; for (let i = 0; i < form.elements.length; i++) { let input = form.elements[i]; - if (!(input instanceof Ci.nsIDOMHTMLInputElement)) + if (!(input instanceof Ci.nsIDOMHTMLInputElement)) { continue; + } // Only use inputs that hold text values (not including type="password") - if (!input.mozIsTextField(true)) + if (!input.mozIsTextField(true)) { continue; + } // Bug 394612: If Login Manager marked this input, don't save it. // The login manager will deal with remembering it. // Don't save values when autocomplete=off is present. if (input.hasAttribute("autocomplete") && - input.getAttribute("autocomplete").toLowerCase() == "off") + input.getAttribute("autocomplete").toLowerCase() == "off") { continue; + } let value = input.value.trim(); // Don't save empty or unchanged values. - if (!value || value == input.defaultValue.trim()) + if (!value || value == input.defaultValue.trim()) { continue; + } // Don't save credit card numbers. if (this.isValidCCNumber(value)) { @@ -128,8 +135,9 @@ var satchelFormListener = { } let name = input.name || input.id; - if (!name) + if (!name) { continue; + } if (name == "searchbar-history") { this.log('addEntry for input name "' + name + '" is denied') diff --git a/toolkit/components/satchel/nsFormAutoComplete.js b/toolkit/components/satchel/nsFormAutoComplete.js index d524fc390168..7154d248d514 100644 --- a/toolkit/components/satchel/nsFormAutoComplete.js +++ b/toolkit/components/satchel/nsFormAutoComplete.js @@ -53,13 +53,11 @@ function FormHistoryClient({ formField, inputName }) { this.mm = topDocShell.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIContentFrameMessageManager); } else { - if (inputName == this.SEARCHBAR_ID) { - if (formField) { - throw new Error("FormHistoryClient constructed with both a " + - "formField and an inputName. This is not " + - "supported, and only empty results will be " + - "returned."); - } + if (inputName == this.SEARCHBAR_ID && formField) { + throw new Error("FormHistoryClient constructed with both a " + + "formField and an inputName. This is not " + + "supported, and only empty results will be " + + "returned."); } this.mm = Services.cpmm; } @@ -210,38 +208,39 @@ FormAutoComplete.prototype = { observe(subject, topic, data) { let self = this._self; - if (topic == "nsPref:changed") { - let prefName = data; - self.log("got change to " + prefName + " preference"); - switch (prefName) { - case "agedWeight": - self._agedWeight = self._prefBranch.getIntPref(prefName); - break; - case "debug": - self._debug = self._prefBranch.getBoolPref(prefName); - break; - case "enable": - self._enabled = self._prefBranch.getBoolPref(prefName); - break; - case "maxTimeGroupings": - self._maxTimeGroupings = self._prefBranch.getIntPref(prefName); - break; - case "timeGroupingSize": - self._timeGroupingSize = self._prefBranch.getIntPref(prefName) * 1000 * 1000; - break; - case "bucketSize": - self._bucketSize = self._prefBranch.getIntPref(prefName); - break; - case "boundaryWeight": - self._boundaryWeight = self._prefBranch.getIntPref(prefName); - break; - case "prefixWeight": - self._prefixWeight = self._prefBranch.getIntPref(prefName); - break; - default: - self.log("Oops! Pref not handled, change ignored."); - } + if (topic == "nsPref:changed") { + let prefName = data; + self.log("got change to " + prefName + " preference"); + + switch (prefName) { + case "agedWeight": + self._agedWeight = self._prefBranch.getIntPref(prefName); + break; + case "debug": + self._debug = self._prefBranch.getBoolPref(prefName); + break; + case "enable": + self._enabled = self._prefBranch.getBoolPref(prefName); + break; + case "maxTimeGroupings": + self._maxTimeGroupings = self._prefBranch.getIntPref(prefName); + break; + case "timeGroupingSize": + self._timeGroupingSize = self._prefBranch.getIntPref(prefName) * 1000 * 1000; + break; + case "bucketSize": + self._bucketSize = self._prefBranch.getIntPref(prefName); + break; + case "boundaryWeight": + self._boundaryWeight = self._prefBranch.getIntPref(prefName); + break; + case "prefixWeight": + self._prefixWeight = self._prefBranch.getIntPref(prefName); + break; + default: + self.log("Oops! Pref not handled, change ignored."); + } } } }, @@ -259,8 +258,9 @@ FormAutoComplete.prototype = { * window */ log(message) { - if (!this._debug) + if (!this._debug) { return; + } dump("FormAutoComplete: " + message + "\n"); Services.console.logStringMessage("FormAutoComplete: " + message); }, @@ -378,8 +378,9 @@ FormAutoComplete.prototype = { let entry = entries[i]; // Remove results that do not contain the token // XXX bug 394604 -- .toLowerCase can be wrong for some intl chars - if (searchTokens.some(tok => entry.textLowerCase.indexOf(tok) < 0)) + if (searchTokens.some(tok => entry.textLowerCase.indexOf(tok) < 0)) { continue; + } this._calculateScore(entry, searchString, searchTokens); this.log("Reusing autocomplete entry '" + entry.text + "' (" + entry.frecency + " / " + entry.totalScore + ")"); @@ -553,8 +554,9 @@ FormAutoCompleteResult.prototype = { fieldName: null, _checkIndexBounds(index) { - if (index < 0 || index >= this.entries.length) + if (index < 0 || index >= this.entries.length) { throw Components.Exception("Index out of range.", Cr.NS_ERROR_ILLEGAL_VALUE); + } }, // Allow autoCompleteSearch to get at the JS object so it can @@ -567,13 +569,15 @@ FormAutoCompleteResult.prototype = { searchString: "", errorDescription: "", get defaultIndex() { - if (this.entries.length == 0) + if (this.entries.length == 0) { return -1; + } return 0; }, get searchResult() { - if (this.entries.length == 0) + if (this.entries.length == 0) { return Ci.nsIAutoCompleteResult.RESULT_NOMATCH; + } return Ci.nsIAutoCompleteResult.RESULT_SUCCESS; }, get matchCount() { diff --git a/toolkit/components/satchel/nsFormFillController.cpp b/toolkit/components/satchel/nsFormFillController.cpp index 51a559d6fb03..ae453a99c9fe 100644 --- a/toolkit/components/satchel/nsFormFillController.cpp +++ b/toolkit/components/satchel/nsFormFillController.cpp @@ -300,8 +300,9 @@ nsFormFillController::MarkAsLoginManagerField(nsIDOMHTMLInputElement *aInput) } } - if (!mLoginManager) + if (!mLoginManager) { mLoginManager = do_GetService("@mozilla.org/login-manager;1"); + } return NS_OK; } @@ -367,10 +368,11 @@ nsFormFillController::GetController(nsIAutoCompleteController **aController) NS_IMETHODIMP nsFormFillController::GetPopupOpen(bool *aPopupOpen) { - if (mFocusedPopup) + if (mFocusedPopup) { mFocusedPopup->GetPopupOpen(aPopupOpen); - else + } else { *aPopupOpen = false; + } return NS_OK; } @@ -399,8 +401,9 @@ nsFormFillController::SetPopupOpen(bool aPopupOpen) nsCOMPtr element = do_QueryInterface(mFocusedInput); mFocusedPopup->OpenAutocompletePopup(this, element); } - } else + } else { mFocusedPopup->ClosePopup(); + } } return NS_OK; @@ -900,37 +903,43 @@ nsFormFillController::HandleEvent(nsIDOMEvent* aEvent) mController->HandleText(&unused) : NS_OK; } if (type.EqualsLiteral("blur")) { - if (mFocusedInput) + if (mFocusedInput) { StopControllingInput(); + } return NS_OK; } if (type.EqualsLiteral("compositionstart")) { NS_ASSERTION(mController, "should have a controller!"); - if (mController && mFocusedInput) + if (mController && mFocusedInput) { mController->HandleStartComposition(); + } return NS_OK; } if (type.EqualsLiteral("compositionend")) { NS_ASSERTION(mController, "should have a controller!"); - if (mController && mFocusedInput) + if (mController && mFocusedInput) { mController->HandleEndComposition(); + } return NS_OK; } if (type.EqualsLiteral("contextmenu")) { - if (mFocusedPopup) + if (mFocusedPopup) { mFocusedPopup->ClosePopup(); + } return NS_OK; } if (type.EqualsLiteral("pagehide")) { nsCOMPtr doc = do_QueryInterface( aEvent->InternalDOMEvent()->GetTarget()); - if (!doc) + if (!doc) { return NS_OK; + } if (mFocusedInput) { - if (doc == mFocusedInputNode->OwnerDoc()) + if (doc == mFocusedInputNode->OwnerDoc()) { StopControllingInput(); + } } RemoveForDocument(doc); @@ -971,17 +980,20 @@ void nsFormFillController::MaybeStartControllingInput(nsIDOMHTMLInputElement* aInput) { nsCOMPtr inputNode = do_QueryInterface(aInput); - if (!inputNode) + if (!inputNode) { return; + } nsCOMPtr formControl = do_QueryInterface(aInput); - if (!formControl || !formControl->IsSingleLineTextControl(false)) + if (!formControl || !formControl->IsSingleLineTextControl(false)) { return; + } bool isReadOnly = false; aInput->GetReadOnly(&isReadOnly); - if (isReadOnly) + if (isReadOnly) { return; + } bool autocomplete = nsContentUtils::IsAutocompleteEnabled(aInput); @@ -1047,12 +1059,14 @@ nsresult nsFormFillController::KeyPress(nsIDOMEvent* aEvent) { NS_ASSERTION(mController, "should have a controller!"); - if (!mFocusedInput || !mController) + if (!mFocusedInput || !mController) { return NS_OK; + } nsCOMPtr keyEvent = do_QueryInterface(aEvent); - if (!keyEvent) + if (!keyEvent) { return NS_ERROR_FAILURE; + } bool cancel = false; bool unused = false; @@ -1089,8 +1103,9 @@ nsFormFillController::KeyPress(nsIDOMEvent* aEvent) keyEvent->GetCtrlKey(&isCtrl); keyEvent->GetAltKey(&isAlt); keyEvent->GetMetaKey(&isMeta); - if (isCtrl || isAlt || isMeta) + if (isCtrl || isAlt || isMeta) { break; + } } MOZ_FALLTHROUGH; case nsIDOMKeyEvent::DOM_VK_UP: @@ -1159,13 +1174,15 @@ nsresult nsFormFillController::MouseDown(nsIDOMEvent* aEvent) { nsCOMPtr mouseEvent(do_QueryInterface(aEvent)); - if (!mouseEvent) + if (!mouseEvent) { return NS_ERROR_FAILURE; + } nsCOMPtr targetInput = do_QueryInterface( aEvent->InternalDOMEvent()->GetTarget()); - if (!targetInput) + if (!targetInput) { return NS_OK; + } int16_t button; mouseEvent->GetButton(&button); @@ -1178,8 +1195,9 @@ nsFormFillController::MouseDown(nsIDOMEvent* aEvent) return NS_OK; } - if (button != 0) + if (button != 0) { return NS_OK; + } return ShowPopup(); } @@ -1195,8 +1213,9 @@ nsFormFillController::ShowPopup() nsCOMPtr input; mController->GetInput(getter_AddRefs(input)); - if (!input) + if (!input) { return NS_OK; + } nsAutoString value; input->GetTextValue(value); @@ -1221,13 +1240,15 @@ nsFormFillController::ShowPopup() void nsFormFillController::AddWindowListeners(nsPIDOMWindowOuter* aWindow) { - if (!aWindow) + if (!aWindow) { return; + } EventTarget* target = aWindow->GetChromeEventHandler(); - if (!target) + if (!target) { return; + } target->AddEventListener(NS_LITERAL_STRING("focus"), this, true, false); @@ -1254,8 +1275,9 @@ nsFormFillController::AddWindowListeners(nsPIDOMWindowOuter* aWindow) void nsFormFillController::RemoveWindowListeners(nsPIDOMWindowOuter* aWindow) { - if (!aWindow) + if (!aWindow) { return; + } StopControllingInput(); @@ -1264,8 +1286,9 @@ nsFormFillController::RemoveWindowListeners(nsPIDOMWindowOuter* aWindow) EventTarget* target = aWindow->GetChromeEventHandler(); - if (!target) + if (!target) { return; + } target->RemoveEventListener(NS_LITERAL_STRING("focus"), this, true); target->RemoveEventListener(NS_LITERAL_STRING("blur"), this, true); @@ -1293,8 +1316,9 @@ nsFormFillController::StartControllingInput(nsIDOMHTMLInputElement *aInput) // Find the currently focused docShell nsCOMPtr docShell = GetDocShellForInput(aInput); int32_t index = GetIndexOfDocShell(docShell); - if (index < 0) + if (index < 0) { return; + } // Cache the popup for the focused docShell mFocusedPopup = mPopups.SafeElementAt(index); @@ -1333,8 +1357,9 @@ nsFormFillController::StopControllingInput() // focus by clicking another autocomplete textbox nsCOMPtr input; mController->GetInput(getter_AddRefs(input)); - if (input == this) + if (input == this) { mController->SetInput(nullptr); + } } if (mFocusedInputNode) { @@ -1387,14 +1412,16 @@ nsFormFillController::GetWindowForDocShell(nsIDocShell *aDocShell) int32_t nsFormFillController::GetIndexOfDocShell(nsIDocShell *aDocShell) { - if (!aDocShell) + if (!aDocShell) { return -1; + } // Loop through our cached docShells looking for the given docShell uint32_t count = mDocShells.Length(); for (uint32_t i = 0; i < count; ++i) { - if (mDocShells[i] == aDocShell) + if (mDocShells[i] == aDocShell) { return i; + } } // Recursively check the parent docShell of this one From 5aafed556751c2276c11a9172197f544c8ca52e6 Mon Sep 17 00:00:00 2001 From: Jonathan Guillotte-Blouin Date: Tue, 16 May 2017 17:15:02 -0700 Subject: [PATCH 26/56] Bug 1365068 - normalize indentation to 2 spaces. r=MattN MozReview-Commit-ID: LeooMk6DVMl --HG-- extra : rebase_source : b1c92542da7b1e008cf2a42d32839915acba5d97 --- .../components/satchel/formSubmitListener.js | 294 ++--- .../components/satchel/nsFormAutoComplete.js | 1055 ++++++++--------- 2 files changed, 672 insertions(+), 677 deletions(-) diff --git a/toolkit/components/satchel/formSubmitListener.js b/toolkit/components/satchel/formSubmitListener.js index df3c6c4ddf79..506c77099604 100644 --- a/toolkit/components/satchel/formSubmitListener.js +++ b/toolkit/components/satchel/formSubmitListener.js @@ -14,159 +14,159 @@ Components.utils.import("resource://gre/modules/Services.jsm"); Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); var satchelFormListener = { - QueryInterface: XPCOMUtils.generateQI([Ci.nsIFormSubmitObserver, - Ci.nsIObserver, - Ci.nsISupportsWeakReference]), + QueryInterface: XPCOMUtils.generateQI([Ci.nsIFormSubmitObserver, + Ci.nsIObserver, + Ci.nsISupportsWeakReference]), - debug: true, - enabled: true, + debug: true, + enabled: true, - init() { - Services.obs.addObserver(this, "earlyformsubmit"); - Services.obs.addObserver(this, "xpcom-shutdown"); - Services.prefs.addObserver("browser.formfill.", this); - this.updatePrefs(); - }, + init() { + Services.obs.addObserver(this, "earlyformsubmit"); + Services.obs.addObserver(this, "xpcom-shutdown"); + Services.prefs.addObserver("browser.formfill.", this); + this.updatePrefs(); + }, - updatePrefs() { - this.debug = Services.prefs.getBoolPref("browser.formfill.debug"); - this.enabled = Services.prefs.getBoolPref("browser.formfill.enable"); - }, + updatePrefs() { + this.debug = Services.prefs.getBoolPref("browser.formfill.debug"); + this.enabled = Services.prefs.getBoolPref("browser.formfill.enable"); + }, - // Implements the Luhn checksum algorithm as described at - // http://wikipedia.org/wiki/Luhn_algorithm - isValidCCNumber(ccNumber) { - // Remove dashes and whitespace - ccNumber = ccNumber.replace(/[\-\s]/g, ""); + // Implements the Luhn checksum algorithm as described at + // http://wikipedia.org/wiki/Luhn_algorithm + isValidCCNumber(ccNumber) { + // Remove dashes and whitespace + ccNumber = ccNumber.replace(/[\-\s]/g, ""); - let len = ccNumber.length; - if (len != 9 && len != 15 && len != 16) { - return false; - } - - if (!/^\d+$/.test(ccNumber)) { - return false; - } - - let total = 0; - for (let i = 0; i < len; i++) { - let ch = parseInt(ccNumber[len - i - 1]); - if (i % 2 == 1) { - // Double it, add digits together if > 10 - ch *= 2; - if (ch > 9) { - ch -= 9; - } - } - total += ch; - } - return total % 10 == 0; - }, - - log(message) { - if (!this.debug) { - return; - } - dump("satchelFormListener: " + message + "\n"); - Services.console.logStringMessage("satchelFormListener: " + message); - }, - - /* ---- nsIObserver interface ---- */ - - observe(subject, topic, data) { - if (topic == "nsPref:changed") { - this.updatePrefs(); - } else if (topic == "xpcom-shutdown") { - Services.obs.removeObserver(this, "earlyformsubmit"); - Services.obs.removeObserver(this, "xpcom-shutdown"); - Services.prefs.removeObserver("browser.formfill.", this); - } else { - this.log("Oops! Unexpected notification: " + topic); - } - }, - - /* ---- nsIFormSubmitObserver interfaces ---- */ - - notify(form, domWin, actionURI, cancelSubmit) { - try { - if (!this.enabled || PrivateBrowsingUtils.isContentWindowPrivate(domWin)) { - return; - } - - this.log("Form submit observer notified."); - - if (form.hasAttribute("autocomplete") && - form.getAttribute("autocomplete").toLowerCase() == "off") { - return; - } - - let entries = []; - for (let i = 0; i < form.elements.length; i++) { - let input = form.elements[i]; - if (!(input instanceof Ci.nsIDOMHTMLInputElement)) { - continue; - } - - // Only use inputs that hold text values (not including type="password") - if (!input.mozIsTextField(true)) { - continue; - } - - // Bug 394612: If Login Manager marked this input, don't save it. - // The login manager will deal with remembering it. - - // Don't save values when autocomplete=off is present. - if (input.hasAttribute("autocomplete") && - input.getAttribute("autocomplete").toLowerCase() == "off") { - continue; - } - - let value = input.value.trim(); - - // Don't save empty or unchanged values. - if (!value || value == input.defaultValue.trim()) { - continue; - } - - // Don't save credit card numbers. - if (this.isValidCCNumber(value)) { - this.log("skipping saving a credit card number"); - continue; - } - - let name = input.name || input.id; - if (!name) { - continue; - } - - if (name == "searchbar-history") { - this.log('addEntry for input name "' + name + '" is denied') - continue; - } - - // Limit stored data to 200 characters. - if (name.length > 200 || value.length > 200) { - this.log("skipping input that has a name/value too large"); - continue; - } - - // Limit number of fields stored per form. - if (entries.length >= 100) { - this.log("not saving any more entries for this form."); - break; - } - - entries.push({ name, value }); - } - - if (entries.length) { - this.log("sending entries to parent process for form " + form.id); - sendAsyncMessage("FormHistory:FormSubmitEntries", entries); - } - } catch (e) { - this.log("notify failed: " + e); - } + let len = ccNumber.length; + if (len != 9 && len != 15 && len != 16) { + return false; } + + if (!/^\d+$/.test(ccNumber)) { + return false; + } + + let total = 0; + for (let i = 0; i < len; i++) { + let ch = parseInt(ccNumber[len - i - 1]); + if (i % 2 == 1) { + // Double it, add digits together if > 10 + ch *= 2; + if (ch > 9) { + ch -= 9; + } + } + total += ch; + } + return total % 10 == 0; + }, + + log(message) { + if (!this.debug) { + return; + } + dump("satchelFormListener: " + message + "\n"); + Services.console.logStringMessage("satchelFormListener: " + message); + }, + + /* ---- nsIObserver interface ---- */ + + observe(subject, topic, data) { + if (topic == "nsPref:changed") { + this.updatePrefs(); + } else if (topic == "xpcom-shutdown") { + Services.obs.removeObserver(this, "earlyformsubmit"); + Services.obs.removeObserver(this, "xpcom-shutdown"); + Services.prefs.removeObserver("browser.formfill.", this); + } else { + this.log("Oops! Unexpected notification: " + topic); + } + }, + + /* ---- nsIFormSubmitObserver interfaces ---- */ + + notify(form, domWin, actionURI, cancelSubmit) { + try { + if (!this.enabled || PrivateBrowsingUtils.isContentWindowPrivate(domWin)) { + return; + } + + this.log("Form submit observer notified."); + + if (form.hasAttribute("autocomplete") && + form.getAttribute("autocomplete").toLowerCase() == "off") { + return; + } + + let entries = []; + for (let i = 0; i < form.elements.length; i++) { + let input = form.elements[i]; + if (!(input instanceof Ci.nsIDOMHTMLInputElement)) { + continue; + } + + // Only use inputs that hold text values (not including type="password") + if (!input.mozIsTextField(true)) { + continue; + } + + // Bug 394612: If Login Manager marked this input, don't save it. + // The login manager will deal with remembering it. + + // Don't save values when autocomplete=off is present. + if (input.hasAttribute("autocomplete") && + input.getAttribute("autocomplete").toLowerCase() == "off") { + continue; + } + + let value = input.value.trim(); + + // Don't save empty or unchanged values. + if (!value || value == input.defaultValue.trim()) { + continue; + } + + // Don't save credit card numbers. + if (this.isValidCCNumber(value)) { + this.log("skipping saving a credit card number"); + continue; + } + + let name = input.name || input.id; + if (!name) { + continue; + } + + if (name == "searchbar-history") { + this.log('addEntry for input name "' + name + '" is denied') + continue; + } + + // Limit stored data to 200 characters. + if (name.length > 200 || value.length > 200) { + this.log("skipping input that has a name/value too large"); + continue; + } + + // Limit number of fields stored per form. + if (entries.length >= 100) { + this.log("not saving any more entries for this form."); + break; + } + + entries.push({ name, value }); + } + + if (entries.length) { + this.log("sending entries to parent process for form " + form.id); + sendAsyncMessage("FormHistory:FormSubmitEntries", entries); + } + } catch (e) { + this.log("notify failed: " + e); + } + } }; satchelFormListener.init(); diff --git a/toolkit/components/satchel/nsFormAutoComplete.js b/toolkit/components/satchel/nsFormAutoComplete.js index 7154d248d514..acd110498453 100644 --- a/toolkit/components/satchel/nsFormAutoComplete.js +++ b/toolkit/components/satchel/nsFormAutoComplete.js @@ -10,15 +10,14 @@ const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils", - "resource://gre/modules/BrowserUtils.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils", "resource://gre/modules/BrowserUtils.jsm"); function isAutocompleteDisabled(aField) { - if (aField.autocomplete !== "") { - return aField.autocomplete === "off"; - } + if (aField.autocomplete !== "") { + return aField.autocomplete === "off"; + } - return aField.form && aField.form.autocomplete === "off"; + return aField.form && aField.form.autocomplete === "off"; } /** @@ -44,118 +43,115 @@ function isAutocompleteDisabled(aField) { * needs to be null, otherwise constructing will throw. */ function FormHistoryClient({ formField, inputName }) { - if (formField && inputName != this.SEARCHBAR_ID) { - let window = formField.ownerGlobal; - let topDocShell = window.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDocShell) - .sameTypeRootTreeItem - .QueryInterface(Ci.nsIDocShell); - this.mm = topDocShell.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIContentFrameMessageManager); - } else { - if (inputName == this.SEARCHBAR_ID && formField) { - throw new Error("FormHistoryClient constructed with both a " + - "formField and an inputName. This is not " + - "supported, and only empty results will be " + - "returned."); - } - this.mm = Services.cpmm; + if (formField && inputName != this.SEARCHBAR_ID) { + let window = formField.ownerGlobal; + let topDocShell = window.QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIDocShell) + .sameTypeRootTreeItem + .QueryInterface(Ci.nsIDocShell); + this.mm = topDocShell.QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIContentFrameMessageManager); + } else { + if (inputName == this.SEARCHBAR_ID && formField) { + throw new Error("FormHistoryClient constructed with both a " + + "formField and an inputName. This is not " + + "supported, and only empty results will be " + + "returned."); } + this.mm = Services.cpmm; + } - this.inputName = inputName; - this.id = FormHistoryClient.nextRequestID++; + this.inputName = inputName; + this.id = FormHistoryClient.nextRequestID++; } FormHistoryClient.prototype = { - SEARCHBAR_ID: "searchbar-history", + SEARCHBAR_ID: "searchbar-history", - // It is assumed that nsFormAutoComplete only uses / cares about - // one FormHistoryClient at a time, and won't attempt to have - // multiple in-flight searches occurring with the same FormHistoryClient. - // We use an ID number per instantiated FormHistoryClient to make - // sure we only respond to messages that were meant for us. - id: 0, - callback: null, - inputName: "", - mm: null, + // It is assumed that nsFormAutoComplete only uses / cares about + // one FormHistoryClient at a time, and won't attempt to have + // multiple in-flight searches occurring with the same FormHistoryClient. + // We use an ID number per instantiated FormHistoryClient to make + // sure we only respond to messages that were meant for us. + id: 0, + callback: null, + inputName: "", + mm: null, - /** - * Query FormHistory for some results. - * - * @param searchString (string) - * The string to search FormHistory for. See - * FormHistory.getAutoCompleteResults. - * @param params (object) - * An Object with search properties. See - * FormHistory.getAutoCompleteResults. - * @param callback - * A callback function that will take a single - * argument (the found entries). - */ - requestAutoCompleteResults(searchString, params, callback) { - this.mm.sendAsyncMessage("FormHistory:AutoCompleteSearchAsync", { - id: this.id, - searchString, - params, - }); + /** + * Query FormHistory for some results. + * + * @param searchString (string) + * The string to search FormHistory for. See + * FormHistory.getAutoCompleteResults. + * @param params (object) + * An Object with search properties. See + * FormHistory.getAutoCompleteResults. + * @param callback + * A callback function that will take a single + * argument (the found entries). + */ + requestAutoCompleteResults(searchString, params, callback) { + this.mm.sendAsyncMessage("FormHistory:AutoCompleteSearchAsync", { + id: this.id, + searchString, + params, + }); - this.mm.addMessageListener("FormHistory:AutoCompleteSearchResults", - this); - this.callback = callback; - }, + this.mm.addMessageListener("FormHistory:AutoCompleteSearchResults", this); + this.callback = callback; + }, - /** - * Cancel an in-flight results request. This ensures that the - * callback that requestAutoCompleteResults was passed is never - * called from this FormHistoryClient. - */ - cancel() { - this.clearListeners(); - }, + /** + * Cancel an in-flight results request. This ensures that the + * callback that requestAutoCompleteResults was passed is never + * called from this FormHistoryClient. + */ + cancel() { + this.clearListeners(); + }, - /** - * Remove an item from FormHistory. - * - * @param value (string) - * - * The value to remove for this particular - * field. - */ - remove(value) { - this.mm.sendAsyncMessage("FormHistory:RemoveEntry", { - inputName: this.inputName, - value, - }); - }, + /** + * Remove an item from FormHistory. + * + * @param value (string) + * + * The value to remove for this particular + * field. + */ + remove(value) { + this.mm.sendAsyncMessage("FormHistory:RemoveEntry", { + inputName: this.inputName, + value, + }); + }, - // Private methods + // Private methods - receiveMessage(msg) { - let { id, results } = msg.data; - if (id != this.id) { - return; - } - if (!this.callback) { - Cu.reportError("FormHistoryClient received message with no " + - "callback"); - return; - } - this.callback(results); - this.clearListeners(); - }, + receiveMessage(msg) { + let { id, results } = msg.data; + if (id != this.id) { + return; + } + if (!this.callback) { + Cu.reportError("FormHistoryClient received message with no callback"); + return; + } + this.callback(results); + this.clearListeners(); + }, - clearListeners() { - this.mm.removeMessageListener("FormHistory:AutoCompleteSearchResults", - this); - this.callback = null; - }, + clearListeners() { + this.mm.removeMessageListener("FormHistory:AutoCompleteSearchResults", this); + this.callback = null; + }, }; FormHistoryClient.nextRequestID = 1; function FormAutoComplete() { - this.init(); + this.init(); } /** @@ -164,370 +160,370 @@ function FormAutoComplete() { * Implements the nsIFormAutoComplete interface in the main process. */ FormAutoComplete.prototype = { - classID: Components.ID("{c11c21b2-71c9-4f87-a0f8-5e13f50495fd}"), - QueryInterface: XPCOMUtils.generateQI([Ci.nsIFormAutoComplete, Ci.nsISupportsWeakReference]), + classID: Components.ID("{c11c21b2-71c9-4f87-a0f8-5e13f50495fd}"), + QueryInterface: XPCOMUtils.generateQI([Ci.nsIFormAutoComplete, Ci.nsISupportsWeakReference]), - _prefBranch: null, - _debug: true, // mirrors browser.formfill.debug - _enabled: true, // mirrors browser.formfill.enable preference - _agedWeight: 2, - _bucketSize: 1, - _maxTimeGroupings: 25, - _timeGroupingSize: 7 * 24 * 60 * 60 * 1000 * 1000, - _expireDays: null, - _boundaryWeight: 25, - _prefixWeight: 5, + _prefBranch: null, + _debug: true, // mirrors browser.formfill.debug + _enabled: true, // mirrors browser.formfill.enable preference + _agedWeight: 2, + _bucketSize: 1, + _maxTimeGroupings: 25, + _timeGroupingSize: 7 * 24 * 60 * 60 * 1000 * 1000, + _expireDays: null, + _boundaryWeight: 25, + _prefixWeight: 5, - // Only one query via FormHistoryClient is performed at a time, and the - // most recent FormHistoryClient which will be stored in _pendingClient - // while the query is being performed. It will be cleared when the query - // finishes, is cancelled, or an error occurs. If a new query occurs while - // one is already pending, the existing one is cancelled. - _pendingClient: null, + // Only one query via FormHistoryClient is performed at a time, and the + // most recent FormHistoryClient which will be stored in _pendingClient + // while the query is being performed. It will be cleared when the query + // finishes, is cancelled, or an error occurs. If a new query occurs while + // one is already pending, the existing one is cancelled. + _pendingClient: null, - init() { - // Preferences. Add observer so we get notified of changes. - this._prefBranch = Services.prefs.getBranch("browser.formfill."); - this._prefBranch.addObserver("", this.observer, true); - this.observer._self = this; + init() { + // Preferences. Add observer so we get notified of changes. + this._prefBranch = Services.prefs.getBranch("browser.formfill."); + this._prefBranch.addObserver("", this.observer, true); + this.observer._self = this; - this._debug = this._prefBranch.getBoolPref("debug"); - this._enabled = this._prefBranch.getBoolPref("enable"); - this._agedWeight = this._prefBranch.getIntPref("agedWeight"); - this._bucketSize = this._prefBranch.getIntPref("bucketSize"); - this._maxTimeGroupings = this._prefBranch.getIntPref("maxTimeGroupings"); - this._timeGroupingSize = this._prefBranch.getIntPref("timeGroupingSize") * 1000 * 1000; - this._expireDays = this._prefBranch.getIntPref("expire_days"); - }, + this._debug = this._prefBranch.getBoolPref("debug"); + this._enabled = this._prefBranch.getBoolPref("enable"); + this._agedWeight = this._prefBranch.getIntPref("agedWeight"); + this._bucketSize = this._prefBranch.getIntPref("bucketSize"); + this._maxTimeGroupings = this._prefBranch.getIntPref("maxTimeGroupings"); + this._timeGroupingSize = this._prefBranch.getIntPref("timeGroupingSize") * 1000 * 1000; + this._expireDays = this._prefBranch.getIntPref("expire_days"); + }, - observer: { - _self: null, + observer: { + _self: null, - QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, - Ci.nsISupportsWeakReference]), + QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, + Ci.nsISupportsWeakReference]), - observe(subject, topic, data) { - let self = this._self; + observe(subject, topic, data) { + let self = this._self; - if (topic == "nsPref:changed") { - let prefName = data; - self.log("got change to " + prefName + " preference"); + if (topic == "nsPref:changed") { + let prefName = data; + self.log("got change to " + prefName + " preference"); - switch (prefName) { - case "agedWeight": - self._agedWeight = self._prefBranch.getIntPref(prefName); - break; - case "debug": - self._debug = self._prefBranch.getBoolPref(prefName); - break; - case "enable": - self._enabled = self._prefBranch.getBoolPref(prefName); - break; - case "maxTimeGroupings": - self._maxTimeGroupings = self._prefBranch.getIntPref(prefName); - break; - case "timeGroupingSize": - self._timeGroupingSize = self._prefBranch.getIntPref(prefName) * 1000 * 1000; - break; - case "bucketSize": - self._bucketSize = self._prefBranch.getIntPref(prefName); - break; - case "boundaryWeight": - self._boundaryWeight = self._prefBranch.getIntPref(prefName); - break; - case "prefixWeight": - self._prefixWeight = self._prefBranch.getIntPref(prefName); - break; - default: - self.log("Oops! Pref not handled, change ignored."); - } - } + switch (prefName) { + case "agedWeight": + self._agedWeight = self._prefBranch.getIntPref(prefName); + break; + case "debug": + self._debug = self._prefBranch.getBoolPref(prefName); + break; + case "enable": + self._enabled = self._prefBranch.getBoolPref(prefName); + break; + case "maxTimeGroupings": + self._maxTimeGroupings = self._prefBranch.getIntPref(prefName); + break; + case "timeGroupingSize": + self._timeGroupingSize = self._prefBranch.getIntPref(prefName) * 1000 * 1000; + break; + case "bucketSize": + self._bucketSize = self._prefBranch.getIntPref(prefName); + break; + case "boundaryWeight": + self._boundaryWeight = self._prefBranch.getIntPref(prefName); + break; + case "prefixWeight": + self._prefixWeight = self._prefBranch.getIntPref(prefName); + break; + default: + self.log("Oops! Pref not handled, change ignored."); } - }, - - // AutoCompleteE10S needs to be able to call autoCompleteSearchAsync without - // going through IDL in order to pass a mock DOM object field. - get wrappedJSObject() { - return this; - }, - - /* - * log - * - * Internal function for logging debug messages to the Error Console - * window - */ - log(message) { - if (!this._debug) { - return; - } - dump("FormAutoComplete: " + message + "\n"); - Services.console.logStringMessage("FormAutoComplete: " + message); - }, - - /* - * autoCompleteSearchAsync - * - * aInputName -- |name| attribute from the form input being autocompleted. - * aUntrimmedSearchString -- current value of the input - * aField -- nsIDOMHTMLInputElement being autocompleted (may be null if from chrome) - * aPreviousResult -- previous search result, if any. - * aDatalistResult -- results from list=datalist for aField. - * aListener -- nsIFormAutoCompleteObserver that listens for the nsIAutoCompleteResult - * that may be returned asynchronously. - */ - autoCompleteSearchAsync(aInputName, - aUntrimmedSearchString, - aField, - aPreviousResult, - aDatalistResult, - aListener) { - function sortBytotalScore(a, b) { - return b.totalScore - a.totalScore; - } - - // Guard against void DOM strings filtering into this code. - if (typeof aInputName === "object") { - aInputName = ""; - } - if (typeof aUntrimmedSearchString === "object") { - aUntrimmedSearchString = ""; - } - - let client = new FormHistoryClient({ formField: aField, inputName: aInputName }); - - // If we have datalist results, they become our "empty" result. - let emptyResult = aDatalistResult || - new FormAutoCompleteResult(client, [], - aInputName, - aUntrimmedSearchString, - null); - if (!this._enabled) { - if (aListener) { - aListener.onSearchCompletion(emptyResult); - } - return; - } - - // don't allow form inputs (aField != null) to get results from search bar history - if (aInputName == "searchbar-history" && aField) { - this.log('autoCompleteSearch for input name "' + aInputName + '" is denied'); - if (aListener) { - aListener.onSearchCompletion(emptyResult); - } - return; - } - - if (aField && isAutocompleteDisabled(aField)) { - this.log("autoCompleteSearch not allowed due to autcomplete=off"); - if (aListener) { - aListener.onSearchCompletion(emptyResult); - } - return; - } - - this.log("AutoCompleteSearch invoked. Search is: " + aUntrimmedSearchString); - let searchString = aUntrimmedSearchString.trim().toLowerCase(); - - // reuse previous results if: - // a) length greater than one character (others searches are special cases) AND - // b) the the new results will be a subset of the previous results - if (aPreviousResult && aPreviousResult.searchString.trim().length > 1 && - searchString.indexOf(aPreviousResult.searchString.trim().toLowerCase()) >= 0) { - this.log("Using previous autocomplete result"); - let result = aPreviousResult; - let wrappedResult = result.wrappedJSObject; - wrappedResult.searchString = aUntrimmedSearchString; - - // Leaky abstraction alert: it would be great to be able to split - // this code between nsInputListAutoComplete and here but because of - // the way we abuse the formfill autocomplete API in e10s, we have - // to deal with the results here as well (and down below - // in mergeResults). - // If there were datalist results result is a FormAutoCompleteResult - // as defined in nsFormAutoCompleteResult.jsm with the entire list - // of results in wrappedResult._values and only the results from - // form history in wrappedResult.entries. - // First, grab the entire list of old results. - let allResults = wrappedResult._labels; - let datalistResults, datalistLabels; - if (allResults) { - // We have datalist results, extract them from the values array. - // Both allResults and values arrays are in the form of: - // |--wR.entries--| - // - let oldLabels = allResults.slice(wrappedResult.entries.length); - let oldValues = wrappedResult._values.slice(wrappedResult.entries.length); - - datalistLabels = []; - datalistResults = []; - for (let i = 0; i < oldLabels.length; ++i) { - if (oldLabels[i].toLowerCase().includes(searchString)) { - datalistLabels.push(oldLabels[i]); - datalistResults.push(oldValues[i]); - } - } - } - - let searchTokens = searchString.split(/\s+/); - // We have a list of results for a shorter search string, so just - // filter them further based on the new search string and add to a new array. - let entries = wrappedResult.entries; - let filteredEntries = []; - for (let i = 0; i < entries.length; i++) { - let entry = entries[i]; - // Remove results that do not contain the token - // XXX bug 394604 -- .toLowerCase can be wrong for some intl chars - if (searchTokens.some(tok => entry.textLowerCase.indexOf(tok) < 0)) { - continue; - } - this._calculateScore(entry, searchString, searchTokens); - this.log("Reusing autocomplete entry '" + entry.text + - "' (" + entry.frecency + " / " + entry.totalScore + ")"); - filteredEntries.push(entry); - } - filteredEntries.sort(sortBytotalScore); - wrappedResult.entries = filteredEntries; - - // If we had datalistResults, re-merge them back into the filtered - // entries. - if (datalistResults) { - filteredEntries = filteredEntries.map(elt => elt.text); - - let comments = new Array(filteredEntries.length + datalistResults.length).fill(""); - comments[filteredEntries.length] = "separator"; - - // History entries don't have labels (their labels would be read - // from their values). Pad out the labels array so the datalist - // results (which do have separate values and labels) line up. - datalistLabels = new Array(filteredEntries.length).fill("").concat(datalistLabels); - wrappedResult._values = filteredEntries.concat(datalistResults); - wrappedResult._labels = datalistLabels; - wrappedResult._comments = comments; - } - - if (aListener) { - aListener.onSearchCompletion(result); - } - } else { - this.log("Creating new autocomplete search result."); - - // Start with an empty list. - let result = aDatalistResult ? - new FormAutoCompleteResult(client, [], aInputName, aUntrimmedSearchString, null) : - emptyResult; - - let processEntry = (aEntries) => { - if (aField && aField.maxLength > -1) { - result.entries = - aEntries.filter(function(el) { return el.text.length <= aField.maxLength; }); - } else { - result.entries = aEntries; - } - - if (aDatalistResult && aDatalistResult.matchCount > 0) { - result = this.mergeResults(result, aDatalistResult); - } - - if (aListener) { - aListener.onSearchCompletion(result); - } - } - - this.getAutoCompleteValues(client, aInputName, searchString, processEntry); - } - }, - - mergeResults(historyResult, datalistResult) { - let values = datalistResult.wrappedJSObject._values; - let labels = datalistResult.wrappedJSObject._labels; - let comments = new Array(values.length).fill(""); - - // historyResult will be null if form autocomplete is disabled. We - // still want the list values to display. - let entries = historyResult.wrappedJSObject.entries; - let historyResults = entries.map(entry => entry.text); - let historyComments = new Array(entries.length).fill(""); - - // now put the history results above the datalist suggestions - let finalValues = historyResults.concat(values); - let finalLabels = historyResults.concat(labels); - let finalComments = historyComments.concat(comments); - - // This is ugly: there are two FormAutoCompleteResult classes in the - // tree, one in a module and one in this file. Datalist results need to - // use the one defined in the module but the rest of this file assumes - // that we use the one defined here. To get around that, we explicitly - // import the module here, out of the way of the other uses of - // FormAutoCompleteResult. - let {FormAutoCompleteResult} = Cu.import("resource://gre/modules/nsFormAutoCompleteResult.jsm", {}); - return new FormAutoCompleteResult(datalistResult.searchString, - Ci.nsIAutoCompleteResult.RESULT_SUCCESS, - 0, "", finalValues, finalLabels, - finalComments, historyResult); - }, - - stopAutoCompleteSearch() { - if (this._pendingClient) { - this._pendingClient.cancel(); - this._pendingClient = null; - } - }, - - /* - * Get the values for an autocomplete list given a search string. - * - * client - a FormHistoryClient instance to perform the search with - * fieldName - fieldname field within form history (the form input name) - * searchString - string to search for - * callback - called when the values are available. Passed an array of objects, - * containing properties for each result. The callback is only called - * when successful. - */ - getAutoCompleteValues(client, fieldName, searchString, callback) { - let params = { - agedWeight: this._agedWeight, - bucketSize: this._bucketSize, - expiryDate: 1000 * (Date.now() - this._expireDays * 24 * 60 * 60 * 1000), - fieldname: fieldName, - maxTimeGroupings: this._maxTimeGroupings, - timeGroupingSize: this._timeGroupingSize, - prefixWeight: this._prefixWeight, - boundaryWeight: this._boundaryWeight - } - - this.stopAutoCompleteSearch(); - client.requestAutoCompleteResults(searchString, params, (entries) => { - this._pendingClient = null; - callback(entries); - }); - this._pendingClient = client; - }, - - /* - * _calculateScore - * - * entry -- an nsIAutoCompleteResult entry - * aSearchString -- current value of the input (lowercase) - * searchTokens -- array of tokens of the search string - * - * Returns: an int - */ - _calculateScore(entry, aSearchString, searchTokens) { - let boundaryCalc = 0; - // for each word, calculate word boundary weights - for (let token of searchTokens) { - boundaryCalc += (entry.textLowerCase.indexOf(token) == 0); - boundaryCalc += (entry.textLowerCase.indexOf(" " + token) >= 0); - } - boundaryCalc = boundaryCalc * this._boundaryWeight; - // now add more weight if we have a traditional prefix match and - // multiply boundary bonuses by boundary weight - boundaryCalc += this._prefixWeight * - (entry.textLowerCase. - indexOf(aSearchString) == 0); - entry.totalScore = Math.round(entry.frecency * Math.max(1, boundaryCalc)); + } } + }, + + // AutoCompleteE10S needs to be able to call autoCompleteSearchAsync without + // going through IDL in order to pass a mock DOM object field. + get wrappedJSObject() { + return this; + }, + + /* + * log + * + * Internal function for logging debug messages to the Error Console + * window + */ + log(message) { + if (!this._debug) { + return; + } + dump("FormAutoComplete: " + message + "\n"); + Services.console.logStringMessage("FormAutoComplete: " + message); + }, + + /* + * autoCompleteSearchAsync + * + * aInputName -- |name| attribute from the form input being autocompleted. + * aUntrimmedSearchString -- current value of the input + * aField -- nsIDOMHTMLInputElement being autocompleted (may be null if from chrome) + * aPreviousResult -- previous search result, if any. + * aDatalistResult -- results from list=datalist for aField. + * aListener -- nsIFormAutoCompleteObserver that listens for the nsIAutoCompleteResult + * that may be returned asynchronously. + */ + autoCompleteSearchAsync(aInputName, + aUntrimmedSearchString, + aField, + aPreviousResult, + aDatalistResult, + aListener) { + function sortBytotalScore(a, b) { + return b.totalScore - a.totalScore; + } + + // Guard against void DOM strings filtering into this code. + if (typeof aInputName === "object") { + aInputName = ""; + } + if (typeof aUntrimmedSearchString === "object") { + aUntrimmedSearchString = ""; + } + + let client = new FormHistoryClient({ formField: aField, inputName: aInputName }); + + // If we have datalist results, they become our "empty" result. + let emptyResult = aDatalistResult || new FormAutoCompleteResult( + client, + [], + aInputName, + aUntrimmedSearchString, + null + ); + if (!this._enabled) { + if (aListener) { + aListener.onSearchCompletion(emptyResult); + } + return; + } + + // don't allow form inputs (aField != null) to get results from search bar history + if (aInputName == "searchbar-history" && aField) { + this.log('autoCompleteSearch for input name "' + aInputName + '" is denied'); + if (aListener) { + aListener.onSearchCompletion(emptyResult); + } + return; + } + + if (aField && isAutocompleteDisabled(aField)) { + this.log("autoCompleteSearch not allowed due to autcomplete=off"); + if (aListener) { + aListener.onSearchCompletion(emptyResult); + } + return; + } + + this.log("AutoCompleteSearch invoked. Search is: " + aUntrimmedSearchString); + let searchString = aUntrimmedSearchString.trim().toLowerCase(); + + // reuse previous results if: + // a) length greater than one character (others searches are special cases) AND + // b) the the new results will be a subset of the previous results + if (aPreviousResult && aPreviousResult.searchString.trim().length > 1 && + searchString.indexOf(aPreviousResult.searchString.trim().toLowerCase()) >= 0) { + this.log("Using previous autocomplete result"); + let result = aPreviousResult; + let wrappedResult = result.wrappedJSObject; + wrappedResult.searchString = aUntrimmedSearchString; + + // Leaky abstraction alert: it would be great to be able to split + // this code between nsInputListAutoComplete and here but because of + // the way we abuse the formfill autocomplete API in e10s, we have + // to deal with the results here as well (and down below + // in mergeResults). + // If there were datalist results result is a FormAutoCompleteResult + // as defined in nsFormAutoCompleteResult.jsm with the entire list + // of results in wrappedResult._values and only the results from + // form history in wrappedResult.entries. + // First, grab the entire list of old results. + let allResults = wrappedResult._labels; + let datalistResults, datalistLabels; + if (allResults) { + // We have datalist results, extract them from the values array. + // Both allResults and values arrays are in the form of: + // |--wR.entries--| + // + let oldLabels = allResults.slice(wrappedResult.entries.length); + let oldValues = wrappedResult._values.slice(wrappedResult.entries.length); + + datalistLabels = []; + datalistResults = []; + for (let i = 0; i < oldLabels.length; ++i) { + if (oldLabels[i].toLowerCase().includes(searchString)) { + datalistLabels.push(oldLabels[i]); + datalistResults.push(oldValues[i]); + } + } + } + + let searchTokens = searchString.split(/\s+/); + // We have a list of results for a shorter search string, so just + // filter them further based on the new search string and add to a new array. + let entries = wrappedResult.entries; + let filteredEntries = []; + for (let i = 0; i < entries.length; i++) { + let entry = entries[i]; + // Remove results that do not contain the token + // XXX bug 394604 -- .toLowerCase can be wrong for some intl chars + if (searchTokens.some(tok => entry.textLowerCase.indexOf(tok) < 0)) { + continue; + } + this._calculateScore(entry, searchString, searchTokens); + this.log("Reusing autocomplete entry '" + entry.text + + "' (" + entry.frecency + " / " + entry.totalScore + ")"); + filteredEntries.push(entry); + } + filteredEntries.sort(sortBytotalScore); + wrappedResult.entries = filteredEntries; + + // If we had datalistResults, re-merge them back into the filtered + // entries. + if (datalistResults) { + filteredEntries = filteredEntries.map(elt => elt.text); + + let comments = new Array(filteredEntries.length + datalistResults.length).fill(""); + comments[filteredEntries.length] = "separator"; + + // History entries don't have labels (their labels would be read + // from their values). Pad out the labels array so the datalist + // results (which do have separate values and labels) line up. + datalistLabels = new Array(filteredEntries.length).fill("").concat(datalistLabels); + wrappedResult._values = filteredEntries.concat(datalistResults); + wrappedResult._labels = datalistLabels; + wrappedResult._comments = comments; + } + + if (aListener) { + aListener.onSearchCompletion(result); + } + } else { + this.log("Creating new autocomplete search result."); + + // Start with an empty list. + let result = aDatalistResult ? + new FormAutoCompleteResult(client, [], aInputName, aUntrimmedSearchString, null) : + emptyResult; + + let processEntry = (aEntries) => { + if (aField && aField.maxLength > -1) { + result.entries = + aEntries.filter(function(el) { return el.text.length <= aField.maxLength; }); + } else { + result.entries = aEntries; + } + + if (aDatalistResult && aDatalistResult.matchCount > 0) { + result = this.mergeResults(result, aDatalistResult); + } + + if (aListener) { + aListener.onSearchCompletion(result); + } + } + + this.getAutoCompleteValues(client, aInputName, searchString, processEntry); + } + }, + + mergeResults(historyResult, datalistResult) { + let values = datalistResult.wrappedJSObject._values; + let labels = datalistResult.wrappedJSObject._labels; + let comments = new Array(values.length).fill(""); + + // historyResult will be null if form autocomplete is disabled. We + // still want the list values to display. + let entries = historyResult.wrappedJSObject.entries; + let historyResults = entries.map(entry => entry.text); + let historyComments = new Array(entries.length).fill(""); + + // now put the history results above the datalist suggestions + let finalValues = historyResults.concat(values); + let finalLabels = historyResults.concat(labels); + let finalComments = historyComments.concat(comments); + + // This is ugly: there are two FormAutoCompleteResult classes in the + // tree, one in a module and one in this file. Datalist results need to + // use the one defined in the module but the rest of this file assumes + // that we use the one defined here. To get around that, we explicitly + // import the module here, out of the way of the other uses of + // FormAutoCompleteResult. + let {FormAutoCompleteResult} = Cu.import("resource://gre/modules/nsFormAutoCompleteResult.jsm", {}); + return new FormAutoCompleteResult(datalistResult.searchString, + Ci.nsIAutoCompleteResult.RESULT_SUCCESS, + 0, "", finalValues, finalLabels, + finalComments, historyResult); + }, + + stopAutoCompleteSearch() { + if (this._pendingClient) { + this._pendingClient.cancel(); + this._pendingClient = null; + } + }, + + /* + * Get the values for an autocomplete list given a search string. + * + * client - a FormHistoryClient instance to perform the search with + * fieldName - fieldname field within form history (the form input name) + * searchString - string to search for + * callback - called when the values are available. Passed an array of objects, + * containing properties for each result. The callback is only called + * when successful. + */ + getAutoCompleteValues(client, fieldName, searchString, callback) { + let params = { + agedWeight: this._agedWeight, + bucketSize: this._bucketSize, + expiryDate: 1000 * (Date.now() - this._expireDays * 24 * 60 * 60 * 1000), + fieldname: fieldName, + maxTimeGroupings: this._maxTimeGroupings, + timeGroupingSize: this._timeGroupingSize, + prefixWeight: this._prefixWeight, + boundaryWeight: this._boundaryWeight + } + + this.stopAutoCompleteSearch(); + client.requestAutoCompleteResults(searchString, params, (entries) => { + this._pendingClient = null; + callback(entries); + }); + this._pendingClient = client; + }, + + /* + * _calculateScore + * + * entry -- an nsIAutoCompleteResult entry + * aSearchString -- current value of the input (lowercase) + * searchTokens -- array of tokens of the search string + * + * Returns: an int + */ + _calculateScore(entry, aSearchString, searchTokens) { + let boundaryCalc = 0; + // for each word, calculate word boundary weights + for (let token of searchTokens) { + boundaryCalc += (entry.textLowerCase.indexOf(token) == 0); + boundaryCalc += (entry.textLowerCase.indexOf(" " + token) >= 0); + } + boundaryCalc = boundaryCalc * this._boundaryWeight; + // now add more weight if we have a traditional prefix match and + // multiply boundary bonuses by boundary weight + boundaryCalc += this._prefixWeight * (entry.textLowerCase.indexOf(aSearchString) == 0); + entry.totalScore = Math.round(entry.frecency * Math.max(1, boundaryCalc)); + } }; // end of FormAutoComplete implementation @@ -537,90 +533,89 @@ function FormAutoCompleteResult(client, fieldName, searchString, messageManager) { - this.client = client; - this.entries = entries; - this.fieldName = fieldName; - this.searchString = searchString; - this.messageManager = messageManager; + this.client = client; + this.entries = entries; + this.fieldName = fieldName; + this.searchString = searchString; + this.messageManager = messageManager; } FormAutoCompleteResult.prototype = { - QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompleteResult, - Ci.nsISupportsWeakReference]), + QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompleteResult, Ci.nsISupportsWeakReference]), - // private - client: null, - entries: null, - fieldName: null, + // private + client: null, + entries: null, + fieldName: null, - _checkIndexBounds(index) { - if (index < 0 || index >= this.entries.length) { - throw Components.Exception("Index out of range.", Cr.NS_ERROR_ILLEGAL_VALUE); - } - }, - - // Allow autoCompleteSearch to get at the JS object so it can - // modify some readonly properties for internal use. - get wrappedJSObject() { - return this; - }, - - // Interfaces from idl... - searchString: "", - errorDescription: "", - get defaultIndex() { - if (this.entries.length == 0) { - return -1; - } - return 0; - }, - get searchResult() { - if (this.entries.length == 0) { - return Ci.nsIAutoCompleteResult.RESULT_NOMATCH; - } - return Ci.nsIAutoCompleteResult.RESULT_SUCCESS; - }, - get matchCount() { - return this.entries.length; - }, - - getValueAt(index) { - this._checkIndexBounds(index); - return this.entries[index].text; - }, - - getLabelAt(index) { - return this.getValueAt(index); - }, - - getCommentAt(index) { - this._checkIndexBounds(index); - return ""; - }, - - getStyleAt(index) { - this._checkIndexBounds(index); - return ""; - }, - - getImageAt(index) { - this._checkIndexBounds(index); - return ""; - }, - - getFinalCompleteValueAt(index) { - return this.getValueAt(index); - }, - - removeValueAt(index, removeFromDB) { - this._checkIndexBounds(index); - - let [removedEntry] = this.entries.splice(index, 1); - - if (removeFromDB) { - this.client.remove(removedEntry.text); - } + _checkIndexBounds(index) { + if (index < 0 || index >= this.entries.length) { + throw Components.Exception("Index out of range.", Cr.NS_ERROR_ILLEGAL_VALUE); } + }, + + // Allow autoCompleteSearch to get at the JS object so it can + // modify some readonly properties for internal use. + get wrappedJSObject() { + return this; + }, + + // Interfaces from idl... + searchString: "", + errorDescription: "", + get defaultIndex() { + if (this.entries.length == 0) { + return -1; + } + return 0; + }, + get searchResult() { + if (this.entries.length == 0) { + return Ci.nsIAutoCompleteResult.RESULT_NOMATCH; + } + return Ci.nsIAutoCompleteResult.RESULT_SUCCESS; + }, + get matchCount() { + return this.entries.length; + }, + + getValueAt(index) { + this._checkIndexBounds(index); + return this.entries[index].text; + }, + + getLabelAt(index) { + return this.getValueAt(index); + }, + + getCommentAt(index) { + this._checkIndexBounds(index); + return ""; + }, + + getStyleAt(index) { + this._checkIndexBounds(index); + return ""; + }, + + getImageAt(index) { + this._checkIndexBounds(index); + return ""; + }, + + getFinalCompleteValueAt(index) { + return this.getValueAt(index); + }, + + removeValueAt(index, removeFromDB) { + this._checkIndexBounds(index); + + let [removedEntry] = this.entries.splice(index, 1); + + if (removeFromDB) { + this.client.remove(removedEntry.text); + } + } }; this.NSGetFactory = XPCOMUtils.generateNSGetFactory([FormAutoComplete]); From 4eb32a2872e78a62e0198bc484071317df8b0d23 Mon Sep 17 00:00:00 2001 From: Jonathan Guillotte-Blouin Date: Tue, 16 May 2017 18:23:56 -0700 Subject: [PATCH 27/56] Bug 1365068 - import with destructuring, switch to shorthand function declarations and use array.includes. r=MattN MozReview-Commit-ID: IfmePvN8WnA --HG-- extra : rebase_source : 9f7d272ae66bbfde81d777cff9a17eebb1ec98b8 --- .../components/satchel/AutoCompletePopup.jsm | 4 +- toolkit/components/satchel/FormHistory.jsm | 42 +++++++++---------- .../components/satchel/FormHistoryStartup.js | 15 +++---- .../components/satchel/formSubmitListener.js | 3 +- .../components/satchel/nsFormAutoComplete.js | 10 ++--- .../satchel/nsFormAutoCompleteResult.jsm | 3 +- .../satchel/nsInputListAutoComplete.js | 2 +- 7 files changed, 35 insertions(+), 44 deletions(-) diff --git a/toolkit/components/satchel/AutoCompletePopup.jsm b/toolkit/components/satchel/AutoCompletePopup.jsm index cb6d39fa6ff8..713d1feb078a 100644 --- a/toolkit/components/satchel/AutoCompletePopup.jsm +++ b/toolkit/components/satchel/AutoCompletePopup.jsm @@ -4,9 +4,7 @@ "use strict"; -const Cc = Components.classes; -const Ci = Components.interfaces; -const Cu = Components.utils; +const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; this.EXPORTED_SYMBOLS = [ "AutoCompletePopup" ]; diff --git a/toolkit/components/satchel/FormHistory.jsm b/toolkit/components/satchel/FormHistory.jsm index 851f6268c6b3..6858f999ba2c 100644 --- a/toolkit/components/satchel/FormHistory.jsm +++ b/toolkit/components/satchel/FormHistory.jsm @@ -85,13 +85,11 @@ this.EXPORTED_SYMBOLS = ["FormHistory"]; -const Cc = Components.classes; -const Ci = Components.interfaces; -const Cr = Components.results; +const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; -Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); -Components.utils.import("resource://gre/modules/Services.jsm"); -Components.utils.import("resource://gre/modules/AppConstants.jsm"); +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); +Cu.import("resource://gre/modules/Services.jsm"); +Cu.import("resource://gre/modules/AppConstants.jsm"); XPCOMUtils.defineLazyServiceGetter(this, "uuidService", "@mozilla.org/uuid-generator;1", @@ -214,7 +212,7 @@ function validateOpData(aData, aDataType) { thisValidFields = ["guid", "newGuid"]; } for (let field in aData) { - if (field != "op" && thisValidFields.indexOf(field) == -1) { + if (field != "op" && !thisValidFields.includes(field)) { throw Components.Exception( aDataType + " query contains an unrecognized field: " + field, Cr.NS_ERROR_ILLEGAL_VALUE); @@ -225,7 +223,7 @@ function validateOpData(aData, aDataType) { function validateSearchData(aData, aDataType) { for (let field in aData) { - if (field != "op" && validFields.indexOf(field) == -1 && searchFilters.indexOf(field) == -1) { + if (field != "op" && !validFields.includes(field) && !searchFilters.includes(field)) { throw Components.Exception( aDataType + " query contains an unrecognized field: " + field, Cr.NS_ERROR_ILLEGAL_VALUE); @@ -234,7 +232,7 @@ function validateSearchData(aData, aDataType) { } function makeQueryPredicates(aQueryData, delimiter = " AND ") { - return Object.keys(aQueryData).map(function(field) { + return Object.keys(aQueryData).map(field => { switch (field) { case "firstUsedStart": { return "firstUsed >= :" + field; @@ -532,7 +530,7 @@ var Migrators = { * Updates the DB schema to v3 (bug 506402). * Adds deleted form history table. */ - dbMigrateToVersion4: function dbMigrateToVersion4() { + dbMigrateToVersion4() { if (!_dbConnection.tableExists("moz_deleted_formhistory")) { let table = dbSchema.tables["moz_deleted_formhistory"]; let tSQL = Object.keys(table).map(col => [col, table[col]].join(" ")).join(", "); @@ -642,7 +640,7 @@ function updateFormHistoryWrite(aChanges, aCallbacks) { case "remove": log("Remove from form history " + change); let delStmt = makeMoveToDeletedStatement(change.guid, now, change, bindingArrays); - if (delStmt && stmts.indexOf(delStmt) == -1) { + if (delStmt && !stmts.includes(delStmt)) { stmts.push(delStmt); } if ("timeDeleted" in change) { @@ -688,7 +686,7 @@ function updateFormHistoryWrite(aChanges, aCallbacks) { } // As identical statements are reused, only add statements if they aren't already present. - if (stmt && stmts.indexOf(stmt) == -1) { + if (stmt && !stmts.includes(stmt)) { stmts.push(stmt); } } @@ -782,7 +780,7 @@ this.FormHistory = { return Prefs.enabled; }, - search: function formHistorySearch(aSelectTerms, aSearchData, aCallbacks) { + search(aSelectTerms, aSearchData, aCallbacks) { // if no terms selected, select everything if (!aSelectTerms) { aSelectTerms = validFields; @@ -811,7 +809,7 @@ this.FormHistory = { } }, - handleCompletion: function searchCompletionHandler(aReason) { + handleCompletion(aReason) { if (aCallbacks && aCallbacks.handleCompletion) { aCallbacks.handleCompletion(aReason == Ci.mozIStorageStatementCallback.REASON_FINISHED ? 0 : 1); } @@ -821,11 +819,11 @@ this.FormHistory = { stmt.executeAsync(handlers); }, - count: function formHistoryCount(aSearchData, aCallbacks) { + count(aSearchData, aCallbacks) { validateSearchData(aSearchData, "Count"); let stmt = makeCountStatement(aSearchData); let handlers = { - handleResult: function countResultHandler(aResultSet) { + handleResult(aResultSet) { let row = aResultSet.getNextRow(); let count = row.getResultByName("numEntries"); if (aCallbacks && aCallbacks.handleResult) { @@ -839,7 +837,7 @@ this.FormHistory = { } }, - handleCompletion: function searchCompletionHandler(aReason) { + handleCompletion(aReason) { if (aCallbacks && aCallbacks.handleCompletion) { aCallbacks.handleCompletion(aReason == Ci.mozIStorageStatementCallback.REASON_FINISHED ? 0 : 1); } @@ -849,7 +847,7 @@ this.FormHistory = { stmt.executeAsync(handlers); }, - update: function formHistoryUpdate(aChanges, aCallbacks) { + update(aChanges, aCallbacks) { // Used to keep track of how many searches have been started. When that number // are finished, updateFormHistoryWrite can be called. let numSearches = 0; @@ -977,7 +975,7 @@ this.FormHistory = { } }, - getAutoCompleteResults: function getAutoCompleteResults(searchString, params, aCallbacks) { + getAutoCompleteResults(searchString, params, aCallbacks) { // only do substring matching when the search string contains more than one character let searchTokens; let where = "" @@ -1101,11 +1099,11 @@ this.FormHistory = { }, // The remaining methods are called by FormHistoryStartup.js - updatePrefs: function updatePrefs() { + updatePrefs() { Prefs.initialized = false; }, - expireOldEntries: function expireOldEntries() { + expireOldEntries() { log("expireOldEntries"); // Determine how many days of history we're supposed to keep. @@ -1124,7 +1122,7 @@ this.FormHistory = { }); }, - shutdown: function shutdown() { dbClose(true); } + shutdown() { dbClose(true); } }; // Prevent add-ons from redefining this API diff --git a/toolkit/components/satchel/FormHistoryStartup.js b/toolkit/components/satchel/FormHistoryStartup.js index 09ae1f047b13..43519017d45a 100644 --- a/toolkit/components/satchel/FormHistoryStartup.js +++ b/toolkit/components/satchel/FormHistoryStartup.js @@ -2,8 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -const Cc = Components.classes; -const Ci = Components.interfaces; +const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/Services.jsm"); @@ -74,13 +73,11 @@ FormHistoryStartup.prototype = { switch (message.name) { case "FormHistory:FormSubmitEntries": { let entries = message.data; - let changes = entries.map(function(entry) { - return { - op: "bump", - fieldname: entry.name, - value: entry.value, - } - }); + let changes = entries.map(entry => ({ + op: "bump", + fieldname: entry.name, + value: entry.value, + })); FormHistory.update(changes); break; diff --git a/toolkit/components/satchel/formSubmitListener.js b/toolkit/components/satchel/formSubmitListener.js index 506c77099604..a1d9909c963b 100644 --- a/toolkit/components/satchel/formSubmitListener.js +++ b/toolkit/components/satchel/formSubmitListener.js @@ -6,8 +6,7 @@ (function() { -var Cc = Components.classes; -var Ci = Components.interfaces; +const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/Services.jsm"); diff --git a/toolkit/components/satchel/nsFormAutoComplete.js b/toolkit/components/satchel/nsFormAutoComplete.js index acd110498453..431e9cfb30bb 100644 --- a/toolkit/components/satchel/nsFormAutoComplete.js +++ b/toolkit/components/satchel/nsFormAutoComplete.js @@ -5,7 +5,7 @@ "use strict"; -const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components; +const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); @@ -331,7 +331,7 @@ FormAutoComplete.prototype = { // a) length greater than one character (others searches are special cases) AND // b) the the new results will be a subset of the previous results if (aPreviousResult && aPreviousResult.searchString.trim().length > 1 && - searchString.indexOf(aPreviousResult.searchString.trim().toLowerCase()) >= 0) { + searchString.includes(aPreviousResult.searchString.trim().toLowerCase())) { this.log("Using previous autocomplete result"); let result = aPreviousResult; let wrappedResult = result.wrappedJSObject; @@ -376,7 +376,7 @@ FormAutoComplete.prototype = { let entry = entries[i]; // Remove results that do not contain the token // XXX bug 394604 -- .toLowerCase can be wrong for some intl chars - if (searchTokens.some(tok => entry.textLowerCase.indexOf(tok) < 0)) { + if (searchTokens.some(tok => !entry.textLowerCase.includes(tok))) { continue; } this._calculateScore(entry, searchString, searchTokens); @@ -418,7 +418,7 @@ FormAutoComplete.prototype = { let processEntry = (aEntries) => { if (aField && aField.maxLength > -1) { result.entries = - aEntries.filter(function(el) { return el.text.length <= aField.maxLength; }); + aEntries.filter(el => el.text.length <= aField.maxLength); } else { result.entries = aEntries; } @@ -516,7 +516,7 @@ FormAutoComplete.prototype = { // for each word, calculate word boundary weights for (let token of searchTokens) { boundaryCalc += (entry.textLowerCase.indexOf(token) == 0); - boundaryCalc += (entry.textLowerCase.indexOf(" " + token) >= 0); + boundaryCalc += (entry.textLowerCase.includes(" " + token)); } boundaryCalc = boundaryCalc * this._boundaryWeight; // now add more weight if we have a traditional prefix match and diff --git a/toolkit/components/satchel/nsFormAutoCompleteResult.jsm b/toolkit/components/satchel/nsFormAutoCompleteResult.jsm index 14c75fb51217..11463dc5fd7f 100644 --- a/toolkit/components/satchel/nsFormAutoCompleteResult.jsm +++ b/toolkit/components/satchel/nsFormAutoCompleteResult.jsm @@ -4,8 +4,7 @@ this.EXPORTED_SYMBOLS = [ "FormAutoCompleteResult" ]; -const Ci = Components.interfaces; -const Cr = Components.results; +const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); diff --git a/toolkit/components/satchel/nsInputListAutoComplete.js b/toolkit/components/satchel/nsInputListAutoComplete.js index 77e2bdaf248a..3277954a981c 100644 --- a/toolkit/components/satchel/nsInputListAutoComplete.js +++ b/toolkit/components/satchel/nsInputListAutoComplete.js @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -const Ci = Components.interfaces; +const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/Services.jsm"); From b991e3f4f232fa214beaf3a0fe6d71a0591fdea2 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Sat, 20 May 2017 11:34:36 -0500 Subject: [PATCH 28/56] =?UTF-8?q?servo:=20Merge=20#16960=20-=20Derive=20Ha?= =?UTF-8?q?sViewportPercentage=20=F0=9F=8D=B7=20(from=20servo:derive-all-t?= =?UTF-8?q?he-things);=20r=3Demilio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Source-Repo: https://github.com/servo/servo Source-Revision: 4f0b24ac0c3bd04104d705898ceb4d06ef5ea092 --HG-- rename : servo/components/domobject_derive/Cargo.toml => servo/components/style_derive/Cargo.toml extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 498aeee06ee32907459c0ba0c29d40189438fb0b --- servo/Cargo.lock | 20 +++- servo/components/style/Cargo.toml | 1 + servo/components/style/lib.rs | 2 + servo/components/style/macros.rs | 13 --- .../style/properties/helpers.mako.rs | 38 +++++-- .../properties/longhand/background.mako.rs | 23 +--- .../style/properties/longhand/border.mako.rs | 37 +------ .../style/properties/longhand/box.mako.rs | 104 ++---------------- .../style/properties/longhand/color.mako.rs | 3 +- .../properties/longhand/counters.mako.rs | 13 +-- .../style/properties/longhand/effects.mako.rs | 25 ++--- .../style/properties/longhand/font.mako.rs | 35 +----- .../properties/longhand/inherited_box.mako.rs | 2 - .../properties/longhand/inherited_svg.mako.rs | 1 - .../longhand/inherited_table.mako.rs | 10 +- .../longhand/inherited_text.mako.rs | 65 +---------- .../style/properties/longhand/list.mako.rs | 3 - .../style/properties/longhand/outline.mako.rs | 16 +-- .../properties/longhand/pointing.mako.rs | 3 +- .../properties/longhand/position.mako.rs | 21 ++-- .../style/properties/longhand/svg.mako.rs | 1 - .../style/properties/longhand/table.mako.rs | 1 - .../style/properties/longhand/text.mako.rs | 3 - .../style/properties/longhand/ui.mako.rs | 2 - servo/components/style/values/computed/mod.rs | 2 +- .../components/style/values/generics/image.rs | 78 ++----------- .../style/values/generics/position.rs | 10 +- servo/components/style/values/mod.rs | 26 +---- .../components/style/values/specified/grid.rs | 13 +-- .../style/values/specified/image.rs | 2 +- .../style/values/specified/length.rs | 82 ++------------ .../components/style/values/specified/mod.rs | 39 +------ servo/components/style_derive/Cargo.toml | 15 +++ .../style_derive/has_viewport_percentage.rs | 56 ++++++++++ servo/components/style_derive/lib.rs | 18 +++ servo/components/style_traits/lib.rs | 2 + servo/components/style_traits/viewport.rs | 42 +++++++ servo/tests/unit/style/attr.rs | 1 - servo/tests/unit/style/restyle_hints.rs | 2 +- servo/tests/unit/style/stylist.rs | 2 +- 40 files changed, 258 insertions(+), 574 deletions(-) create mode 100644 servo/components/style_derive/Cargo.toml create mode 100644 servo/components/style_derive/has_viewport_percentage.rs create mode 100644 servo/components/style_derive/lib.rs diff --git a/servo/Cargo.lock b/servo/Cargo.lock index 77d1550ad412..fd6a93386fee 100644 --- a/servo/Cargo.lock +++ b/servo/Cargo.lock @@ -605,7 +605,7 @@ name = "deny_public_fields" version = "0.0.1" dependencies = [ "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", - "synstructure 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1146,7 +1146,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", - "synstructure 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1346,7 +1346,7 @@ version = "0.0.1" dependencies = [ "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", - "synstructure 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2860,6 +2860,7 @@ dependencies = [ "servo_config 0.0.1", "servo_url 0.0.1", "smallvec 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "style_derive 0.0.1", "style_traits 0.0.1", "time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2867,6 +2868,15 @@ dependencies = [ "walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "style_derive" +version = "0.0.1" +dependencies = [ + "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "style_tests" version = "0.0.1" @@ -2946,7 +2956,7 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3651,7 +3661,7 @@ dependencies = [ "checksum swapper 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca610b32bb8bfc5e7f705480c3a1edfeb70b6582495d343872c8bee0dcf758c" "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" "checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" -"checksum synstructure 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5ccc9780bf1aa601943988c2876ab22413c01ad1739689aa6af18d0aa0b3f38b" +"checksum synstructure 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cf318c34a2f8381a4f3d4db2c91b45bca2b1cd8cbe56caced900647be164800c" "checksum syntex 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a8f5e3aaa79319573d19938ea38d068056b826db9883a5d47f86c1cecc688f0e" "checksum syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "867cc5c2d7140ae7eaad2ae9e8bf39cb18a67ca651b7834f88d46ca98faadb9c" "checksum syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13ad4762fe52abc9f4008e85c4fb1b1fe3aa91ccb99ff4826a439c7c598e1047" diff --git a/servo/components/style/Cargo.toml b/servo/components/style/Cargo.toml index 125545a052fa..22400c4e2dd8 100644 --- a/servo/components/style/Cargo.toml +++ b/servo/components/style/Cargo.toml @@ -63,6 +63,7 @@ serde_derive = {version = "0.9", optional = true} servo_atoms = {path = "../atoms", optional = true} servo_config = {path = "../config", optional = true} smallvec = "0.3.3" +style_derive = {path = "../style_derive"} style_traits = {path = "../style_traits"} servo_url = {path = "../url", optional = true} time = "0.1" diff --git a/servo/components/style/lib.rs b/servo/components/style/lib.rs index 8e0e45d2bdad..98745ef2b3ee 100644 --- a/servo/components/style/lib.rs +++ b/servo/components/style/lib.rs @@ -79,6 +79,8 @@ extern crate selectors; #[cfg(feature = "servo")] extern crate servo_url; extern crate smallvec; #[macro_use] +extern crate style_derive; +#[macro_use] extern crate style_traits; extern crate time; #[allow(unused_extern_crates)] diff --git a/servo/components/style/macros.rs b/servo/components/style/macros.rs index ce040891a74c..092dc7bb8f26 100644 --- a/servo/components/style/macros.rs +++ b/servo/components/style/macros.rs @@ -38,19 +38,6 @@ macro_rules! define_numbered_css_keyword_enum { } } -/// A macro used to implement HasViewportPercentage trait -/// for a given type that may never contain viewport units. -macro_rules! no_viewport_percentage { - ($name: ident) => { - impl $crate::values::HasViewportPercentage for $name { - #[inline] - fn has_viewport_percentage(&self) -> bool { - false - } - } - }; -} - /// A macro for implementing `ComputedValueAsSpecified`, `Parse` /// and `HasViewportPercentage` traits for the enums defined /// using `define_css_keyword_enum` macro. diff --git a/servo/components/style/properties/helpers.mako.rs b/servo/components/style/properties/helpers.mako.rs index 9c0807ae33ae..d57f54c24bcb 100644 --- a/servo/components/style/properties/helpers.mako.rs +++ b/servo/components/style/properties/helpers.mako.rs @@ -13,8 +13,11 @@ <%def name="predefined_type_inner(name, type, initial_value, parse_method)"> #[allow(unused_imports)] use app_units::Au; + #[allow(unused_imports)] use cssparser::{Color as CSSParserColor, RGBA}; + #[allow(unused_imports)] use values::specified::AllowQuirks; + #[allow(unused_imports)] use smallvec::SmallVec; pub use values::specified::${type} as SpecifiedValue; pub mod computed_value { @@ -78,22 +81,22 @@ % if not gecko_only: use smallvec::SmallVec; use std::fmt; + #[allow(unused_imports)] use values::HasViewportPercentage; use style_traits::ToCss; - impl HasViewportPercentage for SpecifiedValue { - fn has_viewport_percentage(&self) -> bool { - let &SpecifiedValue(ref vec) = self; - vec.iter().any(|ref x| x.has_viewport_percentage()) - } - } - pub mod single_value { + #[allow(unused_imports)] use cssparser::Parser; + #[allow(unused_imports)] use parser::{Parse, ParserContext}; + #[allow(unused_imports)] use properties::ShorthandId; + #[allow(unused_imports)] use values::computed::{Context, ToComputedValue}; + #[allow(unused_imports)] use values::{computed, specified}; + #[allow(unused_imports)] use values::{Auto, Either, None_, Normal}; ${caller.body()} } @@ -168,7 +171,7 @@ } /// The specified value of ${name}. - #[derive(Debug, Clone, PartialEq)] + #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct SpecifiedValue(pub Vec); @@ -205,6 +208,7 @@ } pub fn parse(context: &ParserContext, input: &mut Parser) -> Result { + #[allow(unused_imports)] use parser::parse_space_or_comma_separated; <% @@ -260,22 +264,35 @@ %> /// ${property.spec} pub mod ${property.ident} { - #![allow(unused_imports)] % if not property.derived_from: + #[allow(unused_imports)] use cssparser::Parser; + #[allow(unused_imports)] use parser::{Parse, ParserContext}; + #[allow(unused_imports)] use properties::{UnparsedValue, ShorthandId}; % endif + #[allow(unused_imports)] use values::{Auto, Either, None_, Normal}; + #[allow(unused_imports)] use cascade_info::CascadeInfo; + #[allow(unused_imports)] use error_reporting::ParseErrorReporter; + #[allow(unused_imports)] use properties::longhands; + #[allow(unused_imports)] use properties::{DeclaredValue, LonghandId, LonghandIdSet}; + #[allow(unused_imports)] use properties::{CSSWideKeyword, ComputedValues, PropertyDeclaration}; + #[allow(unused_imports)] use properties::style_structs; + #[allow(unused_imports)] use stylearc::Arc; + #[allow(unused_imports)] use values::computed::{Context, ToComputedValue}; + #[allow(unused_imports)] use values::{computed, generics, specified}; + #[allow(unused_imports)] use Atom; ${caller.body()} #[allow(unused_variables)] @@ -461,7 +478,6 @@ keyword = keyword=Keyword(name, values, **keyword_kwargs) %> <%call expr="longhand(name, keyword=Keyword(name, values, **keyword_kwargs), **kwargs)"> - use values::HasViewportPercentage; use properties::longhands::system_font::SystemFont; use std::fmt; use style_traits::ToCss; @@ -583,7 +599,6 @@ impl ComputedValueAsSpecified for SpecifiedValue {} % endif - use values::HasViewportPercentage; no_viewport_percentage!(SpecifiedValue); @@ -745,7 +760,6 @@ % if shorthand: /// ${shorthand.spec} pub mod ${shorthand.ident} { - #[allow(unused_imports)] use cssparser::Parser; use parser::ParserContext; use properties::{PropertyDeclaration, SourcePropertyDeclaration, MaybeBoxed}; diff --git a/servo/components/style/properties/longhand/background.mako.rs b/servo/components/style/properties/longhand/background.mako.rs index 3b41a5714cf3..699395dd9f22 100644 --- a/servo/components/style/properties/longhand/background.mako.rs +++ b/servo/components/style/properties/longhand/background.mako.rs @@ -34,7 +34,6 @@ ${helpers.predefined_type("background-image", "ImageLayer", spec="https://drafts.csswg.org/css-backgrounds/#the-background-repeat"> use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; define_css_keyword_enum!(RepeatKeyword: "repeat" => Repeat, @@ -163,11 +162,8 @@ ${helpers.single_keyword("background-origin", <%helpers:vector_longhand name="background-size" animation_value_type="ComputedValue" extra_prefixes="webkit" spec="https://drafts.csswg.org/css-backgrounds/#the-background-size"> - use cssparser::Token; - use std::ascii::AsciiExt; use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; #[allow(missing_docs)] pub mod computed_value { @@ -236,13 +232,7 @@ ${helpers.single_keyword("background-origin", } } - impl HasViewportPercentage for ExplicitSize { - fn has_viewport_percentage(&self) -> bool { - return self.width.has_viewport_percentage() || self.height.has_viewport_percentage(); - } - } - - #[derive(Clone, PartialEq, Debug)] + #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[allow(missing_docs)] pub struct ExplicitSize { @@ -266,16 +256,7 @@ ${helpers.single_keyword("background-origin", } } - impl HasViewportPercentage for SpecifiedValue { - fn has_viewport_percentage(&self) -> bool { - match *self { - SpecifiedValue::Explicit(ref explicit_size) => explicit_size.has_viewport_percentage(), - _ => false - } - } - } - - #[derive(Clone, PartialEq, Debug)] + #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum SpecifiedValue { Explicit(ExplicitSize), diff --git a/servo/components/style/properties/longhand/border.mako.rs b/servo/components/style/properties/longhand/border.mako.rs index e5270e30fb92..8c775b682c08 100644 --- a/servo/components/style/properties/longhand/border.mako.rs +++ b/servo/components/style/properties/longhand/border.mako.rs @@ -62,7 +62,6 @@ ${helpers.gecko_keyword_conversion(Keyword('border-style', products="gecko"> use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; use values::specified::CSSColor; no_viewport_percentage!(SpecifiedValue); @@ -205,20 +204,8 @@ ${helpers.predefined_type("border-image-source", "ImageLayer", spec="https://drafts.csswg.org/css-backgrounds/#border-image-outset"> use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; use values::specified::{LengthOrNumber, Number}; - impl HasViewportPercentage for SpecifiedValue { - fn has_viewport_percentage(&self) -> bool { - let mut viewport_percentage = false; - for value in self.0.iter() { - let vp = value.has_viewport_percentage(); - viewport_percentage = vp || viewport_percentage; - } - viewport_percentage - } - } - pub mod computed_value { use values::computed::LengthOrNumber; #[derive(Debug, Clone, PartialEq)] @@ -227,7 +214,7 @@ ${helpers.predefined_type("border-image-source", "ImageLayer", pub LengthOrNumber, pub LengthOrNumber); } - #[derive(Debug, Clone, PartialEq)] + #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct SpecifiedValue(pub Vec); @@ -321,13 +308,11 @@ ${helpers.predefined_type("border-image-source", "ImageLayer", spec="https://drafts.csswg.org/css-backgrounds/#border-image-repeat"> use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; no_viewport_percentage!(SpecifiedValue); pub mod computed_value { pub use super::RepeatKeyword; - use values::computed; #[derive(Debug, Clone, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] @@ -399,23 +384,8 @@ ${helpers.predefined_type("border-image-source", "ImageLayer", spec="https://drafts.csswg.org/css-backgrounds/#border-image-width"> use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; use values::specified::{LengthOrPercentage, Number}; - impl HasViewportPercentage for SpecifiedValue { - fn has_viewport_percentage(&self) -> bool { - let mut viewport_percentage = false; - for value in self.0.clone() { - let vp = match value { - SingleSpecifiedValue::LengthOrPercentage(len) => len.has_viewport_percentage(), - _ => false, - }; - viewport_percentage = vp || viewport_percentage; - } - viewport_percentage - } - } - pub mod computed_value { use values::computed::{LengthOrPercentage, Number}; #[derive(Debug, Clone, PartialEq)] @@ -432,7 +402,7 @@ ${helpers.predefined_type("border-image-source", "ImageLayer", } } - #[derive(Debug, Clone, PartialEq)] + #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct SpecifiedValue(pub Vec); @@ -458,7 +428,7 @@ ${helpers.predefined_type("border-image-source", "ImageLayer", } } - #[derive(Debug, Clone, PartialEq)] + #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum SingleSpecifiedValue { LengthOrPercentage(LengthOrPercentage), @@ -599,7 +569,6 @@ ${helpers.predefined_type("border-image-source", "ImageLayer", spec="https://drafts.csswg.org/css-backgrounds/#border-image-slice"> use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; use values::computed::NumberOrPercentage as ComputedNumberOrPercentage; use values::specified::{NumberOrPercentage, Percentage}; diff --git a/servo/components/style/properties/longhand/box.mako.rs b/servo/components/style/properties/longhand/box.mako.rs index 86b2e7d95e20..fe9aa583a2bc 100644 --- a/servo/components/style/properties/longhand/box.mako.rs +++ b/servo/components/style/properties/longhand/box.mako.rs @@ -31,7 +31,6 @@ %> use values::computed::ComputedValueAsSpecified; use style_traits::ToCss; - use values::HasViewportPercentage; no_viewport_percentage!(SpecifiedValue); pub mod computed_value { @@ -170,7 +169,6 @@ ${helpers.single_keyword("position", "static absolute relative fixed", gecko_inexhaustive="True" gecko_ffi_name="mFloat" spec="https://drafts.csswg.org/css-box/#propdef-float"> - use values::HasViewportPercentage; no_viewport_percentage!(SpecifiedValue); impl ToComputedValue for SpecifiedValue { type ComputedValue = computed_value::T; @@ -209,7 +207,6 @@ ${helpers.single_keyword("position", "static absolute relative fixed", gecko_enum_prefix="StyleClear" gecko_ffi_name="mBreakType" spec="https://www.w3.org/TR/CSS2/visuren.html#flow-control"> - use values::HasViewportPercentage; no_viewport_percentage!(SpecifiedValue); impl ToComputedValue for SpecifiedValue { type ComputedValue = computed_value::T; @@ -263,7 +260,6 @@ ${helpers.single_keyword("position", "static absolute relative fixed", spec="https://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align"> use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; use values::specified::AllowQuirks; <% vertical_align = data.longhands_by_name["vertical-align"] %> @@ -274,18 +270,9 @@ ${helpers.single_keyword("position", "static absolute relative fixed", ${helpers.gecko_keyword_conversion(vertical_align.keyword)} - impl HasViewportPercentage for SpecifiedValue { - fn has_viewport_percentage(&self) -> bool { - match *self { - SpecifiedValue::LengthOrPercentage(ref length) => length.has_viewport_percentage(), - _ => false - } - } - } - /// The `vertical-align` value. #[allow(non_camel_case_types)] - #[derive(Debug, Clone, PartialEq)] + #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum SpecifiedValue { % for keyword in vertical_align_keywords: @@ -321,10 +308,9 @@ ${helpers.single_keyword("position", "static absolute relative fixed", /// The computed value for `vertical-align`. pub mod computed_value { - use app_units::Au; use std::fmt; use style_traits::ToCss; - use values::{CSSFloat, computed}; + use values::computed; /// The keywords are the same, and the `LengthOrPercentage` is computed /// here. @@ -426,7 +412,6 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto", use values::specified::Time; pub use values::specified::Time as SpecifiedValue; - use values::HasViewportPercentage; no_viewport_percentage!(SpecifiedValue); pub mod computed_value { @@ -458,7 +443,6 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto", use values::specified::Number; use euclid::point::{Point2D, TypedPoint2D}; use std::fmt; - use std::marker::PhantomData; use style_traits::ToCss; // FIXME: This could use static variables and const functions when they are available. @@ -499,7 +483,6 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto", pub mod computed_value { use euclid::point::Point2D; - use parser::{Parse, ParserContext}; use std::fmt; use style_traits::ToCss; use super::FunctionKeyword; @@ -764,7 +747,6 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto", } } - use values::HasViewportPercentage; no_viewport_percentage!(SpecifiedValue); #[inline] @@ -795,8 +777,6 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto", pub use properties::animated_properties::TransitionProperty as SpecifiedValue; pub mod computed_value { - use std::fmt; - use style_traits::ToCss; // NB: Can't generate the type here because it needs all the longhands // generated beforehand. pub use super::SpecifiedValue as T; @@ -810,7 +790,6 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto", TransitionProperty::All } - use values::HasViewportPercentage; no_viewport_percentage!(SpecifiedValue); impl ComputedValueAsSpecified for SpecifiedValue { } @@ -839,10 +818,9 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto", spec="https://drafts.csswg.org/css-animations/#propdef-animation-name"> use Atom; use std::fmt; - use std::ops::Deref; use style_traits::ToCss; use values::computed::ComputedValueAsSpecified; - use values::{HasViewportPercentage, KeyframesName}; + use values::KeyframesName; pub mod computed_value { pub use super::SpecifiedValue as T; @@ -937,7 +915,6 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto", use std::fmt; use style_traits::ToCss; use values::computed::ComputedValueAsSpecified; - use values::HasViewportPercentage; pub mod computed_value { pub use super::SpecifiedValue as T; @@ -1045,18 +1022,8 @@ ${helpers.single_keyword("animation-fill-mode", spec="Nonstandard (https://www.w3.org/TR/2015/WD-css-snappoints-1-20150326/#scroll-snap-points)"> use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; use values::specified::LengthOrPercentage; - impl HasViewportPercentage for SpecifiedValue { - fn has_viewport_percentage(&self) -> bool { - match *self { - SpecifiedValue::Repeat(ref length) => length.has_viewport_percentage(), - _ => false - } - } - } - pub mod computed_value { use values::computed::LengthOrPercentage; @@ -1065,7 +1032,7 @@ ${helpers.single_keyword("animation-fill-mode", pub struct T(pub Option); } - #[derive(Debug, Clone, PartialEq)] + #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum SpecifiedValue { None, @@ -1175,9 +1142,8 @@ ${helpers.predefined_type("scroll-snap-coordinate", use values::specified::{LengthOrNumber, LengthOrPercentageOrNumber as LoPoNumber, Number}; use style_traits::ToCss; use style_traits::values::Css; - use values::HasViewportPercentage; - use std::fmt::{self, Display}; + use std::fmt; pub mod computed_value { use app_units::Au; @@ -1253,7 +1219,7 @@ ${helpers.predefined_type("scroll-snap-coordinate", /// Multiple transform functions compose a transformation. /// /// Some transformations can be expressed by other more general functions. - #[derive(Clone, Debug, PartialEq)] + #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum SpecifiedOperation { /// Represents a 2D 2x3 matrix. @@ -1328,41 +1294,6 @@ ${helpers.predefined_type("scroll-snap-coordinate", } } - impl HasViewportPercentage for SpecifiedOperation { - fn has_viewport_percentage(&self) -> bool { - match *self { - SpecifiedOperation::Translate(ref l1, None) | - SpecifiedOperation::TranslateX(ref l1) | - SpecifiedOperation::TranslateY(ref l1) => { - l1.has_viewport_percentage() - } - SpecifiedOperation::TranslateZ(ref l1) => { - l1.has_viewport_percentage() - } - SpecifiedOperation::Translate(ref l1, Some(ref l2)) => { - l1.has_viewport_percentage() || - l2.has_viewport_percentage() - } - SpecifiedOperation::Translate3D(ref l1, ref l2, ref l3) => { - l1.has_viewport_percentage() || - l2.has_viewport_percentage() || - l3.has_viewport_percentage() - }, - SpecifiedOperation::Perspective(ref length) => length.has_viewport_percentage(), - SpecifiedOperation::PrefixedMatrix{ ref e, ref f, .. } => { - e.has_viewport_percentage() || - f.has_viewport_percentage() - }, - SpecifiedOperation::PrefixedMatrix3D{ ref m41, ref m42, ref m43, .. } => { - m41.has_viewport_percentage() || - m42.has_viewport_percentage() || - m43.has_viewport_percentage() - }, - _ => false - } - } - } - impl ToCss for SpecifiedOperation { fn to_css(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { use self::SpecifiedOperation::*; @@ -1422,14 +1353,7 @@ ${helpers.predefined_type("scroll-snap-coordinate", } } - impl HasViewportPercentage for SpecifiedValue { - fn has_viewport_percentage(&self) -> bool { - let &SpecifiedValue(ref specified_ops) = self; - specified_ops.iter().any(|ref x| x.has_viewport_percentage()) - } - } - - #[derive(Clone, Debug, PartialEq)] + #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct SpecifiedValue(Vec); @@ -2181,7 +2105,6 @@ ${helpers.single_keyword("transform-style", use app_units::Au; use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; use values::specified::{NoCalcLength, LengthOrPercentage, Percentage}; pub mod computed_value { @@ -2223,15 +2146,7 @@ ${helpers.single_keyword("transform-style", } } - impl HasViewportPercentage for SpecifiedValue { - fn has_viewport_percentage(&self) -> bool { - self.horizontal.has_viewport_percentage() || - self.vertical.has_viewport_percentage() || - self.depth.has_viewport_percentage() - } - } - - #[derive(Clone, Debug, PartialEq)] + #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct SpecifiedValue { horizontal: LengthOrPercentage, @@ -2307,7 +2222,6 @@ ${helpers.single_keyword("transform-style", spec="https://drafts.csswg.org/css-contain/#contain-property"> use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; use values::computed::ComputedValueAsSpecified; impl ComputedValueAsSpecified for SpecifiedValue {} @@ -2460,7 +2374,6 @@ ${helpers.single_keyword("-moz-orient", use cssparser::serialize_identifier; use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; use values::computed::ComputedValueAsSpecified; impl ComputedValueAsSpecified for SpecifiedValue {} @@ -2533,7 +2446,6 @@ ${helpers.predefined_type("shape-outside", "basic_shape::ShapeWithShapeBox", use gecko_bindings::structs; use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; use values::computed::ComputedValueAsSpecified; impl ComputedValueAsSpecified for SpecifiedValue {} diff --git a/servo/components/style/properties/longhand/color.mako.rs b/servo/components/style/properties/longhand/color.mako.rs index e4c3ef4b1fbc..20faeec84850 100644 --- a/servo/components/style/properties/longhand/color.mako.rs +++ b/servo/components/style/properties/longhand/color.mako.rs @@ -14,7 +14,7 @@ use cssparser::RGBA; use std::fmt; use style_traits::ToCss; - use values::specified::{AllowQuirks, Color, CSSColor, CSSRGBA}; + use values::specified::{AllowQuirks, Color, CSSColor}; impl ToComputedValue for SpecifiedValue { type ComputedValue = computed_value::T; @@ -122,6 +122,7 @@ impl SystemColor { pub fn parse(input: &mut Parser) -> Result { + #[cfg(feature = "gecko")] use std::ascii::AsciiExt; static PARSE_ARRAY: &'static [(&'static str, SystemColor); ${len(system_colors)}] = &[ % for color in system_colors: diff --git a/servo/components/style/properties/longhand/counters.mako.rs b/servo/components/style/properties/longhand/counters.mako.rs index 4c4ac955d5b6..c961e073b211 100644 --- a/servo/components/style/properties/longhand/counters.mako.rs +++ b/servo/components/style/properties/longhand/counters.mako.rs @@ -9,12 +9,11 @@ <%helpers:longhand name="content" boxed="True" animation_value_type="none" spec="https://drafts.csswg.org/css-content/#propdef-content"> use cssparser::Token; - use std::ascii::AsciiExt; use values::computed::ComputedValueAsSpecified; #[cfg(feature = "gecko")] use values::generics::CounterStyleOrNone; + #[cfg(feature = "gecko")] use values::specified::url::SpecifiedUrl; - use values::HasViewportPercentage; #[cfg(feature = "servo")] use super::list_style_type; @@ -29,6 +28,7 @@ use cssparser; use std::fmt; use style_traits::ToCss; + #[cfg(feature = "gecko")] use values::specified::url::SpecifiedUrl; #[cfg(feature = "servo")] @@ -256,11 +256,9 @@ spec="https://drafts.csswg.org/css-lists/#propdef-counter-increment"> use std::fmt; use style_traits::ToCss; - use super::content; - use values::{HasViewportPercentage, CustomIdent}; + use values::CustomIdent; - use cssparser::{Token, serialize_identifier}; - use std::borrow::{Cow, ToOwned}; + use cssparser::Token; #[derive(Debug, Clone, PartialEq)] pub struct SpecifiedValue(pub Vec<(CustomIdent, specified::Integer)>); @@ -278,7 +276,6 @@ fn to_css(&self, dest: &mut W) -> fmt::Result where W: fmt::Write, { - use cssparser::serialize_identifier; if self.0.is_empty() { return dest.write_str("none") } @@ -348,8 +345,6 @@ } pub fn parse_common(context: &ParserContext, default_value: i32, input: &mut Parser) -> Result { - use std::ascii::AsciiExt; - if input.try(|input| input.expect_ident_matching("none")).is_ok() { return Ok(SpecifiedValue(Vec::new())) } diff --git a/servo/components/style/properties/longhand/effects.mako.rs b/servo/components/style/properties/longhand/effects.mako.rs index b56f105c4921..730142b76a7d 100644 --- a/servo/components/style/properties/longhand/effects.mako.rs +++ b/servo/components/style/properties/longhand/effects.mako.rs @@ -18,10 +18,8 @@ ${helpers.predefined_type("opacity", animation_value_type="IntermediateBoxShadowList" extra_prefixes="webkit" spec="https://drafts.csswg.org/css-backgrounds/#box-shadow"> - use cssparser; use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; pub type SpecifiedValue = specified::Shadow; @@ -47,9 +45,6 @@ ${helpers.predefined_type("opacity", } pub mod computed_value { - use app_units::Au; - use std::fmt; - use values::computed; use values::computed::Shadow; pub type T = Shadow; @@ -91,20 +86,16 @@ ${helpers.predefined_type("clip", flags="CREATES_STACKING_CONTEXT FIXPOS_CB" spec="https://drafts.fxtf.org/filters/#propdef-filter"> //pub use self::computed_value::T as SpecifiedValue; - use cssparser; use std::fmt; - use style_traits::{self, ToCss}; + use style_traits::ToCss; use values::{CSSFloat, HasViewportPercentage}; - use values::specified::{Angle, CSSColor, Length, Shadow}; + use values::specified::{Angle, Length}; + #[cfg(feature = "gecko")] + use values::specified::Shadow; + #[cfg(feature = "gecko")] use values::specified::url::SpecifiedUrl; - impl HasViewportPercentage for SpecifiedValue { - fn has_viewport_percentage(&self) -> bool { - self.0.iter().any(|ref x| x.has_viewport_percentage()) - } - } - - #[derive(Debug, Clone, PartialEq)] + #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct SpecifiedValue(pub Vec); @@ -139,8 +130,10 @@ ${helpers.predefined_type("clip", pub mod computed_value { use app_units::Au; use values::CSSFloat; - use values::computed::{CSSColor, Shadow}; + #[cfg(feature = "gecko")] + use values::computed::Shadow; use values::computed::Angle; + #[cfg(feature = "gecko")] use values::specified::url::SpecifiedUrl; #[derive(Clone, PartialEq, Debug)] diff --git a/servo/components/style/properties/longhand/font.mako.rs b/servo/components/style/properties/longhand/font.mako.rs index 45687818d095..191dca525742 100644 --- a/servo/components/style/properties/longhand/font.mako.rs +++ b/servo/components/style/properties/longhand/font.mako.rs @@ -68,14 +68,11 @@ use self::computed_value::{FontFamily, FamilyName}; use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; - use values::computed::ComputedValueAsSpecified; no_viewport_percentage!(SpecifiedValue); pub mod computed_value { use cssparser::{CssStringWriter, Parser, serialize_identifier}; - use properties::longhands::system_font::SystemFont; use std::fmt::{self, Write}; use Atom; use style_traits::ToCss; @@ -355,7 +352,6 @@ ${helpers.single_keyword_system("font-variant-caps", spec="https://drafts.csswg.org/css-fonts/#propdef-font-weight"> use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; use properties::longhands::system_font::SystemFont; no_viewport_percentage!(SpecifiedValue); @@ -449,7 +445,6 @@ ${helpers.single_keyword_system("font-variant-caps", } pub mod computed_value { - use std::fmt; #[derive(PartialEq, Eq, Copy, Clone, Hash, Debug)] #[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))] #[repr(u16)] @@ -557,7 +552,7 @@ ${helpers.single_keyword_system("font-variant-caps", use std::fmt; use style_traits::ToCss; use values::{FONT_MEDIUM_PX, HasViewportPercentage}; - use values::specified::{AllowQuirks, FontRelativeLength, LengthOrPercentage, Length}; + use values::specified::{AllowQuirks, FontRelativeLength, LengthOrPercentage}; use values::specified::{NoCalcLength, Percentage}; use values::specified::length::FontBaseSize; @@ -694,8 +689,7 @@ ${helpers.single_keyword_system("font-variant-caps", type ComputedValue = Au; #[inline] fn to_computed_value(&self, cx: &Context) -> computed_value::T { - use gecko_bindings::bindings::Gecko_GetBaseSize; - use gecko_bindings::structs::{self, nsIAtom}; + use gecko_bindings::structs::nsIAtom; use values::specified::length::au_to_int_px; // Data from nsRuleNode.cpp in Gecko // Mapping from base size and HTML size to pixels @@ -977,7 +971,6 @@ ${helpers.single_keyword_system("font-variant-caps", use properties::longhands::system_font::SystemFont; use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; no_viewport_percentage!(SpecifiedValue); @@ -1119,7 +1112,6 @@ ${helpers.single_keyword_system("font-variant-caps", spec="https://drafts.csswg.org/css-fonts/#propdef-font-synthesis"> use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; use values::computed::ComputedValueAsSpecified; impl ComputedValueAsSpecified for SpecifiedValue {} @@ -1203,7 +1195,6 @@ ${helpers.single_keyword_system("font-kerning", use properties::longhands::system_font::SystemFont; use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; no_viewport_percentage!(SpecifiedValue); @@ -1339,7 +1330,6 @@ macro_rules! exclusive_value { use properties::longhands::system_font::SystemFont; use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; no_viewport_percentage!(SpecifiedValue); @@ -1480,7 +1470,6 @@ macro_rules! exclusive_value { use properties::longhands::system_font::SystemFont; use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; no_viewport_percentage!(SpecifiedValue); @@ -1631,7 +1620,6 @@ macro_rules! exclusive_value { use properties::longhands::system_font::SystemFont; use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; no_viewport_percentage!(SpecifiedValue); @@ -1784,8 +1772,6 @@ ${helpers.single_keyword_system("font-variant-position", use properties::longhands::system_font::SystemFont; use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; - use values::computed::ComputedValueAsSpecified; #[derive(Debug, Clone, PartialEq)] pub enum SpecifiedValue { @@ -1868,8 +1854,6 @@ ${helpers.single_keyword_system("font-variant-position", /// [ on | off | ] fn parse(_context: &ParserContext, input: &mut Parser) -> Result { use std::io::Cursor; - use std::str; - use std::ops::Deref; use byteorder::{ReadBytesExt, BigEndian}; let tag = try!(input.expect_string()); @@ -1928,7 +1912,6 @@ ${helpers.single_keyword_system("font-variant-position", use std::fmt; use style_traits::ToCss; use byteorder::{BigEndian, ByteOrder}; - use values::HasViewportPercentage; no_viewport_percentage!(SpecifiedValue); #[derive(Debug, Clone, PartialEq, Eq)] @@ -2063,7 +2046,6 @@ ${helpers.single_keyword_system("font-variant-position", <%helpers:longhand name="-x-lang" products="gecko" animation_value_type="none" internal="True" spec="Internal (not web-exposed)"> - use values::HasViewportPercentage; use values::computed::ComputedValueAsSpecified; pub use self::computed_value::T as SpecifiedValue; @@ -2102,12 +2084,10 @@ ${helpers.single_keyword_system("font-variant-position", predefined_type="Number" gecko_ffi_name="mScriptSizeMultiplier" spec="Internal (not web-exposed)" internal="True" disable_when_testing="True"> - use values::HasViewportPercentage; use values::computed::ComputedValueAsSpecified; pub use self::computed_value::T as SpecifiedValue; impl ComputedValueAsSpecified for SpecifiedValue {} - no_viewport_percentage!(SpecifiedValue); pub mod computed_value { pub type T = f32; @@ -2130,7 +2110,6 @@ ${helpers.single_keyword_system("font-variant-position", internal="True" disable_when_testing="True" need_clone="True"> use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; no_viewport_percentage!(SpecifiedValue); @@ -2230,11 +2209,9 @@ ${helpers.single_keyword("-moz-math-variant", use gecko_bindings::structs::NS_MATHML_DEFAULT_SCRIPT_MIN_SIZE_PT; use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; - use values::computed::ComputedValueAsSpecified; use values::specified::length::{AU_PER_PT, FontBaseSize, NoCalcLength}; - #[derive(Clone, PartialEq, Debug)] + #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] pub struct SpecifiedValue(pub NoCalcLength); pub mod computed_value { @@ -2272,12 +2249,6 @@ ${helpers.single_keyword("-moz-math-variant", } } - impl HasViewportPercentage for SpecifiedValue { - fn has_viewport_percentage(&self) -> bool { - self.0.has_viewport_percentage() - } - } - #[inline] pub fn get_initial_value() -> computed_value::T { Au((NS_MATHML_DEFAULT_SCRIPT_MIN_SIZE_PT as f32 * AU_PER_PT) as i32) diff --git a/servo/components/style/properties/longhand/inherited_box.mako.rs b/servo/components/style/properties/longhand/inherited_box.mako.rs index 7c7cd67e8e9f..c482e03dd627 100644 --- a/servo/components/style/properties/longhand/inherited_box.mako.rs +++ b/servo/components/style/properties/longhand/inherited_box.mako.rs @@ -68,7 +68,6 @@ ${helpers.single_keyword("image-rendering", use style_traits::ToCss; use values::specified::Angle; - use values::HasViewportPercentage; no_viewport_percentage!(SpecifiedValue); use std::f32::consts::PI; @@ -207,7 +206,6 @@ ${helpers.single_keyword("image-rendering", use std::fmt; use style_traits::ToCss; use values::computed::ComputedValueAsSpecified; - use values::HasViewportPercentage; no_viewport_percentage!(SpecifiedValue); diff --git a/servo/components/style/properties/longhand/inherited_svg.mako.rs b/servo/components/style/properties/longhand/inherited_svg.mako.rs index d7acf552e89b..1f06f0ca1722 100644 --- a/servo/components/style/properties/longhand/inherited_svg.mako.rs +++ b/servo/components/style/properties/longhand/inherited_svg.mako.rs @@ -144,7 +144,6 @@ ${helpers.predefined_type("marker-end", "UrlOrNone", "Either::Second(None_)", use values::computed::ComputedValueAsSpecified; use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; pub const NORMAL: u8 = 0; pub const FILL: u8 = 1; diff --git a/servo/components/style/properties/longhand/inherited_table.mako.rs b/servo/components/style/properties/longhand/inherited_table.mako.rs index b6c1ad3d6049..61229c3228f0 100644 --- a/servo/components/style/properties/longhand/inherited_table.mako.rs +++ b/servo/components/style/properties/longhand/inherited_table.mako.rs @@ -25,7 +25,6 @@ ${helpers.single_keyword("caption-side", "top bottom", use app_units::Au; use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; use values::specified::{AllowQuirks, Length}; pub mod computed_value { @@ -65,14 +64,7 @@ ${helpers.single_keyword("caption-side", "top bottom", } } - impl HasViewportPercentage for SpecifiedValue { - fn has_viewport_percentage(&self) -> bool { - self.horizontal.has_viewport_percentage() || - self.vertical.as_ref().map_or(false, |v| v.has_viewport_percentage()) - } - } - - #[derive(Clone, Debug, PartialEq)] + #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct SpecifiedValue { pub horizontal: Length, diff --git a/servo/components/style/properties/longhand/inherited_text.mako.rs b/servo/components/style/properties/longhand/inherited_text.mako.rs index a1f6dfc04188..83b0cf261793 100644 --- a/servo/components/style/properties/longhand/inherited_text.mako.rs +++ b/servo/components/style/properties/longhand/inherited_text.mako.rs @@ -10,18 +10,8 @@ spec="https://drafts.csswg.org/css2/visudet.html#propdef-line-height"> use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; - impl HasViewportPercentage for SpecifiedValue { - fn has_viewport_percentage(&self) -> bool { - match *self { - SpecifiedValue::LengthOrPercentage(ref length) => length.has_viewport_percentage(), - _ => false - } - } - } - - #[derive(Debug, Clone, PartialEq)] + #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum SpecifiedValue { Normal, @@ -75,7 +65,6 @@ } pub mod computed_value { use app_units::Au; - use std::fmt; use values::CSSFloat; #[derive(PartialEq, Copy, Clone, Debug)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] @@ -212,7 +201,6 @@ ${helpers.single_keyword("word-break", gecko_enum_prefix="StyleTextJustify" animation_value_type="none" spec="https://drafts.csswg.org/css-text/#propdef-text-justify"> - use values::HasViewportPercentage; no_viewport_percentage!(SpecifiedValue); impl ToComputedValue for SpecifiedValue { @@ -256,8 +244,6 @@ ${helpers.single_keyword("text-align-last", // TODO make this a shorthand and implement text-align-last/text-align-all <%helpers:longhand name="text-align" animation_value_type="none" need_clone="True" spec="https://drafts.csswg.org/css-text/#propdef-text-align"> - use values::computed::ComputedValueAsSpecified; - use values::HasViewportPercentage; no_viewport_percentage!(SpecifiedValue); pub mod computed_value { use style_traits::ToCss; @@ -400,6 +386,7 @@ ${helpers.single_keyword("text-align-last", } } % else: + use values::computed::ComputedValueAsSpecified; impl ComputedValueAsSpecified for SpecifiedValue {} pub use self::computed_value::T as SpecifiedValue; pub fn parse(_context: &ParserContext, input: &mut Parser) -> Result { @@ -412,19 +399,9 @@ ${helpers.single_keyword("text-align-last", spec="https://drafts.csswg.org/css-text/#propdef-letter-spacing"> use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; use values::specified::AllowQuirks; - impl HasViewportPercentage for SpecifiedValue { - fn has_viewport_percentage(&self) -> bool { - match *self { - SpecifiedValue::Specified(ref length) => length.has_viewport_percentage(), - _ => false - } - } - } - - #[derive(Debug, Clone, PartialEq)] + #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum SpecifiedValue { Normal, @@ -498,19 +475,9 @@ ${helpers.single_keyword("text-align-last", spec="https://drafts.csswg.org/css-text/#propdef-word-spacing"> use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; use values::specified::AllowQuirks; - impl HasViewportPercentage for SpecifiedValue { - fn has_viewport_percentage(&self) -> bool { - match *self { - SpecifiedValue::Specified(ref length) => length.has_viewport_percentage(), - _ => false - } - } - } - - #[derive(Debug, Clone, PartialEq)] + #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum SpecifiedValue { Normal, @@ -588,7 +555,6 @@ ${helpers.single_keyword("text-align-last", use cssparser::RGBA; use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; use values::computed::ComputedValueAsSpecified; impl ComputedValueAsSpecified for SpecifiedValue {} @@ -674,7 +640,6 @@ ${helpers.single_keyword("text-align-last", animation_value_type="none" spec="https://drafts.csswg.org/css-text/#propdef-white-space"> use values::computed::ComputedValueAsSpecified; - use values::HasViewportPercentage; impl ComputedValueAsSpecified for SpecifiedValue {} no_viewport_percentage!(SpecifiedValue); @@ -720,28 +685,12 @@ ${helpers.single_keyword("text-align-last", use std::fmt; use style_traits::ToCss; use values::specified::Shadow; - use values::HasViewportPercentage; - impl HasViewportPercentage for SpecifiedValue { - fn has_viewport_percentage(&self) -> bool { - let &SpecifiedValue(ref vec) = self; - vec.iter().any(|ref x| x.has_viewport_percentage()) - } - } - - #[derive(Clone, PartialEq, Debug)] + #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct SpecifiedValue(Vec); - impl HasViewportPercentage for SpecifiedTextShadow { - fn has_viewport_percentage(&self) -> bool { - self.offset_x.has_viewport_percentage() || - self.offset_y.has_viewport_percentage() || - self.blur_radius.has_viewport_percentage() - } - } - - #[derive(Clone, PartialEq, Debug)] + #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct SpecifiedTextShadow { pub offset_x: specified::Length, @@ -891,7 +840,6 @@ ${helpers.single_keyword("text-align-last", use std::fmt; use style_traits::ToCss; use unicode_segmentation::UnicodeSegmentation; - use values::HasViewportPercentage; no_viewport_percentage!(SpecifiedValue); @@ -1097,7 +1045,6 @@ ${helpers.single_keyword("text-align-last", spec="https://drafts.csswg.org/css-text-decor/#propdef-text-emphasis-position"> use std::fmt; use values::computed::ComputedValueAsSpecified; - use values::HasViewportPercentage; use style_traits::ToCss; define_css_keyword_enum!(HorizontalWritingModeValue: diff --git a/servo/components/style/properties/longhand/list.mako.rs b/servo/components/style/properties/longhand/list.mako.rs index 14084f894d22..90d9a9e3f67c 100644 --- a/servo/components/style/properties/longhand/list.mako.rs +++ b/servo/components/style/properties/longhand/list.mako.rs @@ -36,7 +36,6 @@ ${helpers.single_keyword("list-style-position", "outside inside", animation_valu use std::fmt; use style_traits::ToCss; use values::CustomIdent; - use values::HasViewportPercentage; use values::computed::ComputedValueAsSpecified; use values::generics::CounterStyleOrNone; @@ -105,7 +104,6 @@ ${helpers.single_keyword("list-style-position", "outside inside", animation_valu boxed="${product == 'gecko'}" spec="https://drafts.csswg.org/css-lists/#propdef-list-style-image"> use std::fmt; - use values::HasViewportPercentage; use values::computed::ComputedValueAsSpecified; use values::specified::UrlOrNone; pub use self::computed_value::T as SpecifiedValue; @@ -158,7 +156,6 @@ ${helpers.single_keyword("list-style-position", "outside inside", animation_valu use std::fmt; use style_traits::ToCss; use values::computed::ComputedValueAsSpecified; - use values::HasViewportPercentage; pub use self::computed_value::T as SpecifiedValue; diff --git a/servo/components/style/properties/longhand/outline.mako.rs b/servo/components/style/properties/longhand/outline.mako.rs index fcfebe6a00e8..3d0a22f08d4d 100644 --- a/servo/components/style/properties/longhand/outline.mako.rs +++ b/servo/components/style/properties/longhand/outline.mako.rs @@ -17,11 +17,7 @@ ${helpers.predefined_type("outline-color", "CSSColor", "computed::CSSColor::Curr <%helpers:longhand name="outline-style" need_clone="True" animation_value_type="none" spec="https://drafts.csswg.org/css-ui/#propdef-outline-style"> - - use std::fmt; - use style_traits::ToCss; use values::specified::BorderStyle; - use values::computed::ComputedValueAsSpecified; pub type SpecifiedValue = Either; @@ -66,10 +62,8 @@ ${helpers.predefined_type("outline-color", "CSSColor", "computed::CSSColor::Curr <%helpers:longhand name="outline-width" animation_value_type="ComputedValue" spec="https://drafts.csswg.org/css-ui/#propdef-outline-width"> - use app_units::Au; use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; impl ToCss for SpecifiedValue { fn to_css(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { @@ -81,16 +75,10 @@ ${helpers.predefined_type("outline-color", "CSSColor", "computed::CSSColor::Curr specified::parse_border_width(context, input).map(SpecifiedValue) } - impl HasViewportPercentage for SpecifiedValue { - fn has_viewport_percentage(&self) -> bool { - let &SpecifiedValue(ref length) = self; - length.has_viewport_percentage() - } - } - - #[derive(Debug, Clone, PartialEq)] + #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct SpecifiedValue(pub specified::Length); + pub mod computed_value { use app_units::Au; pub type T = Au; diff --git a/servo/components/style/properties/longhand/pointing.mako.rs b/servo/components/style/properties/longhand/pointing.mako.rs index 77edc71e000e..e04a2fc09b61 100644 --- a/servo/components/style/properties/longhand/pointing.mako.rs +++ b/servo/components/style/properties/longhand/pointing.mako.rs @@ -9,8 +9,8 @@ <%helpers:longhand name="cursor" boxed="${product == 'gecko'}" animation_value_type="none" spec="https://drafts.csswg.org/css-ui/#cursor"> pub use self::computed_value::T as SpecifiedValue; - use values::HasViewportPercentage; use values::computed::ComputedValueAsSpecified; + #[cfg(feature = "gecko")] use values::specified::url::SpecifiedUrl; impl ComputedValueAsSpecified for SpecifiedValue {} @@ -20,6 +20,7 @@ use std::fmt; use style_traits::cursor::Cursor; use style_traits::ToCss; + #[cfg(feature = "gecko")] use values::specified::url::SpecifiedUrl; #[derive(Clone, PartialEq, Copy, Debug)] diff --git a/servo/components/style/properties/longhand/position.mako.rs b/servo/components/style/properties/longhand/position.mako.rs index 0cea82301cc1..da7fe080604f 100644 --- a/servo/components/style/properties/longhand/position.mako.rs +++ b/servo/components/style/properties/longhand/position.mako.rs @@ -178,20 +178,16 @@ ${helpers.predefined_type("flex-basis", use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; - use values::specified::{AllowQuirks, ${MinMax}Length}; - - impl HasViewportPercentage for SpecifiedValue { - fn has_viewport_percentage(&self) -> bool { - self.0.has_viewport_percentage() - } - } + % if not logical: + use values::specified::AllowQuirks; + % endif + use values::specified::${MinMax}Length; pub mod computed_value { pub type T = ::values::computed::${MinMax}Length; } - #[derive(PartialEq, Clone, Debug)] + #[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct SpecifiedValue(${MinMax}Length); @@ -225,7 +221,9 @@ ${helpers.predefined_type("flex-basis", type ComputedValue = computed_value::T; #[inline] fn to_computed_value(&self, context: &Context) -> computed_value::T { - use values::computed::${MinMax}Length; + % if not logical or "block" in size: + use values::computed::${MinMax}Length; + % endif let computed = self.0.to_computed_value(context); // filter out keyword values in the block direction @@ -338,7 +336,6 @@ ${helpers.predefined_type("object-position", animation_value_type="none"> use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; use values::computed::ComputedValueAsSpecified; pub type SpecifiedValue = computed_value::T; @@ -430,8 +427,6 @@ ${helpers.predefined_type("object-position", use std::ops::Range; use str::HTML_SPACE_CHARACTERS; use style_traits::ToCss; - use style_traits::values::Css; - use values::HasViewportPercentage; use values::computed::ComputedValueAsSpecified; pub mod computed_value { diff --git a/servo/components/style/properties/longhand/svg.mako.rs b/servo/components/style/properties/longhand/svg.mako.rs index bd1a2b520a13..9d531ca58a11 100644 --- a/servo/components/style/properties/longhand/svg.mako.rs +++ b/servo/components/style/properties/longhand/svg.mako.rs @@ -77,7 +77,6 @@ ${helpers.single_keyword("mask-mode", pub use properties::longhands::background_repeat::single_value::SpecifiedValue; pub use properties::longhands::background_repeat::single_value::computed_value; pub use properties::longhands::background_repeat::single_value::RepeatKeyword; - use properties::longhands::background_repeat::single_value; #[inline] pub fn get_initial_value() -> computed_value::T { diff --git a/servo/components/style/properties/longhand/table.mako.rs b/servo/components/style/properties/longhand/table.mako.rs index 3b1c8709a94d..b64deb64606b 100644 --- a/servo/components/style/properties/longhand/table.mako.rs +++ b/servo/components/style/properties/longhand/table.mako.rs @@ -14,7 +14,6 @@ ${helpers.single_keyword("table-layout", "auto fixed", spec="Internal-only (for `` pres attr)" animation_value_type="none" internal="True"> - use values::HasViewportPercentage; use values::computed::ComputedValueAsSpecified; impl ComputedValueAsSpecified for SpecifiedValue {} diff --git a/servo/components/style/properties/longhand/text.mako.rs b/servo/components/style/properties/longhand/text.mako.rs index 4d29e2b0e774..7d0aa234e09d 100644 --- a/servo/components/style/properties/longhand/text.mako.rs +++ b/servo/components/style/properties/longhand/text.mako.rs @@ -16,7 +16,6 @@ spec="https://drafts.csswg.org/css-ui/#propdef-text-overflow"> use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; use values::computed::ComputedValueAsSpecified; use cssparser; @@ -107,7 +106,6 @@ ${helpers.single_keyword("unicode-bidi", spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-line"> use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; use values::computed::ComputedValueAsSpecified; impl ComputedValueAsSpecified for SpecifiedValue {} @@ -237,7 +235,6 @@ ${helpers.predefined_type( spec="https://drafts.csswg.org/css-inline/#sizing-drop-initials"> use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; use values::computed::ComputedValueAsSpecified; use values::specified::{Number, Integer}; diff --git a/servo/components/style/properties/longhand/ui.mako.rs b/servo/components/style/properties/longhand/ui.mako.rs index 05808307635d..25cba0609c5f 100644 --- a/servo/components/style/properties/longhand/ui.mako.rs +++ b/servo/components/style/properties/longhand/ui.mako.rs @@ -35,10 +35,8 @@ ${helpers.single_keyword("-moz-window-dragging", "default drag no-drag", product products="gecko" animation_value_type="none" spec="None (Nonstandard Firefox-only property)"> - use cssparser::Token; use std::fmt; use style_traits::ToCss; - use values::HasViewportPercentage; use values::computed::ComputedValueAsSpecified; no_viewport_percentage!(SpecifiedValue); diff --git a/servo/components/style/values/computed/mod.rs b/servo/components/style/values/computed/mod.rs index 7101192be1a1..8c537eb36942 100644 --- a/servo/components/style/values/computed/mod.rs +++ b/servo/components/style/values/computed/mod.rs @@ -175,7 +175,7 @@ impl ToComputedValue for T } /// A computed `` value. -#[derive(Clone, PartialEq, PartialOrd, Copy, Debug)] +#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq, PartialOrd)] #[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))] pub enum Angle { /// An angle with degree unit diff --git a/servo/components/style/values/generics/image.rs b/servo/components/style/values/generics/image.rs index 55bb8d20d43e..2b42314eb007 100644 --- a/servo/components/style/values/generics/image.rs +++ b/servo/components/style/values/generics/image.rs @@ -32,7 +32,7 @@ pub enum Image { /// A CSS gradient. /// https://drafts.csswg.org/css-images/#gradients -#[derive(Clone, PartialEq, Debug)] +#[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct Gradient { /// Gradients can be linear or radial. @@ -45,7 +45,7 @@ pub struct Gradient pub compat_mode: CompatMode, } -#[derive(Clone, Copy, PartialEq, Debug)] +#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] /// Whether we used the modern notation or the compatibility `-webkit` prefix. pub enum CompatMode { @@ -56,7 +56,7 @@ pub enum CompatMode { } /// A gradient kind. -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum GradientKind { /// A linear gradient. @@ -66,7 +66,7 @@ pub enum GradientKind { } /// A radial gradient's ending shape. -#[derive(Clone, Copy, PartialEq, Debug)] +#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum EndingShape { /// A circular gradient. @@ -76,7 +76,7 @@ pub enum EndingShape { } /// A circle shape. -#[derive(Clone, Copy, PartialEq, Debug)] +#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum Circle { /// A circle radius. @@ -86,7 +86,7 @@ pub enum Circle { } /// An ellipse shape. -#[derive(Clone, Copy, PartialEq, Debug)] +#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum Ellipse { /// An ellipse pair of radii. @@ -104,10 +104,11 @@ define_css_keyword_enum!(ShapeExtent: "contain" => Contain, "cover" => Cover ); +no_viewport_percentage!(ShapeExtent); /// A gradient item. /// https://drafts.csswg.org/css-images-4/#color-stop-syntax -#[derive(Clone, Copy, PartialEq, Debug)] +#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum GradientItem { /// A color stop. @@ -118,7 +119,7 @@ pub enum GradientItem { /// A color stop. /// https://drafts.csswg.org/css-images/#typedef-color-stop-list -#[derive(Clone, Copy, PartialEq)] +#[derive(Clone, Copy, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct ColorStop { /// The color of this stop. @@ -281,17 +282,6 @@ impl ToCss for Gradient } } -impl HasViewportPercentage for Gradient - where L: HasViewportPercentage, - LoP: HasViewportPercentage, - P: HasViewportPercentage, -{ - fn has_viewport_percentage(&self) -> bool { - self.kind.has_viewport_percentage() || - self.items.iter().any(|i| i.has_viewport_percentage()) - } -} - impl ToComputedValue for Gradient where D: ToComputedValue, L: ToComputedValue, @@ -333,21 +323,6 @@ impl GradientKind { } } -impl HasViewportPercentage for GradientKind - where L: HasViewportPercentage, - LoP: HasViewportPercentage, - P: HasViewportPercentage -{ - fn has_viewport_percentage(&self) -> bool { - match *self { - GradientKind::Linear(_) => false, - GradientKind::Radial(ref shape, ref position) => { - shape.has_viewport_percentage() || position.has_viewport_percentage() - }, - } - } -} - impl ToComputedValue for GradientKind where D: ToComputedValue, L: ToComputedValue, @@ -423,22 +398,6 @@ impl ToCss for EndingShape } } -impl HasViewportPercentage for EndingShape - where L: HasViewportPercentage, LoP: HasViewportPercentage, -{ - fn has_viewport_percentage(&self) -> bool { - match *self { - EndingShape::Circle(Circle::Radius(ref length)) => { - length.has_viewport_percentage() - }, - EndingShape::Ellipse(Ellipse::Radii(ref x, ref y)) => { - x.has_viewport_percentage() || y.has_viewport_percentage() - }, - _ => false, - } - } -} - impl ToComputedValue for EndingShape where L: ToComputedValue, LoP: ToComputedValue, { @@ -497,17 +456,6 @@ impl ToCss for GradientItem } } -impl HasViewportPercentage for GradientItem - where L: HasViewportPercentage, -{ - fn has_viewport_percentage(&self) -> bool { - match *self { - GradientItem::ColorStop(ref stop) => stop.has_viewport_percentage(), - GradientItem::InterpolationHint(ref hint) => hint.has_viewport_percentage(), - } - } -} - impl ToComputedValue for GradientItem where C: ToComputedValue, L: ToComputedValue, { @@ -562,14 +510,6 @@ impl ToCss for ColorStop } } -impl HasViewportPercentage for ColorStop - where L: HasViewportPercentage, -{ - fn has_viewport_percentage(&self) -> bool { - self.position.as_ref().map_or(false, HasViewportPercentage::has_viewport_percentage) - } -} - impl ToComputedValue for ColorStop where C: ToComputedValue, L: ToComputedValue, { diff --git a/servo/components/style/values/generics/position.rs b/servo/components/style/values/generics/position.rs index 1b805b8ff08e..7e13919d30cd 100644 --- a/servo/components/style/values/generics/position.rs +++ b/servo/components/style/values/generics/position.rs @@ -5,10 +5,9 @@ //! Generic types for CSS handling of specified and computed values of //! [`position`](https://drafts.csswg.org/css-backgrounds-3/#position) -use values::HasViewportPercentage; use values::computed::{Context, ToComputedValue}; -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] /// A generic type for representing a CSS [position](https://drafts.csswg.org/css-values/#position). pub struct Position { @@ -28,13 +27,6 @@ impl Position { } } -impl HasViewportPercentage for Position { - #[inline] - fn has_viewport_percentage(&self) -> bool { - self.horizontal.has_viewport_percentage() || self.vertical.has_viewport_percentage() - } -} - impl ToComputedValue for Position { type ComputedValue = Position<::ComputedValue, ::ComputedValue>; diff --git a/servo/components/style/values/mod.rs b/servo/components/style/values/mod.rs index 63bcc366bad0..6a6469a1742c 100644 --- a/servo/components/style/values/mod.rs +++ b/servo/components/style/values/mod.rs @@ -16,6 +16,7 @@ use std::borrow::Cow; use std::fmt::{self, Debug}; use std::hash; use style_traits::ToCss; +pub use style_traits::HasViewportPercentage; pub mod computed; pub mod generics; @@ -30,24 +31,11 @@ pub type CSSInteger = i32; /// The default font size. pub const FONT_MEDIUM_PX: i32 = 16; -/// A trait used to query whether this value has viewport units. -pub trait HasViewportPercentage { - /// Returns true if this value has viewport units. - fn has_viewport_percentage(&self) -> bool; -} - -impl HasViewportPercentage for Box { - #[inline] - fn has_viewport_percentage(&self) -> bool { - (**self).has_viewport_percentage() - } -} - define_keyword_type!(None_, "none"); define_keyword_type!(Auto, "auto"); define_keyword_type!(Normal, "normal"); -#[derive(Clone, PartialEq, Copy)] +#[derive(Clone, Copy, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] /// A struct representing one of two kinds of values. pub enum Either { @@ -75,15 +63,6 @@ impl ToCss for Either { } } -impl HasViewportPercentage for Either { - fn has_viewport_percentage(&self) -> bool { - match *self { - Either::First(ref v) => v.has_viewport_percentage(), - Either::Second(ref v) => v.has_viewport_percentage(), - } - } -} - impl Parse for Either { fn parse(context: &ParserContext, input: &mut Parser) -> Result, ()> { if let Ok(v) = input.try(|i| A::parse(context, i)) { @@ -209,3 +188,4 @@ define_css_keyword_enum!(ExtremumLength: "-moz-min-content" => MinContent, "-moz-fit-content" => FitContent, "-moz-available" => FillAvailable); +no_viewport_percentage!(ExtremumLength); diff --git a/servo/components/style/values/specified/grid.rs b/servo/components/style/values/specified/grid.rs index 45f888d97024..a4a8b930ef86 100644 --- a/servo/components/style/values/specified/grid.rs +++ b/servo/components/style/values/specified/grid.rs @@ -221,7 +221,7 @@ impl ToComputedValue for TrackBreadth { } } -#[derive(Clone, PartialEq, Debug)] +#[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] /// A `` type for explicit grid track sizing. Like ``, this is /// generic only to avoid code bloat. It only takes `` @@ -321,17 +321,6 @@ impl ToCss for TrackSize { } } -impl HasViewportPercentage for TrackSize { - #[inline] - fn has_viewport_percentage(&self) -> bool { - match *self { - TrackSize::Breadth(ref b) => b.has_viewport_percentage(), - TrackSize::MinMax(ref inf_b, ref b) => inf_b.has_viewport_percentage() || b.has_viewport_percentage(), - TrackSize::FitContent(ref lop) => lop.has_viewport_percentage(), - } - } -} - impl ToComputedValue for TrackSize { type ComputedValue = TrackSize; diff --git a/servo/components/style/values/specified/image.rs b/servo/components/style/values/specified/image.rs index 9266bec885ba..d14e9b492b25 100644 --- a/servo/components/style/values/specified/image.rs +++ b/servo/components/style/values/specified/image.rs @@ -54,7 +54,7 @@ pub type GradientKind = GenericGradientKind< >; /// A specified gradient line direction. -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum LineDirection { /// An angular direction. diff --git a/servo/components/style/values/specified/length.rs b/servo/components/style/values/specified/length.rs index d117593738c7..331901bf8c64 100644 --- a/servo/components/style/values/specified/length.rs +++ b/servo/components/style/values/specified/length.rs @@ -531,7 +531,7 @@ impl NoCalcLength { /// This is commonly used for the `` values. /// /// https://drafts.csswg.org/css-values/#lengths -#[derive(Clone, PartialEq, Debug)] +#[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum Length { /// The internal length type that cannot parse `calc` @@ -549,15 +549,6 @@ impl From for Length { } } -impl HasViewportPercentage for Length { - fn has_viewport_percentage(&self) -> bool { - match *self { - Length::NoCalc(ref inner) => inner.has_viewport_percentage(), - Length::Calc(ref calc) => calc.has_viewport_percentage(), - } - } -} - impl ToCss for Length { fn to_css(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { match *self { @@ -713,7 +704,7 @@ impl Either { /// As of today, only `-moz-image-rect` supports percentages without length. /// This is not a regression, and that's a non-standard extension anyway, so I'm /// not implementing it for now. -#[derive(Clone, PartialEq, Copy, Debug)] +#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct Percentage(pub CSSFloat); @@ -754,7 +745,7 @@ impl Parse for Percentage { impl ComputedValueAsSpecified for Percentage {} /// A length or a percentage value. -#[derive(Clone, PartialEq, Debug)] +#[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[allow(missing_docs)] pub enum LengthOrPercentage { @@ -786,16 +777,6 @@ impl From for LengthOrPercentage { } } -impl HasViewportPercentage for LengthOrPercentage { - fn has_viewport_percentage(&self) -> bool { - match *self { - LengthOrPercentage::Length(ref length) => length.has_viewport_percentage(), - LengthOrPercentage::Calc(ref calc) => calc.has_viewport_percentage(), - _ => false - } - } -} - impl ToCss for LengthOrPercentage { fn to_css(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { match *self { @@ -914,7 +895,7 @@ impl LengthOrPercentage { } /// Either a ``, a ``, or the `auto` keyword. -#[derive(Clone, PartialEq, Debug)] +#[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[allow(missing_docs)] pub enum LengthOrPercentageOrAuto { @@ -938,16 +919,6 @@ impl From for LengthOrPercentageOrAuto { } } -impl HasViewportPercentage for LengthOrPercentageOrAuto { - fn has_viewport_percentage(&self) -> bool { - match *self { - LengthOrPercentageOrAuto::Length(ref length) => length.has_viewport_percentage(), - LengthOrPercentageOrAuto::Calc(ref calc) => calc.has_viewport_percentage(), - _ => false - } - } -} - impl ToCss for LengthOrPercentageOrAuto { fn to_css(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { match *self { @@ -1036,7 +1007,7 @@ impl LengthOrPercentageOrAuto { } /// Either a ``, a ``, or the `none` keyword. -#[derive(Clone, PartialEq, Debug)] +#[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[allow(missing_docs)] pub enum LengthOrPercentageOrNone { @@ -1046,16 +1017,6 @@ pub enum LengthOrPercentageOrNone { None, } -impl HasViewportPercentage for LengthOrPercentageOrNone { - fn has_viewport_percentage(&self) -> bool { - match *self { - LengthOrPercentageOrNone::Length(ref length) => length.has_viewport_percentage(), - LengthOrPercentageOrNone::Calc(ref calc) => calc.has_viewport_percentage(), - _ => false - } - } -} - impl ToCss for LengthOrPercentageOrNone { fn to_css(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { match *self { @@ -1133,7 +1094,7 @@ pub type LengthOrAuto = Either; /// Either a `` or a `` or the `auto` keyword or the /// `content` keyword. -#[derive(Clone, PartialEq, Debug)] +#[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum LengthOrPercentageOrAutoOrContent { /// A ``. @@ -1185,16 +1146,6 @@ impl LengthOrPercentageOrAutoOrContent { } } -impl HasViewportPercentage for LengthOrPercentageOrAutoOrContent { - fn has_viewport_percentage(&self) -> bool { - match *self { - LengthOrPercentageOrAutoOrContent::Length(ref length) => length.has_viewport_percentage(), - LengthOrPercentageOrAutoOrContent::Calc(ref calc) => calc.has_viewport_percentage(), - _ => false - } - } -} - impl ToCss for LengthOrPercentageOrAutoOrContent { fn to_css(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { match *self { @@ -1227,7 +1178,7 @@ impl LengthOrNumber { /// A value suitable for a `min-width` or `min-height` property. /// Unlike `max-width` or `max-height` properties, a MinLength can be /// `auto`, and cannot be `none`. -#[derive(Debug, Clone, PartialEq)] +#[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[allow(missing_docs)] pub enum MinLength { @@ -1236,15 +1187,6 @@ pub enum MinLength { ExtremumLength(ExtremumLength), } -impl HasViewportPercentage for MinLength { - fn has_viewport_percentage(&self) -> bool { - match *self { - MinLength::LengthOrPercentage(ref lop) => lop.has_viewport_percentage(), - _ => false - } - } -} - impl ToCss for MinLength { fn to_css(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { match *self { @@ -1277,7 +1219,7 @@ impl MinLength { } /// A value suitable for a `max-width` or `max-height` property. -#[derive(Debug, Clone, PartialEq)] +#[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[allow(missing_docs)] pub enum MaxLength { @@ -1286,14 +1228,6 @@ pub enum MaxLength { ExtremumLength(ExtremumLength), } -impl HasViewportPercentage for MaxLength { - fn has_viewport_percentage(&self) -> bool { - match *self { - MaxLength::LengthOrPercentage(ref lop) => lop.has_viewport_percentage(), - _ => false - } - } -} impl ToCss for MaxLength { fn to_css(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { diff --git a/servo/components/style/values/specified/mod.rs b/servo/components/style/values/specified/mod.rs index 3fb46c473b93..d687c4aaff9d 100644 --- a/servo/components/style/values/specified/mod.rs +++ b/servo/components/style/values/specified/mod.rs @@ -21,7 +21,7 @@ use std::fmt; use std::io::Write; use style_traits::ToCss; use style_traits::values::specified::AllowedNumericType; -use super::{Auto, CSSFloat, CSSInteger, HasViewportPercentage, Either, None_}; +use super::{Auto, CSSFloat, CSSInteger, Either, None_}; use super::computed::{self, Context}; use super::computed::{Shadow as ComputedShadow, ToComputedValue}; use super::generics::BorderRadiusSize as GenericBorderRadiusSize; @@ -76,8 +76,6 @@ impl ComputedValueAsSpecified for SpecifiedUrl {} no_viewport_percentage!(SpecifiedUrl); } -no_viewport_percentage!(i32); // For PropertyDeclaration::Order - #[derive(Clone, PartialEq, Debug)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[allow(missing_docs)] @@ -289,7 +287,7 @@ impl Parse for BorderRadiusSize { } } -#[derive(Clone, PartialEq, Copy, Debug)] +#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))] /// An angle consisting of a value and a unit. /// @@ -455,7 +453,7 @@ pub fn parse_border_width(context: &ParserContext, input: &mut Parser) -> Result }) } -#[derive(Clone, PartialEq, Debug)] +#[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[allow(missing_docs)] pub enum BorderWidth { @@ -507,15 +505,6 @@ impl ToCss for BorderWidth { } } -impl HasViewportPercentage for BorderWidth { - fn has_viewport_percentage(&self) -> bool { - match *self { - BorderWidth::Thin | BorderWidth::Medium | BorderWidth::Thick => false, - BorderWidth::Width(ref length) => length.has_viewport_percentage() - } - } -} - impl ToComputedValue for BorderWidth { type ComputedValue = Au; @@ -950,7 +939,7 @@ pub type TrackList = GenericTrackList; /// ` | none` pub type TrackListOrNone = Either; -#[derive(Debug, Clone, PartialEq)] +#[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[allow(missing_docs)] pub struct Shadow { @@ -962,15 +951,6 @@ pub struct Shadow { pub inset: bool, } -impl HasViewportPercentage for Shadow { - fn has_viewport_percentage(&self) -> bool { - self.offset_x.has_viewport_percentage() || - self.offset_y.has_viewport_percentage() || - self.blur_radius.has_viewport_percentage() || - self.spread_radius.has_viewport_percentage() - } -} - impl ToComputedValue for Shadow { type ComputedValue = ComputedShadow; @@ -1230,16 +1210,7 @@ impl LengthOrPercentageOrNumber { } } -impl HasViewportPercentage for ClipRect { - fn has_viewport_percentage(&self) -> bool { - self.top.as_ref().map_or(false, |x| x.has_viewport_percentage()) || - self.right.as_ref().map_or(false, |x| x.has_viewport_percentage()) || - self.bottom.as_ref().map_or(false, |x| x.has_viewport_percentage()) || - self.left.as_ref().map_or(false, |x| x.has_viewport_percentage()) - } -} - -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, HasViewportPercentage, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] /// rect(, , , ) used by clip and image-region pub struct ClipRect { diff --git a/servo/components/style_derive/Cargo.toml b/servo/components/style_derive/Cargo.toml new file mode 100644 index 000000000000..d56f32256897 --- /dev/null +++ b/servo/components/style_derive/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "style_derive" +version = "0.0.1" +authors = ["The Servo Project Developers"] +license = "MPL-2.0" +publish = false + +[lib] +path = "lib.rs" +proc-macro = true + +[dependencies] +quote = "0.3" +syn = "0.11" +synstructure = "0.5.2" diff --git a/servo/components/style_derive/has_viewport_percentage.rs b/servo/components/style_derive/has_viewport_percentage.rs new file mode 100644 index 000000000000..24e4b919c222 --- /dev/null +++ b/servo/components/style_derive/has_viewport_percentage.rs @@ -0,0 +1,56 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +use quote; +use syn; +use synstructure; + +pub fn derive(input: syn::DeriveInput) -> quote::Tokens { + let name = &input.ident; + let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); + let mut where_clause = where_clause.clone(); + for param in &input.generics.ty_params { + where_clause.predicates.push(where_predicate(syn::Ty::Path(None, param.ident.clone().into()))) + } + + let style = synstructure::BindStyle::Ref.into(); + let match_body = synstructure::each_variant(&input, &style, |bindings, _| { + let (first, rest) = match bindings.split_first() { + None => return Some(quote!(false)), + Some(pair) => pair, + }; + let mut expr = quote!(::style_traits::HasViewportPercentage::has_viewport_percentage(#first)); + for binding in rest { + where_clause.predicates.push(where_predicate(binding.field.ty.clone())); + expr = quote!(#expr || ::style_traits::HasViewportPercentage::has_viewport_percentage(#binding)); + } + Some(expr) + }); + + quote! { + impl #impl_generics ::style_traits::HasViewportPercentage for #name #ty_generics #where_clause { + #[allow(unused_variables, unused_imports)] + #[inline] + fn has_viewport_percentage(&self) -> bool { + match *self { + #match_body + } + } + } + } +} + +fn where_predicate(ty: syn::Ty) -> syn::WherePredicate { + syn::WherePredicate::BoundPredicate(syn::WhereBoundPredicate { + bound_lifetimes: vec![], + bounded_ty: ty, + bounds: vec![syn::TyParamBound::Trait( + syn::PolyTraitRef { + bound_lifetimes: vec![], + trait_ref: syn::parse_path("::style_traits::HasViewportPercentage").unwrap(), + }, + syn::TraitBoundModifier::None + )], + }) +} diff --git a/servo/components/style_derive/lib.rs b/servo/components/style_derive/lib.rs new file mode 100644 index 000000000000..fd47a962ce9b --- /dev/null +++ b/servo/components/style_derive/lib.rs @@ -0,0 +1,18 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +extern crate proc_macro; +#[macro_use] extern crate quote; +extern crate syn; +extern crate synstructure; + +use proc_macro::TokenStream; + +mod has_viewport_percentage; + +#[proc_macro_derive(HasViewportPercentage)] +pub fn derive_has_viewport_percentage(stream: TokenStream) -> TokenStream { + let input = syn::parse_derive_input(&stream.to_string()).unwrap(); + has_viewport_percentage::derive(input).to_string().parse().unwrap() +} diff --git a/servo/components/style_traits/lib.rs b/servo/components/style_traits/lib.rs index 95cd0b3e3ddb..a7c20f051dc4 100644 --- a/servo/components/style_traits/lib.rs +++ b/servo/components/style_traits/lib.rs @@ -63,6 +63,8 @@ pub enum CSSPixel {} pub mod cursor; #[macro_use] pub mod values; +#[macro_use] pub mod viewport; pub use values::{ToCss, OneOrMoreCommaSeparated}; +pub use viewport::HasViewportPercentage; diff --git a/servo/components/style_traits/viewport.rs b/servo/components/style_traits/viewport.rs index 378e17c93c49..05e39f2b3709 100644 --- a/servo/components/style_traits/viewport.rs +++ b/servo/components/style_traits/viewport.rs @@ -20,6 +20,48 @@ define_css_keyword_enum!(Orientation: "portrait" => Portrait, "landscape" => Landscape); +/// A trait used to query whether this value has viewport units. +pub trait HasViewportPercentage { + /// Returns true if this value has viewport units. + fn has_viewport_percentage(&self) -> bool; +} + +/// A macro used to implement HasViewportPercentage trait +/// for a given type that may never contain viewport units. +#[macro_export] +macro_rules! no_viewport_percentage { + ($($name: ident),+) => { + $(impl $crate::HasViewportPercentage for $name { + #[inline] + fn has_viewport_percentage(&self) -> bool { + false + } + })+ + }; +} + +no_viewport_percentage!(bool, f32); + +impl HasViewportPercentage for Box { + #[inline] + fn has_viewport_percentage(&self) -> bool { + (**self).has_viewport_percentage() + } +} + +impl HasViewportPercentage for Option { + #[inline] + fn has_viewport_percentage(&self) -> bool { + self.as_ref().map_or(false, T::has_viewport_percentage) + } +} + +impl HasViewportPercentage for Vec { + #[inline] + fn has_viewport_percentage(&self) -> bool { + self.iter().any(T::has_viewport_percentage) + } +} /// A set of viewport descriptors: /// diff --git a/servo/tests/unit/style/attr.rs b/servo/tests/unit/style/attr.rs index 25fe085a6370..6bf72a5b969e 100644 --- a/servo/tests/unit/style/attr.rs +++ b/servo/tests/unit/style/attr.rs @@ -5,7 +5,6 @@ use app_units::Au; use style::attr::{AttrValue, LengthOrPercentageOrAuto, parse_length}; use style::values::computed::CalcLengthOrPercentage; -use style_traits::values::specified::AllowedLengthType; #[test] fn test_length_calc() { diff --git a/servo/tests/unit/style/restyle_hints.rs b/servo/tests/unit/style/restyle_hints.rs index b2e2cf3e9994..c50cfcc87bb1 100644 --- a/servo/tests/unit/style/restyle_hints.rs +++ b/servo/tests/unit/style/restyle_hints.rs @@ -6,7 +6,7 @@ fn smoke_restyle_hints() { use cssparser::Parser; use selectors::parser::SelectorList; - use style::restyle_hints::{DependencySet, RESTYLE_LATER_SIBLINGS}; + use style::restyle_hints::DependencySet; use style::selector_parser::SelectorParser; use style::stylesheets::{Origin, Namespaces}; let namespaces = Namespaces::default(); diff --git a/servo/tests/unit/style/stylist.rs b/servo/tests/unit/style/stylist.rs index 3c136edcef37..42fc3a8f6a06 100644 --- a/servo/tests/unit/style/stylist.rs +++ b/servo/tests/unit/style/stylist.rs @@ -212,7 +212,7 @@ fn test_insert() { #[test] fn test_get_universal_rules() { thread_state::initialize(thread_state::LAYOUT); - let (map, shared_lock) = get_mock_map(&["*|*", "#foo > *|*", "*|* > *|*", ".klass", "#id"]); + let (map, _shared_lock) = get_mock_map(&["*|*", "#foo > *|*", "*|* > *|*", ".klass", "#id"]); let decls = map.get_universal_rules(CascadeLevel::UserNormal); From 444028b3ce6fc12f3779aac8a1e4e43646572743 Mon Sep 17 00:00:00 2001 From: Servo VCS Sync Date: Sat, 20 May 2017 18:45:20 +0000 Subject: [PATCH 29/56] No bug - Revendor rust dependencies --- .../rust/synstructure/.cargo-checksum.json | 1 + third_party/rust/synstructure/.cargo-ok | 0 third_party/rust/synstructure/.gitignore | 2 + third_party/rust/synstructure/.travis.yml | 7 + third_party/rust/synstructure/Cargo.toml | 16 + third_party/rust/synstructure/README.md | 51 +++ third_party/rust/synstructure/src/lib.rs | 373 ++++++++++++++++++ .../rust/synstructure/tests/alt_prefix.rs | 22 ++ toolkit/library/gtest/rust/Cargo.lock | 20 + toolkit/library/rust/Cargo.lock | 20 + 10 files changed, 512 insertions(+) create mode 100644 third_party/rust/synstructure/.cargo-checksum.json create mode 100644 third_party/rust/synstructure/.cargo-ok create mode 100644 third_party/rust/synstructure/.gitignore create mode 100644 third_party/rust/synstructure/.travis.yml create mode 100644 third_party/rust/synstructure/Cargo.toml create mode 100644 third_party/rust/synstructure/README.md create mode 100644 third_party/rust/synstructure/src/lib.rs create mode 100644 third_party/rust/synstructure/tests/alt_prefix.rs diff --git a/third_party/rust/synstructure/.cargo-checksum.json b/third_party/rust/synstructure/.cargo-checksum.json new file mode 100644 index 000000000000..4ef801aef216 --- /dev/null +++ b/third_party/rust/synstructure/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"f9b1ca6ae27d1c18215265024629a8960c31379f206d9ed20f64e0b2dcf79805",".travis.yml":"d4bc1060351bd12aeb098af93bf7e0f9a057304a1c69ab4c9bdce2bc8cf383c4","Cargo.toml":"acba6e4f3b0e27642e96f9ea1d0d88009d615400e97a65d7381f0345a57ff50d","README.md":"cf1d7d2a7b7dd08ed97ba974ca56246ebb32e6d824b5598468e5c52a3094f31a","src/lib.rs":"923247477fbb41735a02592c19eaf9548cd2f9a6a61bd4ac46d788cd8996650e","tests/alt_prefix.rs":"7978ed607cd44d31bf8329cab2d959c7dfb44f791d28bb0bfd2d11149954c809"},"package":"cf318c34a2f8381a4f3d4db2c91b45bca2b1cd8cbe56caced900647be164800c"} \ No newline at end of file diff --git a/third_party/rust/synstructure/.cargo-ok b/third_party/rust/synstructure/.cargo-ok new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/third_party/rust/synstructure/.gitignore b/third_party/rust/synstructure/.gitignore new file mode 100644 index 000000000000..a9d37c560c6a --- /dev/null +++ b/third_party/rust/synstructure/.gitignore @@ -0,0 +1,2 @@ +target +Cargo.lock diff --git a/third_party/rust/synstructure/.travis.yml b/third_party/rust/synstructure/.travis.yml new file mode 100644 index 000000000000..c5f62f12b9c1 --- /dev/null +++ b/third_party/rust/synstructure/.travis.yml @@ -0,0 +1,7 @@ +language: rust +rust: +- nightly +sudo: false +notifications: + email: + on_success: never diff --git a/third_party/rust/synstructure/Cargo.toml b/third_party/rust/synstructure/Cargo.toml new file mode 100644 index 000000000000..895beb8d45a7 --- /dev/null +++ b/third_party/rust/synstructure/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "synstructure" +version = "0.5.2" +authors = ["Michael Layzell "] + +description = "expand_substructure-like helpers for syn macros 1.1 derive macros" +documentation = "https://docs.rs/synstructure" +repository = "https://github.com/mystor/synstructure" +readme = "README.md" +license = "MIT" +keywords = ["syn", "macros", "derive", "expand_substructure", "enum"] + + +[dependencies] +syn = "0.11" +quote = "0.3" diff --git a/third_party/rust/synstructure/README.md b/third_party/rust/synstructure/README.md new file mode 100644 index 000000000000..44ade94679d4 --- /dev/null +++ b/third_party/rust/synstructure/README.md @@ -0,0 +1,51 @@ +# synstructure + +> NOTE: What follows is an exerpt from the module level documentation. For full +> details read the docs on [docs.rs](https://docs.rs/synstructure/) + +This crate provides helper methods for matching against enum variants, and +extracting bindings to each of the fields in the deriving Struct or Enum in +a generic way. + +If you are writing a `#[derive]` which needs to perform some operation on every +field, then you have come to the right place! + +## Example Usage + +```rust +extern crate syn; +extern crate synstructure; +#[macro_use] +extern crate quote; +use synstructure::{each_field, BindStyle}; + +type TokenStream = String; // XXX: Dummy to not depend on rustc_macro + +fn sum_fields_derive(input: TokenStream) -> TokenStream { + let source = input.to_string(); + let ast = syn::parse_macro_input(&source).unwrap(); + + let match_body = each_field(&ast, &BindStyle::Ref.into(), |bi| quote! { + sum += #bi as i64; + }); + + let name = &ast.ident; + let (impl_generics, ty_generics, where_clause) = ast.generics.split_for_impl(); + let result = quote! { + impl #impl_generics ::sum_fields::SumFields for #name #ty_generics #where_clause { + fn sum_fields(&self) -> i64 { + let mut sum = 0i64; + match *self { #match_body } + sum + } + } + }; + + result.to_string().parse().unwrap() +} + +fn main() {} +``` + +For more example usage, consider investigating the `abomonation_derive` crate, +which makes use of this crate, and is fairly simple. diff --git a/third_party/rust/synstructure/src/lib.rs b/third_party/rust/synstructure/src/lib.rs new file mode 100644 index 000000000000..df10c99fb00c --- /dev/null +++ b/third_party/rust/synstructure/src/lib.rs @@ -0,0 +1,373 @@ +//! This crate provides helper methods for matching against enum variants, and +//! extracting bindings to each of the fields in the deriving Struct or Enum in +//! a generic way. +//! +//! If you are writing a `#[derive]` which needs to perform some operation on +//! every field, then you have come to the right place! +//! +//! # Example +//! +//! ``` +//! extern crate syn; +//! extern crate synstructure; +//! #[macro_use] +//! extern crate quote; +//! extern crate proc_macro; +//! +//! use synstructure::{each_field, BindStyle}; +//! use proc_macro::TokenStream; +//! +//! fn sum_fields_derive(input: TokenStream) -> TokenStream { +//! let source = input.to_string(); +//! let ast = syn::parse_macro_input(&source).unwrap(); +//! +//! let match_body = each_field(&ast, &BindStyle::Ref.into(), |bi| quote! { +//! sum += #bi as i64; +//! }); +//! +//! let name = &ast.ident; +//! let (impl_generics, ty_generics, where_clause) = ast.generics.split_for_impl(); +//! let result = quote! { +//! impl #impl_generics ::sum_fields::SumFields for #name #ty_generics #where_clause { +//! fn sum_fields(&self) -> i64 { +//! let mut sum = 0i64; +//! match *self { #match_body } +//! sum +//! } +//! } +//! }; +//! +//! result.to_string().parse().unwrap() +//! } +//! # +//! # fn main() {} +//! ``` +//! +//! For more example usage, consider investigating the `abomonation_derive` crate, +//! which makes use of this crate, and is fairly simple. + +extern crate syn; +#[macro_use] +extern crate quote; + +use std::borrow::Cow; +use syn::{Body, Field, Ident, MacroInput, VariantData, Variant}; +use quote::{Tokens, ToTokens}; + +/// The type of binding to use when generating a pattern. +#[derive(Debug, Copy, Clone)] +pub enum BindStyle { + /// `x` + Move, + /// `mut x` + MoveMut, + /// `ref x` + Ref, + /// `ref mut x` + RefMut, +} + +impl ToTokens for BindStyle { + fn to_tokens(&self, tokens: &mut Tokens) { + match *self { + BindStyle::Move => {} + BindStyle::MoveMut => tokens.append("mut"), + BindStyle::Ref => tokens.append("ref"), + BindStyle::RefMut => { + tokens.append("ref"); + tokens.append("mut"); + } + } + } +} + +/// Binding options to use when generating a pattern. +/// Configuration options used for generating binding patterns. +/// +/// `bind_style` controls the type of binding performed in the pattern, for +/// example: `ref` or `ref mut`. +/// +/// `prefix` controls the name which is used for the binding. This can be used +/// to avoid name conflicts with nested match patterns. +#[derive(Debug, Clone)] +pub struct BindOpts { + bind_style: BindStyle, + prefix: Cow<'static, str>, +} + +impl BindOpts { + /// Create a BindOpts with the given style, and the default prefix: "__binding". + pub fn new(bind_style: BindStyle) -> BindOpts { + BindOpts { + bind_style: bind_style, + prefix: "__binding".into(), + } + } + + /// Create a BindOpts with the given style and prefix. + pub fn with_prefix(bind_style: BindStyle, prefix: String) -> BindOpts { + BindOpts { + bind_style: bind_style, + prefix: prefix.into(), + } + } +} + +impl From for BindOpts { + fn from(style: BindStyle) -> Self { + BindOpts::new(style) + } +} + +/// Information about a specific binding. This contains both an `Ident` +/// reference to the given field, and the syn `&'a Field` descriptor for that +/// field. +/// +/// This type supports `quote::ToTokens`, so can be directly used within the +/// `quote!` macro. It expands to a reference to the matched field. +#[derive(Debug)] +pub struct BindingInfo<'a> { + pub ident: Ident, + pub field: &'a Field, +} + +impl<'a> ToTokens for BindingInfo<'a> { + fn to_tokens(&self, tokens: &mut Tokens) { + self.ident.to_tokens(tokens); + } +} + +/// Generate a match pattern for binding to the given VariantData This function +/// returns a tuple of the tokens which make up that match pattern, and a +/// `BindingInfo` object for each of the bindings which were made. The `bind` +/// parameter controls the type of binding which is made. +/// +/// # Example +/// +/// ``` +/// extern crate syn; +/// extern crate synstructure; +/// #[macro_use] +/// extern crate quote; +/// use synstructure::{match_pattern, BindStyle}; +/// +/// fn main() { +/// let ast = syn::parse_macro_input("struct A { a: i32, b: i32 }").unwrap(); +/// let vd = if let syn::Body::Struct(ref vd) = ast.body { +/// vd +/// } else { unreachable!() }; +/// +/// let (tokens, bindings) = match_pattern(&ast.ident, vd, &BindStyle::Ref.into()); +/// assert_eq!(tokens.to_string(), quote! { +/// A{ a: ref __binding_0, b: ref __binding_1, } +/// }.to_string()); +/// assert_eq!(bindings.len(), 2); +/// assert_eq!(&bindings[0].ident.to_string(), "__binding_0"); +/// assert_eq!(&bindings[1].ident.to_string(), "__binding_1"); +/// } +/// ``` +pub fn match_pattern<'a, N: ToTokens>(name: &N, + vd: &'a VariantData, + options: &BindOpts) + -> (Tokens, Vec>) { + let mut t = Tokens::new(); + let mut matches = Vec::new(); + + let binding = options.bind_style; + name.to_tokens(&mut t); + match *vd { + VariantData::Unit => {} + VariantData::Tuple(ref fields) => { + t.append("("); + for (i, field) in fields.iter().enumerate() { + let ident: Ident = format!("{}_{}", options.prefix, i).into(); + quote!(#binding #ident ,).to_tokens(&mut t); + matches.push(BindingInfo { + ident: ident, + field: field, + }); + } + t.append(")"); + } + VariantData::Struct(ref fields) => { + t.append("{"); + for (i, field) in fields.iter().enumerate() { + let ident: Ident = format!("{}_{}", options.prefix, i).into(); + { + let field_name = field.ident.as_ref().unwrap(); + quote!(#field_name : #binding #ident ,).to_tokens(&mut t); + } + matches.push(BindingInfo { + ident: ident, + field: field, + }); + } + t.append("}"); + } + } + + (t, matches) +} + +/// This method calls `func` once per variant in the struct or enum, and generates +/// a series of match branches which will destructure a the input, and run the result +/// of `func` once for each of the variants. +/// +/// The second argument to `func` is a syn `Variant` object. This object is +/// fabricated for struct-like `MacroInput` parameters. +/// +/// # Example +/// +/// ``` +/// extern crate syn; +/// extern crate synstructure; +/// #[macro_use] +/// extern crate quote; +/// use synstructure::{each_variant, BindStyle}; +/// +/// fn main() { +/// let mut ast = syn::parse_macro_input("enum A { B(i32, i32), C }").unwrap(); +/// +/// let tokens = each_variant(&mut ast, &BindStyle::Ref.into(), |bindings, variant| { +/// let name_str = variant.ident.as_ref(); +/// if name_str == "B" { +/// assert_eq!(bindings.len(), 2); +/// assert_eq!(bindings[0].ident.as_ref(), "__binding_0"); +/// assert_eq!(bindings[1].ident.as_ref(), "__binding_1"); +/// } else { +/// assert_eq!(name_str, "C"); +/// assert_eq!(bindings.len(), 0); +/// } +/// quote!(#name_str) +/// }); +/// assert_eq!(tokens.to_string(), quote! { +/// A::B(ref __binding_0, ref __binding_1,) => { "B" } +/// A::C => { "C" } +/// }.to_string()); +/// } +/// ``` +pub fn each_variant(input: &MacroInput, + options: &BindOpts, + mut func: F) + -> Tokens + where F: FnMut(Vec, &Variant) -> T { + let ident = &input.ident; + + let struct_variant; + // Generate patterns for matching against all of the variants + let variants = match input.body { + Body::Enum(ref variants) => { + variants.iter() + .map(|variant| { + let variant_ident = &variant.ident; + let (pat, bindings) = match_pattern("e!(#ident :: #variant_ident), + &variant.data, + options); + (pat, bindings, variant) + }) + .collect() + } + Body::Struct(ref vd) => { + struct_variant = Variant { + ident: ident.clone(), + attrs: input.attrs.clone(), + data: vd.clone(), + discriminant: None, + }; + + let (pat, bindings) = match_pattern(&ident, &vd, options); + vec![(pat, bindings, &struct_variant)] + } + }; + + // Now that we have the patterns, generate the actual branches of the match + // expression + let mut t = Tokens::new(); + for (pat, bindings, variant) in variants { + let body = func(bindings, variant); + quote!(#pat => { #body }).to_tokens(&mut t); + } + + t +} + +/// This method generates a match branch for each of the substructures of the +/// given `MacroInput`. It will call `func` for each of these substructures, +/// passing in the bindings which were made for each of the fields in the +/// substructure. The return value of `func` is then used as the value of each +/// branch +/// +/// # Example +/// +/// ``` +/// extern crate syn; +/// extern crate synstructure; +/// #[macro_use] +/// extern crate quote; +/// use synstructure::{match_substructs, BindStyle}; +/// +/// fn main() { +/// let mut ast = syn::parse_macro_input("struct A { a: i32, b: i32 }").unwrap(); +/// +/// let tokens = match_substructs(&mut ast, &BindStyle::Ref.into(), |bindings| { +/// assert_eq!(bindings.len(), 2); +/// assert_eq!(bindings[0].ident.as_ref(), "__binding_0"); +/// assert_eq!(bindings[1].ident.as_ref(), "__binding_1"); +/// quote!("some_random_string") +/// }); +/// assert_eq!(tokens.to_string(), quote! { +/// A { a: ref __binding_0, b: ref __binding_1, } => { "some_random_string" } +/// }.to_string()); +/// } +/// ``` +pub fn match_substructs(input: &MacroInput, + options: &BindOpts, + mut func: F) + -> Tokens + where F: FnMut(Vec) -> T +{ + each_variant(input, options, |bindings, _| func(bindings)) +} + +/// This method calls `func` once per field in the struct or enum, and generates +/// a series of match branches which will destructure match argument, and run +/// the result of `func` once on each of the bindings. +/// +/// # Example +/// +/// ``` +/// extern crate syn; +/// extern crate synstructure; +/// #[macro_use] +/// extern crate quote; +/// use synstructure::{each_field, BindStyle}; +/// +/// fn main() { +/// let mut ast = syn::parse_macro_input("struct A { a: i32, b: i32 }").unwrap(); +/// +/// let tokens = each_field(&mut ast, &BindStyle::Ref.into(), |bi| quote! { +/// println!("Saw: {:?}", #bi); +/// }); +/// assert_eq!(tokens.to_string(), quote! { +/// A{ a: ref __binding_0, b: ref __binding_1, } => { +/// { println!("Saw: {:?}", __binding_0); } +/// { println!("Saw: {:?}", __binding_1); } +/// () +/// } +/// }.to_string()); +/// } +/// ``` +pub fn each_field(input: &MacroInput, options: &BindOpts, mut func: F) -> Tokens + where F: FnMut(BindingInfo) -> T +{ + each_variant(input, options, |bindings, _| { + let mut t = Tokens::new(); + for binding in bindings { + t.append("{"); + func(binding).to_tokens(&mut t); + t.append("}"); + } + quote!(()).to_tokens(&mut t); + t + }) +} diff --git a/third_party/rust/synstructure/tests/alt_prefix.rs b/third_party/rust/synstructure/tests/alt_prefix.rs new file mode 100644 index 000000000000..c33a074b0d7e --- /dev/null +++ b/third_party/rust/synstructure/tests/alt_prefix.rs @@ -0,0 +1,22 @@ +extern crate syn; +extern crate synstructure; +#[macro_use] +extern crate quote; +use synstructure::{match_substructs, BindStyle, BindOpts}; + +#[test] +fn alt_prefix() { + let ast = syn::parse_macro_input("struct A { a: i32, b: i32 }").unwrap(); + + let opts = BindOpts::with_prefix(BindStyle::Ref, "__foo".into()); + let tokens = match_substructs(&ast, &opts, |bindings| { + assert_eq!(bindings.len(), 2); + assert_eq!(bindings[0].ident.as_ref(), "__foo_0"); + assert_eq!(bindings[1].ident.as_ref(), "__foo_1"); + quote!("some_random_string") + }); + let e = quote! { + A{ a: ref __foo_0, b: ref __foo_1, } => { "some_random_string" } + }.to_string(); + assert_eq!(tokens.to_string(), e); +} diff --git a/toolkit/library/gtest/rust/Cargo.lock b/toolkit/library/gtest/rust/Cargo.lock index 45442760bab3..cc63c0a63b3b 100644 --- a/toolkit/library/gtest/rust/Cargo.lock +++ b/toolkit/library/gtest/rust/Cargo.lock @@ -830,6 +830,7 @@ dependencies = [ "regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "selectors 0.18.0", "smallvec 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "style_derive 0.0.1", "style_traits 0.0.1", "time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -837,6 +838,15 @@ dependencies = [ "walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "style_derive" +version = "0.0.1" +dependencies = [ + "quote 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.11.8 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "style_traits" version = "0.0.1" @@ -864,6 +874,15 @@ dependencies = [ "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "synstructure" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quote 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.11.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "syntex" version = "0.58.1" @@ -1197,6 +1216,7 @@ dependencies = [ "checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694" "checksum syn 0.11.8 (registry+https://github.com/rust-lang/crates.io-index)" = "37c279fb816210c9bb28b2c292664581e7b87b4561e86b94df462664d8620bb8" "checksum synom 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "27e31aa4b09b9f4cb12dff3c30ba503e17b1a624413d764d32dab76e3920e5bc" +"checksum synstructure 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cf318c34a2f8381a4f3d4db2c91b45bca2b1cd8cbe56caced900647be164800c" "checksum syntex 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a8f5e3aaa79319573d19938ea38d068056b826db9883a5d47f86c1cecc688f0e" "checksum syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "867cc5c2d7140ae7eaad2ae9e8bf39cb18a67ca651b7834f88d46ca98faadb9c" "checksum syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13ad4762fe52abc9f4008e85c4fb1b1fe3aa91ccb99ff4826a439c7c598e1047" diff --git a/toolkit/library/rust/Cargo.lock b/toolkit/library/rust/Cargo.lock index 34906eb16384..bd26b24745eb 100644 --- a/toolkit/library/rust/Cargo.lock +++ b/toolkit/library/rust/Cargo.lock @@ -817,6 +817,7 @@ dependencies = [ "regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "selectors 0.18.0", "smallvec 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "style_derive 0.0.1", "style_traits 0.0.1", "time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -824,6 +825,15 @@ dependencies = [ "walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "style_derive" +version = "0.0.1" +dependencies = [ + "quote 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.11.8 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "style_traits" version = "0.0.1" @@ -851,6 +861,15 @@ dependencies = [ "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "synstructure" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quote 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.11.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "syntex" version = "0.58.1" @@ -1184,6 +1203,7 @@ dependencies = [ "checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694" "checksum syn 0.11.8 (registry+https://github.com/rust-lang/crates.io-index)" = "37c279fb816210c9bb28b2c292664581e7b87b4561e86b94df462664d8620bb8" "checksum synom 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "27e31aa4b09b9f4cb12dff3c30ba503e17b1a624413d764d32dab76e3920e5bc" +"checksum synstructure 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cf318c34a2f8381a4f3d4db2c91b45bca2b1cd8cbe56caced900647be164800c" "checksum syntex 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a8f5e3aaa79319573d19938ea38d068056b826db9883a5d47f86c1cecc688f0e" "checksum syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "867cc5c2d7140ae7eaad2ae9e8bf39cb18a67ca651b7834f88d46ca98faadb9c" "checksum syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13ad4762fe52abc9f4008e85c4fb1b1fe3aa91ccb99ff4826a439c7c598e1047" From bf23cb1d19c1e76c5a7d306549ae0fdd8cf76085 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Sat, 20 May 2017 21:44:37 +0200 Subject: [PATCH 30/56] Bug 1362599 - Guard against threadsafety issues in lang group stuff. r=heycam --- intl/locale/nsLanguageAtomService.cpp | 1 + js/src/devtools/rootAnalysis/analyzeHeapWrites.js | 1 + layout/base/StaticPresData.cpp | 4 +++- layout/style/ServoSpecifiedValues.cpp | 6 ++++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/intl/locale/nsLanguageAtomService.cpp b/intl/locale/nsLanguageAtomService.cpp index ec0499c196b6..c1794b69e691 100644 --- a/intl/locale/nsLanguageAtomService.cpp +++ b/intl/locale/nsLanguageAtomService.cpp @@ -70,6 +70,7 @@ nsLanguageAtomService::GetLanguageGroup(nsIAtom* aLanguage, retVal = mLangToGroup.GetWeak(aLanguage); if (!retVal) { + MOZ_ASSERT(NS_IsMainThread(), "Should not append to cache off main thread"); nsCOMPtr uncached = GetUncachedLanguageGroup(aLanguage, aError); retVal = uncached.get(); diff --git a/js/src/devtools/rootAnalysis/analyzeHeapWrites.js b/js/src/devtools/rootAnalysis/analyzeHeapWrites.js index 86daf073f275..4543b3f4f5d1 100644 --- a/js/src/devtools/rootAnalysis/analyzeHeapWrites.js +++ b/js/src/devtools/rootAnalysis/analyzeHeapWrites.js @@ -207,6 +207,7 @@ function treatAsSafeArgument(entry, varName, csuName) ["Gecko_DestroyShapeSource", "aShape", null], ["Gecko_StyleShapeSource_SetURLValue", "aShape", null], ["Gecko_nsFont_InitSystem", "aDest", null], + ["Gecko_nsStyleFont_FixupNoneGeneric", "aFont", null], ["Gecko_StyleTransition_SetUnsupportedProperty", "aTransition", null], ["Gecko_AddPropertyToSet", "aPropertySet", "null"], ]; diff --git a/layout/base/StaticPresData.cpp b/layout/base/StaticPresData.cpp index 9eef6ea33183..f2e1cee801d8 100644 --- a/layout/base/StaticPresData.cpp +++ b/layout/base/StaticPresData.cpp @@ -282,11 +282,13 @@ StaticPresData::GetFontPrefsForLangHelper(nsIAtom* aLanguage, } prefs = prefs->mNext; } - + MOZ_ASSERT(NS_IsMainThread(), "Should not append to cache off main thread"); // nothing cached, so go on and fetch the prefs for this lang group: prefs = prefs->mNext = new LangGroupFontPrefs; } + MOZ_ASSERT(NS_IsMainThread(), "Should not append to cache off main thread"); + prefs->Initialize(langGroupAtom); return prefs; diff --git a/layout/style/ServoSpecifiedValues.cpp b/layout/style/ServoSpecifiedValues.cpp index 1c43f0b2537e..d101cf9d4187 100644 --- a/layout/style/ServoSpecifiedValues.cpp +++ b/layout/style/ServoSpecifiedValues.cpp @@ -48,6 +48,12 @@ ServoSpecifiedValues::SetIdentStringValue(nsCSSPropertyID aId, { nsCOMPtr atom = NS_Atomize(aValue); Servo_DeclarationBlock_SetIdentStringValue(mDecl, aId, atom); + if (aId == eCSSProperty__x_lang) { + // This forces the lang prefs result to be cached + // so that we can access them off main thread during traversal + mPresContext->GetDefaultFont(kPresContext_DefaultVariableFont_ID, + atom); + } } void From 9ac08154b79a200f530fe0208695e25fd954fb71 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Sat, 20 May 2017 21:47:36 +0200 Subject: [PATCH 31/56] Bug 1362599 - Remember which languages were used and force-cache when reset; r=heycam --- layout/base/nsPresContext.cpp | 30 +++++++++++++++++++++++++++ layout/base/nsPresContext.h | 6 ++++++ layout/style/ServoSpecifiedValues.cpp | 3 +-- layout/style/ServoStyleSet.cpp | 1 + 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index 71a1c73c7476..67db9197934e 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -237,6 +237,7 @@ nsPresContext::nsPresContext(nsIDocument* aDocument, nsPresContextType aType) mExistThrottledUpdates(false), // mImageAnimationMode is initialised below, in constructor body mImageAnimationModePref(imgIContainer::kNormalAnimMode), + mFontGroupCacheDirty(true), mInterruptChecksToSkip(0), mElementsRestyled(0), mFramesConstructed(0), @@ -623,6 +624,7 @@ nsPresContext::GetUserPreferences() mPrefScrollbarSide = Preferences::GetInt("layout.scrollbar.side"); mLangGroupFontPrefs.Reset(); + mFontGroupCacheDirty = true; StaticPresData::Get()->ResetCachedFontPrefs(); // * image animation @@ -1066,6 +1068,7 @@ nsPresContext::UpdateCharSet(const nsCString& aCharSet) mLanguage = mLangService->GetLocaleLanguage(); } mLangGroupFontPrefs.Reset(); + mFontGroupCacheDirty = true; } switch (GET_BIDI_OPTION_TEXTTYPE(GetBidi())) { @@ -1975,6 +1978,33 @@ void nsPresContext::StopEmulatingMedium() } } +void +nsPresContext::ForceCacheLang(nsIAtom *aLanguage) +{ + // force it to be cached + GetDefaultFont(kPresContext_DefaultVariableFont_ID, aLanguage); + if (!mLanguagesUsed.Contains(aLanguage)) { + mLanguagesUsed.PutEntry(aLanguage); + } +} + +void +nsPresContext::CacheAllLangs() +{ + if (mFontGroupCacheDirty) { + nsCOMPtr thisLang = nsStyleFont::GetLanguage(this); + GetDefaultFont(kPresContext_DefaultVariableFont_ID, thisLang.get()); + GetDefaultFont(kPresContext_DefaultVariableFont_ID, nsGkAtoms::x_math); + // https://bugzilla.mozilla.org/show_bug.cgi?id=1362599#c12 + GetDefaultFont(kPresContext_DefaultVariableFont_ID, nsGkAtoms::Unicode); + for (auto iter = mLanguagesUsed.Iter(); !iter.Done(); iter.Next()) { + + GetDefaultFont(kPresContext_DefaultVariableFont_ID, iter.Get()->GetKey()); + } + } + mFontGroupCacheDirty = false; +} + void nsPresContext::RebuildAllStyleData(nsChangeHint aExtraHint, nsRestyleHint aRestyleHint) diff --git a/layout/base/nsPresContext.h b/layout/base/nsPresContext.h index b08d28dba65c..334654cc62b9 100644 --- a/layout/base/nsPresContext.h +++ b/layout/base/nsPresContext.h @@ -373,6 +373,9 @@ public: GetFontPrefsForLang(lang)); } + void ForceCacheLang(nsIAtom *aLanguage); + void CacheAllLangs(); + /** Get a cached boolean pref, by its type */ // * - initially created for bugs 31816, 20760, 22963 bool GetCachedBoolPref(nsPresContext_CachedBoolPrefType aPrefType) const @@ -1420,6 +1423,9 @@ protected: // link items. LangGroupFontPrefs mLangGroupFontPrefs; + bool mFontGroupCacheDirty; + nsTHashtable> mLanguagesUsed; + nscoord mBorderWidthTable[3]; uint32_t mInterruptChecksToSkip; diff --git a/layout/style/ServoSpecifiedValues.cpp b/layout/style/ServoSpecifiedValues.cpp index d101cf9d4187..2ac4937dcf97 100644 --- a/layout/style/ServoSpecifiedValues.cpp +++ b/layout/style/ServoSpecifiedValues.cpp @@ -51,8 +51,7 @@ ServoSpecifiedValues::SetIdentStringValue(nsCSSPropertyID aId, if (aId == eCSSProperty__x_lang) { // This forces the lang prefs result to be cached // so that we can access them off main thread during traversal - mPresContext->GetDefaultFont(kPresContext_DefaultVariableFont_ID, - atom); + mPresContext->ForceCacheLang(atom); } } diff --git a/layout/style/ServoStyleSet.cpp b/layout/style/ServoStyleSet.cpp index 62817ffbe6a7..3b9721b40689 100644 --- a/layout/style/ServoStyleSet.cpp +++ b/layout/style/ServoStyleSet.cpp @@ -267,6 +267,7 @@ ServoStyleSet::PreTraverseSync() mPresContext->Document()->GetUserFontSet(); UpdateStylistIfNeeded(); + mPresContext->CacheAllLangs(); } void From cdff82b294b5d869fb001f9aa96ddea36ac4c6a5 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Thu, 18 May 2017 11:41:13 +0200 Subject: [PATCH 32/56] Bug 1329876 - Stop accepting aTreeMatchContext in the ServoStyleSet methods. r=bz This makes it clear it's unused. --- layout/style/ServoStyleSet.cpp | 31 +++++----------------------- layout/style/ServoStyleSet.h | 12 ----------- layout/style/StyleSetHandleInlines.h | 15 +++++++++++--- 3 files changed, 17 insertions(+), 41 deletions(-) diff --git a/layout/style/ServoStyleSet.cpp b/layout/style/ServoStyleSet.cpp index 3b9721b40689..3eb9f478fa0a 100644 --- a/layout/style/ServoStyleSet.cpp +++ b/layout/style/ServoStyleSet.cpp @@ -363,18 +363,6 @@ ServoStyleSet::PrepareAndTraverseSubtree( return postTraversalRequired; } -already_AddRefed -ServoStyleSet::ResolveStyleFor(Element* aElement, - nsStyleContext* aParentContext, - LazyComputeBehavior aMayCompute, - TreeMatchContext& aTreeMatchContext) -{ - // aTreeMatchContext is used to speed up selector matching, - // but if the element already has a ServoComputedValues computed in - // advance, then we shouldn't need to use it. - return ResolveStyleFor(aElement, aParentContext, aMayCompute); -} - already_AddRefed ServoStyleSet::ResolveStyleForText(nsIContent* aTextNode, nsStyleContext* aParentContext) @@ -778,9 +766,13 @@ ServoStyleSet::AddDocStyleSheet(ServoStyleSheet* aSheet, already_AddRefed ServoStyleSet::ProbePseudoElementStyle(Element* aOriginatingElement, CSSPseudoElementType aType, - nsStyleContext* aParentContext) + nsStyleContext* aParentContext, + Element* aPseudoElement) { UpdateStylistIfNeeded(); + if (aPseudoElement) { + NS_ERROR("stylo: We don't support CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE yet"); + } // NB: We ignore aParentContext, on the assumption that pseudo element styles // should just inherit from aOriginatingElement's primary style, which Servo @@ -814,19 +806,6 @@ ServoStyleSet::ProbePseudoElementStyle(Element* aOriginatingElement, isBeforeOrAfter ? aOriginatingElement : nullptr); } -already_AddRefed -ServoStyleSet::ProbePseudoElementStyle(Element* aOriginatingElement, - CSSPseudoElementType aType, - nsStyleContext* aParentContext, - TreeMatchContext& aTreeMatchContext, - Element* aPseudoElement) -{ - if (aPseudoElement) { - NS_ERROR("stylo: We don't support CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE yet"); - } - return ProbePseudoElementStyle(aOriginatingElement, aType, aParentContext); -} - nsRestyleHint ServoStyleSet::HasStateDependentStyle(dom::Element* aElement, EventStates aStateMask) diff --git a/layout/style/ServoStyleSet.h b/layout/style/ServoStyleSet.h index f32b2648a09f..33b73ab79b84 100644 --- a/layout/style/ServoStyleSet.h +++ b/layout/style/ServoStyleSet.h @@ -119,12 +119,6 @@ public: nsStyleContext* aParentContext, LazyComputeBehavior aMayCompute); - already_AddRefed - ResolveStyleFor(dom::Element* aElement, - nsStyleContext* aParentContext, - LazyComputeBehavior aMayCompute, - TreeMatchContext& aTreeMatchContext); - // Get a style context for a text node (which no rules will match). // // The returned style context will have nsCSSAnonBoxes::mozText as its pseudo. @@ -216,16 +210,10 @@ public: nsresult AddDocStyleSheet(ServoStyleSheet* aSheet, nsIDocument* aDocument); // check whether there is ::before/::after style for an element - already_AddRefed - ProbePseudoElementStyle(dom::Element* aOriginatingElement, - mozilla::CSSPseudoElementType aType, - nsStyleContext* aParentContext); - already_AddRefed ProbePseudoElementStyle(dom::Element* aOriginatingElement, mozilla::CSSPseudoElementType aType, nsStyleContext* aParentContext, - TreeMatchContext& aTreeMatchContext, dom::Element* aPseudoElement = nullptr); // Test if style is dependent on content state diff --git a/layout/style/StyleSetHandleInlines.h b/layout/style/StyleSetHandleInlines.h index b1245848c66d..92f9287e40ce 100644 --- a/layout/style/StyleSetHandleInlines.h +++ b/layout/style/StyleSetHandleInlines.h @@ -91,7 +91,11 @@ StyleSetHandle::Ptr::ResolveStyleFor(dom::Element* aElement, LazyComputeBehavior aMayCompute, TreeMatchContext& aTreeMatchContext) { - FORWARD(ResolveStyleFor, (aElement, aParentContext, aMayCompute, aTreeMatchContext)); + if (IsGecko()) { + return AsGecko()->ResolveStyleFor(aElement, aParentContext, aMayCompute, aTreeMatchContext); + } else { + return AsServo()->ResolveStyleFor(aElement, aParentContext, aMayCompute); + } } already_AddRefed @@ -231,8 +235,13 @@ StyleSetHandle::Ptr::ProbePseudoElementStyle(dom::Element* aParentElement, TreeMatchContext& aTreeMatchContext, dom::Element* aPseudoElement) { - FORWARD(ProbePseudoElementStyle, (aParentElement, aType, aParentContext, - aTreeMatchContext, aPseudoElement)); + if (IsGecko()) { + return AsGecko()->ProbePseudoElementStyle(aParentElement, aType, aParentContext, + aTreeMatchContext, aPseudoElement); + } else { + return AsServo()->ProbePseudoElementStyle(aParentElement, aType, aParentContext, + aPseudoElement); + } } nsRestyleHint From 74189ef7bcc5e412694f3378169a8fda9ee43f44 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Thu, 18 May 2017 12:11:59 +0200 Subject: [PATCH 33/56] Bug 1329876 - Don't maintain a TreeMatchContext for Servo. r=bz --- layout/base/GeckoRestyleManager.cpp | 8 +- layout/base/nsCSSFrameConstructor.cpp | 119 ++++++++++++++++++-------- layout/style/StyleSetHandle.h | 4 +- layout/style/StyleSetHandleInlines.h | 10 ++- layout/style/nsRuleProcessorData.h | 41 +++++++-- 5 files changed, 127 insertions(+), 55 deletions(-) diff --git a/layout/base/GeckoRestyleManager.cpp b/layout/base/GeckoRestyleManager.cpp index 3fbc3b0cf6be..77620a0342ef 100644 --- a/layout/base/GeckoRestyleManager.cpp +++ b/layout/base/GeckoRestyleManager.cpp @@ -3120,7 +3120,7 @@ ElementRestyler::RestyleUndisplayedNodes(nsRestyleHint aChildRestyleHint, { nsIContent* undisplayedParent = aUndisplayedParent; UndisplayedNode* undisplayed = aUndisplayed; - TreeMatchContext::AutoAncestorPusher pusher(mTreeMatchContext); + TreeMatchContext::AutoAncestorPusher pusher(&mTreeMatchContext); if (undisplayed) { pusher.PushAncestorAndStyleScope(undisplayedParent); } @@ -3140,7 +3140,7 @@ ElementRestyler::RestyleUndisplayedNodes(nsRestyleHint aChildRestyleHint, // children element. Push the children element as an ancestor here because it does // not have a frame and would not otherwise be pushed as an ancestor. nsIContent* parent = undisplayed->mContent->GetParent(); - TreeMatchContext::AutoAncestorPusher insertionPointPusher(mTreeMatchContext); + TreeMatchContext::AutoAncestorPusher insertionPointPusher(&mTreeMatchContext); if (parent && nsContentUtils::IsContentInsertionPoint(parent)) { insertionPointPusher.PushAncestorAndStyleScope(parent); } @@ -3348,7 +3348,7 @@ ElementRestyler::RestyleContentChildren(nsIFrame* aParent, LOG_RESTYLE("RestyleContentChildren"); nsIFrame::ChildListIterator lists(aParent); - TreeMatchContext::AutoAncestorPusher ancestorPusher(mTreeMatchContext); + TreeMatchContext::AutoAncestorPusher ancestorPusher(&mTreeMatchContext); if (!lists.IsDone()) { ancestorPusher.PushAncestorAndStyleScope(mContent); } @@ -3366,7 +3366,7 @@ ElementRestyler::RestyleContentChildren(nsIFrame* aParent, // Check if the frame has a content because |child| may be a // nsPageFrame that does not have a content. nsIContent* parent = child->GetContent() ? child->GetContent()->GetParent() : nullptr; - TreeMatchContext::AutoAncestorPusher insertionPointPusher(mTreeMatchContext); + TreeMatchContext::AutoAncestorPusher insertionPointPusher(&mTreeMatchContext); if (parent && nsContentUtils::IsContentInsertionPoint(parent)) { insertionPointPusher.PushAncestorAndStyleScope(parent); } diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 261e8afdab2a..f7f238d42b14 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -330,6 +330,32 @@ static int32_t FFWC_recursions=0; static int32_t FFWC_nextInFlows=0; #endif +// Wrapper class to handle stack-construction a TreeMatchContext only if we're +// using the Gecko style system. +class MOZ_STACK_CLASS TreeMatchContextHolder +{ +public: + explicit TreeMatchContextHolder(nsIDocument* aDocument) + { + if (!aDocument->IsStyledByServo()) { + mMaybeTreeMatchContext.emplace(aDocument, + TreeMatchContext::ForFrameConstruction); + } + } + + bool Exists() const { return mMaybeTreeMatchContext.isSome(); } + operator TreeMatchContext*() { return mMaybeTreeMatchContext.ptrOr(nullptr); } + + TreeMatchContext* operator ->() + { + MOZ_ASSERT(mMaybeTreeMatchContext.isSome()); + return mMaybeTreeMatchContext.ptr(); + } + +private: + Maybe mMaybeTreeMatchContext; +}; + // Returns true if aFrame is an anonymous flex/grid item. static inline bool IsAnonymousFlexOrGridItem(const nsIFrame* aFrame) @@ -803,26 +829,35 @@ public: nsCOMArray mGeneratedTextNodesWithInitializer; - TreeMatchContext& mTreeMatchContext; + // Selector matching context for. This is null when we're using the Servo style + // system. + TreeMatchContext* mTreeMatchContext; // Constructor // Use the passed-in history state. + // + // aTreeMatchContext is null when we're using the Servo style system. nsFrameConstructorState( nsIPresShell* aPresShell, - TreeMatchContext& aTreeMatchContext, + TreeMatchContext* aTreeMatchContext, nsContainerFrame* aFixedContainingBlock, nsContainerFrame* aAbsoluteContainingBlock, nsContainerFrame* aFloatContainingBlock, already_AddRefed aHistoryState); // Get the history state from the pres context's pres shell. nsFrameConstructorState(nsIPresShell* aPresShell, - TreeMatchContext& aTreeMatchContext, + TreeMatchContext* aTreeMatchContext, nsContainerFrame* aFixedContainingBlock, nsContainerFrame* aAbsoluteContainingBlock, nsContainerFrame* aFloatContainingBlock); ~nsFrameConstructorState(); + bool HasAncestorFilter() + { + return mTreeMatchContext && mTreeMatchContext->mAncestorFilter.HasFilter(); + } + // Function to push the existing absolute containing block state and // create a new scope. Code that uses this function should get matching // logic in GetAbsoluteContainingBlock. @@ -972,7 +1007,7 @@ protected: nsFrameConstructorState::nsFrameConstructorState( nsIPresShell* aPresShell, - TreeMatchContext& aTreeMatchContext, + TreeMatchContext* aTreeMatchContext, nsContainerFrame* aFixedContainingBlock, nsContainerFrame* aAbsoluteContainingBlock, nsContainerFrame* aFloatContainingBlock, @@ -1012,7 +1047,7 @@ nsFrameConstructorState::nsFrameConstructorState( } nsFrameConstructorState::nsFrameConstructorState(nsIPresShell* aPresShell, - TreeMatchContext& aTreeMatchContext, + TreeMatchContext* aTreeMatchContext, nsContainerFrame* aFixedContainingBlock, nsContainerFrame* aAbsoluteContainingBlock, nsContainerFrame* aFloatContainingBlock) @@ -2427,10 +2462,12 @@ nsCSSFrameConstructor::ConstructDocElementFrame(Element* aDocEle NS_ASSERTION(mDocElementContainingBlock, "Should have parent by now"); - TreeMatchContext matchContext(mDocument, TreeMatchContext::ForFrameConstruction); + TreeMatchContextHolder matchContext(mDocument); // Initialize the ancestor filter with null for now; we'll push // aDocElement once we finish resolving style for it. - matchContext.InitAncestors(nullptr); + if (matchContext.Exists()) { + matchContext->InitAncestors(nullptr); + } nsFrameConstructorState state(mPresShell, matchContext, GetAbsoluteContainingBlock(mDocElementContainingBlock, FIXED_POS), @@ -2876,7 +2913,7 @@ nsCSSFrameConstructor::SetUpDocElementContainingBlock(nsIContent* aDocElement) RefPtr rootPseudoStyle; // we must create a state because if the scrollbars are GFX it needs the // state to build the scrollbar frames. - TreeMatchContext matchContext(mDocument, TreeMatchContext::ForFrameConstruction); + TreeMatchContextHolder matchContext(mDocument); nsFrameConstructorState state(mPresShell, matchContext, nullptr, nullptr, nullptr); // Start off with the viewport as parent; we'll adjust it as needed. @@ -3854,8 +3891,12 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt nsIContent* parent = content->GetParent(); // Push display:contents ancestors. - AutoDisplayContentsAncestorPusher adcp(aState.mTreeMatchContext, - aState.mPresContext, parent); + Maybe adcp; + if (aState.mTreeMatchContext) { + adcp.emplace(*aState.mTreeMatchContext, aState.mPresContext, parent); + } else { + MOZ_ASSERT(content->IsStyledByServo()); + } // Get the parent of the content and check if it is a XBL children element. // Push the children element as an ancestor here because it does @@ -3865,8 +3906,9 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt // AutoDisplayContentsAncestorPusher above.) TreeMatchContext::AutoAncestorPusher insertionPointPusher(aState.mTreeMatchContext); - if (adcp.IsEmpty() && parent && nsContentUtils::IsContentInsertionPoint(parent)) { - if (aState.mTreeMatchContext.mAncestorFilter.HasFilter()) { + if (adcp.isSome() && adcp->IsEmpty() && parent && + nsContentUtils::IsContentInsertionPoint(parent)) { + if (aState.mTreeMatchContext->mAncestorFilter.HasFilter()) { insertionPointPusher.PushAncestorAndStyleScope(parent); } else { insertionPointPusher.PushStyleScope(parent); @@ -3883,7 +3925,7 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt // places. TreeMatchContext::AutoAncestorPusher ancestorPusher(aState.mTreeMatchContext); - if (aState.mTreeMatchContext.mAncestorFilter.HasFilter()) { + if (aState.HasAncestorFilter()) { ancestorPusher.PushAncestorAndStyleScope(content); } else { ancestorPusher.PushStyleScope(content); @@ -4601,7 +4643,7 @@ nsCSSFrameConstructor::BeginBuildingScrollFrame(nsFrameConstructorState& aState, MOZ_ASSERT(NS_SUCCEEDED(rv)); if (scrollNAC.Length() > 0) { TreeMatchContext::AutoAncestorPusher ancestorPusher(aState.mTreeMatchContext); - if (aState.mTreeMatchContext.mAncestorFilter.HasFilter()) { + if (aState.HasAncestorFilter()) { ancestorPusher.PushAncestorAndStyleScope(aContent->AsElement()); } else { ancestorPusher.PushStyleScope(aContent->AsElement()); @@ -5965,7 +6007,7 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState } TreeMatchContext::AutoAncestorPusher ancestorPusher(aState.mTreeMatchContext); - if (aState.mTreeMatchContext.mAncestorFilter.HasFilter()) { + if (aState.HasAncestorFilter()) { ancestorPusher.PushAncestorAndStyleScope(aContent->AsElement()); } else { ancestorPusher.PushStyleScope(aContent->AsElement()); @@ -5992,7 +6034,7 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState MOZ_ASSERT(parent, "Parent must be non-null because we are iterating children."); TreeMatchContext::AutoAncestorPusher ancestorPusher(aState.mTreeMatchContext); if (parent != aContent && parent->IsElement()) { - if (aState.mTreeMatchContext.mAncestorFilter.HasFilter()) { + if (aState.HasAncestorFilter()) { ancestorPusher.PushAncestorAndStyleScope(parent->AsElement()); } else { ancestorPusher.PushStyleScope(parent->AsElement()); @@ -7178,6 +7220,7 @@ nsCSSFrameConstructor::CreateNeededFrames( nsIContent* aContent, TreeMatchContext& aTreeMatchContext) { + MOZ_ASSERT(!aContent->IsStyledByServo()); NS_ASSERTION(!aContent->HasFlag(NODE_NEEDS_FRAME), "shouldn't get here with a content node that has needs frame bit set"); NS_ASSERTION(aContent->HasFlag(NODE_DESCENDANTS_NEED_FRAMES), @@ -7239,7 +7282,7 @@ nsCSSFrameConstructor::CreateNeededFrames( for (nsIContent* child = iter.GetNextChild(); child; child = iter.GetNextChild()) { if (child->HasFlag(NODE_DESCENDANTS_NEED_FRAMES)) { TreeMatchContext::AutoAncestorPusher insertionPointPusher( - aTreeMatchContext); + &aTreeMatchContext); // Handle stuff like xbl:children. if (child->GetParent() != aContent && child->GetParent()->IsElement()) { @@ -7247,7 +7290,7 @@ nsCSSFrameConstructor::CreateNeededFrames( child->GetParent()->AsElement()); } - TreeMatchContext::AutoAncestorPusher pusher(aTreeMatchContext); + TreeMatchContext::AutoAncestorPusher pusher(&aTreeMatchContext); pusher.PushAncestorAndStyleScope(child); CreateNeededFrames(child, aTreeMatchContext); @@ -7622,13 +7665,12 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer, // We use the provided tree match context, or create a new one on the fly // otherwise. Maybe matchContext; - if (!aProvidedTreeMatchContext) { + if (!aProvidedTreeMatchContext && !aContainer->IsStyledByServo()) { matchContext.emplace(mDocument, TreeMatchContext::ForFrameConstruction); matchContext->InitAncestors(aContainer->AsElement()); } nsFrameConstructorState state(mPresShell, - aProvidedTreeMatchContext - ? *aProvidedTreeMatchContext : *matchContext, + matchContext.ptrOr(aProvidedTreeMatchContext), GetAbsoluteContainingBlock(parentFrame, FIXED_POS), GetAbsoluteContainingBlock(parentFrame, ABS_POS), GetFloatContainingBlock(parentFrame)); @@ -8129,13 +8171,12 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer, } Maybe matchContext; - if (!aProvidedTreeMatchContext) { + if (!aProvidedTreeMatchContext && !aContainer->IsStyledByServo()) { matchContext.emplace(mDocument, TreeMatchContext::ForFrameConstruction); matchContext->InitAncestors(aContainer ? aContainer->AsElement() : nullptr); } nsFrameConstructorState state(mPresShell, - aProvidedTreeMatchContext - ? *aProvidedTreeMatchContext : *matchContext, + matchContext.ptrOr(aProvidedTreeMatchContext), GetAbsoluteContainingBlock(insertion.mParentFrame, FIXED_POS), GetAbsoluteContainingBlock(insertion.mParentFrame, ABS_POS), GetFloatContainingBlock(insertion.mParentFrame), @@ -9095,7 +9136,7 @@ nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresShell* aPresShell, nsTableRowGroupFrame* headerFooterFrame; nsFrameItems childItems; - TreeMatchContext matchContext(mDocument, TreeMatchContext::ForFrameConstruction); + TreeMatchContextHolder matchContext(mDocument); nsFrameConstructorState state(mPresShell, matchContext, GetAbsoluteContainingBlock(newFrame, FIXED_POS), @@ -9370,7 +9411,7 @@ nsCSSFrameConstructor::ReplicateFixedFrames(nsPageContentFrame* aParentFrame) // This should not normally be possible (because fixed-pos elements should // be absolute containers) but fixed-pos tables currently aren't abs-pos // containers. - TreeMatchContext matchContext(mDocument, TreeMatchContext::ForFrameConstruction); + TreeMatchContextHolder matchContext(mDocument); nsFrameConstructorState state(mPresShell, matchContext, aParentFrame, @@ -10916,8 +10957,12 @@ nsCSSFrameConstructor::AddFCItemsForAnonymousContent( "Why is someone creating garbage anonymous content"); RefPtr styleContext; - TreeMatchContext::AutoParentDisplayBasedStyleFixupSkipper - parentDisplayBasedStyleFixupSkipper(aState.mTreeMatchContext); + Maybe + parentDisplayBasedStyleFixupSkipper; + MOZ_ASSERT_IF(!aState.mTreeMatchContext, content->IsStyledByServo()); + if (aState.mTreeMatchContext) { + parentDisplayBasedStyleFixupSkipper.emplace(*aState.mTreeMatchContext); + } // Make sure we eagerly performed the servo cascade when the anonymous // nodes were created. @@ -11138,8 +11183,9 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState, // a flex/grid container frame, not just has display:flex/grid. Maybe parentDisplayBasedStyleFixupSkipper; - if (!isFlexOrGridContainer) { - parentDisplayBasedStyleFixupSkipper.emplace(aState.mTreeMatchContext); + MOZ_ASSERT_IF(!aState.mTreeMatchContext, aContent->IsStyledByServo()); + if (!isFlexOrGridContainer && aState.mTreeMatchContext) { + parentDisplayBasedStyleFixupSkipper.emplace(*aState.mTreeMatchContext); } InsertionPoint insertion(aFrame, nullptr); @@ -11157,7 +11203,7 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState, if (parent != aContent && parent->IsElement()) { insertion.mContainer = child->GetFlattenedTreeParent(); MOZ_ASSERT(insertion.mContainer == GetInsertionPoint(parent, child).mContainer); - if (aState.mTreeMatchContext.mAncestorFilter.HasFilter()) { + if (aState.HasAncestorFilter()) { ancestorPusher.PushAncestorAndStyleScope(parent->AsElement()); } else { ancestorPusher.PushStyleScope(parent->AsElement()); @@ -11681,8 +11727,7 @@ nsCSSFrameConstructor::CreateLetterFrame(nsContainerFrame* aBlockFrame, NS_ASSERTION(aBlockContinuation == GetFloatContainingBlock(aParentFrame), "Containing block is confused"); - TreeMatchContext matchContext(mDocument, - TreeMatchContext::ForFrameConstruction); + TreeMatchContextHolder matchContext(mDocument); nsFrameConstructorState state(mPresShell, matchContext, GetAbsoluteContainingBlock(aParentFrame, FIXED_POS), @@ -12058,7 +12103,7 @@ nsCSSFrameConstructor::CreateListBoxContent(nsContainerFrame* aParentFrame, // Construct a new frame if (nullptr != aParentFrame) { nsFrameItems frameItems; - TreeMatchContext matchContext(mDocument, TreeMatchContext::ForFrameConstruction); + TreeMatchContextHolder matchContext(mDocument); nsFrameConstructorState state(mPresShell, matchContext, GetAbsoluteContainingBlock(aParentFrame, FIXED_POS), @@ -12407,7 +12452,7 @@ nsCSSFrameConstructor::BuildInlineChildItems(nsFrameConstructorState& aState, nsIContent* const parentContent = aParentItem.mContent; TreeMatchContext::AutoAncestorPusher ancestorPusher(aState.mTreeMatchContext); - if (aState.mTreeMatchContext.mAncestorFilter.HasFilter()) { + if (aState.HasAncestorFilter()) { ancestorPusher.PushAncestorAndStyleScope(parentContent->AsElement()); } else { ancestorPusher.PushStyleScope(parentContent->AsElement()); @@ -12448,7 +12493,7 @@ nsCSSFrameConstructor::BuildInlineChildItems(nsFrameConstructorState& aState, MOZ_ASSERT(contentParent, "Parent must be non-null because we are iterating children."); TreeMatchContext::AutoAncestorPusher insertionPointPusher(aState.mTreeMatchContext); if (contentParent != parentContent && contentParent->IsElement()) { - if (aState.mTreeMatchContext.mAncestorFilter.HasFilter()) { + if (aState.HasAncestorFilter()) { insertionPointPusher.PushAncestorAndStyleScope(contentParent->AsElement()); } else { insertionPointPusher.PushStyleScope(contentParent->AsElement()); @@ -12945,7 +12990,7 @@ nsCSSFrameConstructor::GenerateChildFrames(nsContainerFrame* aFrame) BeginUpdate(); nsFrameItems childItems; - TreeMatchContext matchContext(mDocument, TreeMatchContext::ForFrameConstruction); + TreeMatchContextHolder matchContext(mDocument); nsFrameConstructorState state(mPresShell, matchContext, nullptr, nullptr, nullptr); // We don't have a parent frame with a pending binding constructor here, // so no need to worry about ordering of the kids' constructors with it. diff --git a/layout/style/StyleSetHandle.h b/layout/style/StyleSetHandle.h index 105a460d4c75..ca7289997134 100644 --- a/layout/style/StyleSetHandle.h +++ b/layout/style/StyleSetHandle.h @@ -123,7 +123,7 @@ public: ResolveStyleFor(dom::Element* aElement, nsStyleContext* aParentContext, LazyComputeBehavior aMayCompute, - TreeMatchContext& aTreeMatchContext); + TreeMatchContext* aTreeMatchContext); inline already_AddRefed ResolveStyleForText(nsIContent* aTextNode, nsStyleContext* aParentContext); @@ -161,7 +161,7 @@ public: ProbePseudoElementStyle(dom::Element* aParentElement, mozilla::CSSPseudoElementType aType, nsStyleContext* aParentContext, - TreeMatchContext& aTreeMatchContext, + TreeMatchContext* aTreeMatchContext, dom::Element* aPseudoElement = nullptr); inline nsRestyleHint HasStateDependentStyle(dom::Element* aElement, EventStates aStateMask); diff --git a/layout/style/StyleSetHandleInlines.h b/layout/style/StyleSetHandleInlines.h index 92f9287e40ce..a1d086513f72 100644 --- a/layout/style/StyleSetHandleInlines.h +++ b/layout/style/StyleSetHandleInlines.h @@ -89,10 +89,11 @@ already_AddRefed StyleSetHandle::Ptr::ResolveStyleFor(dom::Element* aElement, nsStyleContext* aParentContext, LazyComputeBehavior aMayCompute, - TreeMatchContext& aTreeMatchContext) + TreeMatchContext* aTreeMatchContext) { if (IsGecko()) { - return AsGecko()->ResolveStyleFor(aElement, aParentContext, aMayCompute, aTreeMatchContext); + MOZ_ASSERT(aTreeMatchContext); + return AsGecko()->ResolveStyleFor(aElement, aParentContext, aMayCompute, *aTreeMatchContext); } else { return AsServo()->ResolveStyleFor(aElement, aParentContext, aMayCompute); } @@ -232,12 +233,13 @@ already_AddRefed StyleSetHandle::Ptr::ProbePseudoElementStyle(dom::Element* aParentElement, CSSPseudoElementType aType, nsStyleContext* aParentContext, - TreeMatchContext& aTreeMatchContext, + TreeMatchContext* aTreeMatchContext, dom::Element* aPseudoElement) { if (IsGecko()) { + MOZ_ASSERT(aTreeMatchContext); return AsGecko()->ProbePseudoElementStyle(aParentElement, aType, aParentContext, - aTreeMatchContext, aPseudoElement); + *aTreeMatchContext, aPseudoElement); } else { return AsServo()->ProbePseudoElementStyle(aParentElement, aType, aParentContext, aPseudoElement); diff --git a/layout/style/nsRuleProcessorData.h b/layout/style/nsRuleProcessorData.h index 6ace4cb5a093..4d1608ff331e 100644 --- a/layout/style/nsRuleProcessorData.h +++ b/layout/style/nsRuleProcessorData.h @@ -226,10 +226,15 @@ struct MOZ_STACK_CLASS TreeMatchContext { return mCurrentStyleScope; } - /* Helper class for maintaining the ancestor state */ + /* + * Helper class for maintaining the ancestor state. + * + * This class does nothing if aTreeMatchContext is null, which is the case for + * the Servo style system. + */ class MOZ_RAII AutoAncestorPusher { public: - explicit AutoAncestorPusher(TreeMatchContext& aTreeMatchContext + explicit AutoAncestorPusher(TreeMatchContext* aTreeMatchContext MOZ_GUARD_OBJECT_NOTIFIER_PARAM) : mPushedAncestor(false) , mPushedStyleScope(false) @@ -240,32 +245,52 @@ struct MOZ_STACK_CLASS TreeMatchContext { } void PushAncestorAndStyleScope(mozilla::dom::Element* aElement) { + if (!mTreeMatchContext) { + MOZ_ASSERT_IF(aElement, aElement->IsStyledByServo()); + return; + } + MOZ_ASSERT(!mElement); if (aElement) { mElement = aElement; mPushedAncestor = true; mPushedStyleScope = true; - mTreeMatchContext.mAncestorFilter.PushAncestor(aElement); - mTreeMatchContext.PushStyleScope(aElement); + mTreeMatchContext->mAncestorFilter.PushAncestor(aElement); + mTreeMatchContext->PushStyleScope(aElement); } } void PushAncestorAndStyleScope(nsIContent* aContent) { + if (!mTreeMatchContext) { + MOZ_ASSERT_IF(aContent, aContent->IsStyledByServo()); + return; + } + if (aContent && aContent->IsElement()) { PushAncestorAndStyleScope(aContent->AsElement()); } } void PushStyleScope(mozilla::dom::Element* aElement) { + if (!mTreeMatchContext) { + MOZ_ASSERT_IF(aElement, aElement->IsStyledByServo()); + return; + } + MOZ_ASSERT(!mElement); if (aElement) { mElement = aElement; mPushedStyleScope = true; - mTreeMatchContext.PushStyleScope(aElement); + mTreeMatchContext->PushStyleScope(aElement); } } void PushStyleScope(nsIContent* aContent) { + if (!mTreeMatchContext) { + MOZ_ASSERT_IF(aContent, aContent->IsStyledByServo()); + return; + } + if (aContent && aContent->IsElement()) { PushStyleScope(aContent->AsElement()); } @@ -273,17 +298,17 @@ struct MOZ_STACK_CLASS TreeMatchContext { ~AutoAncestorPusher() { if (mPushedAncestor) { - mTreeMatchContext.mAncestorFilter.PopAncestor(); + mTreeMatchContext->mAncestorFilter.PopAncestor(); } if (mPushedStyleScope) { - mTreeMatchContext.PopStyleScope(mElement); + mTreeMatchContext->PopStyleScope(mElement); } } private: bool mPushedAncestor; bool mPushedStyleScope; - TreeMatchContext& mTreeMatchContext; + TreeMatchContext* mTreeMatchContext; mozilla::dom::Element* mElement; MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER }; From 7e7daf7028a6fd3909292b1bf9c1842a0edf40a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 20 May 2017 13:44:31 -0500 Subject: [PATCH 34/56] servo: Merge #16967 - Bug 1366144: Correctly diff ::before and ::after pseudo-element styles if there's no generated content. r=heycam (from emilio:after); r=heycam,emilio Source-Repo: https://github.com/servo/servo Source-Revision: 05a26a29967b4cb70cac0055d0a177881e047efd --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 8cc35948a5bc6e6d686c52899e276e4ae7831736 --- servo/components/layout/animation.rs | 4 +- servo/components/layout_thread/lib.rs | 6 +- servo/components/script/dom/document.rs | 6 +- servo/components/script/dom/element.rs | 4 +- servo/components/style/data.rs | 49 ++- .../style/gecko/generated/bindings.rs | 3 +- .../components/style/gecko/restyle_damage.rs | 18 +- servo/components/style/matching.rs | 313 +++++++++---- .../components/style/properties/gecko.mako.rs | 11 + .../style/properties/properties.mako.rs | 13 + servo/components/style/restyle_hints.rs | 415 +++++++++++++++--- .../components/style/servo/restyle_damage.rs | 15 +- servo/components/style/traversal.rs | 51 ++- servo/ports/geckolib/glue.rs | 8 +- 14 files changed, 689 insertions(+), 227 deletions(-) diff --git a/servo/components/layout/animation.rs b/servo/components/layout/animation.rs index d1673ac44a14..a054927190ca 100644 --- a/servo/components/layout/animation.rs +++ b/servo/components/layout/animation.rs @@ -160,7 +160,9 @@ pub fn recalc_style_for_animations(context: &LayoutContext, animation, &mut fragment.style, &ServoMetricsProvider); - damage |= RestyleDamage::compute(&old_style, &fragment.style); + let difference = + RestyleDamage::compute_style_difference(&old_style, &fragment.style); + damage |= difference.damage; } } }); diff --git a/servo/components/layout_thread/lib.rs b/servo/components/layout_thread/lib.rs index 8185aa6e4093..9f5b60b0045f 100644 --- a/servo/components/layout_thread/lib.rs +++ b/servo/components/layout_thread/lib.rs @@ -1100,7 +1100,7 @@ impl LayoutThread { let el = node.as_element().unwrap(); if let Some(mut d) = element.mutate_data() { if d.has_styles() { - d.ensure_restyle().hint.insert(&StoredRestyleHint::subtree()); + d.ensure_restyle().hint.insert(StoredRestyleHint::subtree()); } } if let Some(p) = el.parent_element() { @@ -1136,7 +1136,7 @@ impl LayoutThread { if needs_dirtying { if let Some(mut d) = element.mutate_data() { if d.has_styles() { - d.ensure_restyle().hint.insert(&StoredRestyleHint::subtree()); + d.ensure_restyle().hint.insert(StoredRestyleHint::subtree()); } } } @@ -1184,7 +1184,7 @@ impl LayoutThread { let mut restyle_data = style_data.ensure_restyle(); // Stash the data on the element for processing by the style system. - restyle_data.hint.insert(&restyle.hint.into()); + restyle_data.hint.insert(restyle.hint.into()); restyle_data.damage = restyle.damage; debug!("Noting restyle for {:?}: {:?}", el, restyle_data); } diff --git a/servo/components/script/dom/document.rs b/servo/components/script/dom/document.rs index 81ea073ab417..3bca1dcee9e0 100644 --- a/servo/components/script/dom/document.rs +++ b/servo/components/script/dom/document.rs @@ -131,7 +131,7 @@ use std::rc::Rc; use std::time::{Duration, Instant}; use style::attr::AttrValue; use style::context::{QuirksMode, ReflowGoal}; -use style::restyle_hints::{RestyleHint, RESTYLE_SELF, RESTYLE_STYLE_ATTRIBUTE}; +use style::restyle_hints::{RestyleHint, RestyleReplacements, RESTYLE_STYLE_ATTRIBUTE}; use style::selector_parser::{RestyleDamage, Snapshot}; use style::shared_lock::SharedRwLock as StyleSharedRwLock; use style::str::{HTML_SPACE_CHARACTERS, split_html_space_chars, str_join}; @@ -2361,14 +2361,14 @@ impl Document { entry.snapshot = Some(Snapshot::new(el.html_element_in_html_document())); } if attr.local_name() == &local_name!("style") { - entry.hint |= RESTYLE_STYLE_ATTRIBUTE; + entry.hint.insert(RestyleHint::for_replacements(RESTYLE_STYLE_ATTRIBUTE)); } // FIXME(emilio): This should become something like // element.is_attribute_mapped(attr.local_name()). if attr.local_name() == &local_name!("width") || attr.local_name() == &local_name!("height") { - entry.hint |= RESTYLE_SELF; + entry.hint.insert(RestyleHint::for_self()); } let mut snapshot = entry.snapshot.as_mut().unwrap(); diff --git a/servo/components/script/dom/element.rs b/servo/components/script/dom/element.rs index 55175fd45c6b..0dc3db0ebe5d 100644 --- a/servo/components/script/dom/element.rs +++ b/servo/components/script/dom/element.rs @@ -102,7 +102,7 @@ use style::context::{QuirksMode, ReflowGoal}; use style::element_state::*; use style::properties::{Importance, PropertyDeclaration, PropertyDeclarationBlock, parse_style_attribute}; use style::properties::longhands::{self, background_image, border_spacing, font_family, font_size, overflow_x}; -use style::restyle_hints::RESTYLE_SELF; +use style::restyle_hints::RestyleHint; use style::rule_tree::CascadeLevel; use style::selector_parser::{NonTSPseudoClass, PseudoElement, RestyleDamage, SelectorImpl, SelectorParser}; use style::shared_lock::{SharedRwLock, Locked}; @@ -245,7 +245,7 @@ impl Element { // FIXME(bholley): I think we should probably only do this for // NodeStyleDamaged, but I'm preserving existing behavior. - restyle.hint |= RESTYLE_SELF; + restyle.hint.insert(RestyleHint::for_self()); if damage == NodeDamage::OtherNodeDamage { restyle.damage = RestyleDamage::rebuild_and_reflow(); diff --git a/servo/components/style/data.rs b/servo/components/style/data.rs index c1ea08653172..e7248cf94d23 100644 --- a/servo/components/style/data.rs +++ b/servo/components/style/data.rs @@ -10,7 +10,7 @@ use context::SharedStyleContext; use dom::TElement; use properties::ComputedValues; use properties::longhands::display::computed_value as display; -use restyle_hints::{RESTYLE_DESCENDANTS, RESTYLE_LATER_SIBLINGS, RESTYLE_SELF, RestyleHint}; +use restyle_hints::{RestyleReplacements, RestyleHint}; use rule_tree::StrongRuleNode; use selector_parser::{EAGER_PSEUDO_COUNT, PseudoElement, RestyleDamage}; use shared_lock::StylesheetGuards; @@ -198,21 +198,18 @@ impl StoredRestyleHint { // In the middle of an animation only restyle, we don't need to // propagate any restyle hints, and we need to remove ourselves. if traversal_flags.for_animation_only() { - self.0.remove(RestyleHint::for_animations()); + self.0.remove_animation_hints(); return Self::empty(); } - debug_assert!(!self.0.intersects(RestyleHint::for_animations()), + debug_assert!(!self.0.has_animation_hint(), "There should not be any animation restyle hints \ during normal traversal"); // Else we should clear ourselves, and return the propagated hint. - let hint = mem::replace(&mut self.0, RestyleHint::empty()); - StoredRestyleHint(if hint.contains(RESTYLE_DESCENDANTS) { - RESTYLE_SELF | RESTYLE_DESCENDANTS - } else { - RestyleHint::empty() - }) + let new_hint = mem::replace(&mut self.0, RestyleHint::empty()) + .propagate_for_non_animation_restyle(); + StoredRestyleHint(new_hint) } /// Creates an empty `StoredRestyleHint`. @@ -223,25 +220,25 @@ impl StoredRestyleHint { /// Creates a restyle hint that forces the whole subtree to be restyled, /// including the element. pub fn subtree() -> Self { - StoredRestyleHint(RESTYLE_SELF | RESTYLE_DESCENDANTS) + StoredRestyleHint(RestyleHint::subtree()) } /// Creates a restyle hint that forces the element and all its later /// siblings to have their whole subtrees restyled, including the elements /// themselves. pub fn subtree_and_later_siblings() -> Self { - StoredRestyleHint(RESTYLE_SELF | RESTYLE_DESCENDANTS | RESTYLE_LATER_SIBLINGS) + StoredRestyleHint(RestyleHint::subtree_and_later_siblings()) } /// Returns true if the hint indicates that our style may be invalidated. pub fn has_self_invalidations(&self) -> bool { - self.0.intersects(RestyleHint::for_self()) + self.0.affects_self() } /// Returns true if the hint indicates that our sibling's style may be /// invalidated. pub fn has_sibling_invalidations(&self) -> bool { - self.0.intersects(RESTYLE_LATER_SIBLINGS) + self.0.affects_later_siblings() } /// Whether the restyle hint is empty (nothing requires to be restyled). @@ -250,13 +247,18 @@ impl StoredRestyleHint { } /// Insert another restyle hint, effectively resulting in the union of both. - pub fn insert(&mut self, other: &Self) { - self.0 |= other.0 + pub fn insert(&mut self, other: Self) { + self.0.insert(other.0) + } + + /// Insert another restyle hint, effectively resulting in the union of both. + pub fn insert_from(&mut self, other: &Self) { + self.0.insert_from(&other.0) } /// Returns true if the hint has animation-only restyle. pub fn has_animation_hint(&self) -> bool { - self.0.intersects(RestyleHint::for_animations()) + self.0.has_animation_hint() } } @@ -356,7 +358,7 @@ pub enum RestyleKind { MatchAndCascade, /// We need to recascade with some replacement rule, such as the style /// attribute, or animation rules. - CascadeWithReplacements(RestyleHint), + CascadeWithReplacements(RestyleReplacements), /// We only need to recascade, for example, because only inherited /// properties in the parent changed. CascadeOnly, @@ -381,7 +383,7 @@ impl ElementData { context.traversal_flags); let mut hint = match self.get_restyle() { - Some(r) => r.hint.0, + Some(r) => r.hint.0.clone(), None => RestyleHint::empty(), }; @@ -393,7 +395,7 @@ impl ElementData { element.implemented_pseudo_element()); if element.has_snapshot() && !element.handled_snapshot() { - hint |= context.stylist.compute_restyle_hint(&element, context.snapshot_map); + hint.insert(context.stylist.compute_restyle_hint(&element, context.snapshot_map)); unsafe { element.set_handled_snapshot() } debug_assert!(element.handled_snapshot()); } @@ -402,8 +404,7 @@ impl ElementData { // If the hint includes a directive for later siblings, strip it out and // notify the caller to modify the base hint for future siblings. - let later_siblings = hint.contains(RESTYLE_LATER_SIBLINGS); - hint.remove(RESTYLE_LATER_SIBLINGS); + let later_siblings = hint.remove_later_siblings_hint(); // Insert the hint, overriding the previous hint. This effectively takes // care of removing the later siblings restyle hint. @@ -445,13 +446,13 @@ impl ElementData { debug_assert!(self.restyle.is_some()); let restyle_data = self.restyle.as_ref().unwrap(); - let hint = restyle_data.hint.0; - if hint.contains(RESTYLE_SELF) { + let hint = &restyle_data.hint.0; + if hint.match_self() { return RestyleKind::MatchAndCascade; } if !hint.is_empty() { - return RestyleKind::CascadeWithReplacements(hint); + return RestyleKind::CascadeWithReplacements(hint.replacements); } debug_assert!(restyle_data.recascade, diff --git a/servo/components/style/gecko/generated/bindings.rs b/servo/components/style/gecko/generated/bindings.rs index a07176ee2088..101e9c89cad7 100644 --- a/servo/components/style/gecko/generated/bindings.rs +++ b/servo/components/style/gecko/generated/bindings.rs @@ -961,7 +961,8 @@ extern "C" { } extern "C" { pub fn Gecko_CalcStyleDifference(oldstyle: *mut nsStyleContext, - newstyle: ServoComputedValuesBorrowed) + newstyle: ServoComputedValuesBorrowed, + any_style_changed: *mut bool) -> nsChangeHint; } extern "C" { diff --git a/servo/components/style/gecko/restyle_damage.rs b/servo/components/style/gecko/restyle_damage.rs index 39fdafebd5da..9d443b23baff 100644 --- a/servo/components/style/gecko/restyle_damage.rs +++ b/servo/components/style/gecko/restyle_damage.rs @@ -8,6 +8,7 @@ use gecko_bindings::bindings; use gecko_bindings::structs; use gecko_bindings::structs::{nsChangeHint, nsStyleContext}; use gecko_bindings::sugar::ownership::FFIArcHelpers; +use matching::{StyleChange, StyleDifference}; use properties::ComputedValues; use std::ops::{BitAnd, BitOr, BitOrAssign, Not}; use stylearc::Arc; @@ -38,22 +39,27 @@ impl GeckoRestyleDamage { self.0 == nsChangeHint(0) } - /// Computes a change hint given an old style (in the form of a - /// `nsStyleContext`, and a new style (in the form of `ComputedValues`). + /// Computes the `StyleDifference` (including the appropriate change hint) + /// given an old style (in the form of a `nsStyleContext`, and a new style + /// (in the form of `ComputedValues`). /// /// Note that we could in theory just get two `ComputedValues` here and diff /// them, but Gecko has an interesting optimization when they mark accessed /// structs, so they effectively only diff structs that have ever been /// accessed from layout. - pub fn compute(source: &nsStyleContext, - new_style: &Arc) -> Self { + pub fn compute_style_difference(source: &nsStyleContext, + new_style: &Arc) + -> StyleDifference { // TODO(emilio): Const-ify this? let context = source as *const nsStyleContext as *mut nsStyleContext; + let mut any_style_changed: bool = false; let hint = unsafe { bindings::Gecko_CalcStyleDifference(context, - new_style.as_borrowed_opt().unwrap()) + new_style.as_borrowed_opt().unwrap(), + &mut any_style_changed) }; - GeckoRestyleDamage(hint) + let change = if any_style_changed { StyleChange::Changed } else { StyleChange::Unchanged }; + StyleDifference::new(GeckoRestyleDamage(hint), change) } /// Returns true if this restyle damage contains all the damage of |other|. diff --git a/servo/components/style/matching.rs b/servo/components/style/matching.rs index 8c7629059907..59f2a19912d1 100644 --- a/servo/components/style/matching.rs +++ b/servo/components/style/matching.rs @@ -16,9 +16,10 @@ use context::{CurrentElementInfo, SelectorFlagsMap, SharedStyleContext, StyleCon use data::{ComputedStyle, ElementData, ElementStyles, RestyleData}; use dom::{AnimationRules, SendElement, TElement, TNode}; use font_metrics::FontMetricsProvider; +use log::LogLevel::Trace; use properties::{CascadeFlags, ComputedValues, SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP, cascade}; use properties::longhands::display::computed_value as display; -use restyle_hints::{RESTYLE_CSS_ANIMATIONS, RESTYLE_CSS_TRANSITIONS, RestyleHint}; +use restyle_hints::{RESTYLE_CSS_ANIMATIONS, RESTYLE_CSS_TRANSITIONS, RestyleReplacements}; use restyle_hints::{RESTYLE_STYLE_ATTRIBUTE, RESTYLE_SMIL}; use rule_tree::{CascadeLevel, RuleTree, StrongRuleNode}; use selector_parser::{PseudoElement, RestyleDamage, SelectorImpl}; @@ -51,6 +52,34 @@ fn relations_are_shareable(relations: &StyleRelations) -> bool { AFFECTED_BY_PRESENTATIONAL_HINTS) } +/// Represents the result of comparing an element's old and new style. +pub struct StyleDifference { + /// The resulting damage. + pub damage: RestyleDamage, + + /// Whether any styles changed. + pub change: StyleChange, +} + +impl StyleDifference { + /// Creates a new `StyleDifference`. + pub fn new(damage: RestyleDamage, change: StyleChange) -> Self { + StyleDifference { + change: change, + damage: damage, + } + } +} + +/// Represents whether or not the style of an element has changed. +#[derive(Copy, Clone)] +pub enum StyleChange { + /// The style hasn't changed. + Unchanged, + /// The style has changed. + Changed, +} + /// Information regarding a style sharing candidate. /// /// Note that this information is stored in TLS and cleared after the traversal, @@ -375,8 +404,37 @@ pub enum StyleSharingResult { /// We didn't find anybody to share the style with. CannotShare, /// The node's style can be shared. The integer specifies the index in the - /// LRU cache that was hit and the damage that was done. - StyleWasShared(usize), + /// LRU cache that was hit and the damage that was done. The + /// `ChildCascadeRequirement` indicates whether style changes due to using + /// the shared style mean we need to recascade to children. + StyleWasShared(usize, ChildCascadeRequirement), +} + +/// Whether or not newly computed values for an element need to be cascade +/// to children. +pub enum ChildCascadeRequirement { + /// Old and new computed values were the same, or we otherwise know that + /// we won't bother recomputing style for children, so we can skip cascading + /// the new values into child elements. + CanSkipCascade, + /// Old and new computed values were different, so we must cascade the + /// new values to children. + /// + /// FIXME(heycam) Although this is "must" cascade, in the future we should + /// track whether child elements rely specifically on inheriting particular + /// property values. When we do that, we can treat `MustCascade` as "must + /// cascade unless we know that changes to these properties can be + /// ignored". + MustCascade, +} + +impl From for ChildCascadeRequirement { + fn from(change: StyleChange) -> ChildCascadeRequirement { + match change { + StyleChange::Unchanged => ChildCascadeRequirement::CanSkipCascade, + StyleChange::Changed => ChildCascadeRequirement::MustCascade, + } + } } /// The result status for match primary rules. @@ -570,7 +628,8 @@ trait PrivateMatchMethods: TElement { fn cascade_primary(&self, context: &mut StyleContext, data: &mut ElementData, - important_rules_changed: bool) { + important_rules_changed: bool) + -> ChildCascadeRequirement { // Collect some values. let (mut styles, restyle) = data.styles_and_restyle_mut(); let mut primary_style = &mut styles.primary; @@ -589,16 +648,19 @@ trait PrivateMatchMethods: TElement { important_rules_changed); } - if let Some(old) = old_values { + let child_cascade_requirement = self.accumulate_damage(&context.shared, - restyle.unwrap(), - &old, + restyle, + old_values.as_ref().map(|v| v.as_ref()), &new_values, None); - } // Set the new computed values. primary_style.values = Some(new_values); + + // Return whether the damage indicates we must cascade new inherited + // values into children. + child_cascade_requirement } fn cascade_eager_pseudo(&self, @@ -613,17 +675,11 @@ trait PrivateMatchMethods: TElement { let new_values = self.cascade_internal(context, &styles.primary, Some(pseudo_style)); - if let Some(old) = old_values { - // ::before and ::after are element-backed in Gecko, so they do - // the damage calculation for themselves. - if cfg!(feature = "servo") || !pseudo.is_before_or_after() { - self.accumulate_damage(&context.shared, - restyle.unwrap(), - &old, - &new_values, - Some(pseudo)); - } - } + self.accumulate_damage(&context.shared, + restyle, + old_values.as_ref().map(|v| &**v), + &new_values, + Some(pseudo)); pseudo_style.values = Some(new_values) } @@ -782,54 +838,89 @@ trait PrivateMatchMethods: TElement { } } - /// Computes and applies non-redundant damage. - #[cfg(feature = "gecko")] + /// Computes and applies restyle damage. fn accumulate_damage(&self, shared_context: &SharedStyleContext, - restyle: &mut RestyleData, - old_values: &ComputedValues, + restyle: Option<&mut RestyleData>, + old_values: Option<&ComputedValues>, new_values: &Arc, - pseudo: Option<&PseudoElement>) { + pseudo: Option<&PseudoElement>) + -> ChildCascadeRequirement { + let restyle = match restyle { + Some(r) => r, + None => return ChildCascadeRequirement::MustCascade, + }; + + let old_values = match old_values { + Some(v) => v, + None => return ChildCascadeRequirement::MustCascade, + }; + + // ::before and ::after are element-backed in Gecko, so they do the + // damage calculation for themselves, when there's an actual pseudo. + let is_existing_before_or_after = + cfg!(feature = "gecko") && + pseudo.map_or(false, |p| p.is_before_or_after()) && + self.existing_style_for_restyle_damage(old_values, pseudo) + .is_some(); + + if is_existing_before_or_after { + return ChildCascadeRequirement::CanSkipCascade; + } + + self.accumulate_damage_for(shared_context, + restyle, + old_values, + new_values, + pseudo) + } + + /// Computes and applies non-redundant damage. + #[cfg(feature = "gecko")] + fn accumulate_damage_for(&self, + shared_context: &SharedStyleContext, + restyle: &mut RestyleData, + old_values: &ComputedValues, + new_values: &Arc, + pseudo: Option<&PseudoElement>) + -> ChildCascadeRequirement { // Don't accumulate damage if we're in a restyle for reconstruction. if shared_context.traversal_flags.for_reconstruct() { - return; + return ChildCascadeRequirement::MustCascade; } // If an ancestor is already getting reconstructed by Gecko's top-down - // frame constructor, no need to apply damage. - if restyle.damage_handled.contains(RestyleDamage::reconstruct()) { - restyle.damage = RestyleDamage::empty(); - return; - } - - // Add restyle damage, but only the bits that aren't redundant with respect - // to damage applied on our ancestors. + // frame constructor, no need to apply damage. Similarly if we already + // have an explicitly stored ReconstructFrame hint. // // See https://bugzilla.mozilla.org/show_bug.cgi?id=1301258#c12 // for followup work to make the optimization here more optimal by considering // each bit individually. - if !restyle.damage.contains(RestyleDamage::reconstruct()) { - let new_damage = self.compute_restyle_damage(&old_values, - &new_values, - pseudo); - if !restyle.damage_handled.contains(new_damage) { - restyle.damage |= new_damage; - } + let skip_applying_damage = + restyle.damage_handled.contains(RestyleDamage::reconstruct()) || + restyle.damage.contains(RestyleDamage::reconstruct()); + + let difference = self.compute_style_difference(&old_values, + &new_values, + pseudo); + if !skip_applying_damage { + restyle.damage |= difference.damage; } + difference.change.into() } /// Computes and applies restyle damage unless we've already maxed it out. #[cfg(feature = "servo")] - fn accumulate_damage(&self, - _shared_context: &SharedStyleContext, - restyle: &mut RestyleData, - old_values: &ComputedValues, - new_values: &Arc, - pseudo: Option<&PseudoElement>) { - if restyle.damage != RestyleDamage::rebuild_and_reflow() { - restyle.damage |= - self.compute_restyle_damage(&old_values, &new_values, pseudo); - } + fn accumulate_damage_for(&self, + _shared_context: &SharedStyleContext, + restyle: &mut RestyleData, + old_values: &ComputedValues, + new_values: &Arc, + pseudo: Option<&PseudoElement>) + -> ChildCascadeRequirement { + let difference = self.compute_style_difference(&old_values, &new_values, pseudo); + restyle.damage |= difference.damage; + difference.change.into() } #[cfg(feature = "servo")] @@ -917,14 +1008,19 @@ pub trait MatchMethods : TElement { fn match_and_cascade(&self, context: &mut StyleContext, data: &mut ElementData, - sharing: StyleSharingBehavior) + sharing: StyleSharingBehavior) -> ChildCascadeRequirement { // Perform selector matching for the primary style. let mut relations = StyleRelations::empty(); let result = self.match_primary(context, data, &mut relations); // Cascade properties and compute primary values. - self.cascade_primary(context, data, result.important_rules_overriding_animation_changed); + let child_cascade_requirement = + self.cascade_primary( + context, + data, + result.important_rules_overriding_animation_changed + ); // Match and cascade eager pseudo-elements. if !data.styles().is_display_none() { @@ -957,6 +1053,8 @@ pub trait MatchMethods : TElement { relations, revalidation_match_results); } + + child_cascade_requirement } /// Performs the cascade, without matching. @@ -964,9 +1062,12 @@ pub trait MatchMethods : TElement { context: &mut StyleContext, mut data: &mut ElementData, important_rules_changed: bool) + -> ChildCascadeRequirement { - self.cascade_primary(context, &mut data, important_rules_changed); + let child_cascade_requirement = + self.cascade_primary(context, &mut data, important_rules_changed); self.cascade_pseudos(context, &mut data); + child_cascade_requirement } /// Runs selector matching to (re)compute the primary rule node for this element. @@ -1063,10 +1164,22 @@ pub trait MatchMethods : TElement { &mut applicable_declarations, &context.shared.guards); - let important_rules_changed = self.has_animations() && - data.has_styles() && - data.important_rules_are_different(&primary_rule_node, - &context.shared.guards); + if log_enabled!(Trace) { + trace!("Matched rules:"); + for rn in primary_rule_node.self_and_ancestors() { + if let Some(source) = rn.style_source() { + trace!(" > {:?}", source); + } + } + } + + let important_rules_changed = + self.has_animations() && + data.has_styles() && + data.important_rules_are_different( + &primary_rule_node, + &context.shared.guards + ); RulesMatchedResult { rule_nodes_changed: data.set_primary_rules(primary_rule_node), @@ -1214,7 +1327,7 @@ pub trait MatchMethods : TElement { /// the rule tree. Returns RulesChanged which indicates whether the rule nodes changed /// and whether the important rules changed. fn replace_rules(&self, - hint: RestyleHint, + replacements: RestyleReplacements, context: &StyleContext, data: &mut AtomicRefMut) -> RulesChanged { @@ -1246,10 +1359,10 @@ pub trait MatchMethods : TElement { // // Non-animation restyle hints will be processed in a subsequent // normal traversal. - if hint.intersects(RestyleHint::for_animations()) { + if replacements.intersects(RestyleReplacements::for_animations()) { debug_assert!(context.shared.traversal_flags.for_animation_only()); - if hint.contains(RESTYLE_SMIL) { + if replacements.contains(RESTYLE_SMIL) { replace_rule_node(CascadeLevel::SMILOverride, self.get_smil_override(), primary_rules); @@ -1265,16 +1378,16 @@ pub trait MatchMethods : TElement { // Apply Transition rules and Animation rules if the corresponding restyle hint // is contained. - if hint.contains(RESTYLE_CSS_TRANSITIONS) { + if replacements.contains(RESTYLE_CSS_TRANSITIONS) { replace_rule_node_for_animation(CascadeLevel::Transitions, primary_rules); } - if hint.contains(RESTYLE_CSS_ANIMATIONS) { + if replacements.contains(RESTYLE_CSS_ANIMATIONS) { replace_rule_node_for_animation(CascadeLevel::Animations, primary_rules); } - } else if hint.contains(RESTYLE_STYLE_ATTRIBUTE) { + } else if replacements.contains(RESTYLE_STYLE_ATTRIBUTE) { let style_attribute = self.style_attribute(); replace_rule_node(CascadeLevel::StyleAttributeNormal, style_attribute, @@ -1342,11 +1455,12 @@ pub trait MatchMethods : TElement { debug_assert_eq!(data.has_styles(), data.has_restyle()); let old_values = data.get_styles_mut() .and_then(|s| s.primary.values.take()); - if let Some(old) = old_values { + let child_cascade_requirement = self.accumulate_damage(&context.shared, - data.restyle_mut(), &old, - shared_style.values(), None); - } + data.get_restyle_mut(), + old_values.as_ref().map(|v| v.as_ref()), + shared_style.values(), + None); // We never put elements with pseudo style into the style // sharing cache, so we can just mint an ElementStyles @@ -1356,7 +1470,7 @@ pub trait MatchMethods : TElement { let styles = ElementStyles::new(shared_style); data.set_styles(styles); - return StyleSharingResult::StyleWasShared(i) + return StyleSharingResult::StyleWasShared(i, child_cascade_requirement) } Err(miss) => { debug!("Cache miss: {:?}", miss); @@ -1391,32 +1505,51 @@ pub trait MatchMethods : TElement { /// Given the old and new style of this element, and whether it's a /// pseudo-element, compute the restyle damage used to determine which /// kind of layout or painting operations we'll need. - fn compute_restyle_damage(&self, - old_values: &ComputedValues, - new_values: &Arc, - pseudo: Option<&PseudoElement>) - -> RestyleDamage + fn compute_style_difference(&self, + old_values: &ComputedValues, + new_values: &Arc, + pseudo: Option<&PseudoElement>) + -> StyleDifference { - match self.existing_style_for_restyle_damage(old_values, pseudo) { - Some(ref source) => RestyleDamage::compute(source, new_values), - None => { - // If there's no style source, that likely means that Gecko - // couldn't find a style context. This happens with display:none - // elements, and probably a number of other edge cases that - // we don't handle well yet (like display:contents). - if new_values.get_box().clone_display() == display::T::none && - old_values.get_box().clone_display() == display::T::none { - // The style remains display:none. No need for damage. - RestyleDamage::empty() - } else { - // Something else. Be conservative for now. - RestyleDamage::reconstruct() - } - } + if let Some(source) = self.existing_style_for_restyle_damage(old_values, pseudo) { + return RestyleDamage::compute_style_difference(source, new_values) } + + let new_style_is_display_none = + new_values.get_box().clone_display() == display::T::none; + let old_style_is_display_none = + old_values.get_box().clone_display() == display::T::none; + + // If there's no style source, that likely means that Gecko couldn't + // find a style context. + // + // This happens with display:none elements, and not-yet-existing + // pseudo-elements. + if new_style_is_display_none && old_style_is_display_none { + // The style remains display:none. No need for damage. + return StyleDifference::new(RestyleDamage::empty(), StyleChange::Unchanged) + } + + if pseudo.map_or(false, |p| p.is_before_or_after()) { + if (old_style_is_display_none || + old_values.ineffective_content_property()) && + (new_style_is_display_none || + new_values.ineffective_content_property()) { + // The pseudo-element will remain undisplayed, so just avoid + // triggering any change. + return StyleDifference::new(RestyleDamage::empty(), StyleChange::Unchanged) + } + return StyleDifference::new(RestyleDamage::reconstruct(), StyleChange::Changed) + } + + // Something else. Be conservative for now. + warn!("Reframing due to lack of old style source: {:?}, pseudo: {:?}", + self, pseudo); + // Something else. Be conservative for now. + StyleDifference::new(RestyleDamage::reconstruct(), StyleChange::Changed) } - /// Cascade the eager pseudo-elements of this element. + /// Performs the cascade for the element's eager pseudos. fn cascade_pseudos(&self, context: &mut StyleContext, mut data: &mut ElementData) diff --git a/servo/components/style/properties/gecko.mako.rs b/servo/components/style/properties/gecko.mako.rs index 8ac9bfd3861f..0736d34e97e0 100644 --- a/servo/components/style/properties/gecko.mako.rs +++ b/servo/components/style/properties/gecko.mako.rs @@ -141,6 +141,13 @@ impl ComputedValues { self.get_box().clone_display() == longhands::display::computed_value::T::contents } + /// Returns true if the value of the `content` property would make a + /// pseudo-element not rendered. + #[inline] + pub fn ineffective_content_property(&self) -> bool { + self.get_counters().ineffective_content_property() + } + % for style_struct in data.style_structs: #[inline] pub fn clone_${style_struct.name_lower}(&self) -> Arc { @@ -4204,6 +4211,10 @@ clip-path <%self:impl_trait style_struct_name="Counters" skip_longhands="content counter-increment counter-reset"> + pub fn ineffective_content_property(&self) -> bool { + self.gecko.mContents.is_empty() + } + pub fn set_content(&mut self, v: longhands::content::computed_value::T) { use properties::longhands::content::computed_value::T; use properties::longhands::content::computed_value::ContentItem; diff --git a/servo/components/style/properties/properties.mako.rs b/servo/components/style/properties/properties.mako.rs index 47022d30a6a1..0f4ee1b6843b 100644 --- a/servo/components/style/properties/properties.mako.rs +++ b/servo/components/style/properties/properties.mako.rs @@ -1813,6 +1813,19 @@ impl ComputedValues { /// Since this isn't supported in Servo, this is always false for Servo. pub fn is_display_contents(&self) -> bool { false } + #[inline] + /// Returns whether the "content" property for the given style is completely + /// ineffective, and would yield an empty `::before` or `::after` + /// pseudo-element. + pub fn ineffective_content_property(&self) -> bool { + use properties::longhands::content::computed_value::T; + match self.get_counters().content { + T::normal | + T::none => true, + T::Content(ref items) => items.is_empty(), + } + } + /// Whether the current style is multicolumn. #[inline] pub fn is_multicol(&self) -> bool { diff --git a/servo/components/style/restyle_hints.rs b/servo/components/style/restyle_hints.rs index 73bd39ec1b38..913141f8dd0f 100644 --- a/servo/components/style/restyle_hints.rs +++ b/servo/components/style/restyle_hints.rs @@ -26,34 +26,38 @@ use smallvec::SmallVec; use std::borrow::Borrow; use std::cell::Cell; use std::clone::Clone; +use std::cmp; use stylist::SelectorMap; +/// When the ElementState of an element (like IN_HOVER_STATE) changes, +/// certain pseudo-classes (like :hover) may require us to restyle that +/// element, its siblings, and/or its descendants. Similarly, when various +/// attributes of an element change, we may also need to restyle things with +/// id, class, and attribute selectors. Doing this conservatively is +/// expensive, and so we use RestyleHints to short-circuit work we know is +/// unnecessary. +#[derive(Debug, Clone, PartialEq)] +pub struct RestyleHint { + /// Depths at which selector matching must be re-run. + match_under_self: RestyleDepths, + + /// Rerun selector matching on all later siblings of the element and all + /// of their descendants. + match_later_siblings: bool, + + /// Levels of the cascade whose rule nodes should be recomputed and + /// replaced. + pub replacements: RestyleReplacements, +} + bitflags! { - /// When the ElementState of an element (like IN_HOVER_STATE) changes, - /// certain pseudo-classes (like :hover) may require us to restyle that - /// element, its siblings, and/or its descendants. Similarly, when various - /// attributes of an element change, we may also need to restyle things with - /// id, class, and attribute selectors. Doing this conservatively is - /// expensive, and so we use RestyleHints to short-circuit work we know is - /// unnecessary. + /// Cascade levels that can be updated for an element by simply replacing + /// their rule node. /// /// Note that the bit values here must be kept in sync with the Gecko /// nsRestyleHint values. If you add more bits with matching values, /// please add assertions to assert_restyle_hints_match below. - pub flags RestyleHint: u32 { - /// Rerun selector matching on the element. - const RESTYLE_SELF = 0x01, - - /// Rerun selector matching on all of the element's descendants. - /// - /// NB: In Gecko, we have RESTYLE_SUBTREE which is inclusive of self, - /// but heycam isn't aware of a good reason for that. - const RESTYLE_DESCENDANTS = 0x04, - - /// Rerun selector matching on all later siblings of the element and all - /// of their descendants. - const RESTYLE_LATER_SIBLINGS = 0x08, - + pub flags RestyleReplacements: u8 { /// Replace the style data coming from CSS transitions without updating /// any other style data. This hint is only processed in animation-only /// traversal which is prior to normal traversal. @@ -76,7 +80,82 @@ bitflags! { } } -/// Asserts that all RestyleHint flags have a matching nsRestyleHint value. +/// Eight bit wide bitfield representing depths of a DOM subtree's descendants, +/// used to represent which elements must have selector matching re-run on them. +/// +/// The least significant bit indicates that selector matching must be re-run +/// for the element itself, the second least significant bit for the element's +/// children, the third its grandchildren, and so on. If the most significant +/// bit it set, it indicates that that selector matching must be re-run for +/// elements at that depth and all of their descendants. +#[derive(Debug, Clone, Copy, PartialEq)] +struct RestyleDepths(u8); + +impl RestyleDepths { + /// Returns a `RestyleDepths` representing no element depths. + fn empty() -> Self { + RestyleDepths(0) + } + + /// Returns a `RestyleDepths` representing the current element depth. + fn for_self() -> Self { + RestyleDepths(0x01) + } + + /// Returns a `RestyleDepths` representing the depths of all descendants of + /// the current element. + fn for_descendants() -> Self { + RestyleDepths(0xfe) + } + + /// Returns a `RestyleDepths` representing the current element depth and the + /// depths of all the current element's descendants. + fn for_self_and_descendants() -> Self { + RestyleDepths(0xff) + } + + /// Returns a `RestyleDepths` representing the specified depth, where zero + /// is the current element depth, one is its children's depths, etc. + fn for_depth(depth: u32) -> Self { + RestyleDepths(1u8 << cmp::min(depth, 7)) + } + + /// Returns whether this `RestyleDepths` represents the current element + /// depth and the depths of all the current element's descendants. + fn is_self_and_descendants(&self) -> bool { + self.0 == 0xff + } + + /// Returns whether this `RestyleDepths` includes any element depth. + fn is_any(&self) -> bool { + self.0 != 0 + } + + /// Returns whether this `RestyleDepths` includes the current element depth. + fn has_self(&self) -> bool { + (self.0 & 0x01) != 0 + } + + /// Returns a new `RestyleDepths` with all depth values represented by this + /// `RestyleDepths` reduced by one. + fn propagate(&self) -> Self { + RestyleDepths((self.0 >> 1) | (self.0 & 0x80)) + } + + /// Returns a new `RestyleDepths` that represents the union of the depths + /// from `self` and `other`. + fn insert(&mut self, other: RestyleDepths) { + self.0 |= other.0; + } + + /// Returns whether this `RestyleDepths` includes all depths represented + /// by `other`. + fn contains(&self, other: RestyleDepths) -> bool { + (self.0 & other.0) == other.0 + } +} + +/// Asserts that all RestyleReplacements have a matching nsRestyleHint value. #[cfg(feature = "gecko")] #[inline] pub fn assert_restyle_hints_match() { @@ -85,24 +164,18 @@ pub fn assert_restyle_hints_match() { macro_rules! check_restyle_hints { ( $( $a:ident => $b:ident ),*, ) => { if cfg!(debug_assertions) { - let mut hints = RestyleHint::all(); + let mut replacements = RestyleReplacements::all(); $( assert_eq!(structs::$a.0 as usize, $b.bits() as usize, stringify!($b)); - hints.remove($b); + replacements.remove($b); )* - assert_eq!(hints, RestyleHint::empty(), "all RestyleHint bits should have an assertion"); + assert_eq!(replacements, RestyleReplacements::empty(), + "all RestyleReplacements bits should have an assertion"); } } } check_restyle_hints! { - nsRestyleHint_eRestyle_Self => RESTYLE_SELF, - // Note that eRestyle_Subtree means "self and descendants", while - // RESTYLE_DESCENDANTS means descendants only. The From impl - // below handles converting eRestyle_Subtree into - // (RESTYLE_SELF | RESTYLE_DESCENDANTS). - nsRestyleHint_eRestyle_Subtree => RESTYLE_DESCENDANTS, - nsRestyleHint_eRestyle_LaterSiblings => RESTYLE_LATER_SIBLINGS, nsRestyleHint_eRestyle_CSSTransitions => RESTYLE_CSS_TRANSITIONS, nsRestyleHint_eRestyle_CSSAnimations => RESTYLE_CSS_ANIMATIONS, nsRestyleHint_eRestyle_StyleAttribute => RESTYLE_STYLE_ATTRIBUTE, @@ -111,39 +184,233 @@ pub fn assert_restyle_hints_match() { } impl RestyleHint { - /// The subset hints that affect the styling of a single element during the - /// traversal. + /// Creates a new, empty `RestyleHint`, which represents no restyling work + /// needs to be done. #[inline] - pub fn for_self() -> Self { - RESTYLE_SELF | RESTYLE_STYLE_ATTRIBUTE | Self::for_animations() + pub fn empty() -> Self { + RestyleHint { + match_under_self: RestyleDepths::empty(), + match_later_siblings: false, + replacements: RestyleReplacements::empty(), + } } - /// The subset hints that are used for animation restyle. + /// Creates a new `RestyleHint` that indicates selector matching must be + /// re-run on the element. + #[inline] + pub fn for_self() -> Self { + RestyleHint { + match_under_self: RestyleDepths::for_self(), + match_later_siblings: false, + replacements: RestyleReplacements::empty(), + } + } + + /// Creates a new `RestyleHint` that indicates selector matching must be + /// re-run on all of the element's descendants. + #[inline] + pub fn descendants() -> Self { + RestyleHint { + match_under_self: RestyleDepths::for_descendants(), + match_later_siblings: false, + replacements: RestyleReplacements::empty(), + } + } + + /// Creates a new `RestyleHint` that indicates selector matching must be + /// re-run on the descendants of element at the specified depth, where 0 + /// indicates the element itself, 1 is its children, 2 its grandchildren, + /// etc. + #[inline] + pub fn descendants_at_depth(depth: u32) -> Self { + RestyleHint { + match_under_self: RestyleDepths::for_depth(depth), + match_later_siblings: false, + replacements: RestyleReplacements::empty(), + } + } + + /// Creates a new `RestyleHint` that indicates selector matching must be + /// re-run on all of the element's later siblings and their descendants. + #[inline] + pub fn later_siblings() -> Self { + RestyleHint { + match_under_self: RestyleDepths::empty(), + match_later_siblings: true, + replacements: RestyleReplacements::empty(), + } + } + + /// Creates a new `RestyleHint` that indicates selector matching must be + /// re-run on the element and all of its descendants. + #[inline] + pub fn subtree() -> Self { + RestyleHint { + match_under_self: RestyleDepths::for_self_and_descendants(), + match_later_siblings: false, + replacements: RestyleReplacements::empty(), + } + } + + /// Creates a new `RestyleHint` that indicates selector matching must be + /// re-run on the element, its descendants, its later siblings, and + /// their descendants. + #[inline] + pub fn subtree_and_later_siblings() -> Self { + RestyleHint { + match_under_self: RestyleDepths::for_self_and_descendants(), + match_later_siblings: true, + replacements: RestyleReplacements::empty(), + } + } + + /// Creates a new `RestyleHint` that indicates the specified rule node + /// replacements must be performed on the element. + #[inline] + pub fn for_replacements(replacements: RestyleReplacements) -> Self { + RestyleHint { + match_under_self: RestyleDepths::empty(), + match_later_siblings: false, + replacements: replacements, + } + } + + /// Returns whether this `RestyleHint` represents no needed restyle work. + #[inline] + pub fn is_empty(&self) -> bool { + *self == RestyleHint::empty() + } + + /// Returns whether this `RestyleHint` represents the maximum possible + /// restyle work, and thus any `insert()` calls will have no effect. + #[inline] + pub fn is_maximum(&self) -> bool { + self.match_under_self.is_self_and_descendants() && + self.match_later_siblings && + self.replacements.is_all() + } + + /// Returns whether the hint specifies that some work must be performed on + /// the current element. + #[inline] + pub fn affects_self(&self) -> bool { + self.match_self() || !self.replacements.is_empty() + } + + /// Returns whether the hint specifies that later siblings must be restyled. + #[inline] + pub fn affects_later_siblings(&self) -> bool { + self.match_later_siblings + } + + /// Returns whether the hint specifies that an animation cascade level must + /// be replaced. + #[inline] + pub fn has_animation_hint(&self) -> bool { + self.replacements.intersects(RestyleReplacements::for_animations()) + } + + /// Returns whether the hint specifies some restyle work other than an + /// animation cascade level replacement. + #[inline] + pub fn has_non_animation_hint(&self) -> bool { + self.match_under_self.is_any() || self.match_later_siblings || + self.replacements.contains(RESTYLE_STYLE_ATTRIBUTE) + } + + /// Returns whether the hint specifies that selector matching must be re-run + /// for the element. + #[inline] + pub fn match_self(&self) -> bool { + self.match_under_self.has_self() + } + + /// Returns a new `RestyleHint` appropriate for children of the current + /// element. + #[inline] + pub fn propagate_for_non_animation_restyle(&self) -> Self { + RestyleHint { + match_under_self: self.match_under_self.propagate(), + match_later_siblings: false, + replacements: RestyleReplacements::empty(), + } + } + + /// Removes all of the animation-related hints. + #[inline] + pub fn remove_animation_hints(&mut self) { + self.replacements.remove(RestyleReplacements::for_animations()); + } + + /// Removes the later siblings hint, and returns whether it was present. + pub fn remove_later_siblings_hint(&mut self) -> bool { + let later_siblings = self.match_later_siblings; + self.match_later_siblings = false; + later_siblings + } + + /// Unions the specified `RestyleHint` into this one. + #[inline] + pub fn insert_from(&mut self, other: &Self) { + self.match_under_self.insert(other.match_under_self); + self.match_later_siblings |= other.match_later_siblings; + self.replacements.insert(other.replacements); + } + + /// Unions the specified `RestyleHint` into this one. + #[inline] + pub fn insert(&mut self, other: Self) { + // A later patch should make it worthwhile to have an insert() function + // that consumes its argument. + self.insert_from(&other) + } + + /// Returns whether this `RestyleHint` represents at least as much restyle + /// work as the specified one. + #[inline] + pub fn contains(&mut self, other: &Self) -> bool { + self.match_under_self.contains(other.match_under_self) && + (self.match_later_siblings & other.match_later_siblings) == other.match_later_siblings && + self.replacements.contains(other.replacements) + } +} + +impl RestyleReplacements { + /// The replacements for the animation cascade levels. #[inline] pub fn for_animations() -> Self { RESTYLE_SMIL | RESTYLE_CSS_ANIMATIONS | RESTYLE_CSS_TRANSITIONS } } +#[cfg(feature = "gecko")] +impl From for RestyleReplacements { + fn from(raw: nsRestyleHint) -> Self { + Self::from_bits_truncate(raw.0 as u8) + } +} + #[cfg(feature = "gecko")] impl From for RestyleHint { fn from(raw: nsRestyleHint) -> Self { - let raw_bits: u32 = raw.0; + use gecko_bindings::structs::nsRestyleHint_eRestyle_LaterSiblings as eRestyle_LaterSiblings; + use gecko_bindings::structs::nsRestyleHint_eRestyle_Self as eRestyle_Self; + use gecko_bindings::structs::nsRestyleHint_eRestyle_SomeDescendants as eRestyle_SomeDescendants; + use gecko_bindings::structs::nsRestyleHint_eRestyle_Subtree as eRestyle_Subtree; - // FIXME(bholley): Finish aligning the binary representations here and - // then .expect() the result of the checked version. - if Self::from_bits(raw_bits).is_none() { - warn!("stylo: dropping unsupported restyle hint bits"); + let mut match_under_self = RestyleDepths::empty(); + if (raw.0 & (eRestyle_Self.0 | eRestyle_Subtree.0)) != 0 { + match_under_self.insert(RestyleDepths::for_self()); + } + if (raw.0 & (eRestyle_Subtree.0 | eRestyle_SomeDescendants.0)) != 0 { + match_under_self.insert(RestyleDepths::for_descendants()); } - let mut bits = Self::from_bits_truncate(raw_bits); - - // eRestyle_Subtree converts to (RESTYLE_SELF | RESTYLE_DESCENDANTS). - if bits.contains(RESTYLE_DESCENDANTS) { - bits |= RESTYLE_SELF; + RestyleHint { + match_under_self: match_under_self, + match_later_siblings: (raw.0 & eRestyle_LaterSiblings.0) != 0, + replacements: raw.into(), } - - bits } } @@ -435,21 +702,6 @@ fn is_attr_selector(sel: &Component) -> bool { } } -fn combinator_to_restyle_hint(combinator: Option) -> RestyleHint { - match combinator { - None => RESTYLE_SELF, - Some(c) => match c { - // NB: RESTYLE_SELF is needed to handle properly eager pseudos, - // otherwise we may leave a stale style on the parent. - Combinator::PseudoElement => RESTYLE_SELF | RESTYLE_DESCENDANTS, - Combinator::Child => RESTYLE_DESCENDANTS, - Combinator::Descendant => RESTYLE_DESCENDANTS, - Combinator::NextSibling => RESTYLE_LATER_SIBLINGS, - Combinator::LaterSibling => RESTYLE_LATER_SIBLINGS, - } - } -} - #[derive(Clone, Debug)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] /// The aspects of an selector which are sensitive. @@ -579,6 +831,8 @@ impl DependencySet { let mut combinator = None; let mut iter = selector.inner.complex.iter(); let mut index = 0; + let mut child_combinators_seen = 0; + let mut saw_descendant_combinator = false; loop { let sequence_start = index; @@ -596,9 +850,34 @@ impl DependencySet { index += 1; // Account for the simple selector. } + // Keep track of how many child combinators we've encountered, + // and whether we've encountered a descendant combinator at all. + match combinator { + Some(Combinator::Child) => child_combinators_seen += 1, + Some(Combinator::Descendant) => saw_descendant_combinator = true, + _ => {} + } + // If we found a sensitivity, add an entry in the dependency set. if !visitor.sensitivities.is_empty() { - let hint = combinator_to_restyle_hint(combinator); + // Compute a RestyleHint given the current combinator and the + // tracked number of child combinators and presence of a + // descendant combinator. + let hint = match combinator { + // NB: RestyleHint::subtree() and not + // RestyleHint::descendants() is needed to handle properly + // eager pseudos, otherwise we may leave a stale style on + // the parent. + Some(Combinator::PseudoElement) => RestyleHint::subtree(), + Some(Combinator::Child) if !saw_descendant_combinator => { + RestyleHint::descendants_at_depth(child_combinators_seen) + } + Some(Combinator::Child) | + Some(Combinator::Descendant) => RestyleHint::descendants(), + Some(Combinator::NextSibling) | + Some(Combinator::LaterSibling) => RestyleHint::later_siblings(), + None => RestyleHint::for_self(), + }; let dep_selector = if sequence_start == 0 { // Reuse the bloom hashes if this is the base selector. @@ -700,7 +979,7 @@ impl DependencySet { return true; } - if hint.contains(dep.hint) { + if hint.contains(&dep.hint) { trace!(" > hint was already there"); return true; } @@ -717,10 +996,10 @@ impl DependencySet { &mut matching_context, &mut |_, _| {}); if matched_then != matches_now { - hint.insert(dep.hint); + hint.insert_from(&dep.hint); } - !hint.is_all() + !hint.is_maximum() }); debug!("Calculated restyle hint: {:?} for {:?}. (State={:?}, {} Deps)", diff --git a/servo/components/style/servo/restyle_damage.rs b/servo/components/style/servo/restyle_damage.rs index 69199d6e9820..59a03a3f085a 100644 --- a/servo/components/style/servo/restyle_damage.rs +++ b/servo/components/style/servo/restyle_damage.rs @@ -9,6 +9,7 @@ use computed_values::display; use heapsize::HeapSizeOf; +use matching::{StyleChange, StyleDifference}; use properties::ServoComputedValues; use std::fmt; @@ -57,12 +58,14 @@ impl HeapSizeOf for ServoRestyleDamage { } impl ServoRestyleDamage { - /// Compute the appropriate restyle damage for a given style change between - /// `old` and `new`. - pub fn compute(old: &ServoComputedValues, - new: &ServoComputedValues) - -> ServoRestyleDamage { - compute_damage(old, new) + /// Compute the `StyleDifference` (including the appropriate restyle damage) + /// for a given style change between `old` and `new`. + pub fn compute_style_difference(old: &ServoComputedValues, + new: &ServoComputedValues) + -> StyleDifference { + let damage = compute_damage(old, new); + let change = if damage.is_empty() { StyleChange::Unchanged } else { StyleChange::Changed }; + StyleDifference::new(damage, change) } /// Returns a bitmask that represents a flow that needs to be rebuilt and diff --git a/servo/components/style/traversal.rs b/servo/components/style/traversal.rs index d91b81149fb2..542c5611f9be 100644 --- a/servo/components/style/traversal.rs +++ b/servo/components/style/traversal.rs @@ -8,8 +8,8 @@ use atomic_refcell::{AtomicRefCell, AtomicRefMut}; use context::{SharedStyleContext, StyleContext, ThreadLocalStyleContext}; use data::{ElementData, ElementStyles, StoredRestyleHint}; use dom::{DirtyDescendants, NodeInfo, OpaqueNode, TElement, TNode}; -use matching::{MatchMethods, StyleSharingBehavior}; -use restyle_hints::{RESTYLE_DESCENDANTS, RESTYLE_SELF}; +use matching::{ChildCascadeRequirement, MatchMethods, StyleSharingBehavior}; +use restyle_hints::RestyleHint; use selector_parser::RestyleDamage; #[cfg(feature = "servo")] use servo_config::opts; use std::borrow::BorrowMut; @@ -232,7 +232,7 @@ pub trait DomTraversal : Sync { if let Some(next) = root.next_sibling_element() { if let Some(mut next_data) = next.mutate_data() { let hint = StoredRestyleHint::subtree_and_later_siblings(); - next_data.ensure_restyle().hint.insert(&hint); + next_data.ensure_restyle().hint.insert(hint); } } } @@ -611,7 +611,12 @@ pub fn recalc_style_at(traversal: &D, // Compute style for this element if necessary. if compute_self { - compute_style(traversal, traversal_data, context, element, &mut data); + match compute_style(traversal, traversal_data, context, element, &mut data) { + ChildCascadeRequirement::MustCascade => { + inherited_style_changed = true; + } + ChildCascadeRequirement::CanSkipCascade => {} + }; // If we're restyling this element to display:none, throw away all style // data in the subtree, notify the caller to early-return. @@ -620,9 +625,6 @@ pub fn recalc_style_at(traversal: &D, element); clear_descendant_data(element, &|e| unsafe { D::clear_element_data(&e) }); } - - // FIXME(bholley): Compute this accurately from the call to CalcStyleDifference. - inherited_style_changed = true; } // Now that matching and cascading is done, clear the bits corresponding to @@ -711,7 +713,7 @@ fn compute_style(_traversal: &D, traversal_data: &PerLevelTraversalData, context: &mut StyleContext, element: E, - mut data: &mut AtomicRefMut) + mut data: &mut AtomicRefMut) -> ChildCascadeRequirement where E: TElement, D: DomTraversal, { @@ -727,10 +729,10 @@ fn compute_style(_traversal: &D, let sharing_result = unsafe { element.share_style_if_possible(context, &mut data) }; - if let StyleWasShared(index) = sharing_result { + if let StyleWasShared(index, had_damage) = sharing_result { context.thread_local.statistics.styles_shared += 1; context.thread_local.style_sharing_candidate_cache.touch(index); - return; + return had_damage; } } @@ -744,17 +746,28 @@ fn compute_style(_traversal: &D, context.thread_local.statistics.elements_matched += 1; // Perform the matching and cascading. - element.match_and_cascade(context, &mut data, StyleSharingBehavior::Allow); + element.match_and_cascade( + context, + &mut data, + StyleSharingBehavior::Allow + ) } - CascadeWithReplacements(hint) => { - let rules_changed = element.replace_rules(hint, context, &mut data); - element.cascade_primary_and_pseudos(context, &mut data, - rules_changed.important_rules_changed()); + CascadeWithReplacements(flags) => { + let rules_changed = element.replace_rules(flags, context, &mut data); + element.cascade_primary_and_pseudos( + context, + &mut data, + rules_changed.important_rules_changed() + ) } CascadeOnly => { - element.cascade_primary_and_pseudos(context, &mut data, false); + element.cascade_primary_and_pseudos( + context, + &mut data, + /* important_rules_changed = */ false + ) } - }; + } } fn preprocess_children(traversal: &D, @@ -806,11 +819,11 @@ fn preprocess_children(traversal: &D, // Propagate the parent and sibling restyle hint. if !propagated_hint.is_empty() { - restyle_data.hint.insert(&propagated_hint); + restyle_data.hint.insert_from(&propagated_hint); } if later_siblings { - propagated_hint.insert(&(RESTYLE_SELF | RESTYLE_DESCENDANTS).into()); + propagated_hint.insert(RestyleHint::subtree().into()); } // Store the damage already handled by ancestors. diff --git a/servo/ports/geckolib/glue.rs b/servo/ports/geckolib/glue.rs index a08068723f71..a78a43ef3955 100644 --- a/servo/ports/geckolib/glue.rs +++ b/servo/ports/geckolib/glue.rs @@ -2116,16 +2116,16 @@ pub extern "C" fn Servo_NoteExplicitHints(element: RawGeckoElementBorrowed, element, restyle_hint, change_hint); let restyle_hint: RestyleHint = restyle_hint.into(); - debug_assert!(RestyleHint::for_animations().contains(restyle_hint) || - !RestyleHint::for_animations().intersects(restyle_hint), + debug_assert!(!(restyle_hint.has_animation_hint() && + restyle_hint.has_non_animation_hint()), "Animation restyle hints should not appear with non-animation restyle hints"); let mut maybe_data = element.mutate_data(); let maybe_restyle_data = maybe_data.as_mut().and_then(|d| unsafe { - maybe_restyle(d, element, restyle_hint.intersects(RestyleHint::for_animations())) + maybe_restyle(d, element, restyle_hint.has_animation_hint()) }); if let Some(restyle_data) = maybe_restyle_data { - restyle_data.hint.insert(&restyle_hint.into()); + restyle_data.hint.insert(restyle_hint.into()); restyle_data.damage |= damage; } else { debug!("(Element not styled, discarding hints)"); From 9e1699e113e8f29a497c663d3db1170dce6abd9f Mon Sep 17 00:00:00 2001 From: Michael Kohler Date: Sun, 9 Apr 2017 12:48:14 +0200 Subject: [PATCH 35/56] Bug 1354884 - convert uses of 'defer' to 'new Promise' in client/webaudioeditor r=nchevobbe MozReview-Commit-ID: 6duPsVQYGnT --HG-- extra : rebase_source : 5bba12bfba5c838b58a840f52cdf2d6a367b0cc3 --- .../browser_wa_properties-view-media-nodes.js | 24 +-- devtools/client/webaudioeditor/test/head.js | 190 +++++++++--------- 2 files changed, 103 insertions(+), 111 deletions(-) diff --git a/devtools/client/webaudioeditor/test/browser_wa_properties-view-media-nodes.js b/devtools/client/webaudioeditor/test/browser_wa_properties-view-media-nodes.js index c1a916a1ff50..c4d98e70528d 100644 --- a/devtools/client/webaudioeditor/test/browser_wa_properties-view-media-nodes.js +++ b/devtools/client/webaudioeditor/test/browser_wa_properties-view-media-nodes.js @@ -18,20 +18,18 @@ function waitForDeviceClosed() { if (!webrtcUI.showGlobalIndicator) return Promise.resolve(); - let deferred = Promise.defer(); - - const message = "webrtc:UpdateGlobalIndicators"; - let ppmm = Cc["@mozilla.org/parentprocessmessagemanager;1"] - .getService(Ci.nsIMessageBroadcaster); - ppmm.addMessageListener(message, function listener(aMessage) { - info("Received " + message + " message"); - if (!aMessage.data.showGlobalIndicator) { - ppmm.removeMessageListener(message, listener); - deferred.resolve(); - } + return new Promise((resolve, reject) => { + const message = "webrtc:UpdateGlobalIndicators"; + let ppmm = Cc["@mozilla.org/parentprocessmessagemanager;1"] + .getService(Ci.nsIMessageBroadcaster); + ppmm.addMessageListener(message, function listener(aMessage) { + info("Received " + message + " message"); + if (!aMessage.data.showGlobalIndicator) { + ppmm.removeMessageListener(message, listener); + resolve(); + } + }); }); - - return deferred.promise; } add_task(function* () { diff --git a/devtools/client/webaudioeditor/test/head.js b/devtools/client/webaudioeditor/test/head.js index 5eae176fe37f..7b827718d077 100644 --- a/devtools/client/webaudioeditor/test/head.js +++ b/devtools/client/webaudioeditor/test/head.js @@ -12,7 +12,6 @@ var { TargetFactory } = require("devtools/client/framework/target"); var { DebuggerServer } = require("devtools/server/main"); var { generateUUID } = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator); -var Promise = require("promise"); var Services = require("Services"); var { WebAudioFront } = require("devtools/shared/fronts/webaudio"); var DevToolsUtils = require("devtools/shared/DevToolsUtils"); @@ -65,7 +64,6 @@ function loadFrameScripts() { function addTab(aUrl, aWindow) { info("Adding tab: " + aUrl); - let deferred = Promise.defer(); let targetWindow = aWindow || window; let targetBrowser = targetWindow.gBrowser; @@ -73,52 +71,50 @@ function addTab(aUrl, aWindow) { let tab = targetBrowser.selectedTab = targetBrowser.addTab(aUrl); let linkedBrowser = tab.linkedBrowser; - BrowserTestUtils.browserLoaded(linkedBrowser).then(function () { - info("Tab added and finished loading: " + aUrl); - deferred.resolve(tab); + return new Promise((resolve, reject) => { + BrowserTestUtils.browserLoaded(linkedBrowser).then(function () { + info("Tab added and finished loading: " + aUrl); + resolve(tab); + }); }); - - return deferred.promise; } function removeTab(aTab, aWindow) { info("Removing tab."); - let deferred = Promise.defer(); let targetWindow = aWindow || window; let targetBrowser = targetWindow.gBrowser; let tabContainer = targetBrowser.tabContainer; - tabContainer.addEventListener("TabClose", function (aEvent) { - info("Tab removed and finished closing."); - deferred.resolve(); - }, {once: true}); + return new Promise((resolve, reject) => { + tabContainer.addEventListener("TabClose", function (aEvent) { + info("Tab removed and finished closing."); + resolve(); + }, {once: true}); - targetBrowser.removeTab(aTab); - return deferred.promise; + targetBrowser.removeTab(aTab); + }); } function once(aTarget, aEventName, aUseCapture = false) { info("Waiting for event: '" + aEventName + "' on " + aTarget + "."); - let deferred = Promise.defer(); - - for (let [add, remove] of [ - ["on", "off"], // Use event emitter before DOM events for consistency - ["addEventListener", "removeEventListener"], - ["addListener", "removeListener"] - ]) { - if ((add in aTarget) && (remove in aTarget)) { - aTarget[add](aEventName, function onEvent(...aArgs) { - aTarget[remove](aEventName, onEvent, aUseCapture); - info("Got event: '" + aEventName + "' on " + aTarget + "."); - deferred.resolve(...aArgs); - }, aUseCapture); - break; + return new Promise((resolve, reject) => { + for (let [add, remove] of [ + ["on", "off"], // Use event emitter before DOM events for consistency + ["addEventListener", "removeEventListener"], + ["addListener", "removeListener"] + ]) { + if ((add in aTarget) && (remove in aTarget)) { + aTarget[add](aEventName, function onEvent(...aArgs) { + aTarget[remove](aEventName, onEvent, aUseCapture); + info("Got event: '" + aEventName + "' on " + aTarget + "."); + resolve(...aArgs); + }, aUseCapture); + break; + } } - } - - return deferred.promise; + }); } function reload(aTarget, aWaitForTargetEvent = "navigate") { @@ -206,20 +202,21 @@ function teardown(aTarget) { // `onAdd` function that calls with the entire actors array on program link function getN(front, eventName, count, spread) { let actors = []; - let deferred = Promise.defer(); info(`Waiting for ${count} ${eventName} events`); - front.on(eventName, function onEvent(...args) { - let actor = args[0]; - if (actors.length !== count) { - actors.push(spread ? args : actor); - } - info(`Got ${actors.length} / ${count} ${eventName} events`); - if (actors.length === count) { - front.off(eventName, onEvent); - deferred.resolve(actors); - } + + return new Promise((resolve, reject) => { + front.on(eventName, function onEvent(...args) { + let actor = args[0]; + if (actors.length !== count) { + actors.push(spread ? args : actor); + } + info(`Got ${actors.length} / ${count} ${eventName} events`); + if (actors.length === count) { + front.off(eventName, onEvent); + resolve(actors); + } + }); }); - return deferred.promise; } function get(front, eventName) { return getN(front, eventName, 1); } @@ -236,19 +233,20 @@ function getNSpread(front, eventName, count) { return getN(front, eventName, cou * nodes and edges. */ function waitForGraphRendered(front, nodeCount, edgeCount, paramEdgeCount) { - let deferred = Promise.defer(); let eventName = front.EVENTS.UI_GRAPH_RENDERED; info(`Wait for graph rendered with ${nodeCount} nodes, ${edgeCount} edges`); - front.on(eventName, function onGraphRendered(_, nodes, edges, pEdges) { - let paramEdgesDone = paramEdgeCount != null ? paramEdgeCount === pEdges : true; - info(`Got graph rendered with ${nodes} / ${nodeCount} nodes, ` + - `${edges} / ${edgeCount} edges`); - if (nodes === nodeCount && edges === edgeCount && paramEdgesDone) { - front.off(eventName, onGraphRendered); - deferred.resolve(); - } + + return new Promise((resolve, reject) => { + front.on(eventName, function onGraphRendered(_, nodes, edges, pEdges) { + let paramEdgesDone = paramEdgeCount != null ? paramEdgeCount === pEdges : true; + info(`Got graph rendered with ${nodes} / ${nodeCount} nodes, ` + + `${edges} / ${edgeCount} edges`); + if (nodes === nodeCount && edges === edgeCount && paramEdgesDone) { + front.off(eventName, onGraphRendered); + resolve(); + } + }); }); - return deferred.promise; } function checkVariableView(view, index, hash, description = "") { @@ -290,39 +288,38 @@ function checkVariableView(view, index, hash, description = "") { } function modifyVariableView(win, view, index, prop, value) { - let deferred = Promise.defer(); let scope = view.getScopeAtIndex(index); let aVar = scope.get(prop); scope.expand(); - win.on(win.EVENTS.UI_SET_PARAM, handleSetting); - win.on(win.EVENTS.UI_SET_PARAM_ERROR, handleSetting); + return new Promise((resolve, reject) => { + win.on(win.EVENTS.UI_SET_PARAM, handleSetting); + win.on(win.EVENTS.UI_SET_PARAM_ERROR, handleSetting); - // Focus and select the variable to begin editing - win.focus(); - aVar.focus(); - EventUtils.sendKey("RETURN", win); - - // Must wait for the scope DOM to be available to receive - // events - executeSoon(() => { - info("Setting " + value + " for " + prop + "...."); - for (let c of (value + "")) { - EventUtils.synthesizeKey(c, {}, win); - } + // Focus and select the variable to begin editing + win.focus(); + aVar.focus(); EventUtils.sendKey("RETURN", win); + + // Must wait for the scope DOM to be available to receive + // events + executeSoon(() => { + info("Setting " + value + " for " + prop + "...."); + for (let c of (value + "")) { + EventUtils.synthesizeKey(c, {}, win); + } + EventUtils.sendKey("RETURN", win); + }); + + function handleSetting(eventName) { + win.off(win.EVENTS.UI_SET_PARAM, handleSetting); + win.off(win.EVENTS.UI_SET_PARAM_ERROR, handleSetting); + if (eventName === win.EVENTS.UI_SET_PARAM) + resolve(); + if (eventName === win.EVENTS.UI_SET_PARAM_ERROR) + reject(); + } }); - - function handleSetting(eventName) { - win.off(win.EVENTS.UI_SET_PARAM, handleSetting); - win.off(win.EVENTS.UI_SET_PARAM_ERROR, handleSetting); - if (eventName === win.EVENTS.UI_SET_PARAM) - deferred.resolve(); - if (eventName === win.EVENTS.UI_SET_PARAM_ERROR) - deferred.reject(); - } - - return deferred.promise; } function findGraphEdge(win, source, target, param) { @@ -360,10 +357,10 @@ function isVisible(element) { * Used in debugging, returns a promise that resolves in `n` milliseconds. */ function wait(n) { - let { promise, resolve } = Promise.defer(); - setTimeout(resolve, n); - info("Waiting " + n / 1000 + " seconds."); - return promise; + return new Promise((resolve, reject) => { + setTimeout(resolve, n); + info("Waiting " + n / 1000 + " seconds."); + }); } /** @@ -372,7 +369,6 @@ function wait(n) { * the tabs have rendered, completing all RDP requests for the node. */ function clickGraphNode(panelWin, el, waitForToggle = false) { - let { promise, resolve } = Promise.defer(); let promises = [ once(panelWin, panelWin.EVENTS.UI_INSPECTOR_NODE_SET), once(panelWin, panelWin.EVENTS.UI_PROPERTIES_TAB_RENDERED), @@ -482,26 +478,24 @@ function waitForInspectorRender(panelWin, EVENTS) { * in potentially a different process. */ function evalInDebuggee(script) { - let deferred = Promise.defer(); - if (!mm) { throw new Error("`loadFrameScripts()` must be called when using MessageManager."); } - let id = generateUUID().toString(); - mm.sendAsyncMessage("devtools:test:eval", { script: script, id: id }); - mm.addMessageListener("devtools:test:eval:response", handler); + return new Promise((resolve, reject) => { + let id = generateUUID().toString(); + mm.sendAsyncMessage("devtools:test:eval", { script: script, id: id }); + mm.addMessageListener("devtools:test:eval:response", handler); - function handler({ data }) { - if (id !== data.id) { - return; + function handler({ data }) { + if (id !== data.id) { + return; + } + + mm.removeMessageListener("devtools:test:eval:response", handler); + resolve(data.value); } - - mm.removeMessageListener("devtools:test:eval:response", handler); - deferred.resolve(data.value); - } - - return deferred.promise; + }); } /** From fa786ffb9349132d8b3de56da09492c95f810b52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 20 May 2017 03:42:15 +0200 Subject: [PATCH 36/56] Bug 1366144: Test. r=heycam MozReview-Commit-ID: Dx1rFw0BZHm --HG-- extra : rebase_source : 2a07111ebe30c8c9f456b97de2bbed0d9ada7e63 --- layout/reftests/bugs/1366144-ref.html | 5 +++++ layout/reftests/bugs/1366144.html | 11 +++++++++++ layout/reftests/bugs/reftest.list | 1 + 3 files changed, 17 insertions(+) create mode 100644 layout/reftests/bugs/1366144-ref.html create mode 100644 layout/reftests/bugs/1366144.html diff --git a/layout/reftests/bugs/1366144-ref.html b/layout/reftests/bugs/1366144-ref.html new file mode 100644 index 000000000000..3631e25a469a --- /dev/null +++ b/layout/reftests/bugs/1366144-ref.html @@ -0,0 +1,5 @@ + + +
diff --git a/layout/reftests/bugs/1366144.html b/layout/reftests/bugs/1366144.html new file mode 100644 index 000000000000..744c668ef62a --- /dev/null +++ b/layout/reftests/bugs/1366144.html @@ -0,0 +1,11 @@ + + +
+ diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index a8a2996d8e3d..3c3f12329a71 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -2004,3 +2004,4 @@ fails-if(stylo) == 1348481-3.html 1348481-ref.html == 1364280-2b.html 1364280-2-ref.html == 1364280-2c.html 1364280-2-ref.html == 1364335.html 1364335-ref.html +== 1366144.html 1366144-ref.html From 8b8f339e85edd2dde4f3e83bdd983a90e52d36fa Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Sat, 20 May 2017 11:17:40 +0800 Subject: [PATCH 37/56] Bug 1289868 - Part 1: stylo: Add an outparam to Gecko_CalcStyleDifference that returns whether any style data changed. r=emilio MozReview-Commit-ID: 2Pk2x9JME0 --HG-- extra : rebase_source : 4ea272000541d5b79d83e69d6129a7b7b6871b8f --- layout/style/ServoBindings.cpp | 8 +++----- layout/style/ServoBindings.h | 3 ++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/layout/style/ServoBindings.cpp b/layout/style/ServoBindings.cpp index 4d26f8325668..defef6408591 100644 --- a/layout/style/ServoBindings.cpp +++ b/layout/style/ServoBindings.cpp @@ -332,20 +332,18 @@ Gecko_GetImplementedPseudo(RawGeckoElementBorrowed aElement) nsChangeHint Gecko_CalcStyleDifference(nsStyleContext* aOldStyleContext, - ServoComputedValuesBorrowed aComputedValues) + ServoComputedValuesBorrowed aComputedValues, + bool* aAnyStyleChanged) { MOZ_ASSERT(aOldStyleContext); MOZ_ASSERT(aComputedValues); - // Eventually, we should compute things out of these flags like - // ElementRestyler::RestyleSelf does and pass the result to the caller to - // potentially halt traversal. See bug 1289868. uint32_t equalStructs, samePointerStructs; nsChangeHint result = aOldStyleContext->CalcStyleDifference(aComputedValues, &equalStructs, &samePointerStructs); - + *aAnyStyleChanged = equalStructs != NS_STYLE_INHERIT_MASK; return result; } diff --git a/layout/style/ServoBindings.h b/layout/style/ServoBindings.h index e91d0c3cc407..f866b2d60ffa 100644 --- a/layout/style/ServoBindings.h +++ b/layout/style/ServoBindings.h @@ -322,7 +322,8 @@ nsStyleContext* Gecko_GetStyleContext(RawGeckoElementBorrowed element, nsIAtom* aPseudoTagOrNull); mozilla::CSSPseudoElementType Gecko_GetImplementedPseudo(RawGeckoElementBorrowed element); nsChangeHint Gecko_CalcStyleDifference(nsStyleContext* oldstyle, - ServoComputedValuesBorrowed newstyle); + ServoComputedValuesBorrowed newstyle, + bool* any_style_changed); nsChangeHint Gecko_HintsHandledForDescendants(nsChangeHint aHint); // Get an element snapshot for a given element from the table. From 99c15e1ebe530814ea8448dcf97d61a12a0b63f4 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Fri, 19 May 2017 17:39:14 +0800 Subject: [PATCH 38/56] Bug 1289868 - Part 2: stylo: Compare all structs in CalcStyleDifference so that Servo can accurately determine whether to stop traversal. r=emilio MozReview-Commit-ID: I0WK2gDsMMu --HG-- extra : rebase_source : 204b8206ef8e924cc8a3992874538a68417768f0 --- layout/style/nsStyleContext.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/layout/style/nsStyleContext.cpp b/layout/style/nsStyleContext.cpp index e19e32f0349e..f941c68486c7 100644 --- a/layout/style/nsStyleContext.cpp +++ b/layout/style/nsStyleContext.cpp @@ -1032,11 +1032,28 @@ nsStyleContext::CalcStyleDifferenceInternal(StyleContextLike* aNewContext, DebugOnly styleStructCount = 1; // count Variables already + // Servo's optimization to stop the cascade when there are no style changes + // that children need to be recascade for relies on comparing all of the + // structs, not just those that are returned from PeekStyleData, although + // if PeekStyleData does return null we still don't want to accumulate + // any change hints for those structs. + bool checkUnrequestedServoStructs = mSource.IsServoComputedValues(); + #define DO_STRUCT_DIFFERENCE(struct_) \ PR_BEGIN_MACRO \ const nsStyle##struct_* this##struct_ = PeekStyle##struct_(); \ + bool unrequestedStruct; \ if (this##struct_) { \ + unrequestedStruct = false; \ structsFound |= NS_STYLE_INHERIT_BIT(struct_); \ + } else if (checkUnrequestedServoStructs) { \ + this##struct_ = \ + Servo_GetStyle##struct_(mSource.AsServoComputedValues()); \ + unrequestedStruct = true; \ + } else { \ + unrequestedStruct = false; \ + } \ + if (this##struct_) { \ const nsStyle##struct_* other##struct_ = aNewContext->Style##struct_(); \ if (this##struct_ == other##struct_) { \ /* The very same struct, so we know that there will be no */ \ @@ -1045,7 +1062,9 @@ nsStyleContext::CalcStyleDifferenceInternal(StyleContextLike* aNewContext, } else { \ nsChangeHint difference = \ this##struct_->CalcDifference(*other##struct_ EXTRA_DIFF_ARGS); \ - hint |= difference; \ + if (!unrequestedStruct) { \ + hint |= difference; \ + } \ if (!difference) { \ *aEqualStructs |= NS_STYLE_INHERIT_BIT(struct_); \ } \ From 9a8d559e54740643a5a3421d6cd08eaa072e5312 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Fri, 19 May 2017 17:39:16 +0800 Subject: [PATCH 39/56] Bug 1364845 - stylo: Adjust test expectations. r=emilio MozReview-Commit-ID: KS4qGSOsFD0 --HG-- extra : rebase_source : d3603746c8b8c0180499f8f01ffac9855362578c --- layout/reftests/bugs/reftest.list | 2 +- layout/reftests/mathml/reftest.list | 4 ++-- layout/style/test/stylo-failures.md | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index 3c3f12329a71..db0fcf14cbd1 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -830,7 +830,7 @@ fuzzy-if(skiaContent,2,21) == 398682-1.html 398682-1-ref.html == 399209-1.html 399209-1-ref.html == 399209-2.html 399209-2-ref.html == 399258-1.html 399258-1-ref.html -fails-if(stylo) == 399384-1.html 399384-1-ref.html +== 399384-1.html 399384-1-ref.html random-if(gtkWidget) == 399636-standards-css.html 399636-standards-ref.html # bug 429022 random-if(gtkWidget) == 399636-standards-html.html 399636-standards-ref.html # bug 429022 random-if(gtkWidget) == 399636-quirks-css.html 399636-quirks-ref.html # bug 429022 diff --git a/layout/reftests/mathml/reftest.list b/layout/reftests/mathml/reftest.list index cd012cd493d9..f8a459c6de92 100644 --- a/layout/reftests/mathml/reftest.list +++ b/layout/reftests/mathml/reftest.list @@ -294,8 +294,8 @@ fails-if(stylo) == mathvariant-3.html mathvariant-3-ref.html == mathvariant-4.html mathvariant-4-ref.html == mathvariant-5.html mathvariant-5-ref.html == dtls-1.html dtls-1-ref.html -== dtls-2.html dtls-2-ref.html -== dtls-3.html dtls-3-ref.html +fails-if(stylo) == dtls-2.html dtls-2-ref.html # bug 1366206 +fails-if(stylo) == dtls-3.html dtls-3-ref.html # bug 1366206 == ssty-1.html ssty-1-ref.html == ssty-2.html ssty-2-ref.html == ssty-3.html ssty-3-ref.html diff --git a/layout/style/test/stylo-failures.md b/layout/style/test/stylo-failures.md index c11f9671221c..06fe8de9c6d3 100644 --- a/layout/style/test/stylo-failures.md +++ b/layout/style/test/stylo-failures.md @@ -55,6 +55,7 @@ to mochitest command. * test_parser_diagnostics_unprintables.html [550] * Transition support: * test_transitions.html: pseudo elements [12] + * test_transitions_and_reframes.html `pseudo-element`: bug 1366422 [4] * Events: * test_animations_event_order.html [2] * test_computed_style.html `gradient`: -webkit-prefixed gradient values [13] From 5fddbbeb72c56322134b18c77c07b3adc00df008 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 20 May 2017 17:28:20 +0200 Subject: [PATCH 40/56] Bug 1366497 - disable strict-aliasing for gcc in js/src/gdb & js/src/jsapi-tests r=sfink MozReview-Commit-ID: HI8yGkXpDXg --HG-- extra : rebase_source : e727801d5b894f21c6ffa77f721c22078f76b11f --- js/src/gdb/moz.build | 2 +- js/src/jsapi-tests/moz.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/src/gdb/moz.build b/js/src/gdb/moz.build index 07047fb742ee..681f9807c120 100644 --- a/js/src/gdb/moz.build +++ b/js/src/gdb/moz.build @@ -42,7 +42,7 @@ if CONFIG['ENABLE_INTL_API'] and CONFIG['MOZ_ICU_DATA_ARCHIVE']: OS_LIBS += CONFIG['MOZ_ZLIB_LIBS'] if CONFIG['GNU_CXX']: - CXXFLAGS += ['-Wno-shadow'] + CXXFLAGS += ['-Wno-shadow', '-fno-strict-aliasing'] # This is intended as a temporary workaround to enable VS2015. if CONFIG['_MSC_VER']: diff --git a/js/src/jsapi-tests/moz.build b/js/src/jsapi-tests/moz.build index cfb519aa3f10..d4494489e4da 100644 --- a/js/src/jsapi-tests/moz.build +++ b/js/src/jsapi-tests/moz.build @@ -145,7 +145,7 @@ USE_LIBS += [ OS_LIBS += CONFIG['MOZ_ZLIB_LIBS'] if CONFIG['GNU_CXX']: - CXXFLAGS += ['-Wno-shadow', '-Werror=format'] + CXXFLAGS += ['-Wno-shadow', '-Werror=format', '-fno-strict-aliasing'] # This is intended as a temporary workaround to enable VS2015. if CONFIG['_MSC_VER']: From 8ab7ae19d19b9edfeda652e692a3a580ed9448e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 21 May 2017 00:00:31 +0200 Subject: [PATCH 41/56] Bug 1289868: Whitelist outparam in heap write hazard analysis on a CLOSED TREE. r=me MozReview-Commit-ID: GlVmMxGopBb --- js/src/devtools/rootAnalysis/analyzeHeapWrites.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/src/devtools/rootAnalysis/analyzeHeapWrites.js b/js/src/devtools/rootAnalysis/analyzeHeapWrites.js index 4543b3f4f5d1..165679151c0d 100644 --- a/js/src/devtools/rootAnalysis/analyzeHeapWrites.js +++ b/js/src/devtools/rootAnalysis/analyzeHeapWrites.js @@ -209,7 +209,8 @@ function treatAsSafeArgument(entry, varName, csuName) ["Gecko_nsFont_InitSystem", "aDest", null], ["Gecko_nsStyleFont_FixupNoneGeneric", "aFont", null], ["Gecko_StyleTransition_SetUnsupportedProperty", "aTransition", null], - ["Gecko_AddPropertyToSet", "aPropertySet", "null"], + ["Gecko_AddPropertyToSet", "aPropertySet", null], + ["Gecko_CalcStyleDifference", "aAnyStyleChanged", null], ]; for (var [entryMatch, varMatch, csuMatch] of whitelist) { assert(entryMatch || varMatch || csuMatch); From 1ae18d00bbda59b8984e8fa2427e586eb57fe73e Mon Sep 17 00:00:00 2001 From: Imanol Fernandez Date: Sat, 20 May 2017 15:04:43 -0500 Subject: [PATCH 42/56] servo: Merge #16933 - Implement MutationObserver childList mutations (from MortimerGoro:mutation_children); r=jdm Implement MutationObserver childList mutations --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ Source-Repo: https://github.com/servo/servo Source-Revision: 323760f47e79b49ef8db4484cca1969bc26b5413 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : d0d805444965d50fc48b8982521415f4ce30c7f8 --- .../components/script/dom/mutationobserver.rs | 16 +++++- servo/components/script/dom/mutationrecord.rs | 55 ++++++++++++++++--- servo/components/script/dom/node.rs | 54 ++++++++++++++++-- servo/components/script/dom/nodelist.rs | 4 ++ 4 files changed, 112 insertions(+), 17 deletions(-) diff --git a/servo/components/script/dom/mutationobserver.rs b/servo/components/script/dom/mutationobserver.rs index 48c8fe24b871..84d34af0149c 100644 --- a/servo/components/script/dom/mutationobserver.rs +++ b/servo/components/script/dom/mutationobserver.rs @@ -29,9 +29,10 @@ pub struct MutationObserver { record_queue: DOMRefCell>>, } -#[derive(Clone)] -pub enum Mutation { - Attribute { name: LocalName, namespace: Namespace, old_value: DOMString } +pub enum Mutation<'a> { + Attribute { name: LocalName, namespace: Namespace, old_value: DOMString }, + ChildList { added: Option<&'a [&'a Node]>, removed: Option<&'a [&'a Node]>, + prev: Option<&'a Node>, next: Option<&'a Node> }, } #[derive(HeapSizeOf, JSTraceable)] @@ -143,6 +144,12 @@ impl MutationObserver { interestedObservers.push((Root::from_ref(&*registered.observer), paired_string)); } + }, + Mutation::ChildList { .. } => { + if !registered.options.child_list { + continue; + } + interestedObservers.push((Root::from_ref(&*registered.observer), None)); } } } @@ -159,6 +166,9 @@ impl MutationObserver { None }; MutationRecord::attribute_mutated(target, name, namespace, paired_string.clone()) + }, + Mutation::ChildList { ref added, ref removed, ref next, ref prev } => { + MutationRecord::child_list_mutated(target, *added, *removed, *next, *prev) } }; // Step 4.8 diff --git a/servo/components/script/dom/mutationrecord.rs b/servo/components/script/dom/mutationrecord.rs index 439f4ae02b53..00d96e258c4c 100644 --- a/servo/components/script/dom/mutationrecord.rs +++ b/servo/components/script/dom/mutationrecord.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::Bindings::MutationRecordBinding::MutationRecordBinding; use dom::bindings::codegen::Bindings::MutationRecordBinding::MutationRecordBinding::MutationRecordMethods; -use dom::bindings::js::{JS, Root}; +use dom::bindings::js::{JS, MutNullableJS, Root}; use dom::bindings::reflector::{Reflector, reflect_dom_object}; use dom::bindings::str::DOMString; use dom::node::{Node, window_from_node}; @@ -20,6 +20,10 @@ pub struct MutationRecord { attribute_name: Option, attribute_namespace: Option, old_value: Option, + added_nodes: MutNullableJS, + removed_nodes: MutNullableJS, + next_sibling: Option>, + prev_sibling: Option>, } impl MutationRecord { @@ -32,15 +36,40 @@ impl MutationRecord { target, Some(DOMString::from(&**attribute_name)), attribute_namespace.map(|n| DOMString::from(&**n)), - old_value); + old_value, + None, None, None, None); reflect_dom_object(record, &*window_from_node(target), MutationRecordBinding::Wrap) } + pub fn child_list_mutated(target: &Node, + added_nodes: Option<&[&Node]>, + removed_nodes: Option<&[&Node]>, + next_sibling: Option<&Node>, + prev_sibling: Option<&Node>) -> Root { + let window = window_from_node(target); + let added_nodes = added_nodes.map(|list| NodeList::new_simple_list_slice(&window, list)); + let removed_nodes = removed_nodes.map(|list| NodeList::new_simple_list_slice(&window, list)); + + reflect_dom_object(box MutationRecord::new_inherited("childList", + target, + None, None, None, + added_nodes.as_ref().map(|list| &**list), + removed_nodes.as_ref().map(|list| &**list), + next_sibling, + prev_sibling), + &*window, + MutationRecordBinding::Wrap) + } + fn new_inherited(record_type: &str, target: &Node, attribute_name: Option, attribute_namespace: Option, - old_value: Option) -> MutationRecord { + old_value: Option, + added_nodes: Option<&NodeList>, + removed_nodes: Option<&NodeList>, + next_sibling: Option<&Node>, + prev_sibling: Option<&Node>) -> MutationRecord { MutationRecord { reflector_: Reflector::new(), record_type: DOMString::from(record_type), @@ -48,6 +77,10 @@ impl MutationRecord { attribute_name: attribute_name, attribute_namespace: attribute_namespace, old_value: old_value, + added_nodes: MutNullableJS::new(added_nodes), + removed_nodes: MutNullableJS::new(removed_nodes), + next_sibling: next_sibling.map(JS::from_ref), + prev_sibling: prev_sibling.map(JS::from_ref), } } } @@ -80,24 +113,28 @@ impl MutationRecordMethods for MutationRecord { // https://dom.spec.whatwg.org/#dom-mutationrecord-addednodes fn AddedNodes(&self) -> Root { - let window = window_from_node(&*self.target); - NodeList::empty(&window) + self.added_nodes.or_init(|| { + let window = window_from_node(&*self.target); + NodeList::empty(&window) + }) } // https://dom.spec.whatwg.org/#dom-mutationrecord-removednodes fn RemovedNodes(&self) -> Root { - let window = window_from_node(&*self.target); - NodeList::empty(&window) + self.removed_nodes.or_init(|| { + let window = window_from_node(&*self.target); + NodeList::empty(&window) + }) } // https://dom.spec.whatwg.org/#dom-mutationrecord-previoussibling fn GetPreviousSibling(&self) -> Option> { - None + self.prev_sibling.as_ref().map(|node| Root::from_ref(&**node)) } // https://dom.spec.whatwg.org/#dom-mutationrecord-previoussibling fn GetNextSibling(&self) -> Option> { - None + self.next_sibling.as_ref().map(|node| Root::from_ref(&**node)) } } diff --git a/servo/components/script/dom/node.rs b/servo/components/script/dom/node.rs index 1ad28974f3de..ff3e5d647871 100644 --- a/servo/components/script/dom/node.rs +++ b/servo/components/script/dom/node.rs @@ -47,7 +47,7 @@ use dom::htmllinkelement::HTMLLinkElement; use dom::htmlmetaelement::HTMLMetaElement; use dom::htmlstyleelement::HTMLStyleElement; use dom::htmltextareaelement::{HTMLTextAreaElement, LayoutHTMLTextAreaElementHelpers}; -use dom::mutationobserver::RegisteredObserver; +use dom::mutationobserver::{Mutation, MutationObserver, RegisteredObserver}; use dom::nodelist::NodeList; use dom::processinginstruction::ProcessingInstruction; use dom::range::WeakRangeVec; @@ -1616,18 +1616,27 @@ impl Node { let new_nodes = if let NodeTypeId::DocumentFragment = node.type_id() { // Step 3. new_nodes.extend(node.children().map(|kid| JS::from_ref(&*kid))); - // Step 4: mutation observers. - // Step 5. + // Step 4. for kid in new_nodes.r() { Node::remove(*kid, node, SuppressObserver::Suppressed); } + // Step 5. vtable_for(&node).children_changed(&ChildrenMutation::replace_all(new_nodes.r(), &[])); + + let mutation = Mutation::ChildList { + added: None, + removed: Some(new_nodes.r()), + prev: None, + next: None, + }; + MutationObserver::queue_a_mutation_record(&node, mutation); + new_nodes.r() } else { // Step 3. ref_slice(&node) }; - // Step 6: mutation observers. + // Step 6. let previous_sibling = match suppress_observers { SuppressObserver::Unsuppressed => { match child { @@ -1646,6 +1655,14 @@ impl Node { if let SuppressObserver::Unsuppressed = suppress_observers { vtable_for(&parent).children_changed( &ChildrenMutation::insert(previous_sibling.r(), new_nodes, child)); + + let mutation = Mutation::ChildList { + added: Some(new_nodes), + removed: None, + prev: previous_sibling.r(), + next: child, + }; + MutationObserver::queue_a_mutation_record(&parent, mutation); } } @@ -1677,9 +1694,19 @@ impl Node { if let Some(node) = node { Node::insert(node, parent, None, SuppressObserver::Suppressed); } - // Step 6: mutation observers. + // Step 6. vtable_for(&parent).children_changed( &ChildrenMutation::replace_all(removed_nodes.r(), added_nodes)); + + if !removed_nodes.is_empty() || !added_nodes.is_empty() { + let mutation = Mutation::ChildList { + added: Some(added_nodes), + removed: Some(removed_nodes.r()), + prev: None, + next: None, + }; + MutationObserver::queue_a_mutation_record(&parent, mutation); + } } // https://dom.spec.whatwg.org/#concept-node-pre-remove @@ -1730,6 +1757,15 @@ impl Node { &ChildrenMutation::replace(old_previous_sibling.r(), &Some(&node), &[], old_next_sibling.r())); + + let removed = [node]; + let mutation = Mutation::ChildList { + added: None, + removed: Some(&removed), + prev: old_previous_sibling.r(), + next: old_next_sibling.r(), + }; + MutationObserver::queue_a_mutation_record(&parent, mutation); } } @@ -2182,6 +2218,14 @@ impl NodeMethods for Node { &ChildrenMutation::replace(previous_sibling.r(), &removed_child, nodes, reference_child)); + let removed = removed_child.map(|r| [r]); + let mutation = Mutation::ChildList { + added: Some(nodes), + removed: removed.as_ref().map(|r| &r[..]), + prev: previous_sibling.r(), + next: reference_child, + }; + MutationObserver::queue_a_mutation_record(&self, mutation); // Step 15. Ok(Root::from_ref(child)) diff --git a/servo/components/script/dom/nodelist.rs b/servo/components/script/dom/nodelist.rs index fae181f7d816..39b4cc1c41ec 100644 --- a/servo/components/script/dom/nodelist.rs +++ b/servo/components/script/dom/nodelist.rs @@ -47,6 +47,10 @@ impl NodeList { NodeList::new(window, NodeListType::Simple(iter.map(|r| JS::from_ref(&*r)).collect())) } + pub fn new_simple_list_slice(window: &Window, slice: &[&Node]) -> Root { + NodeList::new(window, NodeListType::Simple(slice.iter().map(|r| JS::from_ref(*r)).collect())) + } + pub fn new_child_list(window: &Window, node: &Node) -> Root { NodeList::new(window, NodeListType::Children(ChildrenList::new(node))) } From 1cadcce8907ef2f510014b14978f514cd210481e Mon Sep 17 00:00:00 2001 From: Greg Tatum Date: Fri, 19 May 2017 16:11:49 -0500 Subject: [PATCH 43/56] Bug 1366061 - Fix memory tool file picker; r=fitzgen MozReview-Commit-ID: JNrIGmXlZ46 --HG-- extra : rebase_source : a8962ff9e9672329459ce4db6c6c860984785846 --- devtools/client/memory/utils.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/devtools/client/memory/utils.js b/devtools/client/memory/utils.js index 82511dc82195..017decb90628 100644 --- a/devtools/client/memory/utils.js +++ b/devtools/client/memory/utils.js @@ -414,15 +414,17 @@ exports.getSnapshotTotals = function (census) { * The file selected by the user, or null, if cancelled. */ exports.openFilePicker = function ({ title, filters, defaultName, mode }) { - mode = mode === "save" ? Ci.nsIFilePicker.modeSave : null; - mode = mode === "open" ? Ci.nsIFilePicker.modeOpen : null; - - if (mode == void 0) { + let fpMode; + if (mode === "save") { + fpMode = Ci.nsIFilePicker.modeSave; + } else if (mode === "open") { + fpMode = Ci.nsIFilePicker.modeOpen; + } else { throw new Error("No valid mode specified for nsIFilePicker."); } let fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker); - fp.init(window, title, mode); + fp.init(window, title, fpMode); for (let filter of (filters || [])) { fp.appendFilter(filter[0], filter[1]); From 8655dd419d66a56f51d1ffaabd39c3659d81d082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 20 May 2017 17:17:05 -0500 Subject: [PATCH 44/56] servo: Merge #16943 - style: Make a bloom filter arrive to restyle hint computation (from emilio:bloom-restyle-hints); r=bholley Source-Repo: https://github.com/servo/servo Source-Revision: d98abe1397ae9e100d6ee490d69e0fb1a32fd3e6 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : d39211e48ee3b9ce4321f2f6006b71664ea22c3b --- servo/components/style/bloom.rs | 13 +++-- servo/components/style/data.rs | 17 +++--- servo/components/style/restyle_hints.rs | 69 ++++++++++++++++++++++--- servo/components/style/stylist.rs | 19 ++++--- servo/components/style/traversal.rs | 40 +++++++++----- 5 files changed, 115 insertions(+), 43 deletions(-) diff --git a/servo/components/style/bloom.rs b/servo/components/style/bloom.rs index 7633d154fe82..f5df67e6a3f7 100644 --- a/servo/components/style/bloom.rs +++ b/servo/components/style/bloom.rs @@ -9,6 +9,7 @@ use dom::{SendElement, TElement}; use selectors::bloom::BloomFilter; +use smallvec::SmallVec; /// A struct that allows us to fast-reject deep descendant selectors avoiding /// selector-matching. @@ -223,7 +224,7 @@ impl StyleBloom { // Let's collect the parents we are going to need to insert once we've // found the common one. - let mut parents_to_insert = vec![]; + let mut parents_to_insert = SmallVec::<[E; 8]>::new(); // If the bloom filter still doesn't have enough elements, the common // parent is up in the dom. @@ -245,10 +246,12 @@ impl StyleBloom { // Not-so-happy case: Parent's don't match, so we need to keep going up // until we find a common ancestor. // - // Gecko currently models native anonymous content that conceptually hangs - // off the document (such as scrollbars) as a separate subtree from the - // document root. Thus it's possible with Gecko that we do not find any - // common ancestor. + // Gecko currently models native anonymous content that conceptually + // hangs off the document (such as scrollbars) as a separate subtree + // from the document root. + // + // Thus it's possible with Gecko that we do not find any common + // ancestor. while **self.elements.last().unwrap() != common_parent { parents_to_insert.push(common_parent); self.pop().unwrap(); diff --git a/servo/components/style/data.rs b/servo/components/style/data.rs index e7248cf94d23..4e6d191d19d0 100644 --- a/servo/components/style/data.rs +++ b/servo/components/style/data.rs @@ -4,13 +4,11 @@ //! Per-node data used in style calculation. -#![deny(missing_docs)] - use context::SharedStyleContext; use dom::TElement; use properties::ComputedValues; use properties::longhands::display::computed_value as display; -use restyle_hints::{RestyleReplacements, RestyleHint}; +use restyle_hints::{HintComputationContext, RestyleReplacements, RestyleHint}; use rule_tree::StrongRuleNode; use selector_parser::{EAGER_PSEUDO_COUNT, PseudoElement, RestyleDamage}; use shared_lock::StylesheetGuards; @@ -372,15 +370,16 @@ impl ElementData { /// explicit sibling restyle hints from the stored restyle hint. /// /// Returns true if later siblings must be restyled. - pub fn compute_final_hint( + pub fn compute_final_hint<'a, E: TElement>( &mut self, element: E, - context: &SharedStyleContext) + shared_context: &SharedStyleContext, + hint_context: HintComputationContext<'a, E>) -> bool { debug!("compute_final_hint: {:?}, {:?}", element, - context.traversal_flags); + shared_context.traversal_flags); let mut hint = match self.get_restyle() { Some(r) => r.hint.0.clone(), @@ -395,7 +394,11 @@ impl ElementData { element.implemented_pseudo_element()); if element.has_snapshot() && !element.handled_snapshot() { - hint.insert(context.stylist.compute_restyle_hint(&element, context.snapshot_map)); + let snapshot_hint = + shared_context.stylist.compute_restyle_hint(&element, + shared_context, + hint_context); + hint.insert(snapshot_hint); unsafe { element.set_handled_snapshot() } debug_assert!(element.handled_snapshot()); } diff --git a/servo/components/style/restyle_hints.rs b/servo/components/style/restyle_hints.rs index 913141f8dd0f..06188329261e 100644 --- a/servo/components/style/restyle_hints.rs +++ b/servo/components/style/restyle_hints.rs @@ -9,6 +9,7 @@ use Atom; use LocalName; use Namespace; +use context::{SharedStyleContext, ThreadLocalStyleContext}; use dom::TElement; use element_state::*; #[cfg(feature = "gecko")] @@ -825,6 +826,35 @@ pub struct DependencySet { dependencies: SelectorMap, } +/// The data that we need to compute a given restyle hint. +pub enum HintComputationContext<'a, E: 'a> + where E: TElement, +{ + /// The data we need to compute a restyle hint for the root of the + /// traversal. + /// + /// We don't bother with the bloom filter there for multiple reasons: + /// + /// * The root of the traversal uses to be the root of the document, so we + /// don't gain much using a bloom filter. + /// + /// * The chances that a non-root-element root of the traversal has a + /// snapshot is quite low. + Root, + + /// The data we need to compute a restyle hint for a child. + /// + /// This needs a full-blown style context in order to get the selector + /// filters up-to-date, and the dom depth in order to insert into the filter + /// properly if needed. + Child { + /// The thread-local context, that holds the bloom filter alive. + local_context: &'a mut ThreadLocalStyleContext, + /// The dom depth of this element. + dom_depth: usize, + } +} + impl DependencySet { /// Adds a selector to this `DependencySet`. pub fn note_selector(&mut self, selector: &Selector) { @@ -921,16 +951,17 @@ impl DependencySet { /// Compute a restyle hint given an element and a snapshot, per the rules /// explained in the rest of the documentation. - pub fn compute_hint( + pub fn compute_hint<'a, E>( &self, el: &E, - snapshots: &SnapshotMap) + shared_context: &SharedStyleContext, + hint_context: HintComputationContext<'a, E>) -> RestyleHint where E: TElement, { debug_assert!(el.has_snapshot(), "Shouldn't be here!"); - - let snapshot_el = ElementWrapper::new(el.clone(), snapshots); + let snapshot_el = + ElementWrapper::new(*el, shared_context.snapshot_map); let snapshot = snapshot_el.snapshot().expect("has_snapshot lied so badly"); @@ -960,8 +991,30 @@ impl DependencySet { }); } - // FIXME(emilio): A bloom filter here would be neat. - let mut matching_context = + let bloom_filter = match hint_context { + HintComputationContext::Root => None, + HintComputationContext::Child { mut local_context, dom_depth } => { + local_context + .bloom_filter + .insert_parents_recovering(*el, dom_depth); + local_context.bloom_filter.assert_complete(*el); + Some(local_context.bloom_filter.filter()) + } + }; + + let mut element_matching_context = + MatchingContext::new(MatchingMode::Normal, bloom_filter); + + // NOTE(emilio): We can't use the bloom filter for snapshots, given that + // arbitrary elements in the parent chain may have mutated their + // id's/classes, which means that they won't be in the filter, and as + // such we may fast-reject selectors incorrectly. + // + // We may be able to improve this if we record as we go down the tree + // whether any parent had a snapshot, and whether those snapshots were + // taken due to an element class/id change, but it's not clear we _need_ + // it right now. + let mut snapshot_matching_context = MatchingContext::new(MatchingMode::Normal, None); let lookup_element = if el.implemented_pseudo_element().is_some() { @@ -989,11 +1042,11 @@ impl DependencySet { // change its matching behavior here. let matched_then = matches_selector(&dep.selector, &snapshot_el, - &mut matching_context, + &mut snapshot_matching_context, &mut |_, _| {}); let matches_now = matches_selector(&dep.selector, el, - &mut matching_context, + &mut element_matching_context, &mut |_, _| {}); if matched_then != matches_now { hint.insert_from(&dep.hint); diff --git a/servo/components/style/stylist.rs b/servo/components/style/stylist.rs index a5c103c5a558..a2f358b3f221 100644 --- a/servo/components/style/stylist.rs +++ b/servo/components/style/stylist.rs @@ -4,11 +4,9 @@ //! Selector matching. -#![deny(missing_docs)] - use {Atom, LocalName, Namespace}; use bit_vec::BitVec; -use context::QuirksMode; +use context::{QuirksMode, SharedStyleContext}; use data::ComputedStyle; use dom::{AnimationRules, TElement}; use element_state::ElementState; @@ -23,9 +21,9 @@ use properties::{self, CascadeFlags, ComputedValues}; #[cfg(feature = "servo")] use properties::INHERIT_ALL; use properties::PropertyDeclarationBlock; -use restyle_hints::{RestyleHint, DependencySet}; +use restyle_hints::{HintComputationContext, DependencySet, RestyleHint}; use rule_tree::{CascadeLevel, RuleTree, StrongRuleNode, StyleSource}; -use selector_parser::{SelectorImpl, PseudoElement, SnapshotMap}; +use selector_parser::{SelectorImpl, PseudoElement}; use selectors::attr::NamespaceConstraint; use selectors::bloom::BloomFilter; use selectors::matching::{AFFECTED_BY_STYLE_ATTRIBUTE, AFFECTED_BY_PRESENTATIONAL_HINTS}; @@ -1029,13 +1027,14 @@ impl Stylist { /// Given an element, and a snapshot table that represents a previous state /// of the tree, compute the appropriate restyle hint, that is, the kind of /// restyle we need to do. - pub fn compute_restyle_hint(&self, - element: &E, - snapshots: &SnapshotMap) - -> RestyleHint + pub fn compute_restyle_hint<'a, E>(&self, + element: &E, + shared_context: &SharedStyleContext, + context: HintComputationContext<'a, E>) + -> RestyleHint where E: TElement, { - self.dependencies.compute_hint(element, snapshots) + self.dependencies.compute_hint(element, shared_context, context) } /// Computes styles for a given declaration with parent_style. diff --git a/servo/components/style/traversal.rs b/servo/components/style/traversal.rs index 542c5611f9be..6ce7d9d4b181 100644 --- a/servo/components/style/traversal.rs +++ b/servo/components/style/traversal.rs @@ -9,7 +9,7 @@ use context::{SharedStyleContext, StyleContext, ThreadLocalStyleContext}; use data::{ElementData, ElementStyles, StoredRestyleHint}; use dom::{DirtyDescendants, NodeInfo, OpaqueNode, TElement, TNode}; use matching::{ChildCascadeRequirement, MatchMethods, StyleSharingBehavior}; -use restyle_hints::RestyleHint; +use restyle_hints::{HintComputationContext, RestyleHint}; use selector_parser::RestyleDamage; #[cfg(feature = "servo")] use servo_config::opts; use std::borrow::BorrowMut; @@ -123,7 +123,8 @@ pub trait DomTraversal : Sync { type ThreadLocalContext: Send + BorrowMut>; /// Process `node` on the way down, before its children have been processed. - fn process_preorder(&self, data: &PerLevelTraversalData, + fn process_preorder(&self, + data: &PerLevelTraversalData, thread_local: &mut Self::ThreadLocalContext, node: E::ConcreteNode); @@ -227,7 +228,10 @@ pub trait DomTraversal : Sync { // Expanding snapshots here may create a LATER_SIBLINGS restyle hint, which // we propagate to the next sibling element. if let Some(mut data) = root.mutate_data() { - let later_siblings = data.compute_final_hint(root, shared_context); + let later_siblings = + data.compute_final_hint(root, + shared_context, + HintComputationContext::Root); if later_siblings { if let Some(next) = root.next_sibling_element() { if let Some(mut next_data) = next.mutate_data() { @@ -669,11 +673,12 @@ pub fn recalc_style_at(traversal: &D, r.damage_handled() | r.damage.handled_for_descendants() }); - preprocess_children(traversal, - element, - propagated_hint, - damage_handled, - inherited_style_changed); + preprocess_children::(context, + traversal_data, + element, + propagated_hint, + damage_handled, + inherited_style_changed); } // If we are in a restyle for reconstruction, drop the existing restyle @@ -740,7 +745,8 @@ fn compute_style(_traversal: &D, MatchAndCascade => { // Ensure the bloom filter is up to date. context.thread_local.bloom_filter - .insert_parents_recovering(element, traversal_data.current_dom_depth); + .insert_parents_recovering(element, + traversal_data.current_dom_depth); context.thread_local.bloom_filter.assert_complete(element); context.thread_local.statistics.elements_matched += 1; @@ -770,15 +776,17 @@ fn compute_style(_traversal: &D, } } -fn preprocess_children(traversal: &D, +fn preprocess_children(context: &mut StyleContext, + parent_traversal_data: &PerLevelTraversalData, element: E, mut propagated_hint: StoredRestyleHint, damage_handled: RestyleDamage, parent_inherited_style_changed: bool) where E: TElement, - D: DomTraversal + D: DomTraversal, { trace!("preprocess_children: {:?}", element); + // Loop over all the children. for child in element.as_node().children() { // FIXME(bholley): Add TElement::element_children instead of this. @@ -787,7 +795,8 @@ fn preprocess_children(traversal: &D, None => continue, }; - let mut child_data = unsafe { D::ensure_element_data(&child).borrow_mut() }; + let mut child_data = + unsafe { D::ensure_element_data(&child).borrow_mut() }; // If the child is unstyled, we don't need to set up any restyling. if !child_data.has_styles() { @@ -798,7 +807,12 @@ fn preprocess_children(traversal: &D, // // NB: This will be a no-op if there's no restyle data and no snapshot. let later_siblings = - child_data.compute_final_hint(child, traversal.shared_context()); + child_data.compute_final_hint(child, + &context.shared, + HintComputationContext::Child { + local_context: &mut context.thread_local, + dom_depth: parent_traversal_data.current_dom_depth + 1, + }); trace!(" > {:?} -> {:?} + {:?}, pseudo: {:?}, later_siblings: {:?}", child, From 1953860048ba3e52bdd20eedabcfee43ec2e5123 Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Wed, 17 May 2017 16:29:03 +0000 Subject: [PATCH 45/56] Bug 1365646: fix logic error in try syntax `-j` handling; r=gps MozReview-Commit-ID: ApKmq9IYRtV --HG-- extra : rebase_source : c04c31c1ca791baea2db3c9c8c73d1b98ea67f4f --- taskcluster/taskgraph/try_option_syntax.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taskcluster/taskgraph/try_option_syntax.py b/taskcluster/taskgraph/try_option_syntax.py index ab4357658ddf..4d2ffda7dba0 100644 --- a/taskcluster/taskgraph/try_option_syntax.py +++ b/taskcluster/taskgraph/try_option_syntax.py @@ -587,7 +587,7 @@ class TryOptionSyntax(object): job_try_name = attr('job_try_name') if job_try_name: if self.jobs is None or job_try_name in self.jobs: - if self.platforms is None or attr('build_platform') not in self.platforms: + if self.platforms is None or attr('build_platform') in self.platforms: return True elif attr('kind') == 'test': return match_test(self.unittests, 'unittest_try_name') \ From 8773943124df40c44dd1105f5996e47327f29a5b Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Sat, 20 May 2017 19:28:59 -0500 Subject: [PATCH 46/56] servo: Merge #16950 - Fix warning in a future compiler version (from servo:warn); r=nox (Do not upgrade yet because of https://github.com/rust-lang/rust/issues/42101) Source-Repo: https://github.com/servo/servo Source-Revision: dbd4adf3b266fb8d02cb717bc255c04f0fe41c05 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : b024b9d4b46a80c7c8d69c4473cae0617613d68b --- servo/components/style/properties/longhand/font.mako.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/servo/components/style/properties/longhand/font.mako.rs b/servo/components/style/properties/longhand/font.mako.rs index 191dca525742..dc9814c18290 100644 --- a/servo/components/style/properties/longhand/font.mako.rs +++ b/servo/components/style/properties/longhand/font.mako.rs @@ -1315,6 +1315,7 @@ ${helpers.single_keyword_system("font-kerning", } +#[cfg(any(feature = "gecko", feature = "testing"))] macro_rules! exclusive_value { (($value:ident, $set:expr) => $ident:ident) => { if $value.intersects($set) { From 85b8864f71b4c6d1e313bc8c4f1204981a751b87 Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Fri, 19 May 2017 20:57:44 -0400 Subject: [PATCH 47/56] Bug 1366415: Unprefix mozAutoGainControl and mozNoiseSuppression w/deprecation warnings. r=jesup,smaug MozReview-Commit-ID: EdWjSsIhtIM --HG-- extra : rebase_source : 373bf802ae7a0f957770f2f6ec18fa4cc6c736da --- dom/locales/en-US/chrome/dom/dom.properties | 4 ++ dom/media/MediaManager.cpp | 37 ++++++++++++++----- .../test_getUserMedia_constraints.html | 7 ++-- dom/media/webrtc/MediaEngineWebRTCAudio.cpp | 12 +++--- dom/media/webrtc/MediaTrackConstraints.cpp | 36 ++++++++++++++++-- dom/media/webrtc/MediaTrackConstraints.h | 21 ++++++++--- dom/webidl/MediaStreamTrack.webidl | 4 ++ dom/webidl/MediaTrackSettings.webidl | 6 +-- .../MediaTrackSupportedConstraints.webidl | 4 +- 9 files changed, 97 insertions(+), 34 deletions(-) diff --git a/dom/locales/en-US/chrome/dom/dom.properties b/dom/locales/en-US/chrome/dom/dom.properties index ec9b4a0dcbec..45b668ede27f 100644 --- a/dom/locales/en-US/chrome/dom/dom.properties +++ b/dom/locales/en-US/chrome/dom/dom.properties @@ -327,6 +327,10 @@ GeolocationInsecureRequestIsForbidden=A Geolocation request can only be fulfille LargeAllocationNonWin32=This page would be loaded in a new process due to a Large-Allocation header, however Large-Allocation process creation is disabled on non-Win32 platforms. # LOCALIZATION NOTE: Do not translate URL.createObjectURL(MediaStream). URLCreateObjectURL_MediaStream=URL.createObjectURL(MediaStream) is deprecated and will be removed soon. +# LOCALIZATION NOTE: Do not translate MozAutoGainControl or autoGainControl. +MozAutoGainControlWarning=mozAutoGainControl is deprecated. Use autoGainControl instead. +# LOCALIZATION NOTE: Do not translate mozNoiseSuppression or noiseSuppression. +MozNoiseSuppressionWarning=mozNoiseSuppression is deprecated. Use noiseSuppression instead. # LOCALIZATION NOTE: Do not translate xml:base. XMLBaseAttributeWarning=Use of xml:base attribute is deprecated and will be removed soon. Please remove any use of it. # LOCALIZATION NOTE: %S is the tag name of the element that starts the loop diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp index 7fc68c359c46..f1433605f52e 100644 --- a/dom/media/MediaManager.cpp +++ b/dom/media/MediaManager.cpp @@ -2234,6 +2234,14 @@ MediaManager::GetUserMedia(nsPIDOMWindowInner* aWindow, if (c.mAudio.IsMediaTrackConstraints()) { auto& ac = c.mAudio.GetAsMediaTrackConstraints(); + MediaConstraintsHelper::ConvertOldWithWarning(ac.mMozAutoGainControl, + ac.mAutoGainControl, + "MozAutoGainControlWarning", + aWindow); + MediaConstraintsHelper::ConvertOldWithWarning(ac.mMozNoiseSuppression, + ac.mNoiseSuppression, + "MozNoiseSuppressionWarning", + aWindow); audioType = StringToEnum(dom::MediaSourceEnumValues::strings, ac.mMediaSource, MediaSourceEnum::Other); @@ -3775,10 +3783,11 @@ SourceListener::CapturingBrowser() const } already_AddRefed -SourceListener::ApplyConstraintsToTrack(nsPIDOMWindowInner* aWindow, - TrackID aTrackID, - const dom::MediaTrackConstraints& aConstraints, - dom::CallerType aCallerType) +SourceListener::ApplyConstraintsToTrack( + nsPIDOMWindowInner* aWindow, + TrackID aTrackID, + const MediaTrackConstraints& aConstraintsPassedIn, + dom::CallerType aCallerType) { MOZ_ASSERT(NS_IsMainThread()); RefPtr p = new PledgeVoid(); @@ -3797,6 +3806,16 @@ SourceListener::ApplyConstraintsToTrack(nsPIDOMWindowInner* aWindow, p->Resolve(false); return p.forget(); } + MediaTrackConstraints c(aConstraintsPassedIn); // use a modifiable copy + + MediaConstraintsHelper::ConvertOldWithWarning(c.mMozAutoGainControl, + c.mAutoGainControl, + "MozAutoGainControlWarning", + aWindow); + MediaConstraintsHelper::ConvertOldWithWarning(c.mMozNoiseSuppression, + c.mNoiseSuppression, + "MozNoiseSuppressionWarning", + aWindow); RefPtr mgr = MediaManager::GetInstance(); uint32_t id = mgr->mOutstandingVoidPledges.Append(*p); @@ -3805,27 +3824,27 @@ SourceListener::ApplyConstraintsToTrack(nsPIDOMWindowInner* aWindow, MediaManager::PostTask(NewTaskFrom([id, windowId, audioDevice, videoDevice, - aConstraints, isChrome]() mutable { + c, isChrome]() mutable { MOZ_ASSERT(MediaManager::IsInMediaThread()); RefPtr mgr = MediaManager::GetInstance(); const char* badConstraint = nullptr; nsresult rv = NS_OK; if (audioDevice) { - rv = audioDevice->Restart(aConstraints, mgr->mPrefs, &badConstraint); + rv = audioDevice->Restart(c, mgr->mPrefs, &badConstraint); if (rv == NS_ERROR_NOT_AVAILABLE && !badConstraint) { nsTArray> audios; audios.AppendElement(audioDevice); badConstraint = MediaConstraintsHelper::SelectSettings( - NormalizedConstraints(aConstraints), audios, isChrome); + NormalizedConstraints(c), audios, isChrome); } } else { - rv = videoDevice->Restart(aConstraints, mgr->mPrefs, &badConstraint); + rv = videoDevice->Restart(c, mgr->mPrefs, &badConstraint); if (rv == NS_ERROR_NOT_AVAILABLE && !badConstraint) { nsTArray> videos; videos.AppendElement(videoDevice); badConstraint = MediaConstraintsHelper::SelectSettings( - NormalizedConstraints(aConstraints), videos, isChrome); + NormalizedConstraints(c), videos, isChrome); } } NS_DispatchToMainThread(NewRunnableFrom([id, windowId, rv, diff --git a/dom/media/tests/mochitest/test_getUserMedia_constraints.html b/dom/media/tests/mochitest/test_getUserMedia_constraints.html index 5605d7c93324..f739b634def8 100644 --- a/dom/media/tests/mochitest/test_getUserMedia_constraints.html +++ b/dom/media/tests/mochitest/test_getUserMedia_constraints.html @@ -74,9 +74,10 @@ var tests = [ var mustSupport = [ 'width', 'height', 'frameRate', 'facingMode', 'deviceId', + 'echoCancellation', 'noiseSuppression', 'autoGainControl', + // Yet to add: - // 'aspectRatio', 'frameRate', 'volume', 'sampleRate', 'sampleSize', - // 'latency', 'groupId' + // 'aspectRatio', 'volume', 'sampleRate', 'sampleSize', 'latency', 'groupId' // http://fluffy.github.io/w3c-screen-share/#screen-based-video-constraints // OBE by http://w3c.github.io/mediacapture-screen-share @@ -85,8 +86,6 @@ var mustSupport = [ // Experimental https://bugzilla.mozilla.org/show_bug.cgi?id=1131568#c3 'browserWindow', 'scrollWithPage', 'viewportOffsetX', 'viewportOffsetY', 'viewportWidth', 'viewportHeight', - - 'echoCancellation', 'mozNoiseSuppression', 'mozAutoGainControl' ]; var mustFailWith = (msg, reason, constraint, f) => diff --git a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp index 62ed88c3fa45..2e52a26ffaef 100644 --- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp +++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp @@ -215,8 +215,8 @@ MediaEngineWebRTCMicrophoneSource::MediaEngineWebRTCMicrophoneSource( mDeviceUUID.Assign(uuid); mListener = new mozilla::WebRTCAudioDataListener(this); mSettings.mEchoCancellation.Construct(0); - mSettings.mMozAutoGainControl.Construct(0); - mSettings.mMozNoiseSuppression.Construct(0); + mSettings.mAutoGainControl.Construct(0); + mSettings.mNoiseSuppression.Construct(0); // We'll init lazily as needed } @@ -286,8 +286,8 @@ MediaEngineWebRTCMicrophoneSource::UpdateSingleSource( MediaEnginePrefs prefs = aPrefs; prefs.mAecOn = c.mEchoCancellation.Get(prefs.mAecOn); - prefs.mAgcOn = c.mMozAutoGainControl.Get(prefs.mAgcOn); - prefs.mNoiseOn = c.mMozNoiseSuppression.Get(prefs.mNoiseOn); + prefs.mAgcOn = c.mAutoGainControl.Get(prefs.mAgcOn); + prefs.mNoiseOn = c.mNoiseSuppression.Get(prefs.mNoiseOn); LOG(("Audio config: aec: %d, agc: %d, noise: %d, delay: %d", prefs.mAecOn ? prefs.mAec : -1, @@ -382,8 +382,8 @@ MediaEngineWebRTCMicrophoneSource::SetLastPrefs( NS_DispatchToMainThread(media::NewRunnableFrom([that, aPrefs]() mutable { that->mSettings.mEchoCancellation.Value() = aPrefs.mAecOn; - that->mSettings.mMozAutoGainControl.Value() = aPrefs.mAgcOn; - that->mSettings.mMozNoiseSuppression.Value() = aPrefs.mNoiseOn; + that->mSettings.mAutoGainControl.Value() = aPrefs.mAgcOn; + that->mSettings.mNoiseSuppression.Value() = aPrefs.mNoiseOn; return NS_OK; })); } diff --git a/dom/media/webrtc/MediaTrackConstraints.cpp b/dom/media/webrtc/MediaTrackConstraints.cpp index 2b4d4cafc753..a0ad986568ae 100644 --- a/dom/media/webrtc/MediaTrackConstraints.cpp +++ b/dom/media/webrtc/MediaTrackConstraints.cpp @@ -4,6 +4,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "MediaTrackConstraints.h" +#include "nsIScriptError.h" #include "mozilla/dom/MediaStreamTrackBinding.h" #include @@ -371,11 +372,11 @@ FlattenedConstraints::FlattenedConstraints(const NormalizedConstraints& aOther) if (mEchoCancellation.Intersects(set.mEchoCancellation)) { mEchoCancellation.Intersect(set.mEchoCancellation); } - if (mMozNoiseSuppression.Intersects(set.mMozNoiseSuppression)) { - mMozNoiseSuppression.Intersect(set.mMozNoiseSuppression); + if (mNoiseSuppression.Intersects(set.mNoiseSuppression)) { + mNoiseSuppression.Intersect(set.mNoiseSuppression); } - if (mMozAutoGainControl.Intersects(set.mMozAutoGainControl)) { - mMozAutoGainControl.Intersect(set.mMozAutoGainControl); + if (mAutoGainControl.Intersects(set.mAutoGainControl)) { + mAutoGainControl.Intersect(set.mAutoGainControl); } } } @@ -469,4 +470,31 @@ MediaConstraintsHelper::FindBadConstraint( return FindBadConstraint(aConstraints, devices); } +void +MediaConstraintsHelper::ConvertOldWithWarning( + const dom::OwningBooleanOrConstrainBooleanParameters& old, + dom::OwningBooleanOrConstrainBooleanParameters& to, + const char* aMessageName, + nsPIDOMWindowInner* aWindow) { + if ((old.IsBoolean() || + old.GetAsConstrainBooleanParameters().mExact.WasPassed() || + old.GetAsConstrainBooleanParameters().mIdeal.WasPassed()) && + !(to.IsBoolean() || + to.GetAsConstrainBooleanParameters().mExact.WasPassed() || + to.GetAsConstrainBooleanParameters().mIdeal.WasPassed())) { + nsCOMPtr doc = aWindow->GetDoc(); + if (doc) { + nsContentUtils::ReportToConsole(nsIScriptError::warningFlag, + NS_LITERAL_CSTRING("DOM"), doc, + nsContentUtils::eDOM_PROPERTIES, + aMessageName); + } + if (old.IsBoolean()) { + to.SetAsBoolean() = old.GetAsBoolean(); + } else { + to.SetAsConstrainBooleanParameters() = old.GetAsConstrainBooleanParameters(); + } + } +} + } diff --git a/dom/media/webrtc/MediaTrackConstraints.h b/dom/media/webrtc/MediaTrackConstraints.h index 842fea0d2dcc..5c0878030cb5 100644 --- a/dom/media/webrtc/MediaTrackConstraints.h +++ b/dom/media/webrtc/MediaTrackConstraints.h @@ -225,7 +225,7 @@ public: BooleanRange mScrollWithPage; StringRange mDeviceId; LongRange mViewportOffsetX, mViewportOffsetY, mViewportWidth, mViewportHeight; - BooleanRange mEchoCancellation, mMozNoiseSuppression, mMozAutoGainControl; + BooleanRange mEchoCancellation, mNoiseSuppression, mAutoGainControl; private: typedef NormalizedConstraintSet T; public: @@ -254,11 +254,11 @@ public: aOther.mViewportHeight, advanced, aList) , mEchoCancellation(&T::mEchoCancellation, "echoCancellation", aOther.mEchoCancellation, advanced, aList) - , mMozNoiseSuppression(&T::mMozNoiseSuppression, "mozNoiseSuppression", - aOther.mMozNoiseSuppression, - advanced, aList) - , mMozAutoGainControl(&T::mMozAutoGainControl, "mozAutoGainControl", - aOther.mMozAutoGainControl, advanced, aList) {} + , mNoiseSuppression(&T::mNoiseSuppression, "noiseSuppression", + aOther.mNoiseSuppression, + advanced, aList) + , mAutoGainControl(&T::mAutoGainControl, "autoGainControl", + aOther.mAutoGainControl, advanced, aList) {} }; template<> bool NormalizedConstraintSet::Range::Merge(const Range& aOther); @@ -442,6 +442,15 @@ public: FindBadConstraint(const NormalizedConstraints& aConstraints, const MediaEngineSourceType& aMediaEngineSource, const nsString& aDeviceId); + + // Warn on and convert use of deprecated constraints to new ones + + static void + ConvertOldWithWarning( + const dom::OwningBooleanOrConstrainBooleanParameters& old, + dom::OwningBooleanOrConstrainBooleanParameters& to, + const char* aMessageName, + nsPIDOMWindowInner* aWindow); }; } // namespace mozilla diff --git a/dom/webidl/MediaStreamTrack.webidl b/dom/webidl/MediaStreamTrack.webidl index 2487885e4c0a..f4233ccb5fa5 100644 --- a/dom/webidl/MediaStreamTrack.webidl +++ b/dom/webidl/MediaStreamTrack.webidl @@ -55,6 +55,10 @@ dictionary MediaTrackConstraintSet { ConstrainLong viewportWidth; ConstrainLong viewportHeight; ConstrainBoolean echoCancellation; + ConstrainBoolean noiseSuppression; + ConstrainBoolean autoGainControl; + + // Deprecated with warnings: ConstrainBoolean mozNoiseSuppression; ConstrainBoolean mozAutoGainControl; }; diff --git a/dom/webidl/MediaTrackSettings.webidl b/dom/webidl/MediaTrackSettings.webidl index 909b9f60b3d3..3e23ef5f905b 100644 --- a/dom/webidl/MediaTrackSettings.webidl +++ b/dom/webidl/MediaTrackSettings.webidl @@ -14,8 +14,8 @@ dictionary MediaTrackSettings { DOMString facingMode; DOMString deviceId; boolean echoCancellation; - boolean mozNoiseSuppression; - boolean mozAutoGainControl; + boolean noiseSuppression; + boolean autoGainControl; // Mozilla-specific extensions: @@ -33,4 +33,4 @@ dictionary MediaTrackSettings { long viewportOffsetY; long viewportWidth; long viewportHeight; -}; \ No newline at end of file +}; diff --git a/dom/webidl/MediaTrackSupportedConstraints.webidl b/dom/webidl/MediaTrackSupportedConstraints.webidl index 31616ada7286..e169393f06af 100644 --- a/dom/webidl/MediaTrackSupportedConstraints.webidl +++ b/dom/webidl/MediaTrackSupportedConstraints.webidl @@ -17,8 +17,8 @@ dictionary MediaTrackSupportedConstraints { boolean sampleRate; // to be supported boolean sampleSize; // to be supported boolean echoCancellation = true; - boolean mozNoiseSuppression = true; - boolean mozAutoGainControl = true; + boolean noiseSuppression = true; + boolean autoGainControl = true; boolean latency; // to be supported boolean deviceId = true; boolean groupId; // to be supported From 7666f7ec85a8161fdf16907ad15c93762032c1de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 20 May 2017 21:11:38 -0500 Subject: [PATCH 48/56] servo: Merge #16972 - style: Move all the style sharing code outside matching.rs (from emilio:sanity-is-important-most-of-the-time); r=bholley This is just a code health change. I want to move it away to keep matching.rs as simple as possible. Source-Repo: https://github.com/servo/servo Source-Revision: 03fbea4ec8af3ef6c5c621974b3c52cd755ed287 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 9c40723f62f8a51aebeda92f90d7b148498fa820 --- servo/components/style/context.rs | 2 +- servo/components/style/lib.rs | 1 + servo/components/style/matching.rs | 551 +++-------------------- servo/components/style/sharing/checks.rs | 141 ++++++ servo/components/style/sharing/mod.rs | 384 ++++++++++++++++ servo/components/style/traversal.rs | 5 +- 6 files changed, 585 insertions(+), 499 deletions(-) create mode 100644 servo/components/style/sharing/checks.rs create mode 100644 servo/components/style/sharing/mod.rs diff --git a/servo/components/style/context.rs b/servo/components/style/context.rs index a628ef1377f3..f0fadc4bd36c 100644 --- a/servo/components/style/context.rs +++ b/servo/components/style/context.rs @@ -17,13 +17,13 @@ use euclid::Size2D; use fnv::FnvHashMap; use font_metrics::FontMetricsProvider; #[cfg(feature = "gecko")] use gecko_bindings::structs; -use matching::StyleSharingCandidateCache; #[cfg(feature = "servo")] use parking_lot::RwLock; #[cfg(feature = "gecko")] use properties::ComputedValues; use selector_parser::SnapshotMap; use selectors::matching::ElementSelectorFlags; #[cfg(feature = "servo")] use servo_config::opts; use shared_lock::StylesheetGuards; +use sharing::StyleSharingCandidateCache; #[cfg(feature = "servo")] use std::collections::HashMap; #[cfg(feature = "gecko")] use std::env; use std::fmt; diff --git a/servo/components/style/lib.rs b/servo/components/style/lib.rs index 98745ef2b3ee..c294885aed6b 100644 --- a/servo/components/style/lib.rs +++ b/servo/components/style/lib.rs @@ -121,6 +121,7 @@ pub mod rule_tree; pub mod scoped_tls; pub mod selector_parser; pub mod shared_lock; +pub mod sharing; pub mod stylist; #[cfg(feature = "servo")] #[allow(unsafe_code)] pub mod servo; pub mod sequential; diff --git a/servo/components/style/matching.rs b/servo/components/style/matching.rs index 59f2a19912d1..12fb21931ea8 100644 --- a/servo/components/style/matching.rs +++ b/servo/components/style/matching.rs @@ -7,14 +7,11 @@ #![allow(unsafe_code)] #![deny(missing_docs)] -use Atom; use atomic_refcell::AtomicRefMut; -use bit_vec::BitVec; -use cache::{LRUCache, LRUCacheMutIterator}; use cascade_info::CascadeInfo; -use context::{CurrentElementInfo, SelectorFlagsMap, SharedStyleContext, StyleContext}; -use data::{ComputedStyle, ElementData, ElementStyles, RestyleData}; -use dom::{AnimationRules, SendElement, TElement, TNode}; +use context::{SelectorFlagsMap, SharedStyleContext, StyleContext}; +use data::{ComputedStyle, ElementData, RestyleData}; +use dom::{AnimationRules, TElement, TNode}; use font_metrics::FontMetricsProvider; use log::LogLevel::Trace; use properties::{CascadeFlags, ComputedValues, SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP, cascade}; @@ -23,11 +20,10 @@ use restyle_hints::{RESTYLE_CSS_ANIMATIONS, RESTYLE_CSS_TRANSITIONS, RestyleRepl use restyle_hints::{RESTYLE_STYLE_ATTRIBUTE, RESTYLE_SMIL}; use rule_tree::{CascadeLevel, RuleTree, StrongRuleNode}; use selector_parser::{PseudoElement, RestyleDamage, SelectorImpl}; -use selectors::bloom::BloomFilter; use selectors::matching::{ElementSelectorFlags, MatchingContext, MatchingMode, StyleRelations}; use selectors::matching::AFFECTED_BY_PSEUDO_ELEMENTS; use shared_lock::StylesheetGuards; -use sink::ForgetfulSink; +use sharing::{StyleSharingBehavior, StyleSharingResult}; use stylearc::Arc; use stylist::ApplicableDeclarationList; @@ -42,16 +38,6 @@ enum InheritMode { FromPrimaryStyle, } -/// Determines the amount of relations where we're going to share style. -#[inline] -fn relations_are_shareable(relations: &StyleRelations) -> bool { - use selectors::matching::*; - !relations.intersects(AFFECTED_BY_ID_SELECTOR | - AFFECTED_BY_PSEUDO_ELEMENTS | - AFFECTED_BY_STYLE_ATTRIBUTE | - AFFECTED_BY_PRESENTATIONAL_HINTS) -} - /// Represents the result of comparing an element's old and new style. pub struct StyleDifference { /// The resulting damage. @@ -80,336 +66,6 @@ pub enum StyleChange { Changed, } -/// Information regarding a style sharing candidate. -/// -/// Note that this information is stored in TLS and cleared after the traversal, -/// and once here, the style information of the element is immutable, so it's -/// safe to access. -/// -/// TODO: We can stick a lot more info here. -#[derive(Debug)] -struct StyleSharingCandidate { - /// The element. We use SendElement here so that the cache may live in - /// ScopedTLS. - element: SendElement, - /// The cached class names. - class_attributes: Option>, - /// The cached result of matching this entry against the revalidation selectors. - revalidation_match_results: Option, -} - -impl PartialEq> for StyleSharingCandidate { - fn eq(&self, other: &Self) -> bool { - self.element == other.element - } -} - -/// An LRU cache of the last few nodes seen, so that we can aggressively try to -/// reuse their styles. -/// -/// Note that this cache is flushed every time we steal work from the queue, so -/// storing nodes here temporarily is safe. -pub struct StyleSharingCandidateCache { - cache: LRUCache>, -} - -/// A cache miss result. -#[derive(Clone, Debug)] -pub enum CacheMiss { - /// The parents don't match. - Parent, - /// One element was NAC, while the other wasn't. - NativeAnonymousContent, - /// The local name of the element and the candidate don't match. - LocalName, - /// The namespace of the element and the candidate don't match. - Namespace, - /// One of the element or the candidate was a link, but the other one - /// wasn't. - Link, - /// The element and the candidate match different kind of rules. This can - /// only happen in Gecko. - UserAndAuthorRules, - /// The element and the candidate are in a different state. - State, - /// The element had an id attribute, which qualifies for a unique style. - IdAttr, - /// The element had a style attribute, which qualifies for a unique style. - StyleAttr, - /// The element and the candidate class names didn't match. - Class, - /// The presentation hints didn't match. - PresHints, - /// The element and the candidate didn't match the same set of revalidation - /// selectors. - Revalidation, -} - -fn same_computed_values(first: Option, second: Option) -> bool { - let (a, b) = match (first, second) { - (Some(f), Some(s)) => (f, s), - _ => return false, - }; - - let eq = Arc::ptr_eq(a.borrow_data().unwrap().styles().primary.values(), - b.borrow_data().unwrap().styles().primary.values()); - eq -} - -fn element_matches_candidate(element: &E, - candidate: &mut StyleSharingCandidate, - candidate_element: &E, - shared: &SharedStyleContext, - bloom: &BloomFilter, - info: &mut CurrentElementInfo, - selector_flags_map: &mut SelectorFlagsMap) - -> Result { - macro_rules! miss { - ($miss: ident) => { - return Err(CacheMiss::$miss); - } - } - - // Check that we have the same parent, or at least the same pointer identity - // for parent computed style. The latter check allows us to share style - // between cousins if the parents shared style. - let parent = element.parent_element(); - let candidate_parent = candidate_element.parent_element(); - if parent != candidate_parent && !same_computed_values(parent, candidate_parent) { - miss!(Parent) - } - - if element.is_native_anonymous() { - debug_assert!(!candidate_element.is_native_anonymous(), - "Why inserting NAC into the cache?"); - miss!(NativeAnonymousContent) - } - - if *element.get_local_name() != *candidate_element.get_local_name() { - miss!(LocalName) - } - - if *element.get_namespace() != *candidate_element.get_namespace() { - miss!(Namespace) - } - - if element.is_link() != candidate_element.is_link() { - miss!(Link) - } - - if element.matches_user_and_author_rules() != candidate_element.matches_user_and_author_rules() { - miss!(UserAndAuthorRules) - } - - if element.get_state() != candidate_element.get_state() { - miss!(State) - } - - if element.get_id() != candidate_element.get_id() { - miss!(IdAttr) - } - - if element.style_attribute().is_some() { - miss!(StyleAttr) - } - - if !have_same_class(element, candidate, candidate_element) { - miss!(Class) - } - - if has_presentational_hints(element) { - miss!(PresHints) - } - - if !revalidate(element, candidate, candidate_element, - shared, bloom, info, selector_flags_map) { - miss!(Revalidation) - } - - let data = candidate_element.borrow_data().unwrap(); - debug_assert!(element.has_current_styles(&data)); - let current_styles = data.styles(); - - debug!("Sharing style between {:?} and {:?}", element, candidate_element); - - Ok(current_styles.primary.clone()) -} - -fn has_presentational_hints(element: &E) -> bool { - let mut hints = ForgetfulSink::new(); - element.synthesize_presentational_hints_for_legacy_attributes(&mut hints); - !hints.is_empty() -} - -fn have_same_class(element: &E, - candidate: &mut StyleSharingCandidate, - candidate_element: &E) -> bool { - // XXX Efficiency here, I'm only validating ideas. - let mut element_class_attributes = vec![]; - element.each_class(|c| element_class_attributes.push(c.clone())); - - if candidate.class_attributes.is_none() { - let mut attrs = vec![]; - candidate_element.each_class(|c| attrs.push(c.clone())); - candidate.class_attributes = Some(attrs) - } - - element_class_attributes == *candidate.class_attributes.as_ref().unwrap() -} - -#[inline] -fn revalidate(element: &E, - candidate: &mut StyleSharingCandidate, - candidate_element: &E, - shared: &SharedStyleContext, - bloom: &BloomFilter, - info: &mut CurrentElementInfo, - selector_flags_map: &mut SelectorFlagsMap) - -> bool { - // NB: We could avoid matching ancestor selectors entirely (rather than - // just depending on the bloom filter), at the expense of some complexity. - // Gecko bug 1354965 tracks this. - // - // We could also be even more careful about only matching the minimal number - // of revalidation selectors until we find a mismatch. Gecko bug 1355668 - // tracks this. - // - // These potential optimizations may not be worth the complexity. - let stylist = &shared.stylist; - - if info.revalidation_match_results.is_none() { - // It's important to set the selector flags. Otherwise, if we succeed in - // sharing the style, we may not set the slow selector flags for the - // right elements (which may not necessarily be |element|), causing missed - // restyles after future DOM mutations. - // - // Gecko's test_bug534804.html exercises this. A minimal testcase is: - // - // - // - // - // - // - // The style sharing cache will get a hit for the second span. When the - // child span is subsequently removed from the DOM, missing selector - // flags would cause us to miss the restyle on the second span. - let mut set_selector_flags = |el: &E, flags: ElementSelectorFlags| { - element.apply_selector_flags(selector_flags_map, el, flags); - }; - info.revalidation_match_results = - Some(stylist.match_revalidation_selectors(element, bloom, - &mut set_selector_flags)); - } - - if candidate.revalidation_match_results.is_none() { - candidate.revalidation_match_results = - Some(stylist.match_revalidation_selectors(candidate_element, bloom, - &mut |_, _| {})); - } - - let for_element = info.revalidation_match_results.as_ref().unwrap(); - let for_candidate = candidate.revalidation_match_results.as_ref().unwrap(); - debug_assert!(for_element.len() == for_candidate.len()); - for_element == for_candidate -} - -static STYLE_SHARING_CANDIDATE_CACHE_SIZE: usize = 8; - -impl StyleSharingCandidateCache { - /// Create a new style sharing candidate cache. - pub fn new() -> Self { - StyleSharingCandidateCache { - cache: LRUCache::new(STYLE_SHARING_CANDIDATE_CACHE_SIZE), - } - } - - /// Returns the number of entries in the cache. - pub fn num_entries(&self) -> usize { - self.cache.num_entries() - } - - fn iter_mut(&mut self) -> LRUCacheMutIterator> { - self.cache.iter_mut() - } - - /// Tries to insert an element in the style sharing cache. - /// - /// Fails if we know it should never be in the cache. - pub fn insert_if_possible(&mut self, - element: &E, - style: &Arc, - relations: StyleRelations, - revalidation_match_results: Option) { - let parent = match element.parent_element() { - Some(element) => element, - None => { - debug!("Failing to insert to the cache: no parent element"); - return; - } - }; - - if element.is_native_anonymous() { - debug!("Failing to insert into the cache: NAC"); - return; - } - - // These are things we don't check in the candidate match because they - // are either uncommon or expensive. - if !relations_are_shareable(&relations) { - debug!("Failing to insert to the cache: {:?}", relations); - return; - } - - // Make sure we noted any presentational hints in the StyleRelations. - if cfg!(debug_assertions) { - let mut hints = ForgetfulSink::new(); - element.synthesize_presentational_hints_for_legacy_attributes(&mut hints); - debug_assert!(hints.is_empty(), "Style relations should not be shareable!"); - } - - let box_style = style.get_box(); - if box_style.specifies_transitions() { - debug!("Failing to insert to the cache: transitions"); - return; - } - - if box_style.specifies_animations() { - debug!("Failing to insert to the cache: animations"); - return; - } - - debug!("Inserting into cache: {:?} with parent {:?}", - element, parent); - - self.cache.insert(StyleSharingCandidate { - element: unsafe { SendElement::new(*element) }, - class_attributes: None, - revalidation_match_results: revalidation_match_results, - }); - } - - /// Touch a given index in the style sharing candidate cache. - pub fn touch(&mut self, index: usize) { - self.cache.touch(index); - } - - /// Clear the style sharing candidate cache. - pub fn clear(&mut self) { - self.cache.evict_all() - } -} - -/// The results of attempting to share a style. -pub enum StyleSharingResult { - /// We didn't find anybody to share the style with. - CannotShare, - /// The node's style can be shared. The integer specifies the index in the - /// LRU cache that was hit and the damage that was done. The - /// `ChildCascadeRequirement` indicates whether style changes due to using - /// the shared style mean we need to recascade to children. - StyleWasShared(usize, ChildCascadeRequirement), -} - /// Whether or not newly computed values for an element need to be cascade /// to children. pub enum ChildCascadeRequirement { @@ -838,43 +494,6 @@ trait PrivateMatchMethods: TElement { } } - /// Computes and applies restyle damage. - fn accumulate_damage(&self, - shared_context: &SharedStyleContext, - restyle: Option<&mut RestyleData>, - old_values: Option<&ComputedValues>, - new_values: &Arc, - pseudo: Option<&PseudoElement>) - -> ChildCascadeRequirement { - let restyle = match restyle { - Some(r) => r, - None => return ChildCascadeRequirement::MustCascade, - }; - - let old_values = match old_values { - Some(v) => v, - None => return ChildCascadeRequirement::MustCascade, - }; - - // ::before and ::after are element-backed in Gecko, so they do the - // damage calculation for themselves, when there's an actual pseudo. - let is_existing_before_or_after = - cfg!(feature = "gecko") && - pseudo.map_or(false, |p| p.is_before_or_after()) && - self.existing_style_for_restyle_damage(old_values, pseudo) - .is_some(); - - if is_existing_before_or_after { - return ChildCascadeRequirement::CanSkipCascade; - } - - self.accumulate_damage_for(shared_context, - restyle, - old_values, - new_values, - pseudo) - } - /// Computes and applies non-redundant damage. #[cfg(feature = "gecko")] fn accumulate_damage_for(&self, @@ -966,18 +585,6 @@ trait PrivateMatchMethods: TElement { } } } - - fn share_style_with_candidate_if_possible(&self, - candidate: &mut StyleSharingCandidate, - shared: &SharedStyleContext, - bloom: &BloomFilter, - info: &mut CurrentElementInfo, - selector_flags_map: &mut SelectorFlagsMap) - -> Result { - let candidate_element = *candidate.element; - element_matches_candidate(self, candidate, &candidate_element, - shared, bloom, info, selector_flags_map) - } } fn compute_rule_node(rule_tree: &RuleTree, @@ -992,15 +599,6 @@ fn compute_rule_node(rule_tree: &RuleTree, impl PrivateMatchMethods for E {} -/// Controls whether the style sharing cache is used. -#[derive(Clone, Copy, PartialEq)] -pub enum StyleSharingBehavior { - /// Style sharing allowed. - Allow, - /// Style sharing disallowed. - Disallow, -} - /// The public API that elements expose for selector matching. pub trait MatchMethods : TElement { /// Performs selector matching and property cascading on an element and its @@ -1008,7 +606,8 @@ pub trait MatchMethods : TElement { fn match_and_cascade(&self, context: &mut StyleContext, data: &mut ElementData, - sharing: StyleSharingBehavior) -> ChildCascadeRequirement + sharing: StyleSharingBehavior) + -> ChildCascadeRequirement { // Perform selector matching for the primary style. let mut relations = StyleRelations::empty(); @@ -1323,6 +922,43 @@ pub trait MatchMethods : TElement { } } + /// Computes and applies restyle damage. + fn accumulate_damage(&self, + shared_context: &SharedStyleContext, + restyle: Option<&mut RestyleData>, + old_values: Option<&ComputedValues>, + new_values: &Arc, + pseudo: Option<&PseudoElement>) + -> ChildCascadeRequirement { + let restyle = match restyle { + Some(r) => r, + None => return ChildCascadeRequirement::MustCascade, + }; + + let old_values = match old_values { + Some(v) => v, + None => return ChildCascadeRequirement::MustCascade, + }; + + // ::before and ::after are element-backed in Gecko, so they do the + // damage calculation for themselves, when there's an actual pseudo. + let is_existing_before_or_after = + cfg!(feature = "gecko") && + pseudo.map_or(false, |p| p.is_before_or_after()) && + self.existing_style_for_restyle_damage(old_values, pseudo) + .is_some(); + + if is_existing_before_or_after { + return ChildCascadeRequirement::CanSkipCascade; + } + + self.accumulate_damage_for(shared_context, + restyle, + old_values, + new_values, + pseudo) + } + /// Updates the rule nodes without re-running selector matching, using just /// the rule tree. Returns RulesChanged which indicates whether the rule nodes changed /// and whether the important rules changed. @@ -1407,99 +1043,22 @@ pub trait MatchMethods : TElement { /// system level yet. unsafe fn share_style_if_possible(&self, context: &mut StyleContext, - data: &mut AtomicRefMut) + data: &mut ElementData) -> StyleSharingResult { - if context.shared.options.disable_style_sharing_cache { - debug!("{:?} Cannot share style: style sharing cache disabled", self); - return StyleSharingResult::CannotShare - } - - if self.parent_element().is_none() { - debug!("{:?} Cannot share style: element has style attribute", self); - return StyleSharingResult::CannotShare - } - - if self.is_native_anonymous() { - debug!("{:?} Cannot share style: NAC", self); - return StyleSharingResult::CannotShare; - } - - if self.style_attribute().is_some() { - debug!("{:?} Cannot share style: element has style attribute", self); - return StyleSharingResult::CannotShare - } - - if self.has_attr(&ns!(), &local_name!("id")) { - debug!("{:?} Cannot share style: element has id", self); - return StyleSharingResult::CannotShare - } - - let cache = &mut context.thread_local.style_sharing_candidate_cache; + let shared_context = &context.shared; let current_element_info = - &mut context.thread_local.current_element_info.as_mut().unwrap(); - let bloom = context.thread_local.bloom_filter.filter(); + context.thread_local.current_element_info.as_mut().unwrap(); let selector_flags_map = &mut context.thread_local.selector_flags; - let mut should_clear_cache = false; - for (i, candidate) in cache.iter_mut().enumerate() { - let sharing_result = - self.share_style_with_candidate_if_possible(candidate, - &context.shared, - bloom, - current_element_info, - selector_flags_map); - match sharing_result { - Ok(shared_style) => { - // Yay, cache hit. Share the style. + let bloom_filter = context.thread_local.bloom_filter.filter(); - // Accumulate restyle damage. - debug_assert_eq!(data.has_styles(), data.has_restyle()); - let old_values = data.get_styles_mut() - .and_then(|s| s.primary.values.take()); - let child_cascade_requirement = - self.accumulate_damage(&context.shared, - data.get_restyle_mut(), - old_values.as_ref().map(|v| v.as_ref()), - shared_style.values(), - None); - - // We never put elements with pseudo style into the style - // sharing cache, so we can just mint an ElementStyles - // directly here. - // - // See https://bugzilla.mozilla.org/show_bug.cgi?id=1329361 - let styles = ElementStyles::new(shared_style); - data.set_styles(styles); - - return StyleSharingResult::StyleWasShared(i, child_cascade_requirement) - } - Err(miss) => { - debug!("Cache miss: {:?}", miss); - - // Cache miss, let's see what kind of failure to decide - // whether we keep trying or not. - match miss { - // Cache miss because of parent, clear the candidate cache. - CacheMiss::Parent => { - should_clear_cache = true; - break; - }, - // Too expensive failure, give up, we don't want another - // one of these. - CacheMiss::PresHints | - CacheMiss::Revalidation => break, - _ => {} - } - } - } - } - - debug!("{:?} Cannot share style: {} cache entries", self, cache.num_entries()); - - if should_clear_cache { - cache.clear(); - } - - StyleSharingResult::CannotShare + context.thread_local + .style_sharing_candidate_cache + .share_style_if_possible(shared_context, + current_element_info, + selector_flags_map, + bloom_filter, + *self, + data) } /// Given the old and new style of this element, and whether it's a diff --git a/servo/components/style/sharing/checks.rs b/servo/components/style/sharing/checks.rs new file mode 100644 index 000000000000..5cc5869e5099 --- /dev/null +++ b/servo/components/style/sharing/checks.rs @@ -0,0 +1,141 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//! Different checks done during the style sharing process in order to determine +//! quickly whether it's worth to share style, and whether two different +//! elements can indeed share the same style. + +use context::{CurrentElementInfo, SelectorFlagsMap, SharedStyleContext}; +use dom::TElement; +use matching::MatchMethods; +use selectors::bloom::BloomFilter; +use selectors::matching::{ElementSelectorFlags, StyleRelations}; +use sharing::StyleSharingCandidate; +use sink::ForgetfulSink; +use stylearc::Arc; + +/// Determines, based on the results of selector matching, whether it's worth to +/// try to share style with this element, that is, to try to insert the element +/// in the chache. +#[inline] +pub fn relations_are_shareable(relations: &StyleRelations) -> bool { + use selectors::matching::*; + !relations.intersects(AFFECTED_BY_ID_SELECTOR | + AFFECTED_BY_PSEUDO_ELEMENTS | + AFFECTED_BY_STYLE_ATTRIBUTE | + AFFECTED_BY_PRESENTATIONAL_HINTS) +} + +/// Whether, given two elements, they have pointer-equal computed values. +/// +/// Both elements need to be styled already. +/// +/// This is used to know whether we can share style across cousins (if the two +/// parents have the same style). +pub fn same_computed_values(first: Option, second: Option) -> bool + where E: TElement, +{ + let (a, b) = match (first, second) { + (Some(f), Some(s)) => (f, s), + _ => return false, + }; + + let eq = Arc::ptr_eq(a.borrow_data().unwrap().styles().primary.values(), + b.borrow_data().unwrap().styles().primary.values()); + eq +} + +/// Whether a given element has presentational hints. +/// +/// We consider not worth to share style with an element that has presentational +/// hints, both because implementing the code that compares that the hints are +/// equal is somewhat annoying, and also because it'd be expensive enough. +pub fn has_presentational_hints(element: E) -> bool + where E: TElement, +{ + let mut hints = ForgetfulSink::new(); + element.synthesize_presentational_hints_for_legacy_attributes(&mut hints); + !hints.is_empty() +} + +/// Whether a given element has the same class attribute than a given candidate. +/// +/// We don't try to share style across elements with different class attributes. +pub fn have_same_class(element: E, + candidate: &mut StyleSharingCandidate) + -> bool + where E: TElement, +{ + // XXX Efficiency here, I'm only validating ideas. + let mut element_class_attributes = vec![]; + element.each_class(|c| element_class_attributes.push(c.clone())); + + if candidate.class_attributes.is_none() { + let mut attrs = vec![]; + candidate.element.each_class(|c| attrs.push(c.clone())); + candidate.class_attributes = Some(attrs) + } + + element_class_attributes == *candidate.class_attributes.as_ref().unwrap() +} + +/// Whether a given element and a candidate match the same set of "revalidation" +/// selectors. +/// +/// Revalidation selectors are those that depend on the DOM structure, like +/// :first-child, etc, or on attributes that we don't check off-hand (pretty +/// much every attribute selector except `id` and `class`. +#[inline] +pub fn revalidate(element: E, + candidate: &mut StyleSharingCandidate, + shared_context: &SharedStyleContext, + bloom: &BloomFilter, + info: &mut CurrentElementInfo, + selector_flags_map: &mut SelectorFlagsMap) + -> bool + where E: TElement, +{ + let stylist = &shared_context.stylist; + + if info.revalidation_match_results.is_none() { + // It's important to set the selector flags. Otherwise, if we succeed in + // sharing the style, we may not set the slow selector flags for the + // right elements (which may not necessarily be |element|), causing + // missed restyles after future DOM mutations. + // + // Gecko's test_bug534804.html exercises this. A minimal testcase is: + // + // + // + // + // + // + // The style sharing cache will get a hit for the second span. When the + // child span is subsequently removed from the DOM, missing selector + // flags would cause us to miss the restyle on the second span. + let mut set_selector_flags = |el: &E, flags: ElementSelectorFlags| { + element.apply_selector_flags(selector_flags_map, el, flags); + }; + info.revalidation_match_results = + Some(stylist.match_revalidation_selectors(&element, bloom, + &mut set_selector_flags)); + } + + if candidate.revalidation_match_results.is_none() { + let results = + stylist.match_revalidation_selectors(&*candidate.element, bloom, + &mut |_, _| {}); + candidate.revalidation_match_results = Some(results); + } + + let for_element = info.revalidation_match_results.as_ref().unwrap(); + let for_candidate = candidate.revalidation_match_results.as_ref().unwrap(); + + // This assert "ensures", to some extent, that the two candidates have + // matched the same rulehash buckets, and as such, that the bits we're + // comparing represent the same set of selectors. + debug_assert_eq!(for_element.len(), for_candidate.len()); + + for_element == for_candidate +} diff --git a/servo/components/style/sharing/mod.rs b/servo/components/style/sharing/mod.rs new file mode 100644 index 000000000000..744571ca863f --- /dev/null +++ b/servo/components/style/sharing/mod.rs @@ -0,0 +1,384 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//! Code related to the style sharing cache, an optimization that allows similar +//! nodes to share style without having to run selector matching twice. + +use Atom; +use bit_vec::BitVec; +use cache::{LRUCache, LRUCacheMutIterator}; +use context::{CurrentElementInfo, SelectorFlagsMap, SharedStyleContext}; +use data::{ComputedStyle, ElementData, ElementStyles}; +use dom::{TElement, SendElement}; +use matching::{ChildCascadeRequirement, MatchMethods}; +use properties::ComputedValues; +use selectors::bloom::BloomFilter; +use selectors::matching::StyleRelations; +use sink::ForgetfulSink; + +mod checks; + +/// The amount of nodes that the style sharing candidate cache should hold at +/// most. +pub const STYLE_SHARING_CANDIDATE_CACHE_SIZE: usize = 8; + +/// Controls whether the style sharing cache is used. +#[derive(Clone, Copy, PartialEq)] +pub enum StyleSharingBehavior { + /// Style sharing allowed. + Allow, + /// Style sharing disallowed. + Disallow, +} + +/// Information regarding a style sharing candidate, that is, an entry in the +/// style sharing cache. +/// +/// Note that this information is stored in TLS and cleared after the traversal, +/// and once here, the style information of the element is immutable, so it's +/// safe to access. +/// +/// TODO: We can stick a lot more info here. +#[derive(Debug)] +pub struct StyleSharingCandidate { + /// The element. We use SendElement here so that the cache may live in + /// ScopedTLS. + element: SendElement, + /// The cached class names. + class_attributes: Option>, + /// The cached result of matching this entry against the revalidation selectors. + revalidation_match_results: Option, +} + +impl PartialEq> for StyleSharingCandidate { + fn eq(&self, other: &Self) -> bool { + self.element == other.element + } +} + +/// A cache miss result. +#[derive(Clone, Debug)] +pub enum CacheMiss { + /// The parents don't match. + Parent, + /// One element was NAC, while the other wasn't. + NativeAnonymousContent, + /// The local name of the element and the candidate don't match. + LocalName, + /// The namespace of the element and the candidate don't match. + Namespace, + /// One of the element or the candidate was a link, but the other one + /// wasn't. + Link, + /// The element and the candidate match different kind of rules. This can + /// only happen in Gecko. + UserAndAuthorRules, + /// The element and the candidate are in a different state. + State, + /// The element had an id attribute, which qualifies for a unique style. + IdAttr, + /// The element had a style attribute, which qualifies for a unique style. + StyleAttr, + /// The element and the candidate class names didn't match. + Class, + /// The presentation hints didn't match. + PresHints, + /// The element and the candidate didn't match the same set of revalidation + /// selectors. + Revalidation, +} + +/// The results of attempting to share a style. +pub enum StyleSharingResult { + /// We didn't find anybody to share the style with. + CannotShare, + /// The node's style can be shared. The integer specifies the index in the + /// LRU cache that was hit and the damage that was done. The + /// `ChildCascadeRequirement` indicates whether style changes due to using + /// the shared style mean we need to recascade to children. + StyleWasShared(usize, ChildCascadeRequirement), +} + +/// An LRU cache of the last few nodes seen, so that we can aggressively try to +/// reuse their styles. +/// +/// Note that this cache is flushed every time we steal work from the queue, so +/// storing nodes here temporarily is safe. +pub struct StyleSharingCandidateCache { + cache: LRUCache>, +} + +impl StyleSharingCandidateCache { + /// Create a new style sharing candidate cache. + pub fn new() -> Self { + StyleSharingCandidateCache { + cache: LRUCache::new(STYLE_SHARING_CANDIDATE_CACHE_SIZE), + } + } + + /// Returns the number of entries in the cache. + pub fn num_entries(&self) -> usize { + self.cache.num_entries() + } + + fn iter_mut(&mut self) -> LRUCacheMutIterator> { + self.cache.iter_mut() + } + + /// Tries to insert an element in the style sharing cache. + /// + /// Fails if we know it should never be in the cache. + pub fn insert_if_possible(&mut self, + element: &E, + style: &ComputedValues, + relations: StyleRelations, + revalidation_match_results: Option) { + let parent = match element.parent_element() { + Some(element) => element, + None => { + debug!("Failing to insert to the cache: no parent element"); + return; + } + }; + + if element.is_native_anonymous() { + debug!("Failing to insert into the cache: NAC"); + return; + } + + // These are things we don't check in the candidate match because they + // are either uncommon or expensive. + if !checks::relations_are_shareable(&relations) { + debug!("Failing to insert to the cache: {:?}", relations); + return; + } + + // Make sure we noted any presentational hints in the StyleRelations. + if cfg!(debug_assertions) { + let mut hints = ForgetfulSink::new(); + element.synthesize_presentational_hints_for_legacy_attributes(&mut hints); + debug_assert!(hints.is_empty(), + "Style relations should not be shareable!"); + } + + let box_style = style.get_box(); + if box_style.specifies_transitions() { + debug!("Failing to insert to the cache: transitions"); + return; + } + + if box_style.specifies_animations() { + debug!("Failing to insert to the cache: animations"); + return; + } + + debug!("Inserting into cache: {:?} with parent {:?}", element, parent); + + self.cache.insert(StyleSharingCandidate { + element: unsafe { SendElement::new(*element) }, + class_attributes: None, + revalidation_match_results: revalidation_match_results, + }); + } + + /// Touch a given index in the style sharing candidate cache. + pub fn touch(&mut self, index: usize) { + self.cache.touch(index); + } + + /// Clear the style sharing candidate cache. + pub fn clear(&mut self) { + self.cache.evict_all() + } + + /// Attempts to share a style with another node. + /// + /// This method is unsafe because it depends on the + /// `style_sharing_candidate_cache` having only live nodes in it, and we + /// have no way to guarantee that at the type system level yet. + pub unsafe fn share_style_if_possible( + &mut self, + shared_context: &SharedStyleContext, + current_element_info: &mut CurrentElementInfo, + selector_flags_map: &mut SelectorFlagsMap, + bloom_filter: &BloomFilter, + element: E, + data: &mut ElementData + ) -> StyleSharingResult { + if shared_context.options.disable_style_sharing_cache { + debug!("{:?} Cannot share style: style sharing cache disabled", + element); + return StyleSharingResult::CannotShare + } + + if element.parent_element().is_none() { + debug!("{:?} Cannot share style: element has no parent", element); + return StyleSharingResult::CannotShare + } + + if element.is_native_anonymous() { + debug!("{:?} Cannot share style: NAC", element); + return StyleSharingResult::CannotShare; + } + + if element.style_attribute().is_some() { + debug!("{:?} Cannot share style: element has style attribute", + element); + return StyleSharingResult::CannotShare + } + + if element.get_id().is_some() { + debug!("{:?} Cannot share style: element has id", element); + return StyleSharingResult::CannotShare + } + + let mut should_clear_cache = false; + for (i, candidate) in self.iter_mut().enumerate() { + let sharing_result = + Self::test_candidate( + element, + candidate, + &shared_context, + bloom_filter, + current_element_info, + selector_flags_map + ); + + match sharing_result { + Ok(shared_style) => { + // Yay, cache hit. Share the style. + + // Accumulate restyle damage. + debug_assert_eq!(data.has_styles(), data.has_restyle()); + let old_values = data.get_styles_mut() + .and_then(|s| s.primary.values.take()); + let child_cascade_requirement = + element.accumulate_damage( + &shared_context, + data.get_restyle_mut(), + old_values.as_ref().map(|v| &**v), + shared_style.values(), + None + ); + + // We never put elements with pseudo style into the style + // sharing cache, so we can just mint an ElementStyles + // directly here. + // + // See https://bugzilla.mozilla.org/show_bug.cgi?id=1329361 + let styles = ElementStyles::new(shared_style); + data.set_styles(styles); + + return StyleSharingResult::StyleWasShared(i, child_cascade_requirement) + } + Err(miss) => { + debug!("Cache miss: {:?}", miss); + + // Cache miss, let's see what kind of failure to decide + // whether we keep trying or not. + match miss { + // Cache miss because of parent, clear the candidate cache. + CacheMiss::Parent => { + should_clear_cache = true; + break; + }, + // Too expensive failure, give up, we don't want another + // one of these. + CacheMiss::PresHints | + CacheMiss::Revalidation => break, + _ => {} + } + } + } + } + + debug!("{:?} Cannot share style: {} cache entries", element, + self.cache.num_entries()); + + if should_clear_cache { + self.clear(); + } + + StyleSharingResult::CannotShare + } + + fn test_candidate(element: E, + candidate: &mut StyleSharingCandidate, + shared: &SharedStyleContext, + bloom: &BloomFilter, + info: &mut CurrentElementInfo, + selector_flags_map: &mut SelectorFlagsMap) + -> Result { + macro_rules! miss { + ($miss: ident) => { + return Err(CacheMiss::$miss); + } + } + + // Check that we have the same parent, or at least the same pointer + // identity for parent computed style. The latter check allows us to + // share style between cousins if the parents shared style. + let parent = element.parent_element(); + let candidate_parent = candidate.element.parent_element(); + if parent != candidate_parent && + !checks::same_computed_values(parent, candidate_parent) { + miss!(Parent) + } + + if element.is_native_anonymous() { + debug_assert!(!candidate.element.is_native_anonymous(), + "Why inserting NAC into the cache?"); + miss!(NativeAnonymousContent) + } + + if *element.get_local_name() != *candidate.element.get_local_name() { + miss!(LocalName) + } + + if *element.get_namespace() != *candidate.element.get_namespace() { + miss!(Namespace) + } + + if element.is_link() != candidate.element.is_link() { + miss!(Link) + } + + if element.matches_user_and_author_rules() != + candidate.element.matches_user_and_author_rules() { + miss!(UserAndAuthorRules) + } + + if element.get_state() != candidate.element.get_state() { + miss!(State) + } + + if element.get_id() != candidate.element.get_id() { + miss!(IdAttr) + } + + if element.style_attribute().is_some() { + miss!(StyleAttr) + } + + if !checks::have_same_class(element, candidate) { + miss!(Class) + } + + if checks::has_presentational_hints(element) { + miss!(PresHints) + } + + if !checks::revalidate(element, candidate, shared, bloom, info, + selector_flags_map) { + miss!(Revalidation) + } + + let data = candidate.element.borrow_data().unwrap(); + debug_assert!(element.has_current_styles(&data)); + + debug!("Sharing style between {:?} and {:?}", + element, candidate.element); + Ok(data.styles().primary.clone()) + } +} diff --git a/servo/components/style/traversal.rs b/servo/components/style/traversal.rs index 6ce7d9d4b181..f1f1a26342d7 100644 --- a/servo/components/style/traversal.rs +++ b/servo/components/style/traversal.rs @@ -8,9 +8,10 @@ use atomic_refcell::{AtomicRefCell, AtomicRefMut}; use context::{SharedStyleContext, StyleContext, ThreadLocalStyleContext}; use data::{ElementData, ElementStyles, StoredRestyleHint}; use dom::{DirtyDescendants, NodeInfo, OpaqueNode, TElement, TNode}; -use matching::{ChildCascadeRequirement, MatchMethods, StyleSharingBehavior}; +use matching::{ChildCascadeRequirement, MatchMethods}; use restyle_hints::{HintComputationContext, RestyleHint}; use selector_parser::RestyleDamage; +use sharing::StyleSharingBehavior; #[cfg(feature = "servo")] use servo_config::opts; use std::borrow::BorrowMut; @@ -723,7 +724,7 @@ fn compute_style(_traversal: &D, D: DomTraversal, { use data::RestyleKind::*; - use matching::StyleSharingResult::*; + use sharing::StyleSharingResult::*; context.thread_local.statistics.elements_styled += 1; let kind = data.restyle_kind(); From 7c79fdbe984b2b2316843ad70f86cc92629549d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 20 May 2017 23:03:53 -0500 Subject: [PATCH 49/56] servo: Merge #16975 - style: Bump bindgen version (from emilio:bindgenupagain); r=upsuper This should fix bug 1365488, and also the template instantiation test noise reported at https://github.com/servo/rust-bindgen/issues/619. Source-Repo: https://github.com/servo/servo Source-Revision: 1602edb04ac3cc06a71eb6349e137dce453bc191 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 06b0a5c0055788959826d228b5d1ebd7764d43c9 --- servo/Cargo.lock | 19 +- servo/components/style/Cargo.toml | 2 +- .../style/gecko/generated/atom_macro.rs | 8 + .../style/gecko/generated/bindings.rs | 191 +- .../style/gecko/generated/structs_debug.rs | 6871 +++++++++++++---- .../style/gecko/generated/structs_release.rs | 6485 +++++++++++++--- 6 files changed, 10731 insertions(+), 2845 deletions(-) diff --git a/servo/Cargo.lock b/servo/Cargo.lock index fd6a93386fee..add60c19c96a 100644 --- a/servo/Cargo.lock +++ b/servo/Cargo.lock @@ -164,17 +164,18 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.25.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "cexpr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "clang-sys 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "clang-sys 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.20.5 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "quasi 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "quasi_codegen 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -362,7 +363,7 @@ dependencies = [ [[package]] name = "clang-sys" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2028,6 +2029,11 @@ name = "pdqsort" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "phf" version = "0.7.21" @@ -2826,7 +2832,7 @@ dependencies = [ "app_units 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "arrayvec 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)", "atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bindgen 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bindgen 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)", "bit-vec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3454,7 +3460,7 @@ dependencies = [ "checksum base64 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "979d348dc50dfcd050a87df408ec61f01a0a27ee9b4ebdc6085baba8275b2c7f" "checksum binary-space-partition 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "88ceb0d16c4fd0e42876e298d7d3ce3780dd9ebdcbe4199816a32c77e08597ff" "checksum bincode 1.0.0-alpha6 (registry+https://github.com/rust-lang/crates.io-index)" = "fb0cdeac1c5d567fdb487ae5853c024e4acf1ea85ba6a6552fe084e0805fea5d" -"checksum bindgen 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ccaf8958532d7e570e905266ee2dc1094c3e5c3c3cfc2c299368747a30a5e654" +"checksum bindgen 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)" = "708a688675f9d2e7c73018e17f5997beacc9a5ca87a0cb60c13093915facda32" "checksum bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9bf6104718e80d7b26a68fdbacff3481cfc05df670821affc7e9cbc1884400c" "checksum bit-vec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5b97c2c8e8bbb4251754f559df8af22fb264853c7d009084a576cdf12565089d" "checksum bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f67931368edf3a9a51d29886d245f1c3db2f1ef0dcc9e35ff70341b78c10d23" @@ -3474,7 +3480,7 @@ dependencies = [ "checksum cexpr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "393a5f0088efbe41f9d1fcd062f24e83c278608420e62109feb2c8abee07de7d" "checksum cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c" "checksum cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "86765cb42c2a2c497e142af72517c1b4d7ae5bb2f25dfa77a5c69642f2342d89" -"checksum clang-sys 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "33d47b0ea88a529a570490efbb79403e416e89864ce8a96bf23e2a0f23d7e9eb" +"checksum clang-sys 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff7c2d1502c65748c7221f43ce670b3ba5c697acebfeb85a580827daca6975fc" "checksum clap 2.20.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7db281b0520e97fbd15cd615dcd8f8bcad0c26f5f7d5effe705f090f39e9a758" "checksum cmake 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "d18d68987ed4c516dcc3e7913659bfa4076f5182eea4a7e0038bb060953e76ac" "checksum cocoa 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0a5d0bcb4d345adf9b4ada6c5bb3e2b87c8150b79c46f3f26446de5f4d48de4b" @@ -3605,6 +3611,7 @@ dependencies = [ "checksum parking_lot_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "56a19dcbb5d1e32b6cccb8a9aa1fc2a38418c8699652e735e2bf391a3dc0aa16" "checksum parse-hosts 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7626e29ef8f479f10d9a753f1fca914506663ecc9ec2dedb8cffc610a3d1f705" "checksum pdqsort 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ceca1642c89148ca05611cc775a0c383abef355fc4907c4e95f49f7b09d6287c" +"checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" "checksum phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "cb325642290f28ee14d8c6201159949a872f220c62af6e110a56ea914fbe42fc" "checksum phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d62594c0bb54c464f633175d502038177e90309daf2e0158be42ed5f023ce88f" "checksum phf_generator 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "6b07ffcc532ccc85e3afc45865469bf5d9e4ef5bfcf9622e3cfe80c2d275ec03" diff --git a/servo/components/style/Cargo.toml b/servo/components/style/Cargo.toml index 22400c4e2dd8..e6018f2653bb 100644 --- a/servo/components/style/Cargo.toml +++ b/servo/components/style/Cargo.toml @@ -75,7 +75,7 @@ kernel32-sys = "0.2" [build-dependencies] lazy_static = "0.2" log = "0.3" -bindgen = { version = "0.25", optional = true } +bindgen = { version = "0.25.1", optional = true } regex = {version = "0.2", optional = true} walkdir = "1.0" toml = {version = "0.2.1", optional = true, default-features = false} diff --git a/servo/components/style/gecko/generated/atom_macro.rs b/servo/components/style/gecko/generated/atom_macro.rs index bba0c7bc8179..5cf3aca1c3fc 100644 --- a/servo/components/style/gecko/generated/atom_macro.rs +++ b/servo/components/style/gecko/generated/atom_macro.rs @@ -2164,6 +2164,8 @@ cfg_if! { pub static nsGkAtoms_onreloadpage: *mut nsIAtom; #[link_name = "_ZN9nsGkAtoms3remE"] pub static nsGkAtoms_rem: *mut nsIAtom; + #[link_name = "_ZN9nsGkAtoms6remoteE"] + pub static nsGkAtoms_remote: *mut nsIAtom; #[link_name = "_ZN9nsGkAtoms13removeelementE"] pub static nsGkAtoms_removeelement: *mut nsIAtom; #[link_name = "_ZN9nsGkAtoms21renderingobserverlistE"] @@ -7179,6 +7181,8 @@ cfg_if! { pub static nsGkAtoms_onreloadpage: *mut nsIAtom; #[link_name = "?rem@nsGkAtoms@@2PEAVnsIAtom@@EA"] pub static nsGkAtoms_rem: *mut nsIAtom; + #[link_name = "?remote@nsGkAtoms@@2PEAVnsIAtom@@EA"] + pub static nsGkAtoms_remote: *mut nsIAtom; #[link_name = "?removeelement@nsGkAtoms@@2PEAVnsIAtom@@EA"] pub static nsGkAtoms_removeelement: *mut nsIAtom; #[link_name = "?renderingobserverlist@nsGkAtoms@@2PEAVnsIAtom@@EA"] @@ -12194,6 +12198,8 @@ cfg_if! { pub static nsGkAtoms_onreloadpage: *mut nsIAtom; #[link_name = "\x01?rem@nsGkAtoms@@2PAVnsIAtom@@A"] pub static nsGkAtoms_rem: *mut nsIAtom; + #[link_name = "\x01?remote@nsGkAtoms@@2PAVnsIAtom@@A"] + pub static nsGkAtoms_remote: *mut nsIAtom; #[link_name = "\x01?removeelement@nsGkAtoms@@2PAVnsIAtom@@A"] pub static nsGkAtoms_removeelement: *mut nsIAtom; #[link_name = "\x01?renderingobserverlist@nsGkAtoms@@2PAVnsIAtom@@A"] @@ -17212,6 +17218,8 @@ macro_rules! atom { { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_onreloadpage as *mut _) } }; ("rem") => { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_rem as *mut _) } }; +("remote") => + { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_remote as *mut _) } }; ("removeelement") => { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_removeelement as *mut _) } }; ("renderingobserverlist") => diff --git a/servo/components/style/gecko/generated/bindings.rs b/servo/components/style/gecko/generated/bindings.rs index 101e9c89cad7..c88d389bd3b4 100644 --- a/servo/components/style/gecko/generated/bindings.rs +++ b/servo/components/style/gecko/generated/bindings.rs @@ -202,6 +202,92 @@ use gecko_bindings::structs::ParsingMode; use gecko_bindings::structs::InheritTarget; use gecko_bindings::structs::URLMatchingFunction; pub type nsTArrayBorrowed_uintptr_t<'a> = &'a mut ::gecko_bindings::structs::nsTArray; +pub type RawServoStyleSetOwned = ::gecko_bindings::sugar::ownership::Owned; +pub type RawServoStyleSetOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull; +pub type RawServoStyleSetBorrowed<'a> = &'a RawServoStyleSet; +pub type RawServoStyleSetBorrowedOrNull<'a> = Option<&'a RawServoStyleSet>; +pub type RawServoStyleSetBorrowedMut<'a> = &'a mut RawServoStyleSet; +pub type RawServoStyleSetBorrowedMutOrNull<'a> = Option<&'a mut RawServoStyleSet>; +enum RawServoStyleSetVoid { } +pub struct RawServoStyleSet(RawServoStyleSetVoid); +pub type StyleChildrenIteratorOwned = ::gecko_bindings::sugar::ownership::Owned; +pub type StyleChildrenIteratorOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull; +pub type StyleChildrenIteratorBorrowed<'a> = &'a StyleChildrenIterator; +pub type StyleChildrenIteratorBorrowedOrNull<'a> = Option<&'a StyleChildrenIterator>; +pub type StyleChildrenIteratorBorrowedMut<'a> = &'a mut StyleChildrenIterator; +pub type StyleChildrenIteratorBorrowedMutOrNull<'a> = Option<&'a mut StyleChildrenIterator>; +enum StyleChildrenIteratorVoid { } +pub struct StyleChildrenIterator(StyleChildrenIteratorVoid); +pub type ServoElementSnapshotOwned = ::gecko_bindings::sugar::ownership::Owned; +pub type ServoElementSnapshotOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull; +pub type ServoElementSnapshotBorrowed<'a> = &'a ServoElementSnapshot; +pub type ServoElementSnapshotBorrowedOrNull<'a> = Option<&'a ServoElementSnapshot>; +pub type ServoElementSnapshotBorrowedMut<'a> = &'a mut ServoElementSnapshot; +pub type ServoElementSnapshotBorrowedMutOrNull<'a> = Option<&'a mut ServoElementSnapshot>; +pub type RawServoAnimationValueMapOwned = ::gecko_bindings::sugar::ownership::Owned; +pub type RawServoAnimationValueMapOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull; +pub type RawServoAnimationValueMapBorrowed<'a> = &'a RawServoAnimationValueMap; +pub type RawServoAnimationValueMapBorrowedOrNull<'a> = Option<&'a RawServoAnimationValueMap>; +pub type RawServoAnimationValueMapBorrowedMut<'a> = &'a mut RawServoAnimationValueMap; +pub type RawServoAnimationValueMapBorrowedMutOrNull<'a> = Option<&'a mut RawServoAnimationValueMap>; +enum RawServoAnimationValueMapVoid { } +pub struct RawServoAnimationValueMap(RawServoAnimationValueMapVoid); +pub type RawGeckoNodeBorrowed<'a> = &'a RawGeckoNode; +pub type RawGeckoNodeBorrowedOrNull<'a> = Option<&'a RawGeckoNode>; +pub type RawGeckoElementBorrowed<'a> = &'a RawGeckoElement; +pub type RawGeckoElementBorrowedOrNull<'a> = Option<&'a RawGeckoElement>; +pub type RawGeckoDocumentBorrowed<'a> = &'a RawGeckoDocument; +pub type RawGeckoDocumentBorrowedOrNull<'a> = Option<&'a RawGeckoDocument>; +pub type RawServoDeclarationBlockStrongBorrowed<'a> = &'a RawServoDeclarationBlockStrong; +pub type RawServoDeclarationBlockStrongBorrowedOrNull<'a> = Option<&'a RawServoDeclarationBlockStrong>; +pub type RawGeckoPresContextBorrowed<'a> = &'a RawGeckoPresContext; +pub type RawGeckoPresContextBorrowedOrNull<'a> = Option<&'a RawGeckoPresContext>; +pub type RawGeckoStyleAnimationListBorrowed<'a> = &'a RawGeckoStyleAnimationList; +pub type RawGeckoStyleAnimationListBorrowedOrNull<'a> = Option<&'a RawGeckoStyleAnimationList>; +pub type nsCSSPropertyIDSetBorrowed<'a> = &'a nsCSSPropertyIDSet; +pub type nsCSSPropertyIDSetBorrowedOrNull<'a> = Option<&'a nsCSSPropertyIDSet>; +pub type nsCSSPropertyIDSetBorrowedMut<'a> = &'a mut nsCSSPropertyIDSet; +pub type nsCSSPropertyIDSetBorrowedMutOrNull<'a> = Option<&'a mut nsCSSPropertyIDSet>; +pub type nsCSSValueBorrowed<'a> = &'a nsCSSValue; +pub type nsCSSValueBorrowedOrNull<'a> = Option<&'a nsCSSValue>; +pub type nsCSSValueBorrowedMut<'a> = &'a mut nsCSSValue; +pub type nsCSSValueBorrowedMutOrNull<'a> = Option<&'a mut nsCSSValue>; +pub type nsTimingFunctionBorrowed<'a> = &'a nsTimingFunction; +pub type nsTimingFunctionBorrowedOrNull<'a> = Option<&'a nsTimingFunction>; +pub type nsTimingFunctionBorrowedMut<'a> = &'a mut nsTimingFunction; +pub type nsTimingFunctionBorrowedMutOrNull<'a> = Option<&'a mut nsTimingFunction>; +pub type RawGeckoAnimationPropertySegmentBorrowed<'a> = &'a RawGeckoAnimationPropertySegment; +pub type RawGeckoAnimationPropertySegmentBorrowedOrNull<'a> = Option<&'a RawGeckoAnimationPropertySegment>; +pub type RawGeckoAnimationPropertySegmentBorrowedMut<'a> = &'a mut RawGeckoAnimationPropertySegment; +pub type RawGeckoAnimationPropertySegmentBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoAnimationPropertySegment>; +pub type RawGeckoAnimationValueListBorrowed<'a> = &'a RawGeckoAnimationValueList; +pub type RawGeckoAnimationValueListBorrowedOrNull<'a> = Option<&'a RawGeckoAnimationValueList>; +pub type RawGeckoAnimationValueListBorrowedMut<'a> = &'a mut RawGeckoAnimationValueList; +pub type RawGeckoAnimationValueListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoAnimationValueList>; +pub type RawGeckoComputedTimingBorrowed<'a> = &'a RawGeckoComputedTiming; +pub type RawGeckoComputedTimingBorrowedOrNull<'a> = Option<&'a RawGeckoComputedTiming>; +pub type RawGeckoComputedTimingBorrowedMut<'a> = &'a mut RawGeckoComputedTiming; +pub type RawGeckoComputedTimingBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoComputedTiming>; +pub type RawGeckoCSSPropertyIDListBorrowed<'a> = &'a RawGeckoCSSPropertyIDList; +pub type RawGeckoCSSPropertyIDListBorrowedOrNull<'a> = Option<&'a RawGeckoCSSPropertyIDList>; +pub type RawGeckoCSSPropertyIDListBorrowedMut<'a> = &'a mut RawGeckoCSSPropertyIDList; +pub type RawGeckoCSSPropertyIDListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoCSSPropertyIDList>; +pub type RawGeckoKeyframeListBorrowed<'a> = &'a RawGeckoKeyframeList; +pub type RawGeckoKeyframeListBorrowedOrNull<'a> = Option<&'a RawGeckoKeyframeList>; +pub type RawGeckoKeyframeListBorrowedMut<'a> = &'a mut RawGeckoKeyframeList; +pub type RawGeckoKeyframeListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoKeyframeList>; +pub type RawGeckoComputedKeyframeValuesListBorrowed<'a> = &'a RawGeckoComputedKeyframeValuesList; +pub type RawGeckoComputedKeyframeValuesListBorrowedOrNull<'a> = Option<&'a RawGeckoComputedKeyframeValuesList>; +pub type RawGeckoComputedKeyframeValuesListBorrowedMut<'a> = &'a mut RawGeckoComputedKeyframeValuesList; +pub type RawGeckoComputedKeyframeValuesListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoComputedKeyframeValuesList>; +pub type RawGeckoFontFaceRuleListBorrowed<'a> = &'a RawGeckoFontFaceRuleList; +pub type RawGeckoFontFaceRuleListBorrowedOrNull<'a> = Option<&'a RawGeckoFontFaceRuleList>; +pub type RawGeckoFontFaceRuleListBorrowedMut<'a> = &'a mut RawGeckoFontFaceRuleList; +pub type RawGeckoFontFaceRuleListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoFontFaceRuleList>; +pub type RawGeckoServoStyleRuleListBorrowed<'a> = &'a RawGeckoServoStyleRuleList; +pub type RawGeckoServoStyleRuleListBorrowedOrNull<'a> = Option<&'a RawGeckoServoStyleRuleList>; +pub type RawGeckoServoStyleRuleListBorrowedMut<'a> = &'a mut RawGeckoServoStyleRuleList; +pub type RawGeckoServoStyleRuleListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoServoStyleRuleList>; pub type ServoCssRulesStrong = ::gecko_bindings::sugar::ownership::Strong; pub type ServoCssRulesBorrowed<'a> = &'a ServoCssRules; pub type ServoCssRulesBorrowedOrNull<'a> = Option<&'a ServoCssRules>; @@ -276,92 +362,6 @@ pub type RawServoRuleNodeBorrowed<'a> = &'a RawServoRuleNode; pub type RawServoRuleNodeBorrowedOrNull<'a> = Option<&'a RawServoRuleNode>; enum RawServoRuleNodeVoid { } pub struct RawServoRuleNode(RawServoRuleNodeVoid); -pub type RawServoStyleSetOwned = ::gecko_bindings::sugar::ownership::Owned; -pub type RawServoStyleSetOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull; -pub type RawServoStyleSetBorrowed<'a> = &'a RawServoStyleSet; -pub type RawServoStyleSetBorrowedOrNull<'a> = Option<&'a RawServoStyleSet>; -pub type RawServoStyleSetBorrowedMut<'a> = &'a mut RawServoStyleSet; -pub type RawServoStyleSetBorrowedMutOrNull<'a> = Option<&'a mut RawServoStyleSet>; -enum RawServoStyleSetVoid { } -pub struct RawServoStyleSet(RawServoStyleSetVoid); -pub type StyleChildrenIteratorOwned = ::gecko_bindings::sugar::ownership::Owned; -pub type StyleChildrenIteratorOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull; -pub type StyleChildrenIteratorBorrowed<'a> = &'a StyleChildrenIterator; -pub type StyleChildrenIteratorBorrowedOrNull<'a> = Option<&'a StyleChildrenIterator>; -pub type StyleChildrenIteratorBorrowedMut<'a> = &'a mut StyleChildrenIterator; -pub type StyleChildrenIteratorBorrowedMutOrNull<'a> = Option<&'a mut StyleChildrenIterator>; -enum StyleChildrenIteratorVoid { } -pub struct StyleChildrenIterator(StyleChildrenIteratorVoid); -pub type ServoElementSnapshotOwned = ::gecko_bindings::sugar::ownership::Owned; -pub type ServoElementSnapshotOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull; -pub type ServoElementSnapshotBorrowed<'a> = &'a ServoElementSnapshot; -pub type ServoElementSnapshotBorrowedOrNull<'a> = Option<&'a ServoElementSnapshot>; -pub type ServoElementSnapshotBorrowedMut<'a> = &'a mut ServoElementSnapshot; -pub type ServoElementSnapshotBorrowedMutOrNull<'a> = Option<&'a mut ServoElementSnapshot>; -pub type RawServoAnimationValueMapOwned = ::gecko_bindings::sugar::ownership::Owned; -pub type RawServoAnimationValueMapOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull; -pub type RawServoAnimationValueMapBorrowed<'a> = &'a RawServoAnimationValueMap; -pub type RawServoAnimationValueMapBorrowedOrNull<'a> = Option<&'a RawServoAnimationValueMap>; -pub type RawServoAnimationValueMapBorrowedMut<'a> = &'a mut RawServoAnimationValueMap; -pub type RawServoAnimationValueMapBorrowedMutOrNull<'a> = Option<&'a mut RawServoAnimationValueMap>; -enum RawServoAnimationValueMapVoid { } -pub struct RawServoAnimationValueMap(RawServoAnimationValueMapVoid); -pub type RawGeckoNodeBorrowed<'a> = &'a RawGeckoNode; -pub type RawGeckoNodeBorrowedOrNull<'a> = Option<&'a RawGeckoNode>; -pub type RawGeckoElementBorrowed<'a> = &'a RawGeckoElement; -pub type RawGeckoElementBorrowedOrNull<'a> = Option<&'a RawGeckoElement>; -pub type RawGeckoDocumentBorrowed<'a> = &'a RawGeckoDocument; -pub type RawGeckoDocumentBorrowedOrNull<'a> = Option<&'a RawGeckoDocument>; -pub type RawServoDeclarationBlockStrongBorrowed<'a> = &'a RawServoDeclarationBlockStrong; -pub type RawServoDeclarationBlockStrongBorrowedOrNull<'a> = Option<&'a RawServoDeclarationBlockStrong>; -pub type RawGeckoPresContextBorrowed<'a> = &'a RawGeckoPresContext; -pub type RawGeckoPresContextBorrowedOrNull<'a> = Option<&'a RawGeckoPresContext>; -pub type RawGeckoStyleAnimationListBorrowed<'a> = &'a RawGeckoStyleAnimationList; -pub type RawGeckoStyleAnimationListBorrowedOrNull<'a> = Option<&'a RawGeckoStyleAnimationList>; -pub type nsCSSPropertyIDSetBorrowed<'a> = &'a nsCSSPropertyIDSet; -pub type nsCSSPropertyIDSetBorrowedOrNull<'a> = Option<&'a nsCSSPropertyIDSet>; -pub type nsCSSPropertyIDSetBorrowedMut<'a> = &'a mut nsCSSPropertyIDSet; -pub type nsCSSPropertyIDSetBorrowedMutOrNull<'a> = Option<&'a mut nsCSSPropertyIDSet>; -pub type nsCSSValueBorrowed<'a> = &'a nsCSSValue; -pub type nsCSSValueBorrowedOrNull<'a> = Option<&'a nsCSSValue>; -pub type nsCSSValueBorrowedMut<'a> = &'a mut nsCSSValue; -pub type nsCSSValueBorrowedMutOrNull<'a> = Option<&'a mut nsCSSValue>; -pub type nsTimingFunctionBorrowed<'a> = &'a nsTimingFunction; -pub type nsTimingFunctionBorrowedOrNull<'a> = Option<&'a nsTimingFunction>; -pub type nsTimingFunctionBorrowedMut<'a> = &'a mut nsTimingFunction; -pub type nsTimingFunctionBorrowedMutOrNull<'a> = Option<&'a mut nsTimingFunction>; -pub type RawGeckoAnimationPropertySegmentBorrowed<'a> = &'a RawGeckoAnimationPropertySegment; -pub type RawGeckoAnimationPropertySegmentBorrowedOrNull<'a> = Option<&'a RawGeckoAnimationPropertySegment>; -pub type RawGeckoAnimationPropertySegmentBorrowedMut<'a> = &'a mut RawGeckoAnimationPropertySegment; -pub type RawGeckoAnimationPropertySegmentBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoAnimationPropertySegment>; -pub type RawGeckoAnimationValueListBorrowed<'a> = &'a RawGeckoAnimationValueList; -pub type RawGeckoAnimationValueListBorrowedOrNull<'a> = Option<&'a RawGeckoAnimationValueList>; -pub type RawGeckoAnimationValueListBorrowedMut<'a> = &'a mut RawGeckoAnimationValueList; -pub type RawGeckoAnimationValueListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoAnimationValueList>; -pub type RawGeckoComputedTimingBorrowed<'a> = &'a RawGeckoComputedTiming; -pub type RawGeckoComputedTimingBorrowedOrNull<'a> = Option<&'a RawGeckoComputedTiming>; -pub type RawGeckoComputedTimingBorrowedMut<'a> = &'a mut RawGeckoComputedTiming; -pub type RawGeckoComputedTimingBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoComputedTiming>; -pub type RawGeckoKeyframeListBorrowed<'a> = &'a RawGeckoKeyframeList; -pub type RawGeckoKeyframeListBorrowedOrNull<'a> = Option<&'a RawGeckoKeyframeList>; -pub type RawGeckoKeyframeListBorrowedMut<'a> = &'a mut RawGeckoKeyframeList; -pub type RawGeckoKeyframeListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoKeyframeList>; -pub type RawGeckoComputedKeyframeValuesListBorrowed<'a> = &'a RawGeckoComputedKeyframeValuesList; -pub type RawGeckoComputedKeyframeValuesListBorrowedOrNull<'a> = Option<&'a RawGeckoComputedKeyframeValuesList>; -pub type RawGeckoComputedKeyframeValuesListBorrowedMut<'a> = &'a mut RawGeckoComputedKeyframeValuesList; -pub type RawGeckoComputedKeyframeValuesListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoComputedKeyframeValuesList>; -pub type RawGeckoFontFaceRuleListBorrowed<'a> = &'a RawGeckoFontFaceRuleList; -pub type RawGeckoFontFaceRuleListBorrowedOrNull<'a> = Option<&'a RawGeckoFontFaceRuleList>; -pub type RawGeckoFontFaceRuleListBorrowedMut<'a> = &'a mut RawGeckoFontFaceRuleList; -pub type RawGeckoFontFaceRuleListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoFontFaceRuleList>; -pub type RawGeckoServoStyleRuleListBorrowed<'a> = &'a RawGeckoServoStyleRuleList; -pub type RawGeckoServoStyleRuleListBorrowedOrNull<'a> = Option<&'a RawGeckoServoStyleRuleList>; -pub type RawGeckoServoStyleRuleListBorrowedMut<'a> = &'a mut RawGeckoServoStyleRuleList; -pub type RawGeckoServoStyleRuleListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoServoStyleRuleList>; -pub type RawGeckoCSSPropertyIDListBorrowed<'a> = &'a RawGeckoCSSPropertyIDList; -pub type RawGeckoCSSPropertyIDListBorrowedOrNull<'a> = Option<&'a RawGeckoCSSPropertyIDList>; -pub type RawGeckoCSSPropertyIDListBorrowedMut<'a> = &'a mut RawGeckoCSSPropertyIDList; -pub type RawGeckoCSSPropertyIDListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoCSSPropertyIDList>; extern "C" { pub fn Gecko_EnsureTArrayCapacity(aArray: *mut ::std::os::raw::c_void, @@ -874,10 +874,6 @@ extern "C" { pub fn Gecko_SetLayerImageImageValue(image: *mut nsStyleImage, aImageValue: *mut ImageValue); } -extern "C" { - pub fn Gecko_SetUrlImageValue(image: *mut nsStyleImage, - uri: ServoBundledURI); -} extern "C" { pub fn Gecko_SetImageElement(image: *mut nsStyleImage, atom: *mut nsIAtom); @@ -901,10 +897,6 @@ extern "C" { pub fn Gecko_SetListStyleImageImageValue(style_struct: *mut nsStyleList, aImageValue: *mut ImageValue); } -extern "C" { - pub fn Gecko_SetListStyleImage(style_struct: *mut nsStyleList, - uri: ServoBundledURI); -} extern "C" { pub fn Gecko_CopyListStyleImageFrom(dest: *mut nsStyleList, src: *const nsStyleList); @@ -917,10 +909,6 @@ extern "C" { pub fn Gecko_SetCursorImageValue(aCursor: *mut nsCursorImage, aImageValue: *mut ImageValue); } -extern "C" { - pub fn Gecko_SetCursorImage(cursor: *mut nsCursorImage, - uri: ServoBundledURI); -} extern "C" { pub fn Gecko_CopyCursorArrayFrom(dest: *mut nsStyleUserInterface, src: *const nsStyleUserInterface); @@ -929,10 +917,6 @@ extern "C" { pub fn Gecko_SetContentDataImageValue(aList: *mut nsStyleContentData, aImageValue: *mut ImageValue); } -extern "C" { - pub fn Gecko_SetContentDataImage(content_data: *mut nsStyleContentData, - uri: ServoBundledURI); -} extern "C" { pub fn Gecko_SetContentDataArray(content_data: *mut nsStyleContentData, type_: nsStyleContentType, len: u32); @@ -1751,6 +1735,9 @@ extern "C" { pub fn Servo_StyleSet_Init(pres_context: RawGeckoPresContextOwned) -> RawServoStyleSetOwned; } +extern "C" { + pub fn Servo_StyleSet_Clear(set: RawServoStyleSetBorrowed); +} extern "C" { pub fn Servo_StyleSet_RebuildData(set: RawServoStyleSetBorrowed); } diff --git a/servo/components/style/gecko/generated/structs_debug.rs b/servo/components/style/gecko/generated/structs_debug.rs index f5492e5bfe8a..ffa6dc5b55a2 100644 --- a/servo/components/style/gecko/generated/structs_debug.rs +++ b/servo/components/style/gecko/generated/structs_debug.rs @@ -971,6 +971,7 @@ pub mod root { pub const NS_STYLE_DISPLAY_MODE_BROWSER: ::std::os::raw::c_uint = 0; pub const NS_STYLE_DISPLAY_MODE_MINIMAL_UI: ::std::os::raw::c_uint = 1; pub const NS_STYLE_DISPLAY_MODE_STANDALONE: ::std::os::raw::c_uint = 2; + pub const NS_STYLE_DISPLAY_MODE_FULLSCREEN: ::std::os::raw::c_uint = 3; pub const NS_THEME_NONE: ::std::os::raw::c_uint = 0; pub const NS_THEME_BUTTON: ::std::os::raw::c_uint = 1; pub const NS_THEME_RADIO: ::std::os::raw::c_uint = 2; @@ -1169,6 +1170,16 @@ pub mod root { use self::super::super::root; #[repr(C)] #[derive(Debug, Copy, Clone)] + pub struct __is_swappable { + pub _address: u8, + } + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct __is_nothrow_swappable { + pub _address: u8, + } + #[repr(C)] + #[derive(Debug, Copy, Clone)] pub struct pair<_T1, _T2> { pub first: _T1, pub second: _T2, @@ -1177,6 +1188,8 @@ pub mod root { } pub type pair_first_type<_T1> = _T1; pub type pair_second_type<_T2> = _T2; + pub type pair__PCCP = u8; + pub type pair__PCCFP = u8; #[repr(C)] #[derive(Debug, Copy)] pub struct input_iterator_tag { @@ -1196,101 +1209,54 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy)] - pub struct forward_iterator_tag { + #[derive(Debug, Copy, Clone)] + pub struct iterator { pub _address: u8, } - #[test] - fn bindgen_test_layout_forward_iterator_tag() { - assert_eq!(::std::mem::size_of::() , 1usize - , concat ! ( - "Size of: " , stringify ! ( forward_iterator_tag ) )); - assert_eq! (::std::mem::align_of::() , - 1usize , concat ! ( - "Alignment of " , stringify ! ( forward_iterator_tag ) - )); - } - impl Clone for forward_iterator_tag { - fn clone(&self) -> Self { *self } - } + pub type iterator_iterator_category<_Category> = _Category; + pub type iterator_value_type<_Tp> = _Tp; + pub type iterator_difference_type<_Distance> = _Distance; + pub type iterator_pointer<_Pointer> = _Pointer; + pub type iterator_reference<_Reference> = _Reference; #[repr(C)] - #[derive(Debug, Copy)] - pub struct bidirectional_iterator_tag { + #[derive(Debug, Copy, Clone)] + pub struct __iterator_traits { pub _address: u8, } - #[test] - fn bindgen_test_layout_bidirectional_iterator_tag() { - assert_eq!(::std::mem::size_of::() , - 1usize , concat ! ( - "Size of: " , stringify ! ( bidirectional_iterator_tag - ) )); - assert_eq! (::std::mem::align_of::() , - 1usize , concat ! ( - "Alignment of " , stringify ! ( - bidirectional_iterator_tag ) )); - } - impl Clone for bidirectional_iterator_tag { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct random_access_iterator_tag { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_random_access_iterator_tag() { - assert_eq!(::std::mem::size_of::() , - 1usize , concat ! ( - "Size of: " , stringify ! ( random_access_iterator_tag - ) )); - assert_eq! (::std::mem::align_of::() , - 1usize , concat ! ( - "Alignment of " , stringify ! ( - random_access_iterator_tag ) )); - } - impl Clone for random_access_iterator_tag { - fn clone(&self) -> Self { *self } - } #[repr(C)] + #[derive(Debug, Copy, Clone)] pub struct iterator_traits { pub _address: u8, } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct iterator { - pub _address: u8, + pub struct reverse_iterator<_Iterator> { + pub current: _Iterator, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_Iterator>>, } - pub type iterator_value_type<_Tp> = _Tp; - pub type iterator_difference_type<_Distance> = _Distance; - pub type iterator_pointer<_Pointer> = _Pointer; - pub type iterator_reference<_Reference> = _Reference; - pub type iterator_iterator_category<_Category> = _Category; - #[repr(C)] - pub struct reverse_iterator<_Iter> { - pub __t: _Iter, - pub current: _Iter, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_Iter>>, - } - pub type reverse_iterator_iterator_type<_Iter> = _Iter; + pub type reverse_iterator___traits_type = root::std::iterator_traits; + pub type reverse_iterator_iterator_type<_Iterator> = _Iterator; pub type reverse_iterator_difference_type = - root::std::iterator_traits; - pub type reverse_iterator_reference = root::std::iterator_traits; - pub type reverse_iterator_pointer = root::std::iterator_traits; + root::std::reverse_iterator___traits_type; + pub type reverse_iterator_pointer = + root::std::reverse_iterator___traits_type; + pub type reverse_iterator_reference = + root::std::reverse_iterator___traits_type; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct atomic { } - pub type atomic___base = u8; - #[repr(C)] - pub struct __bit_const_reference { - pub __seg_: root::std::__bit_const_reference___storage_pointer, - pub __mask_: root::std::__bit_const_reference___storage_type, + pub mod chrono { + #[allow(unused_imports)] + use self::super::super::super::root; } - pub type __bit_const_reference___storage_type = [u8; 0usize]; - pub type __bit_const_reference___storage_pointer = [u8; 0usize]; } - pub type __int64_t = ::std::os::raw::c_longlong; - pub type __darwin_off_t = root::__int64_t; + pub mod __gnu_cxx { + #[allow(unused_imports)] + use self::super::super::root; + } + pub type __off_t = ::std::os::raw::c_long; + pub type __off64_t = ::std::os::raw::c_long; pub mod mozilla { #[allow(unused_imports)] use self::super::super::root; @@ -1333,8 +1299,9 @@ pub mod root { root::nsSubstringTuple; pub type nsStringRepr_string_type = ::nsstring::nsStringRepr; pub type nsStringRepr_const_iterator = - root::nsReadingIterator; - pub type nsStringRepr_iterator = root::nsWritingIterator; + root::nsReadingIterator; + pub type nsStringRepr_iterator = + root::nsWritingIterator; pub type nsStringRepr_comparator_type = root::nsStringComparator; pub type nsStringRepr_char_iterator = *mut root::mozilla::detail::nsStringRepr_char_type; @@ -1424,9 +1391,9 @@ pub mod root { root::nsCSubstringTuple; pub type nsCStringRepr_string_type = root::nsCString; pub type nsCStringRepr_const_iterator = - root::nsReadingIterator<::std::os::raw::c_char>; + root::nsReadingIterator; pub type nsCStringRepr_iterator = - root::nsWritingIterator<::std::os::raw::c_char>; + root::nsWritingIterator; pub type nsCStringRepr_comparator_type = root::nsCStringComparator; pub type nsCStringRepr_char_iterator = @@ -1580,7 +1547,7 @@ pub mod root { #[repr(C)] #[derive(Debug)] pub struct MutexImpl { - pub platformData_: [*mut ::std::os::raw::c_void; 8usize], + pub platformData_: [*mut ::std::os::raw::c_void; 5usize], } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -1589,7 +1556,7 @@ pub mod root { } #[test] fn bindgen_test_layout_MutexImpl() { - assert_eq!(::std::mem::size_of::() , 64usize , + assert_eq!(::std::mem::size_of::() , 40usize , concat ! ( "Size of: " , stringify ! ( MutexImpl ) )); assert_eq! (::std::mem::align_of::() , 8usize , @@ -2220,7 +2187,7 @@ pub mod root { } } #[repr(C)] - #[derive(Debug, Copy)] + #[derive(Debug)] pub struct ThreadSafeAutoRefCnt { pub mValue: u64, } @@ -2241,9 +2208,6 @@ pub mod root { ThreadSafeAutoRefCnt ) , "::" , stringify ! ( mValue ) )); } - impl Clone for ThreadSafeAutoRefCnt { - fn clone(&self) -> Self { *self } - } #[repr(C)] #[derive(Debug)] pub struct OwningNonNull { @@ -2629,78 +2593,118 @@ pub mod root { #[inline] pub fn mIsRootContent(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsRootContent(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mDoSmoothScroll(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mDoSmoothScroll(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mUseDisplayPortMargins(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mUseDisplayPortMargins(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsScrollInfoLayer(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsScrollInfoLayer(&mut self, val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mIsRootContent: bool, + mDoSmoothScroll: bool, + mUseDisplayPortMargins: bool, + mIsScrollInfoLayer: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = { 0 }; + let mIsRootContent = + mIsRootContent as u8 as u8; + let mask = 1usize as u8; + let mIsRootContent = + (mIsRootContent << 0usize) & + mask; + bitfield_unit_val | mIsRootContent + }; + let mDoSmoothScroll = + mDoSmoothScroll as u8 as u8; + let mask = 2usize as u8; + let mDoSmoothScroll = + (mDoSmoothScroll << 1usize) & mask; + bitfield_unit_val | mDoSmoothScroll + }; + let mUseDisplayPortMargins = + mUseDisplayPortMargins as u8 as u8; + let mask = 4usize as u8; + let mUseDisplayPortMargins = + (mUseDisplayPortMargins << 2usize) & mask; + bitfield_unit_val | mUseDisplayPortMargins + }; + let mIsScrollInfoLayer = mIsScrollInfoLayer as u8 as u8; + let mask = 8usize as u8; + let mIsScrollInfoLayer = + (mIsScrollInfoLayer << 3usize) & mask; + bitfield_unit_val | mIsScrollInfoLayer } } #[repr(C)] @@ -2893,28 +2897,28 @@ pub mod root { #[inline] pub fn mHasScrollgrab(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasScrollgrab(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mAllowVerticalScrollWithWheel(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] @@ -2922,69 +2926,125 @@ pub mod root { val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsLayersIdRoot(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsLayersIdRoot(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mUsesContainerScrolling(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mUsesContainerScrolling(&mut self, val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mForceDisableApz(&self) -> bool { let mask = 16usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mForceDisableApz(&mut self, val: bool) { let mask = 16usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mHasScrollgrab: bool, + mAllowVerticalScrollWithWheel: bool, + mIsLayersIdRoot: bool, + mUsesContainerScrolling: bool, + mForceDisableApz: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { 0 }; + let mHasScrollgrab = + mHasScrollgrab as u8 + as u8; + let mask = 1usize as u8; + let mHasScrollgrab = + (mHasScrollgrab << + 0usize) & mask; + bitfield_unit_val | + mHasScrollgrab + }; + let mAllowVerticalScrollWithWheel = + mAllowVerticalScrollWithWheel + as u8 as u8; + let mask = 2usize as u8; + let mAllowVerticalScrollWithWheel = + (mAllowVerticalScrollWithWheel + << 1usize) & mask; + bitfield_unit_val | + mAllowVerticalScrollWithWheel + }; + let mIsLayersIdRoot = + mIsLayersIdRoot as u8 as u8; + let mask = 4usize as u8; + let mIsLayersIdRoot = + (mIsLayersIdRoot << 2usize) & mask; + bitfield_unit_val | mIsLayersIdRoot + }; + let mUsesContainerScrolling = + mUsesContainerScrolling as u8 as u8; + let mask = 8usize as u8; + let mUsesContainerScrolling = + (mUsesContainerScrolling << 3usize) & mask; + bitfield_unit_val | mUsesContainerScrolling + }; + let mForceDisableApz = mForceDisableApz as u8 as u8; + let mask = 16usize as u8; + let mForceDisableApz = + (mForceDisableApz << 4usize) & mask; + bitfield_unit_val | mForceDisableApz } } #[repr(C)] @@ -5080,7 +5140,7 @@ pub mod root { pub mDataset: *mut root::nsDOMStringMap, /** * SMIL Overridde style rules (for SMIL animation of CSS properties) - * @see nsIContent::GetSMILOverrideStyle + * @see Element::GetSMILOverrideStyle */ pub mSMILOverrideStyle: root::nsCOMPtr, /** @@ -6943,7 +7003,7 @@ pub mod root { _unused: [u8; 0], } #[test] - fn __bindgen_test_layout_StaticRefPtr_instantiation_119008() { + fn __bindgen_test_layout_StaticRefPtr_instantiation_2() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -8053,7 +8113,7 @@ pub mod root { } #[test] fn bindgen_test_layout_OffTheBooksMutex() { - assert_eq!(::std::mem::size_of::() , 96usize , + assert_eq!(::std::mem::size_of::() , 72usize , concat ! ( "Size of: " , stringify ! ( OffTheBooksMutex ) )); assert_eq! (::std::mem::align_of::() , 8usize , @@ -8061,7 +8121,7 @@ pub mod root { "Alignment of " , stringify ! ( OffTheBooksMutex ) )); assert_eq! (unsafe { & ( * ( 0 as * const OffTheBooksMutex ) ) . - mOwningThread as * const _ as usize } , 88usize , + mOwningThread as * const _ as usize } , 64usize , concat ! ( "Alignment of field: " , stringify ! ( OffTheBooksMutex ) , "::" , stringify ! ( @@ -8079,7 +8139,7 @@ pub mod root { } #[test] fn bindgen_test_layout_Mutex() { - assert_eq!(::std::mem::size_of::() , 96usize , concat ! ( + assert_eq!(::std::mem::size_of::() , 72usize , concat ! ( "Size of: " , stringify ! ( Mutex ) )); assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( Mutex ) )); @@ -9197,8 +9257,10 @@ pub mod root { PropertyStyleAnimationValuePair ) , "::" , stringify ! ( mValue ) )); } + pub type ComputedKeyframeValues = + root::nsTArray; #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_156786() { + fn __bindgen_test_layout_DefaultDelete_instantiation_3() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -10316,194 +10378,196 @@ pub mod root { pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } } - pub type va_list = root::__builtin_va_list; - pub type fpos_t = root::__darwin_off_t; #[repr(C)] #[derive(Debug, Copy)] - pub struct __sbuf { - pub _base: *mut ::std::os::raw::c_uchar, - pub _size: ::std::os::raw::c_int, + pub struct _IO_FILE { + pub _flags: ::std::os::raw::c_int, + pub _IO_read_ptr: *mut ::std::os::raw::c_char, + pub _IO_read_end: *mut ::std::os::raw::c_char, + pub _IO_read_base: *mut ::std::os::raw::c_char, + pub _IO_write_base: *mut ::std::os::raw::c_char, + pub _IO_write_ptr: *mut ::std::os::raw::c_char, + pub _IO_write_end: *mut ::std::os::raw::c_char, + pub _IO_buf_base: *mut ::std::os::raw::c_char, + pub _IO_buf_end: *mut ::std::os::raw::c_char, + pub _IO_save_base: *mut ::std::os::raw::c_char, + pub _IO_backup_base: *mut ::std::os::raw::c_char, + pub _IO_save_end: *mut ::std::os::raw::c_char, + pub _markers: *mut root::_IO_marker, + pub _chain: *mut root::_IO_FILE, + pub _fileno: ::std::os::raw::c_int, + pub _flags2: ::std::os::raw::c_int, + pub _old_offset: root::__off_t, + pub _cur_column: ::std::os::raw::c_ushort, + pub _vtable_offset: ::std::os::raw::c_schar, + pub _shortbuf: [::std::os::raw::c_char; 1usize], + pub _lock: *mut root::_IO_lock_t, + pub _offset: root::__off64_t, + pub __pad1: *mut ::std::os::raw::c_void, + pub __pad2: *mut ::std::os::raw::c_void, + pub __pad3: *mut ::std::os::raw::c_void, + pub __pad4: *mut ::std::os::raw::c_void, + pub __pad5: usize, + pub _mode: ::std::os::raw::c_int, + pub _unused2: [::std::os::raw::c_char; 20usize], } #[test] - fn bindgen_test_layout___sbuf() { - assert_eq!(::std::mem::size_of::<__sbuf>() , 16usize , concat ! ( - "Size of: " , stringify ! ( __sbuf ) )); - assert_eq! (::std::mem::align_of::<__sbuf>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( __sbuf ) )); + fn bindgen_test_layout__IO_FILE() { + assert_eq!(::std::mem::size_of::<_IO_FILE>() , 216usize , concat ! ( + "Size of: " , stringify ! ( _IO_FILE ) )); + assert_eq! (::std::mem::align_of::<_IO_FILE>() , 8usize , concat ! ( + "Alignment of " , stringify ! ( _IO_FILE ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sbuf ) ) . _base as * const _ as + & ( * ( 0 as * const _IO_FILE ) ) . _flags as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( __sbuf ) , "::" , - stringify ! ( _base ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const __sbuf ) ) . _size as * const _ as - usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( __sbuf ) , "::" , - stringify ! ( _size ) )); - } - impl Clone for __sbuf { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct __sFILEX { - _unused: [u8; 0], - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct __sFILE { - pub _p: *mut ::std::os::raw::c_uchar, - pub _r: ::std::os::raw::c_int, - pub _w: ::std::os::raw::c_int, - pub _flags: ::std::os::raw::c_short, - pub _file: ::std::os::raw::c_short, - pub _bf: root::__sbuf, - pub _lbfsize: ::std::os::raw::c_int, - pub _cookie: *mut ::std::os::raw::c_void, - pub _close: ::std::option::Option ::std::os::raw::c_int>, - pub _read: ::std::option::Option ::std::os::raw::c_int>, - pub _seek: ::std::option::Option root::fpos_t>, - pub _write: ::std::option::Option ::std::os::raw::c_int>, - pub _ub: root::__sbuf, - pub _extra: *mut root::__sFILEX, - pub _ur: ::std::os::raw::c_int, - pub _ubuf: [::std::os::raw::c_uchar; 3usize], - pub _nbuf: [::std::os::raw::c_uchar; 1usize], - pub _lb: root::__sbuf, - pub _blksize: ::std::os::raw::c_int, - pub _offset: root::fpos_t, - } - #[test] - fn bindgen_test_layout___sFILE() { - assert_eq!(::std::mem::size_of::<__sFILE>() , 152usize , concat ! ( - "Size of: " , stringify ! ( __sFILE ) )); - assert_eq! (::std::mem::align_of::<__sFILE>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( __sFILE ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _p as * const _ as - usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _p ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _r as * const _ as - usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _r ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _w as * const _ as - usize } , 12usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _w ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _flags as * const _ as - usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _flags ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _file as * const _ as - usize } , 18usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _file ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _IO_read_ptr as * + const _ as usize } , 8usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_read_ptr ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _bf as * const _ as - usize } , 24usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _bf ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _IO_read_end as * + const _ as usize } , 16usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_read_end ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _lbfsize as * const _ - as usize } , 40usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _lbfsize ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _IO_read_base as * + const _ as usize } , 24usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_read_base ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _cookie as * const _ as - usize } , 48usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _cookie ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _IO_write_base as * + const _ as usize } , 32usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_write_base ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _close as * const _ as - usize } , 56usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _close ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _IO_write_ptr as * + const _ as usize } , 40usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_write_ptr ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _read as * const _ as - usize } , 64usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _read ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _IO_write_end as * + const _ as usize } , 48usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_write_end ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _seek as * const _ as - usize } , 72usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _seek ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _IO_buf_base as * + const _ as usize } , 56usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_buf_base ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _write as * const _ as - usize } , 80usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _write ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _IO_buf_end as * const + _ as usize } , 64usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_buf_end ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _ub as * const _ as - usize } , 88usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _ub ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _IO_save_base as * + const _ as usize } , 72usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_save_base ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _extra as * const _ as + & ( * ( 0 as * const _IO_FILE ) ) . _IO_backup_base as * + const _ as usize } , 80usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_backup_base ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . _IO_save_end as * + const _ as usize } , 88usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_save_end ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . _markers as * const _ + as usize } , 96usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _markers ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . _chain as * const _ as usize } , 104usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _extra ) )); + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _chain ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _ur as * const _ as - usize } , 112usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _ur ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _fileno as * const _ + as usize } , 112usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _fileno ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _ubuf as * const _ as - usize } , 116usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _ubuf ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _flags2 as * const _ + as usize } , 116usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _flags2 ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _nbuf as * const _ as - usize } , 119usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _nbuf ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _old_offset as * const + _ as usize } , 120usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _old_offset ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _lb as * const _ as - usize } , 120usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _lb ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _cur_column as * const + _ as usize } , 128usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _cur_column ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _blksize as * const _ - as usize } , 136usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _blksize ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _vtable_offset as * + const _ as usize } , 130usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _vtable_offset ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _offset as * const _ as - usize } , 144usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , + & ( * ( 0 as * const _IO_FILE ) ) . _shortbuf as * const _ + as usize } , 131usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _shortbuf ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . _lock as * const _ as + usize } , 136usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _lock ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . _offset as * const _ + as usize } , 144usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _offset ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . __pad1 as * const _ as + usize } , 152usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( __pad1 ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . __pad2 as * const _ as + usize } , 160usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( __pad2 ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . __pad3 as * const _ as + usize } , 168usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( __pad3 ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . __pad4 as * const _ as + usize } , 176usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( __pad4 ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . __pad5 as * const _ as + usize } , 184usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( __pad5 ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . _mode as * const _ as + usize } , 192usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _mode ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . _unused2 as * const _ + as usize } , 196usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _unused2 ) )); } - impl Clone for __sFILE { + impl Clone for _IO_FILE { fn clone(&self) -> Self { *self } } - pub type FILE = root::__sFILE; + pub type FILE = root::_IO_FILE; + pub type va_list = root::__builtin_va_list; #[repr(C)] #[derive(Debug, Copy)] pub struct InfallibleAllocPolicy { @@ -11060,6 +11124,39 @@ pub mod root { NS_OK_NO_NAME_CLAUSE_HANDLED = 7864354, } pub type nsrefcnt = root::MozRefCountType; + pub type _IO_lock_t = ::std::os::raw::c_void; + #[repr(C)] + #[derive(Debug, Copy)] + pub struct _IO_marker { + pub _next: *mut root::_IO_marker, + pub _sbuf: *mut root::_IO_FILE, + pub _pos: ::std::os::raw::c_int, + } + #[test] + fn bindgen_test_layout__IO_marker() { + assert_eq!(::std::mem::size_of::<_IO_marker>() , 24usize , concat ! ( + "Size of: " , stringify ! ( _IO_marker ) )); + assert_eq! (::std::mem::align_of::<_IO_marker>() , 8usize , concat ! ( + "Alignment of " , stringify ! ( _IO_marker ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_marker ) ) . _next as * const _ + as usize } , 0usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_marker ) , "::" + , stringify ! ( _next ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_marker ) ) . _sbuf as * const _ + as usize } , 8usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_marker ) , "::" + , stringify ! ( _sbuf ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_marker ) ) . _pos as * const _ as + usize } , 16usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_marker ) , "::" + , stringify ! ( _pos ) )); + } + impl Clone for _IO_marker { + fn clone(&self) -> Self { *self } + } #[repr(C)] pub struct nsQueryFrame__bindgen_vtable(::std::os::raw::c_void); #[repr(C)] @@ -11618,28 +11715,6 @@ pub mod root { pub struct nsCharTraits { pub _address: u8, } - #[test] - fn __bindgen_test_layout_nsCharTraits_instantiation_53553() { - assert_eq!(::std::mem::size_of::() , 1usize , - concat ! ( - "Size of template specialization: " , stringify ! ( - root::nsCharTraits ) )); - assert_eq!(::std::mem::align_of::() , 1usize , - concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::nsCharTraits ) )); - } - #[test] - fn __bindgen_test_layout_nsCharTraits_instantiation_53557() { - assert_eq!(::std::mem::size_of::() , 1usize , - concat ! ( - "Size of template specialization: " , stringify ! ( - root::nsCharTraits ) )); - assert_eq!(::std::mem::align_of::() , 1usize , - concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::nsCharTraits ) )); - } /** * @see nsTAString */ @@ -12321,40 +12396,56 @@ pub mod root { #[inline] pub fn payload47(&self) -> u64 { let mask = 140737488355327usize as u64; - let field_val: u64 = + let unit_field_val: u64 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u64) } } #[inline] pub fn set_payload47(&mut self, val: u64) { let mask = 140737488355327usize as u64; let val = val as u64 as u64; - let mut field_val: u64 = + let mut unit_field_val: u64 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn tag(&self) -> root::JSValueTag { let mask = 18446603336221196288usize as u64; - let field_val: u64 = + let unit_field_val: u64 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 47usize; + let val = (unit_field_val & mask) >> 47usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_tag(&mut self, val: root::JSValueTag) { let mask = 18446603336221196288usize as u64; let val = val as u32 as u64; - let mut field_val: u64 = + let mut unit_field_val: u64 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 47usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 47usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(payload47: u64, tag: root::JSValueTag) + -> u64 { + let bitfield_unit_val = + { + let bitfield_unit_val = { 0 }; + let payload47 = payload47 as u64 as u64; + let mask = 140737488355327usize as u64; + let payload47 = (payload47 << 0usize) & mask; + bitfield_unit_val | payload47 + }; + let tag = tag as u32 as u64; + let mask = 18446603336221196288usize as u64; + let tag = (tag << 47usize) & mask; + bitfield_unit_val | tag } } #[repr(C)] @@ -12877,6 +12968,11 @@ pub mod root { AutoSetAsyncStackForNewCalls ) , "::" , stringify ! ( oldAsyncCallIsExplicit ) )); } + pub type WarningReporter = + ::std::option::Option; #[repr(C)] #[derive(Debug)] pub struct AutoHideScriptedCaller { @@ -13038,6 +13134,113 @@ pub mod root { pub struct JSCompartment { _unused: [u8; 0], } + /** + * Describes a single error or warning that occurs in the execution of script. + */ + #[repr(C)] + pub struct JSErrorReport { + pub _base: root::JSErrorBase, + pub linebuf_: *const u16, + pub linebufLength_: usize, + pub tokenOffset_: usize, + pub notes: root::mozilla::UniquePtr, + pub flags: ::std::os::raw::c_uint, + pub exnType: i16, + pub _bitfield_1: u8, + pub __bindgen_padding_0: u8, + } + #[test] + fn bindgen_test_layout_JSErrorReport() { + assert_eq!(::std::mem::size_of::() , 72usize , concat ! + ( "Size of: " , stringify ! ( JSErrorReport ) )); + assert_eq! (::std::mem::align_of::() , 8usize , concat + ! ( "Alignment of " , stringify ! ( JSErrorReport ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const JSErrorReport ) ) . linebuf_ as * + const _ as usize } , 32usize , concat ! ( + "Alignment of field: " , stringify ! ( JSErrorReport ) , + "::" , stringify ! ( linebuf_ ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const JSErrorReport ) ) . linebufLength_ as + * const _ as usize } , 40usize , concat ! ( + "Alignment of field: " , stringify ! ( JSErrorReport ) , + "::" , stringify ! ( linebufLength_ ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const JSErrorReport ) ) . tokenOffset_ as * + const _ as usize } , 48usize , concat ! ( + "Alignment of field: " , stringify ! ( JSErrorReport ) , + "::" , stringify ! ( tokenOffset_ ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const JSErrorReport ) ) . notes as * const + _ as usize } , 56usize , concat ! ( + "Alignment of field: " , stringify ! ( JSErrorReport ) , + "::" , stringify ! ( notes ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const JSErrorReport ) ) . flags as * const + _ as usize } , 64usize , concat ! ( + "Alignment of field: " , stringify ! ( JSErrorReport ) , + "::" , stringify ! ( flags ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const JSErrorReport ) ) . exnType as * + const _ as usize } , 68usize , concat ! ( + "Alignment of field: " , stringify ! ( JSErrorReport ) , + "::" , stringify ! ( exnType ) )); + } + impl JSErrorReport { + #[inline] + pub fn isMuted(&self) -> bool { + let mask = 1usize as u8; + let unit_field_val: u8 = + unsafe { ::std::mem::transmute(self._bitfield_1) }; + let val = (unit_field_val & mask) >> 0usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_isMuted(&mut self, val: bool) { + let mask = 1usize as u8; + let val = val as u8 as u8; + let mut unit_field_val: u8 = + unsafe { ::std::mem::transmute(self._bitfield_1) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn ownsLinebuf_(&self) -> bool { + let mask = 2usize as u8; + let unit_field_val: u8 = + unsafe { ::std::mem::transmute(self._bitfield_1) }; + let val = (unit_field_val & mask) >> 1usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_ownsLinebuf_(&mut self, val: bool) { + let mask = 2usize as u8; + let val = val as u8 as u8; + let mut unit_field_val: u8 = + unsafe { ::std::mem::transmute(self._bitfield_1) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(isMuted: bool, ownsLinebuf_: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = { 0 }; + let isMuted = isMuted as u8 as u8; + let mask = 1usize as u8; + let isMuted = (isMuted << 0usize) & mask; + bitfield_unit_val | isMuted + }; + let ownsLinebuf_ = ownsLinebuf_ as u8 as u8; + let mask = 2usize as u8; + let ownsLinebuf_ = (ownsLinebuf_ << 1usize) & mask; + bitfield_unit_val | ownsLinebuf_ + } + } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JSRuntime { @@ -13102,17 +13305,6 @@ pub mod root { pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } pub type nsCOMPtr_element_type = T; - #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_62693() { - assert_eq!(::std::mem::size_of::>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::nsCOMPtr ) )); - assert_eq!(::std::mem::align_of::>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::nsCOMPtr ) )); - } #[repr(C)] #[derive(Debug)] pub struct nsAutoPtr { @@ -13749,38 +13941,55 @@ pub mod root { #[inline] pub fn mCapacity(&self) -> u32 { let mask = 2147483647usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mCapacity(&mut self, val: u32) { let mask = 2147483647usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsAutoArray(&self) -> u32 { let mask = 2147483648usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 31usize; + let val = (unit_field_val & mask) >> 31usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mIsAutoArray(&mut self, val: u32) { let mask = 2147483648usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 31usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 31usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mCapacity: u32, mIsAutoArray: u32) -> u32 { + let bitfield_unit_val = + { + let bitfield_unit_val = { 0 }; + let mCapacity = mCapacity as u32 as u32; + let mask = 2147483647usize as u32; + let mCapacity = (mCapacity << 0usize) & mask; + bitfield_unit_val | mCapacity + }; + let mIsAutoArray = mIsAutoArray as u32 as u32; + let mask = 2147483648usize as u32; + let mIsAutoArray = (mIsAutoArray << 31usize) & mask; + bitfield_unit_val | mIsAutoArray } } pub type nscoord = i32; @@ -13851,7 +14060,7 @@ pub mod root { #[derive(Debug)] pub struct gfxFontFeatureValueSet_ValueList { pub name: ::nsstring::nsStringRepr, - pub featureSelectors: root::nsTArray<::std::os::raw::c_uint>, + pub featureSelectors: root::nsTArray, } #[test] fn bindgen_test_layout_gfxFontFeatureValueSet_ValueList() { @@ -13956,7 +14165,7 @@ pub mod root { pub struct gfxFontFeatureValueSet_FeatureValueHashEntry { pub _base: root::PLDHashEntryHdr, pub mKey: root::gfxFontFeatureValueSet_FeatureValueHashKey, - pub mValues: root::nsTArray<::std::os::raw::c_uint>, + pub mValues: root::nsTArray, } pub type gfxFontFeatureValueSet_FeatureValueHashEntry_KeyType = *const root::gfxFontFeatureValueSet_FeatureValueHashKey; @@ -14066,7 +14275,7 @@ pub mod root { pub alternateValues: root::nsTArray, pub featureValueLookup: root::RefPtr, pub fontFeatureSettings: root::nsTArray, - pub fontVariationSettings: root::nsTArray, + pub fontVariationSettings: root::nsTArray, pub languageOverride: u32, } #[test] @@ -14579,6 +14788,28 @@ pub mod root { #[inline] fn bitor(self, other: Self) -> Self { nsChangeHint(self.0 | other.0) } } + impl ::std::ops::BitOrAssign for root::nsChangeHint { + #[inline] + fn bitor_assign(&mut self, rhs: root::nsChangeHint) { + self.0 |= rhs.0; + } + } + impl ::std::ops::BitAnd for root::nsChangeHint { + type + Output + = + Self; + #[inline] + fn bitand(self, other: Self) -> Self { + nsChangeHint(self.0 & other.0) + } + } + impl ::std::ops::BitAndAssign for root::nsChangeHint { + #[inline] + fn bitand_assign(&mut self, rhs: root::nsChangeHint) { + self.0 &= rhs.0; + } + } #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub struct nsChangeHint(pub u32); @@ -14616,6 +14847,28 @@ pub mod root { nsRestyleHint(self.0 | other.0) } } + impl ::std::ops::BitOrAssign for root::nsRestyleHint { + #[inline] + fn bitor_assign(&mut self, rhs: root::nsRestyleHint) { + self.0 |= rhs.0; + } + } + impl ::std::ops::BitAnd for root::nsRestyleHint { + type + Output + = + Self; + #[inline] + fn bitand(self, other: Self) -> Self { + nsRestyleHint(self.0 & other.0) + } + } + impl ::std::ops::BitAndAssign for root::nsRestyleHint { + #[inline] + fn bitand_assign(&mut self, rhs: root::nsRestyleHint) { + self.0 &= rhs.0; + } + } #[repr(C)] /** * |nsRestyleHint| is a bitfield for the result of @@ -14702,7 +14955,7 @@ pub mod root { * count is 1. */ #[repr(C)] - #[derive(Debug, Copy)] + #[derive(Debug)] pub struct nsStringBuffer { pub mRefCount: u32, pub mStorageSize: u32, @@ -14724,9 +14977,6 @@ pub mod root { "Alignment of field: " , stringify ! ( nsStringBuffer ) , "::" , stringify ! ( mStorageSize ) )); } - impl Clone for nsStringBuffer { - fn clone(&self) -> Self { *self } - } #[repr(C)] #[derive(Debug, Copy)] pub struct nsIAtom { @@ -14769,38 +15019,55 @@ pub mod root { #[inline] pub fn mLength(&self) -> u32 { let mask = 2147483647usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mLength(&mut self, val: u32) { let mask = 2147483647usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsStatic(&self) -> u32 { let mask = 2147483648usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 31usize; + let val = (unit_field_val & mask) >> 31usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mIsStatic(&mut self, val: u32) { let mask = 2147483648usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 31usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 31usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mLength: u32, mIsStatic: u32) -> u32 { + let bitfield_unit_val = + { + let bitfield_unit_val = { 0 }; + let mLength = mLength as u32 as u32; + let mask = 2147483647usize as u32; + let mLength = (mLength << 0usize) & mask; + bitfield_unit_val | mLength + }; + let mIsStatic = mIsStatic as u32 as u32; + let mask = 2147483648usize as u32; + let mIsStatic = (mIsStatic << 31usize) & mask; + bitfield_unit_val | mIsStatic } } #[repr(C)] @@ -15596,20 +15863,29 @@ pub mod root { #[inline] pub fn ownsMessage_(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_ownsMessage_(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(ownsMessage_: bool) -> u8 { + let bitfield_unit_val = { 0 }; + let ownsMessage_ = ownsMessage_ as u8 as u8; + let mask = 1usize as u8; + let ownsMessage_ = (ownsMessage_ << 0usize) & mask; + bitfield_unit_val | ownsMessage_ } } /** @@ -16469,7 +16745,7 @@ pub mod root { */ pub mFrameRequestCallbackCounter: i32, pub mStaticCloneCount: u32, - pub mBlockedTrackingNodes: root::nsTArray>, + pub mBlockedTrackingNodes: root::nsTArray, pub mWindow: *mut root::nsPIDOMWindowInner, pub mCachedEncoder: root::nsCOMPtr, pub mFrameRequestCallbacks: root::nsTArray, @@ -16776,812 +17052,1440 @@ pub mod root { #[inline] pub fn mBidiEnabled(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mBidiEnabled(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mMathMLEnabled(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mMathMLEnabled(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsInitialDocumentInWindow(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsInitialDocumentInWindow(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIgnoreDocGroupMismatches(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIgnoreDocGroupMismatches(&mut self, val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mLoadedAsData(&self) -> bool { let mask = 16usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mLoadedAsData(&mut self, val: bool) { let mask = 16usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mLoadedAsInteractiveData(&self) -> bool { let mask = 32usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 5usize; + let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mLoadedAsInteractiveData(&mut self, val: bool) { let mask = 32usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 5usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mMayStartLayout(&self) -> bool { let mask = 64usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 6usize; + let val = (unit_field_val & mask) >> 6usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mMayStartLayout(&mut self, val: bool) { let mask = 64usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 6usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHaveFiredTitleChange(&self) -> bool { let mask = 128usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 7usize; + let val = (unit_field_val & mask) >> 7usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHaveFiredTitleChange(&mut self, val: bool) { let mask = 128usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 7usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 7usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mBidiEnabled: bool, mMathMLEnabled: bool, + mIsInitialDocumentInWindow: bool, + mIgnoreDocGroupMismatches: bool, + mLoadedAsData: bool, + mLoadedAsInteractiveData: bool, + mMayStartLayout: bool, + mHaveFiredTitleChange: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { 0 }; + let mBidiEnabled = + mBidiEnabled + as + u8 + as + u8; + let mask = + 1usize + as + u8; + let mBidiEnabled = + (mBidiEnabled + << + 0usize) + & + mask; + bitfield_unit_val + | + mBidiEnabled + }; + let mMathMLEnabled = + mMathMLEnabled + as u8 as + u8; + let mask = + 2usize as u8; + let mMathMLEnabled = + (mMathMLEnabled + << + 1usize) & + mask; + bitfield_unit_val + | + mMathMLEnabled + }; + let mIsInitialDocumentInWindow = + mIsInitialDocumentInWindow + as u8 as u8; + let mask = 4usize as u8; + let mIsInitialDocumentInWindow = + (mIsInitialDocumentInWindow + << 2usize) & + mask; + bitfield_unit_val | + mIsInitialDocumentInWindow + }; + let mIgnoreDocGroupMismatches = + mIgnoreDocGroupMismatches as + u8 as u8; + let mask = 8usize as u8; + let mIgnoreDocGroupMismatches = + (mIgnoreDocGroupMismatches << + 3usize) & mask; + bitfield_unit_val | + mIgnoreDocGroupMismatches + }; + let mLoadedAsData = + mLoadedAsData as u8 as u8; + let mask = 16usize as u8; + let mLoadedAsData = + (mLoadedAsData << 4usize) & mask; + bitfield_unit_val | mLoadedAsData + }; + let mLoadedAsInteractiveData = + mLoadedAsInteractiveData as u8 as u8; + let mask = 32usize as u8; + let mLoadedAsInteractiveData = + (mLoadedAsInteractiveData << 5usize) & mask; + bitfield_unit_val | mLoadedAsInteractiveData + }; + let mMayStartLayout = mMayStartLayout as u8 as u8; + let mask = 64usize as u8; + let mMayStartLayout = (mMayStartLayout << 6usize) & mask; + bitfield_unit_val | mMayStartLayout + }; + let mHaveFiredTitleChange = mHaveFiredTitleChange as u8 as u8; + let mask = 128usize as u8; + let mHaveFiredTitleChange = + (mHaveFiredTitleChange << 7usize) & mask; + bitfield_unit_val | mHaveFiredTitleChange } #[inline] pub fn mIsShowing(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsShowing(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mVisible(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mVisible(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasReferrerPolicyCSP(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasReferrerPolicyCSP(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mRemovedFromDocShell(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mRemovedFromDocShell(&mut self, val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mAllowDNSPrefetch(&self) -> bool { let mask = 16usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mAllowDNSPrefetch(&mut self, val: bool) { let mask = 16usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsStaticDocument(&self) -> bool { let mask = 32usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 5usize; + let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsStaticDocument(&mut self, val: bool) { let mask = 32usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 5usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mCreatingStaticClone(&self) -> bool { let mask = 64usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 6usize; + let val = (unit_field_val & mask) >> 6usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mCreatingStaticClone(&mut self, val: bool) { let mask = 64usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 6usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mInUnlinkOrDeletion(&self) -> bool { let mask = 128usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 7usize; + let val = (unit_field_val & mask) >> 7usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mInUnlinkOrDeletion(&mut self, val: bool) { let mask = 128usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 7usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 7usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_2(mIsShowing: bool, mVisible: bool, + mHasReferrerPolicyCSP: bool, + mRemovedFromDocShell: bool, + mAllowDNSPrefetch: bool, + mIsStaticDocument: bool, + mCreatingStaticClone: bool, + mInUnlinkOrDeletion: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { 0 }; + let mIsShowing = + mIsShowing + as + u8 + as + u8; + let mask = + 1usize + as + u8; + let mIsShowing = + (mIsShowing + << + 0usize) + & + mask; + bitfield_unit_val + | + mIsShowing + }; + let mVisible = + mVisible as u8 + as u8; + let mask = + 2usize as u8; + let mVisible = + (mVisible << + 1usize) & + mask; + bitfield_unit_val + | mVisible + }; + let mHasReferrerPolicyCSP = + mHasReferrerPolicyCSP + as u8 as u8; + let mask = 4usize as u8; + let mHasReferrerPolicyCSP = + (mHasReferrerPolicyCSP + << 2usize) & + mask; + bitfield_unit_val | + mHasReferrerPolicyCSP + }; + let mRemovedFromDocShell = + mRemovedFromDocShell as u8 as + u8; + let mask = 8usize as u8; + let mRemovedFromDocShell = + (mRemovedFromDocShell << + 3usize) & mask; + bitfield_unit_val | + mRemovedFromDocShell + }; + let mAllowDNSPrefetch = + mAllowDNSPrefetch as u8 as u8; + let mask = 16usize as u8; + let mAllowDNSPrefetch = + (mAllowDNSPrefetch << 4usize) & mask; + bitfield_unit_val | mAllowDNSPrefetch + }; + let mIsStaticDocument = + mIsStaticDocument as u8 as u8; + let mask = 32usize as u8; + let mIsStaticDocument = + (mIsStaticDocument << 5usize) & mask; + bitfield_unit_val | mIsStaticDocument + }; + let mCreatingStaticClone = + mCreatingStaticClone as u8 as u8; + let mask = 64usize as u8; + let mCreatingStaticClone = + (mCreatingStaticClone << 6usize) & mask; + bitfield_unit_val | mCreatingStaticClone + }; + let mInUnlinkOrDeletion = mInUnlinkOrDeletion as u8 as u8; + let mask = 128usize as u8; + let mInUnlinkOrDeletion = (mInUnlinkOrDeletion << 7usize) & mask; + bitfield_unit_val | mInUnlinkOrDeletion } #[inline] pub fn mHasHadScriptHandlingObject(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasHadScriptHandlingObject(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_3 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_3 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsBeingUsedAsImage(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsBeingUsedAsImage(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_3 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_3 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsSyntheticDocument(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsSyntheticDocument(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_3 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_3 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasLinksToUpdate(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasLinksToUpdate(&mut self, val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_3 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_3 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasLinksToUpdateRunnable(&self) -> bool { let mask = 16usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasLinksToUpdateRunnable(&mut self, val: bool) { let mask = 16usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_3 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_3 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mMayHaveDOMMutationObservers(&self) -> bool { let mask = 32usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - let val = (field_val & mask) >> 5usize; + let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mMayHaveDOMMutationObservers(&mut self, val: bool) { let mask = 32usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - field_val &= !mask; - field_val |= (val << 5usize) & mask; - self._bitfield_3 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + self._bitfield_3 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mMayHaveAnimationObservers(&self) -> bool { let mask = 64usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - let val = (field_val & mask) >> 6usize; + let val = (unit_field_val & mask) >> 6usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mMayHaveAnimationObservers(&mut self, val: bool) { let mask = 64usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - field_val &= !mask; - field_val |= (val << 6usize) & mask; - self._bitfield_3 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + self._bitfield_3 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasMixedActiveContentLoaded(&self) -> bool { let mask = 128usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - let val = (field_val & mask) >> 7usize; + let val = (unit_field_val & mask) >> 7usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasMixedActiveContentLoaded(&mut self, val: bool) { let mask = 128usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - field_val &= !mask; - field_val |= (val << 7usize) & mask; - self._bitfield_3 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 7usize) & mask; + self._bitfield_3 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_3(mHasHadScriptHandlingObject: bool, + mIsBeingUsedAsImage: bool, + mIsSyntheticDocument: bool, + mHasLinksToUpdate: bool, + mHasLinksToUpdateRunnable: bool, + mMayHaveDOMMutationObservers: bool, + mMayHaveAnimationObservers: bool, + mHasMixedActiveContentLoaded: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { 0 }; + let mHasHadScriptHandlingObject = + mHasHadScriptHandlingObject + as + u8 + as + u8; + let mask = + 1usize + as + u8; + let mHasHadScriptHandlingObject = + (mHasHadScriptHandlingObject + << + 0usize) + & + mask; + bitfield_unit_val + | + mHasHadScriptHandlingObject + }; + let mIsBeingUsedAsImage = + mIsBeingUsedAsImage + as u8 as + u8; + let mask = + 2usize as u8; + let mIsBeingUsedAsImage = + (mIsBeingUsedAsImage + << + 1usize) & + mask; + bitfield_unit_val + | + mIsBeingUsedAsImage + }; + let mIsSyntheticDocument = + mIsSyntheticDocument + as u8 as u8; + let mask = 4usize as u8; + let mIsSyntheticDocument = + (mIsSyntheticDocument + << 2usize) & + mask; + bitfield_unit_val | + mIsSyntheticDocument + }; + let mHasLinksToUpdate = + mHasLinksToUpdate as u8 as u8; + let mask = 8usize as u8; + let mHasLinksToUpdate = + (mHasLinksToUpdate << 3usize) + & mask; + bitfield_unit_val | + mHasLinksToUpdate + }; + let mHasLinksToUpdateRunnable = + mHasLinksToUpdateRunnable as u8 as u8; + let mask = 16usize as u8; + let mHasLinksToUpdateRunnable = + (mHasLinksToUpdateRunnable << 4usize) + & mask; + bitfield_unit_val | + mHasLinksToUpdateRunnable + }; + let mMayHaveDOMMutationObservers = + mMayHaveDOMMutationObservers as u8 as u8; + let mask = 32usize as u8; + let mMayHaveDOMMutationObservers = + (mMayHaveDOMMutationObservers << 5usize) & + mask; + bitfield_unit_val | mMayHaveDOMMutationObservers + }; + let mMayHaveAnimationObservers = + mMayHaveAnimationObservers as u8 as u8; + let mask = 64usize as u8; + let mMayHaveAnimationObservers = + (mMayHaveAnimationObservers << 6usize) & mask; + bitfield_unit_val | mMayHaveAnimationObservers + }; + let mHasMixedActiveContentLoaded = + mHasMixedActiveContentLoaded as u8 as u8; + let mask = 128usize as u8; + let mHasMixedActiveContentLoaded = + (mHasMixedActiveContentLoaded << 7usize) & mask; + bitfield_unit_val | mHasMixedActiveContentLoaded } #[inline] pub fn mHasMixedActiveContentBlocked(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasMixedActiveContentBlocked(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_4 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_4 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasMixedDisplayContentLoaded(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasMixedDisplayContentLoaded(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_4 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_4 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasMixedDisplayContentBlocked(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasMixedDisplayContentBlocked(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_4 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_4 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasMixedContentObjectSubrequest(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasMixedContentObjectSubrequest(&mut self, val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_4 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_4 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasCSP(&self) -> bool { let mask = 16usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasCSP(&mut self, val: bool) { let mask = 16usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_4 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_4 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasUnsafeEvalCSP(&self) -> bool { let mask = 32usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - let val = (field_val & mask) >> 5usize; + let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasUnsafeEvalCSP(&mut self, val: bool) { let mask = 32usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - field_val &= !mask; - field_val |= (val << 5usize) & mask; - self._bitfield_4 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + self._bitfield_4 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasUnsafeInlineCSP(&self) -> bool { let mask = 64usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - let val = (field_val & mask) >> 6usize; + let val = (unit_field_val & mask) >> 6usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasUnsafeInlineCSP(&mut self, val: bool) { let mask = 64usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - field_val &= !mask; - field_val |= (val << 6usize) & mask; - self._bitfield_4 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + self._bitfield_4 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasTrackingContentBlocked(&self) -> bool { let mask = 128usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - let val = (field_val & mask) >> 7usize; + let val = (unit_field_val & mask) >> 7usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasTrackingContentBlocked(&mut self, val: bool) { let mask = 128usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - field_val &= !mask; - field_val |= (val << 7usize) & mask; - self._bitfield_4 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 7usize) & mask; + self._bitfield_4 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_4(mHasMixedActiveContentBlocked: bool, + mHasMixedDisplayContentLoaded: bool, + mHasMixedDisplayContentBlocked: bool, + mHasMixedContentObjectSubrequest: bool, + mHasCSP: bool, mHasUnsafeEvalCSP: bool, + mHasUnsafeInlineCSP: bool, + mHasTrackingContentBlocked: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { 0 }; + let mHasMixedActiveContentBlocked = + mHasMixedActiveContentBlocked + as + u8 + as + u8; + let mask = + 1usize + as + u8; + let mHasMixedActiveContentBlocked = + (mHasMixedActiveContentBlocked + << + 0usize) + & + mask; + bitfield_unit_val + | + mHasMixedActiveContentBlocked + }; + let mHasMixedDisplayContentLoaded = + mHasMixedDisplayContentLoaded + as u8 as + u8; + let mask = + 2usize as u8; + let mHasMixedDisplayContentLoaded = + (mHasMixedDisplayContentLoaded + << + 1usize) & + mask; + bitfield_unit_val + | + mHasMixedDisplayContentLoaded + }; + let mHasMixedDisplayContentBlocked = + mHasMixedDisplayContentBlocked + as u8 as u8; + let mask = 4usize as u8; + let mHasMixedDisplayContentBlocked = + (mHasMixedDisplayContentBlocked + << 2usize) & + mask; + bitfield_unit_val | + mHasMixedDisplayContentBlocked + }; + let mHasMixedContentObjectSubrequest = + mHasMixedContentObjectSubrequest + as u8 as u8; + let mask = 8usize as u8; + let mHasMixedContentObjectSubrequest = + (mHasMixedContentObjectSubrequest + << 3usize) & mask; + bitfield_unit_val | + mHasMixedContentObjectSubrequest + }; + let mHasCSP = mHasCSP as u8 as u8; + let mask = 16usize as u8; + let mHasCSP = (mHasCSP << 4usize) & mask; + bitfield_unit_val | mHasCSP + }; + let mHasUnsafeEvalCSP = + mHasUnsafeEvalCSP as u8 as u8; + let mask = 32usize as u8; + let mHasUnsafeEvalCSP = + (mHasUnsafeEvalCSP << 5usize) & mask; + bitfield_unit_val | mHasUnsafeEvalCSP + }; + let mHasUnsafeInlineCSP = mHasUnsafeInlineCSP as u8 as u8; + let mask = 64usize as u8; + let mHasUnsafeInlineCSP = + (mHasUnsafeInlineCSP << 6usize) & mask; + bitfield_unit_val | mHasUnsafeInlineCSP + }; + let mHasTrackingContentBlocked = + mHasTrackingContentBlocked as u8 as u8; + let mask = 128usize as u8; + let mHasTrackingContentBlocked = + (mHasTrackingContentBlocked << 7usize) & mask; + bitfield_unit_val | mHasTrackingContentBlocked } #[inline] pub fn mHasTrackingContentLoaded(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasTrackingContentLoaded(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_5 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_5 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mBFCacheDisallowed(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mBFCacheDisallowed(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_5 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_5 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasHadDefaultView(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasHadDefaultView(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_5 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_5 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mStyleSheetChangeEventsEnabled(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mStyleSheetChangeEventsEnabled(&mut self, val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_5 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_5 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsSrcdocDocument(&self) -> bool { let mask = 16usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsSrcdocDocument(&mut self, val: bool) { let mask = 16usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_5 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_5 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mDidDocumentOpen(&self) -> bool { let mask = 32usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - let val = (field_val & mask) >> 5usize; + let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mDidDocumentOpen(&mut self, val: bool) { let mask = 32usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - field_val &= !mask; - field_val |= (val << 5usize) & mask; - self._bitfield_5 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + self._bitfield_5 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasDisplayDocument(&self) -> bool { let mask = 64usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - let val = (field_val & mask) >> 6usize; + let val = (unit_field_val & mask) >> 6usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasDisplayDocument(&mut self, val: bool) { let mask = 64usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - field_val &= !mask; - field_val |= (val << 6usize) & mask; - self._bitfield_5 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + self._bitfield_5 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mFontFaceSetDirty(&self) -> bool { let mask = 128usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - let val = (field_val & mask) >> 7usize; + let val = (unit_field_val & mask) >> 7usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mFontFaceSetDirty(&mut self, val: bool) { let mask = 128usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - field_val &= !mask; - field_val |= (val << 7usize) & mask; - self._bitfield_5 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 7usize) & mask; + self._bitfield_5 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_5(mHasTrackingContentLoaded: bool, + mBFCacheDisallowed: bool, + mHasHadDefaultView: bool, + mStyleSheetChangeEventsEnabled: bool, + mIsSrcdocDocument: bool, mDidDocumentOpen: bool, + mHasDisplayDocument: bool, + mFontFaceSetDirty: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { 0 }; + let mHasTrackingContentLoaded = + mHasTrackingContentLoaded + as + u8 + as + u8; + let mask = + 1usize + as + u8; + let mHasTrackingContentLoaded = + (mHasTrackingContentLoaded + << + 0usize) + & + mask; + bitfield_unit_val + | + mHasTrackingContentLoaded + }; + let mBFCacheDisallowed = + mBFCacheDisallowed + as u8 as + u8; + let mask = + 2usize as u8; + let mBFCacheDisallowed = + (mBFCacheDisallowed + << + 1usize) & + mask; + bitfield_unit_val + | + mBFCacheDisallowed + }; + let mHasHadDefaultView = + mHasHadDefaultView as + u8 as u8; + let mask = 4usize as u8; + let mHasHadDefaultView = + (mHasHadDefaultView << + 2usize) & mask; + bitfield_unit_val | + mHasHadDefaultView + }; + let mStyleSheetChangeEventsEnabled = + mStyleSheetChangeEventsEnabled + as u8 as u8; + let mask = 8usize as u8; + let mStyleSheetChangeEventsEnabled = + (mStyleSheetChangeEventsEnabled + << 3usize) & mask; + bitfield_unit_val | + mStyleSheetChangeEventsEnabled + }; + let mIsSrcdocDocument = + mIsSrcdocDocument as u8 as u8; + let mask = 16usize as u8; + let mIsSrcdocDocument = + (mIsSrcdocDocument << 4usize) & mask; + bitfield_unit_val | mIsSrcdocDocument + }; + let mDidDocumentOpen = + mDidDocumentOpen as u8 as u8; + let mask = 32usize as u8; + let mDidDocumentOpen = + (mDidDocumentOpen << 5usize) & mask; + bitfield_unit_val | mDidDocumentOpen + }; + let mHasDisplayDocument = mHasDisplayDocument as u8 as u8; + let mask = 64usize as u8; + let mHasDisplayDocument = + (mHasDisplayDocument << 6usize) & mask; + bitfield_unit_val | mHasDisplayDocument + }; + let mFontFaceSetDirty = mFontFaceSetDirty as u8 as u8; + let mask = 128usize as u8; + let mFontFaceSetDirty = (mFontFaceSetDirty << 7usize) & mask; + bitfield_unit_val | mFontFaceSetDirty } #[inline] pub fn mGetUserFontSetCalled(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_6) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mGetUserFontSetCalled(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_6) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_6 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_6 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPostedFlushUserFontSet(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_6) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mPostedFlushUserFontSet(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_6) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_6 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_6 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mDidFireDOMContentLoaded(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_6) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mDidFireDOMContentLoaded(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_6) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_6 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_6 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasScrollLinkedEffect(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_6) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasScrollLinkedEffect(&mut self, val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_6) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_6 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_6 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mFrameRequestCallbacksScheduled(&self) -> bool { let mask = 16usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_6) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mFrameRequestCallbacksScheduled(&mut self, val: bool) { let mask = 16usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_6) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_6 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_6 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_6(mGetUserFontSetCalled: bool, + mPostedFlushUserFontSet: bool, + mDidFireDOMContentLoaded: bool, + mHasScrollLinkedEffect: bool, + mFrameRequestCallbacksScheduled: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = { 0 }; + let mGetUserFontSetCalled = + mGetUserFontSetCalled as u8 as + u8; + let mask = 1usize as u8; + let mGetUserFontSetCalled = + (mGetUserFontSetCalled << + 0usize) & mask; + bitfield_unit_val | + mGetUserFontSetCalled + }; + let mPostedFlushUserFontSet = + mPostedFlushUserFontSet as u8 as u8; + let mask = 2usize as u8; + let mPostedFlushUserFontSet = + (mPostedFlushUserFontSet << 1usize) & + mask; + bitfield_unit_val | + mPostedFlushUserFontSet + }; + let mDidFireDOMContentLoaded = + mDidFireDOMContentLoaded as u8 as u8; + let mask = 4usize as u8; + let mDidFireDOMContentLoaded = + (mDidFireDOMContentLoaded << 2usize) & mask; + bitfield_unit_val | mDidFireDOMContentLoaded + }; + let mHasScrollLinkedEffect = + mHasScrollLinkedEffect as u8 as u8; + let mask = 8usize as u8; + let mHasScrollLinkedEffect = + (mHasScrollLinkedEffect << 3usize) & mask; + bitfield_unit_val | mHasScrollLinkedEffect + }; + let mFrameRequestCallbacksScheduled = + mFrameRequestCallbacksScheduled as u8 as u8; + let mask = 16usize as u8; + let mFrameRequestCallbacksScheduled = + (mFrameRequestCallbacksScheduled << 4usize) & mask; + bitfield_unit_val | mFrameRequestCallbacksScheduled } } #[repr(C)] @@ -17793,6 +18697,8 @@ pub mod root { pub mImageAnimationMode: u16, pub mImageAnimationModePref: u16, pub mLangGroupFontPrefs: root::nsPresContext_LangGroupFontPrefs, + pub mFontGroupCacheDirty: bool, + pub mLanguagesUsed: [u64; 6usize], pub mBorderWidthTable: [root::nscoord; 3usize], pub mInterruptChecksToSkip: u32, pub mElementsRestyled: u64, @@ -17938,7 +18844,7 @@ pub mod root { } #[test] fn bindgen_test_layout_nsPresContext() { - assert_eq!(::std::mem::size_of::() , 1336usize , concat + assert_eq!(::std::mem::size_of::() , 1392usize , concat ! ( "Size of: " , stringify ! ( nsPresContext ) )); assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( nsPresContext ) )); @@ -18237,110 +19143,121 @@ pub mod root { concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mLangGroupFontPrefs ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsPresContext ) ) . + mFontGroupCacheDirty as * const _ as usize } , 1200usize , + concat ! ( + "Alignment of field: " , stringify ! ( nsPresContext ) , + "::" , stringify ! ( mFontGroupCacheDirty ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsPresContext ) ) . mLanguagesUsed as + * const _ as usize } , 1208usize , concat ! ( + "Alignment of field: " , stringify ! ( nsPresContext ) , + "::" , stringify ! ( mLanguagesUsed ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mBorderWidthTable - as * const _ as usize } , 1200usize , concat ! ( + as * const _ as usize } , 1256usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mBorderWidthTable ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mInterruptChecksToSkip as * const _ as usize } , 1212usize + mInterruptChecksToSkip as * const _ as usize } , 1268usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mInterruptChecksToSkip ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mElementsRestyled - as * const _ as usize } , 1216usize , concat ! ( + as * const _ as usize } , 1272usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mElementsRestyled ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mFramesConstructed as * const _ as usize } , 1224usize , + mFramesConstructed as * const _ as usize } , 1280usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFramesConstructed ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFramesReflowed - as * const _ as usize } , 1232usize , concat ! ( + as * const _ as usize } , 1288usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFramesReflowed ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mReflowStartTime - as * const _ as usize } , 1240usize , concat ! ( + as * const _ as usize } , 1296usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mReflowStartTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFirstNonBlankPaintTime as * const _ as usize } , - 1248usize , concat ! ( + 1304usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFirstNonBlankPaintTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFirstClickTime - as * const _ as usize } , 1256usize , concat ! ( + as * const _ as usize } , 1312usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFirstClickTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFirstKeyTime as - * const _ as usize } , 1264usize , concat ! ( + * const _ as usize } , 1320usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFirstKeyTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mFirstMouseMoveTime as * const _ as usize } , 1272usize , + mFirstMouseMoveTime as * const _ as usize } , 1328usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFirstMouseMoveTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFirstScrollTime - as * const _ as usize } , 1280usize , concat ! ( + as * const _ as usize } , 1336usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFirstScrollTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mInteractionTimeEnabled as * const _ as usize } , - 1288usize , concat ! ( + 1344usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mInteractionTimeEnabled ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mLastStyleUpdateForAllAnimations as * const _ as usize } , - 1296usize , concat ! ( + 1352usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mLastStyleUpdateForAllAnimations ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mTelemetryScrollLastY as * const _ as usize } , 1304usize + mTelemetryScrollLastY as * const _ as usize } , 1360usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mTelemetryScrollLastY ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mTelemetryScrollMaxY as * const _ as usize } , 1308usize , + mTelemetryScrollMaxY as * const _ as usize } , 1364usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mTelemetryScrollMaxY ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mTelemetryScrollTotalY as * const _ as usize } , 1312usize + mTelemetryScrollTotalY as * const _ as usize } , 1368usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mTelemetryScrollTotalY ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mRestyleLoggingEnabled as * const _ as usize } , 1322usize + mRestyleLoggingEnabled as * const _ as usize } , 1378usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mRestyleLoggingEnabled ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mInitialized as * - const _ as usize } , 1323usize , concat ! ( + const _ as usize } , 1379usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mInitialized ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mLayoutPhaseCount - as * const _ as usize } , 1324usize , concat ! ( + as * const _ as usize } , 1380usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mLayoutPhaseCount ) )); } @@ -18348,9 +19265,9 @@ pub mod root { #[inline] pub fn mHasPendingInterrupt(&self) -> ::std::os::raw::c_uint { let mask = 1usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18358,18 +19275,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 1usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPendingInterruptFromTest(&self) -> ::std::os::raw::c_uint { let mask = 2usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18377,18 +19295,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 2usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mInterruptsEnabled(&self) -> ::std::os::raw::c_uint { let mask = 4usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18396,36 +19315,38 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 4usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mUseDocumentFonts(&self) -> ::std::os::raw::c_uint { let mask = 8usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mUseDocumentFonts(&mut self, val: ::std::os::raw::c_uint) { let mask = 8usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mUseDocumentColors(&self) -> ::std::os::raw::c_uint { let mask = 16usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18433,36 +19354,38 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 16usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mUnderlineLinks(&self) -> ::std::os::raw::c_uint { let mask = 32usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 5usize; + let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mUnderlineLinks(&mut self, val: ::std::os::raw::c_uint) { let mask = 32usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 5usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mSendAfterPaintToContent(&self) -> ::std::os::raw::c_uint { let mask = 64usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 6usize; + let val = (unit_field_val & mask) >> 6usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18470,36 +19393,38 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 64usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 6usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mUseFocusColors(&self) -> ::std::os::raw::c_uint { let mask = 128usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 7usize; + let val = (unit_field_val & mask) >> 7usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mUseFocusColors(&mut self, val: ::std::os::raw::c_uint) { let mask = 128usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 7usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 7usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mFocusRingOnAnything(&self) -> ::std::os::raw::c_uint { let mask = 256usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 8usize; + let val = (unit_field_val & mask) >> 8usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18507,36 +19432,38 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 256usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 8usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 8usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mFocusRingStyle(&self) -> ::std::os::raw::c_uint { let mask = 512usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 9usize; + let val = (unit_field_val & mask) >> 9usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mFocusRingStyle(&mut self, val: ::std::os::raw::c_uint) { let mask = 512usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 9usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 9usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mDrawImageBackground(&self) -> ::std::os::raw::c_uint { let mask = 1024usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 10usize; + let val = (unit_field_val & mask) >> 10usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18544,18 +19471,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 1024usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 10usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 10usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mDrawColorBackground(&self) -> ::std::os::raw::c_uint { let mask = 2048usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 11usize; + let val = (unit_field_val & mask) >> 11usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18563,36 +19491,38 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 2048usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 11usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 11usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mNeverAnimate(&self) -> ::std::os::raw::c_uint { let mask = 4096usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 12usize; + let val = (unit_field_val & mask) >> 12usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mNeverAnimate(&mut self, val: ::std::os::raw::c_uint) { let mask = 4096usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 12usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 12usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsRenderingOnlySelection(&self) -> ::std::os::raw::c_uint { let mask = 8192usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 13usize; + let val = (unit_field_val & mask) >> 13usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18600,36 +19530,38 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 8192usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 13usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 13usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPaginated(&self) -> ::std::os::raw::c_uint { let mask = 16384usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 14usize; + let val = (unit_field_val & mask) >> 14usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mPaginated(&mut self, val: ::std::os::raw::c_uint) { let mask = 16384usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 14usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 14usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mCanPaginatedScroll(&self) -> ::std::os::raw::c_uint { let mask = 32768usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 15usize; + let val = (unit_field_val & mask) >> 15usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18637,36 +19569,38 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 32768usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 15usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 15usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mDoScaledTwips(&self) -> ::std::os::raw::c_uint { let mask = 65536usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 16usize; + let val = (unit_field_val & mask) >> 16usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mDoScaledTwips(&mut self, val: ::std::os::raw::c_uint) { let mask = 65536usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 16usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 16usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsRootPaginatedDocument(&self) -> ::std::os::raw::c_uint { let mask = 131072usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 17usize; + let val = (unit_field_val & mask) >> 17usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18674,18 +19608,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 131072usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 17usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 17usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPrefBidiDirection(&self) -> ::std::os::raw::c_uint { let mask = 262144usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 18usize; + let val = (unit_field_val & mask) >> 18usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18693,18 +19628,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 262144usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 18usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 18usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPrefScrollbarSide(&self) -> ::std::os::raw::c_uint { let mask = 1572864usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 19usize; + let val = (unit_field_val & mask) >> 19usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18712,18 +19648,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 1572864usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 19usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 19usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPendingSysColorChanged(&self) -> ::std::os::raw::c_uint { let mask = 2097152usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 21usize; + let val = (unit_field_val & mask) >> 21usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18731,18 +19668,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 2097152usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 21usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 21usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPendingThemeChanged(&self) -> ::std::os::raw::c_uint { let mask = 4194304usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 22usize; + let val = (unit_field_val & mask) >> 22usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18750,18 +19688,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 4194304usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 22usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 22usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPendingUIResolutionChanged(&self) -> ::std::os::raw::c_uint { let mask = 8388608usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 23usize; + let val = (unit_field_val & mask) >> 23usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18769,19 +19708,20 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 8388608usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 23usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 23usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPendingMediaFeatureValuesChanged(&self) -> ::std::os::raw::c_uint { let mask = 16777216usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 24usize; + let val = (unit_field_val & mask) >> 24usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18790,19 +19730,20 @@ pub mod root { ::std::os::raw::c_uint) { let mask = 16777216usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 24usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 24usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPrefChangePendingNeedsReflow(&self) -> ::std::os::raw::c_uint { let mask = 33554432usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 25usize; + let val = (unit_field_val & mask) >> 25usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18811,90 +19752,95 @@ pub mod root { ::std::os::raw::c_uint) { let mask = 33554432usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 25usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 25usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsEmulatingMedia(&self) -> ::std::os::raw::c_uint { let mask = 67108864usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 26usize; + let val = (unit_field_val & mask) >> 26usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mIsEmulatingMedia(&mut self, val: ::std::os::raw::c_uint) { let mask = 67108864usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 26usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 26usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsGlyph(&self) -> ::std::os::raw::c_uint { let mask = 134217728usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 27usize; + let val = (unit_field_val & mask) >> 27usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mIsGlyph(&mut self, val: ::std::os::raw::c_uint) { let mask = 134217728usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 27usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 27usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mUsesRootEMUnits(&self) -> ::std::os::raw::c_uint { let mask = 268435456usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 28usize; + let val = (unit_field_val & mask) >> 28usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mUsesRootEMUnits(&mut self, val: ::std::os::raw::c_uint) { let mask = 268435456usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 28usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 28usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mUsesExChUnits(&self) -> ::std::os::raw::c_uint { let mask = 536870912usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 29usize; + let val = (unit_field_val & mask) >> 29usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mUsesExChUnits(&mut self, val: ::std::os::raw::c_uint) { let mask = 536870912usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 29usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 29usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mUsesViewportUnits(&self) -> ::std::os::raw::c_uint { let mask = 1073741824usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 30usize; + let val = (unit_field_val & mask) >> 30usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18902,18 +19848,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 1073741824usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 30usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 30usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPendingViewportChange(&self) -> ::std::os::raw::c_uint { let mask = 2147483648usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 31usize; + let val = (unit_field_val & mask) >> 31usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18921,18 +19868,662 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 2147483648usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 31usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 31usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mHasPendingInterrupt: ::std::os::raw::c_uint, + mPendingInterruptFromTest: + ::std::os::raw::c_uint, + mInterruptsEnabled: ::std::os::raw::c_uint, + mUseDocumentFonts: ::std::os::raw::c_uint, + mUseDocumentColors: ::std::os::raw::c_uint, + mUnderlineLinks: ::std::os::raw::c_uint, + mSendAfterPaintToContent: + ::std::os::raw::c_uint, + mUseFocusColors: ::std::os::raw::c_uint, + mFocusRingOnAnything: ::std::os::raw::c_uint, + mFocusRingStyle: ::std::os::raw::c_uint, + mDrawImageBackground: ::std::os::raw::c_uint, + mDrawColorBackground: ::std::os::raw::c_uint, + mNeverAnimate: ::std::os::raw::c_uint, + mIsRenderingOnlySelection: + ::std::os::raw::c_uint, + mPaginated: ::std::os::raw::c_uint, + mCanPaginatedScroll: ::std::os::raw::c_uint, + mDoScaledTwips: ::std::os::raw::c_uint, + mIsRootPaginatedDocument: + ::std::os::raw::c_uint, + mPrefBidiDirection: ::std::os::raw::c_uint, + mPrefScrollbarSide: ::std::os::raw::c_uint, + mPendingSysColorChanged: ::std::os::raw::c_uint, + mPendingThemeChanged: ::std::os::raw::c_uint, + mPendingUIResolutionChanged: + ::std::os::raw::c_uint, + mPendingMediaFeatureValuesChanged: + ::std::os::raw::c_uint, + mPrefChangePendingNeedsReflow: + ::std::os::raw::c_uint, + mIsEmulatingMedia: ::std::os::raw::c_uint, + mIsGlyph: ::std::os::raw::c_uint, + mUsesRootEMUnits: ::std::os::raw::c_uint, + mUsesExChUnits: ::std::os::raw::c_uint, + mUsesViewportUnits: ::std::os::raw::c_uint, + mPendingViewportChange: ::std::os::raw::c_uint) + -> u32 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + 0 + }; + let mHasPendingInterrupt = + mHasPendingInterrupt + as + u32 + as + u32; + let mask = + 1usize + as + u32; + let mHasPendingInterrupt = + (mHasPendingInterrupt + << + 0usize) + & + mask; + bitfield_unit_val + | + mHasPendingInterrupt + }; + let mPendingInterruptFromTest = + mPendingInterruptFromTest + as + u32 + as + u32; + let mask = + 2usize + as + u32; + let mPendingInterruptFromTest = + (mPendingInterruptFromTest + << + 1usize) + & + mask; + bitfield_unit_val + | + mPendingInterruptFromTest + }; + let mInterruptsEnabled = + mInterruptsEnabled + as + u32 + as + u32; + let mask = + 4usize + as + u32; + let mInterruptsEnabled = + (mInterruptsEnabled + << + 2usize) + & + mask; + bitfield_unit_val + | + mInterruptsEnabled + }; + let mUseDocumentFonts = + mUseDocumentFonts + as + u32 + as + u32; + let mask = + 8usize + as + u32; + let mUseDocumentFonts = + (mUseDocumentFonts + << + 3usize) + & + mask; + bitfield_unit_val + | + mUseDocumentFonts + }; + let mUseDocumentColors = + mUseDocumentColors + as + u32 + as + u32; + let mask = + 16usize + as + u32; + let mUseDocumentColors = + (mUseDocumentColors + << + 4usize) + & + mask; + bitfield_unit_val + | + mUseDocumentColors + }; + let mUnderlineLinks = + mUnderlineLinks + as + u32 + as + u32; + let mask = + 32usize + as + u32; + let mUnderlineLinks = + (mUnderlineLinks + << + 5usize) + & + mask; + bitfield_unit_val + | + mUnderlineLinks + }; + let mSendAfterPaintToContent = + mSendAfterPaintToContent + as + u32 + as + u32; + let mask = + 64usize + as + u32; + let mSendAfterPaintToContent = + (mSendAfterPaintToContent + << + 6usize) + & + mask; + bitfield_unit_val + | + mSendAfterPaintToContent + }; + let mUseFocusColors = + mUseFocusColors + as + u32 + as + u32; + let mask = + 128usize + as + u32; + let mUseFocusColors = + (mUseFocusColors + << + 7usize) + & + mask; + bitfield_unit_val + | + mUseFocusColors + }; + let mFocusRingOnAnything = + mFocusRingOnAnything + as + u32 + as + u32; + let mask = + 256usize + as + u32; + let mFocusRingOnAnything = + (mFocusRingOnAnything + << + 8usize) + & + mask; + bitfield_unit_val + | + mFocusRingOnAnything + }; + let mFocusRingStyle = + mFocusRingStyle + as + u32 + as + u32; + let mask = + 512usize + as + u32; + let mFocusRingStyle = + (mFocusRingStyle + << + 9usize) + & + mask; + bitfield_unit_val + | + mFocusRingStyle + }; + let mDrawImageBackground = + mDrawImageBackground + as + u32 + as + u32; + let mask = + 1024usize + as + u32; + let mDrawImageBackground = + (mDrawImageBackground + << + 10usize) + & + mask; + bitfield_unit_val + | + mDrawImageBackground + }; + let mDrawColorBackground = + mDrawColorBackground + as + u32 + as + u32; + let mask = + 2048usize + as + u32; + let mDrawColorBackground = + (mDrawColorBackground + << + 11usize) + & + mask; + bitfield_unit_val + | + mDrawColorBackground + }; + let mNeverAnimate = + mNeverAnimate + as + u32 + as + u32; + let mask = + 4096usize + as + u32; + let mNeverAnimate = + (mNeverAnimate + << + 12usize) + & + mask; + bitfield_unit_val + | + mNeverAnimate + }; + let mIsRenderingOnlySelection = + mIsRenderingOnlySelection + as + u32 + as + u32; + let mask = + 8192usize + as + u32; + let mIsRenderingOnlySelection = + (mIsRenderingOnlySelection + << + 13usize) + & + mask; + bitfield_unit_val + | + mIsRenderingOnlySelection + }; + let mPaginated = + mPaginated + as + u32 + as + u32; + let mask = + 16384usize + as + u32; + let mPaginated = + (mPaginated + << + 14usize) + & + mask; + bitfield_unit_val + | + mPaginated + }; + let mCanPaginatedScroll = + mCanPaginatedScroll + as + u32 + as + u32; + let mask = + 32768usize + as + u32; + let mCanPaginatedScroll = + (mCanPaginatedScroll + << + 15usize) + & + mask; + bitfield_unit_val + | + mCanPaginatedScroll + }; + let mDoScaledTwips = + mDoScaledTwips + as + u32 + as + u32; + let mask = + 65536usize + as + u32; + let mDoScaledTwips = + (mDoScaledTwips + << + 16usize) + & + mask; + bitfield_unit_val + | + mDoScaledTwips + }; + let mIsRootPaginatedDocument = + mIsRootPaginatedDocument + as + u32 + as + u32; + let mask = + 131072usize + as + u32; + let mIsRootPaginatedDocument = + (mIsRootPaginatedDocument + << + 17usize) + & + mask; + bitfield_unit_val + | + mIsRootPaginatedDocument + }; + let mPrefBidiDirection = + mPrefBidiDirection + as + u32 + as + u32; + let mask = + 262144usize + as + u32; + let mPrefBidiDirection = + (mPrefBidiDirection + << + 18usize) + & + mask; + bitfield_unit_val + | + mPrefBidiDirection + }; + let mPrefScrollbarSide = + mPrefScrollbarSide + as + u32 + as + u32; + let mask = + 1572864usize + as + u32; + let mPrefScrollbarSide = + (mPrefScrollbarSide + << + 19usize) + & + mask; + bitfield_unit_val + | + mPrefScrollbarSide + }; + let mPendingSysColorChanged = + mPendingSysColorChanged + as + u32 + as + u32; + let mask = + 2097152usize + as + u32; + let mPendingSysColorChanged = + (mPendingSysColorChanged + << + 21usize) + & + mask; + bitfield_unit_val + | + mPendingSysColorChanged + }; + let mPendingThemeChanged = + mPendingThemeChanged + as + u32 + as + u32; + let mask = + 4194304usize + as + u32; + let mPendingThemeChanged = + (mPendingThemeChanged + << + 22usize) + & + mask; + bitfield_unit_val + | + mPendingThemeChanged + }; + let mPendingUIResolutionChanged = + mPendingUIResolutionChanged + as + u32 + as + u32; + let mask = + 8388608usize + as + u32; + let mPendingUIResolutionChanged = + (mPendingUIResolutionChanged + << + 23usize) + & + mask; + bitfield_unit_val + | + mPendingUIResolutionChanged + }; + let mPendingMediaFeatureValuesChanged = + mPendingMediaFeatureValuesChanged + as + u32 + as + u32; + let mask = + 16777216usize + as + u32; + let mPendingMediaFeatureValuesChanged = + (mPendingMediaFeatureValuesChanged + << + 24usize) + & + mask; + bitfield_unit_val + | + mPendingMediaFeatureValuesChanged + }; + let mPrefChangePendingNeedsReflow = + mPrefChangePendingNeedsReflow + as u32 as + u32; + let mask = + 33554432usize + as u32; + let mPrefChangePendingNeedsReflow = + (mPrefChangePendingNeedsReflow + << + 25usize) + & mask; + bitfield_unit_val + | + mPrefChangePendingNeedsReflow + }; + let mIsEmulatingMedia = + mIsEmulatingMedia as + u32 as u32; + let mask = + 67108864usize as u32; + let mIsEmulatingMedia = + (mIsEmulatingMedia << + 26usize) & mask; + bitfield_unit_val | + mIsEmulatingMedia + }; + let mIsGlyph = + mIsGlyph as u32 as u32; + let mask = 134217728usize as u32; + let mIsGlyph = + (mIsGlyph << 27usize) & mask; + bitfield_unit_val | mIsGlyph + }; + let mUsesRootEMUnits = + mUsesRootEMUnits as u32 as u32; + let mask = 268435456usize as u32; + let mUsesRootEMUnits = + (mUsesRootEMUnits << 28usize) & mask; + bitfield_unit_val | mUsesRootEMUnits + }; + let mUsesExChUnits = mUsesExChUnits as u32 as u32; + let mask = 536870912usize as u32; + let mUsesExChUnits = + (mUsesExChUnits << 29usize) & mask; + bitfield_unit_val | mUsesExChUnits + }; + let mUsesViewportUnits = mUsesViewportUnits as u32 as u32; + let mask = 1073741824usize as u32; + let mUsesViewportUnits = + (mUsesViewportUnits << 30usize) & mask; + bitfield_unit_val | mUsesViewportUnits + }; + let mPendingViewportChange = mPendingViewportChange as u32 as u32; + let mask = 2147483648usize as u32; + let mPendingViewportChange = + (mPendingViewportChange << 31usize) & mask; + bitfield_unit_val | mPendingViewportChange } #[inline] pub fn mCounterStylesDirty(&self) -> ::std::os::raw::c_uint { let mask = 1usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18940,18 +20531,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 1usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPostedFlushCounterStyles(&self) -> ::std::os::raw::c_uint { let mask = 2usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18959,18 +20551,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 2usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mSuppressResizeReflow(&self) -> ::std::os::raw::c_uint { let mask = 4usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18978,36 +20571,38 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 4usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsVisual(&self) -> ::std::os::raw::c_uint { let mask = 8usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mIsVisual(&mut self, val: ::std::os::raw::c_uint) { let mask = 8usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mFireAfterPaintEvents(&self) -> ::std::os::raw::c_uint { let mask = 16usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -19015,36 +20610,38 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 16usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsChrome(&self) -> ::std::os::raw::c_uint { let mask = 32usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 5usize; + let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mIsChrome(&mut self, val: ::std::os::raw::c_uint) { let mask = 32usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 5usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsChromeOriginImage(&self) -> ::std::os::raw::c_uint { let mask = 64usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 6usize; + let val = (unit_field_val & mask) >> 6usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -19052,36 +20649,38 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 64usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 6usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPaintFlashing(&self) -> ::std::os::raw::c_uint { let mask = 128usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 7usize; + let val = (unit_field_val & mask) >> 7usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mPaintFlashing(&mut self, val: ::std::os::raw::c_uint) { let mask = 128usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 7usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 7usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPaintFlashingInitialized(&self) -> ::std::os::raw::c_uint { let mask = 256usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 8usize; + let val = (unit_field_val & mask) >> 8usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -19089,19 +20688,20 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 256usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 8usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 8usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasWarnedAboutPositionedTableParts(&self) -> ::std::os::raw::c_uint { let mask = 512usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 9usize; + let val = (unit_field_val & mask) >> 9usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -19110,19 +20710,20 @@ pub mod root { ::std::os::raw::c_uint) { let mask = 512usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 9usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 9usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasWarnedAboutTooLargeDashedOrDottedRadius(&self) -> ::std::os::raw::c_uint { let mask = 1024usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 10usize; + let val = (unit_field_val & mask) >> 10usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -19131,65 +20732,325 @@ pub mod root { ::std::os::raw::c_uint) { let mask = 1024usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 10usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 10usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mQuirkSheetAdded(&self) -> ::std::os::raw::c_uint { let mask = 2048usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 11usize; + let val = (unit_field_val & mask) >> 11usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mQuirkSheetAdded(&mut self, val: ::std::os::raw::c_uint) { let mask = 2048usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 11usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 11usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mNeedsPrefUpdate(&self) -> ::std::os::raw::c_uint { let mask = 4096usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 12usize; + let val = (unit_field_val & mask) >> 12usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mNeedsPrefUpdate(&mut self, val: ::std::os::raw::c_uint) { let mask = 4096usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 12usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 12usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHadNonBlankPaint(&self) -> ::std::os::raw::c_uint { let mask = 8192usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 13usize; + let val = (unit_field_val & mask) >> 13usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mHadNonBlankPaint(&mut self, val: ::std::os::raw::c_uint) { let mask = 8192usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 13usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 13usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_2(mCounterStylesDirty: ::std::os::raw::c_uint, + mPostedFlushCounterStyles: + ::std::os::raw::c_uint, + mSuppressResizeReflow: ::std::os::raw::c_uint, + mIsVisual: ::std::os::raw::c_uint, + mFireAfterPaintEvents: ::std::os::raw::c_uint, + mIsChrome: ::std::os::raw::c_uint, + mIsChromeOriginImage: ::std::os::raw::c_uint, + mPaintFlashing: ::std::os::raw::c_uint, + mPaintFlashingInitialized: + ::std::os::raw::c_uint, + mHasWarnedAboutPositionedTableParts: + ::std::os::raw::c_uint, + mHasWarnedAboutTooLargeDashedOrDottedRadius: + ::std::os::raw::c_uint, + mQuirkSheetAdded: ::std::os::raw::c_uint, + mNeedsPrefUpdate: ::std::os::raw::c_uint, + mHadNonBlankPaint: ::std::os::raw::c_uint) + -> u16 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + 0 + }; + let mCounterStylesDirty = + mCounterStylesDirty + as + u32 + as + u16; + let mask = + 1usize + as + u16; + let mCounterStylesDirty = + (mCounterStylesDirty + << + 0usize) + & + mask; + bitfield_unit_val + | + mCounterStylesDirty + }; + let mPostedFlushCounterStyles = + mPostedFlushCounterStyles + as + u32 + as + u16; + let mask = + 2usize + as + u16; + let mPostedFlushCounterStyles = + (mPostedFlushCounterStyles + << + 1usize) + & + mask; + bitfield_unit_val + | + mPostedFlushCounterStyles + }; + let mSuppressResizeReflow = + mSuppressResizeReflow + as + u32 + as + u16; + let mask = + 4usize + as + u16; + let mSuppressResizeReflow = + (mSuppressResizeReflow + << + 2usize) + & + mask; + bitfield_unit_val + | + mSuppressResizeReflow + }; + let mIsVisual = + mIsVisual + as + u32 + as + u16; + let mask = + 8usize + as + u16; + let mIsVisual = + (mIsVisual + << + 3usize) + & + mask; + bitfield_unit_val + | + mIsVisual + }; + let mFireAfterPaintEvents = + mFireAfterPaintEvents + as + u32 + as + u16; + let mask = + 16usize + as + u16; + let mFireAfterPaintEvents = + (mFireAfterPaintEvents + << + 4usize) + & + mask; + bitfield_unit_val + | + mFireAfterPaintEvents + }; + let mIsChrome = + mIsChrome + as + u32 + as + u16; + let mask = + 32usize + as + u16; + let mIsChrome = + (mIsChrome + << + 5usize) + & + mask; + bitfield_unit_val + | + mIsChrome + }; + let mIsChromeOriginImage = + mIsChromeOriginImage + as + u32 + as + u16; + let mask = + 64usize + as + u16; + let mIsChromeOriginImage = + (mIsChromeOriginImage + << + 6usize) + & + mask; + bitfield_unit_val + | + mIsChromeOriginImage + }; + let mPaintFlashing = + mPaintFlashing + as u32 as + u16; + let mask = + 128usize as + u16; + let mPaintFlashing = + (mPaintFlashing + << + 7usize) & + mask; + bitfield_unit_val + | + mPaintFlashing + }; + let mPaintFlashingInitialized = + mPaintFlashingInitialized + as u32 as u16; + let mask = + 256usize as u16; + let mPaintFlashingInitialized = + (mPaintFlashingInitialized + << 8usize) & + mask; + bitfield_unit_val | + mPaintFlashingInitialized + }; + let mHasWarnedAboutPositionedTableParts = + mHasWarnedAboutPositionedTableParts + as u32 as u16; + let mask = 512usize as u16; + let mHasWarnedAboutPositionedTableParts = + (mHasWarnedAboutPositionedTableParts + << 9usize) & mask; + bitfield_unit_val | + mHasWarnedAboutPositionedTableParts + }; + let mHasWarnedAboutTooLargeDashedOrDottedRadius = + mHasWarnedAboutTooLargeDashedOrDottedRadius + as u32 as u16; + let mask = 1024usize as u16; + let mHasWarnedAboutTooLargeDashedOrDottedRadius = + (mHasWarnedAboutTooLargeDashedOrDottedRadius + << 10usize) & mask; + bitfield_unit_val | + mHasWarnedAboutTooLargeDashedOrDottedRadius + }; + let mQuirkSheetAdded = + mQuirkSheetAdded as u32 as u16; + let mask = 2048usize as u16; + let mQuirkSheetAdded = + (mQuirkSheetAdded << 11usize) & mask; + bitfield_unit_val | mQuirkSheetAdded + }; + let mNeedsPrefUpdate = mNeedsPrefUpdate as u32 as u16; + let mask = 4096usize as u16; + let mNeedsPrefUpdate = + (mNeedsPrefUpdate << 12usize) & mask; + bitfield_unit_val | mNeedsPrefUpdate + }; + let mHadNonBlankPaint = mHadNonBlankPaint as u32 as u16; + let mask = 8192usize as u16; + let mHadNonBlankPaint = (mHadNonBlankPaint << 13usize) & mask; + bitfield_unit_val | mHadNonBlankPaint } } #[repr(C)] @@ -19782,7 +21643,7 @@ pub mod root { pub _base_1: root::nsWrapperCache, pub mRefCnt: root::nsCycleCollectingAutoRefCnt, pub _mOwningThread: root::nsAutoOwningThread, - pub mContent: root::nsCOMPtr, + pub mContent: root::nsCOMPtr, /** * Cache of Attrs. */ @@ -20467,207 +22328,318 @@ pub mod root { #[inline] pub fn mStylesHaveChanged(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mStylesHaveChanged(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mDidInitialize(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mDidInitialize(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsDestroying(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsDestroying(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsReflowing(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsReflowing(&mut self, val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPaintingSuppressed(&self) -> bool { let mask = 16usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mPaintingSuppressed(&mut self, val: bool) { let mask = 16usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsThemeSupportDisabled(&self) -> bool { let mask = 32usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 5usize; + let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsThemeSupportDisabled(&mut self, val: bool) { let mask = 32usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 5usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsActive(&self) -> bool { let mask = 64usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 6usize; + let val = (unit_field_val & mask) >> 6usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsActive(&mut self, val: bool) { let mask = 64usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 6usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mFrozen(&self) -> bool { let mask = 128usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 7usize; + let val = (unit_field_val & mask) >> 7usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mFrozen(&mut self, val: bool) { let mask = 128usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 7usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 7usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mStylesHaveChanged: bool, mDidInitialize: bool, + mIsDestroying: bool, mIsReflowing: bool, + mPaintingSuppressed: bool, + mIsThemeSupportDisabled: bool, mIsActive: bool, + mFrozen: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { 0 }; + let mStylesHaveChanged = + mStylesHaveChanged + as + u8 + as + u8; + let mask = + 1usize + as + u8; + let mStylesHaveChanged = + (mStylesHaveChanged + << + 0usize) + & + mask; + bitfield_unit_val + | + mStylesHaveChanged + }; + let mDidInitialize = + mDidInitialize + as u8 as + u8; + let mask = + 2usize as u8; + let mDidInitialize = + (mDidInitialize + << + 1usize) & + mask; + bitfield_unit_val + | + mDidInitialize + }; + let mIsDestroying = + mIsDestroying as u8 as + u8; + let mask = 4usize as u8; + let mIsDestroying = + (mIsDestroying << + 2usize) & mask; + bitfield_unit_val | + mIsDestroying + }; + let mIsReflowing = + mIsReflowing as u8 as u8; + let mask = 8usize as u8; + let mIsReflowing = + (mIsReflowing << 3usize) & + mask; + bitfield_unit_val | mIsReflowing + }; + let mPaintingSuppressed = + mPaintingSuppressed as u8 as u8; + let mask = 16usize as u8; + let mPaintingSuppressed = + (mPaintingSuppressed << 4usize) & + mask; + bitfield_unit_val | mPaintingSuppressed + }; + let mIsThemeSupportDisabled = + mIsThemeSupportDisabled as u8 as u8; + let mask = 32usize as u8; + let mIsThemeSupportDisabled = + (mIsThemeSupportDisabled << 5usize) & mask; + bitfield_unit_val | mIsThemeSupportDisabled + }; + let mIsActive = mIsActive as u8 as u8; + let mask = 64usize as u8; + let mIsActive = (mIsActive << 6usize) & mask; + bitfield_unit_val | mIsActive + }; + let mFrozen = mFrozen as u8 as u8; + let mask = 128usize as u8; + let mFrozen = (mFrozen << 7usize) & mask; + bitfield_unit_val | mFrozen } #[inline] pub fn mIsFirstPaint(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsFirstPaint(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mObservesMutationsForPrint(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mObservesMutationsForPrint(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mSuppressInterruptibleReflows(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mSuppressInterruptibleReflows(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mScrollPositionClampingScrollPortSizeSet(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] @@ -20675,101 +22647,223 @@ pub mod root { val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mNeedLayoutFlush(&self) -> bool { let mask = 16usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mNeedLayoutFlush(&mut self, val: bool) { let mask = 16usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mNeedStyleFlush(&self) -> bool { let mask = 32usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 5usize; + let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mNeedStyleFlush(&mut self, val: bool) { let mask = 32usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 5usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mObservingStyleFlushes(&self) -> bool { let mask = 64usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 6usize; + let val = (unit_field_val & mask) >> 6usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mObservingStyleFlushes(&mut self, val: bool) { let mask = 64usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 6usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mObservingLayoutFlushes(&self) -> bool { let mask = 128usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 7usize; + let val = (unit_field_val & mask) >> 7usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mObservingLayoutFlushes(&mut self, val: bool) { let mask = 128usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 7usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 7usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_2(mIsFirstPaint: bool, + mObservesMutationsForPrint: bool, + mSuppressInterruptibleReflows: bool, + mScrollPositionClampingScrollPortSizeSet: bool, + mNeedLayoutFlush: bool, mNeedStyleFlush: bool, + mObservingStyleFlushes: bool, + mObservingLayoutFlushes: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { 0 }; + let mIsFirstPaint = + mIsFirstPaint + as + u8 + as + u8; + let mask = + 1usize + as + u8; + let mIsFirstPaint = + (mIsFirstPaint + << + 0usize) + & + mask; + bitfield_unit_val + | + mIsFirstPaint + }; + let mObservesMutationsForPrint = + mObservesMutationsForPrint + as u8 as + u8; + let mask = + 2usize as u8; + let mObservesMutationsForPrint = + (mObservesMutationsForPrint + << + 1usize) & + mask; + bitfield_unit_val + | + mObservesMutationsForPrint + }; + let mSuppressInterruptibleReflows = + mSuppressInterruptibleReflows + as u8 as u8; + let mask = 4usize as u8; + let mSuppressInterruptibleReflows = + (mSuppressInterruptibleReflows + << 2usize) & + mask; + bitfield_unit_val | + mSuppressInterruptibleReflows + }; + let mScrollPositionClampingScrollPortSizeSet = + mScrollPositionClampingScrollPortSizeSet + as u8 as u8; + let mask = 8usize as u8; + let mScrollPositionClampingScrollPortSizeSet = + (mScrollPositionClampingScrollPortSizeSet + << 3usize) & mask; + bitfield_unit_val | + mScrollPositionClampingScrollPortSizeSet + }; + let mNeedLayoutFlush = + mNeedLayoutFlush as u8 as u8; + let mask = 16usize as u8; + let mNeedLayoutFlush = + (mNeedLayoutFlush << 4usize) & mask; + bitfield_unit_val | mNeedLayoutFlush + }; + let mNeedStyleFlush = mNeedStyleFlush as u8 as u8; + let mask = 32usize as u8; + let mNeedStyleFlush = + (mNeedStyleFlush << 5usize) & mask; + bitfield_unit_val | mNeedStyleFlush + }; + let mObservingStyleFlushes = + mObservingStyleFlushes as u8 as u8; + let mask = 64usize as u8; + let mObservingStyleFlushes = + (mObservingStyleFlushes << 6usize) & mask; + bitfield_unit_val | mObservingStyleFlushes + }; + let mObservingLayoutFlushes = mObservingLayoutFlushes as u8 as u8; + let mask = 128usize as u8; + let mObservingLayoutFlushes = + (mObservingLayoutFlushes << 7usize) & mask; + bitfield_unit_val | mObservingLayoutFlushes } #[inline] pub fn mNeedThrottledAnimationFlush(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mNeedThrottledAnimationFlush(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_3 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_3 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_3(mNeedThrottledAnimationFlush: bool) -> u8 { + let bitfield_unit_val = { 0 }; + let mNeedThrottledAnimationFlush = + mNeedThrottledAnimationFlush as u8 as u8; + let mask = 1usize as u8; + let mNeedThrottledAnimationFlush = + (mNeedThrottledAnimationFlush << 0usize) & mask; + bitfield_unit_val | mNeedThrottledAnimationFlush } } /** @@ -20815,57 +22909,57 @@ pub mod root { pub struct nsDOMMutationObserver { _unused: [u8; 0], } - pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_HAS_LISTENERMANAGER; - pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_HAS_PROPERTIES; - pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_IS_ANONYMOUS_ROOT; - pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; - pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_IS_NATIVE_ANONYMOUS_ROOT; - pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_FORCE_XBL_BINDINGS; - pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_MAY_BE_IN_BINDING_MNGR; - pub const NODE_IS_EDITABLE: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_IS_EDITABLE; - pub const NODE_IS_NATIVE_ANONYMOUS: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_IS_NATIVE_ANONYMOUS; - pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_IS_IN_SHADOW_TREE; - pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_HAS_EMPTY_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_HAS_SLOW_SELECTOR; - pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_HAS_EDGE_CHILD_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; - pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_ALL_SELECTOR_FLAGS; - pub const NODE_NEEDS_FRAME: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_NEEDS_FRAME; - pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_DESCENDANTS_NEED_FRAMES; - pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_HAS_ACCESSKEY; - pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_HAS_DIRECTION_RTL; - pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_HAS_DIRECTION_LTR; - pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_ALL_DIRECTION_FLAGS; - pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_CHROME_ONLY_ACCESS; - pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; - pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_TYPE_SPECIFIC_BITS_OFFSET; + pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_HAS_LISTENERMANAGER; + pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_HAS_PROPERTIES; + pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_IS_ANONYMOUS_ROOT; + pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; + pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_IS_NATIVE_ANONYMOUS_ROOT; + pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_FORCE_XBL_BINDINGS; + pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_MAY_BE_IN_BINDING_MNGR; + pub const NODE_IS_EDITABLE: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_IS_EDITABLE; + pub const NODE_IS_NATIVE_ANONYMOUS: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_IS_NATIVE_ANONYMOUS; + pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_IS_IN_SHADOW_TREE; + pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_HAS_EMPTY_SELECTOR; + pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_HAS_SLOW_SELECTOR; + pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_HAS_EDGE_CHILD_SELECTOR; + pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; + pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_ALL_SELECTOR_FLAGS; + pub const NODE_NEEDS_FRAME: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_NEEDS_FRAME; + pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_DESCENDANTS_NEED_FRAMES; + pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_HAS_ACCESSKEY; + pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_HAS_DIRECTION_RTL; + pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_HAS_DIRECTION_LTR; + pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_ALL_DIRECTION_FLAGS; + pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_CHROME_ONLY_ACCESS; + pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; + pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_82 = + _bindgen_ty_82::NODE_TYPE_SPECIFIC_BITS_OFFSET; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum _bindgen_ty_17 { + pub enum _bindgen_ty_82 { NODE_HAS_LISTENERMANAGER = 4, NODE_HAS_PROPERTIES = 8, NODE_IS_ANONYMOUS_ROOT = 16, @@ -22825,38 +24919,56 @@ pub mod root { #[inline] pub fn mGeneration(&self) -> u32 { let mask = 15usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mGeneration(&mut self, val: u32) { let mask = 15usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIndexInGeneration(&self) -> u32 { let mask = 4294967280usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mIndexInGeneration(&mut self, val: u32) { let mask = 4294967280usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mGeneration: u32, mIndexInGeneration: u32) + -> u32 { + let bitfield_unit_val = + { + let bitfield_unit_val = { 0 }; + let mGeneration = mGeneration as u32 as u32; + let mask = 15usize as u32; + let mGeneration = (mGeneration << 0usize) & mask; + bitfield_unit_val | mGeneration + }; + let mIndexInGeneration = mIndexInGeneration as u32 as u32; + let mask = 4294967280usize as u32; + let mIndexInGeneration = (mIndexInGeneration << 4usize) & mask; + bitfield_unit_val | mIndexInGeneration } } #[repr(C)] @@ -23514,7 +25626,7 @@ pub mod root { } #[test] fn bindgen_test_layout_nsRootPresContext() { - assert_eq!(::std::mem::size_of::() , 1496usize , + assert_eq!(::std::mem::size_of::() , 1552usize , concat ! ( "Size of: " , stringify ! ( nsRootPresContext ) )); assert_eq! (::std::mem::align_of::() , 8usize , @@ -23522,37 +25634,37 @@ pub mod root { "Alignment of " , stringify ! ( nsRootPresContext ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . - mNotifyDidPaintTimers as * const _ as usize } , 1336usize + mNotifyDidPaintTimers as * const _ as usize } , 1392usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mNotifyDidPaintTimers ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . mApplyPluginGeometryTimer as * const _ as usize } , - 1416usize , concat ! ( + 1472usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mApplyPluginGeometryTimer ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . - mRegisteredPlugins as * const _ as usize } , 1424usize , + mRegisteredPlugins as * const _ as usize } , 1480usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mRegisteredPlugins ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . - mWillPaintObservers as * const _ as usize } , 1472usize , + mWillPaintObservers as * const _ as usize } , 1528usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mWillPaintObservers ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . mWillPaintFallbackEvent as * const _ as usize } , - 1480usize , concat ! ( + 1536usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mWillPaintFallbackEvent ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . - mDOMGeneration as * const _ as usize } , 1488usize , + mDOMGeneration as * const _ as usize } , 1544usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mDOMGeneration ) )); @@ -26020,7 +28132,7 @@ pub mod root { pub mRefCnt: root::nsAutoRefCnt, pub _mOwningThread: root::nsAutoOwningThread, pub mBehaviour: root::mozilla::UniquePtr, - pub mURI: root::RefPtr, + pub mURI: root::RefPtr, pub mListener: *mut root::imgINotificationObserver, pub mLoadGroup: root::nsCOMPtr, pub mLoadFlags: root::nsLoadFlags, @@ -27252,7 +29364,7 @@ pub mod root { pub _mOwningThread: root::nsAutoOwningThread, pub mLoader: *mut root::imgLoader, pub mRequest: root::nsCOMPtr, - pub mURI: root::RefPtr, + pub mURI: root::RefPtr, pub mCurrentURI: root::nsCOMPtr, pub mLoadingPrincipal: root::nsCOMPtr, pub mPrincipal: root::nsCOMPtr, @@ -27279,8 +29391,8 @@ pub mod root { pub mImageErrorCode: root::nsresult, pub mBoostCategoriesRequested: u32, pub mMutex: root::mozilla::Mutex, - pub mProgressTracker: root::RefPtr, - pub mImage: root::RefPtr, + pub mProgressTracker: root::RefPtr, + pub mImage: root::RefPtr, pub _bitfield_1: u8, pub __bindgen_padding_0: [u8; 7usize], } @@ -27294,7 +29406,7 @@ pub mod root { pub type imgRequest_HasThreadSafeRefCnt = root::mozilla::TrueType; #[test] fn bindgen_test_layout_imgRequest() { - assert_eq!(::std::mem::size_of::() , 440usize , concat ! ( + assert_eq!(::std::mem::size_of::() , 416usize , concat ! ( "Size of: " , stringify ! ( imgRequest ) )); assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( imgRequest ) )); @@ -27303,110 +29415,175 @@ pub mod root { #[inline] pub fn mIsMultiPartChannel(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsMultiPartChannel(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mGotData(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mGotData(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsInCache(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsInCache(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mDecodeRequested(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mDecodeRequested(&mut self, val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mNewPartPending(&self) -> bool { let mask = 16usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mNewPartPending(&mut self, val: bool) { let mask = 16usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHadInsecureRedirect(&self) -> bool { let mask = 32usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 5usize; + let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHadInsecureRedirect(&mut self, val: bool) { let mask = 32usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 5usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mIsMultiPartChannel: bool, mGotData: bool, + mIsInCache: bool, mDecodeRequested: bool, + mNewPartPending: bool, + mHadInsecureRedirect: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { 0 }; + let mIsMultiPartChannel = + mIsMultiPartChannel as + u8 as u8; + let mask = 1usize as u8; + let mIsMultiPartChannel = + (mIsMultiPartChannel + << 0usize) & + mask; + bitfield_unit_val | + mIsMultiPartChannel + }; + let mGotData = + mGotData as u8 as u8; + let mask = 2usize as u8; + let mGotData = + (mGotData << 1usize) & mask; + bitfield_unit_val | mGotData + }; + let mIsInCache = mIsInCache as u8 as u8; + let mask = 4usize as u8; + let mIsInCache = + (mIsInCache << 2usize) & mask; + bitfield_unit_val | mIsInCache + }; + let mDecodeRequested = + mDecodeRequested as u8 as u8; + let mask = 8usize as u8; + let mDecodeRequested = + (mDecodeRequested << 3usize) & mask; + bitfield_unit_val | mDecodeRequested + }; + let mNewPartPending = mNewPartPending as u8 as u8; + let mask = 16usize as u8; + let mNewPartPending = (mNewPartPending << 4usize) & mask; + bitfield_unit_val | mNewPartPending + }; + let mHadInsecureRedirect = mHadInsecureRedirect as u8 as u8; + let mask = 32usize as u8; + let mHadInsecureRedirect = + (mHadInsecureRedirect << 5usize) & mask; + bitfield_unit_val | mHadInsecureRedirect } } #[repr(C)] @@ -28710,7 +30887,18 @@ pub mod root { ) , "::" , stringify ! ( mQuotePairs ) )); } #[test] - fn __bindgen_test_layout_StaticRefPtr_instantiation_152716() { + fn __bindgen_test_layout_StaticRefPtr_instantiation_85() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::StaticRefPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::StaticRefPtr ) )); + } + #[test] + fn __bindgen_test_layout_StaticRefPtr_instantiation_86() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -28872,38 +31060,55 @@ pub mod root { #[inline] pub fn mIsAutoFill(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsAutoFill(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsSubgrid(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsSubgrid(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mIsAutoFill: bool, mIsSubgrid: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = { 0 }; + let mIsAutoFill = mIsAutoFill as u8 as u8; + let mask = 1usize as u8; + let mIsAutoFill = (mIsAutoFill << 0usize) & mask; + bitfield_unit_val | mIsAutoFill + }; + let mIsSubgrid = mIsSubgrid as u8 as u8; + let mask = 2usize as u8; + let mIsSubgrid = (mIsSubgrid << 1usize) & mask; + bitfield_unit_val | mIsSubgrid } } #[repr(C)] @@ -29453,38 +31658,56 @@ pub mod root { #[inline] pub fn mTextAlignTrue(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mTextAlignTrue(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mTextAlignLastTrue(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mTextAlignLastTrue(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mTextAlignTrue: bool, mTextAlignLastTrue: bool) + -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = { 0 }; + let mTextAlignTrue = mTextAlignTrue as u8 as u8; + let mask = 1usize as u8; + let mTextAlignTrue = (mTextAlignTrue << 0usize) & mask; + bitfield_unit_val | mTextAlignTrue + }; + let mTextAlignLastTrue = mTextAlignLastTrue as u8 as u8; + let mask = 2usize as u8; + let mTextAlignLastTrue = (mTextAlignLastTrue << 1usize) & mask; + bitfield_unit_val | mTextAlignLastTrue } } #[repr(C)] @@ -30820,7 +33043,7 @@ pub mod root { pub type RawGeckoURLExtraData = root::mozilla::URLExtraData; pub type RawGeckoKeyframeList = root::nsTArray; pub type RawGeckoComputedKeyframeValuesList = - root::nsTArray>; + root::nsTArray; pub type RawGeckoAnimationValueList = root::nsTArray; pub type RawGeckoStyleAnimationList = @@ -31187,48 +33410,48 @@ pub mod root { pub struct nsAttrValueOrString { _unused: [u8; 0], } - pub const ELEMENT_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_1; - pub const ELEMENT_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_SHARED_RESTYLE_BIT_3: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_3; - pub const ELEMENT_SHARED_RESTYLE_BIT_4: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_1; + pub const ELEMENT_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_84 = + _bindgen_ty_84::ELEMENT_SHARED_RESTYLE_BIT_1; + pub const ELEMENT_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_84 = + _bindgen_ty_84::ELEMENT_SHARED_RESTYLE_BIT_2; + pub const ELEMENT_SHARED_RESTYLE_BIT_3: root::_bindgen_ty_84 = + _bindgen_ty_84::ELEMENT_SHARED_RESTYLE_BIT_3; + pub const ELEMENT_SHARED_RESTYLE_BIT_4: root::_bindgen_ty_84 = + _bindgen_ty_84::ELEMENT_SHARED_RESTYLE_BIT_4; + pub const ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_84 = + _bindgen_ty_84::ELEMENT_SHARED_RESTYLE_BIT_1; pub const ELEMENT_HAS_ANIMATION_ONLY_DIRTY_DESCENDANTS_FOR_SERVO: - root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_HAS_SNAPSHOT: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_3; - pub const ELEMENT_HANDLED_SNAPSHOT: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_HAS_PENDING_RESTYLE: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_1; - pub const ELEMENT_IS_POTENTIAL_RESTYLE_ROOT: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE: root::_bindgen_ty_19 + root::_bindgen_ty_84 = + _bindgen_ty_84::ELEMENT_SHARED_RESTYLE_BIT_2; + pub const ELEMENT_HAS_SNAPSHOT: root::_bindgen_ty_84 = + _bindgen_ty_84::ELEMENT_SHARED_RESTYLE_BIT_3; + pub const ELEMENT_HANDLED_SNAPSHOT: root::_bindgen_ty_84 = + _bindgen_ty_84::ELEMENT_SHARED_RESTYLE_BIT_4; + pub const ELEMENT_HAS_PENDING_RESTYLE: root::_bindgen_ty_84 = + _bindgen_ty_84::ELEMENT_SHARED_RESTYLE_BIT_1; + pub const ELEMENT_IS_POTENTIAL_RESTYLE_ROOT: root::_bindgen_ty_84 = + _bindgen_ty_84::ELEMENT_SHARED_RESTYLE_BIT_2; + pub const ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE: root::_bindgen_ty_84 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_3; + _bindgen_ty_84::ELEMENT_SHARED_RESTYLE_BIT_3; pub const ELEMENT_IS_POTENTIAL_ANIMATION_ONLY_RESTYLE_ROOT: - root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR; - pub const ELEMENT_PENDING_RESTYLE_FLAGS: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_PENDING_RESTYLE_FLAGS; - pub const ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS; - pub const ELEMENT_ALL_RESTYLE_FLAGS: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_ALL_RESTYLE_FLAGS; - pub const ELEMENT_HAS_SCROLLGRAB: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_HAS_SCROLLGRAB; - pub const ELEMENT_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_TYPE_SPECIFIC_BITS_OFFSET; + root::_bindgen_ty_84 = + _bindgen_ty_84::ELEMENT_SHARED_RESTYLE_BIT_4; + pub const ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR: root::_bindgen_ty_84 = + _bindgen_ty_84::ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR; + pub const ELEMENT_PENDING_RESTYLE_FLAGS: root::_bindgen_ty_84 = + _bindgen_ty_84::ELEMENT_PENDING_RESTYLE_FLAGS; + pub const ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS: root::_bindgen_ty_84 = + _bindgen_ty_84::ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS; + pub const ELEMENT_ALL_RESTYLE_FLAGS: root::_bindgen_ty_84 = + _bindgen_ty_84::ELEMENT_ALL_RESTYLE_FLAGS; + pub const ELEMENT_HAS_SCROLLGRAB: root::_bindgen_ty_84 = + _bindgen_ty_84::ELEMENT_HAS_SCROLLGRAB; + pub const ELEMENT_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_84 = + _bindgen_ty_84::ELEMENT_TYPE_SPECIFIC_BITS_OFFSET; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum _bindgen_ty_19 { + pub enum _bindgen_ty_84 { ELEMENT_SHARED_RESTYLE_BIT_1 = 8388608, ELEMENT_SHARED_RESTYLE_BIT_2 = 16777216, ELEMENT_SHARED_RESTYLE_BIT_3 = 33554432, @@ -31959,6 +34182,22 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy)] + pub struct _bindgen_ty_29 { + pub _address: u8, + } + impl Clone for _bindgen_ty_29 { + fn clone(&self) -> Self { *self } + } + #[repr(C)] + #[derive(Debug, Copy)] + pub struct _bindgen_ty_30 { + pub _address: u8, + } + impl Clone for _bindgen_ty_30 { + fn clone(&self) -> Self { *self } + } + #[repr(C)] + #[derive(Debug, Copy)] pub struct __va_list_tag { pub gp_offset: ::std::os::raw::c_uint, pub fp_offset: ::std::os::raw::c_uint, @@ -31997,7 +34236,7 @@ pub mod root { } pub type __builtin_va_list = [root::__va_list_tag; 1usize]; #[test] - fn __bindgen_test_layout_IntegralConstant_instantiation_181735() { + fn __bindgen_test_layout_IntegralConstant_instantiation_87() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( u8 ) )); @@ -32006,7 +34245,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_IntegralConstant_instantiation_181739() { + fn __bindgen_test_layout_IntegralConstant_instantiation_88() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( u8 ) )); @@ -32015,69 +34254,103 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsReadingIterator_instantiation_181956() { - assert_eq!(::std::mem::size_of::>() , - 24usize , concat ! ( + fn __bindgen_test_layout_nsCharTraits_instantiation_89() { + assert_eq!(::std::mem::size_of::() , 1usize , + concat ! ( "Size of template specialization: " , stringify ! ( - root::nsReadingIterator ) )); - assert_eq!(::std::mem::align_of::>() , - 8usize , concat ! ( + root::nsCharTraits ) )); + assert_eq!(::std::mem::align_of::() , 1usize , + concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsReadingIterator ) )); + root::nsCharTraits ) )); } #[test] - fn __bindgen_test_layout_nsWritingIterator_instantiation_181960() { - assert_eq!(::std::mem::size_of::>() , - 24usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::nsWritingIterator ) )); - assert_eq!(::std::mem::align_of::>() , - 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::nsWritingIterator ) )); - } - #[test] - fn __bindgen_test_layout_nsReadingIterator_instantiation_182033() { - assert_eq!(::std::mem::size_of::>() + fn __bindgen_test_layout_nsReadingIterator_instantiation_90() { + assert_eq!(::std::mem::size_of::>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsReadingIterator<::std::os::raw::c_char> ) )); - assert_eq!(::std::mem::align_of::>() + root::nsReadingIterator + ) )); + assert_eq!(::std::mem::align_of::>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsReadingIterator<::std::os::raw::c_char> ) )); + root::nsReadingIterator + ) )); } #[test] - fn __bindgen_test_layout_nsWritingIterator_instantiation_182037() { - assert_eq!(::std::mem::size_of::>() + fn __bindgen_test_layout_nsWritingIterator_instantiation_91() { + assert_eq!(::std::mem::size_of::>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsWritingIterator<::std::os::raw::c_char> ) )); - assert_eq!(::std::mem::align_of::>() + root::nsWritingIterator + ) )); + assert_eq!(::std::mem::align_of::>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsWritingIterator<::std::os::raw::c_char> ) )); + root::nsWritingIterator + ) )); } #[test] - fn __bindgen_test_layout_atomic_instantiation_184077() { - assert_eq!(::std::mem::size_of::() , 4usize , concat ! ( - "Size of template specialization: " , stringify ! ( u32 ) - )); - assert_eq!(::std::mem::align_of::() , 4usize , concat ! ( + fn __bindgen_test_layout_nsCharTraits_instantiation_92() { + assert_eq!(::std::mem::size_of::() , 1usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCharTraits ) )); + assert_eq!(::std::mem::align_of::() , 1usize , + concat ! ( "Alignment of template specialization: " , stringify ! ( - u32 ) )); + root::nsCharTraits ) )); } #[test] - fn __bindgen_test_layout_atomic_instantiation_184085() { - assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( u64 ) - )); - assert_eq!(::std::mem::align_of::() , 8usize , concat ! ( + fn __bindgen_test_layout_nsReadingIterator_instantiation_93() { + assert_eq!(::std::mem::size_of::>() + , 24usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsReadingIterator + ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - u64 ) )); + root::nsReadingIterator + ) )); } #[test] - fn __bindgen_test_layout__bindgen_ty_id_184342_instantiation_184339() { + fn __bindgen_test_layout_nsWritingIterator_instantiation_94() { + assert_eq!(::std::mem::size_of::>() + , 24usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsWritingIterator + ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsWritingIterator + ) )); + } + #[test] + fn __bindgen_test_layout_nsCharTraits_instantiation_95() { + assert_eq!(::std::mem::size_of::() , 1usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCharTraits ) )); + assert_eq!(::std::mem::align_of::() , 1usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCharTraits ) )); + } + #[test] + fn __bindgen_test_layout_nsCharTraits_instantiation_96() { + assert_eq!(::std::mem::size_of::() , 1usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCharTraits ) )); + assert_eq!(::std::mem::align_of::() , 1usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCharTraits ) )); + } + #[test] + fn __bindgen_test_layout__bindgen_ty_id_187141_instantiation_97() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( u8 ) )); @@ -32086,7 +34359,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout__bindgen_ty_id_184375_instantiation_184372() { + fn __bindgen_test_layout__bindgen_ty_id_187177_instantiation_98() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( u8 ) )); @@ -32095,7 +34368,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_184643() { + fn __bindgen_test_layout_nsTArray_instantiation_99() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32106,7 +34379,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_185475() { + fn __bindgen_test_layout_Handle_instantiation_100() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32117,7 +34390,7 @@ pub mod root { root::JS::Handle<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_185491() { + fn __bindgen_test_layout_Handle_instantiation_101() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32128,18 +34401,7 @@ pub mod root { root::JS::Handle ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_185501() { - assert_eq!(::std::mem::size_of::>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<*mut root::JSObject> ) )); - } - #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_185517() { + fn __bindgen_test_layout_MutableHandle_instantiation_102() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32150,7 +34412,7 @@ pub mod root { root::JS::MutableHandle ) )); } #[test] - fn __bindgen_test_layout_Rooted_instantiation_185520() { + fn __bindgen_test_layout_Rooted_instantiation_103() { assert_eq!(::std::mem::size_of::<[u64; 3usize]>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32161,7 +34423,7 @@ pub mod root { [u64; 3usize] ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_185857() { + fn __bindgen_test_layout_DeletePolicy_instantiation_104() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32172,7 +34434,7 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_190833() { + fn __bindgen_test_layout_nsTArray_instantiation_105() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32183,7 +34445,7 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_190837() { + fn __bindgen_test_layout_nsTArray_instantiation_106() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32194,51 +34456,40 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_190850() { - assert_eq!(::std::mem::size_of::>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::nsTArray<::std::os::raw::c_uint> ) )); - assert_eq!(::std::mem::align_of::>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::nsTArray<::std::os::raw::c_uint> ) )); - } - #[test] - fn __bindgen_test_layout_TenuredHeap_instantiation_191764() { - assert_eq!(::std::mem::size_of::() , 8usize , + fn __bindgen_test_layout_nsTArray_instantiation_107() { + assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::TenuredHeap ) )); - assert_eq!(::std::mem::align_of::() , 8usize , + root::nsTArray ) )); + assert_eq!(::std::mem::align_of::>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::TenuredHeap ) )); + root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_Heap_instantiation_191854() { - assert_eq!(::std::mem::size_of::>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsTArray_instantiation_108() { + assert_eq!(::std::mem::size_of::>() , 8usize , + concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Heap<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::>() - , 8usize , concat ! ( + root::nsTArray ) )); + assert_eq!(::std::mem::align_of::>() , 8usize , + concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Heap<*mut root::JSObject> ) )); + root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_Heap_instantiation_191969() { - assert_eq!(::std::mem::size_of::>() , + fn __bindgen_test_layout_nsTArray_instantiation_109() { + assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Heap ) )); - assert_eq!(::std::mem::align_of::>() , + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Heap ) )); + root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_TErrorResult_instantiation_191976() { + fn __bindgen_test_layout_TErrorResult_instantiation_110() { assert_eq!(::std::mem::size_of::() , 32usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32249,7 +34500,7 @@ pub mod root { root::mozilla::binding_danger::TErrorResult ) )); } #[test] - fn __bindgen_test_layout_TErrorResult_instantiation_191992() { + fn __bindgen_test_layout_TErrorResult_instantiation_111() { assert_eq!(::std::mem::size_of::() , 32usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32260,7 +34511,7 @@ pub mod root { root::mozilla::binding_danger::TErrorResult ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_191998() { + fn __bindgen_test_layout_already_AddRefed_instantiation_112() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32271,18 +34522,51 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_192050() { - assert_eq!(::std::mem::size_of::>() + fn __bindgen_test_layout_Handle_instantiation_113() { + assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed ) )); - assert_eq!(::std::mem::align_of::>() + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed ) )); + root::JS::Handle<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_192533() { + fn __bindgen_test_layout_MutableHandle_instantiation_114() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_115() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_116() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_instantiation_117() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32293,18 +34577,29 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_192879() { - assert_eq!(::std::mem::size_of::>() + fn __bindgen_test_layout_Handle_instantiation_118() { + assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed ) )); - assert_eq!(::std::mem::align_of::>() + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed ) )); + root::JS::Handle<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_193124() { + fn __bindgen_test_layout_Handle_instantiation_119() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_120() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32315,7 +34610,18 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_193271() { + fn __bindgen_test_layout_already_AddRefed_instantiation_121() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_122() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32326,7 +34632,40 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_197390() { + fn __bindgen_test_layout_Handle_instantiation_123() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_124() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_125() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_DeletePolicy_instantiation_126() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32337,7 +34676,7 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_197388() { + fn __bindgen_test_layout_UniquePtr_instantiation_127() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32348,7 +34687,95 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_iterator_instantiation_197423() { + fn __bindgen_test_layout_DeletePolicy_instantiation_128() { + assert_eq!(::std::mem::size_of::() , 1usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + assert_eq!(::std::mem::align_of::() , 1usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_instantiation_129() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + } + #[test] + fn __bindgen_test_layout_DeletePolicy_instantiation_130() { + assert_eq!(::std::mem::size_of::() , 1usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + assert_eq!(::std::mem::align_of::() , 1usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_instantiation_131() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + } + #[test] + fn __bindgen_test_layout_DeletePolicy_instantiation_132() { + assert_eq!(::std::mem::size_of::() , 1usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + assert_eq!(::std::mem::align_of::() , 1usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_instantiation_133() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + } + #[test] + fn __bindgen_test_layout_DeletePolicy_instantiation_134() { + assert_eq!(::std::mem::size_of::() , 1usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + assert_eq!(::std::mem::align_of::() , 1usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_instantiation_135() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + } + #[test] + fn __bindgen_test_layout_iterator_instantiation_136() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32359,7 +34786,51 @@ pub mod root { root::std::iterator ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_197991() { + fn __bindgen_test_layout_DeletePolicy_instantiation_137() { + assert_eq!(::std::mem::size_of::() , 1usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + assert_eq!(::std::mem::align_of::() , 1usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_instantiation_138() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + } + #[test] + fn __bindgen_test_layout_DeletePolicy_instantiation_139() { + assert_eq!(::std::mem::size_of::() , 1usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + assert_eq!(::std::mem::align_of::() , 1usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_instantiation_140() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_instantiation_141() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32370,7 +34841,117 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_199584() { + fn __bindgen_test_layout_Handle_instantiation_142() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_143() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_instantiation_144() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_instantiation_145() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_146() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_147() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray ) )); + } + #[test] + fn __bindgen_test_layout_Heap_instantiation_148() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Heap ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Heap ) )); + } + #[test] + fn __bindgen_test_layout_Heap_instantiation_149() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Heap<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Heap<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_TenuredHeap_instantiation_150() { + assert_eq!(::std::mem::size_of::() , 8usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::TenuredHeap ) )); + assert_eq!(::std::mem::align_of::() , 8usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::TenuredHeap ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_151() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_152() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32383,18 +34964,29 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_LinkedList_instantiation_199860() { - assert_eq!(::std::mem::size_of::() , - 24usize , concat ! ( + fn __bindgen_test_layout_RefPtr_instantiation_153() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::LinkedList ) )); - assert_eq!(::std::mem::align_of::() , - 8usize , concat ! ( + root::RefPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::LinkedList ) )); + root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_199876() { + fn __bindgen_test_layout_RefPtr_instantiation_154() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_instantiation_155() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32405,7 +34997,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_199875() { + fn __bindgen_test_layout_nsTArray_instantiation_156() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32418,7 +35010,7 @@ pub mod root { )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_199905() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_157() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32429,7 +35021,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_199904() { + fn __bindgen_test_layout_nsTArray_instantiation_158() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32440,7 +35032,18 @@ pub mod root { root::nsTArray> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_199950() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_159() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_160() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32451,7 +35054,51 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_200115() { + fn __bindgen_test_layout_already_AddRefed_instantiation_161() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_instantiation_162() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_163() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_164() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_165() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32462,7 +35109,75 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_200442() { + fn __bindgen_test_layout_already_AddRefed_instantiation_166() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_167() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_instantiation_168() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_169() { + assert_eq!(::std::mem::size_of::>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray> ) + )); + assert_eq!(::std::mem::align_of::>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray> ) + )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_170() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_171() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_172() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32473,7 +35188,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_200535() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_173() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32484,18 +35199,18 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_200572() { - assert_eq!(::std::mem::size_of::>() + fn __bindgen_test_layout_Handle_instantiation_174() { + assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsCOMPtr ) )); - assert_eq!(::std::mem::align_of::>() + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsCOMPtr ) )); + root::JS::Handle<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_200830() { + fn __bindgen_test_layout_DefaultDelete_instantiation_175() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32506,7 +35221,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_200828() { + fn __bindgen_test_layout_UniquePtr_instantiation_176() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32517,7 +35232,62 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_201389() { + fn __bindgen_test_layout_already_AddRefed_instantiation_177() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_178() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_179() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_180() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_181() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_182() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32530,7 +35300,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsDataHashtable_instantiation_201388() { + fn __bindgen_test_layout_nsDataHashtable_instantiation_183() { assert_eq!(::std::mem::size_of::<[u64; 6usize]>() , 48usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32541,7 +35311,18 @@ pub mod root { [u64; 6usize] ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_201595() { + fn __bindgen_test_layout_Handle_instantiation_184() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_185() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32552,7 +35333,40 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_SupportsWeakPtr_instantiation_201646() { + fn __bindgen_test_layout_nsTArray_instantiation_186() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsIContent> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsIContent> ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_187() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_188() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_SupportsWeakPtr_instantiation_189() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( u64 ) )); @@ -32561,7 +35375,18 @@ pub mod root { u64 ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_201826() { + fn __bindgen_test_layout_already_AddRefed_instantiation_190() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_191() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32572,7 +35397,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_201942() { + fn __bindgen_test_layout_DefaultDelete_instantiation_192() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32583,7 +35408,40 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_202111() { + fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_193() { + assert_eq!(::std::mem::size_of::>() + , 16usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsRefPtrHashKey ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsRefPtrHashKey ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_instantiation_194() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_instantiation_195() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_196() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32594,7 +35452,95 @@ pub mod root { root::nsTArray> ) )); } #[test] - fn __bindgen_test_layout_nsPIDOMWindow_instantiation_202900() { + fn __bindgen_test_layout_already_AddRefed_instantiation_197() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_198() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_199() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_200() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_201() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_202() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_203() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_204() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_nsPIDOMWindow_instantiation_205() { assert_eq!(::std::mem::size_of::<[u64; 29usize]>() , 232usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32605,7 +35551,7 @@ pub mod root { [u64; 29usize] ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_202992() { + fn __bindgen_test_layout_already_AddRefed_instantiation_206() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32616,7 +35562,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashtable_instantiation_203182() { + fn __bindgen_test_layout_nsRefPtrHashtable_instantiation_207() { assert_eq!(::std::mem::size_of::<[u64; 6usize]>() , 48usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32627,7 +35573,71 @@ pub mod root { [u64; 6usize] ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_203705() { + fn __bindgen_test_layout_Handle_instantiation_208() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_209() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_210() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_instantiation_211() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_instantiation_212() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr ) )); + } + #[test] + fn __bindgen_test_layout_WeakPtr_instantiation_213() { + assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) + )); + assert_eq!(::std::mem::align_of::() , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + u64 ) )); + } + #[test] + fn __bindgen_test_layout_nsPtrHashKey_instantiation_214() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32638,7 +35648,7 @@ pub mod root { root::nsPtrHashKey<::std::os::raw::c_void> ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_203713() { + fn __bindgen_test_layout_nsPtrHashKey_instantiation_215() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32649,7 +35659,29 @@ pub mod root { root::nsPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_OwningNonNull_instantiation_203828() { + fn __bindgen_test_layout_RefPtr_instantiation_216() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_217() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_OwningNonNull_instantiation_218() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32660,7 +35692,95 @@ pub mod root { root::mozilla::OwningNonNull ) )); } #[test] - fn __bindgen_test_layout_PointTyped_instantiation_204907() { + fn __bindgen_test_layout_OwningNonNull_instantiation_219() { + assert_eq!(::std::mem::size_of::>() + , 16usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::OwningNonNull ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::OwningNonNull ) )); + } + #[test] + fn __bindgen_test_layout_OwningNonNull_instantiation_220() { + assert_eq!(::std::mem::size_of::>() + , 16usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::OwningNonNull ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::OwningNonNull ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_221() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_222() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_223() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_224() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_instantiation_225() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsPtrHashKey_instantiation_226() { + assert_eq!(::std::mem::size_of::>() + , 16usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsPtrHashKey<::std::os::raw::c_void> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsPtrHashKey<::std::os::raw::c_void> ) )); + } + #[test] + fn __bindgen_test_layout_PointTyped_instantiation_227() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32671,7 +35791,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_IntPointTyped_instantiation_204912() { + fn __bindgen_test_layout_IntPointTyped_instantiation_228() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32682,7 +35802,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_SizeTyped_instantiation_204915() { + fn __bindgen_test_layout_SizeTyped_instantiation_229() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32693,7 +35813,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_RectTyped_instantiation_204923() { + fn __bindgen_test_layout_RectTyped_instantiation_230() { assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32704,7 +35824,7 @@ pub mod root { [u32; 4usize] ) )); } #[test] - fn __bindgen_test_layout_IntPointTyped_instantiation_204955() { + fn __bindgen_test_layout_IntPointTyped_instantiation_231() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32715,7 +35835,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_IntSizeTyped_instantiation_204963() { + fn __bindgen_test_layout_IntSizeTyped_instantiation_232() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32726,7 +35846,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_IntRectTyped_instantiation_204971() { + fn __bindgen_test_layout_IntRectTyped_instantiation_233() { assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32737,7 +35857,7 @@ pub mod root { [u32; 4usize] ) )); } #[test] - fn __bindgen_test_layout_MarginTyped_instantiation_205138() { + fn __bindgen_test_layout_MarginTyped_instantiation_234() { assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32748,7 +35868,7 @@ pub mod root { [u32; 4usize] ) )); } #[test] - fn __bindgen_test_layout_RectTyped_instantiation_205173() { + fn __bindgen_test_layout_RectTyped_instantiation_235() { assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32759,7 +35879,7 @@ pub mod root { [u32; 4usize] ) )); } #[test] - fn __bindgen_test_layout_IntRectTyped_instantiation_205178() { + fn __bindgen_test_layout_IntRectTyped_instantiation_236() { assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32770,7 +35890,7 @@ pub mod root { [u32; 4usize] ) )); } #[test] - fn __bindgen_test_layout_ScaleFactor_instantiation_205224() { + fn __bindgen_test_layout_ScaleFactor_instantiation_237() { assert_eq!(::std::mem::size_of::() , 4usize , concat ! ( "Size of template specialization: " , stringify ! ( u32 ) )); @@ -32779,7 +35899,7 @@ pub mod root { u32 ) )); } #[test] - fn __bindgen_test_layout_ScaleFactors2D_instantiation_205324() { + fn __bindgen_test_layout_ScaleFactors2D_instantiation_238() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32790,7 +35910,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_ScaleFactors2D_instantiation_205332() { + fn __bindgen_test_layout_ScaleFactors2D_instantiation_239() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32801,7 +35921,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_ScaleFactors2D_instantiation_205376() { + fn __bindgen_test_layout_ScaleFactors2D_instantiation_240() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32812,7 +35932,29 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_206006() { + fn __bindgen_test_layout_already_AddRefed_instantiation_241() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_242() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_243() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32825,7 +35967,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_206022() { + fn __bindgen_test_layout_nsPtrHashKey_instantiation_244() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32836,7 +35978,18 @@ pub mod root { root::nsPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_nsPIDOMWindow_instantiation_209296() { + fn __bindgen_test_layout_already_AddRefed_instantiation_245() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_nsPIDOMWindow_instantiation_246() { assert_eq!(::std::mem::size_of::<[u64; 29usize]>() , 232usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32847,7 +36000,29 @@ pub mod root { [u64; 29usize] ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_209932() { + fn __bindgen_test_layout_MutableHandle_instantiation_247() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_248() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_249() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32858,7 +36033,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_210023() { + fn __bindgen_test_layout_DefaultDelete_instantiation_250() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32869,7 +36044,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashtable_instantiation_210027() { + fn __bindgen_test_layout_nsRefPtrHashtable_instantiation_251() { assert_eq!(::std::mem::size_of::<[u64; 6usize]>() , 48usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32880,7 +36055,29 @@ pub mod root { [u64; 6usize] ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_211216() { + fn __bindgen_test_layout_Rooted_instantiation_252() { + assert_eq!(::std::mem::size_of::<[u64; 3usize]>() , 24usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + [u64; 3usize] ) )); + assert_eq!(::std::mem::align_of::<[u64; 3usize]>() , 8usize , concat ! + ( + "Alignment of template specialization: " , stringify ! ( + [u64; 3usize] ) )); + } + #[test] + fn __bindgen_test_layout_Rooted_instantiation_253() { + assert_eq!(::std::mem::size_of::<[u64; 3usize]>() , 24usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + [u64; 3usize] ) )); + assert_eq!(::std::mem::align_of::<[u64; 3usize]>() , 8usize , concat ! + ( + "Alignment of template specialization: " , stringify ! ( + [u64; 3usize] ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_254() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32891,7 +36088,18 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_211803() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_255() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_instantiation_256() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32902,7 +36110,117 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_213346() { + fn __bindgen_test_layout_nsTArray_instantiation_257() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_258() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_259() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_260() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_261() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_262() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_263() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_264() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_265() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_266() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_267() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32913,7 +36231,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_213358() { + fn __bindgen_test_layout_RefPtr_instantiation_268() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32926,7 +36244,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_213357() { + fn __bindgen_test_layout_nsTArray_instantiation_269() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32939,7 +36257,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_213391() { + fn __bindgen_test_layout_nsPtrHashKey_instantiation_270() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32950,7 +36268,20 @@ pub mod root { root::nsPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_213488() { + fn __bindgen_test_layout_RefPtr_instantiation_271() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr + ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr + ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_instantiation_272() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32961,7 +36292,95 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_nsDataHashtable_instantiation_215281() { + fn __bindgen_test_layout_nsTArray_instantiation_273() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_274() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_275() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_276() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_277() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_278() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_279() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_280() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_nsDataHashtable_instantiation_281() { assert_eq!(::std::mem::size_of::<[u64; 6usize]>() , 48usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32972,7 +36391,7 @@ pub mod root { [u64; 6usize] ) )); } #[test] - fn __bindgen_test_layout_OwningNonNull_instantiation_215320() { + fn __bindgen_test_layout_OwningNonNull_instantiation_282() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32985,7 +36404,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_215343() { + fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_283() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32996,7 +36415,7 @@ pub mod root { root::nsRefPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_215379() { + fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_284() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33007,7 +36426,18 @@ pub mod root { root::nsRefPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_215942() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_285() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_DefaultDelete_instantiation_286() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33018,7 +36448,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_215956() { + fn __bindgen_test_layout_already_AddRefed_instantiation_287() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33029,7 +36459,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_nsMainThreadPtrHolder_instantiation_215960() { + fn __bindgen_test_layout_nsMainThreadPtrHolder_instantiation_288() { assert_eq!(::std::mem::size_of::>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33040,7 +36470,62 @@ pub mod root { root::nsMainThreadPtrHolder ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_216034() { + fn __bindgen_test_layout_already_AddRefed_instantiation_289() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_290() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_291() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_292() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_293() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_nsPtrHashKey_instantiation_294() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33051,7 +36536,18 @@ pub mod root { root::nsPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_216321() { + fn __bindgen_test_layout_already_AddRefed_instantiation_295() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_DefaultDelete_instantiation_296() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33062,7 +36558,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_216319() { + fn __bindgen_test_layout_UniquePtr_instantiation_297() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33073,7 +36569,7 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_216327() { + fn __bindgen_test_layout_DefaultDelete_instantiation_298() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33084,7 +36580,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_216325() { + fn __bindgen_test_layout_UniquePtr_instantiation_299() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33095,18 +36591,18 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_216670() { - assert_eq!(::std::mem::size_of::<[u64; 2usize]>() , 16usize , concat ! - ( + fn __bindgen_test_layout_already_AddRefed_instantiation_300() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 2usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 2usize]>() , 8usize , concat ! - ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 2usize] ) )); + root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_SupportsWeakPtr_instantiation_216837() { + fn __bindgen_test_layout_SupportsWeakPtr_instantiation_301() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( u64 ) )); @@ -33115,7 +36611,40 @@ pub mod root { u64 ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_216995() { + fn __bindgen_test_layout_nsTArray_instantiation_302() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_303() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_304() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_Maybe_instantiation_305() { assert_eq!(::std::mem::size_of::<[u32; 3usize]>() , 12usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33126,7 +36655,18 @@ pub mod root { [u32; 3usize] ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_217010() { + fn __bindgen_test_layout_Maybe_instantiation_306() { + assert_eq!(::std::mem::size_of::<[u32; 3usize]>() , 12usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + [u32; 3usize] ) )); + assert_eq!(::std::mem::align_of::<[u32; 3usize]>() , 4usize , concat ! + ( + "Alignment of template specialization: " , stringify ! ( + [u32; 3usize] ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_307() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33137,7 +36677,18 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_217018() { + fn __bindgen_test_layout_already_AddRefed_instantiation_308() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_DefaultDelete_instantiation_309() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33148,7 +36699,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_217016() { + fn __bindgen_test_layout_UniquePtr_instantiation_310() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33159,7 +36710,7 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_217057() { + fn __bindgen_test_layout_DefaultDelete_instantiation_311() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33170,7 +36721,62 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_pair_instantiation_217208() { + fn __bindgen_test_layout_UniquePtr_instantiation_312() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_313() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_Maybe_instantiation_314() { + assert_eq!(::std::mem::size_of::<[u32; 3usize]>() , 12usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + [u32; 3usize] ) )); + assert_eq!(::std::mem::align_of::<[u32; 3usize]>() , 4usize , concat ! + ( + "Alignment of template specialization: " , stringify ! ( + [u32; 3usize] ) )); + } + #[test] + fn __bindgen_test_layout_DefaultDelete_instantiation_315() { + assert_eq!(::std::mem::size_of::() , + 1usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::() , + 1usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::DefaultDelete ) )); + } + #[test] + fn __bindgen_test_layout_DefaultDelete_instantiation_316() { + assert_eq!(::std::mem::size_of::() , + 1usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::() , + 1usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::DefaultDelete ) )); + } + #[test] + fn __bindgen_test_layout_pair_instantiation_317() { assert_eq!(::std::mem::size_of::>() , 32usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33181,7 +36787,7 @@ pub mod root { root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_217207() { + fn __bindgen_test_layout_nsTArray_instantiation_318() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( @@ -33196,18 +36802,139 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_218230() { - assert_eq!(::std::mem::size_of::>() + fn __bindgen_test_layout_already_AddRefed_instantiation_319() { + assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr ) )); - assert_eq!(::std::mem::align_of::>() + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr ) )); + root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_BaseTimeDuration_instantiation_222222() { + fn __bindgen_test_layout_nsTArray_instantiation_320() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_321() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_322() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_instantiation_323() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsStyleAutoArray_instantiation_324() { + assert_eq!(::std::mem::size_of::>() + , 64usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsStyleAutoArray ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsStyleAutoArray ) )); + } + #[test] + fn __bindgen_test_layout_DefaultDelete_instantiation_325() { + assert_eq!(::std::mem::size_of::() , + 1usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::() , + 1usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::DefaultDelete ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_instantiation_326() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + } + #[test] + fn __bindgen_test_layout_DefaultDelete_instantiation_327() { + assert_eq!(::std::mem::size_of::() , + 1usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::() , + 1usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::DefaultDelete ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_instantiation_328() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + } + #[test] + fn __bindgen_test_layout_Maybe_instantiation_329() { + assert_eq!(::std::mem::size_of::<[u64; 18usize]>() , 144usize , concat + ! ( + "Size of template specialization: " , stringify ! ( + [u64; 18usize] ) )); + assert_eq!(::std::mem::align_of::<[u64; 18usize]>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + [u64; 18usize] ) )); + } + #[test] + fn __bindgen_test_layout_Maybe_instantiation_330() { + assert_eq!(::std::mem::size_of::<[u64; 18usize]>() , 144usize , concat + ! ( + "Size of template specialization: " , stringify ! ( + [u64; 18usize] ) )); + assert_eq!(::std::mem::align_of::<[u64; 18usize]>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + [u64; 18usize] ) )); + } + #[test] + fn __bindgen_test_layout_BaseTimeDuration_instantiation_331() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33218,7 +36945,86 @@ pub mod root { root::mozilla::BaseTimeDuration ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_222814() { + fn __bindgen_test_layout_already_AddRefed_instantiation_332() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_333() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_334() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsIContent> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsIContent> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_335() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsIContent> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsIContent> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_instantiation_336() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_337() { + assert_eq!(::std::mem::size_of::>() + , 16usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsRefPtrHashKey + ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsRefPtrHashKey + ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_338() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_339() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33231,29 +37037,29 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_223076() { - assert_eq!(::std::mem::size_of::<[u64; 2usize]>() , 16usize , concat ! - ( + fn __bindgen_test_layout_Handle_instantiation_340() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 2usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 2usize]>() , 8usize , concat ! - ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 2usize] ) )); + root::JS::Handle<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_223083() { - assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat ! - ( + fn __bindgen_test_layout_Handle_instantiation_341() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 5usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 5usize]>() , 8usize , concat ! - ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 5usize] ) )); + root::JS::Handle<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_223258() { + fn __bindgen_test_layout_RefPtr_instantiation_342() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33264,7 +37070,29 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_Sequence_instantiation_223502() { + fn __bindgen_test_layout_Handle_instantiation_343() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_344() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_Sequence_instantiation_345() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( u64 ) )); @@ -33273,7 +37101,102 @@ pub mod root { u64 ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_223801() { + fn __bindgen_test_layout_Handle_instantiation_346() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_Sequence_instantiation_347() { + assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) + )); + assert_eq!(::std::mem::align_of::() , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + u64 ) )); + } + #[test] + fn __bindgen_test_layout_Sequence_instantiation_348() { + assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) + )); + assert_eq!(::std::mem::align_of::() , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + u64 ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_349() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_350() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_351() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_352() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_353() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_354() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_355() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33284,7 +37207,7 @@ pub mod root { root::nsRefPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_nsClassHashtable_instantiation_223800() { + fn __bindgen_test_layout_nsClassHashtable_instantiation_356() { assert_eq!(::std::mem::size_of::<[u64; 6usize]>() , 48usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33295,7 +37218,51 @@ pub mod root { [u64; 6usize] ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_225054() { + fn __bindgen_test_layout_Handle_instantiation_357() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_358() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_359() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_360() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_361() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33306,7 +37273,7 @@ pub mod root { root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); } #[test] - fn __bindgen_test_layout_nsAutoPtr_instantiation_225092() { + fn __bindgen_test_layout_nsAutoPtr_instantiation_362() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( diff --git a/servo/components/style/gecko/generated/structs_release.rs b/servo/components/style/gecko/generated/structs_release.rs index 5828157c0ca3..d9480e2fdfaf 100644 --- a/servo/components/style/gecko/generated/structs_release.rs +++ b/servo/components/style/gecko/generated/structs_release.rs @@ -971,6 +971,7 @@ pub mod root { pub const NS_STYLE_DISPLAY_MODE_BROWSER: ::std::os::raw::c_uint = 0; pub const NS_STYLE_DISPLAY_MODE_MINIMAL_UI: ::std::os::raw::c_uint = 1; pub const NS_STYLE_DISPLAY_MODE_STANDALONE: ::std::os::raw::c_uint = 2; + pub const NS_STYLE_DISPLAY_MODE_FULLSCREEN: ::std::os::raw::c_uint = 3; pub const NS_THEME_NONE: ::std::os::raw::c_uint = 0; pub const NS_THEME_BUTTON: ::std::os::raw::c_uint = 1; pub const NS_THEME_RADIO: ::std::os::raw::c_uint = 2; @@ -1169,6 +1170,16 @@ pub mod root { use self::super::super::root; #[repr(C)] #[derive(Debug, Copy, Clone)] + pub struct __is_swappable { + pub _address: u8, + } + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct __is_nothrow_swappable { + pub _address: u8, + } + #[repr(C)] + #[derive(Debug, Copy, Clone)] pub struct pair<_T1, _T2> { pub first: _T1, pub second: _T2, @@ -1177,6 +1188,8 @@ pub mod root { } pub type pair_first_type<_T1> = _T1; pub type pair_second_type<_T2> = _T2; + pub type pair__PCCP = u8; + pub type pair__PCCFP = u8; #[repr(C)] #[derive(Debug, Copy)] pub struct input_iterator_tag { @@ -1196,98 +1209,47 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy)] - pub struct forward_iterator_tag { + #[derive(Debug, Copy, Clone)] + pub struct iterator { pub _address: u8, } - #[test] - fn bindgen_test_layout_forward_iterator_tag() { - assert_eq!(::std::mem::size_of::() , 1usize - , concat ! ( - "Size of: " , stringify ! ( forward_iterator_tag ) )); - assert_eq! (::std::mem::align_of::() , - 1usize , concat ! ( - "Alignment of " , stringify ! ( forward_iterator_tag ) - )); - } - impl Clone for forward_iterator_tag { - fn clone(&self) -> Self { *self } - } + pub type iterator_iterator_category<_Category> = _Category; + pub type iterator_value_type<_Tp> = _Tp; + pub type iterator_difference_type<_Distance> = _Distance; + pub type iterator_pointer<_Pointer> = _Pointer; + pub type iterator_reference<_Reference> = _Reference; #[repr(C)] - #[derive(Debug, Copy)] - pub struct bidirectional_iterator_tag { + #[derive(Debug, Copy, Clone)] + pub struct __iterator_traits { pub _address: u8, } - #[test] - fn bindgen_test_layout_bidirectional_iterator_tag() { - assert_eq!(::std::mem::size_of::() , - 1usize , concat ! ( - "Size of: " , stringify ! ( bidirectional_iterator_tag - ) )); - assert_eq! (::std::mem::align_of::() , - 1usize , concat ! ( - "Alignment of " , stringify ! ( - bidirectional_iterator_tag ) )); - } - impl Clone for bidirectional_iterator_tag { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy)] - pub struct random_access_iterator_tag { - pub _address: u8, - } - #[test] - fn bindgen_test_layout_random_access_iterator_tag() { - assert_eq!(::std::mem::size_of::() , - 1usize , concat ! ( - "Size of: " , stringify ! ( random_access_iterator_tag - ) )); - assert_eq! (::std::mem::align_of::() , - 1usize , concat ! ( - "Alignment of " , stringify ! ( - random_access_iterator_tag ) )); - } - impl Clone for random_access_iterator_tag { - fn clone(&self) -> Self { *self } - } #[repr(C)] + #[derive(Debug, Copy, Clone)] pub struct iterator_traits { pub _address: u8, } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct iterator { - pub _address: u8, + pub struct reverse_iterator<_Iterator> { + pub current: _Iterator, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_Iterator>>, } - pub type iterator_value_type<_Tp> = _Tp; - pub type iterator_difference_type<_Distance> = _Distance; - pub type iterator_pointer<_Pointer> = _Pointer; - pub type iterator_reference<_Reference> = _Reference; - pub type iterator_iterator_category<_Category> = _Category; - #[repr(C)] - pub struct reverse_iterator<_Iter> { - pub __t: _Iter, - pub current: _Iter, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_Iter>>, - } - pub type reverse_iterator_iterator_type<_Iter> = _Iter; + pub type reverse_iterator___traits_type = root::std::iterator_traits; + pub type reverse_iterator_iterator_type<_Iterator> = _Iterator; pub type reverse_iterator_difference_type = - root::std::iterator_traits; - pub type reverse_iterator_reference = root::std::iterator_traits; - pub type reverse_iterator_pointer = root::std::iterator_traits; + root::std::reverse_iterator___traits_type; + pub type reverse_iterator_pointer = + root::std::reverse_iterator___traits_type; + pub type reverse_iterator_reference = + root::std::reverse_iterator___traits_type; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct atomic { } - pub type atomic___base = u8; - #[repr(C)] - pub struct __bit_const_reference { - pub __seg_: root::std::__bit_const_reference___storage_pointer, - pub __mask_: root::std::__bit_const_reference___storage_type, - } - pub type __bit_const_reference___storage_type = [u8; 0usize]; - pub type __bit_const_reference___storage_pointer = [u8; 0usize]; + } + pub mod __gnu_cxx { + #[allow(unused_imports)] + use self::super::super::root; } pub mod mozilla { #[allow(unused_imports)] @@ -1331,8 +1293,9 @@ pub mod root { root::nsSubstringTuple; pub type nsStringRepr_string_type = ::nsstring::nsStringRepr; pub type nsStringRepr_const_iterator = - root::nsReadingIterator; - pub type nsStringRepr_iterator = root::nsWritingIterator; + root::nsReadingIterator; + pub type nsStringRepr_iterator = + root::nsWritingIterator; pub type nsStringRepr_comparator_type = root::nsStringComparator; pub type nsStringRepr_char_iterator = *mut root::mozilla::detail::nsStringRepr_char_type; @@ -1422,9 +1385,9 @@ pub mod root { root::nsCSubstringTuple; pub type nsCStringRepr_string_type = root::nsCString; pub type nsCStringRepr_const_iterator = - root::nsReadingIterator<::std::os::raw::c_char>; + root::nsReadingIterator; pub type nsCStringRepr_iterator = - root::nsWritingIterator<::std::os::raw::c_char>; + root::nsWritingIterator; pub type nsCStringRepr_comparator_type = root::nsCStringComparator; pub type nsCStringRepr_char_iterator = @@ -1526,7 +1489,7 @@ pub mod root { #[repr(C)] #[derive(Debug)] pub struct MutexImpl { - pub platformData_: [*mut ::std::os::raw::c_void; 8usize], + pub platformData_: [*mut ::std::os::raw::c_void; 5usize], } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -1535,7 +1498,7 @@ pub mod root { } #[test] fn bindgen_test_layout_MutexImpl() { - assert_eq!(::std::mem::size_of::() , 64usize , + assert_eq!(::std::mem::size_of::() , 40usize , concat ! ( "Size of: " , stringify ! ( MutexImpl ) )); assert_eq! (::std::mem::align_of::() , 8usize , @@ -2131,7 +2094,7 @@ pub mod root { } } #[repr(C)] - #[derive(Debug, Copy)] + #[derive(Debug)] pub struct ThreadSafeAutoRefCnt { pub mValue: u64, } @@ -2152,9 +2115,6 @@ pub mod root { ThreadSafeAutoRefCnt ) , "::" , stringify ! ( mValue ) )); } - impl Clone for ThreadSafeAutoRefCnt { - fn clone(&self) -> Self { *self } - } #[repr(C)] #[derive(Debug)] pub struct OwningNonNull { @@ -2539,78 +2499,118 @@ pub mod root { #[inline] pub fn mIsRootContent(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsRootContent(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mDoSmoothScroll(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mDoSmoothScroll(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mUseDisplayPortMargins(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mUseDisplayPortMargins(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsScrollInfoLayer(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsScrollInfoLayer(&mut self, val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mIsRootContent: bool, + mDoSmoothScroll: bool, + mUseDisplayPortMargins: bool, + mIsScrollInfoLayer: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = { 0 }; + let mIsRootContent = + mIsRootContent as u8 as u8; + let mask = 1usize as u8; + let mIsRootContent = + (mIsRootContent << 0usize) & + mask; + bitfield_unit_val | mIsRootContent + }; + let mDoSmoothScroll = + mDoSmoothScroll as u8 as u8; + let mask = 2usize as u8; + let mDoSmoothScroll = + (mDoSmoothScroll << 1usize) & mask; + bitfield_unit_val | mDoSmoothScroll + }; + let mUseDisplayPortMargins = + mUseDisplayPortMargins as u8 as u8; + let mask = 4usize as u8; + let mUseDisplayPortMargins = + (mUseDisplayPortMargins << 2usize) & mask; + bitfield_unit_val | mUseDisplayPortMargins + }; + let mIsScrollInfoLayer = mIsScrollInfoLayer as u8 as u8; + let mask = 8usize as u8; + let mIsScrollInfoLayer = + (mIsScrollInfoLayer << 3usize) & mask; + bitfield_unit_val | mIsScrollInfoLayer } } #[repr(C)] @@ -2803,28 +2803,28 @@ pub mod root { #[inline] pub fn mHasScrollgrab(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasScrollgrab(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mAllowVerticalScrollWithWheel(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] @@ -2832,69 +2832,125 @@ pub mod root { val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsLayersIdRoot(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsLayersIdRoot(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mUsesContainerScrolling(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mUsesContainerScrolling(&mut self, val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mForceDisableApz(&self) -> bool { let mask = 16usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mForceDisableApz(&mut self, val: bool) { let mask = 16usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mHasScrollgrab: bool, + mAllowVerticalScrollWithWheel: bool, + mIsLayersIdRoot: bool, + mUsesContainerScrolling: bool, + mForceDisableApz: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { 0 }; + let mHasScrollgrab = + mHasScrollgrab as u8 + as u8; + let mask = 1usize as u8; + let mHasScrollgrab = + (mHasScrollgrab << + 0usize) & mask; + bitfield_unit_val | + mHasScrollgrab + }; + let mAllowVerticalScrollWithWheel = + mAllowVerticalScrollWithWheel + as u8 as u8; + let mask = 2usize as u8; + let mAllowVerticalScrollWithWheel = + (mAllowVerticalScrollWithWheel + << 1usize) & mask; + bitfield_unit_val | + mAllowVerticalScrollWithWheel + }; + let mIsLayersIdRoot = + mIsLayersIdRoot as u8 as u8; + let mask = 4usize as u8; + let mIsLayersIdRoot = + (mIsLayersIdRoot << 2usize) & mask; + bitfield_unit_val | mIsLayersIdRoot + }; + let mUsesContainerScrolling = + mUsesContainerScrolling as u8 as u8; + let mask = 8usize as u8; + let mUsesContainerScrolling = + (mUsesContainerScrolling << 3usize) & mask; + bitfield_unit_val | mUsesContainerScrolling + }; + let mForceDisableApz = mForceDisableApz as u8 as u8; + let mask = 16usize as u8; + let mForceDisableApz = + (mForceDisableApz << 4usize) & mask; + bitfield_unit_val | mForceDisableApz } } #[repr(C)] @@ -4971,7 +5027,7 @@ pub mod root { pub mDataset: *mut root::nsDOMStringMap, /** * SMIL Overridde style rules (for SMIL animation of CSS properties) - * @see nsIContent::GetSMILOverrideStyle + * @see Element::GetSMILOverrideStyle */ pub mSMILOverrideStyle: root::nsCOMPtr, /** @@ -6818,7 +6874,7 @@ pub mod root { _unused: [u8; 0], } #[test] - fn __bindgen_test_layout_StaticRefPtr_instantiation_117293() { + fn __bindgen_test_layout_StaticRefPtr_instantiation_2() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -7825,7 +7881,7 @@ pub mod root { } #[test] fn bindgen_test_layout_OffTheBooksMutex() { - assert_eq!(::std::mem::size_of::() , 64usize , + assert_eq!(::std::mem::size_of::() , 40usize , concat ! ( "Size of: " , stringify ! ( OffTheBooksMutex ) )); assert_eq! (::std::mem::align_of::() , 8usize , @@ -7844,7 +7900,7 @@ pub mod root { } #[test] fn bindgen_test_layout_Mutex() { - assert_eq!(::std::mem::size_of::() , 64usize , concat ! ( + assert_eq!(::std::mem::size_of::() , 40usize , concat ! ( "Size of: " , stringify ! ( Mutex ) )); assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( Mutex ) )); @@ -8962,8 +9018,10 @@ pub mod root { PropertyStyleAnimationValuePair ) , "::" , stringify ! ( mValue ) )); } + pub type ComputedKeyframeValues = + root::nsTArray; #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_154690() { + fn __bindgen_test_layout_DefaultDelete_instantiation_3() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -11196,28 +11254,6 @@ pub mod root { pub struct nsCharTraits { pub _address: u8, } - #[test] - fn __bindgen_test_layout_nsCharTraits_instantiation_52494() { - assert_eq!(::std::mem::size_of::() , 1usize , - concat ! ( - "Size of template specialization: " , stringify ! ( - root::nsCharTraits ) )); - assert_eq!(::std::mem::align_of::() , 1usize , - concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::nsCharTraits ) )); - } - #[test] - fn __bindgen_test_layout_nsCharTraits_instantiation_52498() { - assert_eq!(::std::mem::size_of::() , 1usize , - concat ! ( - "Size of template specialization: " , stringify ! ( - root::nsCharTraits ) )); - assert_eq!(::std::mem::align_of::() , 1usize , - concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::nsCharTraits ) )); - } /** * @see nsTAString */ @@ -11887,40 +11923,56 @@ pub mod root { #[inline] pub fn payload47(&self) -> u64 { let mask = 140737488355327usize as u64; - let field_val: u64 = + let unit_field_val: u64 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u64) } } #[inline] pub fn set_payload47(&mut self, val: u64) { let mask = 140737488355327usize as u64; let val = val as u64 as u64; - let mut field_val: u64 = + let mut unit_field_val: u64 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn tag(&self) -> root::JSValueTag { let mask = 18446603336221196288usize as u64; - let field_val: u64 = + let unit_field_val: u64 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 47usize; + let val = (unit_field_val & mask) >> 47usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_tag(&mut self, val: root::JSValueTag) { let mask = 18446603336221196288usize as u64; let val = val as u32 as u64; - let mut field_val: u64 = + let mut unit_field_val: u64 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 47usize) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << 47usize) & mask; self._bitfield_1 = - unsafe { ::std::mem::transmute(field_val) }; + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(payload47: u64, tag: root::JSValueTag) + -> u64 { + let bitfield_unit_val = + { + let bitfield_unit_val = { 0 }; + let payload47 = payload47 as u64 as u64; + let mask = 140737488355327usize as u64; + let payload47 = (payload47 << 0usize) & mask; + bitfield_unit_val | payload47 + }; + let tag = tag as u32 as u64; + let mask = 18446603336221196288usize as u64; + let tag = (tag << 47usize) & mask; + bitfield_unit_val | tag } } #[repr(C)] @@ -12443,6 +12495,11 @@ pub mod root { AutoSetAsyncStackForNewCalls ) , "::" , stringify ! ( oldAsyncCallIsExplicit ) )); } + pub type WarningReporter = + ::std::option::Option; #[repr(C)] #[derive(Debug)] pub struct AutoHideScriptedCaller { @@ -12596,6 +12653,113 @@ pub mod root { pub struct JSCompartment { _unused: [u8; 0], } + /** + * Describes a single error or warning that occurs in the execution of script. + */ + #[repr(C)] + pub struct JSErrorReport { + pub _base: root::JSErrorBase, + pub linebuf_: *const u16, + pub linebufLength_: usize, + pub tokenOffset_: usize, + pub notes: root::mozilla::UniquePtr, + pub flags: ::std::os::raw::c_uint, + pub exnType: i16, + pub _bitfield_1: u8, + pub __bindgen_padding_0: u8, + } + #[test] + fn bindgen_test_layout_JSErrorReport() { + assert_eq!(::std::mem::size_of::() , 72usize , concat ! + ( "Size of: " , stringify ! ( JSErrorReport ) )); + assert_eq! (::std::mem::align_of::() , 8usize , concat + ! ( "Alignment of " , stringify ! ( JSErrorReport ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const JSErrorReport ) ) . linebuf_ as * + const _ as usize } , 32usize , concat ! ( + "Alignment of field: " , stringify ! ( JSErrorReport ) , + "::" , stringify ! ( linebuf_ ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const JSErrorReport ) ) . linebufLength_ as + * const _ as usize } , 40usize , concat ! ( + "Alignment of field: " , stringify ! ( JSErrorReport ) , + "::" , stringify ! ( linebufLength_ ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const JSErrorReport ) ) . tokenOffset_ as * + const _ as usize } , 48usize , concat ! ( + "Alignment of field: " , stringify ! ( JSErrorReport ) , + "::" , stringify ! ( tokenOffset_ ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const JSErrorReport ) ) . notes as * const + _ as usize } , 56usize , concat ! ( + "Alignment of field: " , stringify ! ( JSErrorReport ) , + "::" , stringify ! ( notes ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const JSErrorReport ) ) . flags as * const + _ as usize } , 64usize , concat ! ( + "Alignment of field: " , stringify ! ( JSErrorReport ) , + "::" , stringify ! ( flags ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const JSErrorReport ) ) . exnType as * + const _ as usize } , 68usize , concat ! ( + "Alignment of field: " , stringify ! ( JSErrorReport ) , + "::" , stringify ! ( exnType ) )); + } + impl JSErrorReport { + #[inline] + pub fn isMuted(&self) -> bool { + let mask = 1usize as u8; + let unit_field_val: u8 = + unsafe { ::std::mem::transmute(self._bitfield_1) }; + let val = (unit_field_val & mask) >> 0usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_isMuted(&mut self, val: bool) { + let mask = 1usize as u8; + let val = val as u8 as u8; + let mut unit_field_val: u8 = + unsafe { ::std::mem::transmute(self._bitfield_1) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn ownsLinebuf_(&self) -> bool { + let mask = 2usize as u8; + let unit_field_val: u8 = + unsafe { ::std::mem::transmute(self._bitfield_1) }; + let val = (unit_field_val & mask) >> 1usize; + unsafe { ::std::mem::transmute(val as u8) } + } + #[inline] + pub fn set_ownsLinebuf_(&mut self, val: bool) { + let mask = 2usize as u8; + let val = val as u8 as u8; + let mut unit_field_val: u8 = + unsafe { ::std::mem::transmute(self._bitfield_1) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(isMuted: bool, ownsLinebuf_: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = { 0 }; + let isMuted = isMuted as u8 as u8; + let mask = 1usize as u8; + let isMuted = (isMuted << 0usize) & mask; + bitfield_unit_val | isMuted + }; + let ownsLinebuf_ = ownsLinebuf_ as u8 as u8; + let mask = 2usize as u8; + let ownsLinebuf_ = (ownsLinebuf_ << 1usize) & mask; + bitfield_unit_val | ownsLinebuf_ + } + } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JSRuntime { @@ -12844,17 +13008,6 @@ pub mod root { pub _base: root::nsCOMPtr_base, } pub type nsCOMPtr_element_type = T; - #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_61615() { - assert_eq!(::std::mem::size_of::() , 8usize , concat ! - ( - "Size of template specialization: " , stringify ! ( - root::nsCOMPtr ) )); - assert_eq!(::std::mem::align_of::() , 8usize , concat - ! ( - "Alignment of template specialization: " , stringify ! ( - root::nsCOMPtr ) )); - } #[repr(C)] #[derive(Debug)] pub struct nsAutoPtr { @@ -13460,38 +13613,55 @@ pub mod root { #[inline] pub fn mCapacity(&self) -> u32 { let mask = 2147483647usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mCapacity(&mut self, val: u32) { let mask = 2147483647usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsAutoArray(&self) -> u32 { let mask = 2147483648usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 31usize; + let val = (unit_field_val & mask) >> 31usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mIsAutoArray(&mut self, val: u32) { let mask = 2147483648usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 31usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 31usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mCapacity: u32, mIsAutoArray: u32) -> u32 { + let bitfield_unit_val = + { + let bitfield_unit_val = { 0 }; + let mCapacity = mCapacity as u32 as u32; + let mask = 2147483647usize as u32; + let mCapacity = (mCapacity << 0usize) & mask; + bitfield_unit_val | mCapacity + }; + let mIsAutoArray = mIsAutoArray as u32 as u32; + let mask = 2147483648usize as u32; + let mIsAutoArray = (mIsAutoArray << 31usize) & mask; + bitfield_unit_val | mIsAutoArray } } pub type nscoord = i32; @@ -13561,7 +13731,7 @@ pub mod root { #[derive(Debug)] pub struct gfxFontFeatureValueSet_ValueList { pub name: ::nsstring::nsStringRepr, - pub featureSelectors: root::nsTArray<::std::os::raw::c_uint>, + pub featureSelectors: root::nsTArray, } #[test] fn bindgen_test_layout_gfxFontFeatureValueSet_ValueList() { @@ -13666,7 +13836,7 @@ pub mod root { pub struct gfxFontFeatureValueSet_FeatureValueHashEntry { pub _base: root::PLDHashEntryHdr, pub mKey: root::gfxFontFeatureValueSet_FeatureValueHashKey, - pub mValues: root::nsTArray<::std::os::raw::c_uint>, + pub mValues: root::nsTArray, } pub type gfxFontFeatureValueSet_FeatureValueHashEntry_KeyType = *const root::gfxFontFeatureValueSet_FeatureValueHashKey; @@ -13769,7 +13939,7 @@ pub mod root { pub alternateValues: root::nsTArray, pub featureValueLookup: root::RefPtr, pub fontFeatureSettings: root::nsTArray, - pub fontVariationSettings: root::nsTArray, + pub fontVariationSettings: root::nsTArray, pub languageOverride: u32, } #[test] @@ -14282,6 +14452,28 @@ pub mod root { #[inline] fn bitor(self, other: Self) -> Self { nsChangeHint(self.0 | other.0) } } + impl ::std::ops::BitOrAssign for root::nsChangeHint { + #[inline] + fn bitor_assign(&mut self, rhs: root::nsChangeHint) { + self.0 |= rhs.0; + } + } + impl ::std::ops::BitAnd for root::nsChangeHint { + type + Output + = + Self; + #[inline] + fn bitand(self, other: Self) -> Self { + nsChangeHint(self.0 & other.0) + } + } + impl ::std::ops::BitAndAssign for root::nsChangeHint { + #[inline] + fn bitand_assign(&mut self, rhs: root::nsChangeHint) { + self.0 &= rhs.0; + } + } #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub struct nsChangeHint(pub u32); @@ -14319,6 +14511,28 @@ pub mod root { nsRestyleHint(self.0 | other.0) } } + impl ::std::ops::BitOrAssign for root::nsRestyleHint { + #[inline] + fn bitor_assign(&mut self, rhs: root::nsRestyleHint) { + self.0 |= rhs.0; + } + } + impl ::std::ops::BitAnd for root::nsRestyleHint { + type + Output + = + Self; + #[inline] + fn bitand(self, other: Self) -> Self { + nsRestyleHint(self.0 & other.0) + } + } + impl ::std::ops::BitAndAssign for root::nsRestyleHint { + #[inline] + fn bitand_assign(&mut self, rhs: root::nsRestyleHint) { + self.0 &= rhs.0; + } + } #[repr(C)] /** * |nsRestyleHint| is a bitfield for the result of @@ -14405,7 +14619,7 @@ pub mod root { * count is 1. */ #[repr(C)] - #[derive(Debug, Copy)] + #[derive(Debug)] pub struct nsStringBuffer { pub mRefCount: u32, pub mStorageSize: u32, @@ -14427,9 +14641,6 @@ pub mod root { "Alignment of field: " , stringify ! ( nsStringBuffer ) , "::" , stringify ! ( mStorageSize ) )); } - impl Clone for nsStringBuffer { - fn clone(&self) -> Self { *self } - } #[repr(C)] #[derive(Debug, Copy)] pub struct nsIAtom { @@ -14472,38 +14683,55 @@ pub mod root { #[inline] pub fn mLength(&self) -> u32 { let mask = 2147483647usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mLength(&mut self, val: u32) { let mask = 2147483647usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsStatic(&self) -> u32 { let mask = 2147483648usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 31usize; + let val = (unit_field_val & mask) >> 31usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mIsStatic(&mut self, val: u32) { let mask = 2147483648usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 31usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 31usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mLength: u32, mIsStatic: u32) -> u32 { + let bitfield_unit_val = + { + let bitfield_unit_val = { 0 }; + let mLength = mLength as u32 as u32; + let mask = 2147483647usize as u32; + let mLength = (mLength << 0usize) & mask; + bitfield_unit_val | mLength + }; + let mIsStatic = mIsStatic as u32 as u32; + let mask = 2147483648usize as u32; + let mIsStatic = (mIsStatic << 31usize) & mask; + bitfield_unit_val | mIsStatic } } #[repr(C)] @@ -15277,20 +15505,29 @@ pub mod root { #[inline] pub fn ownsMessage_(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_ownsMessage_(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(ownsMessage_: bool) -> u8 { + let bitfield_unit_val = { 0 }; + let ownsMessage_ = ownsMessage_ as u8 as u8; + let mask = 1usize as u8; + let ownsMessage_ = (ownsMessage_ << 0usize) & mask; + bitfield_unit_val | ownsMessage_ } } /** @@ -16145,7 +16382,7 @@ pub mod root { */ pub mFrameRequestCallbackCounter: i32, pub mStaticCloneCount: u32, - pub mBlockedTrackingNodes: root::nsTArray, + pub mBlockedTrackingNodes: root::nsTArray, pub mWindow: *mut root::nsPIDOMWindowInner, pub mCachedEncoder: root::nsCOMPtr, pub mFrameRequestCallbacks: root::nsTArray, @@ -16452,812 +16689,1440 @@ pub mod root { #[inline] pub fn mBidiEnabled(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mBidiEnabled(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mMathMLEnabled(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mMathMLEnabled(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsInitialDocumentInWindow(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsInitialDocumentInWindow(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIgnoreDocGroupMismatches(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIgnoreDocGroupMismatches(&mut self, val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mLoadedAsData(&self) -> bool { let mask = 16usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mLoadedAsData(&mut self, val: bool) { let mask = 16usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mLoadedAsInteractiveData(&self) -> bool { let mask = 32usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 5usize; + let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mLoadedAsInteractiveData(&mut self, val: bool) { let mask = 32usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 5usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mMayStartLayout(&self) -> bool { let mask = 64usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 6usize; + let val = (unit_field_val & mask) >> 6usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mMayStartLayout(&mut self, val: bool) { let mask = 64usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 6usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHaveFiredTitleChange(&self) -> bool { let mask = 128usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 7usize; + let val = (unit_field_val & mask) >> 7usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHaveFiredTitleChange(&mut self, val: bool) { let mask = 128usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 7usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 7usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mBidiEnabled: bool, mMathMLEnabled: bool, + mIsInitialDocumentInWindow: bool, + mIgnoreDocGroupMismatches: bool, + mLoadedAsData: bool, + mLoadedAsInteractiveData: bool, + mMayStartLayout: bool, + mHaveFiredTitleChange: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { 0 }; + let mBidiEnabled = + mBidiEnabled + as + u8 + as + u8; + let mask = + 1usize + as + u8; + let mBidiEnabled = + (mBidiEnabled + << + 0usize) + & + mask; + bitfield_unit_val + | + mBidiEnabled + }; + let mMathMLEnabled = + mMathMLEnabled + as u8 as + u8; + let mask = + 2usize as u8; + let mMathMLEnabled = + (mMathMLEnabled + << + 1usize) & + mask; + bitfield_unit_val + | + mMathMLEnabled + }; + let mIsInitialDocumentInWindow = + mIsInitialDocumentInWindow + as u8 as u8; + let mask = 4usize as u8; + let mIsInitialDocumentInWindow = + (mIsInitialDocumentInWindow + << 2usize) & + mask; + bitfield_unit_val | + mIsInitialDocumentInWindow + }; + let mIgnoreDocGroupMismatches = + mIgnoreDocGroupMismatches as + u8 as u8; + let mask = 8usize as u8; + let mIgnoreDocGroupMismatches = + (mIgnoreDocGroupMismatches << + 3usize) & mask; + bitfield_unit_val | + mIgnoreDocGroupMismatches + }; + let mLoadedAsData = + mLoadedAsData as u8 as u8; + let mask = 16usize as u8; + let mLoadedAsData = + (mLoadedAsData << 4usize) & mask; + bitfield_unit_val | mLoadedAsData + }; + let mLoadedAsInteractiveData = + mLoadedAsInteractiveData as u8 as u8; + let mask = 32usize as u8; + let mLoadedAsInteractiveData = + (mLoadedAsInteractiveData << 5usize) & mask; + bitfield_unit_val | mLoadedAsInteractiveData + }; + let mMayStartLayout = mMayStartLayout as u8 as u8; + let mask = 64usize as u8; + let mMayStartLayout = (mMayStartLayout << 6usize) & mask; + bitfield_unit_val | mMayStartLayout + }; + let mHaveFiredTitleChange = mHaveFiredTitleChange as u8 as u8; + let mask = 128usize as u8; + let mHaveFiredTitleChange = + (mHaveFiredTitleChange << 7usize) & mask; + bitfield_unit_val | mHaveFiredTitleChange } #[inline] pub fn mIsShowing(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsShowing(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mVisible(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mVisible(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasReferrerPolicyCSP(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasReferrerPolicyCSP(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mRemovedFromDocShell(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mRemovedFromDocShell(&mut self, val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mAllowDNSPrefetch(&self) -> bool { let mask = 16usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mAllowDNSPrefetch(&mut self, val: bool) { let mask = 16usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsStaticDocument(&self) -> bool { let mask = 32usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 5usize; + let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsStaticDocument(&mut self, val: bool) { let mask = 32usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 5usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mCreatingStaticClone(&self) -> bool { let mask = 64usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 6usize; + let val = (unit_field_val & mask) >> 6usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mCreatingStaticClone(&mut self, val: bool) { let mask = 64usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 6usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mInUnlinkOrDeletion(&self) -> bool { let mask = 128usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 7usize; + let val = (unit_field_val & mask) >> 7usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mInUnlinkOrDeletion(&mut self, val: bool) { let mask = 128usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 7usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 7usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_2(mIsShowing: bool, mVisible: bool, + mHasReferrerPolicyCSP: bool, + mRemovedFromDocShell: bool, + mAllowDNSPrefetch: bool, + mIsStaticDocument: bool, + mCreatingStaticClone: bool, + mInUnlinkOrDeletion: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { 0 }; + let mIsShowing = + mIsShowing + as + u8 + as + u8; + let mask = + 1usize + as + u8; + let mIsShowing = + (mIsShowing + << + 0usize) + & + mask; + bitfield_unit_val + | + mIsShowing + }; + let mVisible = + mVisible as u8 + as u8; + let mask = + 2usize as u8; + let mVisible = + (mVisible << + 1usize) & + mask; + bitfield_unit_val + | mVisible + }; + let mHasReferrerPolicyCSP = + mHasReferrerPolicyCSP + as u8 as u8; + let mask = 4usize as u8; + let mHasReferrerPolicyCSP = + (mHasReferrerPolicyCSP + << 2usize) & + mask; + bitfield_unit_val | + mHasReferrerPolicyCSP + }; + let mRemovedFromDocShell = + mRemovedFromDocShell as u8 as + u8; + let mask = 8usize as u8; + let mRemovedFromDocShell = + (mRemovedFromDocShell << + 3usize) & mask; + bitfield_unit_val | + mRemovedFromDocShell + }; + let mAllowDNSPrefetch = + mAllowDNSPrefetch as u8 as u8; + let mask = 16usize as u8; + let mAllowDNSPrefetch = + (mAllowDNSPrefetch << 4usize) & mask; + bitfield_unit_val | mAllowDNSPrefetch + }; + let mIsStaticDocument = + mIsStaticDocument as u8 as u8; + let mask = 32usize as u8; + let mIsStaticDocument = + (mIsStaticDocument << 5usize) & mask; + bitfield_unit_val | mIsStaticDocument + }; + let mCreatingStaticClone = + mCreatingStaticClone as u8 as u8; + let mask = 64usize as u8; + let mCreatingStaticClone = + (mCreatingStaticClone << 6usize) & mask; + bitfield_unit_val | mCreatingStaticClone + }; + let mInUnlinkOrDeletion = mInUnlinkOrDeletion as u8 as u8; + let mask = 128usize as u8; + let mInUnlinkOrDeletion = (mInUnlinkOrDeletion << 7usize) & mask; + bitfield_unit_val | mInUnlinkOrDeletion } #[inline] pub fn mHasHadScriptHandlingObject(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasHadScriptHandlingObject(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_3 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_3 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsBeingUsedAsImage(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsBeingUsedAsImage(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_3 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_3 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsSyntheticDocument(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsSyntheticDocument(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_3 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_3 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasLinksToUpdate(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasLinksToUpdate(&mut self, val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_3 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_3 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasLinksToUpdateRunnable(&self) -> bool { let mask = 16usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasLinksToUpdateRunnable(&mut self, val: bool) { let mask = 16usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_3 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_3 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mMayHaveDOMMutationObservers(&self) -> bool { let mask = 32usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - let val = (field_val & mask) >> 5usize; + let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mMayHaveDOMMutationObservers(&mut self, val: bool) { let mask = 32usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - field_val &= !mask; - field_val |= (val << 5usize) & mask; - self._bitfield_3 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + self._bitfield_3 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mMayHaveAnimationObservers(&self) -> bool { let mask = 64usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - let val = (field_val & mask) >> 6usize; + let val = (unit_field_val & mask) >> 6usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mMayHaveAnimationObservers(&mut self, val: bool) { let mask = 64usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - field_val &= !mask; - field_val |= (val << 6usize) & mask; - self._bitfield_3 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + self._bitfield_3 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasMixedActiveContentLoaded(&self) -> bool { let mask = 128usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - let val = (field_val & mask) >> 7usize; + let val = (unit_field_val & mask) >> 7usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasMixedActiveContentLoaded(&mut self, val: bool) { let mask = 128usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - field_val &= !mask; - field_val |= (val << 7usize) & mask; - self._bitfield_3 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 7usize) & mask; + self._bitfield_3 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_3(mHasHadScriptHandlingObject: bool, + mIsBeingUsedAsImage: bool, + mIsSyntheticDocument: bool, + mHasLinksToUpdate: bool, + mHasLinksToUpdateRunnable: bool, + mMayHaveDOMMutationObservers: bool, + mMayHaveAnimationObservers: bool, + mHasMixedActiveContentLoaded: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { 0 }; + let mHasHadScriptHandlingObject = + mHasHadScriptHandlingObject + as + u8 + as + u8; + let mask = + 1usize + as + u8; + let mHasHadScriptHandlingObject = + (mHasHadScriptHandlingObject + << + 0usize) + & + mask; + bitfield_unit_val + | + mHasHadScriptHandlingObject + }; + let mIsBeingUsedAsImage = + mIsBeingUsedAsImage + as u8 as + u8; + let mask = + 2usize as u8; + let mIsBeingUsedAsImage = + (mIsBeingUsedAsImage + << + 1usize) & + mask; + bitfield_unit_val + | + mIsBeingUsedAsImage + }; + let mIsSyntheticDocument = + mIsSyntheticDocument + as u8 as u8; + let mask = 4usize as u8; + let mIsSyntheticDocument = + (mIsSyntheticDocument + << 2usize) & + mask; + bitfield_unit_val | + mIsSyntheticDocument + }; + let mHasLinksToUpdate = + mHasLinksToUpdate as u8 as u8; + let mask = 8usize as u8; + let mHasLinksToUpdate = + (mHasLinksToUpdate << 3usize) + & mask; + bitfield_unit_val | + mHasLinksToUpdate + }; + let mHasLinksToUpdateRunnable = + mHasLinksToUpdateRunnable as u8 as u8; + let mask = 16usize as u8; + let mHasLinksToUpdateRunnable = + (mHasLinksToUpdateRunnable << 4usize) + & mask; + bitfield_unit_val | + mHasLinksToUpdateRunnable + }; + let mMayHaveDOMMutationObservers = + mMayHaveDOMMutationObservers as u8 as u8; + let mask = 32usize as u8; + let mMayHaveDOMMutationObservers = + (mMayHaveDOMMutationObservers << 5usize) & + mask; + bitfield_unit_val | mMayHaveDOMMutationObservers + }; + let mMayHaveAnimationObservers = + mMayHaveAnimationObservers as u8 as u8; + let mask = 64usize as u8; + let mMayHaveAnimationObservers = + (mMayHaveAnimationObservers << 6usize) & mask; + bitfield_unit_val | mMayHaveAnimationObservers + }; + let mHasMixedActiveContentLoaded = + mHasMixedActiveContentLoaded as u8 as u8; + let mask = 128usize as u8; + let mHasMixedActiveContentLoaded = + (mHasMixedActiveContentLoaded << 7usize) & mask; + bitfield_unit_val | mHasMixedActiveContentLoaded } #[inline] pub fn mHasMixedActiveContentBlocked(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasMixedActiveContentBlocked(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_4 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_4 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasMixedDisplayContentLoaded(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasMixedDisplayContentLoaded(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_4 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_4 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasMixedDisplayContentBlocked(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasMixedDisplayContentBlocked(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_4 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_4 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasMixedContentObjectSubrequest(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasMixedContentObjectSubrequest(&mut self, val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_4 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_4 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasCSP(&self) -> bool { let mask = 16usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasCSP(&mut self, val: bool) { let mask = 16usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_4 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_4 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasUnsafeEvalCSP(&self) -> bool { let mask = 32usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - let val = (field_val & mask) >> 5usize; + let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasUnsafeEvalCSP(&mut self, val: bool) { let mask = 32usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - field_val &= !mask; - field_val |= (val << 5usize) & mask; - self._bitfield_4 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + self._bitfield_4 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasUnsafeInlineCSP(&self) -> bool { let mask = 64usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - let val = (field_val & mask) >> 6usize; + let val = (unit_field_val & mask) >> 6usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasUnsafeInlineCSP(&mut self, val: bool) { let mask = 64usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - field_val &= !mask; - field_val |= (val << 6usize) & mask; - self._bitfield_4 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + self._bitfield_4 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasTrackingContentBlocked(&self) -> bool { let mask = 128usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - let val = (field_val & mask) >> 7usize; + let val = (unit_field_val & mask) >> 7usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasTrackingContentBlocked(&mut self, val: bool) { let mask = 128usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_4) }; - field_val &= !mask; - field_val |= (val << 7usize) & mask; - self._bitfield_4 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 7usize) & mask; + self._bitfield_4 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_4(mHasMixedActiveContentBlocked: bool, + mHasMixedDisplayContentLoaded: bool, + mHasMixedDisplayContentBlocked: bool, + mHasMixedContentObjectSubrequest: bool, + mHasCSP: bool, mHasUnsafeEvalCSP: bool, + mHasUnsafeInlineCSP: bool, + mHasTrackingContentBlocked: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { 0 }; + let mHasMixedActiveContentBlocked = + mHasMixedActiveContentBlocked + as + u8 + as + u8; + let mask = + 1usize + as + u8; + let mHasMixedActiveContentBlocked = + (mHasMixedActiveContentBlocked + << + 0usize) + & + mask; + bitfield_unit_val + | + mHasMixedActiveContentBlocked + }; + let mHasMixedDisplayContentLoaded = + mHasMixedDisplayContentLoaded + as u8 as + u8; + let mask = + 2usize as u8; + let mHasMixedDisplayContentLoaded = + (mHasMixedDisplayContentLoaded + << + 1usize) & + mask; + bitfield_unit_val + | + mHasMixedDisplayContentLoaded + }; + let mHasMixedDisplayContentBlocked = + mHasMixedDisplayContentBlocked + as u8 as u8; + let mask = 4usize as u8; + let mHasMixedDisplayContentBlocked = + (mHasMixedDisplayContentBlocked + << 2usize) & + mask; + bitfield_unit_val | + mHasMixedDisplayContentBlocked + }; + let mHasMixedContentObjectSubrequest = + mHasMixedContentObjectSubrequest + as u8 as u8; + let mask = 8usize as u8; + let mHasMixedContentObjectSubrequest = + (mHasMixedContentObjectSubrequest + << 3usize) & mask; + bitfield_unit_val | + mHasMixedContentObjectSubrequest + }; + let mHasCSP = mHasCSP as u8 as u8; + let mask = 16usize as u8; + let mHasCSP = (mHasCSP << 4usize) & mask; + bitfield_unit_val | mHasCSP + }; + let mHasUnsafeEvalCSP = + mHasUnsafeEvalCSP as u8 as u8; + let mask = 32usize as u8; + let mHasUnsafeEvalCSP = + (mHasUnsafeEvalCSP << 5usize) & mask; + bitfield_unit_val | mHasUnsafeEvalCSP + }; + let mHasUnsafeInlineCSP = mHasUnsafeInlineCSP as u8 as u8; + let mask = 64usize as u8; + let mHasUnsafeInlineCSP = + (mHasUnsafeInlineCSP << 6usize) & mask; + bitfield_unit_val | mHasUnsafeInlineCSP + }; + let mHasTrackingContentBlocked = + mHasTrackingContentBlocked as u8 as u8; + let mask = 128usize as u8; + let mHasTrackingContentBlocked = + (mHasTrackingContentBlocked << 7usize) & mask; + bitfield_unit_val | mHasTrackingContentBlocked } #[inline] pub fn mHasTrackingContentLoaded(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasTrackingContentLoaded(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_5 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_5 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mBFCacheDisallowed(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mBFCacheDisallowed(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_5 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_5 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasHadDefaultView(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasHadDefaultView(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_5 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_5 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mStyleSheetChangeEventsEnabled(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mStyleSheetChangeEventsEnabled(&mut self, val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_5 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_5 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsSrcdocDocument(&self) -> bool { let mask = 16usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsSrcdocDocument(&mut self, val: bool) { let mask = 16usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_5 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_5 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mDidDocumentOpen(&self) -> bool { let mask = 32usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - let val = (field_val & mask) >> 5usize; + let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mDidDocumentOpen(&mut self, val: bool) { let mask = 32usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - field_val &= !mask; - field_val |= (val << 5usize) & mask; - self._bitfield_5 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + self._bitfield_5 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasDisplayDocument(&self) -> bool { let mask = 64usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - let val = (field_val & mask) >> 6usize; + let val = (unit_field_val & mask) >> 6usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasDisplayDocument(&mut self, val: bool) { let mask = 64usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - field_val &= !mask; - field_val |= (val << 6usize) & mask; - self._bitfield_5 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + self._bitfield_5 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mFontFaceSetDirty(&self) -> bool { let mask = 128usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - let val = (field_val & mask) >> 7usize; + let val = (unit_field_val & mask) >> 7usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mFontFaceSetDirty(&mut self, val: bool) { let mask = 128usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_5) }; - field_val &= !mask; - field_val |= (val << 7usize) & mask; - self._bitfield_5 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 7usize) & mask; + self._bitfield_5 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_5(mHasTrackingContentLoaded: bool, + mBFCacheDisallowed: bool, + mHasHadDefaultView: bool, + mStyleSheetChangeEventsEnabled: bool, + mIsSrcdocDocument: bool, mDidDocumentOpen: bool, + mHasDisplayDocument: bool, + mFontFaceSetDirty: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { 0 }; + let mHasTrackingContentLoaded = + mHasTrackingContentLoaded + as + u8 + as + u8; + let mask = + 1usize + as + u8; + let mHasTrackingContentLoaded = + (mHasTrackingContentLoaded + << + 0usize) + & + mask; + bitfield_unit_val + | + mHasTrackingContentLoaded + }; + let mBFCacheDisallowed = + mBFCacheDisallowed + as u8 as + u8; + let mask = + 2usize as u8; + let mBFCacheDisallowed = + (mBFCacheDisallowed + << + 1usize) & + mask; + bitfield_unit_val + | + mBFCacheDisallowed + }; + let mHasHadDefaultView = + mHasHadDefaultView as + u8 as u8; + let mask = 4usize as u8; + let mHasHadDefaultView = + (mHasHadDefaultView << + 2usize) & mask; + bitfield_unit_val | + mHasHadDefaultView + }; + let mStyleSheetChangeEventsEnabled = + mStyleSheetChangeEventsEnabled + as u8 as u8; + let mask = 8usize as u8; + let mStyleSheetChangeEventsEnabled = + (mStyleSheetChangeEventsEnabled + << 3usize) & mask; + bitfield_unit_val | + mStyleSheetChangeEventsEnabled + }; + let mIsSrcdocDocument = + mIsSrcdocDocument as u8 as u8; + let mask = 16usize as u8; + let mIsSrcdocDocument = + (mIsSrcdocDocument << 4usize) & mask; + bitfield_unit_val | mIsSrcdocDocument + }; + let mDidDocumentOpen = + mDidDocumentOpen as u8 as u8; + let mask = 32usize as u8; + let mDidDocumentOpen = + (mDidDocumentOpen << 5usize) & mask; + bitfield_unit_val | mDidDocumentOpen + }; + let mHasDisplayDocument = mHasDisplayDocument as u8 as u8; + let mask = 64usize as u8; + let mHasDisplayDocument = + (mHasDisplayDocument << 6usize) & mask; + bitfield_unit_val | mHasDisplayDocument + }; + let mFontFaceSetDirty = mFontFaceSetDirty as u8 as u8; + let mask = 128usize as u8; + let mFontFaceSetDirty = (mFontFaceSetDirty << 7usize) & mask; + bitfield_unit_val | mFontFaceSetDirty } #[inline] pub fn mGetUserFontSetCalled(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_6) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mGetUserFontSetCalled(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_6) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_6 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_6 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPostedFlushUserFontSet(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_6) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mPostedFlushUserFontSet(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_6) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_6 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_6 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mDidFireDOMContentLoaded(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_6) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mDidFireDOMContentLoaded(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_6) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_6 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_6 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasScrollLinkedEffect(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_6) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHasScrollLinkedEffect(&mut self, val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_6) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_6 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_6 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mFrameRequestCallbacksScheduled(&self) -> bool { let mask = 16usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_6) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mFrameRequestCallbacksScheduled(&mut self, val: bool) { let mask = 16usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_6) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_6 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_6 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_6(mGetUserFontSetCalled: bool, + mPostedFlushUserFontSet: bool, + mDidFireDOMContentLoaded: bool, + mHasScrollLinkedEffect: bool, + mFrameRequestCallbacksScheduled: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = { 0 }; + let mGetUserFontSetCalled = + mGetUserFontSetCalled as u8 as + u8; + let mask = 1usize as u8; + let mGetUserFontSetCalled = + (mGetUserFontSetCalled << + 0usize) & mask; + bitfield_unit_val | + mGetUserFontSetCalled + }; + let mPostedFlushUserFontSet = + mPostedFlushUserFontSet as u8 as u8; + let mask = 2usize as u8; + let mPostedFlushUserFontSet = + (mPostedFlushUserFontSet << 1usize) & + mask; + bitfield_unit_val | + mPostedFlushUserFontSet + }; + let mDidFireDOMContentLoaded = + mDidFireDOMContentLoaded as u8 as u8; + let mask = 4usize as u8; + let mDidFireDOMContentLoaded = + (mDidFireDOMContentLoaded << 2usize) & mask; + bitfield_unit_val | mDidFireDOMContentLoaded + }; + let mHasScrollLinkedEffect = + mHasScrollLinkedEffect as u8 as u8; + let mask = 8usize as u8; + let mHasScrollLinkedEffect = + (mHasScrollLinkedEffect << 3usize) & mask; + bitfield_unit_val | mHasScrollLinkedEffect + }; + let mFrameRequestCallbacksScheduled = + mFrameRequestCallbacksScheduled as u8 as u8; + let mask = 16usize as u8; + let mFrameRequestCallbacksScheduled = + (mFrameRequestCallbacksScheduled << 4usize) & mask; + bitfield_unit_val | mFrameRequestCallbacksScheduled } } #[repr(C)] @@ -17468,6 +18333,8 @@ pub mod root { pub mImageAnimationMode: u16, pub mImageAnimationModePref: u16, pub mLangGroupFontPrefs: root::nsPresContext_LangGroupFontPrefs, + pub mFontGroupCacheDirty: bool, + pub mLanguagesUsed: [u64; 5usize], pub mBorderWidthTable: [root::nscoord; 3usize], pub mInterruptChecksToSkip: u32, pub mElementsRestyled: u64, @@ -17611,7 +18478,7 @@ pub mod root { } #[test] fn bindgen_test_layout_nsPresContext() { - assert_eq!(::std::mem::size_of::() , 1312usize , concat + assert_eq!(::std::mem::size_of::() , 1360usize , concat ! ( "Size of: " , stringify ! ( nsPresContext ) )); assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( nsPresContext ) )); @@ -17905,93 +18772,104 @@ pub mod root { concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mLangGroupFontPrefs ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsPresContext ) ) . + mFontGroupCacheDirty as * const _ as usize } , 1184usize , + concat ! ( + "Alignment of field: " , stringify ! ( nsPresContext ) , + "::" , stringify ! ( mFontGroupCacheDirty ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsPresContext ) ) . mLanguagesUsed as + * const _ as usize } , 1192usize , concat ! ( + "Alignment of field: " , stringify ! ( nsPresContext ) , + "::" , stringify ! ( mLanguagesUsed ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mBorderWidthTable - as * const _ as usize } , 1184usize , concat ! ( + as * const _ as usize } , 1232usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mBorderWidthTable ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mInterruptChecksToSkip as * const _ as usize } , 1196usize + mInterruptChecksToSkip as * const _ as usize } , 1244usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mInterruptChecksToSkip ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mElementsRestyled - as * const _ as usize } , 1200usize , concat ! ( + as * const _ as usize } , 1248usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mElementsRestyled ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mFramesConstructed as * const _ as usize } , 1208usize , + mFramesConstructed as * const _ as usize } , 1256usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFramesConstructed ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFramesReflowed - as * const _ as usize } , 1216usize , concat ! ( + as * const _ as usize } , 1264usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFramesReflowed ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mReflowStartTime - as * const _ as usize } , 1224usize , concat ! ( + as * const _ as usize } , 1272usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mReflowStartTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFirstNonBlankPaintTime as * const _ as usize } , - 1232usize , concat ! ( + 1280usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFirstNonBlankPaintTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFirstClickTime - as * const _ as usize } , 1240usize , concat ! ( + as * const _ as usize } , 1288usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFirstClickTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFirstKeyTime as - * const _ as usize } , 1248usize , concat ! ( + * const _ as usize } , 1296usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFirstKeyTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mFirstMouseMoveTime as * const _ as usize } , 1256usize , + mFirstMouseMoveTime as * const _ as usize } , 1304usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFirstMouseMoveTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFirstScrollTime - as * const _ as usize } , 1264usize , concat ! ( + as * const _ as usize } , 1312usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFirstScrollTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mInteractionTimeEnabled as * const _ as usize } , - 1272usize , concat ! ( + 1320usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mInteractionTimeEnabled ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mLastStyleUpdateForAllAnimations as * const _ as usize } , - 1280usize , concat ! ( + 1328usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mLastStyleUpdateForAllAnimations ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mTelemetryScrollLastY as * const _ as usize } , 1288usize + mTelemetryScrollLastY as * const _ as usize } , 1336usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mTelemetryScrollLastY ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mTelemetryScrollMaxY as * const _ as usize } , 1292usize , + mTelemetryScrollMaxY as * const _ as usize } , 1340usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mTelemetryScrollMaxY ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mTelemetryScrollTotalY as * const _ as usize } , 1296usize + mTelemetryScrollTotalY as * const _ as usize } , 1344usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mTelemetryScrollTotalY ) )); @@ -18000,9 +18878,9 @@ pub mod root { #[inline] pub fn mHasPendingInterrupt(&self) -> ::std::os::raw::c_uint { let mask = 1usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18010,18 +18888,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 1usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPendingInterruptFromTest(&self) -> ::std::os::raw::c_uint { let mask = 2usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18029,18 +18908,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 2usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mInterruptsEnabled(&self) -> ::std::os::raw::c_uint { let mask = 4usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18048,36 +18928,38 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 4usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mUseDocumentFonts(&self) -> ::std::os::raw::c_uint { let mask = 8usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mUseDocumentFonts(&mut self, val: ::std::os::raw::c_uint) { let mask = 8usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mUseDocumentColors(&self) -> ::std::os::raw::c_uint { let mask = 16usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18085,36 +18967,38 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 16usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mUnderlineLinks(&self) -> ::std::os::raw::c_uint { let mask = 32usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 5usize; + let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mUnderlineLinks(&mut self, val: ::std::os::raw::c_uint) { let mask = 32usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 5usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mSendAfterPaintToContent(&self) -> ::std::os::raw::c_uint { let mask = 64usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 6usize; + let val = (unit_field_val & mask) >> 6usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18122,36 +19006,38 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 64usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 6usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mUseFocusColors(&self) -> ::std::os::raw::c_uint { let mask = 128usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 7usize; + let val = (unit_field_val & mask) >> 7usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mUseFocusColors(&mut self, val: ::std::os::raw::c_uint) { let mask = 128usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 7usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 7usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mFocusRingOnAnything(&self) -> ::std::os::raw::c_uint { let mask = 256usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 8usize; + let val = (unit_field_val & mask) >> 8usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18159,36 +19045,38 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 256usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 8usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 8usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mFocusRingStyle(&self) -> ::std::os::raw::c_uint { let mask = 512usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 9usize; + let val = (unit_field_val & mask) >> 9usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mFocusRingStyle(&mut self, val: ::std::os::raw::c_uint) { let mask = 512usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 9usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 9usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mDrawImageBackground(&self) -> ::std::os::raw::c_uint { let mask = 1024usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 10usize; + let val = (unit_field_val & mask) >> 10usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18196,18 +19084,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 1024usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 10usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 10usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mDrawColorBackground(&self) -> ::std::os::raw::c_uint { let mask = 2048usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 11usize; + let val = (unit_field_val & mask) >> 11usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18215,36 +19104,38 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 2048usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 11usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 11usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mNeverAnimate(&self) -> ::std::os::raw::c_uint { let mask = 4096usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 12usize; + let val = (unit_field_val & mask) >> 12usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mNeverAnimate(&mut self, val: ::std::os::raw::c_uint) { let mask = 4096usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 12usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 12usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsRenderingOnlySelection(&self) -> ::std::os::raw::c_uint { let mask = 8192usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 13usize; + let val = (unit_field_val & mask) >> 13usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18252,36 +19143,38 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 8192usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 13usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 13usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPaginated(&self) -> ::std::os::raw::c_uint { let mask = 16384usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 14usize; + let val = (unit_field_val & mask) >> 14usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mPaginated(&mut self, val: ::std::os::raw::c_uint) { let mask = 16384usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 14usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 14usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mCanPaginatedScroll(&self) -> ::std::os::raw::c_uint { let mask = 32768usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 15usize; + let val = (unit_field_val & mask) >> 15usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18289,36 +19182,38 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 32768usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 15usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 15usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mDoScaledTwips(&self) -> ::std::os::raw::c_uint { let mask = 65536usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 16usize; + let val = (unit_field_val & mask) >> 16usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mDoScaledTwips(&mut self, val: ::std::os::raw::c_uint) { let mask = 65536usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 16usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 16usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsRootPaginatedDocument(&self) -> ::std::os::raw::c_uint { let mask = 131072usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 17usize; + let val = (unit_field_val & mask) >> 17usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18326,18 +19221,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 131072usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 17usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 17usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPrefBidiDirection(&self) -> ::std::os::raw::c_uint { let mask = 262144usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 18usize; + let val = (unit_field_val & mask) >> 18usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18345,18 +19241,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 262144usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 18usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 18usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPrefScrollbarSide(&self) -> ::std::os::raw::c_uint { let mask = 1572864usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 19usize; + let val = (unit_field_val & mask) >> 19usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18364,18 +19261,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 1572864usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 19usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 19usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPendingSysColorChanged(&self) -> ::std::os::raw::c_uint { let mask = 2097152usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 21usize; + let val = (unit_field_val & mask) >> 21usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18383,18 +19281,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 2097152usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 21usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 21usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPendingThemeChanged(&self) -> ::std::os::raw::c_uint { let mask = 4194304usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 22usize; + let val = (unit_field_val & mask) >> 22usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18402,18 +19301,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 4194304usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 22usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 22usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPendingUIResolutionChanged(&self) -> ::std::os::raw::c_uint { let mask = 8388608usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 23usize; + let val = (unit_field_val & mask) >> 23usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18421,19 +19321,20 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 8388608usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 23usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 23usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPendingMediaFeatureValuesChanged(&self) -> ::std::os::raw::c_uint { let mask = 16777216usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 24usize; + let val = (unit_field_val & mask) >> 24usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18442,19 +19343,20 @@ pub mod root { ::std::os::raw::c_uint) { let mask = 16777216usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 24usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 24usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPrefChangePendingNeedsReflow(&self) -> ::std::os::raw::c_uint { let mask = 33554432usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 25usize; + let val = (unit_field_val & mask) >> 25usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18463,90 +19365,95 @@ pub mod root { ::std::os::raw::c_uint) { let mask = 33554432usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 25usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 25usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsEmulatingMedia(&self) -> ::std::os::raw::c_uint { let mask = 67108864usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 26usize; + let val = (unit_field_val & mask) >> 26usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mIsEmulatingMedia(&mut self, val: ::std::os::raw::c_uint) { let mask = 67108864usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 26usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 26usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsGlyph(&self) -> ::std::os::raw::c_uint { let mask = 134217728usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 27usize; + let val = (unit_field_val & mask) >> 27usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mIsGlyph(&mut self, val: ::std::os::raw::c_uint) { let mask = 134217728usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 27usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 27usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mUsesRootEMUnits(&self) -> ::std::os::raw::c_uint { let mask = 268435456usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 28usize; + let val = (unit_field_val & mask) >> 28usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mUsesRootEMUnits(&mut self, val: ::std::os::raw::c_uint) { let mask = 268435456usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 28usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 28usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mUsesExChUnits(&self) -> ::std::os::raw::c_uint { let mask = 536870912usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 29usize; + let val = (unit_field_val & mask) >> 29usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mUsesExChUnits(&mut self, val: ::std::os::raw::c_uint) { let mask = 536870912usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 29usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 29usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mUsesViewportUnits(&self) -> ::std::os::raw::c_uint { let mask = 1073741824usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 30usize; + let val = (unit_field_val & mask) >> 30usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18554,18 +19461,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 1073741824usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 30usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 30usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPendingViewportChange(&self) -> ::std::os::raw::c_uint { let mask = 2147483648usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 31usize; + let val = (unit_field_val & mask) >> 31usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18573,18 +19481,662 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 2147483648usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 31usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 31usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mHasPendingInterrupt: ::std::os::raw::c_uint, + mPendingInterruptFromTest: + ::std::os::raw::c_uint, + mInterruptsEnabled: ::std::os::raw::c_uint, + mUseDocumentFonts: ::std::os::raw::c_uint, + mUseDocumentColors: ::std::os::raw::c_uint, + mUnderlineLinks: ::std::os::raw::c_uint, + mSendAfterPaintToContent: + ::std::os::raw::c_uint, + mUseFocusColors: ::std::os::raw::c_uint, + mFocusRingOnAnything: ::std::os::raw::c_uint, + mFocusRingStyle: ::std::os::raw::c_uint, + mDrawImageBackground: ::std::os::raw::c_uint, + mDrawColorBackground: ::std::os::raw::c_uint, + mNeverAnimate: ::std::os::raw::c_uint, + mIsRenderingOnlySelection: + ::std::os::raw::c_uint, + mPaginated: ::std::os::raw::c_uint, + mCanPaginatedScroll: ::std::os::raw::c_uint, + mDoScaledTwips: ::std::os::raw::c_uint, + mIsRootPaginatedDocument: + ::std::os::raw::c_uint, + mPrefBidiDirection: ::std::os::raw::c_uint, + mPrefScrollbarSide: ::std::os::raw::c_uint, + mPendingSysColorChanged: ::std::os::raw::c_uint, + mPendingThemeChanged: ::std::os::raw::c_uint, + mPendingUIResolutionChanged: + ::std::os::raw::c_uint, + mPendingMediaFeatureValuesChanged: + ::std::os::raw::c_uint, + mPrefChangePendingNeedsReflow: + ::std::os::raw::c_uint, + mIsEmulatingMedia: ::std::os::raw::c_uint, + mIsGlyph: ::std::os::raw::c_uint, + mUsesRootEMUnits: ::std::os::raw::c_uint, + mUsesExChUnits: ::std::os::raw::c_uint, + mUsesViewportUnits: ::std::os::raw::c_uint, + mPendingViewportChange: ::std::os::raw::c_uint) + -> u32 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + 0 + }; + let mHasPendingInterrupt = + mHasPendingInterrupt + as + u32 + as + u32; + let mask = + 1usize + as + u32; + let mHasPendingInterrupt = + (mHasPendingInterrupt + << + 0usize) + & + mask; + bitfield_unit_val + | + mHasPendingInterrupt + }; + let mPendingInterruptFromTest = + mPendingInterruptFromTest + as + u32 + as + u32; + let mask = + 2usize + as + u32; + let mPendingInterruptFromTest = + (mPendingInterruptFromTest + << + 1usize) + & + mask; + bitfield_unit_val + | + mPendingInterruptFromTest + }; + let mInterruptsEnabled = + mInterruptsEnabled + as + u32 + as + u32; + let mask = + 4usize + as + u32; + let mInterruptsEnabled = + (mInterruptsEnabled + << + 2usize) + & + mask; + bitfield_unit_val + | + mInterruptsEnabled + }; + let mUseDocumentFonts = + mUseDocumentFonts + as + u32 + as + u32; + let mask = + 8usize + as + u32; + let mUseDocumentFonts = + (mUseDocumentFonts + << + 3usize) + & + mask; + bitfield_unit_val + | + mUseDocumentFonts + }; + let mUseDocumentColors = + mUseDocumentColors + as + u32 + as + u32; + let mask = + 16usize + as + u32; + let mUseDocumentColors = + (mUseDocumentColors + << + 4usize) + & + mask; + bitfield_unit_val + | + mUseDocumentColors + }; + let mUnderlineLinks = + mUnderlineLinks + as + u32 + as + u32; + let mask = + 32usize + as + u32; + let mUnderlineLinks = + (mUnderlineLinks + << + 5usize) + & + mask; + bitfield_unit_val + | + mUnderlineLinks + }; + let mSendAfterPaintToContent = + mSendAfterPaintToContent + as + u32 + as + u32; + let mask = + 64usize + as + u32; + let mSendAfterPaintToContent = + (mSendAfterPaintToContent + << + 6usize) + & + mask; + bitfield_unit_val + | + mSendAfterPaintToContent + }; + let mUseFocusColors = + mUseFocusColors + as + u32 + as + u32; + let mask = + 128usize + as + u32; + let mUseFocusColors = + (mUseFocusColors + << + 7usize) + & + mask; + bitfield_unit_val + | + mUseFocusColors + }; + let mFocusRingOnAnything = + mFocusRingOnAnything + as + u32 + as + u32; + let mask = + 256usize + as + u32; + let mFocusRingOnAnything = + (mFocusRingOnAnything + << + 8usize) + & + mask; + bitfield_unit_val + | + mFocusRingOnAnything + }; + let mFocusRingStyle = + mFocusRingStyle + as + u32 + as + u32; + let mask = + 512usize + as + u32; + let mFocusRingStyle = + (mFocusRingStyle + << + 9usize) + & + mask; + bitfield_unit_val + | + mFocusRingStyle + }; + let mDrawImageBackground = + mDrawImageBackground + as + u32 + as + u32; + let mask = + 1024usize + as + u32; + let mDrawImageBackground = + (mDrawImageBackground + << + 10usize) + & + mask; + bitfield_unit_val + | + mDrawImageBackground + }; + let mDrawColorBackground = + mDrawColorBackground + as + u32 + as + u32; + let mask = + 2048usize + as + u32; + let mDrawColorBackground = + (mDrawColorBackground + << + 11usize) + & + mask; + bitfield_unit_val + | + mDrawColorBackground + }; + let mNeverAnimate = + mNeverAnimate + as + u32 + as + u32; + let mask = + 4096usize + as + u32; + let mNeverAnimate = + (mNeverAnimate + << + 12usize) + & + mask; + bitfield_unit_val + | + mNeverAnimate + }; + let mIsRenderingOnlySelection = + mIsRenderingOnlySelection + as + u32 + as + u32; + let mask = + 8192usize + as + u32; + let mIsRenderingOnlySelection = + (mIsRenderingOnlySelection + << + 13usize) + & + mask; + bitfield_unit_val + | + mIsRenderingOnlySelection + }; + let mPaginated = + mPaginated + as + u32 + as + u32; + let mask = + 16384usize + as + u32; + let mPaginated = + (mPaginated + << + 14usize) + & + mask; + bitfield_unit_val + | + mPaginated + }; + let mCanPaginatedScroll = + mCanPaginatedScroll + as + u32 + as + u32; + let mask = + 32768usize + as + u32; + let mCanPaginatedScroll = + (mCanPaginatedScroll + << + 15usize) + & + mask; + bitfield_unit_val + | + mCanPaginatedScroll + }; + let mDoScaledTwips = + mDoScaledTwips + as + u32 + as + u32; + let mask = + 65536usize + as + u32; + let mDoScaledTwips = + (mDoScaledTwips + << + 16usize) + & + mask; + bitfield_unit_val + | + mDoScaledTwips + }; + let mIsRootPaginatedDocument = + mIsRootPaginatedDocument + as + u32 + as + u32; + let mask = + 131072usize + as + u32; + let mIsRootPaginatedDocument = + (mIsRootPaginatedDocument + << + 17usize) + & + mask; + bitfield_unit_val + | + mIsRootPaginatedDocument + }; + let mPrefBidiDirection = + mPrefBidiDirection + as + u32 + as + u32; + let mask = + 262144usize + as + u32; + let mPrefBidiDirection = + (mPrefBidiDirection + << + 18usize) + & + mask; + bitfield_unit_val + | + mPrefBidiDirection + }; + let mPrefScrollbarSide = + mPrefScrollbarSide + as + u32 + as + u32; + let mask = + 1572864usize + as + u32; + let mPrefScrollbarSide = + (mPrefScrollbarSide + << + 19usize) + & + mask; + bitfield_unit_val + | + mPrefScrollbarSide + }; + let mPendingSysColorChanged = + mPendingSysColorChanged + as + u32 + as + u32; + let mask = + 2097152usize + as + u32; + let mPendingSysColorChanged = + (mPendingSysColorChanged + << + 21usize) + & + mask; + bitfield_unit_val + | + mPendingSysColorChanged + }; + let mPendingThemeChanged = + mPendingThemeChanged + as + u32 + as + u32; + let mask = + 4194304usize + as + u32; + let mPendingThemeChanged = + (mPendingThemeChanged + << + 22usize) + & + mask; + bitfield_unit_val + | + mPendingThemeChanged + }; + let mPendingUIResolutionChanged = + mPendingUIResolutionChanged + as + u32 + as + u32; + let mask = + 8388608usize + as + u32; + let mPendingUIResolutionChanged = + (mPendingUIResolutionChanged + << + 23usize) + & + mask; + bitfield_unit_val + | + mPendingUIResolutionChanged + }; + let mPendingMediaFeatureValuesChanged = + mPendingMediaFeatureValuesChanged + as + u32 + as + u32; + let mask = + 16777216usize + as + u32; + let mPendingMediaFeatureValuesChanged = + (mPendingMediaFeatureValuesChanged + << + 24usize) + & + mask; + bitfield_unit_val + | + mPendingMediaFeatureValuesChanged + }; + let mPrefChangePendingNeedsReflow = + mPrefChangePendingNeedsReflow + as u32 as + u32; + let mask = + 33554432usize + as u32; + let mPrefChangePendingNeedsReflow = + (mPrefChangePendingNeedsReflow + << + 25usize) + & mask; + bitfield_unit_val + | + mPrefChangePendingNeedsReflow + }; + let mIsEmulatingMedia = + mIsEmulatingMedia as + u32 as u32; + let mask = + 67108864usize as u32; + let mIsEmulatingMedia = + (mIsEmulatingMedia << + 26usize) & mask; + bitfield_unit_val | + mIsEmulatingMedia + }; + let mIsGlyph = + mIsGlyph as u32 as u32; + let mask = 134217728usize as u32; + let mIsGlyph = + (mIsGlyph << 27usize) & mask; + bitfield_unit_val | mIsGlyph + }; + let mUsesRootEMUnits = + mUsesRootEMUnits as u32 as u32; + let mask = 268435456usize as u32; + let mUsesRootEMUnits = + (mUsesRootEMUnits << 28usize) & mask; + bitfield_unit_val | mUsesRootEMUnits + }; + let mUsesExChUnits = mUsesExChUnits as u32 as u32; + let mask = 536870912usize as u32; + let mUsesExChUnits = + (mUsesExChUnits << 29usize) & mask; + bitfield_unit_val | mUsesExChUnits + }; + let mUsesViewportUnits = mUsesViewportUnits as u32 as u32; + let mask = 1073741824usize as u32; + let mUsesViewportUnits = + (mUsesViewportUnits << 30usize) & mask; + bitfield_unit_val | mUsesViewportUnits + }; + let mPendingViewportChange = mPendingViewportChange as u32 as u32; + let mask = 2147483648usize as u32; + let mPendingViewportChange = + (mPendingViewportChange << 31usize) & mask; + bitfield_unit_val | mPendingViewportChange } #[inline] pub fn mCounterStylesDirty(&self) -> ::std::os::raw::c_uint { let mask = 1usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18592,18 +20144,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 1usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPostedFlushCounterStyles(&self) -> ::std::os::raw::c_uint { let mask = 2usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18611,18 +20164,19 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 2usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mSuppressResizeReflow(&self) -> ::std::os::raw::c_uint { let mask = 4usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18630,36 +20184,38 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 4usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsVisual(&self) -> ::std::os::raw::c_uint { let mask = 8usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mIsVisual(&mut self, val: ::std::os::raw::c_uint) { let mask = 8usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mFireAfterPaintEvents(&self) -> ::std::os::raw::c_uint { let mask = 16usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18667,36 +20223,38 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 16usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsChrome(&self) -> ::std::os::raw::c_uint { let mask = 32usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 5usize; + let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mIsChrome(&mut self, val: ::std::os::raw::c_uint) { let mask = 32usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 5usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsChromeOriginImage(&self) -> ::std::os::raw::c_uint { let mask = 64usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 6usize; + let val = (unit_field_val & mask) >> 6usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18704,36 +20262,38 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 64usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 6usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPaintFlashing(&self) -> ::std::os::raw::c_uint { let mask = 128usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 7usize; + let val = (unit_field_val & mask) >> 7usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mPaintFlashing(&mut self, val: ::std::os::raw::c_uint) { let mask = 128usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 7usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 7usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPaintFlashingInitialized(&self) -> ::std::os::raw::c_uint { let mask = 256usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 8usize; + let val = (unit_field_val & mask) >> 8usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18741,19 +20301,20 @@ pub mod root { val: ::std::os::raw::c_uint) { let mask = 256usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 8usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 8usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasWarnedAboutPositionedTableParts(&self) -> ::std::os::raw::c_uint { let mask = 512usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 9usize; + let val = (unit_field_val & mask) >> 9usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18762,19 +20323,20 @@ pub mod root { ::std::os::raw::c_uint) { let mask = 512usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 9usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 9usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHasWarnedAboutTooLargeDashedOrDottedRadius(&self) -> ::std::os::raw::c_uint { let mask = 1024usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 10usize; + let val = (unit_field_val & mask) >> 10usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] @@ -18783,65 +20345,325 @@ pub mod root { ::std::os::raw::c_uint) { let mask = 1024usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 10usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 10usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mQuirkSheetAdded(&self) -> ::std::os::raw::c_uint { let mask = 2048usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 11usize; + let val = (unit_field_val & mask) >> 11usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mQuirkSheetAdded(&mut self, val: ::std::os::raw::c_uint) { let mask = 2048usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 11usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 11usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mNeedsPrefUpdate(&self) -> ::std::os::raw::c_uint { let mask = 4096usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 12usize; + let val = (unit_field_val & mask) >> 12usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mNeedsPrefUpdate(&mut self, val: ::std::os::raw::c_uint) { let mask = 4096usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 12usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 12usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHadNonBlankPaint(&self) -> ::std::os::raw::c_uint { let mask = 8192usize as u16; - let field_val: u16 = + let unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 13usize; + let val = (unit_field_val & mask) >> 13usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mHadNonBlankPaint(&mut self, val: ::std::os::raw::c_uint) { let mask = 8192usize as u16; let val = val as u32 as u16; - let mut field_val: u16 = + let mut unit_field_val: u16 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 13usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 13usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_2(mCounterStylesDirty: ::std::os::raw::c_uint, + mPostedFlushCounterStyles: + ::std::os::raw::c_uint, + mSuppressResizeReflow: ::std::os::raw::c_uint, + mIsVisual: ::std::os::raw::c_uint, + mFireAfterPaintEvents: ::std::os::raw::c_uint, + mIsChrome: ::std::os::raw::c_uint, + mIsChromeOriginImage: ::std::os::raw::c_uint, + mPaintFlashing: ::std::os::raw::c_uint, + mPaintFlashingInitialized: + ::std::os::raw::c_uint, + mHasWarnedAboutPositionedTableParts: + ::std::os::raw::c_uint, + mHasWarnedAboutTooLargeDashedOrDottedRadius: + ::std::os::raw::c_uint, + mQuirkSheetAdded: ::std::os::raw::c_uint, + mNeedsPrefUpdate: ::std::os::raw::c_uint, + mHadNonBlankPaint: ::std::os::raw::c_uint) + -> u16 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + 0 + }; + let mCounterStylesDirty = + mCounterStylesDirty + as + u32 + as + u16; + let mask = + 1usize + as + u16; + let mCounterStylesDirty = + (mCounterStylesDirty + << + 0usize) + & + mask; + bitfield_unit_val + | + mCounterStylesDirty + }; + let mPostedFlushCounterStyles = + mPostedFlushCounterStyles + as + u32 + as + u16; + let mask = + 2usize + as + u16; + let mPostedFlushCounterStyles = + (mPostedFlushCounterStyles + << + 1usize) + & + mask; + bitfield_unit_val + | + mPostedFlushCounterStyles + }; + let mSuppressResizeReflow = + mSuppressResizeReflow + as + u32 + as + u16; + let mask = + 4usize + as + u16; + let mSuppressResizeReflow = + (mSuppressResizeReflow + << + 2usize) + & + mask; + bitfield_unit_val + | + mSuppressResizeReflow + }; + let mIsVisual = + mIsVisual + as + u32 + as + u16; + let mask = + 8usize + as + u16; + let mIsVisual = + (mIsVisual + << + 3usize) + & + mask; + bitfield_unit_val + | + mIsVisual + }; + let mFireAfterPaintEvents = + mFireAfterPaintEvents + as + u32 + as + u16; + let mask = + 16usize + as + u16; + let mFireAfterPaintEvents = + (mFireAfterPaintEvents + << + 4usize) + & + mask; + bitfield_unit_val + | + mFireAfterPaintEvents + }; + let mIsChrome = + mIsChrome + as + u32 + as + u16; + let mask = + 32usize + as + u16; + let mIsChrome = + (mIsChrome + << + 5usize) + & + mask; + bitfield_unit_val + | + mIsChrome + }; + let mIsChromeOriginImage = + mIsChromeOriginImage + as + u32 + as + u16; + let mask = + 64usize + as + u16; + let mIsChromeOriginImage = + (mIsChromeOriginImage + << + 6usize) + & + mask; + bitfield_unit_val + | + mIsChromeOriginImage + }; + let mPaintFlashing = + mPaintFlashing + as u32 as + u16; + let mask = + 128usize as + u16; + let mPaintFlashing = + (mPaintFlashing + << + 7usize) & + mask; + bitfield_unit_val + | + mPaintFlashing + }; + let mPaintFlashingInitialized = + mPaintFlashingInitialized + as u32 as u16; + let mask = + 256usize as u16; + let mPaintFlashingInitialized = + (mPaintFlashingInitialized + << 8usize) & + mask; + bitfield_unit_val | + mPaintFlashingInitialized + }; + let mHasWarnedAboutPositionedTableParts = + mHasWarnedAboutPositionedTableParts + as u32 as u16; + let mask = 512usize as u16; + let mHasWarnedAboutPositionedTableParts = + (mHasWarnedAboutPositionedTableParts + << 9usize) & mask; + bitfield_unit_val | + mHasWarnedAboutPositionedTableParts + }; + let mHasWarnedAboutTooLargeDashedOrDottedRadius = + mHasWarnedAboutTooLargeDashedOrDottedRadius + as u32 as u16; + let mask = 1024usize as u16; + let mHasWarnedAboutTooLargeDashedOrDottedRadius = + (mHasWarnedAboutTooLargeDashedOrDottedRadius + << 10usize) & mask; + bitfield_unit_val | + mHasWarnedAboutTooLargeDashedOrDottedRadius + }; + let mQuirkSheetAdded = + mQuirkSheetAdded as u32 as u16; + let mask = 2048usize as u16; + let mQuirkSheetAdded = + (mQuirkSheetAdded << 11usize) & mask; + bitfield_unit_val | mQuirkSheetAdded + }; + let mNeedsPrefUpdate = mNeedsPrefUpdate as u32 as u16; + let mask = 4096usize as u16; + let mNeedsPrefUpdate = + (mNeedsPrefUpdate << 12usize) & mask; + bitfield_unit_val | mNeedsPrefUpdate + }; + let mHadNonBlankPaint = mHadNonBlankPaint as u32 as u16; + let mask = 8192usize as u16; + let mHadNonBlankPaint = (mHadNonBlankPaint << 13usize) & mask; + bitfield_unit_val | mHadNonBlankPaint } } #[repr(C)] @@ -20097,207 +21919,318 @@ pub mod root { #[inline] pub fn mStylesHaveChanged(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mStylesHaveChanged(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mDidInitialize(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mDidInitialize(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsDestroying(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsDestroying(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsReflowing(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsReflowing(&mut self, val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mPaintingSuppressed(&self) -> bool { let mask = 16usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mPaintingSuppressed(&mut self, val: bool) { let mask = 16usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsThemeSupportDisabled(&self) -> bool { let mask = 32usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 5usize; + let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsThemeSupportDisabled(&mut self, val: bool) { let mask = 32usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 5usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsActive(&self) -> bool { let mask = 64usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 6usize; + let val = (unit_field_val & mask) >> 6usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsActive(&mut self, val: bool) { let mask = 64usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 6usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mFrozen(&self) -> bool { let mask = 128usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 7usize; + let val = (unit_field_val & mask) >> 7usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mFrozen(&mut self, val: bool) { let mask = 128usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 7usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 7usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mStylesHaveChanged: bool, mDidInitialize: bool, + mIsDestroying: bool, mIsReflowing: bool, + mPaintingSuppressed: bool, + mIsThemeSupportDisabled: bool, mIsActive: bool, + mFrozen: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { 0 }; + let mStylesHaveChanged = + mStylesHaveChanged + as + u8 + as + u8; + let mask = + 1usize + as + u8; + let mStylesHaveChanged = + (mStylesHaveChanged + << + 0usize) + & + mask; + bitfield_unit_val + | + mStylesHaveChanged + }; + let mDidInitialize = + mDidInitialize + as u8 as + u8; + let mask = + 2usize as u8; + let mDidInitialize = + (mDidInitialize + << + 1usize) & + mask; + bitfield_unit_val + | + mDidInitialize + }; + let mIsDestroying = + mIsDestroying as u8 as + u8; + let mask = 4usize as u8; + let mIsDestroying = + (mIsDestroying << + 2usize) & mask; + bitfield_unit_val | + mIsDestroying + }; + let mIsReflowing = + mIsReflowing as u8 as u8; + let mask = 8usize as u8; + let mIsReflowing = + (mIsReflowing << 3usize) & + mask; + bitfield_unit_val | mIsReflowing + }; + let mPaintingSuppressed = + mPaintingSuppressed as u8 as u8; + let mask = 16usize as u8; + let mPaintingSuppressed = + (mPaintingSuppressed << 4usize) & + mask; + bitfield_unit_val | mPaintingSuppressed + }; + let mIsThemeSupportDisabled = + mIsThemeSupportDisabled as u8 as u8; + let mask = 32usize as u8; + let mIsThemeSupportDisabled = + (mIsThemeSupportDisabled << 5usize) & mask; + bitfield_unit_val | mIsThemeSupportDisabled + }; + let mIsActive = mIsActive as u8 as u8; + let mask = 64usize as u8; + let mIsActive = (mIsActive << 6usize) & mask; + bitfield_unit_val | mIsActive + }; + let mFrozen = mFrozen as u8 as u8; + let mask = 128usize as u8; + let mFrozen = (mFrozen << 7usize) & mask; + bitfield_unit_val | mFrozen } #[inline] pub fn mIsFirstPaint(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsFirstPaint(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mObservesMutationsForPrint(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mObservesMutationsForPrint(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mSuppressInterruptibleReflows(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mSuppressInterruptibleReflows(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mScrollPositionClampingScrollPortSizeSet(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] @@ -20305,101 +22238,223 @@ pub mod root { val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mNeedLayoutFlush(&self) -> bool { let mask = 16usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mNeedLayoutFlush(&mut self, val: bool) { let mask = 16usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mNeedStyleFlush(&self) -> bool { let mask = 32usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 5usize; + let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mNeedStyleFlush(&mut self, val: bool) { let mask = 32usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 5usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mObservingStyleFlushes(&self) -> bool { let mask = 64usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 6usize; + let val = (unit_field_val & mask) >> 6usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mObservingStyleFlushes(&mut self, val: bool) { let mask = 64usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 6usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 6usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mObservingLayoutFlushes(&self) -> bool { let mask = 128usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - let val = (field_val & mask) >> 7usize; + let val = (unit_field_val & mask) >> 7usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mObservingLayoutFlushes(&mut self, val: bool) { let mask = 128usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_2) }; - field_val &= !mask; - field_val |= (val << 7usize) & mask; - self._bitfield_2 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 7usize) & mask; + self._bitfield_2 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_2(mIsFirstPaint: bool, + mObservesMutationsForPrint: bool, + mSuppressInterruptibleReflows: bool, + mScrollPositionClampingScrollPortSizeSet: bool, + mNeedLayoutFlush: bool, mNeedStyleFlush: bool, + mObservingStyleFlushes: bool, + mObservingLayoutFlushes: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { 0 }; + let mIsFirstPaint = + mIsFirstPaint + as + u8 + as + u8; + let mask = + 1usize + as + u8; + let mIsFirstPaint = + (mIsFirstPaint + << + 0usize) + & + mask; + bitfield_unit_val + | + mIsFirstPaint + }; + let mObservesMutationsForPrint = + mObservesMutationsForPrint + as u8 as + u8; + let mask = + 2usize as u8; + let mObservesMutationsForPrint = + (mObservesMutationsForPrint + << + 1usize) & + mask; + bitfield_unit_val + | + mObservesMutationsForPrint + }; + let mSuppressInterruptibleReflows = + mSuppressInterruptibleReflows + as u8 as u8; + let mask = 4usize as u8; + let mSuppressInterruptibleReflows = + (mSuppressInterruptibleReflows + << 2usize) & + mask; + bitfield_unit_val | + mSuppressInterruptibleReflows + }; + let mScrollPositionClampingScrollPortSizeSet = + mScrollPositionClampingScrollPortSizeSet + as u8 as u8; + let mask = 8usize as u8; + let mScrollPositionClampingScrollPortSizeSet = + (mScrollPositionClampingScrollPortSizeSet + << 3usize) & mask; + bitfield_unit_val | + mScrollPositionClampingScrollPortSizeSet + }; + let mNeedLayoutFlush = + mNeedLayoutFlush as u8 as u8; + let mask = 16usize as u8; + let mNeedLayoutFlush = + (mNeedLayoutFlush << 4usize) & mask; + bitfield_unit_val | mNeedLayoutFlush + }; + let mNeedStyleFlush = mNeedStyleFlush as u8 as u8; + let mask = 32usize as u8; + let mNeedStyleFlush = + (mNeedStyleFlush << 5usize) & mask; + bitfield_unit_val | mNeedStyleFlush + }; + let mObservingStyleFlushes = + mObservingStyleFlushes as u8 as u8; + let mask = 64usize as u8; + let mObservingStyleFlushes = + (mObservingStyleFlushes << 6usize) & mask; + bitfield_unit_val | mObservingStyleFlushes + }; + let mObservingLayoutFlushes = mObservingLayoutFlushes as u8 as u8; + let mask = 128usize as u8; + let mObservingLayoutFlushes = + (mObservingLayoutFlushes << 7usize) & mask; + bitfield_unit_val | mObservingLayoutFlushes } #[inline] pub fn mNeedThrottledAnimationFlush(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mNeedThrottledAnimationFlush(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_3) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_3 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_3 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_3(mNeedThrottledAnimationFlush: bool) -> u8 { + let bitfield_unit_val = { 0 }; + let mNeedThrottledAnimationFlush = + mNeedThrottledAnimationFlush as u8 as u8; + let mask = 1usize as u8; + let mNeedThrottledAnimationFlush = + (mNeedThrottledAnimationFlush << 0usize) & mask; + bitfield_unit_val | mNeedThrottledAnimationFlush } } /** @@ -20438,57 +22493,57 @@ pub mod root { pub struct nsDOMMutationObserver { _unused: [u8; 0], } - pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_HAS_LISTENERMANAGER; - pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_HAS_PROPERTIES; - pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_IS_ANONYMOUS_ROOT; - pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; - pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_IS_NATIVE_ANONYMOUS_ROOT; - pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_FORCE_XBL_BINDINGS; - pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_MAY_BE_IN_BINDING_MNGR; - pub const NODE_IS_EDITABLE: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_IS_EDITABLE; - pub const NODE_IS_NATIVE_ANONYMOUS: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_IS_NATIVE_ANONYMOUS; - pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_IS_IN_SHADOW_TREE; - pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_HAS_EMPTY_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_HAS_SLOW_SELECTOR; - pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_HAS_EDGE_CHILD_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; - pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_ALL_SELECTOR_FLAGS; - pub const NODE_NEEDS_FRAME: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_NEEDS_FRAME; - pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_DESCENDANTS_NEED_FRAMES; - pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_HAS_ACCESSKEY; - pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_HAS_DIRECTION_RTL; - pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_HAS_DIRECTION_LTR; - pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_ALL_DIRECTION_FLAGS; - pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_CHROME_ONLY_ACCESS; - pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; - pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_17 = - _bindgen_ty_17::NODE_TYPE_SPECIFIC_BITS_OFFSET; + pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_HAS_LISTENERMANAGER; + pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_HAS_PROPERTIES; + pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_IS_ANONYMOUS_ROOT; + pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; + pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_IS_NATIVE_ANONYMOUS_ROOT; + pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_FORCE_XBL_BINDINGS; + pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_MAY_BE_IN_BINDING_MNGR; + pub const NODE_IS_EDITABLE: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_IS_EDITABLE; + pub const NODE_IS_NATIVE_ANONYMOUS: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_IS_NATIVE_ANONYMOUS; + pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_IS_IN_SHADOW_TREE; + pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_HAS_EMPTY_SELECTOR; + pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_HAS_SLOW_SELECTOR; + pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_HAS_EDGE_CHILD_SELECTOR; + pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; + pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_ALL_SELECTOR_FLAGS; + pub const NODE_NEEDS_FRAME: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_NEEDS_FRAME; + pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_DESCENDANTS_NEED_FRAMES; + pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_HAS_ACCESSKEY; + pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_HAS_DIRECTION_RTL; + pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_HAS_DIRECTION_LTR; + pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_ALL_DIRECTION_FLAGS; + pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_CHROME_ONLY_ACCESS; + pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; + pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_76 = + _bindgen_ty_76::NODE_TYPE_SPECIFIC_BITS_OFFSET; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum _bindgen_ty_17 { + pub enum _bindgen_ty_76 { NODE_HAS_LISTENERMANAGER = 4, NODE_HAS_PROPERTIES = 8, NODE_IS_ANONYMOUS_ROOT = 16, @@ -22447,38 +24502,56 @@ pub mod root { #[inline] pub fn mGeneration(&self) -> u32 { let mask = 15usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mGeneration(&mut self, val: u32) { let mask = 15usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIndexInGeneration(&self) -> u32 { let mask = 4294967280usize as u32; - let field_val: u32 = + let unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_mIndexInGeneration(&mut self, val: u32) { let mask = 4294967280usize as u32; let val = val as u32 as u32; - let mut field_val: u32 = + let mut unit_field_val: u32 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mGeneration: u32, mIndexInGeneration: u32) + -> u32 { + let bitfield_unit_val = + { + let bitfield_unit_val = { 0 }; + let mGeneration = mGeneration as u32 as u32; + let mask = 15usize as u32; + let mGeneration = (mGeneration << 0usize) & mask; + bitfield_unit_val | mGeneration + }; + let mIndexInGeneration = mIndexInGeneration as u32 as u32; + let mask = 4294967280usize as u32; + let mIndexInGeneration = (mIndexInGeneration << 4usize) & mask; + bitfield_unit_val | mIndexInGeneration } } #[repr(C)] @@ -23136,7 +25209,7 @@ pub mod root { } #[test] fn bindgen_test_layout_nsRootPresContext() { - assert_eq!(::std::mem::size_of::() , 1464usize , + assert_eq!(::std::mem::size_of::() , 1512usize , concat ! ( "Size of: " , stringify ! ( nsRootPresContext ) )); assert_eq! (::std::mem::align_of::() , 8usize , @@ -23144,37 +25217,37 @@ pub mod root { "Alignment of " , stringify ! ( nsRootPresContext ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . - mNotifyDidPaintTimers as * const _ as usize } , 1312usize + mNotifyDidPaintTimers as * const _ as usize } , 1360usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mNotifyDidPaintTimers ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . mApplyPluginGeometryTimer as * const _ as usize } , - 1392usize , concat ! ( + 1440usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mApplyPluginGeometryTimer ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . - mRegisteredPlugins as * const _ as usize } , 1400usize , + mRegisteredPlugins as * const _ as usize } , 1448usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mRegisteredPlugins ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . - mWillPaintObservers as * const _ as usize } , 1440usize , + mWillPaintObservers as * const _ as usize } , 1488usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mWillPaintObservers ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . mWillPaintFallbackEvent as * const _ as usize } , - 1448usize , concat ! ( + 1496usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mWillPaintFallbackEvent ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . - mDOMGeneration as * const _ as usize } , 1456usize , + mDOMGeneration as * const _ as usize } , 1504usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mDOMGeneration ) )); @@ -25641,7 +27714,7 @@ pub mod root { pub _base_4: root::nsITimedChannel, pub mRefCnt: root::nsAutoRefCnt, pub mBehaviour: root::mozilla::UniquePtr, - pub mURI: root::RefPtr, + pub mURI: root::RefPtr, pub mListener: *mut root::imgINotificationObserver, pub mLoadGroup: root::nsCOMPtr, pub mLoadFlags: root::nsLoadFlags, @@ -26781,7 +28854,7 @@ pub mod root { pub mRefCnt: root::mozilla::ThreadSafeAutoRefCnt, pub mLoader: *mut root::imgLoader, pub mRequest: root::nsCOMPtr, - pub mURI: root::RefPtr, + pub mURI: root::RefPtr, pub mCurrentURI: root::nsCOMPtr, pub mLoadingPrincipal: root::nsCOMPtr, pub mPrincipal: root::nsCOMPtr, @@ -26808,8 +28881,8 @@ pub mod root { pub mImageErrorCode: root::nsresult, pub mBoostCategoriesRequested: u32, pub mMutex: root::mozilla::Mutex, - pub mProgressTracker: root::RefPtr, - pub mImage: root::RefPtr, + pub mProgressTracker: root::RefPtr, + pub mImage: root::RefPtr, pub _bitfield_1: u8, pub __bindgen_padding_0: [u8; 7usize], } @@ -26823,7 +28896,7 @@ pub mod root { pub type imgRequest_HasThreadSafeRefCnt = root::mozilla::TrueType; #[test] fn bindgen_test_layout_imgRequest() { - assert_eq!(::std::mem::size_of::() , 400usize , concat ! ( + assert_eq!(::std::mem::size_of::() , 376usize , concat ! ( "Size of: " , stringify ! ( imgRequest ) )); assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( imgRequest ) )); @@ -26832,110 +28905,175 @@ pub mod root { #[inline] pub fn mIsMultiPartChannel(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsMultiPartChannel(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mGotData(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mGotData(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsInCache(&self) -> bool { let mask = 4usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 2usize; + let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsInCache(&mut self, val: bool) { let mask = 4usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 2usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 2usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mDecodeRequested(&self) -> bool { let mask = 8usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 3usize; + let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mDecodeRequested(&mut self, val: bool) { let mask = 8usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 3usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 3usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mNewPartPending(&self) -> bool { let mask = 16usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 4usize; + let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mNewPartPending(&mut self, val: bool) { let mask = 16usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 4usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 4usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mHadInsecureRedirect(&self) -> bool { let mask = 32usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 5usize; + let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mHadInsecureRedirect(&mut self, val: bool) { let mask = 32usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 5usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 5usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mIsMultiPartChannel: bool, mGotData: bool, + mIsInCache: bool, mDecodeRequested: bool, + mNewPartPending: bool, + mHadInsecureRedirect: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { + let bitfield_unit_val = + { 0 }; + let mIsMultiPartChannel = + mIsMultiPartChannel as + u8 as u8; + let mask = 1usize as u8; + let mIsMultiPartChannel = + (mIsMultiPartChannel + << 0usize) & + mask; + bitfield_unit_val | + mIsMultiPartChannel + }; + let mGotData = + mGotData as u8 as u8; + let mask = 2usize as u8; + let mGotData = + (mGotData << 1usize) & mask; + bitfield_unit_val | mGotData + }; + let mIsInCache = mIsInCache as u8 as u8; + let mask = 4usize as u8; + let mIsInCache = + (mIsInCache << 2usize) & mask; + bitfield_unit_val | mIsInCache + }; + let mDecodeRequested = + mDecodeRequested as u8 as u8; + let mask = 8usize as u8; + let mDecodeRequested = + (mDecodeRequested << 3usize) & mask; + bitfield_unit_val | mDecodeRequested + }; + let mNewPartPending = mNewPartPending as u8 as u8; + let mask = 16usize as u8; + let mNewPartPending = (mNewPartPending << 4usize) & mask; + bitfield_unit_val | mNewPartPending + }; + let mHadInsecureRedirect = mHadInsecureRedirect as u8 as u8; + let mask = 32usize as u8; + let mHadInsecureRedirect = + (mHadInsecureRedirect << 5usize) & mask; + bitfield_unit_val | mHadInsecureRedirect } } #[repr(C)] @@ -28239,7 +30377,18 @@ pub mod root { ) , "::" , stringify ! ( mQuotePairs ) )); } #[test] - fn __bindgen_test_layout_StaticRefPtr_instantiation_150620() { + fn __bindgen_test_layout_StaticRefPtr_instantiation_79() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::StaticRefPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::StaticRefPtr ) )); + } + #[test] + fn __bindgen_test_layout_StaticRefPtr_instantiation_80() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -28401,38 +30550,55 @@ pub mod root { #[inline] pub fn mIsAutoFill(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsAutoFill(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mIsSubgrid(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mIsSubgrid(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mIsAutoFill: bool, mIsSubgrid: bool) -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = { 0 }; + let mIsAutoFill = mIsAutoFill as u8 as u8; + let mask = 1usize as u8; + let mIsAutoFill = (mIsAutoFill << 0usize) & mask; + bitfield_unit_val | mIsAutoFill + }; + let mIsSubgrid = mIsSubgrid as u8 as u8; + let mask = 2usize as u8; + let mIsSubgrid = (mIsSubgrid << 1usize) & mask; + bitfield_unit_val | mIsSubgrid } } #[repr(C)] @@ -28982,38 +31148,56 @@ pub mod root { #[inline] pub fn mTextAlignTrue(&self) -> bool { let mask = 1usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 0usize; + let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mTextAlignTrue(&mut self, val: bool) { let mask = 1usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 0usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 0usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; } #[inline] pub fn mTextAlignLastTrue(&self) -> bool { let mask = 2usize as u8; - let field_val: u8 = + let unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - let val = (field_val & mask) >> 1usize; + let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u8) } } #[inline] pub fn set_mTextAlignLastTrue(&mut self, val: bool) { let mask = 2usize as u8; let val = val as u8 as u8; - let mut field_val: u8 = + let mut unit_field_val: u8 = unsafe { ::std::mem::transmute(self._bitfield_1) }; - field_val &= !mask; - field_val |= (val << 1usize) & mask; - self._bitfield_1 = unsafe { ::std::mem::transmute(field_val) }; + unit_field_val &= !mask; + unit_field_val |= (val << 1usize) & mask; + self._bitfield_1 = + unsafe { ::std::mem::transmute(unit_field_val) }; + } + #[inline] + pub fn new_bitfield_1(mTextAlignTrue: bool, mTextAlignLastTrue: bool) + -> u8 { + let bitfield_unit_val = + { + let bitfield_unit_val = { 0 }; + let mTextAlignTrue = mTextAlignTrue as u8 as u8; + let mask = 1usize as u8; + let mTextAlignTrue = (mTextAlignTrue << 0usize) & mask; + bitfield_unit_val | mTextAlignTrue + }; + let mTextAlignLastTrue = mTextAlignLastTrue as u8 as u8; + let mask = 2usize as u8; + let mTextAlignLastTrue = (mTextAlignLastTrue << 1usize) & mask; + bitfield_unit_val | mTextAlignLastTrue } } #[repr(C)] @@ -30349,7 +32533,7 @@ pub mod root { pub type RawGeckoURLExtraData = root::mozilla::URLExtraData; pub type RawGeckoKeyframeList = root::nsTArray; pub type RawGeckoComputedKeyframeValuesList = - root::nsTArray>; + root::nsTArray; pub type RawGeckoAnimationValueList = root::nsTArray; pub type RawGeckoStyleAnimationList = @@ -30716,48 +32900,48 @@ pub mod root { pub struct nsAttrValueOrString { _unused: [u8; 0], } - pub const ELEMENT_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_1; - pub const ELEMENT_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_SHARED_RESTYLE_BIT_3: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_3; - pub const ELEMENT_SHARED_RESTYLE_BIT_4: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_1; + pub const ELEMENT_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_78 = + _bindgen_ty_78::ELEMENT_SHARED_RESTYLE_BIT_1; + pub const ELEMENT_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_78 = + _bindgen_ty_78::ELEMENT_SHARED_RESTYLE_BIT_2; + pub const ELEMENT_SHARED_RESTYLE_BIT_3: root::_bindgen_ty_78 = + _bindgen_ty_78::ELEMENT_SHARED_RESTYLE_BIT_3; + pub const ELEMENT_SHARED_RESTYLE_BIT_4: root::_bindgen_ty_78 = + _bindgen_ty_78::ELEMENT_SHARED_RESTYLE_BIT_4; + pub const ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_78 = + _bindgen_ty_78::ELEMENT_SHARED_RESTYLE_BIT_1; pub const ELEMENT_HAS_ANIMATION_ONLY_DIRTY_DESCENDANTS_FOR_SERVO: - root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_HAS_SNAPSHOT: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_3; - pub const ELEMENT_HANDLED_SNAPSHOT: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_HAS_PENDING_RESTYLE: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_1; - pub const ELEMENT_IS_POTENTIAL_RESTYLE_ROOT: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE: root::_bindgen_ty_19 + root::_bindgen_ty_78 = + _bindgen_ty_78::ELEMENT_SHARED_RESTYLE_BIT_2; + pub const ELEMENT_HAS_SNAPSHOT: root::_bindgen_ty_78 = + _bindgen_ty_78::ELEMENT_SHARED_RESTYLE_BIT_3; + pub const ELEMENT_HANDLED_SNAPSHOT: root::_bindgen_ty_78 = + _bindgen_ty_78::ELEMENT_SHARED_RESTYLE_BIT_4; + pub const ELEMENT_HAS_PENDING_RESTYLE: root::_bindgen_ty_78 = + _bindgen_ty_78::ELEMENT_SHARED_RESTYLE_BIT_1; + pub const ELEMENT_IS_POTENTIAL_RESTYLE_ROOT: root::_bindgen_ty_78 = + _bindgen_ty_78::ELEMENT_SHARED_RESTYLE_BIT_2; + pub const ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE: root::_bindgen_ty_78 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_3; + _bindgen_ty_78::ELEMENT_SHARED_RESTYLE_BIT_3; pub const ELEMENT_IS_POTENTIAL_ANIMATION_ONLY_RESTYLE_ROOT: - root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR; - pub const ELEMENT_PENDING_RESTYLE_FLAGS: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_PENDING_RESTYLE_FLAGS; - pub const ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS; - pub const ELEMENT_ALL_RESTYLE_FLAGS: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_ALL_RESTYLE_FLAGS; - pub const ELEMENT_HAS_SCROLLGRAB: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_HAS_SCROLLGRAB; - pub const ELEMENT_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_19 = - _bindgen_ty_19::ELEMENT_TYPE_SPECIFIC_BITS_OFFSET; + root::_bindgen_ty_78 = + _bindgen_ty_78::ELEMENT_SHARED_RESTYLE_BIT_4; + pub const ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR: root::_bindgen_ty_78 = + _bindgen_ty_78::ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR; + pub const ELEMENT_PENDING_RESTYLE_FLAGS: root::_bindgen_ty_78 = + _bindgen_ty_78::ELEMENT_PENDING_RESTYLE_FLAGS; + pub const ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS: root::_bindgen_ty_78 = + _bindgen_ty_78::ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS; + pub const ELEMENT_ALL_RESTYLE_FLAGS: root::_bindgen_ty_78 = + _bindgen_ty_78::ELEMENT_ALL_RESTYLE_FLAGS; + pub const ELEMENT_HAS_SCROLLGRAB: root::_bindgen_ty_78 = + _bindgen_ty_78::ELEMENT_HAS_SCROLLGRAB; + pub const ELEMENT_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_78 = + _bindgen_ty_78::ELEMENT_TYPE_SPECIFIC_BITS_OFFSET; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum _bindgen_ty_19 { + pub enum _bindgen_ty_78 { ELEMENT_SHARED_RESTYLE_BIT_1 = 8388608, ELEMENT_SHARED_RESTYLE_BIT_2 = 16777216, ELEMENT_SHARED_RESTYLE_BIT_3 = 33554432, @@ -31488,6 +33672,22 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy)] + pub struct _bindgen_ty_29 { + pub _address: u8, + } + impl Clone for _bindgen_ty_29 { + fn clone(&self) -> Self { *self } + } + #[repr(C)] + #[derive(Debug, Copy)] + pub struct _bindgen_ty_30 { + pub _address: u8, + } + impl Clone for _bindgen_ty_30 { + fn clone(&self) -> Self { *self } + } + #[repr(C)] + #[derive(Debug, Copy)] pub struct __va_list_tag { pub gp_offset: ::std::os::raw::c_uint, pub fp_offset: ::std::os::raw::c_uint, @@ -31526,7 +33726,7 @@ pub mod root { } pub type __builtin_va_list = [root::__va_list_tag; 1usize]; #[test] - fn __bindgen_test_layout_IntegralConstant_instantiation_179522() { + fn __bindgen_test_layout_IntegralConstant_instantiation_81() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( u8 ) )); @@ -31535,7 +33735,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_IntegralConstant_instantiation_179526() { + fn __bindgen_test_layout_IntegralConstant_instantiation_82() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( u8 ) )); @@ -31544,69 +33744,103 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsReadingIterator_instantiation_179740() { - assert_eq!(::std::mem::size_of::>() , - 24usize , concat ! ( + fn __bindgen_test_layout_nsCharTraits_instantiation_83() { + assert_eq!(::std::mem::size_of::() , 1usize , + concat ! ( "Size of template specialization: " , stringify ! ( - root::nsReadingIterator ) )); - assert_eq!(::std::mem::align_of::>() , - 8usize , concat ! ( + root::nsCharTraits ) )); + assert_eq!(::std::mem::align_of::() , 1usize , + concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsReadingIterator ) )); + root::nsCharTraits ) )); } #[test] - fn __bindgen_test_layout_nsWritingIterator_instantiation_179744() { - assert_eq!(::std::mem::size_of::>() , - 24usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::nsWritingIterator ) )); - assert_eq!(::std::mem::align_of::>() , - 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::nsWritingIterator ) )); - } - #[test] - fn __bindgen_test_layout_nsReadingIterator_instantiation_179817() { - assert_eq!(::std::mem::size_of::>() + fn __bindgen_test_layout_nsReadingIterator_instantiation_84() { + assert_eq!(::std::mem::size_of::>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsReadingIterator<::std::os::raw::c_char> ) )); - assert_eq!(::std::mem::align_of::>() + root::nsReadingIterator + ) )); + assert_eq!(::std::mem::align_of::>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsReadingIterator<::std::os::raw::c_char> ) )); + root::nsReadingIterator + ) )); } #[test] - fn __bindgen_test_layout_nsWritingIterator_instantiation_179821() { - assert_eq!(::std::mem::size_of::>() + fn __bindgen_test_layout_nsWritingIterator_instantiation_85() { + assert_eq!(::std::mem::size_of::>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsWritingIterator<::std::os::raw::c_char> ) )); - assert_eq!(::std::mem::align_of::>() + root::nsWritingIterator + ) )); + assert_eq!(::std::mem::align_of::>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsWritingIterator<::std::os::raw::c_char> ) )); + root::nsWritingIterator + ) )); } #[test] - fn __bindgen_test_layout_atomic_instantiation_181804() { - assert_eq!(::std::mem::size_of::() , 4usize , concat ! ( - "Size of template specialization: " , stringify ! ( u32 ) - )); - assert_eq!(::std::mem::align_of::() , 4usize , concat ! ( + fn __bindgen_test_layout_nsCharTraits_instantiation_86() { + assert_eq!(::std::mem::size_of::() , 1usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCharTraits ) )); + assert_eq!(::std::mem::align_of::() , 1usize , + concat ! ( "Alignment of template specialization: " , stringify ! ( - u32 ) )); + root::nsCharTraits ) )); } #[test] - fn __bindgen_test_layout_atomic_instantiation_181812() { - assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( u64 ) - )); - assert_eq!(::std::mem::align_of::() , 8usize , concat ! ( + fn __bindgen_test_layout_nsReadingIterator_instantiation_87() { + assert_eq!(::std::mem::size_of::>() + , 24usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsReadingIterator + ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - u64 ) )); + root::nsReadingIterator + ) )); } #[test] - fn __bindgen_test_layout__bindgen_ty_id_182069_instantiation_182066() { + fn __bindgen_test_layout_nsWritingIterator_instantiation_88() { + assert_eq!(::std::mem::size_of::>() + , 24usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsWritingIterator + ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsWritingIterator + ) )); + } + #[test] + fn __bindgen_test_layout_nsCharTraits_instantiation_89() { + assert_eq!(::std::mem::size_of::() , 1usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCharTraits ) )); + assert_eq!(::std::mem::align_of::() , 1usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCharTraits ) )); + } + #[test] + fn __bindgen_test_layout_nsCharTraits_instantiation_90() { + assert_eq!(::std::mem::size_of::() , 1usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCharTraits ) )); + assert_eq!(::std::mem::align_of::() , 1usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCharTraits ) )); + } + #[test] + fn __bindgen_test_layout__bindgen_ty_id_183129_instantiation_91() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( u8 ) )); @@ -31615,7 +33849,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout__bindgen_ty_id_182102_instantiation_182099() { + fn __bindgen_test_layout__bindgen_ty_id_183165_instantiation_92() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( u8 ) )); @@ -31624,7 +33858,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_182370() { + fn __bindgen_test_layout_nsTArray_instantiation_93() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31635,7 +33869,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_183195() { + fn __bindgen_test_layout_Handle_instantiation_94() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31646,7 +33880,7 @@ pub mod root { root::JS::Handle<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_Handle_instantiation_183211() { + fn __bindgen_test_layout_Handle_instantiation_95() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31657,18 +33891,7 @@ pub mod root { root::JS::Handle ) )); } #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_183221() { - assert_eq!(::std::mem::size_of::>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::JS::MutableHandle<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::JS::MutableHandle<*mut root::JSObject> ) )); - } - #[test] - fn __bindgen_test_layout_MutableHandle_instantiation_183237() { + fn __bindgen_test_layout_MutableHandle_instantiation_96() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31679,7 +33902,7 @@ pub mod root { root::JS::MutableHandle ) )); } #[test] - fn __bindgen_test_layout_Rooted_instantiation_183240() { + fn __bindgen_test_layout_Rooted_instantiation_97() { assert_eq!(::std::mem::size_of::<[u64; 3usize]>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31690,7 +33913,7 @@ pub mod root { [u64; 3usize] ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_183577() { + fn __bindgen_test_layout_DeletePolicy_instantiation_98() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31701,7 +33924,7 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_188506() { + fn __bindgen_test_layout_nsTArray_instantiation_99() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31712,7 +33935,7 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_188510() { + fn __bindgen_test_layout_nsTArray_instantiation_100() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31723,40 +33946,40 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_188523() { - assert_eq!(::std::mem::size_of::>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::nsTArray<::std::os::raw::c_uint> ) )); - assert_eq!(::std::mem::align_of::>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::nsTArray<::std::os::raw::c_uint> ) )); - } - #[test] - fn __bindgen_test_layout_TenuredHeap_instantiation_189393() { - assert_eq!(::std::mem::size_of::() , 8usize , + fn __bindgen_test_layout_nsTArray_instantiation_101() { + assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::TenuredHeap ) )); - assert_eq!(::std::mem::align_of::() , 8usize , + root::nsTArray ) )); + assert_eq!(::std::mem::align_of::>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::TenuredHeap ) )); + root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_Heap_instantiation_189483() { - assert_eq!(::std::mem::size_of::>() - , 8usize , concat ! ( + fn __bindgen_test_layout_nsTArray_instantiation_102() { + assert_eq!(::std::mem::size_of::>() , 8usize , + concat ! ( "Size of template specialization: " , stringify ! ( - root::JS::Heap<*mut root::JSObject> ) )); - assert_eq!(::std::mem::align_of::>() - , 8usize , concat ! ( + root::nsTArray ) )); + assert_eq!(::std::mem::align_of::>() , 8usize , + concat ! ( "Alignment of template specialization: " , stringify ! ( - root::JS::Heap<*mut root::JSObject> ) )); + root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_TErrorResult_instantiation_189593() { + fn __bindgen_test_layout_nsTArray_instantiation_103() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_TErrorResult_instantiation_104() { assert_eq!(::std::mem::size_of::() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31767,7 +33990,7 @@ pub mod root { root::mozilla::binding_danger::TErrorResult ) )); } #[test] - fn __bindgen_test_layout_TErrorResult_instantiation_189609() { + fn __bindgen_test_layout_TErrorResult_instantiation_105() { assert_eq!(::std::mem::size_of::() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31778,7 +34001,7 @@ pub mod root { root::mozilla::binding_danger::TErrorResult ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_189615() { + fn __bindgen_test_layout_already_AddRefed_instantiation_106() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31789,18 +34012,51 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_189667() { - assert_eq!(::std::mem::size_of::>() + fn __bindgen_test_layout_Handle_instantiation_107() { + assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed ) )); - assert_eq!(::std::mem::align_of::>() + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed ) )); + root::JS::Handle<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_190141() { + fn __bindgen_test_layout_MutableHandle_instantiation_108() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_109() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_110() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_instantiation_111() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31811,18 +34067,29 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_190487() { - assert_eq!(::std::mem::size_of::>() + fn __bindgen_test_layout_Handle_instantiation_112() { + assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::already_AddRefed ) )); - assert_eq!(::std::mem::align_of::>() + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::already_AddRefed ) )); + root::JS::Handle<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_190730() { + fn __bindgen_test_layout_Handle_instantiation_113() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_114() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31833,7 +34100,18 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_190877() { + fn __bindgen_test_layout_already_AddRefed_instantiation_115() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_116() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31844,7 +34122,40 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_DeletePolicy_instantiation_194972() { + fn __bindgen_test_layout_Handle_instantiation_117() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_118() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_119() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_DeletePolicy_instantiation_120() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31855,7 +34166,7 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_194970() { + fn __bindgen_test_layout_UniquePtr_instantiation_121() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31866,7 +34177,95 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_iterator_instantiation_195005() { + fn __bindgen_test_layout_DeletePolicy_instantiation_122() { + assert_eq!(::std::mem::size_of::() , 1usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + assert_eq!(::std::mem::align_of::() , 1usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_instantiation_123() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + } + #[test] + fn __bindgen_test_layout_DeletePolicy_instantiation_124() { + assert_eq!(::std::mem::size_of::() , 1usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + assert_eq!(::std::mem::align_of::() , 1usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_instantiation_125() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + } + #[test] + fn __bindgen_test_layout_DeletePolicy_instantiation_126() { + assert_eq!(::std::mem::size_of::() , 1usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + assert_eq!(::std::mem::align_of::() , 1usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_instantiation_127() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + } + #[test] + fn __bindgen_test_layout_DeletePolicy_instantiation_128() { + assert_eq!(::std::mem::size_of::() , 1usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + assert_eq!(::std::mem::align_of::() , 1usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_instantiation_129() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + } + #[test] + fn __bindgen_test_layout_iterator_instantiation_130() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31877,7 +34276,51 @@ pub mod root { root::std::iterator ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_195571() { + fn __bindgen_test_layout_DeletePolicy_instantiation_131() { + assert_eq!(::std::mem::size_of::() , 1usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + assert_eq!(::std::mem::align_of::() , 1usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_instantiation_132() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + } + #[test] + fn __bindgen_test_layout_DeletePolicy_instantiation_133() { + assert_eq!(::std::mem::size_of::() , 1usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + assert_eq!(::std::mem::align_of::() , 1usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::DeletePolicy ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_instantiation_134() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_instantiation_135() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31888,7 +34331,73 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_Heap_instantiation_196824() { + fn __bindgen_test_layout_Handle_instantiation_136() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_137() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_instantiation_138() { + assert_eq!(::std::mem::size_of::() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_instantiation_139() { + assert_eq!(::std::mem::size_of::() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_140() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_141() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray ) )); + } + #[test] + fn __bindgen_test_layout_Heap_instantiation_142() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31899,7 +34408,40 @@ pub mod root { root::JS::Heap ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_197166() { + fn __bindgen_test_layout_Heap_instantiation_143() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Heap<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Heap<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_TenuredHeap_instantiation_144() { + assert_eq!(::std::mem::size_of::() , 8usize , + concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::TenuredHeap ) )); + assert_eq!(::std::mem::align_of::() , 8usize , + concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::TenuredHeap ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_145() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_146() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31912,18 +34454,29 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_LinkedList_instantiation_197442() { - assert_eq!(::std::mem::size_of::() , - 24usize , concat ! ( + fn __bindgen_test_layout_RefPtr_instantiation_147() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::mozilla::LinkedList ) )); - assert_eq!(::std::mem::align_of::() , - 8usize , concat ! ( + root::RefPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::mozilla::LinkedList ) )); + root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_197458() { + fn __bindgen_test_layout_RefPtr_instantiation_148() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_instantiation_149() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31934,7 +34487,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_197457() { + fn __bindgen_test_layout_nsTArray_instantiation_150() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31947,7 +34500,7 @@ pub mod root { )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_197487() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_151() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31958,7 +34511,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_197486() { + fn __bindgen_test_layout_nsTArray_instantiation_152() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31969,7 +34522,18 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_197532() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_153() { + assert_eq!(::std::mem::size_of::() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_154() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31980,7 +34544,51 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_197697() { + fn __bindgen_test_layout_already_AddRefed_instantiation_155() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_instantiation_156() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_157() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_158() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_159() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -31991,7 +34599,75 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_198024() { + fn __bindgen_test_layout_already_AddRefed_instantiation_160() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_161() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_instantiation_162() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_163() { + assert_eq!(::std::mem::size_of::>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray> ) + )); + assert_eq!(::std::mem::align_of::>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray> ) + )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_164() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_165() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_166() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32002,7 +34678,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_198117() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_167() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32013,18 +34689,18 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_198154() { - assert_eq!(::std::mem::size_of::() , 8usize , concat ! - ( + fn __bindgen_test_layout_Handle_instantiation_168() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::nsCOMPtr ) )); - assert_eq!(::std::mem::align_of::() , 8usize , concat - ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::nsCOMPtr ) )); + root::JS::Handle<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_198410() { + fn __bindgen_test_layout_DefaultDelete_instantiation_169() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32035,7 +34711,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_198408() { + fn __bindgen_test_layout_UniquePtr_instantiation_170() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32046,7 +34722,62 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_198959() { + fn __bindgen_test_layout_already_AddRefed_instantiation_171() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_172() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_173() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_174() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_175() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_176() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32059,7 +34790,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsDataHashtable_instantiation_198958() { + fn __bindgen_test_layout_nsDataHashtable_instantiation_177() { assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32070,7 +34801,18 @@ pub mod root { [u64; 5usize] ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_199163() { + fn __bindgen_test_layout_Handle_instantiation_178() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_179() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32081,7 +34823,40 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_SupportsWeakPtr_instantiation_199210() { + fn __bindgen_test_layout_nsTArray_instantiation_180() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsIContent> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsIContent> ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_181() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_182() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_SupportsWeakPtr_instantiation_183() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( u64 ) )); @@ -32090,7 +34865,18 @@ pub mod root { u64 ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_199387() { + fn __bindgen_test_layout_already_AddRefed_instantiation_184() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_185() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32101,7 +34887,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_199503() { + fn __bindgen_test_layout_DefaultDelete_instantiation_186() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32112,7 +34898,40 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_199669() { + fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_187() { + assert_eq!(::std::mem::size_of::>() + , 16usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsRefPtrHashKey ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsRefPtrHashKey ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_instantiation_188() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_instantiation_189() { + assert_eq!(::std::mem::size_of::() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_190() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32123,7 +34942,95 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_nsPIDOMWindow_instantiation_200458() { + fn __bindgen_test_layout_already_AddRefed_instantiation_191() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_192() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_193() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_194() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_195() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_196() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_197() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_198() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_nsPIDOMWindow_instantiation_199() { assert_eq!(::std::mem::size_of::<[u64; 28usize]>() , 224usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32134,7 +35041,7 @@ pub mod root { [u64; 28usize] ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_200550() { + fn __bindgen_test_layout_already_AddRefed_instantiation_200() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32145,7 +35052,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashtable_instantiation_200740() { + fn __bindgen_test_layout_nsRefPtrHashtable_instantiation_201() { assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32156,7 +35063,71 @@ pub mod root { [u64; 5usize] ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_201257() { + fn __bindgen_test_layout_Handle_instantiation_202() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_203() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_204() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_instantiation_205() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr ) )); + } + #[test] + fn __bindgen_test_layout_RefPtr_instantiation_206() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr ) )); + } + #[test] + fn __bindgen_test_layout_WeakPtr_instantiation_207() { + assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) + )); + assert_eq!(::std::mem::align_of::() , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + u64 ) )); + } + #[test] + fn __bindgen_test_layout_nsPtrHashKey_instantiation_208() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32167,7 +35138,29 @@ pub mod root { root::nsPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_OwningNonNull_instantiation_201372() { + fn __bindgen_test_layout_RefPtr_instantiation_209() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_210() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_OwningNonNull_instantiation_211() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32178,7 +35171,84 @@ pub mod root { root::mozilla::OwningNonNull ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_201657() { + fn __bindgen_test_layout_OwningNonNull_instantiation_212() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::OwningNonNull ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::OwningNonNull ) )); + } + #[test] + fn __bindgen_test_layout_OwningNonNull_instantiation_213() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::OwningNonNull ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::OwningNonNull ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_214() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_215() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_216() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_217() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_instantiation_218() { + assert_eq!(::std::mem::size_of::() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsPtrHashKey_instantiation_219() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32189,7 +35259,7 @@ pub mod root { root::nsPtrHashKey<::std::os::raw::c_void> ) )); } #[test] - fn __bindgen_test_layout_PointTyped_instantiation_202448() { + fn __bindgen_test_layout_PointTyped_instantiation_220() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32200,7 +35270,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_IntPointTyped_instantiation_202453() { + fn __bindgen_test_layout_IntPointTyped_instantiation_221() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32211,7 +35281,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_SizeTyped_instantiation_202456() { + fn __bindgen_test_layout_SizeTyped_instantiation_222() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32222,7 +35292,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_RectTyped_instantiation_202464() { + fn __bindgen_test_layout_RectTyped_instantiation_223() { assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32233,7 +35303,7 @@ pub mod root { [u32; 4usize] ) )); } #[test] - fn __bindgen_test_layout_IntPointTyped_instantiation_202496() { + fn __bindgen_test_layout_IntPointTyped_instantiation_224() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32244,7 +35314,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_IntSizeTyped_instantiation_202504() { + fn __bindgen_test_layout_IntSizeTyped_instantiation_225() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32255,7 +35325,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_IntRectTyped_instantiation_202512() { + fn __bindgen_test_layout_IntRectTyped_instantiation_226() { assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32266,7 +35336,7 @@ pub mod root { [u32; 4usize] ) )); } #[test] - fn __bindgen_test_layout_MarginTyped_instantiation_202679() { + fn __bindgen_test_layout_MarginTyped_instantiation_227() { assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32277,7 +35347,7 @@ pub mod root { [u32; 4usize] ) )); } #[test] - fn __bindgen_test_layout_RectTyped_instantiation_202714() { + fn __bindgen_test_layout_RectTyped_instantiation_228() { assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32288,7 +35358,7 @@ pub mod root { [u32; 4usize] ) )); } #[test] - fn __bindgen_test_layout_IntRectTyped_instantiation_202719() { + fn __bindgen_test_layout_IntRectTyped_instantiation_229() { assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32299,7 +35369,7 @@ pub mod root { [u32; 4usize] ) )); } #[test] - fn __bindgen_test_layout_ScaleFactor_instantiation_202765() { + fn __bindgen_test_layout_ScaleFactor_instantiation_230() { assert_eq!(::std::mem::size_of::() , 4usize , concat ! ( "Size of template specialization: " , stringify ! ( u32 ) )); @@ -32308,7 +35378,7 @@ pub mod root { u32 ) )); } #[test] - fn __bindgen_test_layout_ScaleFactors2D_instantiation_202865() { + fn __bindgen_test_layout_ScaleFactors2D_instantiation_231() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32319,7 +35389,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_ScaleFactors2D_instantiation_202873() { + fn __bindgen_test_layout_ScaleFactors2D_instantiation_232() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32330,7 +35400,7 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_ScaleFactors2D_instantiation_202917() { + fn __bindgen_test_layout_ScaleFactors2D_instantiation_233() { assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32341,7 +35411,29 @@ pub mod root { [u32; 2usize] ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_203547() { + fn __bindgen_test_layout_already_AddRefed_instantiation_234() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_235() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_236() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32354,7 +35446,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_203563() { + fn __bindgen_test_layout_nsPtrHashKey_instantiation_237() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32365,7 +35457,18 @@ pub mod root { root::nsPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_nsPIDOMWindow_instantiation_206835() { + fn __bindgen_test_layout_already_AddRefed_instantiation_238() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_nsPIDOMWindow_instantiation_239() { assert_eq!(::std::mem::size_of::<[u64; 28usize]>() , 224usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32376,7 +35479,29 @@ pub mod root { [u64; 28usize] ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_207465() { + fn __bindgen_test_layout_MutableHandle_instantiation_240() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_241() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_242() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32387,7 +35512,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_207556() { + fn __bindgen_test_layout_DefaultDelete_instantiation_243() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32398,7 +35523,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashtable_instantiation_207560() { + fn __bindgen_test_layout_nsRefPtrHashtable_instantiation_244() { assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32409,7 +35534,29 @@ pub mod root { [u64; 5usize] ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_208749() { + fn __bindgen_test_layout_Rooted_instantiation_245() { + assert_eq!(::std::mem::size_of::<[u64; 3usize]>() , 24usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + [u64; 3usize] ) )); + assert_eq!(::std::mem::align_of::<[u64; 3usize]>() , 8usize , concat ! + ( + "Alignment of template specialization: " , stringify ! ( + [u64; 3usize] ) )); + } + #[test] + fn __bindgen_test_layout_Rooted_instantiation_246() { + assert_eq!(::std::mem::size_of::<[u64; 3usize]>() , 24usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + [u64; 3usize] ) )); + assert_eq!(::std::mem::align_of::<[u64; 3usize]>() , 8usize , concat ! + ( + "Alignment of template specialization: " , stringify ! ( + [u64; 3usize] ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_247() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32420,7 +35567,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_instantiation_209336() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_248() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32431,7 +35578,128 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_210879() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_249() { + assert_eq!(::std::mem::size_of::() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_250() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_251() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_252() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_253() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_254() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_255() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_256() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_257() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_258() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_259() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_260() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32442,7 +35710,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_210891() { + fn __bindgen_test_layout_RefPtr_instantiation_261() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32455,7 +35723,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_210890() { + fn __bindgen_test_layout_nsTArray_instantiation_262() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32468,7 +35736,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_210924() { + fn __bindgen_test_layout_nsPtrHashKey_instantiation_263() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32479,7 +35747,20 @@ pub mod root { root::nsPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_211021() { + fn __bindgen_test_layout_RefPtr_instantiation_264() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::RefPtr + ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::RefPtr + ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_instantiation_265() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32490,7 +35771,95 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_nsDataHashtable_instantiation_212794() { + fn __bindgen_test_layout_nsTArray_instantiation_266() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_267() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_268() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_269() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_270() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_271() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_272() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_273() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_nsDataHashtable_instantiation_274() { assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32501,7 +35870,7 @@ pub mod root { [u64; 5usize] ) )); } #[test] - fn __bindgen_test_layout_OwningNonNull_instantiation_212833() { + fn __bindgen_test_layout_OwningNonNull_instantiation_275() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32514,7 +35883,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_212856() { + fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_276() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32525,7 +35894,7 @@ pub mod root { root::nsRefPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_212892() { + fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_277() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32536,7 +35905,18 @@ pub mod root { root::nsRefPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_213455() { + fn __bindgen_test_layout_nsCOMPtr_instantiation_278() { + assert_eq!(::std::mem::size_of::() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_DefaultDelete_instantiation_279() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32547,7 +35927,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_213469() { + fn __bindgen_test_layout_already_AddRefed_instantiation_280() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32558,7 +35938,7 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_nsMainThreadPtrHolder_instantiation_213473() { + fn __bindgen_test_layout_nsMainThreadPtrHolder_instantiation_281() { assert_eq!(::std::mem::size_of::>() , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32569,7 +35949,62 @@ pub mod root { root::nsMainThreadPtrHolder ) )); } #[test] - fn __bindgen_test_layout_nsPtrHashKey_instantiation_213547() { + fn __bindgen_test_layout_already_AddRefed_instantiation_282() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_283() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_284() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_285() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_286() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_nsPtrHashKey_instantiation_287() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32580,7 +36015,18 @@ pub mod root { root::nsPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_213834() { + fn __bindgen_test_layout_already_AddRefed_instantiation_288() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_DefaultDelete_instantiation_289() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32591,7 +36037,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_213832() { + fn __bindgen_test_layout_UniquePtr_instantiation_290() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32602,7 +36048,7 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_213840() { + fn __bindgen_test_layout_DefaultDelete_instantiation_291() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32613,7 +36059,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_213838() { + fn __bindgen_test_layout_UniquePtr_instantiation_292() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32624,18 +36070,18 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_214110() { - assert_eq!(::std::mem::size_of::<[u64; 2usize]>() , 16usize , concat ! - ( + fn __bindgen_test_layout_already_AddRefed_instantiation_293() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 2usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 2usize]>() , 8usize , concat ! - ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 2usize] ) )); + root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_SupportsWeakPtr_instantiation_214277() { + fn __bindgen_test_layout_SupportsWeakPtr_instantiation_294() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( u64 ) )); @@ -32644,7 +36090,40 @@ pub mod root { u64 ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_214432() { + fn __bindgen_test_layout_nsTArray_instantiation_295() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_296() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_297() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_Maybe_instantiation_298() { assert_eq!(::std::mem::size_of::<[u32; 3usize]>() , 12usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32655,7 +36134,18 @@ pub mod root { [u32; 3usize] ) )); } #[test] - fn __bindgen_test_layout_already_AddRefed_instantiation_214447() { + fn __bindgen_test_layout_Maybe_instantiation_299() { + assert_eq!(::std::mem::size_of::<[u32; 3usize]>() , 12usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + [u32; 3usize] ) )); + assert_eq!(::std::mem::align_of::<[u32; 3usize]>() , 4usize , concat ! + ( + "Alignment of template specialization: " , stringify ! ( + [u32; 3usize] ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_300() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32666,7 +36156,18 @@ pub mod root { root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_214455() { + fn __bindgen_test_layout_already_AddRefed_instantiation_301() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_DefaultDelete_instantiation_302() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32677,7 +36178,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_instantiation_214453() { + fn __bindgen_test_layout_UniquePtr_instantiation_303() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32688,7 +36189,7 @@ pub mod root { root::mozilla::UniquePtr ) )); } #[test] - fn __bindgen_test_layout_DefaultDelete_instantiation_214494() { + fn __bindgen_test_layout_DefaultDelete_instantiation_304() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32699,7 +36200,62 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_pair_instantiation_214645() { + fn __bindgen_test_layout_UniquePtr_instantiation_305() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_306() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_Maybe_instantiation_307() { + assert_eq!(::std::mem::size_of::<[u32; 3usize]>() , 12usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + [u32; 3usize] ) )); + assert_eq!(::std::mem::align_of::<[u32; 3usize]>() , 4usize , concat ! + ( + "Alignment of template specialization: " , stringify ! ( + [u32; 3usize] ) )); + } + #[test] + fn __bindgen_test_layout_DefaultDelete_instantiation_308() { + assert_eq!(::std::mem::size_of::() , + 1usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::() , + 1usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::DefaultDelete ) )); + } + #[test] + fn __bindgen_test_layout_DefaultDelete_instantiation_309() { + assert_eq!(::std::mem::size_of::() , + 1usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::() , + 1usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::DefaultDelete ) )); + } + #[test] + fn __bindgen_test_layout_pair_instantiation_310() { assert_eq!(::std::mem::size_of::>() , 32usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32710,7 +36266,7 @@ pub mod root { root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_214644() { + fn __bindgen_test_layout_nsTArray_instantiation_311() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( @@ -32725,18 +36281,139 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_215667() { - assert_eq!(::std::mem::size_of::>() + fn __bindgen_test_layout_already_AddRefed_instantiation_312() { + assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - root::RefPtr ) )); - assert_eq!(::std::mem::align_of::>() + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - root::RefPtr ) )); + root::already_AddRefed ) )); } #[test] - fn __bindgen_test_layout_BaseTimeDuration_instantiation_219659() { + fn __bindgen_test_layout_nsTArray_instantiation_313() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_314() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_315() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_instantiation_316() { + assert_eq!(::std::mem::size_of::() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsStyleAutoArray_instantiation_317() { + assert_eq!(::std::mem::size_of::>() + , 64usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsStyleAutoArray ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsStyleAutoArray ) )); + } + #[test] + fn __bindgen_test_layout_DefaultDelete_instantiation_318() { + assert_eq!(::std::mem::size_of::() , + 1usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::() , + 1usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::DefaultDelete ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_instantiation_319() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + } + #[test] + fn __bindgen_test_layout_DefaultDelete_instantiation_320() { + assert_eq!(::std::mem::size_of::() , + 1usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::DefaultDelete ) )); + assert_eq!(::std::mem::align_of::() , + 1usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::DefaultDelete ) )); + } + #[test] + fn __bindgen_test_layout_UniquePtr_instantiation_321() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::mozilla::UniquePtr ) )); + } + #[test] + fn __bindgen_test_layout_Maybe_instantiation_322() { + assert_eq!(::std::mem::size_of::<[u64; 18usize]>() , 144usize , concat + ! ( + "Size of template specialization: " , stringify ! ( + [u64; 18usize] ) )); + assert_eq!(::std::mem::align_of::<[u64; 18usize]>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + [u64; 18usize] ) )); + } + #[test] + fn __bindgen_test_layout_Maybe_instantiation_323() { + assert_eq!(::std::mem::size_of::<[u64; 18usize]>() , 144usize , concat + ! ( + "Size of template specialization: " , stringify ! ( + [u64; 18usize] ) )); + assert_eq!(::std::mem::align_of::<[u64; 18usize]>() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + [u64; 18usize] ) )); + } + #[test] + fn __bindgen_test_layout_BaseTimeDuration_instantiation_324() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32747,7 +36424,86 @@ pub mod root { root::mozilla::BaseTimeDuration ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_220251() { + fn __bindgen_test_layout_already_AddRefed_instantiation_325() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_326() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_327() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsIContent> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsIContent> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_328() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsIContent> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<*mut root::nsIContent> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_instantiation_329() { + assert_eq!(::std::mem::size_of::() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] + fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_330() { + assert_eq!(::std::mem::size_of::>() + , 16usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsRefPtrHashKey + ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsRefPtrHashKey + ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_331() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_332() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32760,29 +36516,29 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_220507() { - assert_eq!(::std::mem::size_of::<[u64; 2usize]>() , 16usize , concat ! - ( + fn __bindgen_test_layout_Handle_instantiation_333() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 2usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 2usize]>() , 8usize , concat ! - ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 2usize] ) )); + root::JS::Handle<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_Maybe_instantiation_220514() { - assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat ! - ( + fn __bindgen_test_layout_Handle_instantiation_334() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( - [u64; 5usize] ) )); - assert_eq!(::std::mem::align_of::<[u64; 5usize]>() , 8usize , concat ! - ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( - [u64; 5usize] ) )); + root::JS::Handle<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_RefPtr_instantiation_220689() { + fn __bindgen_test_layout_RefPtr_instantiation_335() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32793,7 +36549,29 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_Sequence_instantiation_220933() { + fn __bindgen_test_layout_Handle_instantiation_336() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_337() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_Sequence_instantiation_338() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( u64 ) )); @@ -32802,7 +36580,102 @@ pub mod root { u64 ) )); } #[test] - fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_221232() { + fn __bindgen_test_layout_Handle_instantiation_339() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_Sequence_instantiation_340() { + assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) + )); + assert_eq!(::std::mem::align_of::() , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + u64 ) )); + } + #[test] + fn __bindgen_test_layout_Sequence_instantiation_341() { + assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( u64 ) + )); + assert_eq!(::std::mem::align_of::() , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + u64 ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_342() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_343() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_344() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_345() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle ) )); + } + #[test] + fn __bindgen_test_layout_MutableHandle_instantiation_346() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::MutableHandle ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_347() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_nsRefPtrHashKey_instantiation_348() { assert_eq!(::std::mem::size_of::>() , 16usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32813,7 +36686,7 @@ pub mod root { root::nsRefPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_nsClassHashtable_instantiation_221231() { + fn __bindgen_test_layout_nsClassHashtable_instantiation_349() { assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32824,7 +36697,51 @@ pub mod root { [u64; 5usize] ) )); } #[test] - fn __bindgen_test_layout_nsTArray_instantiation_222483() { + fn __bindgen_test_layout_Handle_instantiation_350() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_351() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray<::nsstring::nsStringRepr> ) )); + } + #[test] + fn __bindgen_test_layout_already_AddRefed_instantiation_352() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::already_AddRefed ) )); + } + #[test] + fn __bindgen_test_layout_Handle_instantiation_353() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::JS::Handle<*mut root::JSObject> ) )); + } + #[test] + fn __bindgen_test_layout_nsTArray_instantiation_354() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -32835,7 +36752,7 @@ pub mod root { root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); } #[test] - fn __bindgen_test_layout_nsAutoPtr_instantiation_222519() { + fn __bindgen_test_layout_nsAutoPtr_instantiation_355() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( From 2ca25817fa0e30c379a72d03fb2b3c7bd4f24c78 Mon Sep 17 00:00:00 2001 From: Servo VCS Sync Date: Sun, 21 May 2017 06:13:11 +0000 Subject: [PATCH 50/56] No bug - Revendor rust dependencies --- third_party/rust/bindgen/.cargo-checksum.json | 2 +- .../rust/bindgen/.github/ISSUE_TEMPLATE.md | 2 +- third_party/rust/bindgen/Cargo.toml | 5 +- third_party/rust/bindgen/ci/test.sh | 2 + third_party/rust/bindgen/src/codegen/mod.rs | 971 ++++++++++-------- .../rust/bindgen/src/codegen/struct_layout.rs | 47 +- third_party/rust/bindgen/src/ir/comp.rs | 716 +++++++++++-- third_party/rust/bindgen/src/ir/context.rs | 41 +- third_party/rust/bindgen/src/ir/dot.rs | 2 +- third_party/rust/bindgen/src/ir/item.rs | 30 +- third_party/rust/bindgen/src/ir/template.rs | 64 +- third_party/rust/bindgen/src/ir/ty.rs | 26 +- third_party/rust/bindgen/src/lib.rs | 1 + .../rust/clang-sys/.cargo-checksum.json | 2 +- third_party/rust/clang-sys/CHANGELOG.md | 7 +- third_party/rust/clang-sys/Cargo.toml | 2 +- third_party/rust/clang-sys/README.md | 13 +- third_party/rust/clang-sys/build.rs | 38 +- .../peeking_take_while/.cargo-checksum.json | 1 + third_party/rust/peeking_take_while/.cargo-ok | 0 .../rust/peeking_take_while/.gitignore | 3 + .../rust/peeking_take_while/.travis.yml | 18 + .../rust/peeking_take_while/Cargo.toml | 14 + .../rust/peeking_take_while/LICENSE-APACHE | 201 ++++ .../rust/peeking_take_while/LICENSE-MIT | 25 + third_party/rust/peeking_take_while/README.md | 58 ++ .../rust/peeking_take_while/src/lib.rs | 117 +++ toolkit/library/gtest/rust/Cargo.lock | 19 +- toolkit/library/rust/Cargo.lock | 19 +- 29 files changed, 1869 insertions(+), 577 deletions(-) create mode 100644 third_party/rust/peeking_take_while/.cargo-checksum.json create mode 100644 third_party/rust/peeking_take_while/.cargo-ok create mode 100644 third_party/rust/peeking_take_while/.gitignore create mode 100644 third_party/rust/peeking_take_while/.travis.yml create mode 100644 third_party/rust/peeking_take_while/Cargo.toml create mode 100644 third_party/rust/peeking_take_while/LICENSE-APACHE create mode 100644 third_party/rust/peeking_take_while/LICENSE-MIT create mode 100644 third_party/rust/peeking_take_while/README.md create mode 100644 third_party/rust/peeking_take_while/src/lib.rs diff --git a/third_party/rust/bindgen/.cargo-checksum.json b/third_party/rust/bindgen/.cargo-checksum.json index 171141142cd7..d5f482c09426 100644 --- a/third_party/rust/bindgen/.cargo-checksum.json +++ b/third_party/rust/bindgen/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".github/ISSUE_TEMPLATE.md":"0e894c174dc24acfc0a20439f7c0d700fcc2fc81b4c1aea00a259c3dc7ab44fb",".gitignore":"f83c74c38844f7e2adaf3f030f24945cf0f22e027b0bbf13fffb0057d6bf7ebf",".travis.yml":"5cb7111daf589d0379e3cd7c799cec2e6408f310765be81db549a1808cde6046","CONTRIBUTING.md":"113197274ed6ca925acf05330d9bae11141bc8e2ab11ae497697fa04df76f33e","Cargo.toml":"ca8088d86e128d0b4977bb8a268a6782632bde54d912fc98ff71d8bf8ab7aaa3","LICENSE":"1d2e4bdb9d94ab020e9550136cae9ec73fc699c3c96a9d98078c542e9b93d294","README.md":"a9de10e2422217cb41cac812694eedc82c2c429d18721af05a38f4593d56347c","book/.gitignore":"3c4dbff9eeda9410a0b9eb423472981db8997d666388b4cd2424700c3974d64b","book/book.toml":"dbf931141036d1d0eb02b326f7f5d7867dd9a8f0fc49b66b8fd97e9873c08e44","book/src/SUMMARY.md":"7bb880df58bbe6e4a6f103ce4fe4835e6499b2005db1b621d5c6ee26982a6f64","book/src/blacklisting.md":"a68424cc3643e06e83c5ea4efd5eb501dc64229ff9f4286b9a210a2376c20a9b","book/src/chapter_1.md":"cac4f4a3609ec22eb519b0e07d1d1bdc15ac3d741f29f9b97280f700b96ded66","book/src/command-line-usage.md":"9e3ae32cb5d893f1a93fc539149950bacdf43a18c694169fa45dfe8080617403","book/src/cpp.md":"6dab1a9997d2f30b69ba78c19ddefe48b7033a3ec247b573dba96b6be047e582","book/src/customizing-generated-bindings.md":"0363ca69719c5e24d624ac3adfef71445896d3ed2b7bb3689c7905e47bdd9cdd","book/src/introduction.md":"b6b0cdcf67ad428f53b667449e309712c617b80fade6afcf598bc58dc6bf58fa","book/src/library-usage.md":"62565cf21a6b07a9de9a3f525427e75aa0f05350a1f546ed428c8a6c40cf850c","book/src/nocopy.md":"615f9b2ae474adf32ddf49e2f29f019f857db0fbb3232ed30df3960edd9f3406","book/src/opaque.md":"d6a5d6b7dfad4e8e1f7a1307f57a0a4b723032970bbae0e1290e1ab81e08b21a","book/src/replacing-types.md":"f406f7135299cd4e67a017237a6a9acbe936aa48f37b7f52be2769c90537b73f","book/src/requirements.md":"23c71db101ccce73b46a0273fa81bc4cb1f2271499fb15f7c7befd8c95ec3bbe","book/src/tutorial-0.md":"4f46c7f76056231f8c4dc7e21dc06d7adad44b4e25a44c46c821684df023bd24","book/src/tutorial-1.md":"e6e6bb4dbdcf968d516a2da039a57f6153a21bd67167d709dc2abc6614372b1e","book/src/tutorial-2.md":"f6c9cf4ea8e38628c15dedc0ee7f60055a2aa841e95f972465d2932bb71878ad","book/src/tutorial-3.md":"112eb7ae1a1194cd82890ca3301beb309b0fa5f1ca2942db5af25f2654b06b1b","book/src/tutorial-4.md":"840edccb116f59229a2132041b5ec532f903ca90ec9904a3d1b6847779e62a66","book/src/tutorial-5.md":"45a3034e2ad8d701a8cc5d2e5e34fb427486f1ebddeff3a91a9567a1b3b668d8","book/src/tutorial-6.md":"e92a5188366108495dc1e989a1ed77c31a71b09b4c3e48936c9445b49bcc466b","book/src/whitelisting.md":"b6913e3fc43d28f504331afe4ccc3607caad9aa88d4cb627a86bdc1e72ea0175","build.rs":"e19f3db33a88f9217acef718eda6fcb6bf33949297c9f2b2bf444ce32b279a4e","ci/assert-docs.sh":"5d8ba2280bb03b9d975d2290cf9ec8f1344dafa61a3f5e2ace763019502e4e92","ci/assert-no-diff.sh":"af208c40d412e2bce82ae9b4a4e52cae4ae0b4beef9f93eb825bf5d5346a70b2","ci/assert-rustfmt.sh":"b9c810e86ea6d71bce1d6bf8d896839cfe2c198338e042ebc744b75e83af1126","ci/before_install.sh":"51409851cf4e1dee27735461e77247c599e023259c3a57e82fa044f284ca8e87","ci/deploy-book.sh":"2dc27d6252ed0f9e5e9fd5729f6087d20c6f0901ae2a470e3436f1c324623455","ci/test-book.sh":"3b8892a6c4e1f840349d2cfadff5a5e5b7ddf28b4b11e9cafd92cfe9c8d6d8c6","ci/test.sh":"495d4d0dcb8251a6be866c7e2bd090dcb63534103926c455159a5d4a097440a7","example-graphviz-ir.png":"e1122ab33b4c80e8c9c0cf8abea404c1192f9b2eef97f5766e86103cc95d5e01","rustfmt.toml":"c4f3b593bdd634590df22aaf7b0872244d5c2169aacd0274a05e4aca4708a8d3","src/callbacks.rs":"e0d36d30adac8a4eaab64f0a9df0ab29026fcd5f5c5588bdeb2ad762e4c024ad","src/clang.rs":"b160cd41a0b80aa204c85c6fd8800d31887529ef21a21d08e32585b71ee55576","src/codegen/error.rs":"2613af1d833377fd4a70719f4a09951d9d45dc9227827b9a2a938a1bcaaea2dd","src/codegen/helpers.rs":"4bbb92c587e881466ac4d343ada69f4a7a8edea8c484cf142664dade7c150acc","src/codegen/mod.rs":"239dd32206b62d542267817b1ced2d3aca975e243e685c5458010503719b832e","src/codegen/struct_layout.rs":"c485bed7bc4e0f02cd0a5e15b5d30d7756a90ffec0417f0202ad56ddb078561f","src/extra_assertions.rs":"449549c4a7a50c3f0b06332452b2fb6c9b23f31ca8e5e1656fe6c7f21e8ef7fa","src/ir/annotations.rs":"887ad7beaa43eddd60337b67951a109c2e7f51cb8e757b35cad45f744b7ba919","src/ir/comp.rs":"d674a06f569a807f57ce659dac9145ad3a02008ad895119e3b6d0869f1797b96","src/ir/context.rs":"7b6011adacb6abe2ac5ae8155d6a67d72bbf0546d1e73b00aee62856a75c4809","src/ir/derive.rs":"8706a8e3c4ccd2135d0eb9ec8c0e02008609604bce42cad2974f3ca7d2ca7d91","src/ir/dot.rs":"412da1e6ec7259c73266c437b7d5ee898d3116c00be2edbd8a69dc847c444d94","src/ir/enum_ty.rs":"cb552126907501e78a8c98a2d107c825842a45ab3fad8b656bdaf9925d0cdfd9","src/ir/function.rs":"b86146b0a3e8089d92c86ac9695b508cdeda4d0cc8f2937a131ea627dc151acd","src/ir/int.rs":"b7bc19668ca6c7c084a3f8d1e07d5a980ee49c0c9a8882c3e72baab4ea7fa403","src/ir/item.rs":"5df3c6d331b09773555f853b7d935303470d9e9b4f4f37ce3de28347d0494619","src/ir/item_kind.rs":"64b8b5bede6dfe950ceb15da1aabf888707eeb5883df9213f05ee47797bfb84f","src/ir/layout.rs":"9676218f0f25769573eb4ba848b7a8030501fc08c28b40f13a21e4fa5ee44d4e","src/ir/mod.rs":"74631e1006639aaf13e8b251efef9788b9e80b55df5b8b1fb2c484845450a196","src/ir/module.rs":"7bd8273e7001ca3d2f084e4374e21eb9f13f087bbd901849cf617e75fb712050","src/ir/named.rs":"ac96cb1a9f4ae3e9fa6494b3d97d8f30acffa180838f8ddd1392a7c168352c2d","src/ir/objc.rs":"353be93027d74ad102ac3b0ef8754dd1258a400dcf7d361fa224fdf1ab973c56","src/ir/template.rs":"35b1e216dc4f8ef904a076cee887b165dee45318a24a71bc18c794f77fa065bb","src/ir/traversal.rs":"02f25e1cad8f8630408a5b08aa5cc1d2dc97301455ef0fbb349f9f21d1334f2a","src/ir/ty.rs":"091a25e98d8bbaccc764cd1f2698493ed87128994de1f07e2fed272e81715958","src/ir/var.rs":"8d81a8227709dbe879f9aa39b7cd6c99870d1f68cd1113be03fa34a580eef43f","src/lib.rs":"c96696a54767238d7b412a955445eb72f7ab18386b0ad3dbcfea8b478660d25a","src/log_stubs.rs":"6dfdd908b7c6453da416cf232893768f9480e551ca4add0858ef88bf71ee6ceb","src/main.rs":"fdd6a6810806fa40e6bb6001be691eeaad5439ebc462ccf1d779d20ac63d6fad","src/options.rs":"c8af158043a61a90bb11005aad9515e852a89cf758322faed2dd3ec8faa641f2","src/parse.rs":"6d88e1dcdb4e99f4f65629ce205c14e18097773bc938973f8e3849ba3bda4f79","src/regex_set.rs":"6c46877238c338e1fc6a35a8983db21f0711c979e44310975f60ad73a50fdbbc","src/uses.rs":"b46a9b540c39d23fa1c22c8b5325d00486348a2aec2464deada524a6b96ebec2"},"package":"ccaf8958532d7e570e905266ee2dc1094c3e5c3c3cfc2c299368747a30a5e654"} \ No newline at end of file +{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".github/ISSUE_TEMPLATE.md":"213c5948f132f0855d1efee494beb6fae1f010d25791c19c702982157961bc96",".gitignore":"f83c74c38844f7e2adaf3f030f24945cf0f22e027b0bbf13fffb0057d6bf7ebf",".travis.yml":"5cb7111daf589d0379e3cd7c799cec2e6408f310765be81db549a1808cde6046","CONTRIBUTING.md":"113197274ed6ca925acf05330d9bae11141bc8e2ab11ae497697fa04df76f33e","Cargo.toml":"69ab16a0990af676c19c8202ecc475f455f03445ea6a915a4935cc1ffb445be7","LICENSE":"1d2e4bdb9d94ab020e9550136cae9ec73fc699c3c96a9d98078c542e9b93d294","README.md":"a9de10e2422217cb41cac812694eedc82c2c429d18721af05a38f4593d56347c","book/.gitignore":"3c4dbff9eeda9410a0b9eb423472981db8997d666388b4cd2424700c3974d64b","book/book.toml":"dbf931141036d1d0eb02b326f7f5d7867dd9a8f0fc49b66b8fd97e9873c08e44","book/src/SUMMARY.md":"7bb880df58bbe6e4a6f103ce4fe4835e6499b2005db1b621d5c6ee26982a6f64","book/src/blacklisting.md":"a68424cc3643e06e83c5ea4efd5eb501dc64229ff9f4286b9a210a2376c20a9b","book/src/chapter_1.md":"cac4f4a3609ec22eb519b0e07d1d1bdc15ac3d741f29f9b97280f700b96ded66","book/src/command-line-usage.md":"9e3ae32cb5d893f1a93fc539149950bacdf43a18c694169fa45dfe8080617403","book/src/cpp.md":"6dab1a9997d2f30b69ba78c19ddefe48b7033a3ec247b573dba96b6be047e582","book/src/customizing-generated-bindings.md":"0363ca69719c5e24d624ac3adfef71445896d3ed2b7bb3689c7905e47bdd9cdd","book/src/introduction.md":"b6b0cdcf67ad428f53b667449e309712c617b80fade6afcf598bc58dc6bf58fa","book/src/library-usage.md":"62565cf21a6b07a9de9a3f525427e75aa0f05350a1f546ed428c8a6c40cf850c","book/src/nocopy.md":"615f9b2ae474adf32ddf49e2f29f019f857db0fbb3232ed30df3960edd9f3406","book/src/opaque.md":"d6a5d6b7dfad4e8e1f7a1307f57a0a4b723032970bbae0e1290e1ab81e08b21a","book/src/replacing-types.md":"f406f7135299cd4e67a017237a6a9acbe936aa48f37b7f52be2769c90537b73f","book/src/requirements.md":"23c71db101ccce73b46a0273fa81bc4cb1f2271499fb15f7c7befd8c95ec3bbe","book/src/tutorial-0.md":"4f46c7f76056231f8c4dc7e21dc06d7adad44b4e25a44c46c821684df023bd24","book/src/tutorial-1.md":"e6e6bb4dbdcf968d516a2da039a57f6153a21bd67167d709dc2abc6614372b1e","book/src/tutorial-2.md":"f6c9cf4ea8e38628c15dedc0ee7f60055a2aa841e95f972465d2932bb71878ad","book/src/tutorial-3.md":"112eb7ae1a1194cd82890ca3301beb309b0fa5f1ca2942db5af25f2654b06b1b","book/src/tutorial-4.md":"840edccb116f59229a2132041b5ec532f903ca90ec9904a3d1b6847779e62a66","book/src/tutorial-5.md":"45a3034e2ad8d701a8cc5d2e5e34fb427486f1ebddeff3a91a9567a1b3b668d8","book/src/tutorial-6.md":"e92a5188366108495dc1e989a1ed77c31a71b09b4c3e48936c9445b49bcc466b","book/src/whitelisting.md":"b6913e3fc43d28f504331afe4ccc3607caad9aa88d4cb627a86bdc1e72ea0175","build.rs":"e19f3db33a88f9217acef718eda6fcb6bf33949297c9f2b2bf444ce32b279a4e","ci/assert-docs.sh":"5d8ba2280bb03b9d975d2290cf9ec8f1344dafa61a3f5e2ace763019502e4e92","ci/assert-no-diff.sh":"af208c40d412e2bce82ae9b4a4e52cae4ae0b4beef9f93eb825bf5d5346a70b2","ci/assert-rustfmt.sh":"b9c810e86ea6d71bce1d6bf8d896839cfe2c198338e042ebc744b75e83af1126","ci/before_install.sh":"51409851cf4e1dee27735461e77247c599e023259c3a57e82fa044f284ca8e87","ci/deploy-book.sh":"2dc27d6252ed0f9e5e9fd5729f6087d20c6f0901ae2a470e3436f1c324623455","ci/test-book.sh":"3b8892a6c4e1f840349d2cfadff5a5e5b7ddf28b4b11e9cafd92cfe9c8d6d8c6","ci/test.sh":"6e8bb39c327dbc5c709be0e50bd288bfe27efdb5c9cdfd276f97c31a951f8ff0","example-graphviz-ir.png":"e1122ab33b4c80e8c9c0cf8abea404c1192f9b2eef97f5766e86103cc95d5e01","rustfmt.toml":"c4f3b593bdd634590df22aaf7b0872244d5c2169aacd0274a05e4aca4708a8d3","src/callbacks.rs":"e0d36d30adac8a4eaab64f0a9df0ab29026fcd5f5c5588bdeb2ad762e4c024ad","src/clang.rs":"b160cd41a0b80aa204c85c6fd8800d31887529ef21a21d08e32585b71ee55576","src/codegen/error.rs":"2613af1d833377fd4a70719f4a09951d9d45dc9227827b9a2a938a1bcaaea2dd","src/codegen/helpers.rs":"4bbb92c587e881466ac4d343ada69f4a7a8edea8c484cf142664dade7c150acc","src/codegen/mod.rs":"14faa66df26851dab9567bc7e54410113d930a801c34fbff856a044074f6386a","src/codegen/struct_layout.rs":"130cf8a2e1cb8348a13e05904af2300333b51bf72cd63f3ec696b768a4a6b52d","src/extra_assertions.rs":"449549c4a7a50c3f0b06332452b2fb6c9b23f31ca8e5e1656fe6c7f21e8ef7fa","src/ir/annotations.rs":"887ad7beaa43eddd60337b67951a109c2e7f51cb8e757b35cad45f744b7ba919","src/ir/comp.rs":"359db14fc67b3c9815690ec0d95f23de4811b6f8095d568d0726328930d09cd8","src/ir/context.rs":"9b0670cc11fdfe4e7751bd1b083c288af492a3ad02c081cbd615bc4002b88b4b","src/ir/derive.rs":"8706a8e3c4ccd2135d0eb9ec8c0e02008609604bce42cad2974f3ca7d2ca7d91","src/ir/dot.rs":"d9b60aab08949a6d597d2fe000401c021f3cfff8805cd7ad02b8f22824e4525d","src/ir/enum_ty.rs":"cb552126907501e78a8c98a2d107c825842a45ab3fad8b656bdaf9925d0cdfd9","src/ir/function.rs":"b86146b0a3e8089d92c86ac9695b508cdeda4d0cc8f2937a131ea627dc151acd","src/ir/int.rs":"b7bc19668ca6c7c084a3f8d1e07d5a980ee49c0c9a8882c3e72baab4ea7fa403","src/ir/item.rs":"e42d779600f034c25094d50bab9f2aa7f9cc0ff12f9680d616433d72deb574ae","src/ir/item_kind.rs":"64b8b5bede6dfe950ceb15da1aabf888707eeb5883df9213f05ee47797bfb84f","src/ir/layout.rs":"9676218f0f25769573eb4ba848b7a8030501fc08c28b40f13a21e4fa5ee44d4e","src/ir/mod.rs":"74631e1006639aaf13e8b251efef9788b9e80b55df5b8b1fb2c484845450a196","src/ir/module.rs":"7bd8273e7001ca3d2f084e4374e21eb9f13f087bbd901849cf617e75fb712050","src/ir/named.rs":"ac96cb1a9f4ae3e9fa6494b3d97d8f30acffa180838f8ddd1392a7c168352c2d","src/ir/objc.rs":"353be93027d74ad102ac3b0ef8754dd1258a400dcf7d361fa224fdf1ab973c56","src/ir/template.rs":"35d4202ddf15bdac6ab5085bc8bdfc0fc44e0a8650ab6e49592b72252a16ebba","src/ir/traversal.rs":"02f25e1cad8f8630408a5b08aa5cc1d2dc97301455ef0fbb349f9f21d1334f2a","src/ir/ty.rs":"283975ede4c84c6cdae3a75b7015b645fce42898fdfc0f24d47877c324cff0e2","src/ir/var.rs":"8d81a8227709dbe879f9aa39b7cd6c99870d1f68cd1113be03fa34a580eef43f","src/lib.rs":"582151beb761a1c14cca0fb3ddf805b9f216b07f5ec6dfc4fd6270e3c4a337aa","src/log_stubs.rs":"6dfdd908b7c6453da416cf232893768f9480e551ca4add0858ef88bf71ee6ceb","src/main.rs":"fdd6a6810806fa40e6bb6001be691eeaad5439ebc462ccf1d779d20ac63d6fad","src/options.rs":"c8af158043a61a90bb11005aad9515e852a89cf758322faed2dd3ec8faa641f2","src/parse.rs":"6d88e1dcdb4e99f4f65629ce205c14e18097773bc938973f8e3849ba3bda4f79","src/regex_set.rs":"6c46877238c338e1fc6a35a8983db21f0711c979e44310975f60ad73a50fdbbc","src/uses.rs":"b46a9b540c39d23fa1c22c8b5325d00486348a2aec2464deada524a6b96ebec2"},"package":"708a688675f9d2e7c73018e17f5997beacc9a5ca87a0cb60c13093915facda32"} \ No newline at end of file diff --git a/third_party/rust/bindgen/.github/ISSUE_TEMPLATE.md b/third_party/rust/bindgen/.github/ISSUE_TEMPLATE.md index 33b65a200f69..c10fab0f7bdb 100644 --- a/third_party/rust/bindgen/.github/ISSUE_TEMPLATE.md +++ b/third_party/rust/bindgen/.github/ISSUE_TEMPLATE.md @@ -4,7 +4,7 @@ // Insert your (minimal) C/C++ header here. ``` -### Bindgen Invokation +### Bindgen Invocation diff --git a/third_party/rust/bindgen/Cargo.toml b/third_party/rust/bindgen/Cargo.toml index 86d0451c95cc..8d477662bf8a 100644 --- a/third_party/rust/bindgen/Cargo.toml +++ b/third_party/rust/bindgen/Cargo.toml @@ -13,7 +13,7 @@ name = "bindgen" readme = "README.md" repository = "https://github.com/servo/rust-bindgen" documentation = "https://docs.rs/bindgen" -version = "0.25.0" +version = "0.25.1" build = "build.rs" exclude = [ @@ -44,8 +44,9 @@ quasi_codegen = "0.32" [dependencies] cexpr = "0.2" cfg-if = "0.1.0" -clang-sys = { version = "0.17.0", features = ["runtime", "clang_3_9"] } +clang-sys = { version = "0.18.0", features = ["runtime", "clang_3_9"] } lazy_static = "0.2.1" +peeking_take_while = "0.1.2" syntex_syntax = "0.58" regex = "0.2" # This kinda sucks: https://github.com/rust-lang/cargo/issues/1982 diff --git a/third_party/rust/bindgen/ci/test.sh b/third_party/rust/bindgen/ci/test.sh index f14b7b968762..011ac7372df8 100755 --- a/third_party/rust/bindgen/ci/test.sh +++ b/third_party/rust/bindgen/ci/test.sh @@ -3,6 +3,8 @@ set -xeu cd "$(dirname "$0")/.." +export RUST_BACKTRACE=1 + # Regenerate the test headers' bindings in debug and release modes, and assert # that we always get the expected generated bindings. diff --git a/third_party/rust/bindgen/src/codegen/mod.rs b/third_party/rust/bindgen/src/codegen/mod.rs index 6f9685b579f5..2f8ad805704b 100644 --- a/third_party/rust/bindgen/src/codegen/mod.rs +++ b/third_party/rust/bindgen/src/codegen/mod.rs @@ -1,14 +1,16 @@ mod error; mod helpers; -mod struct_layout; +pub mod struct_layout; use self::helpers::{BlobTyBuilder, attributes}; -use self::struct_layout::{StructLayoutTracker, bytes_from_bits_pow2}; -use self::struct_layout::{align_to, bytes_from_bits}; +use self::struct_layout::StructLayoutTracker; + use aster; +use aster::struct_field::StructFieldBuilder; use ir::annotations::FieldAccessorKind; -use ir::comp::{Base, CompInfo, CompKind, Field, Method, MethodKind}; +use ir::comp::{Base, BitfieldUnit, Bitfield, CompInfo, CompKind, Field, + FieldData, FieldMethods, Method, MethodKind}; use ir::context::{BindgenContext, ItemId}; use ir::derive::{CanDeriveCopy, CanDeriveDebug, CanDeriveDefault}; use ir::dot; @@ -27,7 +29,6 @@ use ir::var::Var; use std::borrow::Cow; use std::cell::Cell; -use std::cmp; use std::collections::{HashSet, VecDeque}; use std::collections::hash_map::{Entry, HashMap}; use std::fmt::Write; @@ -736,110 +737,463 @@ impl<'a> TryToRustTy for Vtable<'a> { } } -struct Bitfield<'a> { - index: &'a mut usize, - fields: Vec<&'a Field>, -} +impl CodeGenerator for TemplateInstantiation { + type Extra = Item; -impl<'a> Bitfield<'a> { - fn new(index: &'a mut usize, fields: Vec<&'a Field>) -> Self { - Bitfield { - index: index, - fields: fields, + fn codegen<'a>(&self, + ctx: &BindgenContext, + result: &mut CodegenResult<'a>, + _whitelisted_items: &ItemSet, + item: &Item) { + // Although uses of instantiations don't need code generation, and are + // just converted to rust types in fields, vars, etc, we take this + // opportunity to generate tests for their layout here. + if !ctx.options().layout_tests { + return + } + + let layout = item.kind().expect_type().layout(ctx); + + if let Some(layout) = layout { + let size = layout.size; + let align = layout.align; + + let name = item.canonical_name(ctx); + let fn_name = format!("__bindgen_test_layout_{}_instantiation_{}", + name, item.exposed_id(ctx)); + + let fn_name = ctx.rust_ident_raw(&fn_name); + + let prefix = ctx.trait_prefix(); + let ident = item.to_rust_ty_or_opaque(ctx, &()); + let size_of_expr = quote_expr!(ctx.ext_cx(), + ::$prefix::mem::size_of::<$ident>()); + let align_of_expr = quote_expr!(ctx.ext_cx(), + ::$prefix::mem::align_of::<$ident>()); + + let item = quote_item!( + ctx.ext_cx(), + #[test] + fn $fn_name() { + assert_eq!($size_of_expr, $size, + concat!("Size of template specialization: ", + stringify!($ident))); + assert_eq!($align_of_expr, $align, + concat!("Alignment of template specialization: ", + stringify!($ident))); + }) + .unwrap(); + + result.push(item); } } +} - fn codegen_fields(self, - ctx: &BindgenContext, - parent: &CompInfo, - fields: &mut Vec, - methods: &mut Vec) - -> Layout { - // NOTE: What follows is reverse-engineered from LLVM's - // lib/AST/RecordLayoutBuilder.cpp - // - // FIXME(emilio): There are some differences between Microsoft and the - // Itanium ABI, but we'll ignore those and stick to Itanium for now. - // - // Also, we need to handle packed bitfields and stuff. - // TODO(emilio): Take into account C++'s wide bitfields, and - // packing, sigh. - let mut total_size_in_bits = 0; - let mut max_align = 0; - let mut unfilled_bits_in_last_unit = 0; - let mut field_size_in_bits = 0; - *self.index += 1; - let mut last_field_name = format!("_bitfield_{}", self.index); - let mut last_field_align = 0; +/// Generates an infinite number of anonymous field names. +struct AnonFieldNames(usize); - // (name, mask, width, bitfield's type, bitfield's layout) - let mut bitfields: Vec<(&str, usize, usize, ast::Ty, Layout)> = vec![]; +impl Default for AnonFieldNames { + fn default() -> AnonFieldNames { + AnonFieldNames(0) + } +} - for field in self.fields { - let width = field.bitfield().unwrap() as usize; - let field_item = ctx.resolve_item(field.ty()); - let field_ty_layout = field_item.kind() - .expect_type() - .layout(ctx) - .expect("Bitfield without layout? Gah!"); - let field_align = field_ty_layout.align; +impl Iterator for AnonFieldNames { + type Item = String; - if field_size_in_bits != 0 && - (width == 0 || width > unfilled_bits_in_last_unit) { - // We've finished a physical field, so flush it and its bitfields. - field_size_in_bits = align_to(field_size_in_bits, field_align); - fields.push(flush_bitfields(ctx, + fn next(&mut self) -> Option { + self.0 += 1; + Some(format!("__bindgen_anon_{}", self.0)) + } +} + +/// Trait for implementing the code generation of a struct or union field. +trait FieldCodegen<'a> { + type Extra; + + fn codegen(&self, + ctx: &BindgenContext, + fields_should_be_private: bool, + accessor_kind: FieldAccessorKind, + parent: &CompInfo, + anon_field_names: &mut AnonFieldNames, + result: &mut CodegenResult, + struct_layout: &mut StructLayoutTracker, + fields: &mut F, + methods: &mut M, + extra: Self::Extra) + where F: Extend, + M: Extend; +} + +impl<'a> FieldCodegen<'a> for Field { + type Extra = (); + + fn codegen(&self, + ctx: &BindgenContext, + fields_should_be_private: bool, + accessor_kind: FieldAccessorKind, + parent: &CompInfo, + anon_field_names: &mut AnonFieldNames, + result: &mut CodegenResult, + struct_layout: &mut StructLayoutTracker, + fields: &mut F, + methods: &mut M, + _: ()) + where F: Extend, + M: Extend + { + match *self { + Field::DataMember(ref data) => { + data.codegen(ctx, + fields_should_be_private, + accessor_kind, + parent, + anon_field_names, + result, + struct_layout, + fields, + methods, + ()); + } + Field::Bitfields(ref unit) => { + unit.codegen(ctx, + fields_should_be_private, + accessor_kind, + parent, + anon_field_names, + result, + struct_layout, + fields, + methods, + ()); + } + } + } +} + +impl<'a> FieldCodegen<'a> for FieldData { + type Extra = (); + + fn codegen(&self, + ctx: &BindgenContext, + fields_should_be_private: bool, + accessor_kind: FieldAccessorKind, + parent: &CompInfo, + anon_field_names: &mut AnonFieldNames, + result: &mut CodegenResult, + struct_layout: &mut StructLayoutTracker, + fields: &mut F, + methods: &mut M, + _: ()) + where F: Extend, + M: Extend + { + // Bitfields are handled by `FieldCodegen` implementations for + // `BitfieldUnit` and `Bitfield`. + assert!(self.bitfield().is_none()); + + let field_ty = ctx.resolve_type(self.ty()); + let ty = self.ty().to_rust_ty_or_opaque(ctx, &()); + + // NB: In unstable rust we use proper `union` types. + let ty = if parent.is_union() && !ctx.options().unstable_rust { + if ctx.options().enable_cxx_namespaces { + quote_ty!(ctx.ext_cx(), root::__BindgenUnionField<$ty>) + } else { + quote_ty!(ctx.ext_cx(), __BindgenUnionField<$ty>) + } + } else if let Some(item) = + field_ty.is_incomplete_array(ctx) { + result.saw_incomplete_array(); + + let inner = item.to_rust_ty_or_opaque(ctx, &()); + + if ctx.options().enable_cxx_namespaces { + quote_ty!(ctx.ext_cx(), root::__IncompleteArrayField<$inner>) + } else { + quote_ty!(ctx.ext_cx(), __IncompleteArrayField<$inner>) + } + } else { + ty + }; + + let mut attrs = vec![]; + if ctx.options().generate_comments { + if let Some(comment) = self.comment() { + attrs.push(attributes::doc(comment)); + } + } + + let field_name = self.name() + .map(|name| ctx.rust_mangle(name).into_owned()) + .unwrap_or_else(|| anon_field_names.next().unwrap()); + + if !parent.is_union() { + if let Some(padding_field) = + struct_layout.pad_field(&field_name, field_ty, self.offset()) { + fields.extend(Some(padding_field)); + } + } + + let is_private = self.annotations() + .private_fields() + .unwrap_or(fields_should_be_private); + + let accessor_kind = self.annotations() + .accessor_kind() + .unwrap_or(accessor_kind); + + let mut field = StructFieldBuilder::named(&field_name); + + if !is_private { + field = field.pub_(); + } + + let field = field.with_attrs(attrs) + .build_ty(ty.clone()); + + fields.extend(Some(field)); + + // TODO: Factor the following code out, please! + if accessor_kind == FieldAccessorKind::None { + return; + } + + let getter_name = + ctx.rust_ident_raw(&format!("get_{}", field_name)); + let mutable_getter_name = + ctx.rust_ident_raw(&format!("get_{}_mut", field_name)); + let field_name = ctx.rust_ident_raw(&field_name); + + let accessor_methods_impl = match accessor_kind { + FieldAccessorKind::None => unreachable!(), + FieldAccessorKind::Regular => { + quote_item!(ctx.ext_cx(), + impl X { + #[inline] + pub fn $getter_name(&self) -> &$ty { + &self.$field_name + } + + #[inline] + pub fn $mutable_getter_name(&mut self) -> &mut $ty { + &mut self.$field_name + } + } + ) + } + FieldAccessorKind::Unsafe => { + quote_item!(ctx.ext_cx(), + impl X { + #[inline] + pub unsafe fn $getter_name(&self) -> &$ty { + &self.$field_name + } + + #[inline] + pub unsafe fn $mutable_getter_name(&mut self) + -> &mut $ty { + &mut self.$field_name + } + } + ) + } + FieldAccessorKind::Immutable => { + quote_item!(ctx.ext_cx(), + impl X { + #[inline] + pub fn $getter_name(&self) -> &$ty { + &self.$field_name + } + } + ) + } + }; + + match accessor_methods_impl.unwrap().node { + ast::ItemKind::Impl(_, _, _, _, _, ref items) => { + methods.extend(items.clone()) + } + _ => unreachable!(), + } + } +} + +impl BitfieldUnit { + /// Get the constructor name for this bitfield unit. + fn ctor_name(&self, ctx: &BindgenContext) -> ast::Ident { + let ctor_name = format!("new_bitfield_{}", self.nth()); + ctx.ext_cx().ident_of(&ctor_name) + } + + /// Get the initial bitfield unit constructor that just returns 0. This will + /// then be extended by each bitfield in the unit. See `extend_ctor_impl` + /// below. + fn initial_ctor_impl(&self, + ctx: &BindgenContext, + unit_field_int_ty: &P) + -> P { + let ctor_name = self.ctor_name(ctx); + + // If we're generating unstable Rust, add the const. + let fn_prefix = if ctx.options().unstable_rust { + quote_tokens!(ctx.ext_cx(), pub const fn) + } else { + quote_tokens!(ctx.ext_cx(), pub fn) + }; + + quote_item!( + ctx.ext_cx(), + impl XxxUnused { + #[inline] + $fn_prefix $ctor_name() -> $unit_field_int_ty { + 0 + } + } + ).unwrap() + } +} + +impl Bitfield { + /// Extend an under construction bitfield unit constructor with this + /// bitfield. This involves two things: + /// + /// 1. Adding a parameter with this bitfield's name and its type. + /// + /// 2. Bitwise or'ing the parameter into the final value of the constructed + /// bitfield unit. + fn extend_ctor_impl(&self, + ctx: &BindgenContext, + parent: &CompInfo, + ctor_impl: P, + ctor_name: &ast::Ident, + unit_field_int_ty: &P) + -> P { + let items = match ctor_impl.unwrap().node { + ast::ItemKind::Impl(_, _, _, _, _, items) => { + items + } + _ => unreachable!(), + }; + + assert_eq!(items.len(), 1); + let (sig, body) = match items[0].node { + ast::ImplItemKind::Method(ref sig, ref body) => { + (sig, body) + } + _ => unreachable!(), + }; + + let params = sig.decl.clone().unwrap().inputs; + let param_name = bitfield_getter_name(ctx, parent, self.name()); + + let bitfield_ty_item = ctx.resolve_item(self.ty()); + let bitfield_ty = bitfield_ty_item.expect_type(); + let bitfield_ty_layout = bitfield_ty.layout(ctx) + .expect("Bitfield without layout? Gah!"); + let bitfield_int_ty = BlobTyBuilder::new(bitfield_ty_layout).build(); + let bitfield_ty = bitfield_ty + .to_rust_ty_or_opaque(ctx, bitfield_ty_item); + + let offset = self.offset_into_unit(); + let mask = self.mask(); + + // If we're generating unstable Rust, add the const. + let fn_prefix = if ctx.options().unstable_rust { + quote_tokens!(ctx.ext_cx(), pub const fn) + } else { + quote_tokens!(ctx.ext_cx(), pub fn) + }; + + quote_item!( + ctx.ext_cx(), + impl XxxUnused { + #[inline] + $fn_prefix $ctor_name($params $param_name : $bitfield_ty) + -> $unit_field_int_ty { + let bitfield_unit_val = $body; + let $param_name = $param_name + as $bitfield_int_ty + as $unit_field_int_ty; + let mask = $mask as $unit_field_int_ty; + let $param_name = ($param_name << $offset) & mask; + bitfield_unit_val | $param_name + } + } + ).unwrap() + } +} + +impl<'a> FieldCodegen<'a> for BitfieldUnit { + type Extra = (); + + fn codegen(&self, + ctx: &BindgenContext, + fields_should_be_private: bool, + accessor_kind: FieldAccessorKind, + parent: &CompInfo, + anon_field_names: &mut AnonFieldNames, + result: &mut CodegenResult, + struct_layout: &mut StructLayoutTracker, + fields: &mut F, + methods: &mut M, + _: ()) + where F: Extend, + M: Extend + { + let field_ty = BlobTyBuilder::new(self.layout()).build(); + let unit_field_name = format!("_bitfield_{}", self.nth()); + + let field = StructFieldBuilder::named(&unit_field_name) + .pub_() + .build_ty(field_ty.clone()); + fields.extend(Some(field)); + + let unit_field_int_ty = match self.layout().size { + 8 => quote_ty!(ctx.ext_cx(), u64), + 4 => quote_ty!(ctx.ext_cx(), u32), + 2 => quote_ty!(ctx.ext_cx(), u16), + 1 => quote_ty!(ctx.ext_cx(), u8), + _ => { + // Can't generate bitfield accessors for unit sizes larget than + // 64 bits at the moment. + struct_layout.saw_bitfield_unit(self.layout()); + return; + } + }; + + let ctor_name = self.ctor_name(ctx); + let mut ctor_impl = self.initial_ctor_impl(ctx, &unit_field_int_ty); + + for bf in self.bitfields() { + bf.codegen(ctx, + fields_should_be_private, + accessor_kind, + parent, + anon_field_names, + result, + struct_layout, + fields, + methods, + (&unit_field_name, unit_field_int_ty.clone())); + + ctor_impl = bf.extend_ctor_impl(ctx, parent, - field_size_in_bits, - last_field_align, - &last_field_name, - bitfields.drain(..), - methods)); - - // TODO(emilio): dedup this. - *self.index += 1; - last_field_name = format!("_bitfield_{}", self.index); - - // Now reset the size and the rest of stuff. - // unfilled_bits_in_last_unit = 0; - field_size_in_bits = 0; - last_field_align = 0; - } - - if let Some(name) = field.name() { - let field_item_ty = field_item.to_rust_ty_or_opaque(ctx, &()); - bitfields.push((name, - field_size_in_bits, - width, - field_item_ty.unwrap(), - field_ty_layout)); - } - - field_size_in_bits += width; - total_size_in_bits += width; - - let data_size = align_to(field_size_in_bits, field_align * 8); - - max_align = cmp::max(max_align, field_align); - - // NB: The width here is completely, absolutely intentional. - last_field_align = cmp::max(last_field_align, width); - - unfilled_bits_in_last_unit = data_size - field_size_in_bits; + ctor_impl, + &ctor_name, + &unit_field_int_ty); } - if field_size_in_bits != 0 { - // Flush the last physical field and its bitfields. - fields.push(flush_bitfields(ctx, - parent, - field_size_in_bits, - last_field_align, - &last_field_name, - bitfields.drain(..), - methods)); - } + match ctor_impl.unwrap().node { + ast::ItemKind::Impl(_, _, _, _, _, items) => { + assert_eq!(items.len(), 1); + methods.extend(items.into_iter()); + }, + _ => unreachable!(), + }; - Layout::new(bytes_from_bits(total_size_in_bits), max_align) + struct_layout.saw_bitfield_unit(self.layout()); } } @@ -889,58 +1243,51 @@ fn bitfield_setter_name(ctx: &BindgenContext, ctx.ext_cx().ident_of(&setter) } -/// A physical field (which is a word or byte or ...) has many logical bitfields -/// contained within it, but not all bitfields are in the same physical field of -/// a struct. This function creates a single physical field and flushes all the -/// accessors for the logical `bitfields` within that physical field to the -/// outgoing `methods`. -fn flush_bitfields<'a, I>(ctx: &BindgenContext, - parent: &CompInfo, - field_size_in_bits: usize, - field_align: usize, - field_name: &str, - bitfields: I, - methods: &mut Vec) -> ast::StructField - where I: IntoIterator -{ - use aster::struct_field::StructFieldBuilder; +impl<'a> FieldCodegen<'a> for Bitfield { + type Extra = (&'a str, P); - let field_layout = Layout::new(bytes_from_bits_pow2(field_size_in_bits), - bytes_from_bits_pow2(field_align)); - let field_ty = BlobTyBuilder::new(field_layout).build(); - - let field = StructFieldBuilder::named(field_name) - .pub_() - .build_ty(field_ty.clone()); - - let field_int_ty = match field_layout.size { - 8 => quote_ty!(ctx.ext_cx(), u64), - 4 => quote_ty!(ctx.ext_cx(), u32), - 2 => quote_ty!(ctx.ext_cx(), u16), - 1 => quote_ty!(ctx.ext_cx(), u8), - _ => return field - }; - - for (name, offset, width, bitfield_ty, bitfield_layout) in bitfields { + fn codegen(&self, + ctx: &BindgenContext, + _fields_should_be_private: bool, + _accessor_kind: FieldAccessorKind, + parent: &CompInfo, + _anon_field_names: &mut AnonFieldNames, + _result: &mut CodegenResult, + _struct_layout: &mut StructLayoutTracker, + _fields: &mut F, + methods: &mut M, + (unit_field_name, + unit_field_int_ty): (&'a str, P)) + where F: Extend, + M: Extend + { let prefix = ctx.trait_prefix(); - let getter_name = bitfield_getter_name(ctx, parent, name); - let setter_name = bitfield_setter_name(ctx, parent, name); - let field_ident = ctx.ext_cx().ident_of(field_name); + let getter_name = bitfield_getter_name(ctx, parent, self.name()); + let setter_name = bitfield_setter_name(ctx, parent, self.name()); + let unit_field_ident = ctx.ext_cx().ident_of(unit_field_name); - let bitfield_int_ty = BlobTyBuilder::new(bitfield_layout).build(); + let bitfield_ty_item = ctx.resolve_item(self.ty()); + let bitfield_ty = bitfield_ty_item.expect_type(); - let mask: usize = ((1usize << width) - 1usize) << offset; + let bitfield_ty_layout = bitfield_ty.layout(ctx) + .expect("Bitfield without layout? Gah!"); + let bitfield_int_ty = BlobTyBuilder::new(bitfield_ty_layout).build(); + + let bitfield_ty = bitfield_ty.to_rust_ty_or_opaque(ctx, bitfield_ty_item); + + let offset = self.offset_into_unit(); + let mask: usize = self.mask(); let impl_item = quote_item!( ctx.ext_cx(), impl XxxIgnored { #[inline] pub fn $getter_name(&self) -> $bitfield_ty { - let mask = $mask as $field_int_ty; - let field_val: $field_int_ty = unsafe { - ::$prefix::mem::transmute(self.$field_ident) + let mask = $mask as $unit_field_int_ty; + let unit_field_val: $unit_field_int_ty = unsafe { + ::$prefix::mem::transmute(self.$unit_field_ident) }; - let val = (field_val & mask) >> $offset; + let val = (unit_field_val & mask) >> $offset; unsafe { ::$prefix::mem::transmute(val as $bitfield_int_ty) } @@ -948,17 +1295,17 @@ fn flush_bitfields<'a, I>(ctx: &BindgenContext, #[inline] pub fn $setter_name(&mut self, val: $bitfield_ty) { - let mask = $mask as $field_int_ty; - let val = val as $bitfield_int_ty as $field_int_ty; + let mask = $mask as $unit_field_int_ty; + let val = val as $bitfield_int_ty as $unit_field_int_ty; - let mut field_val: $field_int_ty = unsafe { - ::$prefix::mem::transmute(self.$field_ident) + let mut unit_field_val: $unit_field_int_ty = unsafe { + ::$prefix::mem::transmute(self.$unit_field_ident) }; - field_val &= !mask; - field_val |= (val << $offset) & mask; + unit_field_val &= !mask; + unit_field_val |= (val << $offset) & mask; - self.$field_ident = unsafe { - ::$prefix::mem::transmute(field_val) + self.$unit_field_ident = unsafe { + ::$prefix::mem::transmute(unit_field_val) }; } } @@ -971,58 +1318,6 @@ fn flush_bitfields<'a, I>(ctx: &BindgenContext, _ => unreachable!(), }; } - - field -} - -impl CodeGenerator for TemplateInstantiation { - type Extra = Item; - - fn codegen<'a>(&self, - ctx: &BindgenContext, - result: &mut CodegenResult<'a>, - _whitelisted_items: &ItemSet, - item: &Item) { - // Although uses of instantiations don't need code generation, and are - // just converted to rust types in fields, vars, etc, we take this - // opportunity to generate tests for their layout here. - if !ctx.options().layout_tests { - return - } - - let layout = item.kind().expect_type().layout(ctx); - - if let Some(layout) = layout { - let size = layout.size; - let align = layout.align; - - let name = item.canonical_name(ctx); - let fn_name = format!("__bindgen_test_layout_{}_instantiation_{}", - name, - item.id().as_usize()); - let fn_name = ctx.rust_ident_raw(&fn_name); - - let prefix = ctx.trait_prefix(); - let ident = item.to_rust_ty_or_opaque(ctx, &()); - let size_of_expr = quote_expr!(ctx.ext_cx(), - ::$prefix::mem::size_of::<$ident>()); - let align_of_expr = quote_expr!(ctx.ext_cx(), - ::$prefix::mem::align_of::<$ident>()); - - let item = quote_item!( - ctx.ext_cx(), - #[test] - fn $fn_name() { - assert_eq!($size_of_expr, $size, - concat!("Size of template specialization: ", stringify!($ident))); - assert_eq!($align_of_expr, $align, - concat!("Alignment of template specialization: ", stringify!($ident))); - }) - .unwrap(); - - result.push(item); - } - } } impl CodeGenerator for CompInfo { @@ -1033,8 +1328,6 @@ impl CodeGenerator for CompInfo { result: &mut CodegenResult<'a>, whitelisted_items: &ItemSet, item: &Item) { - use aster::struct_field::StructFieldBuilder; - debug!("::codegen: item = {:?}", item); // Don't output classes with template parameters that aren't types, and @@ -1137,7 +1430,7 @@ impl CodeGenerator for CompInfo { // Also, we need to generate the vtable in such a way it "inherits" from // the parent too. let mut fields = vec![]; - let mut struct_layout = StructLayoutTracker::new(ctx, self); + let mut struct_layout = StructLayoutTracker::new(ctx, self, &canonical_name); if self.needs_explicit_vtable(ctx) { let vtable = Vtable::new(item.id(), self.methods(), self.base_members()); @@ -1185,7 +1478,7 @@ impl CodeGenerator for CompInfo { let field = StructFieldBuilder::named(field_name) .pub_() .build_ty(inner); - fields.push(field); + fields.extend(Some(field)); } if is_union { result.saw_union(); @@ -1193,11 +1486,6 @@ impl CodeGenerator for CompInfo { let layout = item.kind().expect_type().layout(ctx); - let mut current_bitfield_width = None; - let mut current_bitfield_layout: Option = None; - let mut current_bitfield_fields = vec![]; - let mut bitfield_count = 0; - let struct_fields = self.fields(); let fields_should_be_private = item.annotations() .private_fields() .unwrap_or(false); @@ -1206,197 +1494,20 @@ impl CodeGenerator for CompInfo { .unwrap_or(FieldAccessorKind::None); let mut methods = vec![]; - let mut anonymous_field_count = 0; - for field in struct_fields { - debug_assert_eq!(current_bitfield_width.is_some(), - current_bitfield_layout.is_some()); - debug_assert_eq!(current_bitfield_width.is_some(), - !current_bitfield_fields.is_empty()); - - let field_ty = ctx.resolve_type(field.ty()); - - // Try to catch a bitfield contination early. - if let (Some(ref mut bitfield_width), Some(width)) = - (current_bitfield_width, field.bitfield()) { - let layout = current_bitfield_layout.unwrap(); - debug!("Testing bitfield continuation {} {} {:?}", - *bitfield_width, - width, - layout); - if *bitfield_width + width <= (layout.size * 8) as u32 { - *bitfield_width += width; - current_bitfield_fields.push(field); - continue; - } - } - - // Flush the current bitfield. - if current_bitfield_width.is_some() { - debug_assert!(!current_bitfield_fields.is_empty()); - let bitfield_fields = - mem::replace(&mut current_bitfield_fields, vec![]); - let bitfield_layout = Bitfield::new(&mut bitfield_count, - bitfield_fields) - .codegen_fields(ctx, self, &mut fields, &mut methods); - struct_layout.saw_bitfield_batch(bitfield_layout); - - current_bitfield_width = None; - current_bitfield_layout = None; - } - debug_assert!(current_bitfield_fields.is_empty()); - - if let Some(width) = field.bitfield() { - let layout = field_ty.layout(ctx) - .expect("Bitfield type without layout?"); - current_bitfield_width = Some(width); - current_bitfield_layout = Some(layout); - current_bitfield_fields.push(field); - continue; - } - - let ty = field.ty().to_rust_ty_or_opaque(ctx, &()); - - // NB: In unstable rust we use proper `union` types. - let ty = if is_union && !ctx.options().unstable_rust { - if ctx.options().enable_cxx_namespaces { - quote_ty!(ctx.ext_cx(), root::__BindgenUnionField<$ty>) - } else { - quote_ty!(ctx.ext_cx(), __BindgenUnionField<$ty>) - } - } else if let Some(item) = - field_ty.is_incomplete_array(ctx) { - result.saw_incomplete_array(); - - let inner = item.to_rust_ty_or_opaque(ctx, &()); - - if ctx.options().enable_cxx_namespaces { - quote_ty!(ctx.ext_cx(), root::__IncompleteArrayField<$inner>) - } else { - quote_ty!(ctx.ext_cx(), __IncompleteArrayField<$inner>) - } - } else { - ty - }; - - let mut attrs = vec![]; - if ctx.options().generate_comments { - if let Some(comment) = field.comment() { - attrs.push(attributes::doc(comment)); - } - } - let field_name = match field.name() { - Some(name) => ctx.rust_mangle(name).into_owned(), - None => { - anonymous_field_count += 1; - format!("__bindgen_anon_{}", anonymous_field_count) - } - }; - - if !is_union { - if let Some(padding_field) = - struct_layout.pad_field(&field_name, field_ty, field.offset()) { - fields.push(padding_field); - } - } - - let is_private = field.annotations() - .private_fields() - .unwrap_or(fields_should_be_private); - - let accessor_kind = field.annotations() - .accessor_kind() - .unwrap_or(struct_accessor_kind); - - let mut field = StructFieldBuilder::named(&field_name); - - if !is_private { - field = field.pub_(); - } - - let field = field.with_attrs(attrs) - .build_ty(ty.clone()); - - fields.push(field); - - // TODO: Factor the following code out, please! - if accessor_kind == FieldAccessorKind::None { - continue; - } - - let getter_name = - ctx.rust_ident_raw(&format!("get_{}", field_name)); - let mutable_getter_name = - ctx.rust_ident_raw(&format!("get_{}_mut", field_name)); - let field_name = ctx.rust_ident_raw(&field_name); - - let accessor_methods_impl = match accessor_kind { - FieldAccessorKind::None => unreachable!(), - FieldAccessorKind::Regular => { - quote_item!(ctx.ext_cx(), - impl X { - #[inline] - pub fn $getter_name(&self) -> &$ty { - &self.$field_name - } - - #[inline] - pub fn $mutable_getter_name(&mut self) -> &mut $ty { - &mut self.$field_name - } - } - ) - } - FieldAccessorKind::Unsafe => { - quote_item!(ctx.ext_cx(), - impl X { - #[inline] - pub unsafe fn $getter_name(&self) -> &$ty { - &self.$field_name - } - - #[inline] - pub unsafe fn $mutable_getter_name(&mut self) - -> &mut $ty { - &mut self.$field_name - } - } - ) - } - FieldAccessorKind::Immutable => { - quote_item!(ctx.ext_cx(), - impl X { - #[inline] - pub fn $getter_name(&self) -> &$ty { - &self.$field_name - } - } - ) - } - }; - - match accessor_methods_impl.unwrap().node { - ast::ItemKind::Impl(_, _, _, _, _, ref items) => { - methods.extend(items.clone()) - } - _ => unreachable!(), - } + let mut anon_field_names = AnonFieldNames::default(); + for field in self.fields() { + field.codegen(ctx, + fields_should_be_private, + struct_accessor_kind, + self, + &mut anon_field_names, + result, + &mut struct_layout, + &mut fields, + &mut methods, + ()); } - // Flush the last bitfield if any. - // - // FIXME: Reduce duplication with the loop above. - // FIXME: May need to pass current_bitfield_layout too. - if current_bitfield_width.is_some() { - debug_assert!(!current_bitfield_fields.is_empty()); - let bitfield_fields = mem::replace(&mut current_bitfield_fields, - vec![]); - let bitfield_layout = Bitfield::new(&mut bitfield_count, - bitfield_fields) - .codegen_fields(ctx, self, &mut fields, &mut methods); - struct_layout.saw_bitfield_batch(bitfield_layout); - } - debug_assert!(current_bitfield_fields.is_empty()); - if is_union && !ctx.options().unstable_rust { let layout = layout.expect("Unable to get layout information?"); let ty = BlobTyBuilder::new(layout).build(); @@ -1430,7 +1541,7 @@ impl CodeGenerator for CompInfo { } else if !is_union && !self.is_unsized(ctx) { if let Some(padding_field) = layout.and_then(|layout| { - struct_layout.pad_struct(&canonical_name, layout) + struct_layout.pad_struct(layout) }) { fields.push(padding_field); } @@ -1554,21 +1665,24 @@ impl CodeGenerator for CompInfo { } else { let asserts = self.fields() .iter() - .filter(|field| field.bitfield().is_none()) + .filter_map(|field| match *field { + Field::DataMember(ref f) if f.name().is_some() => Some(f), + _ => None, + }) .flat_map(|field| { - field.name().and_then(|name| { - field.offset().and_then(|offset| { - let field_offset = offset / 8; - let field_name = ctx.rust_ident(name); + let name = field.name().unwrap(); + field.offset().and_then(|offset| { + let field_offset = offset / 8; + let field_name = ctx.rust_ident(name); - quote_item!(ctx.ext_cx(), - assert_eq!(unsafe { &(*(0 as *const $type_name)).$field_name as *const _ as usize }, - $field_offset, - concat!("Alignment of field: ", stringify!($type_name), "::", stringify!($field_name))); - ) - }) + quote_item!(ctx.ext_cx(), + assert_eq!(unsafe { &(*(0 as *const $type_name)).$field_name as *const _ as usize }, + $field_offset, + concat!("Alignment of field: ", stringify!($type_name), "::", stringify!($field_name))); + ) }) - }).collect::>>(); + }) + .collect::>>(); Some(asserts) }; @@ -2009,8 +2123,43 @@ impl<'a> EnumBuilder<'a> { } ) .unwrap(); - result.push(impl_); + + let impl_ = quote_item!(ctx.ext_cx(), + impl ::$prefix::ops::BitOrAssign for $rust_ty { + #[inline] + fn bitor_assign(&mut self, rhs: $rust_ty) { + self.0 |= rhs.0; + } + } + ) + .unwrap(); + result.push(impl_); + + let impl_ = quote_item!(ctx.ext_cx(), + impl ::$prefix::ops::BitAnd<$rust_ty> for $rust_ty { + type Output = Self; + + #[inline] + fn bitand(self, other: Self) -> Self { + $rust_ty_name(self.0 & other.0) + } + } + ) + .unwrap(); + result.push(impl_); + + let impl_ = quote_item!(ctx.ext_cx(), + impl ::$prefix::ops::BitAndAssign for $rust_ty { + #[inline] + fn bitand_assign(&mut self, rhs: $rust_ty) { + self.0 &= rhs.0; + } + } + ) + .unwrap(); + result.push(impl_); + aster } EnumBuilder::Consts { aster, .. } => aster, diff --git a/third_party/rust/bindgen/src/codegen/struct_layout.rs b/third_party/rust/bindgen/src/codegen/struct_layout.rs index 351f76428e61..2ba39badccf5 100644 --- a/third_party/rust/bindgen/src/codegen/struct_layout.rs +++ b/third_party/rust/bindgen/src/codegen/struct_layout.rs @@ -14,7 +14,9 @@ use std::mem; use syntax::ast; /// Trace the layout of struct. +#[derive(Debug)] pub struct StructLayoutTracker<'a, 'ctx: 'a> { + name: &'a str, ctx: &'a BindgenContext<'ctx>, comp: &'a CompInfo, latest_offset: usize, @@ -38,15 +40,6 @@ pub fn align_to(size: usize, align: usize) -> usize { size + align - rem } -/// Returns the amount of bytes from a given amount of bytes, rounding up. -pub fn bytes_from_bits(n: usize) -> usize { - if n % 8 == 0 { - return n / 8; - } - - n / 8 + 1 -} - /// Returns the lower power of two byte count that can hold at most n bits. pub fn bytes_from_bits_pow2(mut n: usize) -> usize { if n == 0 { @@ -87,23 +80,10 @@ fn test_bytes_from_bits_pow2() { } } -#[test] -fn test_bytes_from_bits() { - assert_eq!(bytes_from_bits(0), 0); - for i in 1..9 { - assert_eq!(bytes_from_bits(i), 1); - } - for i in 9..17 { - assert_eq!(bytes_from_bits(i), 2); - } - for i in 17..25 { - assert_eq!(bytes_from_bits(i), 3); - } -} - impl<'a, 'ctx> StructLayoutTracker<'a, 'ctx> { - pub fn new(ctx: &'a BindgenContext<'ctx>, comp: &'a CompInfo) -> Self { + pub fn new(ctx: &'a BindgenContext<'ctx>, comp: &'a CompInfo, name: &'a str) -> Self { StructLayoutTracker { + name: name, ctx: ctx, comp: comp, latest_offset: 0, @@ -115,6 +95,8 @@ impl<'a, 'ctx> StructLayoutTracker<'a, 'ctx> { } pub fn saw_vtable(&mut self) { + debug!("saw vtable for {}", self.name); + let ptr_size = mem::size_of::<*mut ()>(); self.latest_offset += ptr_size; self.latest_field_layout = Some(Layout::new(ptr_size, ptr_size)); @@ -122,6 +104,7 @@ impl<'a, 'ctx> StructLayoutTracker<'a, 'ctx> { } pub fn saw_base(&mut self, base_ty: &Type) { + debug!("saw base for {}", self.name); if let Some(layout) = base_ty.layout(self.ctx) { self.align_to_latest_field(layout); @@ -131,7 +114,9 @@ impl<'a, 'ctx> StructLayoutTracker<'a, 'ctx> { } } - pub fn saw_bitfield_batch(&mut self, layout: Layout) { + pub fn saw_bitfield_unit(&mut self, layout: Layout) { + debug!("saw bitfield unit for {}: {:?}", self.name, layout); + self.align_to_latest_field(layout); self.latest_offset += layout.size; @@ -148,6 +133,7 @@ impl<'a, 'ctx> StructLayoutTracker<'a, 'ctx> { } pub fn saw_union(&mut self, layout: Layout) { + debug!("saw union for {}: {:?}", self.name, layout); self.align_to_latest_field(layout); self.latest_offset += self.padding_bytes(layout) + layout.size; @@ -239,13 +225,12 @@ impl<'a, 'ctx> StructLayoutTracker<'a, 'ctx> { padding_layout.map(|layout| self.padding_field(layout)) } - pub fn pad_struct(&mut self, - name: &str, - layout: Layout) - -> Option { + pub fn pad_struct(&mut self, layout: Layout) -> Option { + debug!("pad_struct:\n\tself = {:#?}\n\tlayout = {:#?}", self, layout); + if layout.size < self.latest_offset { error!("Calculated wrong layout for {}, too more {} bytes", - name, + self.name, self.latest_offset - layout.size); return None; } @@ -273,7 +258,7 @@ impl<'a, 'ctx> StructLayoutTracker<'a, 'ctx> { Layout::new(padding_bytes, layout.align) }; - debug!("pad bytes to struct {}, {:?}", name, layout); + debug!("pad bytes to struct {}, {:?}", self.name, layout); Some(self.padding_field(layout)) } else { diff --git a/third_party/rust/bindgen/src/ir/comp.rs b/third_party/rust/bindgen/src/ir/comp.rs index 91593b79349f..9c7577c91c3f 100644 --- a/third_party/rust/bindgen/src/ir/comp.rs +++ b/third_party/rust/bindgen/src/ir/comp.rs @@ -3,13 +3,19 @@ use super::annotations::Annotations; use super::context::{BindgenContext, ItemId}; use super::derive::{CanDeriveCopy, CanDeriveDebug, CanDeriveDefault}; +use super::dot::DotAttributes; use super::item::Item; use super::layout::Layout; use super::traversal::{EdgeKind, Trace, Tracer}; use super::template::TemplateParameters; use clang; +use codegen::struct_layout::{align_to, bytes_from_bits_pow2}; use parse::{ClangItemParser, ParseError}; +use peeking_take_while::PeekableExt; use std::cell::Cell; +use std::cmp; +use std::io; +use std::mem; /// The kind of compound type. #[derive(Debug, Copy, Clone, PartialEq)] @@ -98,36 +104,259 @@ impl Method { } } -/// A struct representing a C++ field. -#[derive(Clone, Debug)] -pub struct Field { - /// The name of the field, empty if it's an unnamed bitfield width. - name: Option, - /// The inner type. - ty: ItemId, - /// The doc comment on the field if any. - comment: Option, - /// Annotations for this field, or the default. - annotations: Annotations, - /// If this field is a bitfield, and how many bits does it contain if it is. - bitfield: Option, - /// If the C++ field is marked as `mutable` - mutable: bool, +/// Methods common to the various field types. +pub trait FieldMethods { + /// Get the name of this field. + fn name(&self) -> Option<&str>; + + /// Get the type of this field. + fn ty(&self) -> ItemId; + + /// Get the comment for this field. + fn comment(&self) -> Option<&str>; + + /// If this is a bitfield, how many bits does it need? + fn bitfield(&self) -> Option; + + /// Is this field marked as `mutable`? + fn is_mutable(&self) -> bool; + + /// Get the annotations for this field. + fn annotations(&self) -> &Annotations; + /// The offset of the field (in bits) - offset: Option, + fn offset(&self) -> Option; +} + +/// A contiguous set of logical bitfields that live within the same physical +/// allocation unit. See 9.2.4 [class.bit] in the C++ standard and [section +/// 2.4.II.1 in the Itanium C++ +/// ABI](http://itanium-cxx-abi.github.io/cxx-abi/abi.html#class-types). +#[derive(Debug)] +pub struct BitfieldUnit { + nth: usize, + layout: Layout, + bitfields: Vec, +} + +impl BitfieldUnit { + /// Get the 1-based index of this bitfield unit within its containing + /// struct. Useful for generating a Rust struct's field name for this unit + /// of bitfields. + pub fn nth(&self) -> usize { + self.nth + } + + /// Get the layout within which these bitfields reside. + pub fn layout(&self) -> Layout { + self.layout + } + + /// Get the bitfields within this unit. + pub fn bitfields(&self) -> &[Bitfield] { + &self.bitfields + } +} + +/// A struct representing a C++ field. +#[derive(Debug)] +pub enum Field { + /// A normal data member. + DataMember(FieldData), + + /// A physical allocation unit containing many logical bitfields. + Bitfields(BitfieldUnit), } impl Field { - /// Construct a new `Field`. - pub fn new(name: Option, - ty: ItemId, - comment: Option, - annotations: Option, - bitfield: Option, - mutable: bool, - offset: Option) - -> Field { - Field { + fn has_destructor(&self, ctx: &BindgenContext) -> bool { + match *self { + Field::DataMember(ref data) => ctx.resolve_type(data.ty).has_destructor(ctx), + // Bitfields may not be of a type that has a destructor. + Field::Bitfields(BitfieldUnit { .. }) => false, + } + } + + /// Get this field's layout. + pub fn layout(&self, ctx: &BindgenContext) -> Option { + match *self { + Field::Bitfields(BitfieldUnit { layout, ..}) => Some(layout), + Field::DataMember(ref data) => { + ctx.resolve_type(data.ty).layout(ctx) + } + } + } +} + +impl Trace for Field { + type Extra = (); + + fn trace(&self, _: &BindgenContext, tracer: &mut T, _: &()) + where T: Tracer, + { + match *self { + Field::DataMember(ref data) => { + tracer.visit_kind(data.ty, EdgeKind::Field); + } + Field::Bitfields(BitfieldUnit { ref bitfields, .. }) => { + for bf in bitfields { + tracer.visit_kind(bf.ty(), EdgeKind::Field); + } + } + } + } +} + +impl DotAttributes for Field { + fn dot_attributes(&self, ctx: &BindgenContext, out: &mut W) -> io::Result<()> + where W: io::Write + { + match *self { + Field::DataMember(ref data) => { + data.dot_attributes(ctx, out) + } + Field::Bitfields(BitfieldUnit { layout, ref bitfields, .. }) => { + writeln!(out, + r#" + bitfield unit + + + + + + + + + "#, + layout.size, + layout.align)?; + for bf in bitfields { + bf.dot_attributes(ctx, out)?; + } + writeln!(out, "
unit.size{}
unit.align{}
") + } + } + } +} + +impl DotAttributes for FieldData { + fn dot_attributes(&self, _ctx: &BindgenContext, out: &mut W) -> io::Result<()> + where W: io::Write + { + writeln!(out, + "{}{:?}", + self.name().unwrap_or("(anonymous)"), + self.ty()) + } +} + +impl DotAttributes for Bitfield { + fn dot_attributes(&self, _ctx: &BindgenContext, out: &mut W) -> io::Result<()> + where W: io::Write + { + writeln!(out, + "{} : {}{:?}", + self.name(), + self.width(), + self.ty()) + } +} + +/// A logical bitfield within some physical bitfield allocation unit. +#[derive(Debug)] +pub struct Bitfield { + /// Index of the bit within this bitfield's allocation unit where this + /// bitfield's bits begin. + offset_into_unit: usize, + + /// The field data for this bitfield. + data: FieldData, +} + +impl Bitfield { + /// Construct a new bitfield. + fn new(offset_into_unit: usize, raw: RawField) -> Bitfield { + assert!(raw.bitfield().is_some()); + assert!(raw.name().is_some()); + + Bitfield { + offset_into_unit: offset_into_unit, + data: raw.0, + } + } + + /// Get the index of the bit within this bitfield's allocation unit where + /// this bitfield begins. + pub fn offset_into_unit(&self) -> usize { + self.offset_into_unit + } + + /// Get the mask value that when &'ed with this bitfield's allocation unit + /// produces this bitfield's value. + pub fn mask(&self) -> usize { + ((1usize << self.width()) - 1usize) << self.offset_into_unit() + } + + /// Get the bit width of this bitfield. + pub fn width(&self) -> u32 { + self.data.bitfield().unwrap() + } + + /// Get the name of this bitfield. + pub fn name(&self) -> &str { + self.data.name().unwrap() + } +} + +impl FieldMethods for Bitfield { + fn name(&self) -> Option<&str> { + self.data.name() + } + + fn ty(&self) -> ItemId { + self.data.ty() + } + + fn comment(&self) -> Option<&str> { + self.data.comment() + } + + fn bitfield(&self) -> Option { + self.data.bitfield() + } + + fn is_mutable(&self) -> bool { + self.data.is_mutable() + } + + fn annotations(&self) -> &Annotations { + self.data.annotations() + } + + fn offset(&self) -> Option { + self.data.offset() + } +} + + +/// A raw field might be either of a plain data member or a bitfield within a +/// bitfield allocation unit, but we haven't processed it and determined which +/// yet (which would involve allocating it into a bitfield unit if it is a +/// bitfield). +#[derive(Debug)] +struct RawField(FieldData); + +impl RawField { + /// Construct a new `RawField`. + fn new(name: Option, + ty: ItemId, + comment: Option, + annotations: Option, + bitfield: Option, + mutable: bool, + offset: Option) + -> RawField { + RawField(FieldData { name: name, ty: ty, comment: comment, @@ -135,41 +364,310 @@ impl Field { bitfield: bitfield, mutable: mutable, offset: offset, + }) + } +} + +impl FieldMethods for RawField { + fn name(&self) -> Option<&str> { + self.0.name() + } + + fn ty(&self) -> ItemId { + self.0.ty() + } + + fn comment(&self) -> Option<&str> { + self.0.comment() + } + + fn bitfield(&self) -> Option { + self.0.bitfield() + } + + fn is_mutable(&self) -> bool { + self.0.is_mutable() + } + + fn annotations(&self) -> &Annotations { + self.0.annotations() + } + + fn offset(&self) -> Option { + self.0.offset() + } +} + +/// Convert the given ordered set of raw fields into a list of either plain data +/// members, and/or bitfield units containing multiple bitfields. +fn raw_fields_to_fields_and_bitfield_units(ctx: &BindgenContext, + raw_fields: I) + -> Vec + where I: IntoIterator +{ + let mut raw_fields = raw_fields.into_iter().fuse().peekable(); + let mut fields = vec![]; + let mut bitfield_unit_count = 0; + + loop { + // While we have plain old data members, just keep adding them to our + // resulting fields. We introduce a scope here so that we can use + // `raw_fields` again after the `by_ref` iterator adaptor is dropped. + { + let non_bitfields = raw_fields + .by_ref() + .peeking_take_while(|f| f.bitfield().is_none()) + .map(|f| Field::DataMember(f.0)); + fields.extend(non_bitfields); + } + + // Now gather all the consecutive bitfields. Only consecutive bitfields + // may potentially share a bitfield allocation unit with each other in + // the Itanium C++ ABI. + let mut bitfields = raw_fields + .by_ref() + .peeking_take_while(|f| f.bitfield().is_some()) + .peekable(); + + if bitfields.peek().is_none() { + break; + } + + bitfields_to_allocation_units(ctx, + &mut bitfield_unit_count, + &mut fields, + bitfields); + } + + assert!(raw_fields.next().is_none(), + "The above loop should consume all items in `raw_fields`"); + + fields +} + +/// Given a set of contiguous raw bitfields, group and allocate them into +/// (potentially multiple) bitfield units. +fn bitfields_to_allocation_units(ctx: &BindgenContext, + bitfield_unit_count: &mut usize, + mut fields: &mut E, + raw_bitfields: I) + where E: Extend, + I: IntoIterator +{ + assert!(ctx.collected_typerefs()); + + // NOTE: What follows is reverse-engineered from LLVM's + // lib/AST/RecordLayoutBuilder.cpp + // + // FIXME(emilio): There are some differences between Microsoft and the + // Itanium ABI, but we'll ignore those and stick to Itanium for now. + // + // Also, we need to handle packed bitfields and stuff. + // + // TODO(emilio): Take into account C++'s wide bitfields, and + // packing, sigh. + + fn flush_allocation_unit(mut fields: &mut E, + bitfield_unit_count: &mut usize, + unit_size_in_bits: usize, + unit_align_in_bits: usize, + bitfields: Vec) + where E: Extend + { + *bitfield_unit_count += 1; + let layout = Layout::new(bytes_from_bits_pow2(unit_size_in_bits), + bytes_from_bits_pow2(unit_align_in_bits)); + fields.extend(Some(Field::Bitfields(BitfieldUnit { + nth: *bitfield_unit_count, + layout: layout, + bitfields: bitfields, + }))); + } + + let mut max_align = 0; + let mut unfilled_bits_in_unit = 0; + let mut unit_size_in_bits = 0; + let mut unit_align = 0; + let mut bitfields_in_unit = vec![]; + + for bitfield in raw_bitfields { + let bitfield_width = bitfield.bitfield().unwrap() as usize; + let bitfield_align = ctx.resolve_type(bitfield.ty()) + .layout(ctx) + .expect("Bitfield without layout? Gah!") + .align; + + if unit_size_in_bits != 0 && + (bitfield_width == 0 || + bitfield_width > unfilled_bits_in_unit) { + // We've reached the end of this allocation unit, so flush it + // and its bitfields. + unit_size_in_bits = align_to(unit_size_in_bits, + bitfield_align); + flush_allocation_unit(fields, + bitfield_unit_count, + unit_size_in_bits, + unit_align, + mem::replace(&mut bitfields_in_unit, vec![])); + + // Now we're working on a fresh bitfield allocation unit, so reset + // the current unit size and alignment. + unit_size_in_bits = 0; + unit_align = 0; + } + + // Only keep named bitfields around. Unnamed bitfields (with > 0 + // bitsize) are used for padding. Because the `Bitfield` struct stores + // the bit-offset into its allocation unit where its bits begin, we + // don't need any padding bits hereafter. + if bitfield.name().is_some() { + bitfields_in_unit.push(Bitfield::new(unit_size_in_bits, bitfield)); + } + + unit_size_in_bits += bitfield_width; + + max_align = cmp::max(max_align, bitfield_align); + + // NB: The `bitfield_width` here is completely, absolutely intentional. + // Alignment of the allocation unit is based on the maximum bitfield + // width, not (directly) on the bitfields' types' alignment. + unit_align = cmp::max(unit_align, bitfield_width); + + // Compute what the physical unit's final size would be given what we + // have seen so far, and use that to compute how many bits are still + // available in the unit. + let data_size = align_to(unit_size_in_bits, bitfield_align * 8); + unfilled_bits_in_unit = data_size - unit_size_in_bits; + } + + if unit_size_in_bits != 0 { + // Flush the last allocation unit and its bitfields. + flush_allocation_unit(fields, + bitfield_unit_count, + unit_size_in_bits, + unit_align, + bitfields_in_unit); + } +} + +/// A compound structure's fields are initially raw, and have bitfields that +/// have not been grouped into allocation units. During this time, the fields +/// are mutable and we build them up during parsing. +/// +/// Then, once resolving typerefs is completed, we compute all structs' fields' +/// bitfield allocation units, and they remain frozen and immutable forever +/// after. +#[derive(Debug)] +enum CompFields { + BeforeComputingBitfieldUnits(Vec), + AfterComputingBitfieldUnits(Vec), +} + +impl Default for CompFields { + fn default() -> CompFields { + CompFields::BeforeComputingBitfieldUnits(vec![]) + } +} + +impl CompFields { + fn append_raw_field(&mut self, raw: RawField) { + match *self { + CompFields::BeforeComputingBitfieldUnits(ref mut raws) => { + raws.push(raw); + } + CompFields::AfterComputingBitfieldUnits(_) => { + panic!("Must not append new fields after computing bitfield allocation units"); + } } } - /// Get the name of this field. - pub fn name(&self) -> Option<&str> { + fn compute_bitfield_units(&mut self, ctx: &BindgenContext) { + let raws = match *self { + CompFields::BeforeComputingBitfieldUnits(ref mut raws) => { + mem::replace(raws, vec![]) + } + CompFields::AfterComputingBitfieldUnits(_) => { + panic!("Already computed bitfield units"); + } + }; + + let fields_and_units = raw_fields_to_fields_and_bitfield_units(ctx, raws); + mem::replace(self, CompFields::AfterComputingBitfieldUnits(fields_and_units)); + } +} + +impl Trace for CompFields { + type Extra = (); + + fn trace(&self, context: &BindgenContext, tracer: &mut T, _: &()) + where T: Tracer, + { + match *self { + CompFields::BeforeComputingBitfieldUnits(ref fields) => { + for f in fields { + tracer.visit_kind(f.ty(), EdgeKind::Field); + } + } + CompFields::AfterComputingBitfieldUnits(ref fields) => { + for f in fields { + f.trace(context, tracer, &()); + } + } + } + } +} + +/// Common data shared across different field types. +#[derive(Clone, Debug)] +pub struct FieldData { + /// The name of the field, empty if it's an unnamed bitfield width. + name: Option, + + /// The inner type. + ty: ItemId, + + /// The doc comment on the field if any. + comment: Option, + + /// Annotations for this field, or the default. + annotations: Annotations, + + /// If this field is a bitfield, and how many bits does it contain if it is. + bitfield: Option, + + /// If the C++ field is marked as `mutable` + mutable: bool, + + /// The offset of the field (in bits) + offset: Option, +} + +impl FieldMethods for FieldData { + fn name(&self) -> Option<&str> { self.name.as_ref().map(|n| &**n) } - /// Get the type of this field. - pub fn ty(&self) -> ItemId { + fn ty(&self) -> ItemId { self.ty } - /// Get the comment for this field. - pub fn comment(&self) -> Option<&str> { + fn comment(&self) -> Option<&str> { self.comment.as_ref().map(|c| &**c) } - /// If this is a bitfield, how many bits does it need? - pub fn bitfield(&self) -> Option { + fn bitfield(&self) -> Option { self.bitfield } - /// Is this field marked as `mutable`? - pub fn is_mutable(&self) -> bool { + fn is_mutable(&self) -> bool { self.mutable } - /// Get the annotations for this field. - pub fn annotations(&self) -> &Annotations { + fn annotations(&self) -> &Annotations { &self.annotations } - /// The offset of the field (in bits) - pub fn offset(&self) -> Option { + fn offset(&self) -> Option { self.offset } } @@ -178,7 +676,12 @@ impl CanDeriveDebug for Field { type Extra = (); fn can_derive_debug(&self, ctx: &BindgenContext, _: ()) -> bool { - self.ty.can_derive_debug(ctx, ()) + match *self { + Field::DataMember(ref data) => data.ty.can_derive_debug(ctx, ()), + Field::Bitfields(BitfieldUnit { ref bitfields, .. }) => bitfields.iter().all(|b| { + b.ty().can_derive_debug(ctx, ()) + }), + } } } @@ -186,7 +689,12 @@ impl CanDeriveDefault for Field { type Extra = (); fn can_derive_default(&self, ctx: &BindgenContext, _: ()) -> bool { - self.ty.can_derive_default(ctx, ()) + match *self { + Field::DataMember(ref data) => data.ty.can_derive_default(ctx, ()), + Field::Bitfields(BitfieldUnit { ref bitfields, .. }) => bitfields.iter().all(|b| { + b.ty().can_derive_default(ctx, ()) + }), + } } } @@ -194,11 +702,21 @@ impl<'a> CanDeriveCopy<'a> for Field { type Extra = (); fn can_derive_copy(&self, ctx: &BindgenContext, _: ()) -> bool { - self.ty.can_derive_copy(ctx, ()) + match *self { + Field::DataMember(ref data) => data.ty.can_derive_copy(ctx, ()), + Field::Bitfields(BitfieldUnit { ref bitfields, .. }) => bitfields.iter().all(|b| { + b.ty().can_derive_copy(ctx, ()) + }), + } } fn can_derive_copy_in_array(&self, ctx: &BindgenContext, _: ()) -> bool { - self.ty.can_derive_copy_in_array(ctx, ()) + match *self { + Field::DataMember(ref data) => data.ty.can_derive_copy_in_array(ctx, ()), + Field::Bitfields(BitfieldUnit { ref bitfields, .. }) => bitfields.iter().all(|b| { + b.ty().can_derive_copy_in_array(ctx, ()) + }), + } } } @@ -247,12 +765,12 @@ pub struct CompInfo { kind: CompKind, /// The members of this struct or union. - fields: Vec, + fields: CompFields, - /// The abstract template parameters of this class. These are NOT concrete - /// template arguments, and should always be a - /// Type(TypeKind::Named(name)). For concrete template arguments, see the - /// TypeKind::TemplateInstantiation. + /// The abstract template parameters of this class. Note that these are NOT + /// concrete template arguments, and should always be a + /// `Type(TypeKind::Named(name))`. For concrete template arguments, see + /// `TypeKind::TemplateInstantiation`. template_params: Vec, /// The method declarations inside this class, if in C++ mode. @@ -332,7 +850,7 @@ impl CompInfo { pub fn new(kind: CompKind) -> Self { CompInfo { kind: kind, - fields: vec![], + fields: CompFields::default(), template_params: vec![], methods: vec![], constructors: vec![], @@ -355,7 +873,7 @@ impl CompInfo { /// Is this compound type unsized? pub fn is_unsized(&self, ctx: &BindgenContext) -> bool { - !self.has_vtable(ctx) && self.fields.is_empty() && + !self.has_vtable(ctx) && self.fields().is_empty() && self.base_members.iter().all(|base| { ctx.resolve_type(base.ty).canonical_type(ctx).is_unsized(ctx) }) @@ -378,9 +896,8 @@ impl CompInfo { self.base_members.iter().any(|base| { ctx.resolve_type(base.ty).has_destructor(ctx) }) || - self.fields.iter().any(|field| { - ctx.resolve_type(field.ty) - .has_destructor(ctx) + self.fields().iter().any(|field| { + field.has_destructor(ctx) }) } }; @@ -400,6 +917,7 @@ impl CompInfo { /// kind of unions, see test/headers/template_union.hpp pub fn layout(&self, ctx: &BindgenContext) -> Option { use std::cmp; + // We can't do better than clang here, sorry. if self.kind == CompKind::Struct { return None; @@ -407,9 +925,8 @@ impl CompInfo { let mut max_size = 0; let mut max_align = 0; - for field in &self.fields { - let field_layout = ctx.resolve_type(field.ty) - .layout(ctx); + for field in self.fields() { + let field_layout = field.layout(ctx); if let Some(layout) = field_layout { max_size = cmp::max(max_size, layout.size); @@ -422,7 +939,12 @@ impl CompInfo { /// Get this type's set of fields. pub fn fields(&self) -> &[Field] { - &self.fields + match self.fields { + CompFields::AfterComputingBitfieldUnits(ref fields) => fields, + CompFields::BeforeComputingBitfieldUnits(_) => { + panic!("Should always have computed bitfield units first"); + } + } } /// Does this type have any template parameters that aren't types @@ -460,6 +982,11 @@ impl CompInfo { self.kind } + /// Is this a union? + pub fn is_union(&self) -> bool { + self.kind() == CompKind::Union + } + /// The set of types that this one inherits from. pub fn base_members(&self) -> &[Base] { &self.base_members @@ -510,8 +1037,8 @@ impl CompInfo { // nothing. } else { let field = - Field::new(None, ty, None, None, None, false, offset); - ci.fields.push(field); + RawField::new(None, ty, None, None, None, false, offset); + ci.fields.append_raw_field(field); } } } @@ -528,14 +1055,14 @@ impl CompInfo { CXChildVisit_Continue }); if !used { - let field = Field::new(None, + let field = RawField::new(None, ty, None, None, None, false, offset); - ci.fields.push(field); + ci.fields.append_raw_field(field); } } @@ -558,14 +1085,14 @@ impl CompInfo { let name = if name.is_empty() { None } else { Some(name) }; - let field = Field::new(name, + let field = RawField::new(name, field_type, comment, annotations, bit_width, is_mutable, offset); - ci.fields.push(field); + ci.fields.append_raw_field(field); // No we look for things like attributes and stuff. cur.visit(|cur| { @@ -744,8 +1271,8 @@ impl CompInfo { if let Some((ty, _, offset)) = maybe_anonymous_struct_field { let field = - Field::new(None, ty, None, None, None, false, offset); - ci.fields.push(field); + RawField::new(None, ty, None, None, None, false, offset); + ci.fields.append_raw_field(field); } Ok(ci) @@ -817,6 +1344,53 @@ impl CompInfo { pub fn is_forward_declaration(&self) -> bool { self.is_forward_declaration } + + /// Compute this compound structure's bitfield allocation units. + pub fn compute_bitfield_units(&mut self, ctx: &BindgenContext) { + self.fields.compute_bitfield_units(ctx); + } +} + +impl DotAttributes for CompInfo { + fn dot_attributes(&self, ctx: &BindgenContext, out: &mut W) -> io::Result<()> + where W: io::Write + { + writeln!(out, "CompKind{:?}", self.kind)?; + + if self.has_vtable { + writeln!(out, "has_vtabletrue")?; + } + + if self.has_destructor { + writeln!(out, "has_destructortrue")?; + } + + if self.has_nonempty_base { + writeln!(out, "has_nonempty_basetrue")?; + } + + if self.has_non_type_template_params { + writeln!(out, "has_non_type_template_paramstrue")?; + } + + if self.packed { + writeln!(out, "packedtrue")?; + } + + if self.is_forward_declaration { + writeln!(out, "is_forward_declarationtrue")?; + } + + if !self.fields().is_empty() { + writeln!(out, r#"fields"#)?; + for field in self.fields() { + field.dot_attributes(ctx, out)?; + } + writeln!(out, "
")?; + } + + Ok(()) + } } impl TemplateParameters for CompInfo { @@ -865,7 +1439,7 @@ impl CanDeriveDebug for CompInfo { self.base_members .iter() .all(|base| base.ty.can_derive_debug(ctx, ())) && - self.fields + self.fields() .iter() .all(|f| f.can_derive_debug(ctx, ())) }; @@ -907,7 +1481,7 @@ impl CanDeriveDefault for CompInfo { self.base_members .iter() .all(|base| base.ty.can_derive_default(ctx, ())) && - self.fields + self.fields() .iter() .all(|f| f.can_derive_default(ctx, ())); @@ -953,7 +1527,7 @@ impl<'a> CanDeriveCopy<'a> for CompInfo { self.base_members .iter() .all(|base| base.ty.can_derive_copy(ctx, ())) && - self.fields.iter().all(|field| field.can_derive_copy(ctx, ())) + self.fields().iter().all(|field| field.can_derive_copy(ctx, ())) } fn can_derive_copy_in_array(&self, @@ -990,9 +1564,7 @@ impl Trace for CompInfo { tracer.visit_kind(base.ty, EdgeKind::BaseMember); } - for field in self.fields() { - tracer.visit_kind(field.ty(), EdgeKind::Field); - } + self.fields.trace(context, tracer, &()); for &var in self.inner_vars() { tracer.visit_kind(var, EdgeKind::InnerVar); diff --git a/third_party/rust/bindgen/src/ir/context.rs b/third_party/rust/bindgen/src/ir/context.rs index 3d3e9fcdb4fa..c5807d2bff17 100644 --- a/third_party/rust/bindgen/src/ir/context.rs +++ b/third_party/rust/bindgen/src/ir/context.rs @@ -21,6 +21,7 @@ use std::collections::{HashMap, hash_map}; use std::collections::btree_map::{self, BTreeMap}; use std::fmt; use std::iter::IntoIterator; +use std::mem; use syntax::ast::Ident; use syntax::codemap::{DUMMY_SP, Span}; use syntax::ext::base::ExtCtxt; @@ -160,6 +161,10 @@ pub struct BindgenContext<'ctx> { /// uses. See `ir::named` for more details. Always `Some` during the codegen /// phase. used_template_parameters: Option>, + + /// The set of `TypeKind::Comp` items found during parsing that need their + /// bitfield allocation units computed. Drained in `compute_bitfield_units`. + need_bitfield_allocation: Vec, } /// A traversal of whitelisted items. @@ -247,6 +252,7 @@ impl<'ctx> BindgenContext<'ctx> { options: options, generated_bindegen_complex: Cell::new(false), used_template_parameters: None, + need_bitfield_allocation: Default::default(), }; me.add_item(root_module, None, None); @@ -299,6 +305,8 @@ impl<'ctx> BindgenContext<'ctx> { let id = item.id(); let is_type = item.kind().is_type(); let is_unnamed = is_type && item.expect_type().name().is_none(); + let is_template_instantiation = + is_type && item.expect_type().is_template_instantiation(); // Be sure to track all the generated children under namespace, even // those generated after resolving typerefs, etc. @@ -310,6 +318,10 @@ impl<'ctx> BindgenContext<'ctx> { } } + if is_type && item.expect_type().is_comp() { + self.need_bitfield_allocation.push(id); + } + let old_item = self.items.insert(id, item); assert!(old_item.is_none(), "should not have already associated an item with the given id"); @@ -317,7 +329,7 @@ impl<'ctx> BindgenContext<'ctx> { // Unnamed items can have an USR, but they can't be referenced from // other sites explicitly and the USR can match if the unnamed items are // nested, so don't bother tracking them. - if is_type && declaration.is_some() { + if is_type && !is_template_instantiation && declaration.is_some() { let mut declaration = declaration.unwrap(); if !declaration.is_valid() { if let Some(location) = location { @@ -484,6 +496,32 @@ impl<'ctx> BindgenContext<'ctx> { } } + /// Compute the bitfield allocation units for all `TypeKind::Comp` items we + /// parsed. + fn compute_bitfield_units(&mut self) { + assert!(self.collected_typerefs()); + + let need_bitfield_allocation = mem::replace(&mut self.need_bitfield_allocation, vec![]); + for id in need_bitfield_allocation { + // To appease the borrow checker, we temporarily remove this item + // from the context, and then replace it once we are done computing + // its bitfield units. We will never try and resolve this + // `TypeKind::Comp` item's id (which would now cause a panic) during + // bitfield unit computation because it is a non-scalar by + // definition, and non-scalar types may not be used as bitfields. + let mut item = self.items.remove(&id).unwrap(); + + item.kind_mut() + .as_type_mut() + .unwrap() + .as_comp_mut() + .unwrap() + .compute_bitfield_units(&*self); + + self.items.insert(id, item); + } + } + /// Iterate over all items and replace any item that has been named in a /// `replaces="SomeType"` annotation with the replacement type. fn process_replacements(&mut self) { @@ -615,6 +653,7 @@ impl<'ctx> BindgenContext<'ctx> { if !self.collected_typerefs() { self.resolve_typerefs(); + self.compute_bitfield_units(); self.process_replacements(); } diff --git a/third_party/rust/bindgen/src/ir/dot.rs b/third_party/rust/bindgen/src/ir/dot.rs index 7472dd8e0f3f..40202b2c9b4e 100644 --- a/third_party/rust/bindgen/src/ir/dot.rs +++ b/third_party/rust/bindgen/src/ir/dot.rs @@ -30,7 +30,7 @@ pub fn write_dot_file

(ctx: &BindgenContext, path: P) -> io::Result<()> for (id, item) in ctx.items() { try!(writeln!(&mut dot_file, - r#"{} [fontname="courier", label=< "#, + r#"{} [fontname="courier", label=<
"#, id.as_usize())); try!(item.dot_attributes(ctx, &mut dot_file)); try!(writeln!(&mut dot_file, r#"
>];"#)); diff --git a/third_party/rust/bindgen/src/ir/item.rs b/third_party/rust/bindgen/src/ir/item.rs index a60697b88994..6c118f548fff 100644 --- a/third_party/rust/bindgen/src/ir/item.rs +++ b/third_party/rust/bindgen/src/ir/item.rs @@ -370,7 +370,7 @@ pub struct Item { /// This item's id. id: ItemId, - /// The item's local id, unique only amongst its siblings. Only used for + /// The item's local id, unique only amongst its siblings. Only used for /// anonymous items. /// /// Lazily initialized in local_id(). @@ -379,7 +379,7 @@ pub struct Item { /// case this is an implementation detail. local_id: Cell>, - /// The next local id to use for a child.. + /// The next local id to use for a child or template instantiation. next_child_local_id: Cell, /// A cached copy of the canonical name, as returned by `canonical_name`. @@ -490,13 +490,23 @@ impl Item { pub fn local_id(&self, ctx: &BindgenContext) -> usize { if self.local_id.get().is_none() { let parent = ctx.resolve_item(self.parent_id); - let local_id = parent.next_child_local_id.get(); - parent.next_child_local_id.set(local_id + 1); - self.local_id.set(Some(local_id)); + self.local_id.set(Some(parent.next_child_local_id())); } self.local_id.get().unwrap() } + /// Get an identifier that differentiates a child of this item of other + /// related items. + /// + /// This is currently used for anonymous items, and template instantiation + /// tests, in both cases in order to reduce noise when system headers are at + /// place. + pub fn next_child_local_id(&self) -> usize { + let local_id = self.next_child_local_id.get(); + self.next_child_local_id.set(local_id + 1); + local_id + } + /// Returns whether this item is a top-level item, from the point of view of /// bindgen. /// @@ -777,13 +787,16 @@ impl Item { ctx.rust_mangle(&name).into_owned() } - fn exposed_id(&self, ctx: &BindgenContext) -> String { + /// The exposed id that represents an unique id among the siblings of a + /// given item. + pub fn exposed_id(&self, ctx: &BindgenContext) -> String { // Only use local ids for enums, classes, structs and union types. All // other items use their global id. let ty_kind = self.kind().as_type().map(|t| t.kind()); if let Some(ty_kind) = ty_kind { match *ty_kind { TypeKind::Comp(..) | + TypeKind::TemplateInstantiation(..) | TypeKind::Enum(..) => return self.local_id(ctx).to_string(), _ => {} } @@ -829,6 +842,11 @@ impl DotAttributes for Item { name{}", self.id, self.name(ctx).get())); + + if self.is_opaque(ctx) { + writeln!(out, "opaquetrue")?; + } + self.kind.dot_attributes(ctx, out) } } diff --git a/third_party/rust/bindgen/src/ir/template.rs b/third_party/rust/bindgen/src/ir/template.rs index 5861929fff9f..4ae0da046ceb 100644 --- a/third_party/rust/bindgen/src/ir/template.rs +++ b/third_party/rust/bindgen/src/ir/template.rs @@ -233,33 +233,49 @@ impl TemplateInstantiation { let template_args = ty.template_args() .map_or(vec![], |args| { - args.filter(|t| t.kind() != CXType_Invalid) - .map(|t| { - Item::from_ty_or_ref(t, t.declaration(), None, ctx) - }) - .collect() - }); - - let definition = ty.declaration() - .specialized() - .or_else(|| { - let mut template_ref = None; - ty.declaration().visit(|child| { - if child.kind() == CXCursor_TemplateRef { - template_ref = Some(child); - return CXVisit_Break; + match ty.canonical_type().template_args() { + Some(canonical_args) => { + let arg_count = args.len(); + args.chain(canonical_args.skip(arg_count)) + .filter(|t| t.kind() != CXType_Invalid) + .map(|t| { + Item::from_ty_or_ref(t, t.declaration(), None, ctx) + }).collect() } - - // Instantiations of template aliases might have the - // TemplateRef to the template alias definition arbitrarily - // deep, so we need to recurse here and not only visit - // direct children. - CXChildVisit_Recurse - }); - - template_ref.and_then(|cur| cur.referenced()) + None => { + args.filter(|t| t.kind() != CXType_Invalid) + .map(|t| { + Item::from_ty_or_ref(t, t.declaration(), None, ctx) + }).collect() + } + } }); + let declaration = ty.declaration(); + let definition = if declaration.kind() == CXCursor_TypeAliasTemplateDecl { + Some(declaration) + } else { + declaration + .specialized() + .or_else(|| { + let mut template_ref = None; + ty.declaration().visit(|child| { + if child.kind() == CXCursor_TemplateRef { + template_ref = Some(child); + return CXVisit_Break; + } + + // Instantiations of template aliases might have the + // TemplateRef to the template alias definition arbitrarily + // deep, so we need to recurse here and not only visit + // direct children. + CXChildVisit_Recurse + }); + + template_ref.and_then(|cur| cur.referenced()) + }) + }; + let definition = match definition { Some(def) => def, None => { diff --git a/third_party/rust/bindgen/src/ir/ty.rs b/third_party/rust/bindgen/src/ir/ty.rs index a9054e981c74..fd8e45c1bbce 100644 --- a/third_party/rust/bindgen/src/ir/ty.rs +++ b/third_party/rust/bindgen/src/ir/ty.rs @@ -55,6 +55,15 @@ impl Type { } } + /// Get the underlying `CompInfo` for this type as a mutable reference, or + /// `None` if this is some other kind of type. + pub fn as_comp_mut(&mut self) -> Option<&mut CompInfo> { + match self.kind { + TypeKind::Comp(ref mut ci) => Some(ci), + _ => None, + } + } + /// Construct a new `Type`. pub fn new(name: Option, layout: Option, @@ -109,6 +118,14 @@ impl Type { } } + /// Is this a template instantiation type? + pub fn is_template_instantiation(&self) -> bool { + match self.kind { + TypeKind::TemplateInstantiation(..) => true, + _ => false, + } + } + /// Is this a template alias type? pub fn is_template_alias(&self) -> bool { match self.kind { @@ -405,7 +422,7 @@ impl DotAttributes for Type { impl DotAttributes for TypeKind { fn dot_attributes(&self, - _ctx: &BindgenContext, + ctx: &BindgenContext, out: &mut W) -> io::Result<()> where W: io::Write, @@ -435,7 +452,12 @@ impl DotAttributes for TypeKind { TypeKind::ObjCSel => "ObjCSel", TypeKind::ObjCInterface(..) => "ObjCInterface", TypeKind::UnresolvedTypeRef(..) => unreachable!("there shouldn't be any more of these anymore"), - }) + })?; + if let TypeKind::Comp(ref comp) = *self { + comp.dot_attributes(ctx, out)?; + } + + Ok(()) } } diff --git a/third_party/rust/bindgen/src/lib.rs b/third_party/rust/bindgen/src/lib.rs index 61ae20df260b..cd5cf8e14d0f 100644 --- a/third_party/rust/bindgen/src/lib.rs +++ b/third_party/rust/bindgen/src/lib.rs @@ -25,6 +25,7 @@ extern crate syntex_syntax as syntax; extern crate aster; extern crate quasi; extern crate clang_sys; +extern crate peeking_take_while; extern crate regex; #[macro_use] extern crate lazy_static; diff --git a/third_party/rust/clang-sys/.cargo-checksum.json b/third_party/rust/clang-sys/.cargo-checksum.json index faf7ab1e2ee2..68a966ef7f38 100644 --- a/third_party/rust/clang-sys/.cargo-checksum.json +++ b/third_party/rust/clang-sys/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"09cd366a44271073e57584376fd326da166664cd8ff303c2839b63a330557c73",".travis.yml":"79d6a139814ae0f06ce0ca85fe22a27316a27d444320b904c471c7f612129889","CHANGELOG.md":"786e019493746e2a1a98fdd069e28103acf146c0093814b74b54f145665c6428","CONTRIBUTING.md":"4e2a45992604f07a37030bb1fc598c6f54a1785747c4f37a15a37481bbdecce8","Cargo.toml":"3c22785a6974cd8a051a0cb87090c480af3cab261df125ab7d408a77644b9cef","LICENSE.txt":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30","README.md":"92dc2a93f6de04e38d305df2d0ee4854269acbacadc665e6ce17b90f90ad29ca","appveyor.yml":"fe7033ab25bb78005136748676f59bfdd8f65b4c5c2910af911cbb9c496bdaef","build.rs":"1c5172ffc51fdf00f35b8366945ab98d644d386bcb12eb773990253adb000c80","ci/before_install.sh":"402f5704cd0163254b056a515a6cdfa16482eb2e28c31eb63a5c226abd26a8b7","ci/install.bat":"d694550679e14b384f8adf8384d475866e5880002cf82d450926f4607dc9077b","ci/script.sh":"1bb1cd29bd9635cc126cdcbd6c02f3500620a231a86726bf2165a4b74baaf433","ci/test_script.bat":"73462f51aaa9a1c14ce9f55c41dc3672df64faa9789725384ae4f28d8ba3c90b","clippy.toml":"acef14b9acffa18d1069ae08a4e8fe824a614f91b0bc71a6b1c68e4d885397e6","src/lib.rs":"f27371163edaec30a3972667318320b060adff25c03a850a9e807f84c9bc395f","src/link.rs":"b9f76e26fa9b1d690f6abf17e9f898d6545be149e2afe64c7411cd53e3168fcf","src/support.rs":"1e48fcb7dc9e7f4dde06d88079074832a4c2dab337228e05241b7d7e94858734","tests/header.h":"b1cf564b21d76db78529d1934e1481a5f0452fdedc6e32954608293c310498b6","tests/lib.rs":"9225ffcaa892a3901c0dce9f8190421db8fb17651499b4de765b87f08daaf5b2"},"package":"33d47b0ea88a529a570490efbb79403e416e89864ce8a96bf23e2a0f23d7e9eb"} \ No newline at end of file +{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"09cd366a44271073e57584376fd326da166664cd8ff303c2839b63a330557c73",".travis.yml":"79d6a139814ae0f06ce0ca85fe22a27316a27d444320b904c471c7f612129889","CHANGELOG.md":"bd7194bb4c1572c3c34764853a871649bb4f8a20bd7fe6ef96aa8c49d3eb79a9","CONTRIBUTING.md":"4e2a45992604f07a37030bb1fc598c6f54a1785747c4f37a15a37481bbdecce8","Cargo.toml":"88bc28832d77f741028cb5ca9d387a7f016275256cf8f8542b94f2bcc5e8983b","LICENSE.txt":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30","README.md":"73c5156eeff880c0c0ea80a2eb2926797fd06376118e23f842b4164ad677d4f1","appveyor.yml":"fe7033ab25bb78005136748676f59bfdd8f65b4c5c2910af911cbb9c496bdaef","build.rs":"2b934b1cd30083531d4b751f8fe22f997e07ffc35631f15a734574d1d2fa0900","ci/before_install.sh":"402f5704cd0163254b056a515a6cdfa16482eb2e28c31eb63a5c226abd26a8b7","ci/install.bat":"d694550679e14b384f8adf8384d475866e5880002cf82d450926f4607dc9077b","ci/script.sh":"1bb1cd29bd9635cc126cdcbd6c02f3500620a231a86726bf2165a4b74baaf433","ci/test_script.bat":"73462f51aaa9a1c14ce9f55c41dc3672df64faa9789725384ae4f28d8ba3c90b","clippy.toml":"acef14b9acffa18d1069ae08a4e8fe824a614f91b0bc71a6b1c68e4d885397e6","src/lib.rs":"f27371163edaec30a3972667318320b060adff25c03a850a9e807f84c9bc395f","src/link.rs":"b9f76e26fa9b1d690f6abf17e9f898d6545be149e2afe64c7411cd53e3168fcf","src/support.rs":"1e48fcb7dc9e7f4dde06d88079074832a4c2dab337228e05241b7d7e94858734","tests/header.h":"b1cf564b21d76db78529d1934e1481a5f0452fdedc6e32954608293c310498b6","tests/lib.rs":"9225ffcaa892a3901c0dce9f8190421db8fb17651499b4de765b87f08daaf5b2"},"package":"ff7c2d1502c65748c7221f43ce670b3ba5c697acebfeb85a580827daca6975fc"} \ No newline at end of file diff --git a/third_party/rust/clang-sys/CHANGELOG.md b/third_party/rust/clang-sys/CHANGELOG.md index 7a49ac3d4120..50c9e6bbb2d6 100644 --- a/third_party/rust/clang-sys/CHANGELOG.md +++ b/third_party/rust/clang-sys/CHANGELOG.md @@ -1,7 +1,12 @@ +## [0.18.0] - 2017-05-16 + +### Changed +- Improved finding of versioned libraries (e.g., `libclang.so.3.9`) + ## [0.17.0] - 2017-05-08 ### Changed -- Change storage type of include search paths from `Vec` to `Option>` +- Changed storage type of include search paths from `Vec` to `Option>` ## [0.16.0] - 2017-05-02 diff --git a/third_party/rust/clang-sys/Cargo.toml b/third_party/rust/clang-sys/Cargo.toml index 36065727fe83..5f059877aba6 100644 --- a/third_party/rust/clang-sys/Cargo.toml +++ b/third_party/rust/clang-sys/Cargo.toml @@ -3,7 +3,7 @@ name = "clang-sys" authors = ["Kyle Mayes "] -version = "0.17.0" +version = "0.18.0" readme = "README.md" license = "Apache-2.0" diff --git a/third_party/rust/clang-sys/README.md b/third_party/rust/clang-sys/README.md index 668099deed42..37942acade7f 100644 --- a/third_party/rust/clang-sys/README.md +++ b/third_party/rust/clang-sys/README.md @@ -47,9 +47,16 @@ the `runtime` Cargo feature. These libraries can be either be installed as a part of Clang or downloaded [here](http://llvm.org/releases/download.html). -**Note:** Installing `libclang` through a package manager might install the `libclang` shared -library as something like `libclang.so.1` instead of `libclang.so`. In this case, you need to make a -symbolic link from the versioned shared library to `libclang.so`. +**Note:** This crate supports finding versioned instances of `libclang.so` (e.g., +`libclang.so.3.9`). In the case where there are multiple instances to choose from, this crate will +prefer an unversioned instance first, then the version with the shortest and highest version. For +example, the following instances of `libclang.so` are listed in descending order of preference: + +1. `libclang.so` +2. `libclang.so.4` +3. `libclang.so.4.0` +4. `libclang.so.3` +5. `libclang.so.3.9` **Note:** The downloads for LLVM and Clang 3.8 and later do not include the `libclang.a` static library. This means you cannot link to any of these versions of `libclang` statically unless you diff --git a/third_party/rust/clang-sys/build.rs b/third_party/rust/clang-sys/build.rs index 08282ac9c039..1fb4557e61dc 100644 --- a/third_party/rust/clang-sys/build.rs +++ b/third_party/rust/clang-sys/build.rs @@ -39,9 +39,34 @@ use std::process::{Command}; use glob::{MatchOptions}; +/// Returns the components of the version appended to the supplied file. +fn parse_version(file: &Path) -> Vec { + let string = file.to_str().unwrap_or(""); + let components = string.split('.').skip(2); + components.map(|s| s.parse::().unwrap_or(0)).collect() +} + /// Returns a path to one of the supplied files if such a file can be found in the supplied directory. -fn contains>(directory: D, files: &[String]) -> Option { - files.iter().map(|file| directory.as_ref().join(file)).find(|file| file.exists()) +fn contains(directory: &Path, files: &[String]) -> Option { + // Join the directory to the files to obtain our glob patterns. + let patterns = files.iter().filter_map(|f| directory.join(f).to_str().map(ToOwned::to_owned)); + + // Prevent wildcards from matching path separators. + let mut options = MatchOptions::new(); + options.require_literal_separator = true; + + // Collect any files that match the glob patterns. + let mut matches = patterns.flat_map(|p| { + if let Ok(paths) = glob::glob_with(&p, &options) { + paths.filter_map(Result::ok).collect() + } else { + vec![] + } + }).collect::>(); + + // Sort the matches by their version, preferring shorter and higher versions. + matches.sort_by_key(|m| parse_version(m)); + matches.pop() } /// Runs a console command, returning the output if the command was successfully executed. @@ -213,11 +238,10 @@ fn find(library: Library, files: &[String], env: &str) -> Result Result { let mut files = vec![format!("{}clang{}", env::consts::DLL_PREFIX, env::consts::DLL_SUFFIX)]; - if cfg!(target_os="linux") { - // Some Linux distributions don't create a `libclang.so` symlink. - // - // FIXME: We should improve our detection and selection of versioned libraries. - files.push("libclang.so.1".into()); + if cfg!(any(target_os="freebsd", target_os="linux", target_os="openbsd")) { + // Some BSDs and Linux distributions don't create a `libclang.so` symlink, so we need to + // look for any versioned files (e.g., `libclang.so.3.9`). + files.push("libclang.so.*".into()); } if cfg!(target_os="windows") { // The official LLVM build uses `libclang.dll` on Windows instead of `clang.dll`. However, diff --git a/third_party/rust/peeking_take_while/.cargo-checksum.json b/third_party/rust/peeking_take_while/.cargo-checksum.json new file mode 100644 index 000000000000..ad6b4c0109f0 --- /dev/null +++ b/third_party/rust/peeking_take_while/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"1405b421de32d7744dd83162e9d640982ece71c6ccbd7ce2dc7df3d0b2c2c47d",".travis.yml":"9871eecb27ad6d76270d75534bd54581fab2a4feae93d114ae65a287ffbad5fe","Cargo.toml":"caf1a07b54869ad1b35394c5b9262fe1e8f63b7ab85bf517ad6d59c1ad1d64bc","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0","README.md":"9f7659439d3e98a3aae69562648a651e49eeac7152f489deb77dd09c0c8010d0","src/lib.rs":"699149181f71aa88dc6585bd047fc29c6f5baba2b8bf5fbd1c5612966322b379"},"package":"19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"} \ No newline at end of file diff --git a/third_party/rust/peeking_take_while/.cargo-ok b/third_party/rust/peeking_take_while/.cargo-ok new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/third_party/rust/peeking_take_while/.gitignore b/third_party/rust/peeking_take_while/.gitignore new file mode 100644 index 000000000000..4308d822046d --- /dev/null +++ b/third_party/rust/peeking_take_while/.gitignore @@ -0,0 +1,3 @@ +target/ +**/*.rs.bk +Cargo.lock diff --git a/third_party/rust/peeking_take_while/.travis.yml b/third_party/rust/peeking_take_while/.travis.yml new file mode 100644 index 000000000000..76aa37f63791 --- /dev/null +++ b/third_party/rust/peeking_take_while/.travis.yml @@ -0,0 +1,18 @@ +sudo: false +language: rust + +rust: + - stable + - beta + - nightly + +cache: cargo + +env: + matrix: + - PROFILE="" + - PROFILE="--release" + +script: + - cargo build $PROFILE --verbose + - cargo test $PROFILE --verbose diff --git a/third_party/rust/peeking_take_while/Cargo.toml b/third_party/rust/peeking_take_while/Cargo.toml new file mode 100644 index 000000000000..40aeef2d79c7 --- /dev/null +++ b/third_party/rust/peeking_take_while/Cargo.toml @@ -0,0 +1,14 @@ +[package] +authors = ["Nick Fitzgerald "] +description = "Like `Iterator::take_while`, but calls the predicate on a peeked value. This allows you to use `Iterator::by_ref` and `Iterator::take_while` together, and still get the first value for which the `take_while` predicate returned false after dropping the `by_ref`." +categories = ["rust-patterns"] +keywords = ["iterator", "take_while", "peek", "by_ref"] +license = "Apache-2.0/MIT" +name = "peeking_take_while" +readme = "./README.md" +repository = "https://github.com/fitzgen/peeking_take_while" +version = "0.1.2" + +[badges] +[badges.travis-ci] +repository = "fitzgen/peeking_take_while" diff --git a/third_party/rust/peeking_take_while/LICENSE-APACHE b/third_party/rust/peeking_take_while/LICENSE-APACHE new file mode 100644 index 000000000000..16fe87b06e80 --- /dev/null +++ b/third_party/rust/peeking_take_while/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/third_party/rust/peeking_take_while/LICENSE-MIT b/third_party/rust/peeking_take_while/LICENSE-MIT new file mode 100644 index 000000000000..e69282e381bc --- /dev/null +++ b/third_party/rust/peeking_take_while/LICENSE-MIT @@ -0,0 +1,25 @@ +Copyright (c) 2015 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/third_party/rust/peeking_take_while/README.md b/third_party/rust/peeking_take_while/README.md new file mode 100644 index 000000000000..c7486b724dae --- /dev/null +++ b/third_party/rust/peeking_take_while/README.md @@ -0,0 +1,58 @@ +# `peeking_take_while` + +[![Build Status](https://travis-ci.org/fitzgen/peeking_take_while.png?branch=master)](https://travis-ci.org/fitzgen/peeking_take_while) + +Provides the `peeking_take_while` iterator adaptor method. + +The `peeking_take_while` method is very similar to `take_while`, but behaves +differently when used with a borrowed iterator (perhaps returned by +`Iterator::by_ref`). + +`peeking_take_while` peeks at the next item in the iterator and runs the +predicate on that peeked item. This avoids consuming the first item yielded by +the underlying iterator for which the predicate returns `false`. On the other +hand, `take_while` will consume that first item for which the predicate returns +`false`, and it will be lost. + +```rust +extern crate peeking_take_while; + +// Bring the `peeking_take_while` method for peekable iterators into +// scope. +use peeking_take_while::PeekableExt; + +// Let's say we have two collections we want to iterate through: `xs` and +// `ys`. We want to perform one operation on all the leading contiguous +// elements that match some predicate, and a different thing with the rest of +// the elements. With the `xs`, we will use the normal `take_while`. With the +// `ys`, we will use `peeking_take_while`. + +let xs: Vec = (0..100).collect(); +let ys = xs.clone(); + +let mut iter_xs = xs.into_iter(); +let mut iter_ys = ys.into_iter().peekable(); + +{ + // Let's do one thing with all the items that are less than 10. + + let xs_less_than_ten = iter_xs.by_ref().take_while(|x| *x < 10); + for x in xs_less_than_ten { + do_things_with(x); + } + + let ys_less_than_ten = iter_ys.by_ref().peeking_take_while(|y| *y < 10); + for y in ys_less_than_ten { + do_things_with(y); + } +} + +// And now we will do some other thing with the items that are greater than +// or equal to 10. + +// ...except, when using plain old `take_while` we lost 10! +assert_eq!(iter_xs.next(), Some(11)); + +// However, when using `peeking_take_while` we did not! Great! +assert_eq!(iter_ys.next(), Some(10)); +``` diff --git a/third_party/rust/peeking_take_while/src/lib.rs b/third_party/rust/peeking_take_while/src/lib.rs new file mode 100644 index 000000000000..67f36d84db12 --- /dev/null +++ b/third_party/rust/peeking_take_while/src/lib.rs @@ -0,0 +1,117 @@ +//! # `peeking_take_while` +//! +//! Provides the `peeking_take_while` iterator adaptor method. +//! +//! The `peeking_take_while` method is very similar to `take_while`, but behaves +//! differently when used with a borrowed iterator (perhaps returned by +//! `Iterator::by_ref`). +//! +//! `peeking_take_while` peeks at the next item in the iterator and runs the +//! predicate on that peeked item. This avoids consuming the first item yielded +//! by the underlying iterator for which the predicate returns `false`. On the +//! other hand, `take_while` will consume that first item for which the +//! predicate returns `false`, and it will be lost. +//! +//! ``` +//! extern crate peeking_take_while; +//! +//! // Bring the `peeking_take_while` method for peekable iterators into +//! // scope. +//! use peeking_take_while::PeekableExt; +//! +//! # fn main() { +//! // Let's say we have two collections we want to iterate through: `xs` and +//! // `ys`. We want to perform one operation on all the leading contiguous +//! // elements that match some predicate, and a different thing with the rest of +//! // the elements. With the `xs`, we will use the normal `take_while`. With the +//! // `ys`, we will use `peeking_take_while`. +//! +//! let xs: Vec = (0..100).collect(); +//! let ys = xs.clone(); +//! +//! let mut iter_xs = xs.into_iter(); +//! let mut iter_ys = ys.into_iter().peekable(); +//! +//! { +//! // Let's do one thing with all the items that are less than 10. +//! # fn do_things_with(_: T) {} +//! +//! let xs_less_than_ten = iter_xs.by_ref().take_while(|x| *x < 10); +//! for x in xs_less_than_ten { +//! do_things_with(x); +//! } +//! +//! let ys_less_than_ten = iter_ys.by_ref().peeking_take_while(|y| *y < 10); +//! for y in ys_less_than_ten { +//! do_things_with(y); +//! } +//! } +//! +//! // And now we will do some other thing with the items that are greater than +//! // or equal to 10. +//! +//! // ...except, when using plain old `take_while` we lost 10! +//! assert_eq!(iter_xs.next(), Some(11)); +//! +//! // However, when using `peeking_take_while` we did not! Great! +//! assert_eq!(iter_ys.next(), Some(10)); +//! # } +//! ``` + +use std::iter::Peekable; + +/// The iterator returned by `peeking_take_while`. +/// +/// See the [module documentation](./index.html) for details. +pub struct PeekingTakeWhile<'a, I, P> + where I: 'a + Iterator +{ + iter: &'a mut Peekable, + predicate: P, +} + +impl<'a, I, P> Iterator for PeekingTakeWhile<'a, I, P> + where I: Iterator, + I::Item: ::std::fmt::Debug, + P: FnMut(&::Item) -> bool +{ + type Item = ::Item; + + fn next(&mut self) -> Option { + let predicate = &mut self.predicate; + if self.iter.peek().map_or(false, |x| !(predicate)(x)) { + None + } else { + self.iter.next() + } + } +} + +/// The `Iterator` extension trait that provides the `peeking_take_while` +/// method. +/// +/// See the [module documentation](./index.html) for details. +pub trait PeekableExt<'a, I>: Iterator + where I: 'a + Iterator +{ + /// The `Iterator` extension trait that provides the `peeking_take_while` + /// method. + /// + /// See the [module documentation](./index.html) for details. + fn peeking_take_while

(&'a mut self, predicate: P) -> PeekingTakeWhile<'a, I, P> + where Self: Sized, + P: FnMut(&::Item) -> bool; +} + +impl<'a, I> PeekableExt<'a, I> for Peekable + where I: 'a + Iterator +{ + fn peeking_take_while

(&'a mut self, predicate: P) -> PeekingTakeWhile + where P: FnMut(&::Item) -> bool + { + PeekingTakeWhile { + iter: self, + predicate: predicate, + } + } +} diff --git a/toolkit/library/gtest/rust/Cargo.lock b/toolkit/library/gtest/rust/Cargo.lock index cc63c0a63b3b..5fa62c76346e 100644 --- a/toolkit/library/gtest/rust/Cargo.lock +++ b/toolkit/library/gtest/rust/Cargo.lock @@ -70,17 +70,18 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.25.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "cexpr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "clang-sys 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "clang-sys 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.20.5 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "quasi 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "quasi_codegen 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -135,7 +136,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "clang-sys" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -566,6 +567,11 @@ name = "pdqsort" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "phf" version = "0.7.21" @@ -805,7 +811,7 @@ dependencies = [ "app_units 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "arrayvec 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", "atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bindgen 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bindgen 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)", "bit-vec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1136,7 +1142,7 @@ dependencies = [ "checksum atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb2dcb6e6d35f20276943cc04bb98e538b348d525a04ac79c10021561d202f21" "checksum binary-space-partition 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "88ceb0d16c4fd0e42876e298d7d3ce3780dd9ebdcbe4199816a32c77e08597ff" "checksum bincode 1.0.0-alpha6 (registry+https://github.com/rust-lang/crates.io-index)" = "fb0cdeac1c5d567fdb487ae5853c024e4acf1ea85ba6a6552fe084e0805fea5d" -"checksum bindgen 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ccaf8958532d7e570e905266ee2dc1094c3e5c3c3cfc2c299368747a30a5e654" +"checksum bindgen 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)" = "708a688675f9d2e7c73018e17f5997beacc9a5ca87a0cb60c13093915facda32" "checksum bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9bf6104718e80d7b26a68fdbacff3481cfc05df670821affc7e9cbc1884400c" "checksum bit-vec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5b97c2c8e8bbb4251754f559df8af22fb264853c7d009084a576cdf12565089d" "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" @@ -1145,7 +1151,7 @@ dependencies = [ "checksum byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c40977b0ee6b9885c9013cd41d9feffdd22deb3bb4dc3a71d901cc7a77de18c8" "checksum cexpr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "393a5f0088efbe41f9d1fcd062f24e83c278608420e62109feb2c8abee07de7d" "checksum cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c" -"checksum clang-sys 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "33d47b0ea88a529a570490efbb79403e416e89864ce8a96bf23e2a0f23d7e9eb" +"checksum clang-sys 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff7c2d1502c65748c7221f43ce670b3ba5c697acebfeb85a580827daca6975fc" "checksum clap 2.20.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7db281b0520e97fbd15cd615dcd8f8bcad0c26f5f7d5effe705f090f39e9a758" "checksum core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f51ce3b8ebe311c56de14231eb57572c15abebd2d32b3bcb99bcdb9c101f5ac3" "checksum core-foundation-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "41115a6aa5d3e1e5ef98148373f25971d1fad53818553f216495f9e67e90a624" @@ -1187,6 +1193,7 @@ dependencies = [ "checksum parking_lot 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "fa12d706797d42551663426a45e2db2e0364bd1dbf6aeada87e89c5f981f43e9" "checksum parking_lot_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "56a19dcbb5d1e32b6cccb8a9aa1fc2a38418c8699652e735e2bf391a3dc0aa16" "checksum pdqsort 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ceca1642c89148ca05611cc775a0c383abef355fc4907c4e95f49f7b09d6287c" +"checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" "checksum phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "cb325642290f28ee14d8c6201159949a872f220c62af6e110a56ea914fbe42fc" "checksum phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d62594c0bb54c464f633175d502038177e90309daf2e0158be42ed5f023ce88f" "checksum phf_generator 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "6b07ffcc532ccc85e3afc45865469bf5d9e4ef5bfcf9622e3cfe80c2d275ec03" diff --git a/toolkit/library/rust/Cargo.lock b/toolkit/library/rust/Cargo.lock index bd26b24745eb..1ef22c4e1227 100644 --- a/toolkit/library/rust/Cargo.lock +++ b/toolkit/library/rust/Cargo.lock @@ -68,17 +68,18 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.25.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "cexpr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "clang-sys 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "clang-sys 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.20.5 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "quasi 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "quasi_codegen 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -133,7 +134,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "clang-sys" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -553,6 +554,11 @@ name = "pdqsort" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "phf" version = "0.7.21" @@ -792,7 +798,7 @@ dependencies = [ "app_units 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "arrayvec 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", "atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bindgen 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bindgen 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)", "bit-vec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1123,7 +1129,7 @@ dependencies = [ "checksum atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb2dcb6e6d35f20276943cc04bb98e538b348d525a04ac79c10021561d202f21" "checksum binary-space-partition 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "88ceb0d16c4fd0e42876e298d7d3ce3780dd9ebdcbe4199816a32c77e08597ff" "checksum bincode 1.0.0-alpha6 (registry+https://github.com/rust-lang/crates.io-index)" = "fb0cdeac1c5d567fdb487ae5853c024e4acf1ea85ba6a6552fe084e0805fea5d" -"checksum bindgen 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ccaf8958532d7e570e905266ee2dc1094c3e5c3c3cfc2c299368747a30a5e654" +"checksum bindgen 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)" = "708a688675f9d2e7c73018e17f5997beacc9a5ca87a0cb60c13093915facda32" "checksum bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9bf6104718e80d7b26a68fdbacff3481cfc05df670821affc7e9cbc1884400c" "checksum bit-vec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5b97c2c8e8bbb4251754f559df8af22fb264853c7d009084a576cdf12565089d" "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" @@ -1132,7 +1138,7 @@ dependencies = [ "checksum byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c40977b0ee6b9885c9013cd41d9feffdd22deb3bb4dc3a71d901cc7a77de18c8" "checksum cexpr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "393a5f0088efbe41f9d1fcd062f24e83c278608420e62109feb2c8abee07de7d" "checksum cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c" -"checksum clang-sys 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "33d47b0ea88a529a570490efbb79403e416e89864ce8a96bf23e2a0f23d7e9eb" +"checksum clang-sys 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff7c2d1502c65748c7221f43ce670b3ba5c697acebfeb85a580827daca6975fc" "checksum clap 2.20.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7db281b0520e97fbd15cd615dcd8f8bcad0c26f5f7d5effe705f090f39e9a758" "checksum core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f51ce3b8ebe311c56de14231eb57572c15abebd2d32b3bcb99bcdb9c101f5ac3" "checksum core-foundation-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "41115a6aa5d3e1e5ef98148373f25971d1fad53818553f216495f9e67e90a624" @@ -1174,6 +1180,7 @@ dependencies = [ "checksum parking_lot 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "fa12d706797d42551663426a45e2db2e0364bd1dbf6aeada87e89c5f981f43e9" "checksum parking_lot_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "56a19dcbb5d1e32b6cccb8a9aa1fc2a38418c8699652e735e2bf391a3dc0aa16" "checksum pdqsort 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ceca1642c89148ca05611cc775a0c383abef355fc4907c4e95f49f7b09d6287c" +"checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" "checksum phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "cb325642290f28ee14d8c6201159949a872f220c62af6e110a56ea914fbe42fc" "checksum phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d62594c0bb54c464f633175d502038177e90309daf2e0158be42ed5f023ce88f" "checksum phf_generator 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "6b07ffcc532ccc85e3afc45865469bf5d9e4ef5bfcf9622e3cfe80c2d275ec03" From 51e1c0b54e07492b4f199425b5d0c7d4252e7114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 20 May 2017 14:35:37 +0200 Subject: [PATCH 51/56] Bug 1366142: Ignore reentrant change hints without primary frame. r=heycam MozReview-Commit-ID: 4bF7M0KMhNL --HG-- extra : rebase_source : 5ad2d1a21e8b1110345b3b2c350de0f1011e61dc --- layout/base/ServoRestyleManager.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/layout/base/ServoRestyleManager.cpp b/layout/base/ServoRestyleManager.cpp index 8ff1dc181529..c0f5f3d6dfef 100644 --- a/layout/base/ServoRestyleManager.cpp +++ b/layout/base/ServoRestyleManager.cpp @@ -578,6 +578,14 @@ ServoRestyleManager::DoProcessPendingRestyles(TraversalRestyleBehavior ProcessRestyledFrames(currentChanges); MOZ_ASSERT(currentChanges.IsEmpty()); for (ReentrantChange& change: newChanges) { + if (!(change.mHint & nsChangeHint_ReconstructFrame) && + !change.mContent->GetPrimaryFrame()) { + // SVG Elements post change hints without ensuring that the primary + // frame will be there after that (see bug 1366142). + // + // Just ignore those, since we can't really process them. + continue; + } currentChanges.AppendChange(change.mContent->GetPrimaryFrame(), change.mContent, change.mHint); } From c1efdc2244d7ec99b55ce7f9b8f566502c759f28 Mon Sep 17 00:00:00 2001 From: Cykesiopka Date: Sun, 21 May 2017 10:43:18 +0800 Subject: [PATCH 52/56] Bug 1174555 - Stop using PR_sscanf() in nsSiteSecurityService.cpp. r=keeler While the uses of PR_sscanf() in PSM are safe, the function in general is vulnerable to format string attacks, and so should be avoided. This change removes the only uses of the function in PSM and moves to the more obviously safe mozilla::Tokenizer. MozReview-Commit-ID: J4BP6JTE1zI --HG-- extra : rebase_source : e77e8b1ba70bef6f0ff794b7d066bbbdebe8f58e --- .../manager/ssl/nsSiteSecurityService.cpp | 278 ++++++++++++------ 1 file changed, 196 insertions(+), 82 deletions(-) diff --git a/security/manager/ssl/nsSiteSecurityService.cpp b/security/manager/ssl/nsSiteSecurityService.cpp index fbcd626356cc..753ea0466f34 100644 --- a/security/manager/ssl/nsSiteSecurityService.cpp +++ b/security/manager/ssl/nsSiteSecurityService.cpp @@ -9,12 +9,14 @@ #include "ScopedNSSTypes.h" #include "SharedCertVerifier.h" #include "mozilla/Assertions.h" +#include "mozilla/Attributes.h" #include "mozilla/Base64.h" -#include "mozilla/dom/PContent.h" -#include "mozilla/dom/ToJSValue.h" #include "mozilla/LinkedList.h" #include "mozilla/Logging.h" #include "mozilla/Preferences.h" +#include "mozilla/Tokenizer.h" +#include "mozilla/dom/PContent.h" +#include "mozilla/dom/ToJSValue.h" #include "nsArrayEnumerator.h" #include "nsCOMArray.h" #include "nsISSLStatus.h" @@ -28,11 +30,9 @@ #include "nsReadableUtils.h" #include "nsSecurityHeaderParser.h" #include "nsThreadUtils.h" -#include "nsXULAppAPI.h" #include "nsVariant.h" -#include "plstr.h" +#include "nsXULAppAPI.h" #include "prnetdb.h" -#include "prprf.h" // A note about the preload list: // When a site specifically disables HSTS by sending a header with @@ -57,6 +57,131 @@ const char kHPKPKeySuffix[] = ":HPKP"; NS_IMPL_ISUPPORTS(SiteHSTSState, nsISiteSecurityState, nsISiteHSTSState) +namespace { + +static bool +stringIsBase64EncodingOf256bitValue(const nsCString& encodedString) { + nsAutoCString binaryValue; + nsresult rv = Base64Decode(encodedString, binaryValue); + if (NS_FAILED(rv)) { + return false; + } + + return binaryValue.Length() == SHA256_LENGTH; +} + +class SSSTokenizer final : public Tokenizer +{ +public: + explicit SSSTokenizer(const nsACString& source) + : Tokenizer(source) + { + } + + MOZ_MUST_USE bool + ReadBool(/*out*/ bool& value) + { + uint8_t rawValue; + if (!ReadInteger(&rawValue)) { + return false; + } + + if (rawValue != 0 && rawValue != 1) { + return false; + } + + value = (rawValue == 1); + return true; + } + + MOZ_MUST_USE bool + ReadState(/*out*/ SecurityPropertyState& state) + { + uint32_t rawValue; + if (!ReadInteger(&rawValue)) { + return false; + } + + state = static_cast(rawValue); + switch (state) { + case SecurityPropertyKnockout: + case SecurityPropertyNegative: + case SecurityPropertySet: + case SecurityPropertyUnset: + break; + default: + return false; + } + + return true; + } + + // Note: Ideally, this method would be able to read SHA256 strings without + // reading all the way to EOF. Unfortunately, if a token starts with digits + // mozilla::Tokenizer will by default not consider the digits part of the + // string. This can be worked around by making mozilla::Tokenizer consider + // digit characters as "word" characters as well, but this can't be changed at + // run time, meaning parsing digits as a number will fail. + MOZ_MUST_USE bool + ReadUntilEOFAsSHA256Keys(/*out*/ nsTArray& keys) + { + nsAutoCString mergedKeys; + if (!ReadUntil(Token::EndOfFile(), mergedKeys, EXCLUDE_LAST)) { + return false; + } + + // This check makes sure the Substring() calls below are always valid. + static const uint32_t SHA256Base64Len = 44; + if (mergedKeys.Length() % SHA256Base64Len != 0) { + return false; + } + + for (uint32_t i = 0; i < mergedKeys.Length(); i += SHA256Base64Len) { + nsAutoCString key(Substring(mergedKeys, i, SHA256Base64Len)); + if (!stringIsBase64EncodingOf256bitValue(key)) { + return false; + } + keys.AppendElement(key); + } + + return !keys.IsEmpty(); + } +}; + +// Parses a state string like "1500918564034,1,1" into its constituent parts. +bool +ParseHSTSState(const nsCString& stateString, + /*out*/ PRTime& expireTime, + /*out*/ SecurityPropertyState& state, + /*out*/ bool& includeSubdomains) +{ + SSSTokenizer tokenizer(stateString); + + if (!tokenizer.ReadInteger(&expireTime)) { + return false; + } + + if (!tokenizer.CheckChar(',')) { + return false; + } + + if (!tokenizer.ReadState(state)) { + return false; + } + + if (!tokenizer.CheckChar(',')) { + return false; + } + + if (!tokenizer.ReadBool(includeSubdomains)) { + return false; + } + + return tokenizer.CheckEOF(); +} + +} // namespace + SiteHSTSState::SiteHSTSState(const nsCString& aHost, const OriginAttributes& aOriginAttributes, const nsCString& aStateString) @@ -66,21 +191,9 @@ SiteHSTSState::SiteHSTSState(const nsCString& aHost, , mHSTSState(SecurityPropertyUnset) , mHSTSIncludeSubdomains(false) { - uint32_t hstsState = 0; - uint32_t hstsIncludeSubdomains = 0; // PR_sscanf doesn't handle bools. - int32_t matches = PR_sscanf(aStateString.get(), "%lld,%lu,%lu", - &mHSTSExpireTime, &hstsState, - &hstsIncludeSubdomains); - bool valid = (matches == 3 && - (hstsIncludeSubdomains == 0 || hstsIncludeSubdomains == 1) && - ((SecurityPropertyState)hstsState == SecurityPropertyUnset || - (SecurityPropertyState)hstsState == SecurityPropertySet || - (SecurityPropertyState)hstsState == SecurityPropertyKnockout || - (SecurityPropertyState)hstsState == SecurityPropertyNegative)); - if (valid) { - mHSTSState = (SecurityPropertyState)hstsState; - mHSTSIncludeSubdomains = (hstsIncludeSubdomains == 1); - } else { + bool valid = ParseHSTSState(aStateString, mHSTSExpireTime, mHSTSState, + mHSTSIncludeSubdomains); + if (!valid) { SSSLOG(("%s is not a valid SiteHSTSState", aStateString.get())); mHSTSExpireTime = 0; mHSTSState = SecurityPropertyUnset; @@ -158,19 +271,66 @@ SiteHSTSState::GetOriginAttributes(JSContext* aCx, NS_IMPL_ISUPPORTS(SiteHPKPState, nsISiteSecurityState, nsISiteHPKPState) -static bool -stringIsBase64EncodingOf256bitValue(nsCString& encodedString) { - nsAutoCString binaryValue; - nsresult rv = mozilla::Base64Decode(encodedString, binaryValue); - if (NS_FAILED(rv)) { +namespace { + +// Parses a state string like +// "1494603034103,1,1,AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" into its +// constituent parts. +bool +ParseHPKPState(const nsCString& stateString, + /*out*/ PRTime& expireTime, + /*out*/ SecurityPropertyState& state, + /*out*/ bool& includeSubdomains, + /*out*/ nsTArray& sha256keys) +{ + SSSTokenizer tokenizer(stateString); + + if (!tokenizer.ReadInteger(&expireTime)) { return false; } - if (binaryValue.Length() != SHA256_LENGTH) { + + if (!tokenizer.CheckChar(',')) { return false; } - return true; + + if (!tokenizer.ReadState(state)) { + return false; + } + + // SecurityPropertyNegative isn't a valid state for HPKP. + switch (state) { + case SecurityPropertyKnockout: + case SecurityPropertySet: + case SecurityPropertyUnset: + break; + case SecurityPropertyNegative: + default: + return false; + } + + if (!tokenizer.CheckChar(',')) { + return false; + } + + if (!tokenizer.ReadBool(includeSubdomains)) { + return false; + } + + if (!tokenizer.CheckChar(',')) { + return false; + } + + if (state == SecurityPropertySet) { + // This reads to the end of input, so there's no need to explicitly check + // for EOF. + return tokenizer.ReadUntilEOFAsSHA256Keys(sha256keys); + } + + return tokenizer.CheckEOF(); } +} // namespace + SiteHPKPState::SiteHPKPState() : mExpireTime(0) , mState(SecurityPropertyUnset) @@ -187,52 +347,9 @@ SiteHPKPState::SiteHPKPState(const nsCString& aHost, , mState(SecurityPropertyUnset) , mIncludeSubdomains(false) { - uint32_t hpkpState = 0; - uint32_t hpkpIncludeSubdomains = 0; // PR_sscanf doesn't handle bools. - const uint32_t MaxMergedHPKPPinSize = 1024; - char mergedHPKPins[MaxMergedHPKPPinSize]; - memset(mergedHPKPins, 0, MaxMergedHPKPPinSize); - - if (aStateString.Length() >= MaxMergedHPKPPinSize) { - SSSLOG(("SSS: Cannot parse PKPState string, too large\n")); - return; - } - - int32_t matches = PR_sscanf(aStateString.get(), "%lld,%lu,%lu,%s", - &mExpireTime, &hpkpState, - &hpkpIncludeSubdomains, mergedHPKPins); - bool valid = (matches == 4 && - (hpkpIncludeSubdomains == 0 || hpkpIncludeSubdomains == 1) && - ((SecurityPropertyState)hpkpState == SecurityPropertyUnset || - (SecurityPropertyState)hpkpState == SecurityPropertySet || - (SecurityPropertyState)hpkpState == SecurityPropertyKnockout)); - - SSSLOG(("SSS: loading SiteHPKPState matches=%d\n", matches)); - const uint32_t SHA256Base64Len = 44; - - if (valid && (SecurityPropertyState)hpkpState == SecurityPropertySet) { - // try to expand the merged PKPins - const char* cur = mergedHPKPins; - nsAutoCString pin; - uint32_t collectedLen = 0; - mergedHPKPins[MaxMergedHPKPPinSize - 1] = 0; - size_t totalLen = strlen(mergedHPKPins); - while (collectedLen + SHA256Base64Len <= totalLen) { - pin.Assign(cur, SHA256Base64Len); - if (stringIsBase64EncodingOf256bitValue(pin)) { - mSHA256keys.AppendElement(pin); - } - cur += SHA256Base64Len; - collectedLen += SHA256Base64Len; - } - if (mSHA256keys.IsEmpty()) { - valid = false; - } - } - if (valid) { - mState = (SecurityPropertyState)hpkpState; - mIncludeSubdomains = (hpkpIncludeSubdomains == 1); - } else { + bool valid = ParseHPKPState(aStateString, mExpireTime, mState, + mIncludeSubdomains, mSHA256keys); + if (!valid) { SSSLOG(("%s is not a valid SiteHPKPState", aStateString.get())); mExpireTime = 0; mState = SecurityPropertyUnset; @@ -827,17 +944,14 @@ ParseSSSHeaders(uint32_t aType, SSSLOG(("SSS: found max-age directive")); foundMaxAge = true; - size_t len = directive->mValue.Length(); - for (size_t i = 0; i < len; i++) { - char chr = directive->mValue.CharAt(i); - if (chr < '0' || chr > '9') { - SSSLOG(("SSS: invalid value for max-age directive")); - return nsISiteSecurityService::ERROR_INVALID_MAX_AGE; - } + Tokenizer tokenizer(directive->mValue); + if (!tokenizer.ReadInteger(&maxAge)) { + SSSLOG(("SSS: could not parse delta-seconds")); + return nsISiteSecurityService::ERROR_INVALID_MAX_AGE; } - if (PR_sscanf(directive->mValue.get(), "%llu", &maxAge) != 1) { - SSSLOG(("SSS: could not parse delta-seconds")); + if (!tokenizer.CheckEOF()) { + SSSLOG(("SSS: invalid value for max-age directive")); return nsISiteSecurityService::ERROR_INVALID_MAX_AGE; } From 114202795c93c1079ccdc45db277fcd529049694 Mon Sep 17 00:00:00 2001 From: Cykesiopka Date: Sun, 21 May 2017 10:43:32 +0800 Subject: [PATCH 53/56] Bug 1174555 - Clean up some SiteSecurityService state file related tests. r=keeler MozReview-Commit-ID: 6qXV04CUElu --HG-- extra : rebase_source : ba47e0cfe9317703895df02277568e59cc56591c --- security/manager/ssl/tests/unit/head_psm.js | 14 ++++++++++ .../ssl/tests/unit/test_pinning_dynamic.js | 21 +++++++-------- .../ssl/tests/unit/test_sss_readstate.js | 24 ++++++++--------- .../tests/unit/test_sss_readstate_child.js | 24 ++++++++--------- .../tests/unit/test_sss_readstate_garbage.js | 26 +++++++++---------- .../ssl/tests/unit/test_sss_readstate_huge.js | 14 +++++----- 6 files changed, 65 insertions(+), 58 deletions(-) diff --git a/security/manager/ssl/tests/unit/head_psm.js b/security/manager/ssl/tests/unit/head_psm.js index 3ad8e9f5fe1e..10881e9ef78d 100644 --- a/security/manager/ssl/tests/unit/head_psm.js +++ b/security/manager/ssl/tests/unit/head_psm.js @@ -867,3 +867,17 @@ function hexify(data) { // prepending a "0" solves the problem. return Array.from(data, (c, i) => ("0" + data.charCodeAt(i).toString(16)).slice(-2)).join(""); } + +/** + * @param {String[]} lines + * Lines to write. Each line automatically has "\n" appended to it when + * being written. + * @param {nsIFileOutputStream} outputStream + */ +function writeLinesAndClose(lines, outputStream) { + for (let line of lines) { + line += "\n"; + outputStream.write(line, line.length); + } + outputStream.close(); +} diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic.js b/security/manager/ssl/tests/unit/test_pinning_dynamic.js index 2457725adc69..41f42ffeb83b 100644 --- a/security/manager/ssl/tests/unit/test_pinning_dynamic.js +++ b/security/manager/ssl/tests/unit/test_pinning_dynamic.js @@ -6,10 +6,6 @@ // The purpose of this test is to create a site security service state file // and see that the site security service reads it properly. -function writeLine(aLine, aOutputStream) { - aOutputStream.write(aLine, aLine.length); -} - var gSSService = null; var gSSSStateSeen = false; var gPreloadStateSeen = false; @@ -50,11 +46,12 @@ function run_test() { ok(!stateFile.exists(), "State file should not exist when working with a clean slate"); let outputStream = FileUtils.openFileOutputStream(stateFile); - let now = (new Date()).getTime(); - writeLine(`a.pinning2.example.com:HPKP\t0\t0\t${now + 100000},1,0,${PINNING_ROOT_KEY_HASH}\n`, outputStream); - writeLine(`b.pinning2.example.com:HPKP\t0\t0\t${now + 100000},1,1,${PINNING_ROOT_KEY_HASH}\n`, outputStream); - - outputStream.close(); + let expiryTime = Date.now() + 100000; + let lines = [ + `a.pinning2.example.com:HPKP\t0\t0\t${expiryTime},1,0,${PINNING_ROOT_KEY_HASH}`, + `b.pinning2.example.com:HPKP\t0\t0\t${expiryTime},1,1,${PINNING_ROOT_KEY_HASH}`, + ]; + writeLinesAndClose(lines, outputStream); let preloadFile = profileDir.clone(); preloadFile.append(PRELOAD_STATE_FILE_NAME); @@ -62,8 +59,10 @@ function run_test() { "Preload file should not exist when working with a clean slate"); outputStream = FileUtils.openFileOutputStream(preloadFile); - writeLine(`a.preload.example.com:HPKP\t0\t0\t${now + 100000},1,1,${PINNING_ROOT_KEY_HASH}\n`, outputStream); - outputStream.close(); + lines = [ + `a.preload.example.com:HPKP\t0\t0\t${expiryTime},1,1,${PINNING_ROOT_KEY_HASH}`, + ]; + writeLinesAndClose(lines, outputStream); Services.obs.addObserver(checkStateRead, "data-storage-ready"); do_test_pending(); diff --git a/security/manager/ssl/tests/unit/test_sss_readstate.js b/security/manager/ssl/tests/unit/test_sss_readstate.js index 6015991e4d60..379a7ff3988e 100644 --- a/security/manager/ssl/tests/unit/test_sss_readstate.js +++ b/security/manager/ssl/tests/unit/test_sss_readstate.js @@ -6,10 +6,6 @@ // The purpose of this test is to create a site security service state file // and see that the site security service reads it properly. -function writeLine(aLine, aOutputStream) { - aOutputStream.write(aLine, aLine.length); -} - var gSSService = null; function checkStateRead(aSubject, aTopic, aData) { @@ -79,15 +75,17 @@ function run_test() { // until we create it. ok(!stateFile.exists()); let outputStream = FileUtils.openFileOutputStream(stateFile); - let now = (new Date()).getTime(); - writeLine("expired.example.com:HSTS\t0\t0\t" + (now - 100000) + ",1,0\n", outputStream); - writeLine("notexpired.example.com:HSTS\t0\t0\t" + (now + 100000) + ",1,0\n", outputStream); - // This overrides an entry on the preload list. - writeLine("includesubdomains.preloaded.test:HSTS\t0\t0\t" + (now + 100000) + ",1,0\n", outputStream); - writeLine("incsubdomain.example.com:HSTS\t0\t0\t" + (now + 100000) + ",1,1\n", outputStream); - // This overrides an entry on the preload list. - writeLine("includesubdomains2.preloaded.test:HSTS\t0\t0\t0,2,0\n", outputStream); - outputStream.close(); + let now = Date.now(); + let lines = [ + `expired.example.com:HSTS\t0\t0\t${now - 100000},1,0`, + `notexpired.example.com:HSTS\t0\t0\t${now + 100000},1,0`, + // This overrides an entry on the preload list. + `includesubdomains.preloaded.test:HSTS\t0\t0\t${now + 100000},1,0`, + `incsubdomain.example.com:HSTS\t0\t0\t${now + 100000},1,1`, + // This overrides an entry on the preload list. + "includesubdomains2.preloaded.test:HSTS\t0\t0\t0,2,0", + ]; + writeLinesAndClose(lines, outputStream); Services.obs.addObserver(checkStateRead, "data-storage-ready"); do_test_pending(); gSSService = Cc["@mozilla.org/ssservice;1"] diff --git a/security/manager/ssl/tests/unit/test_sss_readstate_child.js b/security/manager/ssl/tests/unit/test_sss_readstate_child.js index 50d79037e764..7fc56da4293d 100644 --- a/security/manager/ssl/tests/unit/test_sss_readstate_child.js +++ b/security/manager/ssl/tests/unit/test_sss_readstate_child.js @@ -7,10 +7,6 @@ // and see that the site security service reads it properly. We also verify // that state changes are reflected in the child process. -function writeLine(aLine, aOutputStream) { - aOutputStream.write(aLine, aLine.length); -} - function start_test_in_child() { run_test_in_child("sss_readstate_child_worker.js"); do_test_finished(); @@ -24,15 +20,17 @@ function run_test() { // until we create it. ok(!stateFile.exists()); let outputStream = FileUtils.openFileOutputStream(stateFile); - let now = (new Date()).getTime(); - writeLine("expired.example.com:HSTS\t0\t0\t" + (now - 100000) + ",1,0\n", outputStream); - writeLine("notexpired.example.com:HSTS\t0\t0\t" + (now + 100000) + ",1,0\n", outputStream); - // This overrides an entry on the preload list. - writeLine("includesubdomains.preloaded.test:HSTS\t0\t0\t" + (now + 100000) + ",1,0\n", outputStream); - writeLine("incsubdomain.example.com:HSTS\t0\t0\t" + (now + 100000) + ",1,1\n", outputStream); - // This overrides an entry on the preload list. - writeLine("includesubdomains2.preloaded.test:HSTS\t0\t0\t0,2,0\n", outputStream); - outputStream.close(); + let now = Date.now(); + let lines = [ + `expired.example.com:HSTS\t0\t0\t${now - 100000},1,0`, + `notexpired.example.com:HSTS\t0\t0\t${now + 100000},1,0`, + // This overrides an entry on the preload list. + `includesubdomains.preloaded.test:HSTS\t0\t0\t${now + 100000},1,0`, + `incsubdomain.example.com:HSTS\t0\t0\t${now + 100000},1,1`, + // This overrides an entry on the preload list. + "includesubdomains2.preloaded.test:HSTS\t0\t0\t0,2,0", + ]; + writeLinesAndClose(lines, outputStream); Services.obs.addObserver(start_test_in_child, "data-storage-ready"); do_test_pending(); let SSService = Cc["@mozilla.org/ssservice;1"] diff --git a/security/manager/ssl/tests/unit/test_sss_readstate_garbage.js b/security/manager/ssl/tests/unit/test_sss_readstate_garbage.js index c3b69fedefe4..31a573eb0155 100644 --- a/security/manager/ssl/tests/unit/test_sss_readstate_garbage.js +++ b/security/manager/ssl/tests/unit/test_sss_readstate_garbage.js @@ -6,10 +6,6 @@ // The purpose of this test is to create a mostly bogus site security service // state file and see that the site security service handles it properly. -function writeLine(aLine, aOutputStream) { - aOutputStream.write(aLine, aLine.length); -} - var gSSService = null; function checkStateRead(aSubject, aTopic, aData) { @@ -41,16 +37,18 @@ function run_test() { // until we create it. ok(!stateFile.exists()); let outputStream = FileUtils.openFileOutputStream(stateFile); - let now = (new Date()).getTime(); - writeLine("example1.example.com:HSTS\t0\t0\t" + (now + 100000) + ",1,0\n", outputStream); - writeLine("I'm a lumberjack and I'm okay; I work all night and I sleep all day!\n", outputStream); - writeLine("This is a totally bogus entry\t\n", outputStream); - writeLine("0\t0\t0\t0\t\n", outputStream); - writeLine("\t\t\t\t\t\t\t\n", outputStream); - writeLine("example.com:HSTS\t\t\t\t\t\t\t\n", outputStream); - writeLine("example3.example.com:HSTS\t0\t\t\t\t\t\t\n", outputStream); - writeLine("example2.example.com:HSTS\t0\t0\t" + (now + 100000) + ",1,0\n", outputStream); - outputStream.close(); + let expiryTime = Date.now() + 100000; + let lines = [ + `example1.example.com:HSTS\t0\t0\t${expiryTime},1,0`, + "I'm a lumberjack and I'm okay; I work all night and I sleep all day!", + "This is a totally bogus entry\t", + "0\t0\t0\t0\t", + "\t\t\t\t\t\t\t", + "example.com:HSTS\t\t\t\t\t\t\t", + "example3.example.com:HSTS\t0\t\t\t\t\t\t", + `example2.example.com:HSTS\t0\t0\t${expiryTime},1,0`, + ]; + writeLinesAndClose(lines, outputStream); Services.obs.addObserver(checkStateRead, "data-storage-ready"); do_test_pending(); gSSService = Cc["@mozilla.org/ssservice;1"] diff --git a/security/manager/ssl/tests/unit/test_sss_readstate_huge.js b/security/manager/ssl/tests/unit/test_sss_readstate_huge.js index 549a99377746..d1db12967ca2 100644 --- a/security/manager/ssl/tests/unit/test_sss_readstate_huge.js +++ b/security/manager/ssl/tests/unit/test_sss_readstate_huge.js @@ -7,10 +7,6 @@ // that is too large and see that the site security service reads it properly // (this means discarding all entries after the 1024th). -function writeLine(aLine, aOutputStream) { - aOutputStream.write(aLine, aLine.length); -} - var gSSService = null; function checkStateRead(aSubject, aTopic, aData) { @@ -52,13 +48,17 @@ function run_test() { // until we create it. ok(!stateFile.exists()); let outputStream = FileUtils.openFileOutputStream(stateFile); - let now = (new Date()).getTime(); + let expiryTime = Date.now() + 100000; + let lines = []; for (let i = 0; i < 10000; i++) { // The 0s will all get squashed down into one 0 when they are read. // This is just to make the file size large (>2MB). - writeLine("example" + i + ".example.com:HSTS\t0000000000000000000000000000000000000000000000000\t00000000000000000000000000000000000000\t" + (now + 100000) + ",1,0000000000000000000000000000000000000000000000000000000000000000000000000\n", outputStream); + lines.push(`example${i}.example.com:HSTS\t` + + "0000000000000000000000000000000000000000000000000\t" + + "00000000000000000000000000000000000000\t" + + `${expiryTime},1,0000000000000000000000000000000000000000000000000000000000000000000000000`); } - outputStream.close(); + writeLinesAndClose(lines, outputStream); Services.obs.addObserver(checkStateRead, "data-storage-ready"); do_test_pending(); gSSService = Cc["@mozilla.org/ssservice;1"] From 73288e2bbf0521d8c99aaa144c12990d86380a63 Mon Sep 17 00:00:00 2001 From: Cykesiopka Date: Sun, 21 May 2017 10:43:44 +0800 Subject: [PATCH 54/56] Bug 1174555 - Improve state string parsing test coverage. r=keeler MozReview-Commit-ID: Fv66f1gu4kT --HG-- extra : rebase_source : f02a317fd958909d42bad9cd206f5a74f36d8689 --- .../tests/unit/test_sss_readstate_garbage.js | 119 ++++++++++++++++-- 1 file changed, 108 insertions(+), 11 deletions(-) diff --git a/security/manager/ssl/tests/unit/test_sss_readstate_garbage.js b/security/manager/ssl/tests/unit/test_sss_readstate_garbage.js index 31a573eb0155..9d0076597155 100644 --- a/security/manager/ssl/tests/unit/test_sss_readstate_garbage.js +++ b/security/manager/ssl/tests/unit/test_sss_readstate_garbage.js @@ -15,20 +15,79 @@ function checkStateRead(aSubject, aTopic, aData) { equal(aData, SSS_STATE_FILE_NAME); - ok(gSSService.isSecureURI(Ci.nsISiteSecurityService.HEADER_HSTS, - Services.io.newURI("https://example1.example.com"), - 0)); - ok(gSSService.isSecureURI(Ci.nsISiteSecurityService.HEADER_HSTS, - Services.io.newURI("https://example2.example.com"), - 0)); - ok(!gSSService.isSecureURI(Ci.nsISiteSecurityService.HEADER_HSTS, - Services.io.newURI("https://example.com"), 0)); - ok(!gSSService.isSecureURI(Ci.nsISiteSecurityService.HEADER_HSTS, - Services.io.newURI("https://example3.example.com"), - 0)); + const HSTS_HOSTS = [ + "https://example1.example.com", + "https://example2.example.com", + ]; + for (let host of HSTS_HOSTS) { + ok(gSSService.isSecureURI(Ci.nsISiteSecurityService.HEADER_HSTS, + Services.io.newURI(host), + 0), + `${host} should be HSTS enabled`); + } + + const HPKP_HOSTS = [ + "https://keys.with.securitypropertyset.example.com", + "https://starts.with.number.key.example.com", + "https://starts.with.symbol.key.example.com", + "https://multiple.keys.example.com", + ]; + for (let host of HPKP_HOSTS) { + ok(gSSService.isSecureURI(Ci.nsISiteSecurityService.HEADER_HPKP, + Services.io.newURI(host), + 0), + `${host} should be HPKP enabled`); + } + + const NOT_HSTS_OR_HPKP_HOSTS = [ + "https://example.com", + "https://example3.example.com", + "https://extra.comma.example.com", + "https://empty.statestring.example.com", + "https://rubbish.statestring.example.com", + "https://spaces.statestring.example.com", + "https://invalid.expirytime.example.com", + "https://text.securitypropertystate.example.com", + "https://invalid.securitypropertystate.example.com", + "https://text.includesubdomains.example.com", + "https://invalid.includesubdomains.example.com", + ]; + for (let host of NOT_HSTS_OR_HPKP_HOSTS) { + ok(!gSSService.isSecureURI(Ci.nsISiteSecurityService.HEADER_HSTS, + Services.io.newURI(host), + 0), + `${host} should not be HSTS enabled`); + ok(!gSSService.isSecureURI(Ci.nsISiteSecurityService.HEADER_HPKP, + Services.io.newURI(host), + 0), + `${host} should not be HPKP enabled`); + } + + const NOT_HPKP_HOSTS = [ + "https://empty.keys.example.com", + "https://rubbish.after.keys.example.com", + "https://keys.with.securitypropertyunset.example.com", + "https://keys.with.securitypropertyknockout.example.com", + "https://securitypropertynegative.example.com", + "https://not.sha256.key.example.com", + ]; + for (let host of NOT_HPKP_HOSTS) { + ok(!gSSService.isSecureURI(Ci.nsISiteSecurityService.HEADER_HPKP, + Services.io.newURI(host), + 0), + `${host} should not be HPKP enabled`); + } + do_test_finished(); } +const PINNING_ROOT_KEY_HASH = "VCIlmPM9NkgFQtrs4Oa5TeFcDu6MWRTKSNdePEhOgD8="; +const BASE64_BUT_NOT_SHA256 = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; +const STARTS_WITH_NUMBER = "1ABC23defG/hiJKlmNoP+QRStuVwxYZ9a+bcD/+/EFg="; +const STARTS_WITH_SYMBOL = "+ABC23defG/hiJKlmNoP+QRStuVwxYZ9a+bcD/+/EFg="; +const MULTIPLE_KEYS = PINNING_ROOT_KEY_HASH + STARTS_WITH_NUMBER + + STARTS_WITH_SYMBOL; + function run_test() { let profileDir = do_get_profile(); let stateFile = profileDir.clone(); @@ -39,14 +98,47 @@ function run_test() { let outputStream = FileUtils.openFileOutputStream(stateFile); let expiryTime = Date.now() + 100000; let lines = [ + // General state file entry tests. `example1.example.com:HSTS\t0\t0\t${expiryTime},1,0`, "I'm a lumberjack and I'm okay; I work all night and I sleep all day!", "This is a totally bogus entry\t", "0\t0\t0\t0\t", "\t\t\t\t\t\t\t", "example.com:HSTS\t\t\t\t\t\t\t", + "example.com:HPKP\t\t\t\t\t\t\t", "example3.example.com:HSTS\t0\t\t\t\t\t\t", + "example3.example.com:HPKP\t0\t\t\t\t\t\t", `example2.example.com:HSTS\t0\t0\t${expiryTime},1,0`, + // HSTS and HPKP state string parsing tests + `extra.comma.example.com:HSTS\t0\t0\t${expiryTime},,1,0`, + `extra.comma.example.com:HPKP\t0\t0\t${expiryTime},,1,0,${PINNING_ROOT_KEY_HASH}`, + "empty.statestring.example.com:HSTS\t0\t0\t", + "empty.statestring.example.com:HPKP\t0\t0\t", + "rubbish.statestring.example.com:HSTS\t0\t0\tfoobar", + "rubbish.statestring.example.com:HPKP\t0\t0\tfoobar", + `spaces.statestring.example.com:HSTS\t0\t0\t${expiryTime}, 1,0 `, + `spaces.statestring.example.com:HPKP\t0\t0\t${expiryTime}, 1,0, ${PINNING_ROOT_KEY_HASH}`, + `invalid.expirytime.example.com:HSTS\t0\t0\t${expiryTime}foo123,1,0`, + `invalid.expirytime.example.com:HPKP\t0\t0\t${expiryTime}foo123,1,0,${PINNING_ROOT_KEY_HASH}`, + `text.securitypropertystate.example.com:HSTS\t0\t0\t${expiryTime},1foo,0`, + `text.securitypropertystate.example.com:HPKP\t0\t0\t${expiryTime},1foo,0,${PINNING_ROOT_KEY_HASH}`, + `invalid.securitypropertystate.example.com:HSTS\t0\t0\t${expiryTime},999,0`, + `invalid.securitypropertystate.example.com:HPKP\t0\t0\t${expiryTime},999,0,${PINNING_ROOT_KEY_HASH}`, + `text.includesubdomains.example.com:HSTS\t0\t0\t${expiryTime},1,1foo`, + `text.includesubdomains.example.com:HPKP\t0\t0\t${expiryTime},1,1foo,${PINNING_ROOT_KEY_HASH}`, + `invalid.includesubdomains.example.com:HSTS\t0\t0\t${expiryTime},1,0foo`, + `invalid.includesubdomains.example.com:HPKP\t0\t0\t${expiryTime},1,0foo,${PINNING_ROOT_KEY_HASH}`, + // HPKP specific state string parsing tests + `empty.keys.example.com:HPKP\t0\t0\t${expiryTime},1,0,`, + `rubbish.after.keys.example.com:HPKP\t0\t0\t${expiryTime},1,0,${PINNING_ROOT_KEY_HASH}foo`, + `keys.with.securitypropertyunset.example.com:HPKP\t0\t0\t${expiryTime},0,0,${PINNING_ROOT_KEY_HASH}`, + `keys.with.securitypropertyset.example.com:HPKP\t0\t0\t${expiryTime},1,0,${PINNING_ROOT_KEY_HASH}`, + `keys.with.securitypropertyknockout.example.com:HPKP\t0\t0\t${expiryTime},2,0,${PINNING_ROOT_KEY_HASH}`, + `securitypropertynegative.example.com:HPKP\t0\t0\t${expiryTime},3,0,${PINNING_ROOT_KEY_HASH}`, + `not.sha256.key.example.com:HPKP\t0\t0\t${expiryTime},1,0,${BASE64_BUT_NOT_SHA256}`, + `starts.with.number.key.example.com:HPKP\t0\t0\t${expiryTime},1,0,${STARTS_WITH_NUMBER}`, + `starts.with.symbol.key.example.com:HPKP\t0\t0\t${expiryTime},1,0,${STARTS_WITH_SYMBOL}`, + `multiple.keys.example.com:HPKP\t0\t0\t${expiryTime},1,0,${MULTIPLE_KEYS}`, ]; writeLinesAndClose(lines, outputStream); Services.obs.addObserver(checkStateRead, "data-storage-ready"); @@ -54,4 +146,9 @@ function run_test() { gSSService = Cc["@mozilla.org/ssservice;1"] .getService(Ci.nsISiteSecurityService); notEqual(gSSService, null); + + Services.prefs.setIntPref("security.cert_pinning.enforcement_level", 2); + do_register_cleanup(() => { + Services.prefs.clearUserPref("security.cert_pinning.enforcement_level"); + }); } From 087e7fbd30b333fd03a83395d6939cf5a234122d Mon Sep 17 00:00:00 2001 From: Julian_Chu Date: Sat, 20 May 2017 01:10:04 +0800 Subject: [PATCH 55/56] Bug 1357780 - CustomTabs get rid of dark theme r=sebastian Now we only use Light theme, and its look and feel more close to Full-Browser. Hopefully when we re-use gecko widgets will have less visual issue. In ActionBar, the tint color follows text color. And the text color is decided by Top toolbar background. MozReview-Commit-ID: JrFAdLmk3Fk --HG-- extra : rebase_source : 638fe6b3e5c7bbd37a58b21df9de266743c8d597 --- .../gecko/customtabs/ActionBarPresenter.java | 16 +++++----------- .../gecko/customtabs/CustomTabsActivity.java | 18 +++++------------- .../android/base/resources/values/themes.xml | 8 +------- 3 files changed, 11 insertions(+), 31 deletions(-) diff --git a/mobile/android/base/java/org/mozilla/gecko/customtabs/ActionBarPresenter.java b/mobile/android/base/java/org/mozilla/gecko/customtabs/ActionBarPresenter.java index 2d4bdfa78f50..741497e651ca 100644 --- a/mobile/android/base/java/org/mozilla/gecko/customtabs/ActionBarPresenter.java +++ b/mobile/android/base/java/org/mozilla/gecko/customtabs/ActionBarPresenter.java @@ -7,6 +7,7 @@ package org.mozilla.gecko.customtabs; import android.content.res.Resources; import android.content.res.TypedArray; +import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.os.Build; @@ -58,7 +59,8 @@ public class ActionBarPresenter { @ColorInt private int mTextPrimaryColor = DEFAULT_TEXT_PRIMARY_COLOR; - ActionBarPresenter(@NonNull final ActionBar actionBar) { + ActionBarPresenter(@NonNull final ActionBar actionBar, @ColorInt final int textColor) { + mTextPrimaryColor = textColor; mActionBar = actionBar; mActionBar.setDisplayShowCustomEnabled(true); mActionBar.setDisplayShowTitleEnabled(false); @@ -69,7 +71,8 @@ public class ActionBarPresenter { mTitleView = (TextView) customView.findViewById(R.id.custom_tabs_action_bar_title); mUrlView = (TextView) customView.findViewById(R.id.custom_tabs_action_bar_url); - onThemeChanged(mActionBar.getThemedContext().getTheme()); + mTitleView.setTextColor(mTextPrimaryColor); + mUrlView.setTextColor(mTextPrimaryColor); mIdentityPopup = new SiteIdentityPopup(mActionBar.getThemedContext()); mIdentityPopup.setAnchor(customView); @@ -229,13 +232,4 @@ public class ActionBarPresenter { mUrlView.setVisibility(View.VISIBLE); } } - - private void onThemeChanged(@NonNull final Resources.Theme currentTheme) { - // Theme might be light or dark. To get text color for custom-view. - final TypedArray themeArray = currentTheme.obtainStyledAttributes( - new int[]{android.R.attr.textColorPrimary}); - - mTextPrimaryColor = themeArray.getColor(0, DEFAULT_TEXT_PRIMARY_COLOR); - themeArray.recycle(); - } } diff --git a/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java b/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java index bac5ecaf7548..d4606936469b 100644 --- a/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java +++ b/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java @@ -10,14 +10,13 @@ import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.graphics.Bitmap; -import android.graphics.Color; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; import android.provider.Browser; +import android.support.annotation.ColorInt; import android.support.annotation.NonNull; -import android.support.annotation.StyleRes; import android.support.design.widget.Snackbar; import android.support.v4.util.SparseArrayCompat; import android.support.v7.app.ActionBar; @@ -39,7 +38,6 @@ import org.mozilla.gecko.Tab; import org.mozilla.gecko.Tabs; import org.mozilla.gecko.Telemetry; import org.mozilla.gecko.TelemetryContract; -import org.mozilla.gecko.gfx.DynamicToolbarAnimator; import org.mozilla.gecko.gfx.DynamicToolbarAnimator.PinReason; import org.mozilla.gecko.menu.GeckoMenu; import org.mozilla.gecko.menu.GeckoMenuInflater; @@ -75,8 +73,6 @@ public class CustomTabsActivity extends SingleTabActivity implements Tabs.OnTabs final SafeIntent intent = new SafeIntent(getIntent()); - setThemeFromToolbarColor(); - doorhangerOverlay = findViewById(R.id.custom_tabs_doorhanger_overlay); mProgressView = (ProgressBar) findViewById(R.id.page_progress); @@ -85,7 +81,7 @@ public class CustomTabsActivity extends SingleTabActivity implements Tabs.OnTabs final ActionBar actionBar = getSupportActionBar(); bindNavigationCallback(toolbar); - actionBarPresenter = new ActionBarPresenter(actionBar); + actionBarPresenter = new ActionBarPresenter(actionBar, getActionBarTextColor()); actionBarPresenter.displayUrlOnly(intent.getDataString()); actionBarPresenter.setBackgroundColor(IntentUtil.getToolbarColor(intent), getWindow()); actionBarPresenter.setTextLongClickListener(new UrlCopyListener()); @@ -142,13 +138,9 @@ public class CustomTabsActivity extends SingleTabActivity implements Tabs.OnTabs EventDispatcher.getInstance().dispatch("Telemetry:CustomTabsPing", data); } - private void setThemeFromToolbarColor() { - final int color = ColorUtil.getReadableTextColor(IntentUtil.getToolbarColor(new SafeIntent(getIntent()))); - @StyleRes final int styleRes = (color == Color.BLACK) - ? R.style.GeckoCustomTabs_Light - : R.style.GeckoCustomTabs; - - setTheme(styleRes); + @ColorInt + private int getActionBarTextColor() { + return ColorUtil.getReadableTextColor(IntentUtil.getToolbarColor(new SafeIntent(getIntent()))); } // Bug 1329145: 3rd party app could specify customized exit-animation to this activity. diff --git a/mobile/android/base/resources/values/themes.xml b/mobile/android/base/resources/values/themes.xml index 2b966c9455d0..ddad9d3c30db 100644 --- a/mobile/android/base/resources/values/themes.xml +++ b/mobile/android/base/resources/values/themes.xml @@ -125,13 +125,7 @@ And ensure changes to CustomTabsActivity won't effect GeckoApp. --> - - -