Merge inbound to mozilla-central. a=merge

This commit is contained in:
Ciure Andrei 2018-06-15 12:49:01 +03:00
Родитель d61184c99d 9f536421d6
Коммит 6eea08365e
41 изменённых файлов: 447 добавлений и 111 удалений

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

@ -104,7 +104,6 @@ toolbarseparator + #sidebar-extensions-separator {
list-style-image: none;
background: url(chrome://browser/skin/check.svg) no-repeat transparent;
background-size: 11px 11px;
color: var(--arrowpanel-color);
}
%ifdef XP_MACOSX

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

@ -111,7 +111,6 @@ NS_INTERFACE_MAP_BEGIN(nsDocShellTreeOwner)
NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener)
NS_INTERFACE_MAP_ENTRY(nsIDOMEventListener)
NS_INTERFACE_MAP_ENTRY(nsICDocShellTreeOwner)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_INTERFACE_MAP_END

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

@ -39,28 +39,11 @@ class EventTarget;
class nsWebBrowser;
class ChromeTooltipListener;
// {6D10C180-6888-11d4-952B-0020183BF181}
#define NS_ICDOCSHELLTREEOWNER_IID \
{ 0x6d10c180, 0x6888, 0x11d4, { 0x95, 0x2b, 0x0, 0x20, 0x18, 0x3b, 0xf1, 0x81 } }
// This is a fake 'hidden' interface that nsDocShellTreeOwner implements.
// Classes can QI for this interface to be sure that
// they're dealing with a valid nsDocShellTreeOwner and not some other object
// that implements nsIDocShellTreeOwner.
class nsICDocShellTreeOwner : public nsISupports
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICDOCSHELLTREEOWNER_IID)
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsICDocShellTreeOwner, NS_ICDOCSHELLTREEOWNER_IID)
class nsDocShellTreeOwner final : public nsIDocShellTreeOwner,
public nsIBaseWindow,
public nsIInterfaceRequestor,
public nsIWebProgressListener,
public nsIDOMEventListener,
public nsICDocShellTreeOwner,
public nsSupportsWeakReference
{
friend class nsWebBrowser;

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

@ -4594,13 +4594,29 @@ nsINode::OwnerDocAsNode() const
return OwnerDoc();
}
// ShouldUseXBLScope is defined here as a template so that we can get the faster
// version of IsInAnonymousSubtree if we're statically known to be an
// nsIContent. we could try defining ShouldUseXBLScope separately on nsINode
// and nsIContent, but then we couldn't put its nsINode implementation here
// (because this header does not include nsIContent) and we can't put it in
// nsIContent.h, because the definition of nsIContent::IsInAnonymousSubtree is
// in nsIContentInlines.h. And then we get include hell from people trying to
// call nsINode::GetParentObject but not including nsIContentInlines.h and with
// no really good way to include it.
template<typename T>
inline bool ShouldUseXBLScope(const T* aNode)
{
return aNode->IsInAnonymousSubtree() &&
!aNode->IsAnonymousContentInSVGUseSubtree();
}
inline mozilla::dom::ParentObject
nsINode::GetParentObject() const
{
mozilla::dom::ParentObject p(OwnerDoc());
// Note that mUseXBLScope is a no-op for chrome, and other places where we
// don't use XBL scopes.
p.mUseXBLScope = IsInAnonymousSubtree() && !IsAnonymousContentInSVGUseSubtree();
p.mUseXBLScope = ShouldUseXBLScope(this);
return p;
}

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

