This commit is contained in:
Ryan VanderMeulen 2015-08-27 11:43:16 -04:00
Родитель 09a84e9da3 df0adb1534
Коммит 4ff4f84ce2
103 изменённых файлов: 2171 добавлений и 905 удалений

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

@ -112,16 +112,13 @@ static const uintptr_t IS_PROXY = 1;
// returns the native window we're inside.
- (NSWindow*)window;
// the accessible description of this particular instance.
- (NSString*)customDescription;
// the value of this element.
- (id)value;
// name that is associated with this accessible (for buttons, etc)
- (NSString*)title;
// help text associated with this element.
// the accessible description (help text) of this particular instance.
- (NSString*)help;
- (BOOL)isEnabled;

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

@ -302,7 +302,6 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
NSAccessibilityHelpAttribute,
NSAccessibilityTitleUIElementAttribute,
NSAccessibilityTopLevelUIElementAttribute,
NSAccessibilityDescriptionAttribute,
#if DEBUG
@"AXMozDescription",
#endif
@ -403,8 +402,6 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
return [self value];
if ([attribute isEqualToString:NSAccessibilityRoleDescriptionAttribute])
return [self roleDescription];
if ([attribute isEqualToString:NSAccessibilityDescriptionAttribute])
return [self customDescription];
if ([attribute isEqualToString:NSAccessibilityFocusedAttribute])
return [NSNumber numberWithBool:[self isFocused]];
if ([attribute isEqualToString:NSAccessibilitySizeAttribute])
@ -1199,32 +1196,17 @@ struct RoleDescrComparator
// Do nothing. mozTextAccessible will.
}
- (NSString*)customDescription
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
nsAutoString desc;
if (AccessibleWrap* accWrap = [self getGeckoAccessible])
accWrap->Description(desc);
else if (ProxyAccessible* proxy = [self getProxyAccessible])
proxy->Description(desc);
else
return nil;
return nsCocoaUtils::ToNSString(desc);
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
}
- (NSString*)help
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
// What needs to go here is actually the accDescription of an item.
// The MSAA acc_help method has nothing to do with this one.
nsAutoString helpText;
if (AccessibleWrap* accWrap = [self getGeckoAccessible])
accWrap->Help(helpText);
accWrap->Description(helpText);
else if (ProxyAccessible* proxy = [self getProxyAccessible])
proxy->Help(helpText);
proxy->Description(helpText);
return nsCocoaUtils::ToNSString(helpText);

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

@ -34,7 +34,7 @@
</xul:tabbox>
<children/>
</content>
<implementation implements="nsIDOMEventListener, nsIMessageListener">
<implementation implements="nsIDOMEventListener, nsIMessageListener, nsIObserver">
<property name="tabContextMenu" readonly="true"
onget="return this.tabContainer.contextMenu;"/>
@ -102,6 +102,9 @@
<field name="mProgressListeners">
[]
</field>
<field name="mActiveResizeDisplayportSuppression">
null
</field>
<field name="mTabsProgressListeners">
[]
</field>
@ -4070,12 +4073,40 @@
]]></body>
</method>
<method name="observe">
<parameter name="aSubject"/>
<parameter name="aTopic"/>
<parameter name="aData"/>
<body><![CDATA[
if (aTopic == "live-resize-start") {
let browser = this.mCurrentTab.linkedBrowser;
let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
if (fl && fl.tabParent && !this.mActiveResizeDisplayportSuppression) {
fl.tabParent.suppressDisplayport(true);
this.mActiveResizeDisplayportSuppression = browser;
}
} else if (aTopic == "live-resize-end") {
let browser = this.mActiveResizeDisplayportSuppression;
if (browser) {
let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
if (fl && fl.tabParent) {
fl.tabParent.suppressDisplayport(false);
this.mActiveResizeDisplayportSuppression = null;
}
}
}
]]></body>
</method>
<constructor>
<![CDATA[
let browserStack = document.getAnonymousElementByAttribute(this, "anonid", "browserStack");
this.mCurrentBrowser = document.getAnonymousElementByAttribute(this, "anonid", "initialBrowser");
this.mCurrentBrowser.permanentKey = {};
Services.obs.addObserver(this, "live-resize-start", false);
Services.obs.addObserver(this, "live-resize-end", false);
this.mCurrentTab = this.tabContainer.firstChild;
const nsIEventListenerService =
Components.interfaces.nsIEventListenerService;
@ -4161,6 +4192,9 @@
<destructor>
<![CDATA[
Services.obs.removeObserver(this, "live-resize-start", false);
Services.obs.removeObserver(this, "live-resize-end", false);
for (var i = 0; i < this.mTabListeners.length; ++i) {
let browser = this.getBrowserAtIndex(i);
if (browser.registeredOpenURI) {

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

@ -11631,7 +11631,84 @@ FullscreenRequest::~FullscreenRequest()
// of nsDocument because in the majority of time, there would be at most
// one document requesting fullscreen. We shouldn't waste the space to
// hold for it in every document.
static LinkedList<FullscreenRequest> sPendingFullscreenRequests;
class PendingFullscreenRequestList
{
public:
static void Add(UniquePtr<FullscreenRequest>&& aRequest)
{
sList.insertBack(aRequest.release());
}
static const FullscreenRequest* GetLast()
{
return sList.getLast();
}
class Iterator
{
public:
explicit Iterator(nsIDocument* aDoc)
: mCurrent(PendingFullscreenRequestList::sList.getFirst())
{
if (mCurrent) {
mRootShell = GetRootShell(aDoc);
SkipToNextMatch();
}
}
void DeleteAndNext()
{
DeleteAndNextInternal();
SkipToNextMatch();
}
bool AtEnd() const { return mCurrent == nullptr; }
const FullscreenRequest& Get() const { return *mCurrent; }
private:
already_AddRefed<nsIDocShellTreeItem> GetRootShell(nsIDocument* aDoc)
{
if (nsIDocShellTreeItem* shell = aDoc->GetDocShell()) {
nsCOMPtr<nsIDocShellTreeItem> rootShell;
shell->GetRootTreeItem(getter_AddRefs(rootShell));
return rootShell.forget();
}
return nullptr;
}
void DeleteAndNextInternal()
{
FullscreenRequest* thisRequest = mCurrent;
mCurrent = mCurrent->getNext();
delete thisRequest;
}
void SkipToNextMatch()
{
while (mCurrent) {
nsCOMPtr<nsIDocShellTreeItem>
rootShell = GetRootShell(mCurrent->GetDocument());
if (!rootShell) {
// Always automatically drop documents which has been
// detached from the doc shell.
DeleteAndNextInternal();
} else if (rootShell != mRootShell) {
mCurrent = mCurrent->getNext();
} else {
break;
}
}
}
FullscreenRequest* mCurrent;
nsCOMPtr<nsIDocShellTreeItem> mRootShell;
};
private:
PendingFullscreenRequestList() = delete;
static LinkedList<FullscreenRequest> sList;
};
/* static */ LinkedList<FullscreenRequest> PendingFullscreenRequestList::sList;
static nsCOMPtr<nsPIDOMWindow>
GetRootWindow(nsIDocument* aDoc)
@ -11656,7 +11733,14 @@ nsDocument::RequestFullScreen(UniquePtr<FullscreenRequest>&& aRequest)
// If we have been in fullscreen, apply the new state directly.
// Note that we should check both condition, because if we are in
// child process, our window may not report to be in fullscreen.
if (static_cast<nsGlobalWindow*>(rootWin.get())->FullScreen() ||
// Also, it is possible that the root window reports that it is in
// fullscreen while there exists pending fullscreen request because
// of ongoing fullscreen transition. In that case, we shouldn't
// apply the state before any previous request.
if ((static_cast<nsGlobalWindow*>(rootWin.get())->FullScreen() &&
// The iterator being at end at the beginning indicates there is
// no pending fullscreen request which relates to this document.
PendingFullscreenRequestList::Iterator(this).AtEnd()) ||
nsContentUtils::GetRootDocument(this)->IsFullScreenDoc()) {
ApplyFullscreen(*aRequest);
return;
@ -11669,7 +11753,7 @@ nsDocument::RequestFullScreen(UniquePtr<FullscreenRequest>&& aRequest)
return;
}
sPendingFullscreenRequests.insertBack(aRequest.release());
PendingFullscreenRequestList::Add(Move(aRequest));
if (XRE_GetProcessType() == GeckoProcessType_Content) {
// If we are not the top level process, dispatch an event to make
// our parent process go fullscreen first.
@ -11678,58 +11762,24 @@ nsDocument::RequestFullScreen(UniquePtr<FullscreenRequest>&& aRequest)
/* Bubbles */ true, /* Cancelable */ false, /* DefaultAction */ nullptr);
} else {
// Make the window fullscreen.
FullscreenRequest* lastRequest = sPendingFullscreenRequests.getLast();
const FullscreenRequest*
lastRequest = PendingFullscreenRequestList::GetLast();
rootWin->SetFullscreenInternal(nsPIDOMWindow::eForFullscreenAPI, true,
lastRequest->mVRHMDDevice);
}
}
/* static */ bool
nsIDocument::HandlePendingFullscreenRequest(const FullscreenRequest& aRequest,
nsIDocShellTreeItem* aRootShell,
bool* aHandled)
{
nsDocument* doc = aRequest.GetDocument();
nsIDocShellTreeItem* shell = doc->GetDocShell();
if (!shell) {
return true;
}
nsCOMPtr<nsIDocShellTreeItem> rootShell;
shell->GetRootTreeItem(getter_AddRefs(rootShell));
if (rootShell != aRootShell) {
return false;
}
if (doc->ApplyFullscreen(aRequest)) {
*aHandled = true;
}
return true;
}
/* static */ bool
nsIDocument::HandlePendingFullscreenRequests(nsIDocument* aDoc)
{
if (sPendingFullscreenRequests.isEmpty()) {
return false;
}
bool handled = false;
nsIDocShellTreeItem* shell = aDoc->GetDocShell();
nsCOMPtr<nsIDocShellTreeItem> rootShell;
if (shell) {
shell->GetRootTreeItem(getter_AddRefs(rootShell));
}
FullscreenRequest* request = sPendingFullscreenRequests.getFirst();
while (request) {
if (HandlePendingFullscreenRequest(*request, rootShell, &handled)) {
// Drop requests, which either have been detached from document/
// document shell, or are handled by HandleFullscreenRequest.
FullscreenRequest* thisRequest = request;
request = request->getNext();
delete thisRequest;
} else {
request = request->getNext();
PendingFullscreenRequestList::Iterator iter(aDoc);
while (!iter.AtEnd()) {
const FullscreenRequest& request = iter.Get();
if (request.GetDocument()->ApplyFullscreen(request)) {
handled = true;
}
iter.DeleteAndNext();
}
return handled;
}
@ -11737,29 +11787,9 @@ nsIDocument::HandlePendingFullscreenRequests(nsIDocument* aDoc)
static void
ClearPendingFullscreenRequests(nsIDocument* aDoc)
{
nsIDocShellTreeItem* shell = aDoc->GetDocShell();
if (!shell) {
return;
}
FullscreenRequest* request = sPendingFullscreenRequests.getFirst();
while (request) {
nsIDocument* doc = request->GetDocument();
bool shouldRemove = false;
for (nsCOMPtr<nsIDocShellTreeItem> docShell = doc->GetDocShell();
docShell; docShell->GetParent(getter_AddRefs(docShell))) {
if (docShell == shell) {
shouldRemove = true;
break;
}
}
if (shouldRemove) {
FullscreenRequest* thisRequest = request;
request = request->getNext();
delete thisRequest;
} else {
request = request->getNext();
}
PendingFullscreenRequestList::Iterator iter(aDoc);
while (!iter.AtEnd()) {
iter.DeleteAndNext();
}
}

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

@ -100,6 +100,7 @@ class CallbackFunction;
struct FullscreenRequest : public LinkedListElement<FullscreenRequest>
{
explicit FullscreenRequest(Element* aElement);
FullscreenRequest(const FullscreenRequest&) = delete;
~FullscreenRequest();
Element* GetElement() const { return mElement; }

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

@ -1184,15 +1184,6 @@ public:
*/
static void AsyncExitFullscreen(nsIDocument* aDocument);
/**
* Handles one single fullscreen request, updates `aHandled` if the request
* is handled, and returns whether this request should be removed from the
* request queue.
*/
static bool HandlePendingFullscreenRequest(const FullscreenRequest& aRequest,
nsIDocShellTreeItem* aRootShell,
bool* aHandled);
/**
* Handles any pending fullscreen in aDocument or its subdocuments.
*

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

@ -16,6 +16,7 @@
#include "nsThreadUtils.h"
#include "nsIFile.h"
#include "nsIFileChannel.h"
#include "nsIFileStreams.h"
#include "nsIHttpChannel.h"
#include "nsISeekableStream.h"
#include "nsIInputStream.h"
@ -1367,7 +1368,8 @@ nsresult FileMediaResource::Open(nsIStreamListener** aStreamListener)
rv = fc->GetFile(getter_AddRefs(file));
NS_ENSURE_SUCCESS(rv, rv);
rv = NS_NewLocalFileInputStream(getter_AddRefs(mInput), file);
rv = NS_NewLocalFileInputStream(
getter_AddRefs(mInput), file, -1, -1, nsIFileInputStream::SHARE_DELETE);
} else if (IsBlobURI(mURI)) {
rv = NS_GetStreamForBlobURI(mURI, getter_AddRefs(mInput));
}

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

@ -45,9 +45,19 @@ static int webmdemux_read(void* aBuffer, size_t aLength, void* aUserData)
int64_t length = demuxer->GetEndDataOffset();
uint32_t count = aLength;
int64_t position = demuxer->GetResource()->Tell();
if (position >= length) {
// GetLastBlockOffset was calculated after we had read past it.
// This condition can only occurs with plain webm, as with MSE,
// EnsureUpdateIndex would have been called first.
// Continue reading to the end instead.
length = demuxer->GetResource()->GetLength();
}
MOZ_ASSERT(position <= demuxer->GetResource()->GetLength());
MOZ_ASSERT(position <= length);
if (length >= 0 && count + position > length) {
count = length - position;
}
MOZ_ASSERT(count <= aLength);
uint32_t bytes = 0;
nsresult rv =
@ -446,6 +456,7 @@ WebMDemuxer::EnsureUpToDateIndex()
}
mLastWebMBlockOffset = mBufferedState->GetLastBlockOffset();
mIsExpectingMoreData = mResource.GetResource()->IsExpectingMoreData();
MOZ_ASSERT(mLastWebMBlockOffset <= mResource.GetLength());
mNeedReIndex = false;
}

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

@ -536,13 +536,14 @@ nsNPAPIPluginStreamListener::OnDataAvailable(nsPluginStreamListenerPeer* streamP
nsresult rv = NS_OK;
while (NS_SUCCEEDED(rv) && length > 0) {
if (input && length) {
if (mStreamBufferSize < mStreamBufferByteCount + length && mIsSuspended) {
if (mStreamBufferSize < mStreamBufferByteCount + length) {
// We're in the ::OnDataAvailable() call that we might get
// after suspending a request, or we suspended the request
// from within this ::OnDataAvailable() call while there's
// still data in the input, and we don't have enough space to
// store what we got off the network. Reallocate our internal
// buffer.
// still data in the input, or we have resumed a previously
// suspended request and our buffer is already full, and we
// don't have enough space to store what we got off the network.
// Reallocate our internal buffer.
mStreamBufferSize = mStreamBufferByteCount + length;
char *buf = (char*)PR_Realloc(mStreamBuffer, mStreamBufferSize);
if (!buf)
@ -550,10 +551,11 @@ nsNPAPIPluginStreamListener::OnDataAvailable(nsPluginStreamListenerPeer* streamP
mStreamBuffer = buf;
}
uint32_t bytesToRead =
std::min(length, mStreamBufferSize - mStreamBufferByteCount);
MOZ_ASSERT(bytesToRead > 0);
uint32_t amountRead = 0;
rv = input->Read(mStreamBuffer + mStreamBufferByteCount, bytesToRead,
&amountRead);

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

@ -237,7 +237,9 @@ GLXLibrary::EnsureInitialized()
}
if (HasExtension(extensionsStr, "GLX_ARB_create_context_robustness") &&
GLLibraryLoader::LoadSymbols(mOGLLibrary, symbols_robustness)) {
GLLibraryLoader::LoadSymbols(mOGLLibrary, symbols_robustness,
(GLLibraryLoader::PlatformLookupFunction)&xGetProcAddress))
{
mHasRobustness = true;
}

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

@ -8,6 +8,7 @@
#include "mozilla/layers/BasicCompositor.h"
#include "mozilla/layers/TextureHostBasic.h"
#include "mozilla/layers/X11TextureHost.h"
#include "mozilla/gfx/2D.h"
namespace mozilla {
@ -18,7 +19,7 @@ class BasicCompositor;
// TextureSource for Xlib-backed surfaces.
class X11TextureSourceBasic
: public TextureSourceBasic
, public TextureSource
, public X11TextureSource
{
public:
X11TextureSourceBasic(BasicCompositor* aCompositor, gfxXlibSurface* aSurface);
@ -35,6 +36,8 @@ public:
virtual void SetCompositor(Compositor* aCompositor) override;
virtual void Updated() override { }
static gfx::SurfaceFormat ContentTypeToSurfaceFormat(gfxContentType aType);
protected:

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

@ -15,6 +15,14 @@
namespace mozilla {
namespace layers {
class X11TextureSource : public TextureSource
{
public:
// Called when the underlying X surface has been changed.
// Useful for determining whether to rebind a GLXPixmap to a texture.
virtual void Updated() = 0;
};
// TextureHost for Xlib-backed TextureSources.
class X11TextureHost : public TextureHost
{
@ -43,8 +51,14 @@ public:
#endif
protected:
virtual void UpdatedInternal(const nsIntRegion*) override
{
if (mTextureSource)
mTextureSource->Updated();
}
RefPtr<Compositor> mCompositor;
RefPtr<TextureSource> mTextureSource;
RefPtr<X11TextureSource> mTextureSource;
RefPtr<gfxXlibSurface> mSurface;
};

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

@ -18,6 +18,7 @@ X11TextureSourceOGL::X11TextureSourceOGL(CompositorOGL* aCompositor, gfxXlibSurf
: mCompositor(aCompositor)
, mSurface(aSurface)
, mTexture(0)
, mUpdated(false)
{
}
@ -51,7 +52,10 @@ X11TextureSourceOGL::BindTexture(GLenum aTextureUnit, gfx::Filter aFilter)
gl::sGLXLibrary.BindTexImage(mSurface->XDisplay(), mSurface->GetGLXPixmap());
} else {
gl()->fBindTexture(LOCAL_GL_TEXTURE_2D, mTexture);
gl::sGLXLibrary.UpdateTexImage(mSurface->XDisplay(), mSurface->GetGLXPixmap());
if (mUpdated) {
gl::sGLXLibrary.UpdateTexImage(mSurface->XDisplay(), mSurface->GetGLXPixmap());
mUpdated = false;
}
}
ApplyFilterToBoundTexture(gl(), aFilter, LOCAL_GL_TEXTURE_2D);

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

@ -10,6 +10,7 @@
#include "mozilla/layers/CompositorOGL.h"
#include "mozilla/layers/TextureHostOGL.h"
#include "mozilla/layers/X11TextureHost.h"
#include "mozilla/gfx/2D.h"
namespace mozilla {
@ -18,7 +19,7 @@ namespace layers {
// TextureSource for Xlib-backed surfaces.
class X11TextureSourceOGL
: public TextureSourceOGL
, public TextureSource
, public X11TextureSource
{
public:
X11TextureSourceOGL(CompositorOGL* aCompositor, gfxXlibSurface* aSurface);
@ -42,6 +43,8 @@ public:
virtual void SetCompositor(Compositor* aCompositor) override;
virtual void Updated() override { mUpdated = true; }
gl::GLContext* gl() const;
static gfx::SurfaceFormat ContentTypeToSurfaceFormat(gfxContentType aType);
@ -51,6 +54,7 @@ protected:
nsRefPtr<gfxXlibSurface> mSurface;
RefPtr<gfx::SourceSurface> mSourceSurface;
GLuint mTexture;
bool mUpdated;
};
} // namespace layers

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

@ -1370,6 +1370,15 @@ gfxContext::GetRoundOffsetsToPixels(bool *aRoundX, bool *aRoundY)
cairo_t *cr = GetCairo();
cairo_scaled_font_t *scaled_font = cairo_get_scaled_font(cr);
// bug 1198921 - this sometimes fails under Windows for whatver reason
NS_ASSERTION(scaled_font, "null cairo scaled font should never be returned "
"by cairo_get_scaled_font");
if (!scaled_font) {
*aRoundX = true; // default to the same as the fallback path below
return;
}
// Sometimes hint metrics gets set for us, most notably for printing.
cairo_font_options_t *font_options = cairo_font_options_create();
cairo_scaled_font_get_font_options(scaled_font, font_options);

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

@ -2521,11 +2521,23 @@ AllocationMarker(JSContext* cx, unsigned argc, Value* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
static const JSClass cls = { "AllocationMarker" };
bool allocateInsideNursery = true;
if (args.length() > 0 && args[0].isObject()) {
RootedObject options(cx, &args[0].toObject());
RootedObject obj(cx, JS_NewObject(cx, &cls));
RootedValue nurseryVal(cx);
if (!JS_GetProperty(cx, options, "nursery", &nurseryVal))
return false;
allocateInsideNursery = ToBoolean(nurseryVal);
}
static const Class cls = { "AllocationMarker" };
auto newKind = allocateInsideNursery ? GenericObject : TenuredObject;
RootedObject obj(cx, NewObjectWithGivenProto(cx, &cls, nullptr, newKind));
if (!obj)
return false;
args.rval().setObject(*obj);
return true;
}
@ -3122,11 +3134,13 @@ gc::ZealModeHelpText),
" Otherwise, return null."),
JS_FN_HELP("allocationMarker", AllocationMarker, 0, 0,
"allocationMarker()",
"allocationMarker([options])",
" Return a freshly allocated object whose [[Class]] name is\n"
" \"AllocationMarker\". Such objects are allocated only by calls\n"
" to this function, never implicitly by the system, making them\n"
" suitable for use in allocation tooling tests.\n"),
" suitable for use in allocation tooling tests. Takes an optional\n"
" options object which may contain the following properties:\n"
" * nursery: bool, whether to allocate the object in the nursery\n"),
JS_FN_HELP("setGCCallback", SetGCCallback, 1, 0,
"setGCCallback({action:\"...\", options...})",

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

@ -224,6 +224,10 @@ compartment.
* "allocation trigger"
* "requested"
`gcCycleNumber`
: The GC cycle's "number". Does not correspond to the number
of GC cycles that have run, but is guaranteed to be monotonically
increasing.
Function Properties of the `Debugger.Memory.prototype` Object
-------------------------------------------------------------
@ -244,6 +248,7 @@ Function Properties of the `Debugger.Memory.prototype` Object
"class": <i>className</i>,
"constructor": <i>constructorName</i>,
"size": <i>byteSize</i>,
"inNursery": <i>inNursery</i>,
}
</code></pre>
@ -265,6 +270,9 @@ Function Properties of the `Debugger.Memory.prototype` Object
* *byteSize* is the size of the object in bytes.
* *inNursery* is true if the allocation happened inside the nursery. False
if the allocation skipped the nursery and started in the tenured heap.
When `trackingAllocationSites` is `false`, `drainAllocationsLog()` throws an
`Error`.

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

@ -0,0 +1,27 @@
// Test drainAllocationsLog() entries' inNursery flag.
const root = newGlobal();
const dbg = new Debugger();
const wrappedRoot = dbg.addDebuggee(root);
dbg.memory.trackingAllocationSites = true;
root.eval(
`
for (let i = 0; i < 10; i++)
allocationMarker({ nursery: true });
for (let i = 0; i < 10; i++)
allocationMarker({ nursery: false });
`
);
let entries = dbg.memory.drainAllocationsLog().filter(e => e.class == "AllocationMarker");
assertEq(entries.length, 20);
for (let i = 0; i < 10; i++)
assertEq(entries[i].inNursery, true);
for (let i = 10; i < 20; i++)
assertEq(entries[i].inNursery, false);

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

@ -469,6 +469,8 @@ PrepareForDebuggerOnIonCompilationHook(JSContext* cx, jit::MIRGraph& graph,
void
jit::FinishOffThreadBuilder(JSContext* cx, IonBuilder* builder)
{
MOZ_ASSERT(HelperThreadState().isLocked());
// Clean the references to the pending IonBuilder, if we just finished it.
if (builder->script()->baselineScript()->hasPendingIonBuilder() &&
builder->script()->baselineScript()->pendingIonBuilder() == builder)
@ -574,18 +576,24 @@ LinkBackgroundCodeGen(JSContext* cx, IonBuilder* builder,
void
jit::LazyLink(JSContext* cx, HandleScript calleeScript)
{
// Get the pending builder from the Ion frame.
MOZ_ASSERT(calleeScript->hasBaselineScript());
IonBuilder* builder = calleeScript->baselineScript()->pendingIonBuilder();
calleeScript->baselineScript()->removePendingIonBuilder(calleeScript);
IonBuilder* builder;
{
AutoLockHelperThreadState lock;
// Get the pending builder from the Ion frame.
MOZ_ASSERT(calleeScript->hasBaselineScript());
builder = calleeScript->baselineScript()->pendingIonBuilder();
calleeScript->baselineScript()->removePendingIonBuilder(calleeScript);
// Remove from pending.
builder->removeFrom(HelperThreadState().ionLazyLinkList());
}
// See PrepareForDebuggerOnIonCompilationHook
AutoScriptVector debugScripts(cx);
OnIonCompilationInfo info(builder->alloc().lifoAlloc());
// Remove from pending.
builder->removeFrom(HelperThreadState().ionLazyLinkList());
{
AutoEnterAnalysis enterTypes(cx);
if (!LinkBackgroundCodeGen(cx, builder, &debugScripts, &info)) {
@ -599,7 +607,10 @@ jit::LazyLink(JSContext* cx, HandleScript calleeScript)
if (info.filled())
Debugger::onIonCompilation(cx, debugScripts, info.graph);
FinishOffThreadBuilder(cx, builder);
{
AutoLockHelperThreadState lock;
FinishOffThreadBuilder(cx, builder);
}
MOZ_ASSERT(calleeScript->hasBaselineScript());
MOZ_ASSERT(calleeScript->baselineOrIonRawPointer());
@ -2590,15 +2601,15 @@ jit::SetEnterJitData(JSContext* cx, EnterJitData& data, RunState& state, AutoVal
ScriptFrameIter iter(cx);
if (iter.isFunctionFrame())
data.calleeToken = CalleeToToken(iter.callee(cx), /* constructing = */ false);
// Push newTarget onto the stack, as well as Argv.
if (!vals.reserve(2))
return false;
data.maxArgc = 2;
data.maxArgv = vals.begin();
vals.infallibleAppend(state.asExecute()->thisv());
if (iter.isFunctionFrame()) {
if (iter.isFunctionFrame()) {
if (state.asExecute()->newTarget().isNull())
vals.infallibleAppend(iter.newTarget());
else

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

@ -92,6 +92,7 @@
macro(format, format, "format") \
macro(frame, frame, "frame") \
macro(from, from, "from") \
macro(gcCycleNumber, gcCycleNumber, "gcCycleNumber") \
macro(get, get, "get") \
macro(getInternals, getInternals, "getInternals") \
macro(getOwnPropertyDescriptor, getOwnPropertyDescriptor, "getOwnPropertyDescriptor") \
@ -108,6 +109,7 @@
macro(InitializeCollator, InitializeCollator, "InitializeCollator") \
macro(InitializeDateTimeFormat, InitializeDateTimeFormat, "InitializeDateTimeFormat") \
macro(InitializeNumberFormat, InitializeNumberFormat, "InitializeNumberFormat") \
macro(inNursery, inNursery, "inNursery") \
macro(innermost, innermost, "innermost") \
macro(input, input, "input") \
macro(int8x16, int8x16, "Int8x16") \

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

@ -1743,8 +1743,9 @@ Debugger::appendAllocationSite(JSContext* cx, HandleObject obj, HandleSavedFrame
auto className = obj->getClass()->name;
auto size = JS::ubi::Node(obj.get()).size(cx->runtime()->debuggerMallocSizeOf);
auto inNursery = gc::IsInsideNursery(obj);
if (!allocationsLog.emplaceBack(wrappedFrame, when, className, ctorName, size)) {
if (!allocationsLog.emplaceBack(wrappedFrame, when, className, ctorName, size, inNursery)) {
ReportOutOfMemory(cx);
return false;
}
@ -8182,9 +8183,11 @@ JSObject*
GarbageCollectionEvent::toJSObject(JSContext* cx) const
{
RootedObject obj(cx, NewBuiltinClassInstance<PlainObject>(cx));
RootedValue gcCycleNumberVal(cx, NumberValue(majorGCNumber_));
if (!obj ||
!DefineStringProperty(cx, obj, cx->names().nonincrementalReason, nonincrementalReason) ||
!DefineStringProperty(cx, obj, cx->names().reason, reason))
!DefineStringProperty(cx, obj, cx->names().reason, reason) ||
!DefineProperty(cx, obj, cx->names().gcCycleNumber, gcCycleNumberVal))
{
return nullptr;
}

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

@ -307,12 +307,13 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
struct AllocationsLogEntry : public JS::Traceable
{
AllocationsLogEntry(HandleObject frame, double when, const char* className,
HandleAtom ctorName, size_t size)
HandleAtom ctorName, size_t size, bool inNursery)
: frame(frame),
when(when),
className(className),
ctorName(ctorName),
size(size)
size(size),
inNursery(inNursery)
{
MOZ_ASSERT_IF(frame, UncheckedUnwrap(frame)->is<SavedFrame>());
};
@ -322,6 +323,7 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
const char* className;
RelocatablePtrAtom ctorName;
size_t size;
bool inNursery;
static void trace(AllocationsLogEntry* e, JSTracer* trc) {
if (e->frame)

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

@ -228,6 +228,10 @@ DebuggerMemory::drainAllocationsLog(JSContext* cx, unsigned argc, Value* vp)
if (!DefineProperty(cx, obj, cx->names().size, size))
return false;
RootedValue inNursery(cx, BooleanValue(entry.inNursery));
if (!DefineProperty(cx, obj, cx->names().inNursery, inNursery))
return false;
result->setDenseElement(i, ObjectValue(*obj));
// Pop the front queue entry, and delete it immediately, so that the GC

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

@ -0,0 +1,37 @@
// Test that the onGarbageCollection hook reports its gc cycle's number (aka the
// major GC number) and that it is monotonically increasing.
const root = newGlobal();
const dbg = new Debugger();
const wrappedRoot = dbg.addDebuggee(root)
function run_test() {
do_test_pending();
let numFired = 0;
let lastGCCycleNumber = undefined;
(function loop() {
if (numFired == 10) {
dbg.memory.onGarbageCollection = undefined;
dbg.enabled = false;
return void do_test_finished();
}
dbg.memory.onGarbageCollection = data => {
print("onGarbageCollection: " + uneval(data));
if (numFired != 0) {
equal(typeof lastGCCycleNumber, "number");
equal(data.gcCycleNumber - lastGCCycleNumber, 1);
}
numFired++;
lastGCCycleNumber = data.gcCycleNumber;
executeSoon(loop);
};
root.eval("gc(this)");
}());
}

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

@ -80,6 +80,8 @@ head = head_ongc.js
head = head_ongc.js
[test_onGarbageCollection-04.js]
head = head_ongc.js
[test_onGarbageCollection-05.js]
head = head_ongc.js
[test_reflect_parse.js]
[test_localeCompare.js]
# Bug 676965: test fails consistently on Android

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

@ -0,0 +1,176 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
/* A global table that tracks images referenced by CSS variables. */
#ifndef mozilla_CSSVariableImageTable_h
#define mozilla_CSSVariableImageTable_h
#include "nsClassHashtable.h"
#include "nsCSSProperty.h"
#include "nsCSSValue.h"
#include "nsStyleContext.h"
#include "nsTArray.h"
/**
* CSSVariableImageTable maintains a global mapping
* (nsStyleContext, nsCSSProperty) -> nsTArray<ImageValue>
* which allows us to track the relationship between CSS property values
* involving variables and any images they may reference.
*
* When properties like background-image contain a normal url(), the
* Declaration's data block will hold a reference to the ImageValue. When a
* token stream is used, the Declaration only holds on to an
* nsCSSValueTokenStream object, and the ImageValue would only exist for the
* duration of nsRuleNode::WalkRuleTree, in the AutoCSSValueArray. So instead
* when we re-parse a token stream and get an ImageValue, we record it in the
* CSSVariableImageTable to keep the ImageValue alive. Such ImageValues are
* eventually freed the next time the token stream is re-parsed, or when the
* associated style context is destroyed.
*
* To add ImageValues to the CSSVariableImageTable, callers should pass a lambda
* to CSSVariableImageTable::ReplaceAll() that calls
* CSSVariableImageTable::Add() for each ImageValue that needs to be added to
* the table. When callers are sure that the ImageValues for a given
* nsStyleContext won't be needed anymore, they can call
* CSSVariableImageTable::RemoveAll() to release them.
*/
namespace mozilla {
namespace CSSVariableImageTable {
namespace detail {
typedef nsTArray<nsRefPtr<css::ImageValue>> ImageValueArray;
typedef nsClassHashtable<nsGenericHashKey<nsCSSProperty>, ImageValueArray>
PerPropertyImageHashtable;
typedef nsClassHashtable<nsPtrHashKey<nsStyleContext>, PerPropertyImageHashtable>
CSSVariableImageHashtable;
inline CSSVariableImageHashtable& GetTable()
{
static CSSVariableImageHashtable imageTable;
return imageTable;
}
#ifdef DEBUG
inline bool& IsReplacing()
{
static bool isReplacing = false;
return isReplacing;
}
#endif
} // namespace detail
/**
* ReplaceAll() allows callers to replace the ImageValues associated with a
* (nsStyleContext, nsCSSProperty) pair. The memory used by the previous list of
* ImageValues is automatically released.
*
* @param aContext The style context the ImageValues are associated with.
* @param aProp The CSS property the ImageValues are associated with.
* @param aFunc A lambda that calls CSSVariableImageTable::Add() to add new
* ImageValues which will replace the old ones.
*/
template <typename Lambda>
inline void ReplaceAll(nsStyleContext* aContext,
nsCSSProperty aProp,
Lambda aFunc)
{
MOZ_ASSERT(aContext);
auto& imageTable = detail::GetTable();
// Clear the existing image array, if any, for this property.
{
auto* perPropertyImageTable = imageTable.Get(aContext);
auto* imageList = perPropertyImageTable ? perPropertyImageTable->Get(aProp)
: nullptr;
if (imageList) {
imageList->ClearAndRetainStorage();
}
}
#ifdef DEBUG
MOZ_ASSERT(!detail::IsReplacing());
detail::IsReplacing() = true;
#endif
aFunc();
#ifdef DEBUG
detail::IsReplacing() = false;
#endif
// Clean up.
auto* perPropertyImageTable = imageTable.Get(aContext);
auto* imageList = perPropertyImageTable ? perPropertyImageTable->Get(aProp)
: nullptr;
if (imageList) {
if (imageList->IsEmpty()) {
// We used to have an image array for this property, but now we don't.
// Remove the entry in the per-property image table for this property.
// That may then allow us to remove the entire per-property image table.
perPropertyImageTable->Remove(aProp);
if (perPropertyImageTable->Count() == 0) {
imageTable.Remove(aContext);
}
} else {
// We still have a non-empty image array for this property. Compact the
// storage it's using if possible.
imageList->Compact();
}
}
}
/**
* Adds a new ImageValue @aValue to the CSSVariableImageTable, which will be
* associated with @aContext and @aProp.
*
* It's illegal to call this function outside of a lambda passed to
* CSSVariableImageTable::ReplaceAll().
*/
inline void
Add(nsStyleContext* aContext, nsCSSProperty aProp, css::ImageValue* aValue)
{
MOZ_ASSERT(aValue);
MOZ_ASSERT(aContext);
MOZ_ASSERT(detail::IsReplacing());
auto& imageTable = detail::GetTable();
// Ensure there's a per-property image table for this style context.
auto* perPropertyImageTable = imageTable.Get(aContext);
if (!perPropertyImageTable) {
perPropertyImageTable = new detail::PerPropertyImageHashtable();
imageTable.Put(aContext, perPropertyImageTable);
}
// Ensure there's an image array for this property.
auto* imageList = perPropertyImageTable->Get(aProp);
if (!imageList) {
imageList = new detail::ImageValueArray();
perPropertyImageTable->Put(aProp, imageList);
}
// Append the provided ImageValue to the list.
imageList->AppendElement(aValue);
}
/**
* Removes all ImageValues stored in the CSSVariableImageTable for the provided
* @aContext.
*/
inline void
RemoveAll(nsStyleContext* aContext)
{
detail::GetTable().Remove(aContext);
}
} // namespace CSSVariableImageTable
} // namespace mozilla
#endif // mozilla_CSSVariableImageTable_h

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

@ -10,6 +10,7 @@
#include "nsCSSDataBlock.h"
#include "CSSVariableImageTable.h"
#include "mozilla/css/Declaration.h"
#include "mozilla/css/ImageLoader.h"
#include "mozilla/MemoryReporting.h"
@ -20,6 +21,7 @@
#include "nsStyleSet.h"
using namespace mozilla;
using namespace mozilla::css;
/**
* Does a fast move of aSource to aDest. The previous value in
@ -51,14 +53,16 @@ ShouldIgnoreColors(nsRuleData *aRuleData)
*/
static void
TryToStartImageLoadOnValue(const nsCSSValue& aValue, nsIDocument* aDocument,
nsCSSValueTokenStream* aTokenStream)
nsStyleContext* aContext, nsCSSProperty aProperty,
bool aForTokenStream)
{
MOZ_ASSERT(aDocument);
if (aValue.GetUnit() == eCSSUnit_URL) {
aValue.StartImageLoad(aDocument);
if (aTokenStream) {
aTokenStream->mImageValues.PutEntry(aValue.GetImageStructValue());
if (aForTokenStream && aContext) {
CSSVariableImageTable::Add(aContext, aProperty,
aValue.GetImageStructValue());
}
}
else if (aValue.GetUnit() == eCSSUnit_Image) {
@ -66,10 +70,10 @@ TryToStartImageLoadOnValue(const nsCSSValue& aValue, nsIDocument* aDocument,
imgIRequest* request = aValue.GetImageValue(nullptr);
if (request) {
mozilla::css::ImageValue* imageValue = aValue.GetImageStructValue();
ImageValue* imageValue = aValue.GetImageStructValue();
aDocument->StyleImageLoader()->MaybeRegisterCSSImage(imageValue);
if (aTokenStream) {
aTokenStream->mImageValues.PutEntry(imageValue);
if (aForTokenStream && aContext) {
CSSVariableImageTable::Add(aContext, aProperty, imageValue);
}
}
}
@ -78,27 +82,30 @@ TryToStartImageLoadOnValue(const nsCSSValue& aValue, nsIDocument* aDocument,
MOZ_ASSERT(arguments->Count() == 6, "unexpected num of arguments");
const nsCSSValue& image = arguments->Item(1);
TryToStartImageLoadOnValue(image, aDocument, aTokenStream);
TryToStartImageLoadOnValue(image, aDocument, aContext, aProperty,
aForTokenStream);
}
}
static void
TryToStartImageLoad(const nsCSSValue& aValue, nsIDocument* aDocument,
nsCSSProperty aProperty,
nsCSSValueTokenStream* aTokenStream)
nsStyleContext* aContext, nsCSSProperty aProperty,
bool aForTokenStream)
{
if (aValue.GetUnit() == eCSSUnit_List) {
for (const nsCSSValueList* l = aValue.GetListValue(); l; l = l->mNext) {
TryToStartImageLoad(l->mValue, aDocument, aProperty, aTokenStream);
TryToStartImageLoad(l->mValue, aDocument, aContext, aProperty,
aForTokenStream);
}
} else if (nsCSSProps::PropHasFlags(aProperty,
CSS_PROPERTY_IMAGE_IS_IN_ARRAY_0)) {
if (aValue.GetUnit() == eCSSUnit_Array) {
TryToStartImageLoadOnValue(aValue.GetArrayValue()->Item(0), aDocument,
aTokenStream);
aContext, aProperty, aForTokenStream);
}
} else {
TryToStartImageLoadOnValue(aValue, aDocument, aTokenStream);
TryToStartImageLoadOnValue(aValue, aDocument, aContext, aProperty,
aForTokenStream);
}
}
@ -129,22 +136,17 @@ MapSinglePropertyInto(nsCSSProperty aProp,
// when aTarget is a token stream value, which is the case when we
// have just re-parsed a property that had a variable reference (in
// nsCSSParser::ParsePropertyWithVariableReferences). TryToStartImageLoad
// then records any resulting ImageValue objects on the
// nsCSSValueTokenStream object we found on aTarget. See the comment
// above nsCSSValueTokenStream::mImageValues for why.
// then records any resulting ImageValue objects in the
// CSSVariableImageTable, to give them the appropriate lifetime.
MOZ_ASSERT(aTarget->GetUnit() == eCSSUnit_TokenStream ||
aTarget->GetUnit() == eCSSUnit_Null,
"aTarget must only be a token stream (when re-parsing "
"properties with variable references) or null");
nsCSSValueTokenStream* tokenStream =
aTarget->GetUnit() == eCSSUnit_TokenStream ?
aTarget->GetTokenStreamValue() :
nullptr;
if (ShouldStartImageLoads(aRuleData, aProp)) {
nsIDocument* doc = aRuleData->mPresContext->Document();
TryToStartImageLoad(*aValue, doc, aProp, tokenStream);
TryToStartImageLoad(*aValue, doc, aRuleData->mStyleContext, aProp,
aTarget->GetUnit() == eCSSUnit_TokenStream);
}
*aTarget = *aValue;
if (nsCSSProps::PropHasFlags(aProp,
@ -713,7 +715,9 @@ nsCSSExpandedDataBlock::MapRuleInfoInto(nsCSSProperty aPropID,
MOZ_ASSERT(dest->GetUnit() == eCSSUnit_TokenStream &&
dest->GetTokenStreamValue()->mPropertyID == aPropID);
MapSinglePropertyInto(physicalProp, src, dest, aRuleData);
CSSVariableImageTable::ReplaceAll(aRuleData->mStyleContext, aPropID, [=] {
MapSinglePropertyInto(physicalProp, src, dest, aRuleData);
});
}
#ifdef DEBUG

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

@ -8,6 +8,8 @@
#ifndef nsCSSProperty_h___
#define nsCSSProperty_h___
#include <nsHashKeys.h>
/*
Declare the enum list using the magic of preprocessing
enum values are "eCSSProperty_foo" (where foo is the property)
@ -64,6 +66,17 @@ enum nsCSSProperty {
eCSSPropertyExtra_variable
};
namespace mozilla {
template<>
inline PLDHashNumber
Hash<nsCSSProperty>(const nsCSSProperty& aValue)
{
return uint32_t(aValue);
}
} // namespace mozilla
// The "descriptors" that can appear in a @font-face rule.
// They have the syntax of properties but different value rules.
enum nsCSSFontDesc {

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

@ -1542,18 +1542,6 @@ public:
uint32_t mLineNumber;
uint32_t mLineOffset;
// This table is used to hold a reference on to any ImageValue that results
// from re-parsing this token stream at computed value time. When properties
// like background-image contain a normal url(), the Declaration's data block
// will hold a reference to the ImageValue. When a token stream is used,
// the Declaration only holds on to this nsCSSValueTokenStream object, and
// the ImageValue would only exist for the duration of
// nsRuleNode::WalkRuleTree, in the AutoCSSValueArray. So instead when
// we re-parse a token stream and get an ImageValue, we record it in this
// table so that the Declaration can be the object that keeps holding
// a reference to it.
nsTHashtable<nsRefPtrHashKey<mozilla::css::ImageValue> > mImageValues;
private:
nsCSSValueTokenStream(const nsCSSValueTokenStream& aOther) = delete;
nsCSSValueTokenStream& operator=(const nsCSSValueTokenStream& aOther) = delete;

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

@ -5,6 +5,7 @@
/* the interface (to internal code) for retrieving computed style data */
#include "CSSVariableImageTable.h"
#include "mozilla/DebugOnly.h"
#include "nsCSSAnonBoxes.h"
@ -165,6 +166,9 @@ nsStyleContext::~nsStyleContext()
if (mCachedResetData) {
mCachedResetData->Destroy(mBits, presContext);
}
// Free any ImageValues we were holding on to for CSS variable values.
CSSVariableImageTable::RemoveAll(this);
}
#ifdef DEBUG

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

@ -470,8 +470,9 @@ class PushToTry(MachCommandBase):
print('ERROR please commit changes before continuing')
sys.exit(1)
driver = self._spawn(BuildDriver)
driver.install_tests(remove=False)
if paths or tags:
driver = self._spawn(BuildDriver)
driver.install_tests(remove=False)
manifests_by_flavor = at.resolve_manifests(paths=paths, tags=tags)

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

@ -159,3 +159,13 @@ class TestElements(MarionetteTestCase):
test_html = self.marionette.absolute_url("test.html")
self.marionette.navigate(test_html)
self.assertRaises(InvalidSelectorException, self.marionette.find_element, "Brie Search Type", "doesn't matter")
def test_element_id_is_valid_uuid(self):
import re
test_html = self.marionette.absolute_url("test.html")
self.marionette.navigate(test_html)
el = self.marionette.find_element(By.TAG_NAME, "body")
uuid_regex = re.compile('^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$')
self.assertIsNotNone(re.search(uuid_regex, el.id),
'UUID for the WebElement is not valid. ID is {}'\
.format(el.id))

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

@ -233,7 +233,8 @@ ElementManager.prototype = {
delete this.seenItems[i];
}
}
let id = uuidGen.generateUUID().toString();
let uuid = uuidGen.generateUUID().toString();
let id = uuid.substring(1, uuid.length - 1);
this.seenItems[id] = Components.utils.getWeakReference(element);
return id;
},

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

@ -6,7 +6,7 @@ import sys
from setuptools import setup
PACKAGE_NAME = 'mozprofile'
PACKAGE_VERSION = '0.26'
PACKAGE_VERSION = '0.27'
# we only support python 2 right now
assert sys.version_info[0] == 2

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

@ -43,7 +43,8 @@ def browser_kwargs(**kwargs):
"symbols_path": kwargs["symbols_path"],
"stackwalk_binary": kwargs["stackwalk_binary"],
"certutil_binary": kwargs["certutil_binary"],
"ca_certificate_path": kwargs["ssl_env"].ca_cert_path()}
"ca_certificate_path": kwargs["ssl_env"].ca_cert_path(),
"e10s": kwargs["gecko_e10s"]}
def executor_kwargs(test_type, server_config, cache_manager, run_info_data,
@ -69,7 +70,7 @@ class FirefoxBrowser(Browser):
def __init__(self, logger, binary, prefs_root, debug_info=None,
symbols_path=None, stackwalk_binary=None, certutil_binary=None,
ca_certificate_path=None):
ca_certificate_path=None, e10s=False):
Browser.__init__(self, logger)
self.binary = binary
self.prefs_root = prefs_root
@ -81,6 +82,7 @@ class FirefoxBrowser(Browser):
self.stackwalk_binary = stackwalk_binary
self.ca_certificate_path = ca_certificate_path
self.certutil_binary = certutil_binary
self.e10s = e10s
def start(self):
self.marionette_port = get_free_port(2828, exclude=self.used_ports)
@ -99,6 +101,8 @@ class FirefoxBrowser(Browser):
"marionette.defaultPrefs.port": self.marionette_port,
"dom.disable_open_during_load": False,
"network.dns.localDomains": ",".join(hostnames)})
if self.e10s:
self.profile.set_preferences({"browser.tabs.remote.autostart": True})
if self.ca_certificate_path is not None:
self.setup_ssl()

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

@ -154,6 +154,8 @@ def create_parser(product_choices=None):
gecko_group = parser.add_argument_group("Gecko-specific")
gecko_group.add_argument("--prefs-root", dest="prefs_root", action="store", type=abs_path,
help="Path to the folder containing browser prefs")
gecko_group.add_argument("--e10s", dest="gecko_e10s", action="store_true",
help="Path to the folder containing browser prefs")
b2g_group = parser.add_argument_group("B2G-specific")
b2g_group.add_argument("--b2g-no-backup", action="store_true", default=False,

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

@ -1049,6 +1049,10 @@
"path": "screen-orientation/page-visibility-manual.html",
"url": "/screen-orientation/page-visibility-manual.html"
},
{
"path": "selection/dir-manual.html",
"url": "/selection/dir-manual.html"
},
{
"path": "svg/import/animate-dom-01-f-manual.svg",
"url": "/svg/import/animate-dom-01-f-manual.svg"
@ -12143,22 +12147,6 @@
"path": "ambient-light/idlharness.html",
"url": "/ambient-light/idlharness.html"
},
{
"path": "animation-timing/callback-invoked.html",
"url": "/animation-timing/callback-invoked.html"
},
{
"path": "animation-timing/cancel-invoked.html",
"url": "/animation-timing/cancel-invoked.html"
},
{
"path": "animation-timing/idlharness.html",
"url": "/animation-timing/idlharness.html"
},
{
"path": "animation-timing/same-dispatch-time.html",
"url": "/animation-timing/same-dispatch-time.html"
},
{
"path": "battery-status/battery-interface-idlharness.html",
"url": "/battery-status/battery-interface-idlharness.html"
@ -13011,6 +12999,10 @@
"path": "dom/collections/HTMLCollection-empty-name.html",
"url": "/dom/collections/HTMLCollection-empty-name.html"
},
{
"path": "dom/collections/HTMLCollection-supported-property-names.html",
"url": "/dom/collections/HTMLCollection-supported-property-names.html"
},
{
"path": "dom/events/Event-constants.html",
"url": "/dom/events/Event-constants.html"
@ -15411,6 +15403,10 @@
"path": "html/dom/elements/global-attributes/the-translate-attribute-012.html",
"url": "/html/dom/elements/global-attributes/the-translate-attribute-012.html"
},
{
"path": "html/editing/activation/click.html",
"url": "/html/editing/activation/click.html"
},
{
"path": "html/editing/dnd/dom/draggable.html",
"url": "/html/editing/dnd/dom/draggable.html"
@ -17779,6 +17775,26 @@
"path": "html/syntax/serializing-html-fragments/outerHTML.html",
"url": "/html/syntax/serializing-html-fragments/outerHTML.html"
},
{
"path": "html/webappapis/animation-frames/callback-exception.html",
"url": "/html/webappapis/animation-frames/callback-exception.html"
},
{
"path": "html/webappapis/animation-frames/callback-invoked.html",
"url": "/html/webappapis/animation-frames/callback-invoked.html"
},
{
"path": "html/webappapis/animation-frames/cancel-invoked.html",
"url": "/html/webappapis/animation-frames/cancel-invoked.html"
},
{
"path": "html/webappapis/animation-frames/idlharness.html",
"url": "/html/webappapis/animation-frames/idlharness.html"
},
{
"path": "html/webappapis/animation-frames/same-dispatch-time.html",
"url": "/html/webappapis/animation-frames/same-dispatch-time.html"
},
{
"path": "html/webappapis/atob/base64.html",
"url": "/html/webappapis/atob/base64.html"
@ -18011,6 +18027,10 @@
"path": "js/builtins/Object.prototype.freeze.html",
"url": "/js/builtins/Object.prototype.freeze.html"
},
{
"path": "js/builtins/Object.prototype.getOwnPropertyNames.html",
"url": "/js/builtins/Object.prototype.getOwnPropertyNames.html"
},
{
"path": "js/builtins/Object.prototype.hasOwnProperty-order.html",
"url": "/js/builtins/Object.prototype.hasOwnProperty-order.html"
@ -24903,10 +24923,6 @@
"path": "selection/Document-open.html",
"url": "/selection/Document-open.html"
},
{
"path": "selection/addRange.html",
"url": "/selection/addRange.html"
},
{
"path": "selection/collapse.html",
"url": "/selection/collapse.html"
@ -24919,10 +24935,6 @@
"path": "selection/deleteFromDocument.html",
"url": "/selection/deleteFromDocument.html"
},
{
"path": "selection/dir.manual.html",
"url": "/selection/dir.manual.html"
},
{
"path": "selection/extend.html",
"url": "/selection/extend.html"
@ -25071,10 +25083,6 @@
"path": "shadow-dom/elements-and-dom-objects/the-content-html-element/test-003.html",
"url": "/shadow-dom/elements-and-dom-objects/the-content-html-element/test-003.html"
},
{
"path": "shadow-dom/elements-and-dom-objects/the-content-html-element/test-004.html",
"url": "/shadow-dom/elements-and-dom-objects/the-content-html-element/test-004.html"
},
{
"path": "shadow-dom/elements-and-dom-objects/the-content-html-element/test-005.html",
"url": "/shadow-dom/elements-and-dom-objects/the-content-html-element/test-005.html"
@ -25091,10 +25099,6 @@
"path": "shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-002.html",
"url": "/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-002.html"
},
{
"path": "shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-003.html",
"url": "/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-003.html"
},
{
"path": "shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-004.html",
"url": "/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-004.html"
@ -27491,6 +27495,10 @@
"path": "workers/semantics/encodings/004.html",
"url": "/workers/semantics/encodings/004.html"
},
{
"path": "workers/semantics/encodings/004.worker.js",
"url": "/workers/semantics/encodings/004.worker"
},
{
"path": "workers/semantics/interface-objects/001.worker.js",
"url": "/workers/semantics/interface-objects/001.worker"
@ -28767,6 +28775,11 @@
"timeout": "long",
"url": "/quirks-mode/hashless-hex-color.html"
},
{
"path": "selection/addRange.html",
"timeout": "long",
"url": "/selection/addRange.html"
},
{
"path": "service-workers/cache-storage/common.https.html",
"timeout": "long",
@ -29034,17 +29047,7 @@
},
"local_changes": {
"deleted": [],
"items": {
"testharness": {
"selection/addRange.html": [
{
"path": "selection/addRange.html",
"timeout": "long",
"url": "/selection/addRange.html"
}
]
}
},
"items": {},
"reftest_nodes": {}
},
"reftest_nodes": {
@ -34449,7 +34452,7 @@
}
]
},
"rev": "b54dddfdcc4761d2f8a892fd783d60353949992d",
"rev": "4600b7dbae996754fe52f48bc9c225834f11a686",
"url_base": "/",
"version": 2
}

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

@ -21,3 +21,33 @@
[XMLHttpRequest: send() - charset parameter of Content-Type 7]
expected: FAIL
[header with invalid MIME type is not changed]
expected: FAIL
[known charset but bogus header - missing MIME type]
expected: FAIL
[bogus charset and bogus header - missing MIME type]
expected: FAIL
[If no charset= param is given, implementation should not add one - unknown MIME]
expected: FAIL
[If no charset= param is given, implementation should not add one - known MIME]
expected: FAIL
[charset given but wrong, fix it (unknown MIME, bogus charset)]
expected: FAIL
[charset given but wrong, fix it (known MIME, bogus charset)]
expected: FAIL
[charset given but wrong, fix it (known MIME, actual charset)]
expected: FAIL
[If multiple charset parameters are given, all should be rewritten]
expected: FAIL
[No content type set, give MIME and charset]
expected: FAIL

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

@ -50,3 +50,4 @@
[EventTarget interface: calling dispatchEvent(Event) on navigator.getBattery() with too few arguments must throw TypeError]
expected: FAIL

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

@ -35,3 +35,4 @@
[onlevelchange: treat array as null]
expected: FAIL

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

@ -3,6 +3,3 @@
[Node.cloneNode]
expected: FAIL
[implementation.createHTMLDocument]
expected: FAIL

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

@ -1,3 +1,872 @@
[event.html]
type: testharness
expected: CRASH
[Simple editable div: beforeinput event, canceled]
expected: FAIL
[Simple editable div: input event, canceled]
expected: FAIL
[Simple editable div: beforeinput event, uncanceled]
expected: FAIL
[Simple editable div: input event, uncanceled]
expected: FAIL
[Editable b: execCommand() must not throw, canceled]
expected: FAIL
[Editable b: beforeinput event, canceled]
expected: FAIL
[Editable b: input event, canceled]
expected: FAIL
[Editable b: execCommand() must not throw, uncanceled]
expected: FAIL
[Editable b: beforeinput event, uncanceled]
expected: FAIL
[Editable b: input event, uncanceled]
expected: FAIL
[Changing selection from handler: beforeinput event, canceled]
expected: FAIL
[Changing selection from handler: input event, canceled]
expected: FAIL
[Changing selection from handler: beforeinput event, uncanceled]
expected: FAIL
[Changing selection from handler: input event, uncanceled]
expected: FAIL
[Command backColor, value "": beforeinput event, canceled]
expected: FAIL
[Command backColor, value "": beforeinput event, uncanceled]
expected: FAIL
[Command backColor, value "": input event, uncanceled]
expected: FAIL
[Command backColor, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command backColor, value "quasit": input event, canceled]
expected: FAIL
[Command backColor, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command backColor, value "quasit": input event, uncanceled]
expected: FAIL
[Command backColor, value "green": beforeinput event, canceled]
expected: FAIL
[Command backColor, value "green": input event, canceled]
expected: FAIL
[Command backColor, value "green": beforeinput event, uncanceled]
expected: FAIL
[Command backColor, value "green": input event, uncanceled]
expected: FAIL
[Command createLink, value "": beforeinput event, canceled]
expected: FAIL
[Command createLink, value "": beforeinput event, uncanceled]
expected: FAIL
[Command createLink, value "": input event, uncanceled]
expected: FAIL
[Command createLink, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command createLink, value "quasit": input event, canceled]
expected: FAIL
[Command createLink, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command createLink, value "quasit": input event, uncanceled]
expected: FAIL
[Command createLink, value "http://www.w3.org/community/editing/": beforeinput event, canceled]
expected: FAIL
[Command createLink, value "http://www.w3.org/community/editing/": input event, canceled]
expected: FAIL
[Command createLink, value "http://www.w3.org/community/editing/": beforeinput event, uncanceled]
expected: FAIL
[Command createLink, value "http://www.w3.org/community/editing/": input event, uncanceled]
expected: FAIL
[Command fontName, value "": beforeinput event, canceled]
expected: FAIL
[Command fontName, value "": beforeinput event, uncanceled]
expected: FAIL
[Command fontName, value "": input event, uncanceled]
expected: FAIL
[Command fontName, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command fontName, value "quasit": input event, canceled]
expected: FAIL
[Command fontName, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command fontName, value "quasit": input event, uncanceled]
expected: FAIL
[Command fontName, value "serif": beforeinput event, canceled]
expected: FAIL
[Command fontName, value "serif": beforeinput event, uncanceled]
expected: FAIL
[Command fontName, value "serif": input event, uncanceled]
expected: FAIL
[Command fontName, value "Helvetica": beforeinput event, canceled]
expected: FAIL
[Command fontName, value "Helvetica": input event, canceled]
expected: FAIL
[Command fontName, value "Helvetica": beforeinput event, uncanceled]
expected: FAIL
[Command fontName, value "Helvetica": input event, uncanceled]
expected: FAIL
[Command fontSize, value "": beforeinput event, canceled]
expected: FAIL
[Command fontSize, value "": beforeinput event, uncanceled]
expected: FAIL
[Command fontSize, value "": input event, uncanceled]
expected: FAIL
[Command fontSize, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command fontSize, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command fontSize, value "quasit": input event, uncanceled]
expected: FAIL
[Command fontSize, value "6": beforeinput event, canceled]
expected: FAIL
[Command fontSize, value "6": input event, canceled]
expected: FAIL
[Command fontSize, value "6": beforeinput event, uncanceled]
expected: FAIL
[Command fontSize, value "6": input event, uncanceled]
expected: FAIL
[Command fontSize, value "15px": beforeinput event, canceled]
expected: FAIL
[Command fontSize, value "15px": input event, canceled]
expected: FAIL
[Command fontSize, value "15px": beforeinput event, uncanceled]
expected: FAIL
[Command fontSize, value "15px": input event, uncanceled]
expected: FAIL
[Command foreColor, value "": beforeinput event, canceled]
expected: FAIL
[Command foreColor, value "": beforeinput event, uncanceled]
expected: FAIL
[Command foreColor, value "": input event, uncanceled]
expected: FAIL
[Command foreColor, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command foreColor, value "quasit": input event, canceled]
expected: FAIL
[Command foreColor, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command foreColor, value "quasit": input event, uncanceled]
expected: FAIL
[Command foreColor, value "green": beforeinput event, canceled]
expected: FAIL
[Command foreColor, value "green": input event, canceled]
expected: FAIL
[Command foreColor, value "green": beforeinput event, uncanceled]
expected: FAIL
[Command foreColor, value "green": input event, uncanceled]
expected: FAIL
[Command hiliteColor, value "": beforeinput event, canceled]
expected: FAIL
[Command hiliteColor, value "": beforeinput event, uncanceled]
expected: FAIL
[Command hiliteColor, value "": input event, uncanceled]
expected: FAIL
[Command hiliteColor, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command hiliteColor, value "quasit": input event, canceled]
expected: FAIL
[Command hiliteColor, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command hiliteColor, value "quasit": input event, uncanceled]
expected: FAIL
[Command hiliteColor, value "green": beforeinput event, canceled]
expected: FAIL
[Command hiliteColor, value "green": input event, canceled]
expected: FAIL
[Command hiliteColor, value "green": beforeinput event, uncanceled]
expected: FAIL
[Command hiliteColor, value "green": input event, uncanceled]
expected: FAIL
[Command italic, value "": beforeinput event, canceled]
expected: FAIL
[Command italic, value "": input event, canceled]
expected: FAIL
[Command italic, value "": beforeinput event, uncanceled]
expected: FAIL
[Command italic, value "": input event, uncanceled]
expected: FAIL
[Command italic, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command italic, value "quasit": input event, canceled]
expected: FAIL
[Command italic, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command italic, value "quasit": input event, uncanceled]
expected: FAIL
[Command removeFormat, value "": beforeinput event, canceled]
expected: FAIL
[Command removeFormat, value "": input event, canceled]
expected: FAIL
[Command removeFormat, value "": beforeinput event, uncanceled]
expected: FAIL
[Command removeFormat, value "": input event, uncanceled]
expected: FAIL
[Command removeFormat, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command removeFormat, value "quasit": input event, canceled]
expected: FAIL
[Command removeFormat, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command removeFormat, value "quasit": input event, uncanceled]
expected: FAIL
[Command strikeThrough, value "": beforeinput event, canceled]
expected: FAIL
[Command strikeThrough, value "": input event, canceled]
expected: FAIL
[Command strikeThrough, value "": beforeinput event, uncanceled]
expected: FAIL
[Command strikeThrough, value "": input event, uncanceled]
expected: FAIL
[Command strikeThrough, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command strikeThrough, value "quasit": input event, canceled]
expected: FAIL
[Command strikeThrough, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command strikeThrough, value "quasit": input event, uncanceled]
expected: FAIL
[Command subscript, value "": beforeinput event, canceled]
expected: FAIL
[Command subscript, value "": input event, canceled]
expected: FAIL
[Command subscript, value "": beforeinput event, uncanceled]
expected: FAIL
[Command subscript, value "": input event, uncanceled]
expected: FAIL
[Command subscript, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command subscript, value "quasit": input event, canceled]
expected: FAIL
[Command subscript, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command subscript, value "quasit": input event, uncanceled]
expected: FAIL
[Command superscript, value "": beforeinput event, canceled]
expected: FAIL
[Command superscript, value "": input event, canceled]
expected: FAIL
[Command superscript, value "": beforeinput event, uncanceled]
expected: FAIL
[Command superscript, value "": input event, uncanceled]
expected: FAIL
[Command superscript, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command superscript, value "quasit": input event, canceled]
expected: FAIL
[Command superscript, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command superscript, value "quasit": input event, uncanceled]
expected: FAIL
[Command underline, value "": beforeinput event, canceled]
expected: FAIL
[Command underline, value "": input event, canceled]
expected: FAIL
[Command underline, value "": beforeinput event, uncanceled]
expected: FAIL
[Command underline, value "": input event, uncanceled]
expected: FAIL
[Command underline, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command underline, value "quasit": input event, canceled]
expected: FAIL
[Command underline, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command underline, value "quasit": input event, uncanceled]
expected: FAIL
[Command unlink, value "": beforeinput event, canceled]
expected: FAIL
[Command unlink, value "": beforeinput event, uncanceled]
expected: FAIL
[Command unlink, value "": input event, uncanceled]
expected: FAIL
[Command unlink, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command unlink, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command unlink, value "quasit": input event, uncanceled]
expected: FAIL
[Command delete, value "": beforeinput event, canceled]
expected: FAIL
[Command delete, value "": input event, canceled]
expected: FAIL
[Command delete, value "": beforeinput event, uncanceled]
expected: FAIL
[Command delete, value "": input event, uncanceled]
expected: FAIL
[Command delete, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command delete, value "quasit": input event, canceled]
expected: FAIL
[Command delete, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command delete, value "quasit": input event, uncanceled]
expected: FAIL
[Command formatBlock, value "": beforeinput event, canceled]
expected: FAIL
[Command formatBlock, value "": beforeinput event, uncanceled]
expected: FAIL
[Command formatBlock, value "": input event, uncanceled]
expected: FAIL
[Command formatBlock, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command formatBlock, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command formatBlock, value "quasit": input event, uncanceled]
expected: FAIL
[Command formatBlock, value "p": beforeinput event, canceled]
expected: FAIL
[Command formatBlock, value "p": input event, canceled]
expected: FAIL
[Command formatBlock, value "p": beforeinput event, uncanceled]
expected: FAIL
[Command formatBlock, value "p": input event, uncanceled]
expected: FAIL
[Command forwardDelete, value "": beforeinput event, canceled]
expected: FAIL
[Command forwardDelete, value "": input event, canceled]
expected: FAIL
[Command forwardDelete, value "": beforeinput event, uncanceled]
expected: FAIL
[Command forwardDelete, value "": input event, uncanceled]
expected: FAIL
[Command forwardDelete, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command forwardDelete, value "quasit": input event, canceled]
expected: FAIL
[Command forwardDelete, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command forwardDelete, value "quasit": input event, uncanceled]
expected: FAIL
[Command indent, value "": beforeinput event, canceled]
expected: FAIL
[Command indent, value "": input event, canceled]
expected: FAIL
[Command indent, value "": beforeinput event, uncanceled]
expected: FAIL
[Command indent, value "": input event, uncanceled]
expected: FAIL
[Command indent, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command indent, value "quasit": input event, canceled]
expected: FAIL
[Command indent, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command indent, value "quasit": input event, uncanceled]
expected: FAIL
[Command insertHorizontalRule, value "": beforeinput event, canceled]
expected: FAIL
[Command insertHorizontalRule, value "": input event, canceled]
expected: FAIL
[Command insertHorizontalRule, value "": beforeinput event, uncanceled]
expected: FAIL
[Command insertHorizontalRule, value "": input event, uncanceled]
expected: FAIL
[Command insertHorizontalRule, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command insertHorizontalRule, value "quasit": input event, canceled]
expected: FAIL
[Command insertHorizontalRule, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command insertHorizontalRule, value "quasit": input event, uncanceled]
expected: FAIL
[Command insertHorizontalRule, value "id": beforeinput event, canceled]
expected: FAIL
[Command insertHorizontalRule, value "id": input event, canceled]
expected: FAIL
[Command insertHorizontalRule, value "id": beforeinput event, uncanceled]
expected: FAIL
[Command insertHorizontalRule, value "id": input event, uncanceled]
expected: FAIL
[Command insertHTML, value "": beforeinput event, canceled]
expected: FAIL
[Command insertHTML, value "": input event, canceled]
expected: FAIL
[Command insertHTML, value "": beforeinput event, uncanceled]
expected: FAIL
[Command insertHTML, value "": input event, uncanceled]
expected: FAIL
[Command insertHTML, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command insertHTML, value "quasit": input event, canceled]
expected: FAIL
[Command insertHTML, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command insertHTML, value "quasit": input event, uncanceled]
expected: FAIL
[Command insertHTML, value "<b>hi</b>": beforeinput event, canceled]
expected: FAIL
[Command insertHTML, value "<b>hi</b>": input event, canceled]
expected: FAIL
[Command insertHTML, value "<b>hi</b>": beforeinput event, uncanceled]
expected: FAIL
[Command insertHTML, value "<b>hi</b>": input event, uncanceled]
expected: FAIL
[Command insertImage, value "": beforeinput event, canceled]
expected: FAIL
[Command insertImage, value "": beforeinput event, uncanceled]
expected: FAIL
[Command insertImage, value "": input event, uncanceled]
expected: FAIL
[Command insertImage, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command insertImage, value "quasit": input event, canceled]
expected: FAIL
[Command insertImage, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command insertImage, value "quasit": input event, uncanceled]
expected: FAIL
[Command insertImage, value "../images/green.png": beforeinput event, canceled]
expected: FAIL
[Command insertImage, value "../images/green.png": input event, canceled]
expected: FAIL
[Command insertImage, value "../images/green.png": beforeinput event, uncanceled]
expected: FAIL
[Command insertImage, value "../images/green.png": input event, uncanceled]
expected: FAIL
[Command insertLineBreak, value "": beforeinput event, canceled]
expected: FAIL
[Command insertLineBreak, value "": beforeinput event, uncanceled]
expected: FAIL
[Command insertLineBreak, value "": input event, uncanceled]
expected: FAIL
[Command insertLineBreak, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command insertLineBreak, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command insertLineBreak, value "quasit": input event, uncanceled]
expected: FAIL
[Command insertOrderedList, value "": beforeinput event, canceled]
expected: FAIL
[Command insertOrderedList, value "": input event, canceled]
expected: FAIL
[Command insertOrderedList, value "": beforeinput event, uncanceled]
expected: FAIL
[Command insertOrderedList, value "": input event, uncanceled]
expected: FAIL
[Command insertOrderedList, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command insertOrderedList, value "quasit": input event, canceled]
expected: FAIL
[Command insertOrderedList, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command insertOrderedList, value "quasit": input event, uncanceled]
expected: FAIL
[Command insertParagraph, value "": beforeinput event, canceled]
expected: FAIL
[Command insertParagraph, value "": input event, canceled]
expected: FAIL
[Command insertParagraph, value "": beforeinput event, uncanceled]
expected: FAIL
[Command insertParagraph, value "": input event, uncanceled]
expected: FAIL
[Command insertParagraph, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command insertParagraph, value "quasit": input event, canceled]
expected: FAIL
[Command insertParagraph, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command insertParagraph, value "quasit": input event, uncanceled]
expected: FAIL
[Command insertText, value "": execCommand() must not throw, canceled]
expected: FAIL
[Command insertText, value "": beforeinput event, canceled]
expected: FAIL
[Command insertText, value "": execCommand() must not throw, uncanceled]
expected: FAIL
[Command insertText, value "": beforeinput event, uncanceled]
expected: FAIL
[Command insertText, value "": input event, uncanceled]
expected: FAIL
[Command insertText, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command insertText, value "quasit": input event, canceled]
expected: FAIL
[Command insertText, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command insertText, value "quasit": input event, uncanceled]
expected: FAIL
[Command insertText, value "abc": beforeinput event, canceled]
expected: FAIL
[Command insertText, value "abc": input event, canceled]
expected: FAIL
[Command insertText, value "abc": beforeinput event, uncanceled]
expected: FAIL
[Command insertText, value "abc": input event, uncanceled]
expected: FAIL
[Command insertUnorderedList, value "": beforeinput event, canceled]
expected: FAIL
[Command insertUnorderedList, value "": input event, canceled]
expected: FAIL
[Command insertUnorderedList, value "": beforeinput event, uncanceled]
expected: FAIL
[Command insertUnorderedList, value "": input event, uncanceled]
expected: FAIL
[Command insertUnorderedList, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command insertUnorderedList, value "quasit": input event, canceled]
expected: FAIL
[Command insertUnorderedList, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command insertUnorderedList, value "quasit": input event, uncanceled]
expected: FAIL
[Command justifyCenter, value "": beforeinput event, canceled]
expected: FAIL
[Command justifyCenter, value "": input event, canceled]
expected: FAIL
[Command justifyCenter, value "": beforeinput event, uncanceled]
expected: FAIL
[Command justifyCenter, value "": input event, uncanceled]
expected: FAIL
[Command justifyCenter, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command justifyCenter, value "quasit": input event, canceled]
expected: FAIL
[Command justifyCenter, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command justifyCenter, value "quasit": input event, uncanceled]
expected: FAIL
[Command justifyFull, value "": beforeinput event, canceled]
expected: FAIL
[Command justifyFull, value "": input event, canceled]
expected: FAIL
[Command justifyFull, value "": beforeinput event, uncanceled]
expected: FAIL
[Command justifyFull, value "": input event, uncanceled]
expected: FAIL
[Command justifyFull, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command justifyFull, value "quasit": input event, canceled]
expected: FAIL
[Command justifyFull, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command justifyFull, value "quasit": input event, uncanceled]
expected: FAIL
[Command justifyLeft, value "": beforeinput event, canceled]
expected: FAIL
[Command justifyLeft, value "": input event, canceled]
expected: FAIL
[Command justifyLeft, value "": beforeinput event, uncanceled]
expected: FAIL
[Command justifyLeft, value "": input event, uncanceled]
expected: FAIL
[Command justifyLeft, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command justifyLeft, value "quasit": input event, canceled]
expected: FAIL
[Command justifyLeft, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command justifyLeft, value "quasit": input event, uncanceled]
expected: FAIL
[Command justifyRight, value "": beforeinput event, canceled]
expected: FAIL
[Command justifyRight, value "": input event, canceled]
expected: FAIL
[Command justifyRight, value "": beforeinput event, uncanceled]
expected: FAIL
[Command justifyRight, value "": input event, uncanceled]
expected: FAIL
[Command justifyRight, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command justifyRight, value "quasit": input event, canceled]
expected: FAIL
[Command justifyRight, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command justifyRight, value "quasit": input event, uncanceled]
expected: FAIL
[Command outdent, value "": beforeinput event, canceled]
expected: FAIL
[Command outdent, value "": beforeinput event, uncanceled]
expected: FAIL
[Command outdent, value "": input event, uncanceled]
expected: FAIL
[Command outdent, value "quasit": beforeinput event, canceled]
expected: FAIL
[Command outdent, value "quasit": beforeinput event, uncanceled]
expected: FAIL
[Command outdent, value "quasit": input event, uncanceled]
expected: FAIL

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

@ -2,13 +2,15 @@
type: testharness
prefs: [media.mediasource.enabled:true]
[Demuxed content with different lengths]
expected: FAIL
expected:
if not debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86") and (bits == 32): PASS
if debug and (os == "win") and (version == "5.1.2600") and (processor == "x86") and (bits == 32): PASS
if not debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86_64") and (bits == 64): PASS
if debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86_64") and (bits == 64): PASS
if debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86") and (bits == 32): PASS
if not debug and (os == "win") and (version == "5.1.2600") and (processor == "x86") and (bits == 32): PASS
FAIL
[Muxed content with different lengths]
expected: FAIL
[Demuxed content with an empty buffered range on one SourceBuffer]
expected:
if os == "linux": FAIL
if (os == "win") and (version == "5.1.2600"): FAIL

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

@ -1,7 +1,7 @@
[opt-in-blocks.https.html]
type: testharness
disabled:
if debug and os == "linux": https://bugzilla.mozilla.org/show_bug.cgi?id=1184351
if debug and (os == "linux"): https://bugzilla.mozilla.org/show_bug.cgi?id=1184351
[opt_in_method: http-csp\n origin: same-host-http\n source_scheme: https\n context_nesting: top-level\n redirection: no-redirect\n subresource: picture-tag\n expectation: blocked]
expected:
if debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86_64") and (bits == 64): FAIL

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

@ -1 +1 @@
3fd466ba1167bbba529769448e96dd900b827296
ec39b5e1f451d12030abbb2bc95ea506a73aef73

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

@ -1,3 +0,0 @@
[dir.manual.html]
type: testharness
expected: TIMEOUT

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

@ -4,3 +4,4 @@
[Cache.match and Cache.matchAll]
expected: FAIL
bug: https://github.com/w3c/web-platform-tests/issues/2098

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

@ -4,3 +4,22 @@
[Cache.put with request URLs containing embedded credentials]
expected: FAIL
bug: https://github.com/w3c/web-platform-tests/issues/2098
[Cache.put called with Request and Response from fetch()]
expected: FAIL
[Cache.put with a Response containing an empty URL]
expected: FAIL
[Cache.put with HTTP 500 response]
expected: FAIL
[Cache.put called twice with matching Requests and different Responses]
expected: FAIL
[Cache.put called twice with request URLs that differ only by a fragment]
expected: FAIL
[Cache.put with a relative URL]
expected: FAIL

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

@ -1,3 +1,15 @@
[cache-storage-match.https.html]
type: testharness
prefs: [dom.serviceWorkers.enabled: true, dom.serviceWorkers.interception.enabled: true, dom.serviceWorkers.exemptFromPerDomainMax:true, dom.caches.enabled:true]
[CacheStorageMatch with no cache name provided]
expected: FAIL
[CacheStorageMatch from one of many caches]
expected: FAIL
[CacheStorageMatch from one of many caches by name]
expected: FAIL
[CacheStorageMatch a string request]
expected: FAIL

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

@ -4,3 +4,22 @@
[Cache.put with request URLs containing embedded credentials]
expected: FAIL
bug: https://github.com/w3c/web-platform-tests/issues/2098
[Cache.put called with Request and Response from fetch()]
expected: FAIL
[Cache.put with a Response containing an empty URL]
expected: FAIL
[Cache.put with HTTP 500 response]
expected: FAIL
[Cache.put called twice with matching Requests and different Responses]
expected: FAIL
[Cache.put called twice with request URLs that differ only by a fragment]
expected: FAIL
[Cache.put with a relative URL]
expected: FAIL

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

@ -1,3 +1,15 @@
[cache-storage-match.https.html]
type: testharness
prefs: [dom.caches.enabled:true]
[CacheStorageMatch with no cache name provided]
expected: FAIL
[CacheStorageMatch from one of many caches]
expected: FAIL
[CacheStorageMatch from one of many caches by name]
expected: FAIL
[CacheStorageMatch a string request]
expected: FAIL

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

@ -4,3 +4,22 @@
[Cache.put with request URLs containing embedded credentials]
expected: FAIL
bug: https://github.com/w3c/web-platform-tests/issues/2098
[Cache.put called with Request and Response from fetch()]
expected: FAIL
[Cache.put with a Response containing an empty URL]
expected: FAIL
[Cache.put with HTTP 500 response]
expected: FAIL
[Cache.put called twice with matching Requests and different Responses]
expected: FAIL
[Cache.put called twice with request URLs that differ only by a fragment]
expected: FAIL
[Cache.put with a relative URL]
expected: FAIL

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

@ -1,3 +1,15 @@
[cache-storage-match.https.html]
type: testharness
prefs: [dom.caches.enabled:true]
[CacheStorageMatch with no cache name provided]
expected: FAIL
[CacheStorageMatch from one of many caches]
expected: FAIL
[CacheStorageMatch from one of many caches by name]
expected: FAIL
[CacheStorageMatch a string request]
expected: FAIL

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

@ -1,8 +0,0 @@
[test-004.html]
type: testharness
[A_10_04_04_T01]
expected: FAIL
[A_10_04_04_T02]
expected: FAIL

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

@ -1,8 +0,0 @@
[test-003.html]
type: testharness
[A_10_05_03_T01]
expected: FAIL
[A_10_05_03_T02]
expected: FAIL

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

@ -1,17 +0,0 @@
[test-001.html]
type: testharness
[A_05_05_01_T03]
expected: FAIL
[A_05_05_01_T04]
expected: FAIL
[A_05_05_01_T05]
expected: FAIL
[A_05_05_01_T06]
expected: FAIL
[A_05_05_01_T07]
expected: FAIL

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

@ -1,20 +0,0 @@
[test-004.html]
type: testharness
[A_05_01_04_T03]
expected: FAIL
[A_05_01_04_T04]
expected: FAIL
[A_05_01_04_T05]
expected: FAIL
[A_05_01_04_T06]
expected: FAIL
[A_05_01_04_T07]
expected: FAIL
[A_05_01_04_T12]
expected: FAIL

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

@ -4,3 +4,6 @@
disabled:
if not debug and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): https://bugzilla.mozilla.org/show_bug.cgi?id=1125161
[The argument -4043309056 should be interpreted as 0 for ArrayBuffer constructor.10]
expected: FAIL

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

@ -435,3 +435,30 @@
[The argument object "[object Object\]" (18) should be interpreted as 0 for interface Float64Array.]
expected: FAIL
[The argument -4043309056 (10) should be interpreted as 0 for interface Int8Array.]
expected: FAIL
[The argument -4043309056 (10) should be interpreted as 0 for interface Uint8Array.]
expected: FAIL
[The argument -4043309056 (10) should be interpreted as 0 for interface Uint8ClampedArray.]
expected: FAIL
[The argument -4043309056 (10) should be interpreted as 0 for interface Int16Array.]
expected: FAIL
[The argument -4043309056 (10) should be interpreted as 0 for interface Uint16Array.]
expected: FAIL
[The argument -4043309056 (10) should be interpreted as 0 for interface Int32Array.]
expected: FAIL
[The argument -4043309056 (10) should be interpreted as 0 for interface Uint32Array.]
expected: FAIL
[The argument -4043309056 (10) should be interpreted as 0 for interface Float32Array.]
expected: FAIL
[The argument -4043309056 (10) should be interpreted as 0 for interface Float64Array.]
expected: FAIL

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

@ -501,3 +501,6 @@
[Parsing: <sc:\\../> against <about:blank>]
expected: FAIL
[Parsing: <file:..> against <http://www.example.com/test>]
expected: FAIL

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

@ -519,3 +519,6 @@
[Parsing: <sc:\\../> against <about:blank>]
expected: FAIL
[Parsing: <file:..> against <http://www.example.com/test>]
expected: FAIL

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

@ -420,3 +420,6 @@
[Parsing: <sc:\\../> against <about:blank>]
expected: FAIL
[Parsing: <file:..> against <http://www.example.com/test>]
expected: FAIL

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

@ -1,6 +1,5 @@
[fetch-event-async-respond-with.https.html]
type: testharness
expected: OK
[Calling respondWith asynchronously throws an exception]
expected: FAIL

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

@ -144,4 +144,10 @@ Object.keys(expected).forEach(function(iface) {
assert_props(iface, event, false);
}, iface + " constructor (argument with non-default values)");
});
test(function () {
assert_throws(new TypeError(), function() {
new UIEvent("x", { view: 7 })
});
}, "UIEvent constructor (view argument with wrong type)")
</script>

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

@ -166,7 +166,7 @@ The way to contribute is just as usual:
* Fork this repository (and make sure you're still relatively in sync
with it if you forked a while ago).
* Create a branch for your changes:
`git checkout -b your-name/topic`.
`git checkout -b topic`.
* Make your changes.
* Run the lint script described below.
* Commit locally and push that to your repo.

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

@ -10,7 +10,8 @@
<body>
<div id="log"></div>
<script>
function request(input, output) {
function request(input, output, title) {
title = title || document.title + ' - ' + input;
test(function() {
var client = new XMLHttpRequest()
client.open("POST", "resources/content.py", false)
@ -19,39 +20,63 @@
client.send("TEST")
assert_equals(client.responseText, "TEST")
assert_equals(client.getResponseHeader("x-request-content-type"), output)
})
}, title)
}
request(
"text/x-pink-unicorn; charset=windows-1252; charset=bogus; notrelated; charset=ascii",
"text/x-pink-unicorn; charset=UTF-8; charset=UTF-8; notrelated; charset=UTF-8"
)
request(
"text; charset=ascii",
"text; charset=ascii"
"text; charset=ascii",
"header with invalid MIME type is not changed"
)
request(
"charset=ascii",
"charset=ascii"
"charset=ascii",
"known charset but bogus header - missing MIME type"
)
request(
"text/x-thepiano;charset= waddup",
"text/x-thepiano;charset=UTF-8"
)
request(
"text/x-pink-unicorn",
"text/x-pink-unicorn"
"charset=bogus",
"charset=bogus",
"bogus charset and bogus header - missing MIME type"
)
request(
"text/plain;charset=utf-8",
"text/plain;charset=utf-8"
"text/plain;charset=utf-8",
"Correct text/plain MIME with charset"
)
request(
"text/x-pink-unicorn",
"text/x-pink-unicorn",
"If no charset= param is given, implementation should not add one - unknown MIME"
)
request(
"text/plain",
"text/plain",
"If no charset= param is given, implementation should not add one - known MIME"
)
request(
"text/x-thepiano;charset= waddup",
"text/x-thepiano;charset=UTF-8",
"charset given but wrong, fix it (unknown MIME, bogus charset)"
)
request( /**/
"text/plain;charset=utf-8;charset=waddup",
"text/plain;charset=UTF-8;charset=UTF-8"
"text/plain;charset=UTF-8;charset=UTF-8",
"charset given but wrong, fix it (known MIME, bogus charset)"
)
request(
"text/plain;charset=shift-jis",
"text/plain;charset=UTF-8",
"charset given but wrong, fix it (known MIME, actual charset)"
)
request(
"text/x-pink-unicorn; charset=windows-1252; charset=bogus; notrelated; charset=ascii",
"text/x-pink-unicorn; charset=UTF-8; charset=UTF-8; notrelated; charset=UTF-8",
"If multiple charset parameters are given, all should be rewritten"
)
request(
null,
"text/plain;charset=UTF-8"
"text/plain;charset=UTF-8",
"No content type set, give MIME and charset"
)
</script>
</body>

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

@ -0,0 +1,54 @@
<!doctype html>
<meta charset=utf-8>
<link rel=help href=https://dom.spec.whatwg.org/#interface-htmlcollection>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<!-- with no attribute -->
<span></span>
<!-- with `id` attribute -->
<span id=''></span>
<span id='some-id'></span>
<span id='some-id'></span><!-- to ensure no duplicates -->
<!-- with `name` attribute -->
<span name=''></span>
<span name='some-name'></span>
<span name='some-name'></span><!-- to ensure no duplicates -->
<!-- with `name` and `id` attribute -->
<span id='another-id' name='another-name'></span>
<script>
test(function () {
var elements = document.getElementsByTagName("span");
assert_array_equals(
Object.getOwnPropertyNames(elements),
['0', '1', '2', '3', '4', '5', '6', '7', 'some-id', 'some-name', 'another-id', 'another-name']
);
}, 'Object.getOwnPropertyNames on HTMLCollection');
test(function () {
var elem = document.createElementNS('some-random-namespace', 'foo');
this.add_cleanup(function () {elem.remove();});
elem.setAttribute("name", "some-name");
document.body.appendChild(elem);
var elements = document.getElementsByTagName("foo");
assert_array_equals(Object.getOwnPropertyNames(elements), ['0']);
}, 'Object.getOwnPropertyNames on HTMLCollection with non-HTML namespace');
test(function () {
var elem = document.createElement('foo');
this.add_cleanup(function () {elem.remove();});
document.body.appendChild(elem);
var elements = document.getElementsByTagName("foo");
elements.someProperty = "some value";
assert_array_equals(Object.getOwnPropertyNames(elements), ['0', 'someProperty']);
}, 'Object.getOwnPropertyNames on HTMLCollection with expando object');
</script>

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

@ -237,7 +237,7 @@ test(function() {
var html = document.implementation.createHTMLDocument("title");
var copy = html.cloneNode();
check_copy(html, copy, Document);
assert_equals(html.title, copy.title);
assert_equals(copy.title, "");
}, "implementation.createHTMLDocument");
test(function() {

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

@ -129,7 +129,7 @@ var commandTests = {
indent: [],
insertHorizontalRule: ["id"],
insertHTML: ["<b>hi</b>"],
insertImage: ["http://example.com/some-image"],
insertImage: ["../images/green.png"],
insertLineBreak: [],
insertOrderedList: [],
insertParagraph: [],

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

@ -0,0 +1,18 @@
<!doctype html>
<meta charset=utf-8>
<title>HTMLElement#click</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<script>
test(function() {
var element = document.createElement("div");
var received = false;
element.addEventListener("click", this.step_func(function(e) {
received = true;
assert_false(e.isTrusted, "Event should not be trusted")
}));
element.click();
assert_true(received, "click event should have been dispatched synchronously");
})
</script>

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

@ -25,6 +25,10 @@
var base = document.createElement("base");
base.setAttribute("href", "/foo/bar");
document.head.appendChild(base);
t1.add_cleanup(function () {
document.head.removeChild(base);
});
assert_resolve_url(document, location.href.replace(location.pathname, "/foo"));
assert_equals(document.baseURI, base.href, "The document base URL should be URL of the first base element that has an href attribute.");
});
@ -55,10 +59,10 @@
var iframe = document.createElement("iframe");
iframe.onload = this.step_func_done(function () {
var doc = iframe.contentDocument;
var base = doc.body.appendChild(document.createElement("base"));
var base = doc.body.appendChild(doc.createElement("base"));
base.href = "sub/";
assert_resolve_url(doc, location.href.replace("/document-base-url.html", "/sub"));
assert_equals(doc.baseURI, document.baseURI);
assert_equals(doc.baseURI, document.baseURI.replace("/document-base-url.html", "/sub/"));
});
iframe.setAttribute("src", "about:blank");
document.body.appendChild(iframe);

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

@ -0,0 +1,27 @@
<!doctype html>
<html>
<head>
<title>requestAnimationFrame callback exception reported to error handler</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="help" href="https://w3c.github.io/web-performance/specs/RequestAnimationFrame/Overview.html#dom-windowanimationtiming-requestanimationframe"/>
</head>
<body>
<div id="log"></div>
<script>
var custom_exception = 'requestAnimationFrameException';
setup({allow_uncaught_exception : true});
async_test(function (t) {
addEventListener("error",function(e) {
t.step(function() {
assert_equals(e.error.message, custom_exception);
t.done();
})
});
window.requestAnimationFrame(function () {
throw new Error(custom_exception);
});
}, "requestAnimationFrame callback exceptions are reported to error handler");
</script>
</body>
</html>

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

@ -0,0 +1,56 @@
<!doctype html>
<title>Object.prototype.getOwnPropertyNames</title>
<link rel=help href=http://es5.github.io/#x15.2.3.4>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<script>
test(function () {
var obj = {0: 'a', 1: 'b', 2: 'c'};
assert_array_equals(
Object.getOwnPropertyNames(obj).sort(),
['0', '1', '2']
);
}, "object");
test(function () {
var arr = ['a', 'b', 'c'];
assert_array_equals(
Object.getOwnPropertyNames(arr).sort(),
['0', '1', '2', 'length']
);
}, "array-like");
test(function () {
var obj = Object.create({}, {
getFoo: {
value: function() { return this.foo; },
enumerable: false
}
});
obj.foo = 1;
assert_array_equals(
Object.getOwnPropertyNames(obj).sort(),
['foo', 'getFoo']
);
}, "non-enumerable property");
test(function() {
function ParentClass() {}
ParentClass.prototype.inheritedMethod = function() {};
function ChildClass() {
this.prop = 5;
this.method = function() {};
}
ChildClass.prototype = new ParentClass;
ChildClass.prototype.prototypeMethod = function() {};
var obj = new ChildClass;
assert_array_equals(
Object.getOwnPropertyNames(obj).sort(),
['method', 'prop']
);
}, 'items on the prototype chain are not listed');
</script>

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

@ -15,12 +15,12 @@
var manifestFilenameB = subType + "/test-v-128k-320x240-30fps-10kfr-manifest.json";
var expectationsA = {
webm: "{ [0.000, 2.022) }",
webm: "{ [0.000, 2.023) }",
mp4: "{ [0.000, 2.043) }",
};
var expectationsB = {
webm: "{ [0.000, 2.000) }",
webm: "{ [0.000, 2.001) }",
mp4: "{ [0.000, 2.000) }",
};
@ -99,7 +99,7 @@
test.waitForExpectedEvents(function()
{
var expectationsAV = {
webm: ["{ [0.000, 2.003) }", "{ [0.000, 2.022) }"],
webm: ["{ [0.000, 2.003) }", "{ [0.000, 2.023) }"],
mp4: ["{ [0.000, 2.000) }", "{ [0.000, 2.043) }"],
};

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

@ -32,132 +32,69 @@ function assert_promise_rejects(promise, code, description) {
});
}
// Asserts that two objects |actual| and |expected| are weakly equal under the
// following definition:
// Helper for testing with Headers objects. Compares Headers instances
// by serializing |expected| and |actual| to arrays and comparing.
function assert_header_equals(actual, expected, description) {
assert_class_string(actual, "Headers", description);
var header, actual_headers = [], expected_headers = [];
for (header of actual)
actual_headers.push(header[0] + ": " + header[1]);
for (header of expected)
expected_headers.push(header[0] + ": " + header[1]);
assert_array_equals(actual_headers, expected_headers,
description + " Headers differ.");
}
// Helper for testing with Response objects. Compares simple
// attributes defined on the interfaces, as well as the headers. It
// does not compare the response bodies.
function assert_response_equals(actual, expected, description) {
assert_class_string(actual, "Response", description);
["type", "url", "status", "ok", "statusText"].forEach(function(attribute) {
assert_equals(actual[attribute], expected[attribute],
description + " Attributes differ: " + attribute + ".");
});
assert_header_equals(actual.headers, expected.headers, description);
}
// Assert that the two arrays |actual| and |expected| contain the same
// set of Responses as determined by assert_response_equals. The order
// is not significant.
//
// |a| and |b| are weakly equal if any of the following are true:
// 1. If |a| is not an 'object', and |a| === |b|.
// 2. If |a| is an 'object', and all of the following are true:
// 2.1 |a.p| is weakly equal to |b.p| for all own properties |p| of |a|.
// 2.2 Every own property of |b| is an own property of |a|.
//
// This is a replacement for the the version of assert_object_equals() in
// testharness.js. The latter doesn't handle own properties correctly. I.e. if
// |a.p| is not an own property, it still requires that |b.p| be an own
// property.
//
// Note that |actual| must not contain cyclic references.
self.assert_object_equals = function(actual, expected, description) {
var object_stack = [];
// |expected| is assumed to not contain any duplicates.
function assert_response_array_equivalent(actual, expected, description) {
assert_true(Array.isArray(actual), description);
assert_equals(actual.length, expected.length, description);
expected.forEach(function(expected_element) {
// assert_response_in_array treats the first argument as being
// 'actual', and the second as being 'expected array'. We are
// switching them around because we want to be resilient
// against the |actual| array containing duplicates.
assert_response_in_array(expected_element, actual, description);
});
}
function _is_equal(actual, expected, prefix) {
if (typeof actual !== 'object') {
assert_equals(actual, expected, prefix);
return;
}
assert_true(typeof expected === 'object', prefix);
assert_equals(object_stack.indexOf(actual), -1,
prefix + ' must not contain cyclic references.');
// Asserts that two arrays |actual| and |expected| contain the same
// set of Responses as determined by assert_response_equals(). The
// corresponding elements must occupy corresponding indices in their
// respective arrays.
function assert_response_array_equals(actual, expected, description) {
assert_true(Array.isArray(actual), description);
assert_equals(actual.length, expected.length, description);
actual.forEach(function(value, index) {
assert_response_equals(value, expected[index],
description + " : object[" + index + "]");
});
}
object_stack.push(actual);
Object.getOwnPropertyNames(expected).forEach(function(property) {
assert_own_property(actual, property, prefix);
_is_equal(actual[property], expected[property],
prefix + '.' + property);
});
Object.getOwnPropertyNames(actual).forEach(function(property) {
assert_own_property(expected, property, prefix);
});
object_stack.pop();
}
function _brand(object) {
return Object.prototype.toString.call(object).match(/^\[object (.*)\]$/)[1];
}
_is_equal(actual, expected,
(description ? description + ': ' : '') + _brand(expected));
};
// Equivalent to assert_in_array, but uses a weaker equivalence relation
// (assert_object_equals) than '==='.
function assert_object_in_array(actual, expected_array, description) {
assert_true(expected_array.some(function(element) {
try {
assert_object_equals(actual, element);
return true;
} catch (e) {
return false;
}
// Equivalent to assert_in_array, but uses assert_response_equals.
function assert_response_in_array(actual, expected_array, description) {
assert_true(expected_array.some(function(element) {
try {
assert_response_equals(actual, element);
return true;
} catch (e) {
return false;
}
}), description);
}
// Assert that the two arrays |actual| and |expected| contain the same set of
// elements as determined by assert_object_equals. The order is not significant.
//
// |expected| is assumed to not contain any duplicates as determined by
// assert_object_equals().
function assert_array_equivalent(actual, expected, description) {
assert_true(Array.isArray(actual), description);
assert_equals(actual.length, expected.length, description);
expected.forEach(function(expected_element) {
// assert_in_array treats the first argument as being 'actual', and the
// second as being 'expected array'. We are switching them around because
// we want to be resilient against the |actual| array containing
// duplicates.
assert_object_in_array(expected_element, actual, description);
});
}
// Asserts that two arrays |actual| and |expected| contain the same set of
// elements as determined by assert_object_equals(). The corresponding elements
// must occupy corresponding indices in their respective arrays.
function assert_array_objects_equals(actual, expected, description) {
assert_true(Array.isArray(actual), description);
assert_equals(actual.length, expected.length, description);
actual.forEach(function(value, index) {
assert_object_equals(value, expected[index],
description + ' : object[' + index + ']');
});
}
// Asserts that |object| that is an instance of some interface has the attribute
// |attribute_name| following the conditions specified by WebIDL, but it's
// acceptable that the attribute |attribute_name| is an own property of the
// object because we're in the middle of moving the attribute to a prototype
// chain. Once we complete the transition to prototype chains,
// assert_will_be_idl_attribute must be replaced with assert_idl_attribute
// defined in testharness.js.
//
// FIXME: Remove assert_will_be_idl_attribute once we complete the transition
// of moving the DOM attributes to prototype chains. (http://crbug.com/43394)
function assert_will_be_idl_attribute(object, attribute_name, description) {
assert_true(typeof object === "object", description);
assert_true("hasOwnProperty" in object, description);
// Do not test if |attribute_name| is not an own property because
// |attribute_name| is in the middle of the transition to a prototype
// chain. (http://crbug.com/43394)
assert_true(attribute_name in object, description);
}
// Stringifies a DOM object. This function stringifies not only own properties
// but also DOM attributes which are on a prototype chain. Note that
// JSON.stringify only stringifies own properties.
function stringifyDOMObject(object)
{
function deepCopy(src) {
if (typeof src != "object")
return src;
var dst = Array.isArray(src) ? [] : {};
for (var property in src) {
dst[property] = deepCopy(src[property]);
}
return dst;
}
return JSON.stringify(deepCopy(object));
}

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

@ -109,7 +109,7 @@ var vary_entries = [
prepopulated_cache_test(simple_entries, function(cache, entries) {
return cache.matchAll('not-present-in-the-cache')
.then(function(result) {
assert_array_equivalent(
assert_response_array_equivalent(
result, [],
'Cache.matchAll should resolve with an empty array on failure.');
});
@ -126,23 +126,23 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
prepopulated_cache_test(simple_entries, function(cache, entries) {
return cache.matchAll(entries.a.request.url)
.then(function(result) {
assert_array_objects_equals(result, [entries.a.response],
'Cache.matchAll should match by URL.');
assert_response_array_equals(result, [entries.a.response],
'Cache.matchAll should match by URL.');
});
}, 'Cache.matchAll with URL');
prepopulated_cache_test(simple_entries, function(cache, entries) {
return cache.match(entries.a.request.url)
.then(function(result) {
assert_object_equals(result, entries.a.response,
'Cache.match should match by URL.');
assert_response_equals(result, entries.a.response,
'Cache.match should match by URL.');
});
}, 'Cache.match with URL');
prepopulated_cache_test(simple_entries, function(cache, entries) {
return cache.matchAll(entries.a.request)
.then(function(result) {
assert_array_objects_equals(
assert_response_array_equals(
result, [entries.a.response],
'Cache.matchAll should match by Request.');
});
@ -151,15 +151,15 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
prepopulated_cache_test(simple_entries, function(cache, entries) {
return cache.match(entries.a.request)
.then(function(result) {
assert_object_equals(result, entries.a.response,
'Cache.match should match by Request.');
assert_response_equals(result, entries.a.response,
'Cache.match should match by Request.');
});
}, 'Cache.match with Request');
prepopulated_cache_test(simple_entries, function(cache, entries) {
return cache.matchAll(new Request(entries.a.request.url))
.then(function(result) {
assert_array_objects_equals(
assert_response_array_equals(
result, [entries.a.response],
'Cache.matchAll should match by Request.');
});
@ -168,8 +168,8 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
prepopulated_cache_test(simple_entries, function(cache, entries) {
return cache.match(new Request(entries.a.request.url))
.then(function(result) {
assert_object_equals(result, entries.a.response,
'Cache.match should match by Request.');
assert_response_equals(result, entries.a.response,
'Cache.match should match by Request.');
});
}, 'Cache.match with new Request');
@ -177,7 +177,7 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
return cache.matchAll(entries.a.request,
{ignoreSearch: true})
.then(function(result) {
assert_array_equivalent(
assert_response_array_equivalent(
result,
[
entries.a.response,
@ -194,7 +194,7 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
return cache.match(entries.a.request,
{ignoreSearch: true})
.then(function(result) {
assert_object_in_array(
assert_response_in_array(
result,
[
entries.a.response,
@ -211,7 +211,7 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
return cache.matchAll(entries.a_with_query.request,
{ignoreSearch: true})
.then(function(result) {
assert_array_equivalent(
assert_response_array_equivalent(
result,
[
entries.a.response,
@ -227,7 +227,7 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
return cache.match(entries.a_with_query.request,
{ignoreSearch: true})
.then(function(result) {
assert_object_in_array(
assert_response_in_array(
result,
[
entries.a.response,
@ -242,7 +242,7 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
prepopulated_cache_test(simple_entries, function(cache, entries) {
return cache.matchAll(entries.cat.request.url + '#mouse')
.then(function(result) {
assert_array_equivalent(
assert_response_array_equivalent(
result,
[
entries.cat.response,
@ -254,15 +254,15 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
prepopulated_cache_test(simple_entries, function(cache, entries) {
return cache.match(entries.cat.request.url + '#mouse')
.then(function(result) {
assert_object_equals(result, entries.cat.response,
'Cache.match should ignore URL fragment.');
assert_response_equals(result, entries.cat.response,
'Cache.match should ignore URL fragment.');
});
}, 'Cache.match with URL containing fragment');
prepopulated_cache_test(simple_entries, function(cache, entries) {
return cache.matchAll('http')
.then(function(result) {
assert_array_equivalent(
assert_response_array_equivalent(
result, [],
'Cache.matchAll should treat query as a URL and not ' +
'just a string fragment.');
@ -282,7 +282,7 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
prepopulated_cache_test(simple_entries, function(cache, entries) {
return cache.matchAll(entries.secret_cat.request.url)
.then(function(result) {
assert_array_equivalent(
assert_response_array_equivalent(
result, [entries.secret_cat.response],
'Cache.matchAll should not ignore embedded credentials');
});
@ -291,7 +291,7 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
prepopulated_cache_test(simple_entries, function(cache, entries) {
return cache.match(entries.secret_cat.request.url)
.then(function(result) {
assert_object_equals(
assert_response_equals(
result, entries.secret_cat.response,
'Cache.match should not ignore embedded credentials');
});
@ -300,7 +300,7 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
prepopulated_cache_test(vary_entries, function(cache, entries) {
return cache.matchAll('http://example.com/c')
.then(function(result) {
assert_array_equivalent(
assert_response_array_equivalent(
result,
[
entries.vary_cookie_absent.response
@ -316,7 +316,7 @@ prepopulated_cache_test(vary_entries, function(cache, entries) {
{headers: {'Cookies': 'none-of-the-above'}}));
})
.then(function(result) {
assert_array_equivalent(
assert_response_array_equivalent(
result,
[
],
@ -331,7 +331,7 @@ prepopulated_cache_test(vary_entries, function(cache, entries) {
{headers: {'Cookies': 'is-for-cookie'}}));
})
.then(function(result) {
assert_array_equivalent(
assert_response_array_equivalent(
result,
[entries.vary_cookie_is_cookie.response],
'Cache.matchAll should match the entire header if a vary header ' +
@ -342,7 +342,7 @@ prepopulated_cache_test(vary_entries, function(cache, entries) {
prepopulated_cache_test(vary_entries, function(cache, entries) {
return cache.match('http://example.com/c')
.then(function(result) {
assert_object_in_array(
assert_response_in_array(
result,
[
entries.vary_cookie_absent.response
@ -355,7 +355,7 @@ prepopulated_cache_test(vary_entries, function(cache, entries) {
return cache.matchAll('http://example.com/c',
{ignoreVary: true})
.then(function(result) {
assert_array_equivalent(
assert_response_array_equivalent(
result,
[
entries.vary_cookie_is_cookie.response,
@ -383,7 +383,7 @@ cache_test(function(cache) {
return cache.match(request.url);
})
.then(function(result) {
assert_object_equals(
assert_response_equals(
result, response,
'Cache.match should return a Response object that has the same ' +
'properties as the stored response.');

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

@ -30,9 +30,9 @@ cache_test(function(cache) {
return cache.match(test_url);
})
.then(function(result) {
assert_object_equals(result, response,
'Cache.put should update the cache with ' +
'new request and response.');
assert_response_equals(result, response,
'Cache.put should update the cache with ' +
'new request and response.');
return result.text();
})
.then(function(body) {
@ -75,9 +75,9 @@ cache_test(function(cache) {
return cache.match(test_url);
})
.then(function(result) {
assert_object_equals(result, response,
'Cache.put should update the cache with ' +
'new Request and Response.');
assert_response_equals(result, response,
'Cache.put should update the cache with ' +
'new Request and Response.');
});
}, 'Cache.put with a Response containing an empty URL');
@ -118,9 +118,9 @@ cache_test(function(cache) {
return cache.match(test_url);
})
.then(function(result) {
assert_object_equals(result, response,
'Cache.put should update the cache with ' +
'new request and response.');
assert_response_equals(result, response,
'Cache.put should update the cache with ' +
'new request and response.');
return result.text();
})
.then(function(body) {
@ -142,9 +142,9 @@ cache_test(function(cache) {
return cache.match(test_url);
})
.then(function(result) {
assert_object_equals(result, alternate_response,
'Cache.put should replace existing ' +
'response with new response.');
assert_response_equals(result, alternate_response,
'Cache.put should replace existing ' +
'response with new response.');
return result.text();
})
.then(function(body) {
@ -168,9 +168,9 @@ cache_test(function(cache) {
return cache.match(test_url);
})
.then(function(result) {
assert_object_equals(result, alternate_response,
'Cache.put should replace existing ' +
'response with new response.');
assert_response_equals(result, alternate_response,
'Cache.put should replace existing ' +
'response with new response.');
return result.text();
})
.then(function(body) {
@ -248,9 +248,9 @@ cache_test(function(cache) {
return cache.match(new URL('relative-url', location.href).href);
})
.then(function(result) {
assert_object_equals(result, response,
'Cache.put should accept a relative URL ' +
'as the request.');
assert_response_equals(result, response,
'Cache.put should accept a relative URL ' +
'as the request.');
});
}, 'Cache.put with a relative URL');

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

@ -30,8 +30,8 @@ cache_test(function(cache) {
return self.caches.match(transaction.request);
})
.then(function(response) {
assert_object_equals(response, transaction.response,
'The response should not have changed.');
assert_response_equals(response, transaction.response,
'The response should not have changed.');
});
}, 'CacheStorageMatch with no cache name provided');
@ -49,8 +49,8 @@ cache_test(function(cache) {
return self.caches.match(transaction.request);
})
.then(function(response) {
assert_object_equals(response, transaction.response,
'The response should not have changed.');
assert_response_equals(response, transaction.response,
'The response should not have changed.');
});
}, 'CacheStorageMatch from one of many caches');
@ -70,8 +70,8 @@ promise_test(function(test) {
return self.caches.match(transaction.request, {cacheName: 'x'});
})
.then(function(response) {
assert_object_equals(response, transaction.response,
'The response should not have changed.');
assert_response_equals(response, transaction.response,
'The response should not have changed.');
})
.then(function() {
return self.caches.match(transaction.request, {cacheName: 'y'});
@ -89,8 +89,8 @@ cache_test(function(cache) {
return self.caches.match(transaction.request);
})
.then(function(response) {
assert_object_equals(response, transaction.response,
'The response should not have changed.');
assert_response_equals(response, transaction.response,
'The response should not have changed.');
});
}, 'CacheStorageMatch a string request');

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

@ -1,163 +0,0 @@
<!DOCTYPE html>
<!--
Distributed under both the W3C Test Suite License [1] and the W3C
3-clause BSD License [2]. To contribute to a W3C Test Suite, see the
policies and contribution forms [3].
[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license
[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license
[3] http://www.w3.org/2004/10/27-testcases
-->
<html>
<head>
<title>Shadow DOM Test: A_10_04_04</title>
<link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
<link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#content-element">
<meta name="assert" content="The content HTML element: reset-style-inheritance attribute">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../testcommon.js"></script>
<link rel="stylesheet" href="/resources/testharness.css">
</head>
<body>
<div id="log"></div>
<script>
test(unit(function (ctx) {
var d = newRenderedHTMLDocument(ctx);
d.body.innerHTML =
'<ul id="shHost">' +
'<li id="li1" class="shadow">1</li>' +
'<li id="li2" class="shadow2">2</li>' +
'<li id="li3" class="shadow">3</li>' +
'<li id="li4">4</li>' +
'<li id="li5" class="shadow">5</li>' +
'<li id="li6" class="shadow2">6</li>' +
'</ul>';
var defHeight1 = d.querySelector('#li1').offsetHeight;
var defHeight2 = d.querySelector('#li2').offsetHeight;
var defHeight3 = d.querySelector('#li3').offsetHeight;
var defHeight4 = d.querySelector('#li4').offsetHeight;
var defHeight5 = d.querySelector('#li5').offsetHeight;
var defHeight6 = d.querySelector('#li6').offsetHeight;
assert_true(defHeight1 > 0, 'Point 1: Element height should be greater than zero');
assert_true(defHeight2 > 0, 'Point 2: Element height should be greater than zero');
assert_true(defHeight3 > 0, 'Point 3: Element height should be greater than zero');
assert_true(defHeight4 > 0, 'Point 4: Element height should be greater than zero');
assert_true(defHeight5 > 0, 'Point 5: Element height should be greater than zero');
assert_true(defHeight6 > 0, 'Point 6: Element height should be greater than zero');
var host = d.querySelector('#shHost');
d.body.setAttribute('style', 'font-size: 30px');
var height1 = d.querySelector('#li1').offsetHeight;
var height2 = d.querySelector('#li2').offsetHeight;
var height3 = d.querySelector('#li3').offsetHeight;
var height4 = d.querySelector('#li4').offsetHeight;
var height5 = d.querySelector('#li5').offsetHeight;
var height6 = d.querySelector('#li6').offsetHeight;
assert_true(height1 > defHeight1, 'Point 11: Element height should be changed');
assert_true(height2 > defHeight2, 'Point 12: Element height should be changed');
assert_true(height3 > defHeight3, 'Point 13: Element height should be changed');
assert_true(height4 > defHeight4, 'Point 14: Element height should be changed');
assert_true(height5 > defHeight5, 'Point 15: Element height should be changed');
assert_true(height6 > defHeight6, 'Point 16: Element height should be changed');
//Shadow root to play with
var s = host.createShadowRoot();
var div = d.createElement('div');
div.innerHTML ='<ul><content select=".shadow" reset-style-inheritance=true></content></ul>';
s.appendChild(div);
assert_equals(d.querySelector('#li1').offsetHeight, defHeight1, 'Point 21: Inherited ' +
'element style should be reset');
assert_equals(d.querySelector('#li3').offsetHeight, defHeight3, 'Point 22: Inherited ' +
'element style should be reset');
assert_equals(d.querySelector('#li5').offsetHeight, defHeight5, 'Point 23: Inherited ' +
'element style should be reset');
assert_equals(d.querySelector('#li2').offsetHeight, 0, 'Point 24: Element shouldn\'t be rendered');
assert_equals(d.querySelector('#li4').offsetHeight, 0, 'Point 25: Element shouldn\'t be rendered');
assert_equals(d.querySelector('#li6').offsetHeight, 0, 'Point 26: Element shouldn\'t be rendered');
}), 'A_10_04_04_T01');
test(unit(function (ctx) {
var d = newRenderedHTMLDocument(ctx);
d.body.innerHTML =
'<ul id="shHost">' +
'<li id="li1" class="shadow">1</li>' +
'<li id="li2" class="shadow2">2</li>' +
'<li id="li3" class="shadow">3</li>' +
'<li id="li4">4</li>' +
'<li id="li5" class="shadow">5</li>' +
'<li id="li6" class="shadow2">6</li>' +
'</ul>';
var defHeight1 = d.querySelector('#li1').offsetHeight;
var defHeight2 = d.querySelector('#li2').offsetHeight;
var defHeight3 = d.querySelector('#li3').offsetHeight;
var defHeight4 = d.querySelector('#li4').offsetHeight;
var defHeight5 = d.querySelector('#li5').offsetHeight;
var defHeight6 = d.querySelector('#li6').offsetHeight;
assert_true(defHeight1 > 0, 'Point 1: Element height should be greater than zero');
assert_true(defHeight2 > 0, 'Point 2: Element height should be greater than zero');
assert_true(defHeight3 > 0, 'Point 3: Element height should be greater than zero');
assert_true(defHeight4 > 0, 'Point 4: Element height should be greater than zero');
assert_true(defHeight5 > 0, 'Point 5: Element height should be greater than zero');
assert_true(defHeight6 > 0, 'Point 6: Element height should be greater than zero');
var host = d.querySelector('#shHost');
d.body.setAttribute('style', 'font-size: 30px');
var height1 = d.querySelector('#li1').offsetHeight;
var height2 = d.querySelector('#li2').offsetHeight;
var height3 = d.querySelector('#li3').offsetHeight;
var height4 = d.querySelector('#li4').offsetHeight;
var height5 = d.querySelector('#li5').offsetHeight;
var height6 = d.querySelector('#li6').offsetHeight;
assert_true(height1 > defHeight1, 'Point 11: Element height should be changed');
assert_true(height2 > defHeight2, 'Point 12: Element height should be changed');
assert_true(height3 > defHeight3, 'Point 13: Element height should be changed');
assert_true(height4 > defHeight4, 'Point 14: Element height should be changed');
assert_true(height5 > defHeight5, 'Point 15: Element height should be changed');
assert_true(height6 > defHeight6, 'Point 16: Element height should be changed');
//Shadow root to play with
var s = host.createShadowRoot();
var div = d.createElement('div');
div.innerHTML ='<ul><content select=".shadow" reset-style-inheritance></content></ul>';
s.appendChild(div);
assert_equals(d.querySelector('#li1').offsetHeight, defHeight1, 'Point 21: Inherited ' +
'element style should be reset');
assert_equals(d.querySelector('#li3').offsetHeight, defHeight3, 'Point 22: Inherited ' +
'element style should be reset');
assert_equals(d.querySelector('#li5').offsetHeight, defHeight5, 'Point 23: Inherited ' +
'element style should be reset');
assert_equals(d.querySelector('#li2').offsetHeight, 0, 'Point 24: Element shouldn\'t be rendered');
assert_equals(d.querySelector('#li4').offsetHeight, 0, 'Point 25: Element shouldn\'t be rendered');
assert_equals(d.querySelector('#li6').offsetHeight, 0, 'Point 26: Element shouldn\'t be rendered');
}), 'A_10_04_04_T02');
</script>
</body>
</html>

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

@ -1,189 +0,0 @@
<!DOCTYPE html>
<!--
Distributed under both the W3C Test Suite License [1] and the W3C
3-clause BSD License [2]. To contribute to a W3C Test Suite, see the
policies and contribution forms [3].
[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license
[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license
[3] http://www.w3.org/2004/10/27-testcases
-->
<html>
<head>
<title>Shadow DOM Test: A_10_05_03</title>
<link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
<link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#shadow-element">
<meta name="assert" content="The shadow HTML element: reset-style-inheritance attribute">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../testcommon.js"></script>
<link rel="stylesheet" href="/resources/testharness.css">
</head>
<body>
<div id="log"></div>
<script>
// test reset-style-inheritance=true
test(unit(function (ctx) {
var d = newRenderedHTMLDocument(ctx);
d.body.innerHTML =
'<ul id="shHost">' +
'<li id="li1" class="shadow">1</li>' +
'<li id="li2" class="shadow2">2</li>' +
'<li id="li3" class="shadow">3</li>' +
'<li id="li4">4</li>' +
'<li id="li5" class="shadow">5</li>' +
'<li id="li6" class="shadow2">6</li>' +
'</ul>';
var defHeight1 = d.querySelector('#li1').offsetHeight;
var defHeight2 = d.querySelector('#li2').offsetHeight;
var defHeight3 = d.querySelector('#li3').offsetHeight;
var defHeight4 = d.querySelector('#li4').offsetHeight;
var defHeight5 = d.querySelector('#li5').offsetHeight;
var defHeight6 = d.querySelector('#li6').offsetHeight;
assert_true(defHeight1 > 0, 'Point 1: Element height should be greater than zero');
assert_true(defHeight2 > 0, 'Point 2: Element height should be greater than zero');
assert_true(defHeight3 > 0, 'Point 3: Element height should be greater than zero');
assert_true(defHeight4 > 0, 'Point 4: Element height should be greater than zero');
assert_true(defHeight5 > 0, 'Point 5: Element height should be greater than zero');
assert_true(defHeight6 > 0, 'Point 6: Element height should be greater than zero');
var host = d.querySelector('#shHost');
d.body.setAttribute('style', 'font-size: 30px');
var height1 = d.querySelector('#li1').offsetHeight;
var height2 = d.querySelector('#li2').offsetHeight;
var height3 = d.querySelector('#li3').offsetHeight;
var height4 = d.querySelector('#li4').offsetHeight;
var height5 = d.querySelector('#li5').offsetHeight;
var height6 = d.querySelector('#li6').offsetHeight;
assert_true(height1 > defHeight1, 'Point 11: Element height should be changed');
assert_true(height2 > defHeight2, 'Point 12: Element height should be changed');
assert_true(height3 > defHeight3, 'Point 13: Element height should be changed');
assert_true(height4 > defHeight4, 'Point 14: Element height should be changed');
assert_true(height5 > defHeight5, 'Point 15: Element height should be changed');
assert_true(height6 > defHeight6, 'Point 16: Element height should be changed');
//Shadow root to play with
var s = host.createShadowRoot();
var div = d.createElement('div');
div.innerHTML ='<ul><content select=".shadow"></content></ul>';
s.appendChild(div);
assert_equals(d.querySelector('#li1').offsetHeight, height1, 'Point 21: Element height should not be changed');
assert_equals(d.querySelector('#li3').offsetHeight, height3, 'Point 22: Element height should not be changed');
assert_equals(d.querySelector('#li5').offsetHeight, height5, 'Point 23: Element height should not be changed');
assert_equals(d.querySelector('#li2').offsetHeight, 0, 'Point 24: Element shouldn\'t be rendered');
assert_equals(d.querySelector('#li4').offsetHeight, 0, 'Point 25: Element shouldn\'t be rendered');
assert_equals(d.querySelector('#li6').offsetHeight, 0, 'Point 26: Element shouldn\'t be rendered');
//Young tree
var s2 = host.createShadowRoot();
var div2 = d.createElement('div');
div2.innerHTML = '<shadow reset-style-inheritance=true></shadow>';
s2.appendChild(div2);
//styles should be reset
assert_equals(d.querySelector('#li1').offsetHeight, defHeight1, 'Point 31: Inherited ' +
'element style should be reset');
assert_equals(d.querySelector('#li3').offsetHeight, defHeight3, 'Point 32: Inherited ' +
'element style should be reset');
assert_equals(d.querySelector('#li5').offsetHeight, defHeight5, 'Point 33: Inherited ' +
'element style should be reset');
}), 'A_10_05_03_T01');
//test reset-style-inheritance
test(unit(function (ctx) {
var d = newRenderedHTMLDocument(ctx);
d.body.innerHTML =
'<ul id="shHost">' +
'<li id="li1" class="shadow">1</li>' +
'<li id="li2" class="shadow2">2</li>' +
'<li id="li3" class="shadow">3</li>' +
'<li id="li4">4</li>' +
'<li id="li5" class="shadow">5</li>' +
'<li id="li6" class="shadow2">6</li>' +
'</ul>';
var defHeight1 = d.querySelector('#li1').offsetHeight;
var defHeight2 = d.querySelector('#li2').offsetHeight;
var defHeight3 = d.querySelector('#li3').offsetHeight;
var defHeight4 = d.querySelector('#li4').offsetHeight;
var defHeight5 = d.querySelector('#li5').offsetHeight;
var defHeight6 = d.querySelector('#li6').offsetHeight;
assert_true(defHeight1 > 0, 'Point 1: Element height should be greater than zero');
assert_true(defHeight2 > 0, 'Point 2: Element height should be greater than zero');
assert_true(defHeight3 > 0, 'Point 3: Element height should be greater than zero');
assert_true(defHeight4 > 0, 'Point 4: Element height should be greater than zero');
assert_true(defHeight5 > 0, 'Point 5: Element height should be greater than zero');
assert_true(defHeight6 > 0, 'Point 6: Element height should be greater than zero');
var host = d.querySelector('#shHost');
d.body.setAttribute('style', 'font-size: 30px');
var height1 = d.querySelector('#li1').offsetHeight;
var height2 = d.querySelector('#li2').offsetHeight;
var height3 = d.querySelector('#li3').offsetHeight;
var height4 = d.querySelector('#li4').offsetHeight;
var height5 = d.querySelector('#li5').offsetHeight;
var height6 = d.querySelector('#li6').offsetHeight;
assert_true(height1 > defHeight1, 'Point 11: Element height should be changed');
assert_true(height2 > defHeight2, 'Point 12: Element height should be changed');
assert_true(height3 > defHeight3, 'Point 13: Element height should be changed');
assert_true(height4 > defHeight4, 'Point 14: Element height should be changed');
assert_true(height5 > defHeight5, 'Point 15: Element height should be changed');
assert_true(height6 > defHeight6, 'Point 16: Element height should be changed');
//Shadow root to play with
var s = host.createShadowRoot();
var div = d.createElement('div');
div.innerHTML ='<ul><content select=".shadow"></content></ul>';
s.appendChild(div);
assert_equals(d.querySelector('#li1').offsetHeight, height1, 'Point 21: Element height should not be changed');
assert_equals(d.querySelector('#li3').offsetHeight, height3, 'Point 22: Element height should not be changed');
assert_equals(d.querySelector('#li5').offsetHeight, height5, 'Point 23: Element height should not be changed');
assert_equals(d.querySelector('#li2').offsetHeight, 0, 'Point 24: Element shouldn\'t be rendered');
assert_equals(d.querySelector('#li4').offsetHeight, 0, 'Point 25: Element shouldn\'t be rendered');
assert_equals(d.querySelector('#li6').offsetHeight, 0, 'Point 26: Element shouldn\'t be rendered');
//Young tree
var s2 = host.createShadowRoot();
var div2 = d.createElement('div');
div2.innerHTML = '<shadow reset-style-inheritance></shadow>';
s2.appendChild(div2);
//styles should be reset
assert_equals(d.querySelector('#li1').offsetHeight, defHeight1, 'Point 31: Inherited ' +
'element style should be reset');
assert_equals(d.querySelector('#li3').offsetHeight, defHeight3, 'Point 32: Inherited ' +
'element style should be reset');
assert_equals(d.querySelector('#li5').offsetHeight, defHeight5, 'Point 33: Inherited ' +
'element style should be reset');
}), 'A_10_05_03_T02');
</script>
</body>
</html>

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

@ -35,7 +35,7 @@ A_05_05_01_T01.step(unit(function (ctx) {
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
//For #volume-slider-thumb relative target #volume-slider-thumb
//For #volume-slider-thumb relative target #volume-slider-thumb
roots.volumeShadowRoot.querySelector('#volume-slider-thumb').addEventListener('click',
A_05_05_01_T01.step_func(function(event) {
invoked = true;
@ -68,7 +68,7 @@ A_05_05_01_T02.step(unit(function (ctx) {
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
//For #volume-shadow-root relative target #volume-slider-thumb
//For #volume-shadow-root relative target #volume-slider-thumb
roots.volumeShadowRoot.addEventListener('click',
A_05_05_01_T02.step_func(function(event) {
invoked = true;
@ -101,13 +101,13 @@ A_05_05_01_T03.step(unit(function (ctx) {
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
//For #volume-slider relative target #volume-slider
//For #volume-slider relative target #volume-shadow-host
roots.playerShadowRoot.querySelector('#volume-slider').addEventListener('click',
A_05_05_01_T03.step_func(function(event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'volume-slider',
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
'Wrong target');
assert_true(event.currentTarget.getAttribute('id'), 'volume-slider',
assert_equals(event.currentTarget.getAttribute('id'), 'volume-slider',
'Wrong currentTarget');
}), false);
@ -135,13 +135,13 @@ A_05_05_01_T04.step(unit(function (ctx) {
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
//For #volume-slider-container relative target #volume-slider
//For #volume-slider-container relative target #volume-shadow-host
roots.playerShadowRoot.querySelector('#volume-slider-container').addEventListener('click',
A_05_05_01_T04.step_func(function(event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'volume-slider',
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
'Wrong target');
assert_true(event.currentTarget.getAttribute('id'), 'volume-slider',
assert_equals(event.currentTarget.getAttribute('id'), 'volume-slider-container',
'Wrong currentTarget');
}), false);
@ -168,13 +168,13 @@ A_05_05_01_T05.step(unit(function (ctx) {
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
//For #controls relative target #volume-slider
//For #controls relative target #volume-shadow-host
roots.playerShadowRoot.querySelector('#controls').addEventListener('click',
A_05_05_01_T05.step_func(function(event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'volume-slider',
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
'Wrong target');
assert_true(event.currentTarget.getAttribute('id'), 'volume-slider',
assert_equals(event.currentTarget.getAttribute('id'), 'controls',
'Wrong currentTarget');
}), false);
@ -201,13 +201,13 @@ A_05_05_01_T06.step(unit(function (ctx) {
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
//For #player-shadow-root relative target #volume-slider
roots.playerShadowRoot.addEventListener('click',
//For #player-shadow-host relative target #player-shadow-host
d.querySelector('#player-shadow-host').addEventListener('click',
A_05_05_01_T06.step_func(function(event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'volume-slider',
assert_equals(event.target.getAttribute('id'), 'player-shadow-host',
'Wrong target');
assert_true(event.currentTarget.getAttribute('id'), 'volume-slider',
assert_equals(event.currentTarget.getAttribute('id'), 'player-shadow-host',
'Wrong currentTarget');
}), false);
@ -235,13 +235,13 @@ A_05_05_01_T07.step(unit(function (ctx) {
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
//For #player relative target #player
//For #player relative target #player-shadow-host
d.querySelector('#player').addEventListener('click',
A_05_05_01_T07.step_func(function(event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'player',
assert_equals(event.target.getAttribute('id'), 'player-shadow-host',
'Wrong target');
assert_true(event.currentTarget.getAttribute('id'), 'player',
assert_equals(event.currentTarget.getAttribute('id'), 'player',
'Wrong currentTarget');
}), false);

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

@ -60,11 +60,11 @@ A_05_01_04_T02.step(unit(function (ctx) {
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
//For #volume-shadow-root relative target is #volume-slider-thumb
roots.volumeShadowRoot.addEventListener('click',
//For #volume-shadow-host relative target is #volume-shadow-host
roots.playerShadowRoot.querySelector('#volume-shadow-host').addEventListener('click',
A_05_01_04_T02.step_func(function (event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'volume-slider-thumb',
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
'Wrong related target');
}), false);
@ -90,11 +90,11 @@ A_05_01_04_T03.step(unit(function (ctx) {
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
//For #volume-slider relative target is #volume-slider
//For #volume-slider relative target is #volume-shadow-host
roots.playerShadowRoot.querySelector('#volume-slider').addEventListener('click',
A_05_01_04_T03.step_func(function (event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'volume-slider',
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
'Wrong related target');
}), false);
@ -118,11 +118,11 @@ A_05_01_04_T04.step(unit(function (ctx) {
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
//For #volume-slider-container relative target is #volume-slider
//For #volume-slider-container relative target is #volume-shadow-host
roots.playerShadowRoot.querySelector('#volume-slider-container').addEventListener('click',
A_05_01_04_T04.step_func(function (event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'volume-slider',
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
'Wrong related target');
}), false);
@ -146,11 +146,11 @@ A_05_01_04_T05.step(unit(function (ctx) {
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
//For #controls relative target is #volume-slider
//For #controls relative target is #volume-shadow-host
roots.playerShadowRoot.querySelector('#controls').addEventListener('click',
A_05_01_04_T05.step_func(function (event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'volume-slider',
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
'Wrong related target');
}), false);
@ -174,11 +174,11 @@ A_05_01_04_T06.step(unit(function (ctx) {
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
//For #player-shadow-root relative target is #volume-slider
//For #player-shadow-host relative target is #player-shadow-host
roots.playerShadowRoot.addEventListener('click',
A_05_01_04_T06.step_func(function (event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'volume-slider',
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
'Wrong related target');
}), false);
@ -203,11 +203,11 @@ A_05_01_04_T07.step(unit(function (ctx) {
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
//For #player relative target is #player
//For #player relative target is #player-shadow-host
d.querySelector('#player').addEventListener('click',
A_05_01_04_T07.step_func(function (event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'player',
assert_equals(event.target.getAttribute('id'), 'player-shadow-host',
'Wrong related target');
}), false);
@ -344,11 +344,11 @@ A_05_01_04_T12.step(unit(function (ctx) {
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
//For #player relative target is #player
//For #player relative target is #player-shadow-host
d.querySelector('#player').addEventListener('click',
A_05_01_04_T12.step_func(function (event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'player',
assert_equals(event.target.getAttribute('id'), 'player-shadow-host',
'Wrong related target');
}), false);

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

@ -228,30 +228,30 @@ function createTestMediaPlayer(d) {
d.body.innerHTML = '' +
'<div id="player">' +
'<input type="checkbox" id="outside-control">' +
'<div id="player-shadow-root">' +
'<div id="player-shadow-host">' +
'</div>' +
'</div>';
var playerShadowRoot = d.querySelector('#player-shadow-root').createShadowRoot();
var playerShadowRoot = d.querySelector('#player-shadow-host').createShadowRoot();
playerShadowRoot.innerHTML = '' +
'<div id="controls">' +
'<button class="play-button">PLAY</button>' +
'<input type="range" id="timeline">' +
'<div id="timeline-shadow-root">' +
'<div tabindex="0" id="timeline">' +
'<div id="timeline-shadow-host">' +
'</div>' +
'</input>' +
'</div>' +
'<div class="volume-slider-container" id="volume-slider-container">' +
'<input type="range" class="volume-slider" id="volume-slider">' +
'<div id="volume-shadow-root">' +
'<div tabindex="0" class="volume-slider" id="volume-slider">' +
'<div id="volume-shadow-host">' +
'</div>' +
'</input>' +
'</div>' +
'</div>' +
'</div>';
var timeLineShadowRoot = playerShadowRoot.querySelector('#timeline-shadow-root').createShadowRoot();
var timeLineShadowRoot = playerShadowRoot.querySelector('#timeline-shadow-host').createShadowRoot();
timeLineShadowRoot.innerHTML = '<div class="slider-thumb" id="timeline-slider-thumb"></div>';
var volumeShadowRoot = playerShadowRoot.querySelector('#volume-shadow-root').createShadowRoot();
var volumeShadowRoot = playerShadowRoot.querySelector('#volume-shadow-host').createShadowRoot();
volumeShadowRoot.innerHTML = '<div class="slider-thumb" id="volume-slider-thumb"></div>';
return {

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

@ -115,6 +115,11 @@ class Webidl2Regexp(Regexp):
pattern = "webidl2\.js"
error = "WEBIDL2.JS"
class ConsoleRegexp(Regexp):
pattern = "console\.[a-zA-Z]+\s*\("
error = "CONSOLE"
file_extensions = [".html", ".htm", ".js", ".xht", ".html", ".svg"]
class PrintRegexp(Regexp):
pattern = "print(?:\s|\s*\()"
error = "PRINT STATEMENT"
@ -126,6 +131,7 @@ regexps = [item() for item in
CRRegexp,
W3CTestOrgRegexp,
Webidl2Regexp,
ConsoleRegexp,
PrintRegexp]]
def check_regexp_line(path, f):

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

@ -12,7 +12,7 @@ var args = [
/* numbers */
[NaN, 0], [+Infinity, 0], [-Infinity, 0], [+0, 0], [-0, 0],
[-0.4, 0], [-0.9, 0], [1.1, 1], [2.9, 2],
[1, 1], [-0xF1000000, 0xF000000],
[1, 1], [-0xF1000000, 0],
/* strings */
["1", 1], ["1e2", 100],
/* null, undefined, booleans */

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

@ -12,7 +12,7 @@ var args = [
/* numbers */
[NaN, 0], [+Infinity, 0], [-Infinity, 0], [+0, 0], [-0, 0], // Step 2
[-0.4, 0], [-0.9, 0], [1.1, 1], [2.9, 2], // Step 3
[1, 1], [-0xF1000000, 0xF000000], // Step 4
[1, 1], [-0xF1000000, 0], // Step 4
/* strings */
["1", 1], ["1e2", 100],
/* null, undefined, booleans */

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

@ -258,6 +258,9 @@ test.txt s:http h:www.example.com p:/test.txt
\u4E2D/test.txt s:http h:www.example.com p:/%E4%B8%AD/test.txt
http://www.example2.com s:http h:www.example2.com p:/
//www.example2.com s:http h:www.example2.com p:/
file:... s:file h: p:/...
file:.. s:file h: p:/
file:a s:file h: p:/a
# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/host.html

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

@ -0,0 +1,5 @@
importScripts("/resources/testharness.js");
test(function() {
assert_equals("ÿ", "\ufffd");
}, "Decoding invalid utf-8");
done();

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

@ -950,10 +950,7 @@ void GeckoSampler::doNativeBacktrace(ThreadProfile &aProfile, TickSample* aSampl
uint32_t maxFrames = uint32_t(nativeStack.size - nativeStack.count);
#ifdef XP_MACOSX
pthread_t pt = GetProfiledThread(aSample->threadProfile->GetPlatformData());
void *stackEnd = reinterpret_cast<void*>(-1);
if (pt)
stackEnd = static_cast<char*>(pthread_get_stackaddr_np(pt));
void *stackEnd = aSample->threadProfile->GetStackTop();
bool rv = true;
if (aSample->fp >= aSample->sp && aSample->fp <= stackEnd)
rv = FramePointerStackWalk(StackWalkCallback, /* skipFrames */ 0,

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

@ -1,3 +1,11 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */
#include "ThreadInfo.h"
#include "ThreadProfile.h"
ThreadInfo::ThreadInfo(const char* aName, int aThreadId,
bool aIsMainThread, PseudoStack* aPseudoStack,
@ -14,6 +22,12 @@ ThreadInfo::ThreadInfo(const char* aName, int aThreadId,
#ifndef SPS_STANDALONE
mThread = NS_GetCurrentThread();
#endif
// We don't have to guess on mac
#ifdef XP_MACOSX
pthread_t self = pthread_self();
mStackTop = pthread_get_stackaddr_np(self);
#endif
}
ThreadInfo::~ThreadInfo() {

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

@ -47,7 +47,7 @@ class ThreadInfo {
PseudoStack* mPseudoStack;
PlatformData* mPlatformData;
ThreadProfile* mProfile;
void* const mStackTop;
void* mStackTop;
#ifndef SPS_STANDALONE
nsCOMPtr<nsIThread> mThread;
#endif

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

@ -281,18 +281,18 @@ class ThreadProfile;
class TickSample {
public:
TickSample()
:
pc(NULL),
sp(NULL),
fp(NULL),
: pc(NULL)
, sp(NULL)
, fp(NULL)
#ifdef ENABLE_ARM_LR_SAVING
lr(NULL),
, lr(NULL)
#endif
context(NULL),
isSamplingCurrentThread(false),
threadProfile(nullptr),
rssMemory(0),
ussMemory(0) {}
, context(NULL)
, isSamplingCurrentThread(false)
, threadProfile(nullptr)
, rssMemory(0)
, ussMemory(0)
{}
void PopulateContext(void* aContext);

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

@ -280,6 +280,9 @@ typedef NSInteger NSEventGestureAxis;
- (BOOL)isCoveringTitlebar;
- (void)viewWillStartLiveResize;
- (void)viewDidEndLiveResize;
- (NSColor*)vibrancyFillColorForThemeGeometryType:(nsITheme::ThemeGeometryType)aThemeGeometryType;
- (NSColor*)vibrancyFontSmoothingBackgroundColorForThemeGeometryType:(nsITheme::ThemeGeometryType)aThemeGeometryType;

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

@ -3436,6 +3436,28 @@ NSEvent* gLastDragMouseDownEvent = nil;
[(BaseWindow*)[self window] drawsContentsIntoWindowFrame];
}
- (void)viewWillStartLiveResize
{
nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();
if (!observerService) {
return;
}
observerService->NotifyObservers(nullptr, "live-resize-start", nullptr);
}
- (void)viewDidEndLiveResize
{
nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();
if (!observerService) {
return;
}
observerService->NotifyObservers(nullptr, "live-resize-end", nullptr);
}
- (NSColor*)vibrancyFillColorForThemeGeometryType:(nsITheme::ThemeGeometryType)aThemeGeometryType
{
if (!mGeckoChild) {

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

@ -337,7 +337,9 @@ static bool gIsPointerEventsEnabled = false;
*
**************************************************************/
nsWindow::nsWindow() : nsWindowBase()
nsWindow::nsWindow()
: nsWindowBase()
, mResizeState(NOT_RESIZING)
{
mIconSmall = nullptr;
mIconBig = nullptr;
@ -5325,11 +5327,49 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
DispatchPendingEvents();
break;
case WM_SIZING:
{
// When we get WM_ENTERSIZEMOVE we don't know yet if we're in a live
// resize or move event. Instead we wait for first VM_SIZING message
// within a ENTERSIZEMOVE to consider this a live resize event.
if (mResizeState == IN_SIZEMOVE) {
mResizeState = RESIZING;
nsCOMPtr<nsIObserverService> observerService =
mozilla::services::GetObserverService();
if (observerService) {
observerService->NotifyObservers(nullptr, "live-resize-start",
nullptr);
}
}
break;
}
case WM_ENTERSIZEMOVE:
{
if (mResizeState == NOT_RESIZING) {
mResizeState = IN_SIZEMOVE;
}
break;
}
case WM_EXITSIZEMOVE:
{
if (mResizeState == RESIZING) {
mResizeState = NOT_RESIZING;
nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();
if (observerService) {
observerService->NotifyObservers(nullptr, "live-resize-end", nullptr);
}
}
if (!sIsInMouseCapture) {
NotifySizeMoveDone();
}
break;
}
case WM_NCLBUTTONDBLCLK:
DispatchMouseEvent(NS_MOUSE_DOUBLECLICK, 0, lParamToClient(lParam),
@ -7521,7 +7561,6 @@ nsWindow::DealWithPopups(HWND aWnd, UINT aMessage,
return false;
case WM_MOVING:
case WM_SIZING:
case WM_MENUSELECT:
break;

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