@ -33,6 +33,7 @@
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/PromiseNativeHandler.h"
#include "mozilla/dom/ShadowRoot.h"
#include "mozilla/dom/ScriptSettings.h"
#include "nsAttrValueOrString.h"
#include "nsBindingManager.h"
#include "nsCCUncollectableMarker.h"
@ -1299,6 +1300,49 @@ CheckForOutdatedParent(nsINode* aParent, nsINode* aNode, ErrorResult& aError)
}
}
static nsresult
ReparentWrappersInSubtree(nsIContent* aRoot)
{
MOZ_ASSERT(ShouldUseXBLScope(aRoot));
// Start off with no global so we don't fire any error events on failure.
AutoJSAPI jsapi;
jsapi.Init();
JSContext* cx = jsapi.cx();
nsIGlobalObject* docGlobal = aRoot->OwnerDoc()->GetScopeObject();
if (NS_WARN_IF(!docGlobal)) {
return NS_ERROR_UNEXPECTED;
}
JS::Rooted<JSObject*> rootedGlobal(cx, docGlobal->GetGlobalJSObject());
if (NS_WARN_IF(!rootedGlobal)) {
return NS_ERROR_UNEXPECTED;
}
rootedGlobal = xpc::GetXBLScope(cx, rootedGlobal);
ErrorResult rv;
JS::Rooted<JSObject*> reflector(cx);
for (nsIContent* cur = aRoot; cur; cur = cur->GetNextNode(aRoot)) {
if ((reflector = cur->GetWrapper())) {
JSAutoRealm ar(cx, reflector);
ReparentWrapper(cx, reflector, rv);
rv.WouldReportJSException();
if (rv.Failed()) {
// We _could_ consider BlastSubtreeToPieces here, but it's not really
// needed. Having some nodes in here accessible to content while others
// are not is probably OK. We just need to fail out of the actual
// insertion, so they're not in the DOM. Returning a failure here will
// do that.
return rv.StealNSResult();
}
}
}
return NS_OK;
}
nsresult
nsINode::doInsertChildAt(nsIContent* aKid, uint32_t aIndex,
bool aNotify, nsAttrAndChildArray& aChildArray)
@ -1350,9 +1394,15 @@ nsINode::doInsertChildAt(nsIContent* aKid, uint32_t aIndex,
nsIContent* parent = IsContent() ? AsContent() : nullptr;
bool wasInXBLScope = ShouldUseXBLScope(aKid);
rv = aKid->BindToTree(doc, parent,
parent ? parent->GetBindingParent() : nullptr,
true);
if (NS_SUCCEEDED(rv) && !wasInXBLScope && ShouldUseXBLScope(aKid)) {
MOZ_ASSERT(ShouldUseXBLScope(this),
"Why does the kid need to use an XBL scope?");
rv = ReparentWrappersInSubtree(aKid);
}
if (NS_FAILED(rv)) {
if (GetFirstChild() == aKid) {
mFirstChild = aKid->GetNextSibling();

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

@ -566,7 +566,7 @@ private:
// reference, not by value.
TErrorResult(const TErrorResult&) = delete;
void operator=(const TErrorResult&) = delete;
};
} JS_HAZ_ROOTED;
struct JustAssertCleanupPolicy {
static const bool assertHandled = true;
@ -838,7 +838,7 @@ private:
// to SuppressException (one from us, one from the ErrorResult destructor
// after asserting).
binding_danger::TErrorResult<binding_danger::JustSuppressCleanupPolicy> mInner;
};
} JS_HAZ_ROOTED;
/******************************************************************************
** Macros for checking results

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

@ -275,6 +275,14 @@ function test()
isnot(typeof Object.getOwnPropertyDescriptor(win.Node.prototype, "ELEMENT_NODE"), "undefined",
"Should see constant property on prototype objects");
// Adopting nodes should not lose expandos.
var elem = doc.createElement("span");
elem.expando = 5;
is(elem.expando, 5, "We just set this property");
document.adoptNode(elem);
is(elem.wrappedJSObject, undefined, "Shouldn't be an Xray anymore");
is(elem.expando, 5, "Expando should not get lost");
SimpleTest.finish();
}

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

@ -234,6 +234,8 @@ EventStateManager::EventStateManager()
, mCurrentTarget(nullptr)
// init d&d gesture state machine variables
, mGestureDownPoint(0,0)
, mGestureModifiers(0)
, mGestureDownButtons(0)
, mPresContext(nullptr)
, mLClickCount(0)
, mMClickCount(0)

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

@ -198,6 +198,7 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(IMEContentObserver)
IMEContentObserver::IMEContentObserver()
: mESM(nullptr)
, mIMENotificationRequests(nullptr)
, mPreAttrChangeLength(0)
, mSuppressNotifications(0)
, mPreCharacterDataChangeLength(-1)
, mSendingNotification(NOTIFY_IME_OF_NOTHING)

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

@ -577,6 +577,7 @@ private:
CompositionEventDispatcher()
: Runnable("TextComposition::CompositionEventDispatcher")
, mEventMessage(eVoidEvent)
, mIsSynthesizedEvent(false){};
};

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

@ -280,6 +280,10 @@ public:
*/
explicit WheelDeltaHorizontalizer(WidgetWheelEvent& aWheelEvent)
: mWheelEvent(aWheelEvent)
, mOldDeltaX(0.0)
, mOldDeltaZ(0.0)
, mOldOverflowDeltaX(0.0)
, mOldLineOrPageDeltaX(0)
, mHorizontalized(false)
{
}

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

@ -16,6 +16,7 @@ XULCommandEvent::XULCommandEvent(EventTarget* aOwner,
: UIEvent(aOwner, aPresContext,
aEvent ? aEvent :
new WidgetInputEvent(false, eVoidEvent, nullptr))
, mInputSource(0)
{
if (aEvent) {
mEventIsInternal = false;

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

@ -188,6 +188,7 @@ class FileSystemTaskParentBase : public Runnable
public:
FileSystemTaskParentBase()
: Runnable("FileSystemTaskParentBase")
, mErrorValue(NS_ERROR_NOT_INITIALIZED)
{}
/*

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

@ -40,6 +40,7 @@ RenderThread::RenderThread(base::Thread* aThread)
RenderThread::~RenderThread()
{
MOZ_ASSERT(mRenderTexturesDeferred.empty());
delete mThread;
}
@ -507,9 +508,10 @@ RenderThread::UnregisterExternalImage(uint64_t aExternalImageId)
// it. So, no one will access the invalid buffer in RenderTextureHost.
RefPtr<RenderTextureHost> texture;
mRenderTextures.Remove(aExternalImageId, getter_AddRefs(texture));
Loop()->PostTask(NewRunnableMethod<RefPtr<RenderTextureHost>>(
mRenderTexturesDeferred.emplace_back(std::move(texture));
Loop()->PostTask(NewRunnableMethod(
"RenderThread::DeferredRenderTextureHostDestroy",
this, &RenderThread::DeferredRenderTextureHostDestroy, std::move(texture)
this, &RenderThread::DeferredRenderTextureHostDestroy
));
} else {
mRenderTextures.Remove(aExternalImageId);
@ -527,9 +529,10 @@ RenderThread::UnregisterExternalImageDuringShutdown(uint64_t aExternalImageId)
}
void
RenderThread::DeferredRenderTextureHostDestroy(RefPtr<RenderTextureHost>)
RenderThread::DeferredRenderTextureHostDestroy()
{
// Do nothing. Just decrease the ref-count of RenderTextureHost.
MutexAutoLock lock(mRenderTextureMapLock);
mRenderTexturesDeferred.clear();
}
RenderTextureHost*
@ -562,8 +565,12 @@ RenderThread::HandleDeviceReset(const char* aWhere)
gfx::GPUParent::GetSingleton()->NotifyDeviceReset();
}
for (auto iter = mRenderTextures.Iter(); !iter.Done(); iter.Next()) {
iter.UserData()->ClearCachedResources();
{
MutexAutoLock lock(mRenderTextureMapLock);
mRenderTexturesDeferred.clear();
for (auto iter = mRenderTextures.Iter(); !iter.Done(); iter.Next()) {
iter.UserData()->ClearCachedResources();
}
}
mHandlingDeviceReset = true;

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

@ -20,6 +20,8 @@
#include "mozilla/webrender/WebRenderTypes.h"
#include "mozilla/layers/SynchronousTask.h"
#include <list>
namespace mozilla {
namespace wr {
@ -175,7 +177,7 @@ public:
private:
explicit RenderThread(base::Thread* aThread);
void DeferredRenderTextureHostDestroy(RefPtr<RenderTextureHost> aTexture);
void DeferredRenderTextureHostDestroy();
void ShutDownTask(layers::SynchronousTask* aTask);
void ProgramCacheTask();
@ -199,6 +201,10 @@ private:
Mutex mRenderTextureMapLock;
nsRefPtrHashtable<nsUint64HashKey, RenderTextureHost> mRenderTextures;
// Used to remove all RenderTextureHost that are going to be removed by
// a deferred callback and remove them right away without waiting for the callback.
// On device reset we have to remove all GL related resources right away.
std::list<RefPtr<RenderTextureHost>> mRenderTexturesDeferred;
bool mHasShutdown;
bool mHandlingDeviceReset;

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

@ -1490,14 +1490,21 @@ ModuleBuilder::processExportObjectBinding(frontend::ParseNode* pn)
for (ParseNode* node = pn->pn_head; node; node = node->pn_next) {
MOZ_ASSERT(node->isKind(ParseNodeKind::MutateProto) ||
node->isKind(ParseNodeKind::Colon) ||
node->isKind(ParseNodeKind::Shorthand));
node->isKind(ParseNodeKind::Shorthand) ||
node->isKind(ParseNodeKind::Spread));
ParseNode* target = node->isKind(ParseNodeKind::MutateProto)
? node->pn_kid
: node->pn_right;
ParseNode* target;
if (node->isKind(ParseNodeKind::Spread)) {
target = node->pn_kid;
} else {
if (node->isKind(ParseNodeKind::MutateProto))
target = node->pn_kid;
else
target = node->pn_right;
if (target->isKind(ParseNodeKind::Assign))
target = target->pn_left;
if (target->isKind(ParseNodeKind::Assign))
target = target->pn_left;
}
if (!processExportBinding(target))
return false;

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

@ -322,19 +322,10 @@ function extraRootedGCThings()
function extraRootedPointers()
{
return [
'ModuleValidator',
'JSErrorResult',
'WrappableJSErrorResult',
// These are not actually rooted, but are only used in the context of
// AutoKeepAtoms.
'js::frontend::TokenStream',
'js::frontend::TokenStreamAnyChars',
'mozilla::ErrorResult',
'mozilla::IgnoredErrorResult',
'mozilla::IgnoreErrors',
'mozilla::dom::binding_detail::FastErrorResult',
];
}

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

@ -5439,14 +5439,21 @@ Parser<FullParseHandler, CharT>::checkExportedNamesForObjectBinding(ParseNode* p
for (ParseNode* node = pn->pn_head; node; node = node->pn_next) {
MOZ_ASSERT(node->isKind(ParseNodeKind::MutateProto) ||
node->isKind(ParseNodeKind::Colon) ||
node->isKind(ParseNodeKind::Shorthand));
node->isKind(ParseNodeKind::Shorthand) ||
node->isKind(ParseNodeKind::Spread));
ParseNode* target = node->isKind(ParseNodeKind::MutateProto)
? node->pn_kid
: node->pn_right;
ParseNode* target;
if (node->isKind(ParseNodeKind::Spread)) {
target = node->pn_kid;
} else {
if (node->isKind(ParseNodeKind::MutateProto))
target = node->pn_kid;
else
target = node->pn_right;
if (target->isKind(ParseNodeKind::Assign))
target = target->pn_left;
if (target->isKind(ParseNodeKind::Assign))
target = target->pn_left;
}
if (!checkExportedNamesForDeclaration(target))
return false;

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

@ -0,0 +1,11 @@
function lfEvalInCache(lfCode, lfIncremental = false, lfRunOnce = false) {
let ctx = {};
let code = cacheEntry(lfCode);
ctx_save = Object.create(ctx, { saveIncrementalBytecode: { value: true } });
try { evaluate(code, ctx_save); } catch(exc) {}
try { evaluate(code, Object.create(ctx_save, { loadBytecode: { value: true } })); } catch(exc) {}
}
lfEvalInCache(`
function q() {}
Object.freeze(this);
`, false, true);

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

@ -0,0 +1,10 @@
load(libdir + "dummyModuleResolveHook.js");
let a = moduleRepo['a'] = parseModule(`
export var { ... get } = { x: "foo" };
`);
let m = parseModule("import { get } from 'a'; export { get };");
m.declarationInstantiation();
m.evaluation()
assertEq(getModuleEnvironmentValue(m, "get").x, "foo");

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

@ -208,6 +208,9 @@ NewEmptyScopeData(JSContext* cx, uint32_t length = 0)
return UniquePtr<typename ConcreteScope::Data>(data);
}
static constexpr size_t HasAtomMask = 1;
static constexpr size_t HasAtomShift = 1;
static XDRResult
XDRBindingName(XDRState<XDR_ENCODE>* xdr, BindingName* bindingName)
{
@ -216,7 +219,9 @@ XDRBindingName(XDRState<XDR_ENCODE>* xdr, BindingName* bindingName)
RootedAtom atom(cx, bindingName->name());
bool hasAtom = !!atom;
uint8_t u8 = uint8_t(hasAtom << 1) | uint8_t(bindingName->closedOver());
uint8_t flags = bindingName->flagsForXDR();
MOZ_ASSERT(((flags << HasAtomShift) >> HasAtomShift) == flags);
uint8_t u8 = (flags << HasAtomShift) | uint8_t(hasAtom);
MOZ_TRY(xdr->codeUint8(&u8));
if (hasAtom)
@ -233,14 +238,13 @@ XDRBindingName(XDRState<XDR_DECODE>* xdr, BindingName* bindingName)
uint8_t u8;
MOZ_TRY(xdr->codeUint8(&u8));
bool closedOver = u8 & 1;
bool hasAtom = u8 >> 1;
bool hasAtom = u8 & HasAtomMask;
RootedAtom atom(cx);
if (hasAtom)
MOZ_TRY(XDRAtom(xdr, &atom));
*bindingName = BindingName(atom, closedOver);
uint8_t flags = u8 >> HasAtomShift;
*bindingName = BindingName::fromXDR(atom, flags);
return Ok();
}

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

@ -130,6 +130,25 @@ class BindingName
(isTopLevelFunction? TopLevelFunctionFlag : 0x0))
{ }
private:
// For fromXDR.
BindingName(JSAtom* name, uint8_t flags)
: bits_(uintptr_t(name) | flags)
{
static_assert(FlagMask < alignof(JSAtom),
"Flags should fit into unused bits of JSAtom pointer");
MOZ_ASSERT((flags & FlagMask) == flags);
}
public:
static BindingName fromXDR(JSAtom* name, uint8_t flags) {
return BindingName(name, flags);
}
uint8_t flagsForXDR() const {
return static_cast<uint8_t>(bits_ & FlagMask);
}
JSAtom* name() const {
return reinterpret_cast<JSAtom*>(bits_ & ~FlagMask);
}

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

@ -1384,7 +1384,7 @@ static const unsigned VALIDATION_LIFO_DEFAULT_CHUNK_SIZE = 4 * 1024;
//
// ModuleValidator is marked as rooted in the rooting analysis. Don't add
// non-JSAtom pointers, or this will break!
class MOZ_STACK_CLASS ModuleValidator
class MOZ_STACK_CLASS JS_HAZ_ROOTED ModuleValidator
{
public:
class Func

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

@ -47,11 +47,19 @@ using mozilla::MakeEnumeratedRange;
# endif
#endif
// Another sanity check.
// More sanity checks.
static_assert(MaxMemoryInitialPages <= ArrayBufferObject::MaxBufferByteLength / PageSize,
"Memory sizing constraint");
// All plausible targets must be able to do at least IEEE754 double
// loads/stores, hence the lower limit of 8. Some Intel processors support
// AVX-512 loads/stores, hence the upper limit of 64.
static_assert(MaxMemoryAccessSize >= 8, "MaxMemoryAccessSize too low");
static_assert(MaxMemoryAccessSize <= 64, "MaxMemoryAccessSize too high");
static_assert((MaxMemoryAccessSize & (MaxMemoryAccessSize-1)) == 0,
"MaxMemoryAccessSize is not a power of two");
void
Val::writePayload(uint8_t* dst) const
{

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

@ -653,6 +653,7 @@ class Val
ValType type() const { return type_; }
bool isSimd() const { return IsSimdType(type()); }
static constexpr size_t sizeofLargestValue() { return sizeof(u); }
uint32_t i32() const { MOZ_ASSERT(type_ == ValType::I32); return u.i32_; }
uint64_t i64() const { MOZ_ASSERT(type_ == ValType::I64); return u.i64_; }
@ -1993,7 +1994,7 @@ static const unsigned PageSize = 64 * 1024;
// catch the overflow. MaxMemoryAccessSize is a conservative approximation of
// the maximum guard space needed to catch all unaligned overflows.
static const unsigned MaxMemoryAccessSize = sizeof(Val);
static const unsigned MaxMemoryAccessSize = Val::sizeofLargestValue();
#ifdef WASM_HUGE_MEMORY

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

@ -1267,23 +1267,51 @@ XrayTraits::cloneExpandoChain(JSContext* cx, HandleObject dst, HandleObject srcC
RootedObject oldHead(cx, srcChain);
while (oldHead) {
// If movingIntoXrayCompartment is true, then our new reflector is in a
// compartment that used to have an Xray-with-expandos to the old reflector
// and we should copy the expandos to the new reflector directly.
bool movingIntoXrayCompartment;
// exclusiveWrapper is only used if movingIntoXrayCompartment ends up true.
RootedObject exclusiveWrapper(cx);
RootedObject wrapperHolder(cx, JS_GetReservedSlot(oldHead,
JSSLOT_EXPANDO_EXCLUSIVE_WRAPPER_HOLDER)
.toObjectOrNull());
if (wrapperHolder) {
// The global containing this wrapper holder has an xray for |src|
// with expandos. Create an xray in the global for |dst| which
// will be associated with a clone of |src|'s expando object.
JSAutoRealm ar(cx, UncheckedUnwrap(wrapperHolder));
exclusiveWrapper = dst;
if (!JS_WrapObject(cx, &exclusiveWrapper))
RootedObject unwrappedHolder(cx, UncheckedUnwrap(wrapperHolder));
// unwrappedHolder is the compartment of the relevant Xray, so check
// whether that matches the compartment of cx (which matches the
// compartment of dst).
movingIntoXrayCompartment =
js::IsObjectInContextCompartment(unwrappedHolder, cx);
if (!movingIntoXrayCompartment) {
// The global containing this wrapper holder has an xray for |src|
// with expandos. Create an xray in the global for |dst| which
// will be associated with a clone of |src|'s expando object.
JSAutoRealm ar(cx, unwrappedHolder);
exclusiveWrapper = dst;
if (!JS_WrapObject(cx, &exclusiveWrapper))
return false;
}
} else {
JSAutoRealm ar(cx, oldHead);
movingIntoXrayCompartment =
expandoObjectMatchesConsumer(cx, oldHead, ObjectPrincipal(dst));
}
if (movingIntoXrayCompartment) {
// Just copy properties directly onto dst.
if (!JS_CopyPropertiesFrom(cx, dst, oldHead))
return false;
} else {
// Create a new expando object in the compartment of dst to replace
// oldHead.
RootedObject newHead(cx, attachExpandoObject(cx, dst, exclusiveWrapper,
GetExpandoObjectPrincipal(oldHead)));
if (!JS_CopyPropertiesFrom(cx, newHead, oldHead))
return false;
}
RootedObject newHead(cx, attachExpandoObject(cx, dst, exclusiveWrapper,
GetExpandoObjectPrincipal(oldHead)));
if (!JS_CopyPropertiesFrom(cx, newHead, oldHead))
return false;
oldHead = JS_GetReservedSlot(oldHead, JSSLOT_EXPANDO_NEXT).toObjectOrNull();
}
return true;

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

@ -845,7 +845,7 @@ nsMediaFeatures::features[] = {
&nsGkAtoms::_moz_is_resource_document,
nsMediaFeature::eMinMaxNotAllowed,
nsMediaFeature::eBoolInteger,
nsMediaFeature::eNoRequirements,
nsMediaFeature::eUserAgentAndChromeOnly,
{ nullptr },
GetIsResourceDocument
},

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

@ -792,6 +792,9 @@ function run() {
should_not_apply("not all and (-moz-is-glyph:0)");
should_not_apply("only all and (-moz-is-glyph:1)");
// Resource documents (UA-only).
query_should_not_be_parseable("(-moz-is-resource-document)");
// Parsing tests
// bug 454227
should_apply_unbalanced("(orientation");

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

@ -79,6 +79,7 @@
#include "nsNetUtil.h"
#include "nsIURLParser.h"
#include "NullPrincipal.h"
#include "js/GCAnnotations.h"
#include "mozilla/PeerIdentity.h"
#include "mozilla/dom/RTCCertificate.h"
#include "mozilla/dom/RTCConfigurationBinding.h"
@ -155,7 +156,7 @@ public:
{
SuppressException();
}
};
} JS_HAZ_ROOTED;
// The WrapRunnable() macros copy passed-in args and passes them to the function
// later on the other thread. ErrorResult cannot be passed like this because it
@ -184,7 +185,7 @@ public:
private:
mozilla::UniquePtr<JSErrorResult> mRv;
bool isCopy;
};
} JS_HAZ_ROOTED;
}

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

@ -1645,9 +1645,13 @@ pages_copy(void* dest, const void* src, size_t n)
MOZ_ASSERT(n >= VM_COPY_MIN);
MOZ_ASSERT((void*)((uintptr_t)src & ~gPageSizeMask) == src);
vm_copy(
kern_return_t r = vm_copy(
mach_task_self(), (vm_address_t)src, (vm_size_t)n, (vm_address_t)dest);
if (r != KERN_SUCCESS) {
MOZ_CRASH("vm_copy() failed");
}
}
#endif
template<size_t Bits>

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

@ -10,3 +10,4 @@
*/
#error "Do not include this header file."

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

@ -118,8 +118,7 @@ impl Device {
/// Set the font size of the root element (for rem)
pub fn set_root_font_size(&self, size: Au) {
self.root_font_size
.store(size.0 as isize, Ordering::Relaxed)
self.root_font_size.store(size.0 as isize, Ordering::Relaxed)
}
/// Sets the body text color for the "inherit color from body" quirk.

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

@ -1134,15 +1134,19 @@ pub extern "C" fn Servo_Element_IsPrimaryStyleReusedViaRuleNode(element: RawGeck
data.flags.contains(data::ElementDataFlags::PRIMARY_STYLE_REUSED_VIA_RULE_NODE)
}
#[no_mangle]
pub extern "C" fn Servo_StyleSheet_Empty(mode: SheetParsingMode) -> RawServoStyleSheetContentsStrong {
let global_style_data = &*GLOBAL_STYLE_DATA;
let origin = match mode {
fn mode_to_origin(mode: SheetParsingMode) -> Origin {
match mode {
SheetParsingMode::eAuthorSheetFeatures => Origin::Author,
SheetParsingMode::eUserSheetFeatures => Origin::User,
SheetParsingMode::eAgentSheetFeatures => Origin::UserAgent,
SheetParsingMode::eSafeAgentSheetFeatures => Origin::UserAgent,
};
}
}
#[no_mangle]
pub extern "C" fn Servo_StyleSheet_Empty(mode: SheetParsingMode) -> RawServoStyleSheetContentsStrong {
let global_style_data = &*GLOBAL_STYLE_DATA;
let origin = mode_to_origin(mode);
let shared_lock = &global_style_data.shared_lock;
Arc::new(
StylesheetContents::from_str(
@ -1158,15 +1162,6 @@ pub extern "C" fn Servo_StyleSheet_Empty(mode: SheetParsingMode) -> RawServoStyl
).into_strong()
}
fn mode_to_origin(mode: SheetParsingMode) -> Origin {
match mode {
SheetParsingMode::eAuthorSheetFeatures => Origin::Author,
SheetParsingMode::eUserSheetFeatures => Origin::User,
SheetParsingMode::eAgentSheetFeatures => Origin::UserAgent,
SheetParsingMode::eSafeAgentSheetFeatures => Origin::UserAgent,
}
}
/// Note: The load_data corresponds to this sheet, and is passed as the parent
/// load data for child sheet loads. It may be null for certain cases where we
/// know we won't have child loads.

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

@ -44,6 +44,7 @@ android-api-16/debug:
- android-sdk-linux
- linux64-clang
- linux64-rust-android
- linux64-rust-size
- linux64-sccache
android-x86/opt:
@ -97,6 +98,7 @@ android-x86/opt:
- android-sdk-linux
- linux64-clang
- linux64-rust-android
- linux64-rust-size
- linux64-sccache
android-x86-nightly/opt:
@ -156,6 +158,7 @@ android-x86-nightly/opt:
- android-sdk-linux
- linux64-clang
- linux64-rust-android
- linux64-rust-size
- linux64-sccache
android-api-16/opt:
@ -204,6 +207,7 @@ android-api-16/opt:
- android-sdk-linux
- linux64-clang
- linux64-rust-android
- linux64-rust-size
- linux64-sccache
android-api-16-without-google-play-services/opt:
@ -251,6 +255,7 @@ android-api-16-without-google-play-services/opt:
- android-sdk-linux
- linux64-clang
- linux64-rust-android
- linux64-rust-size
- linux64-sccache
android-api-16-nightly/opt:
@ -305,6 +310,7 @@ android-api-16-nightly/opt:
- android-sdk-linux
- linux64-clang
- linux64-rust-android
- linux64-rust-size
- linux64-sccache
android-aarch64/opt:
@ -353,6 +359,7 @@ android-aarch64/opt:
- android-sdk-linux
- linux64-clang
- linux64-rust-android
- linux64-rust-size
- linux64-sccache
android-aarch64-nightly/opt:
@ -407,4 +414,5 @@ android-aarch64-nightly/opt:
- android-sdk-linux
- linux64-clang
- linux64-rust-android
- linux64-rust-size
- linux64-sccache

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

@ -23,6 +23,7 @@ linux64/opt:
- linux64-clang
- linux64-gcc
- linux64-rust
- linux64-rust-size
- linux64-sccache
linux64-plain/opt:
@ -82,6 +83,7 @@ linux64-dmd/opt:
- linux64-clang
- linux64-gcc
- linux64-rust
- linux64-rust-size
- linux64-sccache
linux64/pgo:
@ -110,6 +112,7 @@ linux64/pgo:
- linux64-clang
- linux64-gcc
- linux64-rust
- linux64-rust-size
- linux64-sccache
linux64-fuzzing/debug:
@ -141,6 +144,7 @@ linux64-fuzzing/debug:
- linux64-gcc
- linux64-sccache
- linux64-rust
- linux64-rust-size
linux64/debug:
description: "Linux64 Debug"
@ -169,6 +173,7 @@ linux64/debug:
- linux64-gcc
- linux64-sccache
- linux64-rust
- linux64-rust-size
linux64-plain/debug:
description: "Linux64 Debug Plain"
@ -231,6 +236,7 @@ linux64-devedition-nightly/opt:
- linux64-clang
- linux64-gcc
- linux64-rust
- linux64-rust-size
- linux64-sccache
linux64-base-toolchains/opt:
@ -318,6 +324,7 @@ linux/opt:
- linux64-clang
- linux64-gcc
- linux64-rust
- linux64-rust-size
- linux64-sccache
linux/debug:
@ -347,6 +354,7 @@ linux/debug:
- linux64-clang
- linux64-gcc
- linux64-rust
- linux64-rust-size
- linux64-sccache
linux/pgo:
@ -376,6 +384,7 @@ linux/pgo:
- linux64-clang
- linux64-gcc
- linux64-rust
- linux64-rust-size
- linux64-sccache
linux-rusttests/opt:
@ -480,6 +489,7 @@ linux-devedition-nightly/opt:
- linux64-clang
- linux64-gcc
- linux64-rust
- linux64-rust-size
- linux64-sccache
linux-nightly/opt:
@ -514,6 +524,7 @@ linux-nightly/opt:
- linux64-clang
- linux64-gcc
- linux64-rust
- linux64-rust-size
- linux64-sccache
@ -545,6 +556,7 @@ linux64-asan/opt:
- linux64-clang
- linux64-gcc
- linux64-rust
- linux64-rust-size
- linux64-sccache
@ -576,6 +588,7 @@ linux64-asan-fuzzing/opt:
- linux64-clang
- linux64-gcc
- linux64-rust
- linux64-rust-size
- linux64-sccache
linux64-asan-reporter-nightly/opt:
@ -610,6 +623,7 @@ linux64-asan-reporter-nightly/opt:
- linux64-clang
- linux64-gcc
- linux64-rust
- linux64-rust-size
- linux64-sccache
linux64-asan/debug:
@ -640,6 +654,7 @@ linux64-asan/debug:
- linux64-clang
- linux64-gcc
- linux64-rust
- linux64-rust-size
- linux64-sccache
linux64-lto/opt:
@ -671,6 +686,7 @@ linux64-lto/opt:
- linux64-clang
- linux64-gcc
- linux64-rust
- linux64-rust-size
- linux64-sccache
linux64-lto/debug:
@ -702,6 +718,7 @@ linux64-lto/debug:
- linux64-clang
- linux64-gcc
- linux64-rust
- linux64-rust-size
- linux64-sccache
linux64-nightly/opt:
@ -735,6 +752,7 @@ linux64-nightly/opt:
- linux64-clang
- linux64-gcc
- linux64-rust
- linux64-rust-size
- linux64-sccache
linux64-noopt/debug:
@ -766,6 +784,7 @@ linux64-noopt/debug:
- linux64-clang
- linux64-gcc
- linux64-rust
- linux64-rust-size
- linux64-sccache
linux64-rusttests/opt:
@ -981,4 +1000,5 @@ linux64-add-on-devel/opt:
- linux64-clang
- linux64-gcc
- linux64-rust
- linux64-rust-size
- linux64-sccache

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

@ -29,6 +29,7 @@ macosx64/debug:
- linux64-libdmg
- linux64-llvm-dsymutil
- linux64-rust-macos
- linux64-rust-size
- linux64-sccache
macosx64/opt:
@ -61,6 +62,7 @@ macosx64/opt:
- linux64-libdmg
- linux64-llvm-dsymutil
- linux64-rust-macos
- linux64-rust-size
- linux64-sccache
macosx64-asan-fuzzing/opt:
@ -94,6 +96,7 @@ macosx64-asan-fuzzing/opt:
- linux64-libdmg
- linux64-llvm-dsymutil
- linux64-rust-macos
- linux64-rust-size
- linux64-sccache
macosx64-dmd/opt:
@ -129,6 +132,7 @@ macosx64-dmd/opt:
- linux64-libdmg
- linux64-llvm-dsymutil
- linux64-rust-macos
- linux64-rust-size
- linux64-sccache
macosx64-devedition-nightly/opt:
@ -169,6 +173,7 @@ macosx64-devedition-nightly/opt:
- linux64-libdmg
- linux64-llvm-dsymutil
- linux64-rust-macos
- linux64-rust-size
- linux64-sccache
macosx64-noopt/debug:
@ -204,6 +209,7 @@ macosx64-noopt/debug:
- linux64-libdmg
- linux64-llvm-dsymutil
- linux64-rust-macos
- linux64-rust-size
- linux64-sccache
macosx64-add-on-devel/opt:
@ -238,6 +244,7 @@ macosx64-add-on-devel/opt:
- linux64-libdmg
- linux64-llvm-dsymutil
- linux64-rust-macos
- linux64-rust-size
- linux64-sccache
macosx64-nightly/opt:
@ -276,6 +283,7 @@ macosx64-nightly/opt:
- linux64-libdmg
- linux64-llvm-dsymutil
- linux64-rust-macos
- linux64-rust-size
- linux64-sccache
macosx64-ccov/debug:
@ -310,4 +318,5 @@ macosx64-ccov/debug:
- linux64-libdmg
- linux64-llvm-dsymutil
- linux64-rust-macos
- linux64-rust-size
- linux64-sccache

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

@ -24,6 +24,7 @@ win32/debug:
toolchains:
- win64-clang-cl
- win64-rust
- win64-rust-size
- win64-sccache
win32/opt:
@ -52,6 +53,7 @@ win32/opt:
toolchains:
- win64-clang-cl
- win64-rust
- win64-rust-size
- win64-sccache
win32-dmd/opt:
@ -83,6 +85,7 @@ win32-dmd/opt:
toolchains:
- win64-clang-cl
- win64-rust
- win64-rust-size
- win64-sccache
win32/pgo:
@ -111,6 +114,7 @@ win32/pgo:
toolchains:
- win64-clang-cl
- win64-rust
- win64-rust-size
- win64-sccache
win64/debug:
@ -139,6 +143,7 @@ win64/debug:
toolchains:
- win64-clang-cl
- win64-rust
- win64-rust-size
- win64-sccache
win64-plain/debug:
@ -196,6 +201,7 @@ win64/opt:
toolchains:
- win64-clang-cl
- win64-rust
- win64-rust-size
- win64-sccache
win64-plain/opt:
@ -256,6 +262,7 @@ win64-dmd/opt:
toolchains:
- win64-clang-cl
- win64-rust
- win64-rust-size
- win64-sccache
win32-nightly/opt:
@ -298,6 +305,7 @@ win32-nightly/opt:
toolchains:
- win64-clang-cl
- win64-rust
- win64-rust-size
- win64-sccache
win64-nightly/opt:
@ -333,6 +341,7 @@ win64-nightly/opt:
toolchains:
- win64-clang-cl
- win64-rust
- win64-rust-size
- win64-sccache
win64/pgo:
@ -361,6 +370,7 @@ win64/pgo:
toolchains:
- win64-clang-cl
- win64-rust
- win64-rust-size
- win64-sccache
win32-add-on-devel/opt:
@ -390,6 +400,7 @@ win32-add-on-devel/opt:
toolchains:
- win64-clang-cl
- win64-rust
- win64-rust-size
- win64-sccache
win64-add-on-devel/opt:
@ -419,6 +430,7 @@ win64-add-on-devel/opt:
toolchains:
- win64-clang-cl
- win64-rust
- win64-rust-size
- win64-sccache
win64-noopt/debug:
@ -448,6 +460,7 @@ win64-noopt/debug:
toolchains:
- win64-clang-cl
- win64-rust
- win64-rust-size
- win64-sccache
win32-noopt/debug:
@ -477,6 +490,7 @@ win32-noopt/debug:
toolchains:
- win64-clang-cl
- win64-rust
- win64-rust-size
- win64-sccache
win32-rusttests/opt:
@ -566,6 +580,7 @@ win64-ccov/debug:
toolchains:
- win64-clang-cl
- win64-rust
- win64-rust-size
- win64-sccache
win64-asan/debug:
@ -596,6 +611,7 @@ win64-asan/debug:
toolchains:
- win64-clang-cl
- win64-rust
- win64-rust-size
- win64-sccache
win64-asan/opt:
@ -626,6 +642,7 @@ win64-asan/opt:
toolchains:
- win64-clang-cl
- win64-rust
- win64-rust-size
- win64-sccache
win32-devedition-nightly/opt:
@ -669,6 +686,7 @@ win32-devedition-nightly/opt:
toolchains:
- win64-clang-cl
- win64-rust
- win64-rust-size
- win64-sccache
win64-devedition-nightly/opt:
@ -705,6 +723,7 @@ win64-devedition-nightly/opt:
toolchains:
- win64-clang-cl
- win64-rust
- win64-rust-size
- win64-sccache
win32-mingw32/opt:

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

@ -507,6 +507,25 @@ linux64-sccache:
toolchains:
- linux64-rust-1.24
linux64-rust-size:
description: "rust-size toolchain build"
treeherder:
kind: build
platform: toolchains/opt
symbol: TL(rust-size)
tier: 1
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
max-run-time: 1800
run:
using: toolchain-script
script: build-rust-size.sh
resources:
- 'taskcluster/scripts/misc/tooltool-download.sh'
toolchain-artifact: public/build/rust-size.tar.xz
toolchains:
- linux64-rust-1.24
linux64-gn:
description: "gn toolchain build"
treeherder:

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

@ -214,6 +214,27 @@ win64-sccache:
toolchains:
- win64-rust-1.24
win64-rust-size:
description: "rust-size toolchain build"
treeherder:
kind: build
platform: toolchains/opt
symbol: TW64(rust-size)
tier: 1
worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
worker:
max-run-time: 1800
env:
TOOLTOOL_MANIFEST: "browser/config/tooltool-manifests/win64/sccache-build.manifest"
run:
using: toolchain-script
script: build-rust-size.sh
resources:
- 'taskcluster/scripts/misc/tooltool-download.sh'
toolchain-artifact: public/build/rust-size.tar.bz2
toolchains:
- win64-rust-1.24
win32-gn:
description: "gn toolchain build"
treeherder:

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

@ -0,0 +1,57 @@
#!/bin/bash
set -x -e -v
OWNER=luser
PROJECT=rust-size
PROJECT_REVISION=4a5d9148f50dc037dc230f10b8fc4e5ca00016aa
# This script is for building rust-size
case "$(uname -s)" in
Linux)
WORKSPACE=$HOME/workspace
UPLOAD_DIR=$HOME/artifacts
COMPRESS_EXT=xz
;;
MINGW*)
WORKSPACE=$PWD
UPLOAD_DIR=$WORKSPACE/public/build
WIN_WORKSPACE="$(pwd -W)"
COMPRESS_EXT=bz2
export INCLUDE="$WIN_WORKSPACE/build/src/vs2017_15.4.2/VC/include;$WIN_WORKSPACE/build/src/vs2017_15.4.2/VC/atlmfc/include;$WIN_WORKSPACE/build/src/vs2017_15.4.2/SDK/Include/10.0.15063.0/ucrt;$WIN_WORKSPACE/build/src/vs2017_15.4.2/SDK/Include/10.0.15063.0/shared;$WIN_WORKSPACE/build/src/vs2017_15.4.2/SDK/Include/10.0.15063.0/um;$WIN_WORKSPACE/build/src/vs2017_15.4.2/SDK/Include/10.0.15063.0/winrt;$WIN_WORKSPACE/build/src/vs2017_15.4.2/DIA SDK/include"
export LIB="$WIN_WORKSPACE/build/src/vs2017_15.4.2/VC/lib/x64;$WIN_WORKSPACE/build/src/vs2017_15.4.2/VC/atlmfc/lib/x64;$WIN_WORKSPACE/build/src/vs2017_15.4.2/SDK/lib/10.0.15063.0/um/x64;$WIN_WORKSPACE/build/src/vs2017_15.4.2/SDK/lib/10.0.15063.0/ucrt/x64;$WIN_WORKSPACE/build/src/vs2017_15.4.2/DIA SDK/lib/amd64"
PATH="$WORKSPACE/build/src/vs2017_15.4.2/VC/bin/Hostx64/x64:$WORKSPACE/build/src/vs2017_15.4.2/VC/bin/Hostx86/x86:$WORKSPACE/build/src/vs2017_15.4.2/SDK/bin/10.0.15063.0/x64:$WORKSPACE/build/src/vs2017_15.4.2/redist/x64/Microsoft.VC141.CRT:$WORKSPACE/build/src/vs2017_15.4.2/SDK/Redist/ucrt/DLLs/x64:$WORKSPACE/build/src/vs2017_15.4.2/DIA SDK/bin/amd64:$WORKSPACE/build/src/mingw64/bin:$PATH"
;;
esac
cd $WORKSPACE/build/src
. taskcluster/scripts/misc/tooltool-download.sh
# cargo gets mad if the parent directory has a Cargo.toml file in it
if [ -e Cargo.toml ]; then
mv Cargo.toml Cargo.toml.back
fi
PATH="$PWD/rustc/bin:$PATH"
git clone -n https://github.com/${OWNER}/${PROJECT} ${PROJECT}
cd $PROJECT
git checkout $PROJECT_REVISION
cargo build --verbose --release
mkdir $PROJECT
cp target/release/${PROJECT}* ${PROJECT}/
tar -acf ${PROJECT}.tar.$COMPRESS_EXT $PROJECT
mkdir -p $UPLOAD_DIR
cp ${PROJECT}.tar.$COMPRESS_EXT $UPLOAD_DIR
cd ..
if [ -e Cargo.toml.back ]; then
mv Cargo.toml.back Cargo.toml
fi

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

@ -1606,35 +1606,40 @@ or run without that action (ie: --no-{action})"
"""
from StringIO import StringIO
# Check for binutils' `size` program
size_names = ('size', 'gsize')
size_prog = None
for name in size_names:
size_prog = self.which(name)
if size_prog:
break
# Check for `rust_size`, our cross platform version of size. It should
# be installed by tooltool in $abs_src_dir/rust-size/rust-size
rust_size = os.path.join(self.query_abs_dirs()['abs_src_dir'],
'rust-size', 'rust-size')
size_prog = self.which(rust_size)
if not size_prog:
self.info("Couldn't find `size` program")
self.info("Couldn't find `rust-size` program")
return {}
# Call `size` and output with SysV format in decimal radix
cmd = [size_prog, '-A', '-d', file]
self.info("Using %s" % size_prog)
cmd = [size_prog, file]
output = self.get_output_from_command(cmd)
if not output:
self.info("`rust-size` failed")
return {}
# Format is JSON:
# {
# "section_type": {
# "section_name": size, ....
# },
# ...
# }
try:
parsed = json.loads(output)
except ValueError:
self.info("`rust-size` failed: %s" % output)
return {}
# Format is:
# <section-name> <size> <address>, ie:
# .data 302160 101053344
size_section_re = re.compile(r"([\w\.]+)\s+(\d+)\s+(\d+)")
sections = {}
for line in output.splitlines():
m = size_section_re.match(line)
if m:
name = m.group(1)
for sec_type in parsed.itervalues():
for name, size in sec_type.iteritems():
if not filter or name in filter:
sections[name] = int(m.group(2))
sections[name] = size
return sections
@ -1650,9 +1655,8 @@ or run without that action (ie: --no-{action})"
'avcodec': ('libmozavcodec.so', 'mozavcodec.dll', 'libmozavcodec.dylib'),
'avutil': ('libmozavutil.so', 'mozavutil.dll', 'libmozavutil.dylib')
}
# TODO(erahm): update for windows and osx. As-is we only have support
# for `size` on debian which gives us linux and android.
section_interests = ('.text', '.data', '.rodata', '.data.rel.ro', '.bss')
section_interests = ('.text', '.data', '.rodata', '.rdata',
'.cstring', '.data.rel.ro', '.bss')
lib_details = []
dirs = self.query_abs_dirs()
@ -1667,6 +1671,18 @@ or run without that action (ie: --no-{action})"
section_details = self._get_sections(lib, section_interests)
section_measurements = []
# Build up the subtests
# Lump rodata sections together
# - Mach-O separates out read-only string data as .cstring
# - PE really uses .rdata, but XUL at least has a .rodata as well
for ro_alias in ('.cstring', '.rdata'):
if ro_alias in section_details:
if '.rodata' in section_details:
section_details['.rodata'] += section_details[ro_alias]
else:
section_details['.rodata'] = section_details[ro_alias]
del section_details[ro_alias]
for k, v in section_details.iteritems():
section_measurements.append({'name': k, 'value': v})
lib_size += v