merge mozilla-inbound to mozilla-central

This commit is contained in:
Carsten "Tomcat" Book 2013-11-06 13:07:50 +01:00
commit 75228a8075
112 changed files with 2693 additions and 717 deletions

View File

@ -220,7 +220,12 @@ this.OutputGenerator = {
if (!typeName || typeName === 'text') {
return;
}
aDesc.push(gStringBundle.GetStringFromName('textInputType_' + typeName));
typeName = 'textInputType_' + typeName;
try {
aDesc.push(gStringBundle.GetStringFromName(typeName));
} catch (x) {
Logger.warning('Failed to get a string from a bundle for', typeName);
}
},
get outputOrder() {

View File

@ -83,6 +83,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=753984
"Column 1 Row 1", "Fruits and vegetables",
"table with 1 column and 1 row"
]]
}, {
accOrElmOrID: "date",
expected: [["date entry", "2011-09-29"], ["2011-09-29", "date entry"]]
}, {
accOrElmOrID: "email",
expected: [
@ -302,6 +305,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=753984
<label id="label4">Points:
<input id="input4" type="range" name="points" min="1" max="10" value="3">
</label>
<input id="date" type="date" value="2011-09-29" />
<input id="email" type="email" value="test@example.com" />
<input id="search" type="search" value="This is a search" />
<input id="tel" type="tel" value="555-5555" />

View File

@ -1,40 +0,0 @@
#
# 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/.
DISTROEXT = $(abspath $(FINAL_TARGET))/distribution/extensions
include $(topsrcdir)/config/config.mk
ifneq (,$(filter beta,$(MOZ_UPDATE_CHANNEL)))
EXTENSIONS = \
$(NULL)
all_xpis = $(foreach dir,$(EXTENSIONS),$(DISTROEXT)/$(dir).xpi)
libs:: $(all_xpis)
GARBAGE += $(all_xpis)
define pp_one
$(2) := $(2)
$(2)_PATH := $(dir $(2))
$(2)_TARGET := libs-$(1)
PP_TARGETS += $(2)
endef
$(foreach d,$(EXTENSIONS), \
$(foreach in,$(shell cd $(srcdir) ; find $(d) -name '*.in'), \
$(eval $(call pp_one,$(d),$(in))) \
) \
)
endif
include $(topsrcdir)/config/rules.mk
$(all_xpis): $(DISTROEXT)/%.xpi: $(call mkdir_deps,$(DISTROEXT)) libs-%
cd $* && \
$(ZIP) -r9XD $@ * -x \*.in -x \*.mkdir.done
cd $(abspath $(srcdir)/$*) && \
$(ZIP) -r9XD $@ * -x \*.in -x \*.mkdir.done
.PHONY: $(all_xpis:.xpi=)

View File

@ -185,6 +185,8 @@ support-files =
[browser_webconsole_bug_630733_response_redirect_headers.js]
[browser_webconsole_bug_632275_getters_document_width.js]
[browser_webconsole_bug_632347_iterators_generators.js]
# Too many intermittent timeouts (bug 935277)
skip-if = os == "linux"
[browser_webconsole_bug_632817.js]
[browser_webconsole_bug_642108_pruneTest.js]
[browser_webconsole_bug_642615_autocomplete.js]

View File

@ -47,6 +47,10 @@ DEFINES += \
-DACCEPTED_MAR_CHANNEL_IDS="$(ACCEPTED_MAR_CHANNEL_IDS)" \
$(NULL)
ifeq ($(MOZ_BUILD_APP),browser)
DEFINES += -DMOZ_BUILD_APP_IS_BROWSER
endif
ifdef MOZ_APP_PROFILE
DEFINES += -DMOZ_APP_PROFILE="$(MOZ_APP_PROFILE)"
endif

View File

@ -1,8 +1,14 @@
#if MOZ_APP_STATIC_INI
#ifdef MOZ_BUILD_APP_IS_BROWSER
; This file is not used. If you modify it and want the application to use
; your modifications, move it under the browser/ subdirectory and start with
; the "-app /path/to/browser/application.ini" argument.
#else
; This file is not used. If you modify it and want the application to use
; your modifications, start with the "-app /path/to/application.ini"
; argument.
#endif
#endif
#if 0
; 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

View File

@ -1,4 +1,5 @@
/* -*- 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/. */
@ -645,15 +646,12 @@ nsDOMMemoryFile::DataOwner::sMemoryReporterRegistered;
NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(DOMMemoryFileDataOwnerMallocSizeOf)
class nsDOMMemoryFileDataOwnerMemoryReporter MOZ_FINAL
: public nsIMemoryReporter
: public MemoryMultiReporter
{
NS_DECL_THREADSAFE_ISUPPORTS
NS_IMETHOD GetName(nsACString& aName)
{
aName.AssignASCII("dom-memory-file-data-owner");
return NS_OK;
}
public:
nsDOMMemoryFileDataOwnerMemoryReporter()
: MemoryMultiReporter("dom-memory-file-data-owner")
{}
NS_IMETHOD CollectReports(nsIMemoryReporterCallback *aCallback,
nsISupports *aClosure)
@ -728,9 +726,6 @@ class nsDOMMemoryFileDataOwnerMemoryReporter MOZ_FINAL
}
};
NS_IMPL_ISUPPORTS1(nsDOMMemoryFileDataOwnerMemoryReporter,
nsIMemoryReporter)
/* static */ void
nsDOMMemoryFile::DataOwner::EnsureMemoryReporterRegistered()
{

View File

@ -1080,11 +1080,15 @@ struct MessageManagerReferentCount
namespace mozilla {
namespace dom {
class MessageManagerReporter MOZ_FINAL : public nsIMemoryReporter
class MessageManagerReporter MOZ_FINAL : public MemoryMultiReporter
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIMEMORYREPORTER
MessageManagerReporter()
: MemoryMultiReporter("message-manager")
{}
NS_IMETHOD CollectReports(nsIMemoryReporterCallback* aCallback,
nsISupports* aData);
static const size_t kSuspectReferentCount = 300;
protected:
@ -1092,8 +1096,6 @@ protected:
MessageManagerReferentCount* aReferentCount);
};
NS_IMPL_ISUPPORTS1(MessageManagerReporter, nsIMemoryReporter)
static PLDHashOperator
CollectMessageListenerData(const nsAString& aKey,
nsAutoTObserverArray<nsMessageListenerInfo, 1>* aListeners,
@ -1153,13 +1155,6 @@ MessageManagerReporter::CountReferents(nsFrameMessageManager* aMessageManager,
}
}
NS_IMETHODIMP
MessageManagerReporter::GetName(nsACString& aName)
{
aName.AssignLiteral("message-manager");
return NS_OK;
}
static nsresult
ReportReferentCount(const char* aManagerType,
const MessageManagerReferentCount& aReferentCount,

View File

@ -11,22 +11,17 @@ using namespace mozilla;
NS_IMPL_ISUPPORTS1(WebGLMemoryPressureObserver, nsIObserver)
class WebGLMemoryReporter MOZ_FINAL : public nsIMemoryReporter
class WebGLMemoryReporter MOZ_FINAL : public MemoryMultiReporter
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIMEMORYREPORTER
public:
WebGLMemoryReporter()
: MemoryMultiReporter("webgl")
{}
NS_IMETHOD CollectReports(nsIMemoryReporterCallback* aCb,
nsISupports* aClosure);
};
NS_IMPL_ISUPPORTS1(WebGLMemoryReporter, nsIMemoryReporter)
NS_IMETHODIMP
WebGLMemoryReporter::GetName(nsACString &aName)
{
aName.AssignLiteral("webgl");
return NS_OK;
}
NS_IMETHODIMP
WebGLMemoryReporter::CollectReports(nsIMemoryReporterCallback* aCb,
nsISupports* aClosure)

View File

@ -1763,16 +1763,12 @@ MediaDecoder::IsAppleMP3Enabled()
}
#endif
class MediaReporter MOZ_FINAL : public nsIMemoryReporter
class MediaReporter MOZ_FINAL : public MemoryMultiReporter
{
public:
NS_DECL_ISUPPORTS
NS_IMETHOD GetName(nsACString& aName)
{
aName.AssignLiteral("media");
return NS_OK;
}
MediaReporter()
: MemoryMultiReporter("media")
{}
NS_IMETHOD CollectReports(nsIMemoryReporterCallback* aCb,
nsISupports* aClosure)
@ -1800,8 +1796,6 @@ public:
}
};
NS_IMPL_ISUPPORTS1(MediaReporter, nsIMemoryReporter)
MediaDecoderOwner*
MediaDecoder::GetOwner()
{

View File

@ -433,7 +433,7 @@ ContentChild::InitXPCOM()
}
PMemoryReportRequestChild*
ContentChild::AllocPMemoryReportRequestChild()
ContentChild::AllocPMemoryReportRequestChild(const uint32_t& generation)
{
return new MemoryReportRequestChild();
}
@ -480,7 +480,9 @@ NS_IMPL_ISUPPORTS1(
)
bool
ContentChild::RecvPMemoryReportRequestConstructor(PMemoryReportRequestChild* child)
ContentChild::RecvPMemoryReportRequestConstructor(
PMemoryReportRequestChild* child,
const uint32_t& generation)
{
nsCOMPtr<nsIMemoryReporterManager> mgr = do_GetService("@mozilla.org/memory-reporter-manager;1");
@ -504,7 +506,7 @@ ContentChild::RecvPMemoryReportRequestConstructor(PMemoryReportRequestChild* chi
r->CollectReports(cb, wrappedReports);
}
child->Send__delete__(child, reports);
child->Send__delete__(child, generation, reports);
return true;
}

View File

@ -111,13 +111,14 @@ public:
virtual bool DeallocPIndexedDBChild(PIndexedDBChild* aActor);
virtual PMemoryReportRequestChild*
AllocPMemoryReportRequestChild();
AllocPMemoryReportRequestChild(const uint32_t& generation);
virtual bool
DeallocPMemoryReportRequestChild(PMemoryReportRequestChild* actor);
virtual bool
RecvPMemoryReportRequestConstructor(PMemoryReportRequestChild* child);
RecvPMemoryReportRequestConstructor(PMemoryReportRequestChild* child,
const uint32_t& generation);
virtual bool
RecvAudioChannelNotify();

View File

@ -78,6 +78,7 @@
#include "nsISupportsPrimitives.h"
#include "nsIURIFixup.h"
#include "nsIWindowWatcher.h"
#include "nsMemoryReporterManager.h"
#include "nsServiceManagerUtils.h"
#include "nsStyleSheetService.h"
#include "nsThreadUtils.h"
@ -160,61 +161,13 @@ namespace dom {
#define NS_IPC_IOSERVICE_SET_OFFLINE_TOPIC "ipc:network:set-offline"
// This represents all the memory reports provided by a child process.
class ChildReporter MOZ_FINAL : public nsIMemoryReporter
{
public:
ChildReporter(const InfallibleTArray<MemoryReport>& childReports)
{
for (uint32_t i = 0; i < childReports.Length(); i++) {
MemoryReport r(childReports[i].process(),
childReports[i].path(),
childReports[i].kind(),
childReports[i].units(),
childReports[i].amount(),
childReports[i].desc());
// Child reports have a non-empty process.
MOZ_ASSERT(!r.process().IsEmpty());
mChildReports.AppendElement(r);
}
}
NS_DECL_ISUPPORTS
NS_IMETHOD GetName(nsACString& name)
{
name.AssignLiteral("content-child");
return NS_OK;
}
NS_IMETHOD CollectReports(nsIMemoryReporterCallback* aCb,
nsISupports* aClosure)
{
for (uint32_t i = 0; i < mChildReports.Length(); i++) {
nsresult rv;
MemoryReport r = mChildReports[i];
rv = aCb->Callback(r.process(), r.path(), r.kind(), r.units(),
r.amount(), r.desc(), aClosure);
NS_ENSURE_SUCCESS(rv, rv);
}
return NS_OK;
}
private:
InfallibleTArray<MemoryReport> mChildReports;
};
NS_IMPL_ISUPPORTS1(ChildReporter, nsIMemoryReporter)
class MemoryReportRequestParent : public PMemoryReportRequestParent
{
public:
MemoryReportRequestParent();
virtual ~MemoryReportRequestParent();
virtual bool Recv__delete__(const InfallibleTArray<MemoryReport>& report);
virtual bool Recv__delete__(const uint32_t& generation, const InfallibleTArray<MemoryReport>& report);
private:
ContentParent* Owner()
{
@ -228,9 +181,13 @@ MemoryReportRequestParent::MemoryReportRequestParent()
}
bool
MemoryReportRequestParent::Recv__delete__(const InfallibleTArray<MemoryReport>& childReports)
MemoryReportRequestParent::Recv__delete__(const uint32_t& generation, const InfallibleTArray<MemoryReport>& childReports)
{
Owner()->SetChildMemoryReports(childReports);
nsRefPtr<nsMemoryReporterManager> mgr =
nsMemoryReporterManager::GetOrCreate();
if (mgr) {
mgr->HandleChildReports(generation, childReports);
}
return true;
}
@ -239,29 +196,21 @@ MemoryReportRequestParent::~MemoryReportRequestParent()
MOZ_COUNT_DTOR(MemoryReportRequestParent);
}
/**
* A memory reporter for ContentParent objects themselves.
*/
class ContentParentMemoryReporter MOZ_FINAL : public nsIMemoryReporter
// A memory reporter for ContentParent objects themselves.
class ContentParentsMemoryReporter MOZ_FINAL : public MemoryMultiReporter
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIMEMORYREPORTER
NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(MallocSizeOf)
ContentParentsMemoryReporter()
: MemoryMultiReporter("content-parents")
{}
NS_IMETHOD CollectReports(nsIMemoryReporterCallback* cb,
nsISupports* aClosure);
};
NS_IMPL_ISUPPORTS1(ContentParentMemoryReporter, nsIMemoryReporter)
NS_IMETHODIMP
ContentParentMemoryReporter::GetName(nsACString& aName)
{
aName.AssignLiteral("ContentParents");
return NS_OK;
}
NS_IMETHODIMP
ContentParentMemoryReporter::CollectReports(nsIMemoryReporterCallback* cb,
nsISupports* aClosure)
ContentParentsMemoryReporter::CollectReports(nsIMemoryReporterCallback* cb,
nsISupports* aClosure)
{
nsAutoTArray<ContentParent*, 16> cps;
ContentParent::GetAllEvenIfDead(cps);
@ -511,8 +460,7 @@ ContentParent::StartUp()
return;
}
nsRefPtr<ContentParentMemoryReporter> mr = new ContentParentMemoryReporter();
NS_RegisterMemoryReporter(mr);
NS_RegisterMemoryReporter(new ContentParentsMemoryReporter());
sCanLaunchSubprocesses = true;
@ -1043,7 +991,6 @@ ContentParent::ShutDownProcess(bool aCloseWithError)
// shut down the cycle collector. But by then it's too late to release any
// CC'ed objects, so we need to null them out here, while we still can. See
// bug 899761.
mChildReporter = nullptr;
if (mMessageManager) {
mMessageManager->Disconnect();
mMessageManager = nullptr;
@ -1218,8 +1165,12 @@ ContentParent::ActorDestroy(ActorDestroyReason why)
ppm->Disconnect();
}
// unregister the child memory reporter
UnregisterChildMemoryReporter();
// Tell the memory reporter manager that this ContentParent is going away.
nsRefPtr<nsMemoryReporterManager> mgr =
nsMemoryReporterManager::GetOrCreate();
if (mgr) {
mgr->DecrementNumChildProcesses();
}
// remove the global remote preferences observers
Preferences::RemoveObserver(this, "");
@ -1426,6 +1377,13 @@ ContentParent::ContentParent(mozIApplication* aApp,
IToplevelProtocol::SetTransport(mSubprocess->GetChannel());
// Tell the memory reporter manager that this ContentParent exists.
nsRefPtr<nsMemoryReporterManager> mgr =
nsMemoryReporterManager::GetOrCreate();
if (mgr) {
mgr->IncrementNumChildProcesses();
}
std::vector<std::string> extraArgs;
if (aIsNuwaProcess) {
extraArgs.push_back("-nuwa");
@ -2037,7 +1995,7 @@ ContentParent::Observe(nsISupports* aSubject,
return NS_ERROR_NOT_AVAILABLE;
}
else if (!strcmp(aTopic, "child-memory-reporter-request")) {
unused << SendPMemoryReportRequestConstructor();
unused << SendPMemoryReportRequestConstructor((uint32_t)(uintptr_t)aData);
}
else if (!strcmp(aTopic, "child-gc-request")){
unused << SendGarbageCollect();
@ -2481,7 +2439,7 @@ ContentParent::RecvPIndexedDBConstructor(PIndexedDBParent* aActor)
}
PMemoryReportRequestParent*
ContentParent::AllocPMemoryReportRequestParent()
ContentParent::AllocPMemoryReportRequestParent(const uint32_t& generation)
{
MemoryReportRequestParent* parent = new MemoryReportRequestParent();
return parent;
@ -2494,32 +2452,6 @@ ContentParent::DeallocPMemoryReportRequestParent(PMemoryReportRequestParent* act
return true;
}
void
ContentParent::SetChildMemoryReports(const InfallibleTArray<MemoryReport>& childReports)
{
nsCOMPtr<nsIMemoryReporterManager> mgr =
do_GetService("@mozilla.org/memory-reporter-manager;1");
if (mChildReporter)
mgr->UnregisterReporter(mChildReporter);
mChildReporter = new ChildReporter(childReports);
mgr->RegisterReporter(mChildReporter);
nsCOMPtr<nsIObserverService> obs =
do_GetService("@mozilla.org/observer-service;1");
if (obs)
obs->NotifyObservers(nullptr, "child-memory-reporter-update", nullptr);
}
void
ContentParent::UnregisterChildMemoryReporter()
{
nsCOMPtr<nsIMemoryReporterManager> mgr =
do_GetService("@mozilla.org/memory-reporter-manager;1");
mgr->UnregisterReporter(mChildReporter);
}
PTestShellParent*
ContentParent::AllocPTestShellParent()
{

View File

@ -140,10 +140,6 @@ public:
bool IsAlive();
bool IsForApp();
void SetChildMemoryReports(const InfallibleTArray<MemoryReport>&
childReports);
void UnregisterChildMemoryReporter();
GeckoChildProcessHost* Process() {
return mSubprocess;
}
@ -340,7 +336,7 @@ private:
virtual bool DeallocPIndexedDBParent(PIndexedDBParent* aActor);
virtual PMemoryReportRequestParent* AllocPMemoryReportRequestParent();
virtual PMemoryReportRequestParent* AllocPMemoryReportRequestParent(const uint32_t& generation);
virtual bool DeallocPMemoryReportRequestParent(PMemoryReportRequestParent* actor);
virtual PTestShellParent* AllocPTestShellParent();
@ -500,14 +496,6 @@ private:
uint64_t mChildID;
int32_t mGeolocationWatchID;
// This is a reporter holding the reports from the child's last
// "child-memory-reporter-update" notification. To update this, one can
// broadcast the topic "child-memory-reporter-request" using the
// nsIObserverService.
//
// Note that this assumes there is at most one child process at a time!
nsCOMPtr<nsIMemoryReporter> mChildReporter;
nsString mAppManifestURL;
/**

View File

@ -231,7 +231,7 @@ child:
*/
async SetProcessPrivileges(ChildPrivileges privs);
PMemoryReportRequest();
PMemoryReportRequest(uint32_t generation);
/**
* Notify the AudioChannelService in the child processes.

View File

@ -21,7 +21,7 @@ protocol PMemoryReportRequest {
manager PContent;
parent:
__delete__(MemoryReport[] report);
__delete__(uint32_t generation, MemoryReport[] report);
};
}

View File

@ -73,6 +73,7 @@ definition = definition
textarea = text area
# Text input types
textInputType_date = date
textInputType_email = e-mail
textInputType_search = search
textInputType_tel = telephone

View File

@ -1950,7 +1950,7 @@ struct WorkerPrivate::TimeoutInfo
bool mCanceled;
};
class WorkerPrivate::MemoryReporter MOZ_FINAL : public nsIMemoryReporter
class WorkerPrivate::MemoryReporter MOZ_FINAL : public MemoryMultiReporter
{
friend class WorkerPrivate;
@ -1960,10 +1960,9 @@ class WorkerPrivate::MemoryReporter MOZ_FINAL : public nsIMemoryReporter
bool mAlreadyMappedToAddon;
public:
NS_DECL_THREADSAFE_ISUPPORTS
MemoryReporter(WorkerPrivate* aWorkerPrivate)
: mMutex(aWorkerPrivate->mMutex), mWorkerPrivate(aWorkerPrivate),
: MemoryMultiReporter("workers"),
mMutex(aWorkerPrivate->mMutex), mWorkerPrivate(aWorkerPrivate),
mAlreadyMappedToAddon(false)
{
aWorkerPrivate->AssertIsOnWorkerThread();
@ -1983,13 +1982,6 @@ public:
NS_LITERAL_CSTRING(")/");
}
NS_IMETHOD
GetName(nsACString& aName)
{
aName.AssignLiteral("workers");
return NS_OK;
}
NS_IMETHOD
CollectReports(nsIMemoryReporterCallback* aCallback,
nsISupports* aClosure)
@ -2072,8 +2064,6 @@ private:
}
};
NS_IMPL_ISUPPORTS1(WorkerPrivate::MemoryReporter, nsIMemoryReporter)
template <class Derived>
WorkerPrivateParent<Derived>::WorkerPrivateParent(
JSContext* aCx,

View File

@ -48,7 +48,7 @@ struct NS_GFX nsFont {
// Force this font to not be considered a 'generic' font, even if
// the name is the same as a CSS generic font family.
uint8_t systemFont;
bool systemFont;
// The variant of the font (normal, small-caps)
uint8_t variant;

View File

@ -6,6 +6,9 @@
* Windows 8 RC SDK. The work for this file itself was based on the one in ProcessHacker at
* http://processhacker.svn.sourceforge.net/viewvc/processhacker/2.x/trunk/plugins/ExtendedTools/d3dkmt.h?revision=4758&view=markup
* For more details see Mozilla Bug 689870.
* [Bug 917496 indicates that some of these structs may not match reality, and
* therefore should not be trusted. See the reference to bug 917496 in
* gfxWindowsPlatform.cpp.]
*/
typedef struct _D3DKMTQS_COUNTER

View File

@ -631,21 +631,13 @@ PR_STATIC_ASSERT(uint32_t(CAIRO_SURFACE_TYPE_SKIA) ==
static int64_t gSurfaceMemoryUsed[gfxSurfaceTypeMax] = { 0 };
class SurfaceMemoryReporter MOZ_FINAL :
public nsIMemoryReporter
class SurfaceMemoryReporter MOZ_FINAL : public MemoryMultiReporter
{
public:
SurfaceMemoryReporter()
: MemoryMultiReporter("gfx-surface")
{ }
NS_DECL_ISUPPORTS
NS_IMETHOD GetName(nsACString &name)
{
name.AssignLiteral("gfx-surface");
return NS_OK;
}
NS_IMETHOD CollectReports(nsIMemoryReporterCallback *aCb,
nsISupports *aClosure)
{
@ -673,8 +665,6 @@ public:
}
};
NS_IMPL_ISUPPORTS1(SurfaceMemoryReporter, nsIMemoryReporter)
void
gfxASurface::RecordMemoryUsedForSurfaceType(gfxSurfaceType aType,
int32_t aBytes)

View File

@ -1360,17 +1360,8 @@ gfxFontFamily::AddSizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
* shaped-word caches to free up memory.
*/
NS_IMPL_ISUPPORTS1(gfxFontCache::MemoryReporter, nsIMemoryReporter)
NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(FontCacheMallocSizeOf)
NS_IMETHODIMP
gfxFontCache::MemoryReporter::GetName(nsACString &aName)
{
aName.AssignLiteral("font-cache");
return NS_OK;
}
NS_IMETHODIMP
gfxFontCache::MemoryReporter::CollectReports
(nsIMemoryReporterCallback* aCb,

View File

@ -950,12 +950,15 @@ public:
FontCacheSizes* aSizes) const;
protected:
class MemoryReporter MOZ_FINAL
: public nsIMemoryReporter
class MemoryReporter MOZ_FINAL : public mozilla::MemoryMultiReporter
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIMEMORYREPORTER
MemoryReporter()
: MemoryMultiReporter("font-cache")
{}
NS_IMETHOD CollectReports(nsIMemoryReporterCallback* aCb,
nsISupports* aClosure);
};
// Observer for notifications that the font cache cares about

View File

@ -71,16 +71,11 @@ gfxFontListPrefObserver::Observe(nsISupports *aSubject,
return NS_OK;
}
NS_IMPL_ISUPPORTS1(gfxPlatformFontList::MemoryReporter, nsIMemoryReporter)
NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(FontListMallocSizeOf)
NS_IMETHODIMP
gfxPlatformFontList::MemoryReporter::GetName(nsACString &aName)
{
aName.AssignLiteral("font-list");
return NS_OK;
}
gfxPlatformFontList::MemoryReporter::MemoryReporter()
: MemoryMultiReporter("font-list")
{}
NS_IMETHODIMP
gfxPlatformFontList::MemoryReporter::CollectReports

View File

@ -178,12 +178,12 @@ public:
void RemoveCmap(const gfxCharacterMap *aCharMap);
protected:
class MemoryReporter MOZ_FINAL
: public nsIMemoryReporter
class MemoryReporter MOZ_FINAL : public mozilla::MemoryMultiReporter
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIMEMORYREPORTER
MemoryReporter();
NS_IMETHOD CollectReports(nsIMemoryReporterCallback *aCb,
nsISupports *aClosure);
};
gfxPlatformFontList(bool aNeedFullnamePostscriptNames = true);

View File

@ -207,70 +207,63 @@ typedef HRESULT (WINAPI*D3D11CreateDeviceFunc)(
ID3D11DeviceContext *ppImmediateContext
);
class GPUAdapterReporter : public nsIMemoryReporter {
class GPUAdapterReporter : public MemoryMultiReporter
{
// Callers must Release the DXGIAdapter after use or risk mem-leak
static bool GetDXGIAdapter(IDXGIAdapter **DXGIAdapter)
{
ID3D10Device1 *D2D10Device;
IDXGIDevice *DXGIDevice;
bool result = false;
if (D2D10Device = mozilla::gfx::Factory::GetDirect3D10Device()) {
if (D2D10Device->QueryInterface(__uuidof(IDXGIDevice), (void **)&DXGIDevice) == S_OK) {
result = (DXGIDevice->GetAdapter(DXGIAdapter) == S_OK);
DXGIDevice->Release();
}
}
return result;
}
public:
NS_DECL_ISUPPORTS
// nsIMemoryReporter abstract method implementation
NS_IMETHOD
GetName(nsACString &aName)
{
aName.AssignLiteral("gpuadapter");
return NS_OK;
}
// nsIMemoryReporter abstract method implementation
public:
GPUAdapterReporter()
: MemoryMultiReporter("gpu-adapter")
{}
NS_IMETHOD
CollectReports(nsIMemoryReporterCallback* aCb,
nsISupports* aClosure)
{
int32_t winVers, buildNum;
HANDLE ProcessHandle = GetCurrentProcess();
int64_t dedicatedBytesUsed = 0;
int64_t sharedBytesUsed = 0;
int64_t committedBytesUsed = 0;
IDXGIAdapter *DXGIAdapter;
HMODULE gdi32Handle;
PFND3DKMTQS queryD3DKMTStatistics;
winVers = gfxWindowsPlatform::WindowsOSVersion(&buildNum);
// GPU memory reporting is not available before Windows 7
if (winVers < gfxWindowsPlatform::kWindows7)
if (winVers < gfxWindowsPlatform::kWindows7)
return NS_OK;
if (gdi32Handle = LoadLibrary(TEXT("gdi32.dll")))
queryD3DKMTStatistics = (PFND3DKMTQS)GetProcAddress(gdi32Handle, "D3DKMTQueryStatistics");
if (queryD3DKMTStatistics && GetDXGIAdapter(&DXGIAdapter)) {
// Most of this block is understood thanks to wj32's work on Process Hacker
DXGI_ADAPTER_DESC adapterDesc;
D3DKMTQS queryStatistics;
DXGIAdapter->GetDesc(&adapterDesc);
DXGIAdapter->Release();
memset(&queryStatistics, 0, sizeof(D3DKMTQS));
queryStatistics.Type = D3DKMTQS_PROCESS;
queryStatistics.AdapterLuid = adapterDesc.AdapterLuid;
@ -278,29 +271,29 @@ public:
if (NT_SUCCESS(queryD3DKMTStatistics(&queryStatistics))) {
committedBytesUsed = queryStatistics.QueryResult.ProcessInfo.SystemMemory.BytesAllocated;
}
memset(&queryStatistics, 0, sizeof(D3DKMTQS));
queryStatistics.Type = D3DKMTQS_ADAPTER;
queryStatistics.AdapterLuid = adapterDesc.AdapterLuid;
if (NT_SUCCESS(queryD3DKMTStatistics(&queryStatistics))) {
ULONG i;
ULONG segmentCount = queryStatistics.QueryResult.AdapterInfo.NbSegments;
for (i = 0; i < segmentCount; i++) {
memset(&queryStatistics, 0, sizeof(D3DKMTQS));
queryStatistics.Type = D3DKMTQS_SEGMENT;
queryStatistics.AdapterLuid = adapterDesc.AdapterLuid;
queryStatistics.QuerySegment.SegmentId = i;
if (NT_SUCCESS(queryD3DKMTStatistics(&queryStatistics))) {
bool aperture;
// SegmentInformation has a different definition in Win7 than later versions
if (winVers < gfxWindowsPlatform::kWindows8)
aperture = queryStatistics.QueryResult.SegmentInfoWin7.Aperture;
else
aperture = queryStatistics.QueryResult.SegmentInfoWin8.Aperture;
memset(&queryStatistics, 0, sizeof(D3DKMTQS));
queryStatistics.Type = D3DKMTQS_PROCESS_SEGMENT;
queryStatistics.AdapterLuid = adapterDesc.AdapterLuid;
@ -320,9 +313,9 @@ public:
}
}
}
FreeLibrary(gdi32Handle);
#define REPORT(_path, _amount, _desc) \
do { \
nsresult rv; \
@ -342,13 +335,12 @@ public:
REPORT("gpu-shared", sharedBytesUsed,
"In-process memory that is shared with the GPU.");
#undef REPORT
return NS_OK;
}
};
NS_IMPL_ISUPPORTS1(GPUAdapterReporter, nsIMemoryReporter)
static __inline void
BuildKeyNameFromFontName(nsAString &aName)
@ -385,13 +377,16 @@ gfxWindowsPlatform::gfxWindowsPlatform()
UpdateRenderMode();
mGPUAdapterReporter = new GPUAdapterReporter();
NS_RegisterMemoryReporter(mGPUAdapterReporter);
// This reporter is disabled because it frequently gives bogus values. See
// bug 917496.
//mGPUAdapterReporter = new GPUAdapterReporter();
//NS_RegisterMemoryReporter(mGPUAdapterReporter);
mGPUAdapterReporter = nullptr;
}
gfxWindowsPlatform::~gfxWindowsPlatform()
{
NS_UnregisterMemoryReporter(mGPUAdapterReporter);
//NS_UnregisterMemoryReporter(mGPUAdapterReporter);
mDeviceManager = nullptr;

View File

@ -50,21 +50,12 @@ using namespace mozilla::image;
NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(ImagesMallocSizeOf)
class imgMemoryReporter MOZ_FINAL :
public nsIMemoryReporter
class imgMemoryReporter MOZ_FINAL : public MemoryMultiReporter
{
public:
imgMemoryReporter()
{
}
NS_DECL_ISUPPORTS
NS_IMETHOD GetName(nsACString &name)
{
name.Assign("images");
return NS_OK;
}
: MemoryMultiReporter("images")
{}
NS_IMETHOD CollectReports(nsIMemoryReporterCallback *callback,
nsISupports *closure)
@ -223,8 +214,6 @@ private:
}
};
NS_IMPL_ISUPPORTS1(imgMemoryReporter, nsIMemoryReporter)
NS_IMPL_ISUPPORTS3(nsProgressNotificationProxy,
nsIProgressEventSink,
nsIChannelEventSink,

View File

@ -1326,13 +1326,7 @@ Neuter(JSContext *cx, unsigned argc, jsval *vp)
return false;
}
void *contents;
uint8_t *data;
if (!JS_StealArrayBufferContents(cx, obj, &contents, &data))
return false;
js_free(contents);
return true;
return JS_NeuterArrayBuffer(cx, obj);
}
static const JSFunctionSpecWithHelp TestingFunctions[] = {

View File

@ -4300,16 +4300,9 @@ if test "$JS_HAS_CTYPES" -a -z "$MOZ_NATIVE_FFI"; then
ac_configure_args="$ac_configure_args --with-pic"
fi
if test "$CROSS_COMPILE"; then
case "$target" in
*-android*|*-linuxandroid*)
export AS CC CXX CPP LD AR RANLIB STRIP CPPFLAGS CFLAGS LDFLAGS
export AS CC CXX CPP LD AR RANLIB STRIP CPPFLAGS CFLAGS LDFLAGS
ac_configure_args="$ac_configure_args --build=$build --host=$target HOST_CC=\"$HOST_CC\""
;;
*)
ac_configure_args="$ac_configure_args --build=$build --host=$target HOST_CC=\"$HOST_CC\" CC=\"$CC\""
;;
esac
ac_configure_args="$ac_configure_args --build=$build --host=$target HOST_CC=\"$HOST_CC\""
fi
if test "$_MSC_VER"; then
# Use a wrapper script for cl and ml that looks more like gcc.

View File

@ -79,6 +79,7 @@ var ignoreCallees = {
"mozilla::CycleCollectedJSRuntime.DescribeCustomObjects" : true, // During tracing, cannot GC.
"mozilla::CycleCollectedJSRuntime.NoteCustomGCThingXPCOMChildren" : true, // During tracing, cannot GC.
"nsIThreadManager.GetIsMainThread" : true,
"PLDHashTableOps.hashKey" : true,
};
function fieldCallCannotGC(csu, fullfield)

View File

@ -2908,38 +2908,22 @@ BaselineCompiler::emit_JSOP_RUNONCE()
return callVM(RunOnceScriptPrologueInfo);
}
static bool
DoCreateRestParameter(JSContext *cx, BaselineFrame *frame, MutableHandleValue res)
{
unsigned numFormals = frame->numFormalArgs() - 1;
unsigned numActuals = frame->numActualArgs();
unsigned numRest = numActuals > numFormals ? numActuals - numFormals : 0;
Value *rest = frame->argv() + numFormals;
JSObject *obj = NewDenseCopiedArray(cx, numRest, rest, nullptr);
if (!obj)
return false;
types::FixRestArgumentsType(cx, obj);
res.setObject(*obj);
return true;
}
typedef bool(*DoCreateRestParameterFn)(JSContext *cx, BaselineFrame *, MutableHandleValue);
static const VMFunction DoCreateRestParameterInfo =
FunctionInfo<DoCreateRestParameterFn>(DoCreateRestParameter);
bool
BaselineCompiler::emit_JSOP_REST()
{
frame.syncStack(0);
prepareVMCall();
masm.loadBaselineFramePtr(BaselineFrameReg, R0.scratchReg());
pushArg(R0.scratchReg());
JSObject *templateObject = NewDenseUnallocatedArray(cx, 0, nullptr, TenuredObject);
if (!templateObject)
return false;
types::FixRestArgumentsType(cx, templateObject);
if (!callVM(DoCreateRestParameterInfo))
// Call IC.
ICRest_Fallback::Compiler compiler(cx, templateObject);
if (!emitOpIC(compiler.getStub(&stubSpace_)))
return false;
// Mark R0 as pushed stack value.
frame.push(R0);
return true;
}

View File

@ -9463,5 +9463,41 @@ ICGetProp_DOMProxyShadowed::ICGetProp_DOMProxyShadowed(IonCode *stubCode,
pcOffset_(pcOffset)
{ }
//
// Rest_Fallback
//
static bool DoRestFallback(JSContext *cx, ICRest_Fallback *stub,
BaselineFrame *frame, MutableHandleValue res)
{
unsigned numFormals = frame->numFormalArgs() - 1;
unsigned numActuals = frame->numActualArgs();
unsigned numRest = numActuals > numFormals ? numActuals - numFormals : 0;
Value *rest = frame->argv() + numFormals;
JSObject *obj = NewDenseCopiedArray(cx, numRest, rest, nullptr);
if (!obj)
return false;
types::FixRestArgumentsType(cx, obj);
res.setObject(*obj);
return true;
}
typedef bool (*DoRestFallbackFn)(JSContext *, ICRest_Fallback *, BaselineFrame *,
MutableHandleValue);
static const VMFunction DoRestFallbackInfo =
FunctionInfo<DoRestFallbackFn>(DoRestFallback);
bool
ICRest_Fallback::Compiler::generateStubCode(MacroAssembler &masm)
{
EmitRestoreTailCallReg(masm);
masm.pushBaselineFramePtr(BaselineFrameReg, R0.scratchReg());
masm.push(BaselineStubReg);
return tailCallVM(DoRestFallbackInfo, masm);
}
} // namespace jit
} // namespace js

View File

@ -5853,6 +5853,47 @@ class ICTypeOf_Typed : public ICFallbackStub
};
};
class ICRest_Fallback : public ICFallbackStub
{
friend class ICStubSpace;
HeapPtrObject templateObject_;
ICRest_Fallback(IonCode *stubCode, JSObject *templateObject)
: ICFallbackStub(ICStub::Rest_Fallback, stubCode), templateObject_(templateObject)
{ }
public:
static const uint32_t MAX_OPTIMIZED_STUBS = 8;
static inline ICRest_Fallback *New(ICStubSpace *space, IonCode *code,
JSObject *templateObject) {
if (!code)
return nullptr;
return space->allocate<ICRest_Fallback>(code, templateObject);
}
JSObject *templateObject() {
return templateObject_;
}
class Compiler : public ICStubCompiler {
protected:
RootedObject templateObject;
bool generateStubCode(MacroAssembler &masm);
public:
Compiler(JSContext *cx, JSObject *templateObject)
: ICStubCompiler(cx, ICStub::Rest_Fallback),
templateObject(cx, templateObject)
{ }
ICStub *getStub(ICStubSpace *space) {
return ICRest_Fallback::New(space, getStubCode(), templateObject);
}
};
};
// Stub for JSOP_RETSUB ("returning" from a |finally| block).
class ICRetSub_Fallback : public ICFallbackStub
{

View File

@ -397,6 +397,8 @@ BaselineInspector::getTemplateObject(jsbytecode *pc)
return stub->toNewArray_Fallback()->templateObject();
case ICStub::NewObject_Fallback:
return stub->toNewObject_Fallback()->templateObject();
case ICStub::Rest_Fallback:
return stub->toRest_Fallback()->templateObject();
case ICStub::Call_Scripted:
if (JSObject *obj = stub->toCall_Scripted()->templateObject())
return obj;

View File

@ -4963,19 +4963,17 @@ IonBuilder::jsop_call(uint32_t argc, bool constructing)
}
JS_ASSERT_IF(gotLambda, originals.length() <= 1);
// If any call targets need to be cloned, clone them. Keep track of the
// originals as we need to case on them for poly inline.
// If any call targets need to be cloned, look for existing clones to use.
// Keep track of the originals as we need to case on them for poly inline.
bool hasClones = false;
ObjectVector targets;
RootedFunction fun(cx);
RootedScript scriptRoot(cx, script());
for (uint32_t i = 0; i < originals.length(); i++) {
fun = &originals[i]->as<JSFunction>();
JSFunction *fun = &originals[i]->as<JSFunction>();
if (fun->hasScript() && fun->nonLazyScript()->shouldCloneAtCallsite) {
fun = CloneFunctionAtCallsite(cx, fun, scriptRoot, pc);
if (!fun)
return false;
hasClones = true;
if (JSFunction *clone = ExistingCloneFunctionAtCallsite(compartment, fun, script(), pc)) {
fun = clone;
hasClones = true;
}
}
if (!targets.append(fun))
return false;
@ -7473,23 +7471,14 @@ IonBuilder::jsop_arguments_length()
return pushConstant(Int32Value(inlineCallInfo_->argv().length()));
}
static JSObject *
CreateRestArgumentsTemplateObject(JSContext *cx, unsigned length)
{
JSObject *templateObject = NewDenseUnallocatedArray(cx, length, nullptr, TenuredObject);
if (templateObject)
types::FixRestArgumentsType(cx, templateObject);
return templateObject;
}
bool
IonBuilder::jsop_rest()
{
// We don't know anything about the callee.
JSObject *templateObject = inspector->getTemplateObject(pc);
JS_ASSERT(templateObject->is<ArrayObject>());
if (inliningDepth_ == 0) {
JSObject *templateObject = CreateRestArgumentsTemplateObject(cx, 0);
if (!templateObject)
return false;
// We don't know anything about the callee.
MArgumentsLength *numActuals = MArgumentsLength::New();
current->add(numActuals);
@ -7505,9 +7494,6 @@ IonBuilder::jsop_rest()
unsigned numActuals = inlineCallInfo_->argv().length();
unsigned numFormals = info().nargs() - 1;
unsigned numRest = numActuals > numFormals ? numActuals - numFormals : 0;
JSObject *templateObject = CreateRestArgumentsTemplateObject(cx, numRest);
if (!templateObject)
return false;
MNewArray *array = new MNewArray(numRest, templateObject, MNewArray::NewArray_Allocating);
current->add(array);

View File

@ -583,7 +583,7 @@ class IonBuilder : public MIRGenerator
InliningStatus inlineNewParallelArray(CallInfo &callInfo);
InliningStatus inlineParallelArray(CallInfo &callInfo);
InliningStatus inlineParallelArrayTail(CallInfo &callInfo,
HandleFunction target,
JSFunction *target,
MDefinition *ctor,
types::TemporaryTypeSet *ctorTypes,
uint32_t discards);

View File

@ -1195,14 +1195,12 @@ IonBuilder::inlineNewParallelArray(CallInfo &callInfo)
types::TemporaryTypeSet *ctorTypes = callInfo.getArg(0)->resultTypeSet();
JSObject *targetObj = ctorTypes ? ctorTypes->getSingleton() : nullptr;
RootedFunction target(cx);
JSFunction *target = nullptr;
if (targetObj && targetObj->is<JSFunction>())
target = &targetObj->as<JSFunction>();
if (target && target->isInterpreted() && target->nonLazyScript()->shouldCloneAtCallsite) {
RootedScript scriptRoot(cx, script());
target = CloneFunctionAtCallsite(cx, target, scriptRoot, pc);
if (!target)
return InliningStatus_Error;
if (JSFunction *clone = ExistingCloneFunctionAtCallsite(compartment, target, script(), pc))
target = clone;
}
MDefinition *ctor = makeCallsiteClone(
target,
@ -1220,15 +1218,13 @@ IonBuilder::inlineParallelArray(CallInfo &callInfo)
return InliningStatus_NotInlined;
uint32_t argc = callInfo.argc();
RootedFunction target(cx, ParallelArrayObject::getConstructor(cx, argc));
JSFunction *target = ParallelArrayObject::getConstructor(cx, argc);
if (!target)
return InliningStatus_Error;
JS_ASSERT(target->nonLazyScript()->shouldCloneAtCallsite);
RootedScript script(cx, script_);
target = CloneFunctionAtCallsite(cx, target, script, pc);
if (!target)
return InliningStatus_Error;
if (JSFunction *clone = ExistingCloneFunctionAtCallsite(compartment, target, script(), pc))
target = clone;
MConstant *ctor = MConstant::New(ObjectValue(*target));
current->add(ctor);
@ -1238,7 +1234,7 @@ IonBuilder::inlineParallelArray(CallInfo &callInfo)
IonBuilder::InliningStatus
IonBuilder::inlineParallelArrayTail(CallInfo &callInfo,
HandleFunction target,
JSFunction *target,
MDefinition *ctor,
types::TemporaryTypeSet *ctorTypes,
uint32_t discards)

View File

@ -110,9 +110,10 @@ JSCompartment::sweepCallsiteClones()
}
JSFunction *
js::CloneFunctionAtCallsite(JSContext *cx, HandleFunction fun, HandleScript script, jsbytecode *pc)
js::ExistingCloneFunctionAtCallsite(JSCompartment *comp, JSFunction *fun,
JSScript *script, jsbytecode *pc)
{
JS_ASSERT(cx->typeInferenceEnabled());
JS_ASSERT(comp->zone()->types.inferenceEnabled);
JS_ASSERT(fun->nonLazyScript()->shouldCloneAtCallsite);
JS_ASSERT(!fun->nonLazyScript()->enclosingStaticScope());
JS_ASSERT(types::UseNewTypeForClone(fun));
@ -126,23 +127,25 @@ js::CloneFunctionAtCallsite(JSContext *cx, HandleFunction fun, HandleScript scri
typedef CallsiteCloneKey Key;
typedef CallsiteCloneTable Table;
Table &table = cx->compartment()->callsiteClones;
if (!table.initialized() && !table.init())
Table &table = comp->callsiteClones;
if (!table.initialized())
return nullptr;
uint32_t offset = pc - script->code;
void* originalScript = script;
void* originalFun = fun;
SkipRoot skipScript(cx, &originalScript);
SkipRoot skipFun(cx, &originalFun);
Table::AddPtr p = table.lookupForAdd(Key(fun, script, offset));
SkipRoot skipHash(cx, &p); /* Prevent the hash from being poisoned. */
Table::Ptr p = table.lookup(Key(fun, script, pc - script->code));
if (p)
return p->value;
return nullptr;
}
JSFunction *
js::CloneFunctionAtCallsite(JSContext *cx, HandleFunction fun, HandleScript script, jsbytecode *pc)
{
if (JSFunction *clone = ExistingCloneFunctionAtCallsite(cx->compartment(), fun, script, pc))
return clone;
RootedObject parent(cx, fun->environment());
RootedFunction clone(cx, CloneFunctionObject(cx, fun, parent));
JSFunction *clone = CloneFunctionObject(cx, fun, parent);
if (!clone)
return nullptr;
@ -154,15 +157,14 @@ js::CloneFunctionAtCallsite(JSContext *cx, HandleFunction fun, HandleScript scri
clone->nonLazyScript()->isCallsiteClone = true;
clone->nonLazyScript()->setOriginalFunctionObject(fun);
Key key(fun, script, offset);
typedef CallsiteCloneKey Key;
typedef CallsiteCloneTable Table;
/* Recalculate the hash if script or fun have been moved. */
if (script != originalScript || fun != originalFun) {
p = table.lookupForAdd(key);
JS_ASSERT(!p);
}
Table &table = cx->compartment()->callsiteClones;
if (!table.initialized() && !table.init())
return nullptr;
if (!table.relookupOrAdd(p, key, clone.get()))
if (!table.putNew(Key(fun, script, pc - script->code), clone))
return nullptr;
return clone;

View File

@ -64,6 +64,10 @@ typedef HashMap<CallsiteCloneKey,
CallsiteCloneKey,
SystemAllocPolicy> CallsiteCloneTable;
JSFunction *
ExistingCloneFunctionAtCallsite(JSCompartment *comp, JSFunction *fun,
JSScript *script, jsbytecode *pc);
JSFunction *CloneFunctionAtCallsite(JSContext *cx, HandleFunction fun,
HandleScript script, jsbytecode *pc);

View File

@ -1248,8 +1248,8 @@ JS_GetArrayBufferViewBuffer(JSObject *obj);
/*
* Set an ArrayBuffer's length to 0 and neuter all of its views.
*/
extern JS_FRIEND_API(void)
JS_NeuterArrayBuffer(JSObject *obj, JSContext *cx);
extern JS_FRIEND_API(bool)
JS_NeuterArrayBuffer(JSContext *cx, JS::HandleObject obj);
/*
* Check whether obj supports JS_GetDataView* APIs.

View File

@ -4031,12 +4031,12 @@ JS_GetArrayBufferData(JSObject *obj)
}
JS_FRIEND_API(bool)
JS_NeuterArrayBuffer(JSContext *cx, JSObject *obj)
JS_NeuterArrayBuffer(JSContext *cx, HandleObject obj)
{
ArrayBufferObject &buffer = obj->as<ArrayBufferObject>();
if (!buffer.neuterViews(cx))
Rooted<ArrayBufferObject*> buffer(cx, &obj->as<ArrayBufferObject>());
if (!buffer->neuterViews(cx))
return false;
buffer.neuter(cx);
buffer->neuter(cx);
return true;
}

View File

@ -2398,15 +2398,12 @@ ReportJSRuntimeExplicitTreeStats(const JS::RuntimeStats &rtStats,
} // namespace xpc
class JSMainRuntimeCompartmentsReporter MOZ_FINAL : public nsIMemoryReporter
class JSMainRuntimeCompartmentsReporter MOZ_FINAL : public MemoryMultiReporter
{
public:
NS_DECL_THREADSAFE_ISUPPORTS
NS_IMETHOD GetName(nsACString &name) {
name.AssignLiteral("js-main-runtime-compartments");
return NS_OK;
}
JSMainRuntimeCompartmentsReporter()
: MemoryMultiReporter("js-main-runtime-compartments")
{}
typedef js::Vector<nsCString, 0, js::SystemAllocPolicy> Paths;
@ -2445,8 +2442,6 @@ class JSMainRuntimeCompartmentsReporter MOZ_FINAL : public nsIMemoryReporter
}
};
NS_IMPL_ISUPPORTS1(JSMainRuntimeCompartmentsReporter, nsIMemoryReporter)
NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(OrphanMallocSizeOf)
namespace xpc {

View File

@ -50,7 +50,7 @@ include multicol3/reftest.list
# include transitions/reftest.list
# User Interface Level 3
# include ui3/reftest.list
include ui3/reftest.list
# Values and Units Level 3
include values3/reftest.list

View File

@ -0,0 +1,40 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Reference: Box Sizing - Border-Box with specified width</title>
<link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
<style type="text/css"><![CDATA[
.container {
width: 300px;
border: 2px solid black;
position: absolute;
left: 25px;
top: 25px;
background-color: red;
}
.box-sized {
width: 140px;
z-index: 1;
float: left;
border: 5px solid black;
}
#one {
background-color: green;
}
#two {
background-color: blue;
}
]]></style>
</head>
<body>
The two divs should be side-by-side, not one on top of another. No red should be visible.
<br />
<div class="container">
<div class="box-sized" id="one">LEFT HALF</div>
<div class="box-sized" id="two">RIGHT HALF</div>
</div>
</body>
</html>

View File

@ -0,0 +1,43 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Box Sizing - Border-Box with specified width</title>
<link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
<link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
<meta name="assert" content="-moz-box-sizing: border-box should make the element's (percentage) width be the distance from the left border edge to the right border edge." />
<style type="text/css"><![CDATA[
.container {
width: 300px;
border: 2px solid black;
position: absolute;
left: 25px;
top: 25px;
background-color: red;
}
.box-sized {
-moz-box-sizing: border-box;
width: 50%;
z-index: 1;
float: left;
border: 5px solid black;
}
#one {
background-color: green;
}
#two {
background-color: blue;
}
]]></style>
</head>
<body>
The two divs should be side-by-side, not one on top of another. No red should be visible.
<br />
<div class="container">
<div class="box-sized" id="one">LEFT HALF</div>
<div class="box-sized" id="two">RIGHT HALF</div>
</div>
</body>
</html>

View File

@ -0,0 +1,41 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Reference: Box Sizing - Border-Box with specified width</title>
<link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
<style type="text/css"><![CDATA[
.container {
width: 300px;
border: 2px solid black;
position: absolute;
left: 25px;
top: 25px;
background-color: red;
}
.box-sized {
width: 120px;
z-index: 1;
float: left;
border: 5px solid black;
padding: 0px 10px;
}
#one {
background-color: green;
}
#two {
background-color: blue;
}
]]></style>
</head>
<body>
The two divs should be side-by-side, not one on top of another. No red should be visible.
<br />
<div class="container">
<div class="box-sized" id="one">LEFT HALF</div>
<div class="box-sized" id="two">RIGHT HALF</div>
</div>
</body>
</html>

View File

@ -0,0 +1,44 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Box Sizing - Border-Box with specified width</title>
<link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
<link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
<meta name="assert" content="-moz-box-sizing: border-box should make the element's (percentage) width be the distance from the left border edge to the right border edge." />
<style type="text/css"><![CDATA[
.container {
width: 300px;
border: 2px solid black;
position: absolute;
left: 25px;
top: 25px;
background-color: red;
}
.box-sized {
-moz-box-sizing: border-box;
width: 50%;
z-index: 1;
float: left;
border: 5px solid black;
padding: 0px 10px;
}
#one {
background-color: green;
}
#two {
background-color: blue;
}
]]></style>
</head>
<body>
The two divs should be side-by-side, not one on top of another. No red should be visible.
<br />
<div class="container">
<div class="box-sized" id="one">LEFT HALF</div>
<div class="box-sized" id="two">RIGHT HALF</div>
</div>
</body>
</html>

View File

@ -0,0 +1,43 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Reference: Box Sizing - Border-Box with specified width/height</title>
<link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
<style type="text/css"><![CDATA[
.container {
width: 300px;
height: 400px;
border: 2px solid black;
position: absolute;
left: 25px;
top: 25px;
background-color: red;
}
.box-sized {
width: 120px;
height: 340px;
z-index: 1;
float: left;
border: 5px solid black;
padding: 25px 10px;
}
#one {
background-color: green;
}
#two {
background-color: blue;
}
]]></style>
</head>
<body>
The two divs should be side-by-side, not one on top of another. No red should be visible.
<br />
<div class="container">
<div class="box-sized" id="one">LEFT HALF</div>
<div class="box-sized" id="two">RIGHT HALF</div>
</div>
</body>
</html>

View File

@ -0,0 +1,46 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Box Sizing - Border-Box with specified width/height</title>
<link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
<link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
<meta name="assert" content="-moz-box-sizing: border-box should make the element's (percentage) width be the distance from the left border edge to the right border edge and the height be the distance from the top border edge to the bottom border edge." />
<style type="text/css"><![CDATA[
.container {
width: 300px;
height: 400px;
border: 2px solid black;
position: absolute;
left: 25px;
top: 25px;
background-color: red;
}
.box-sized {
-moz-box-sizing: border-box;
width: 50%;
height: 100%;
z-index: 1;
float: left;
border: 5px solid black;
padding: 25px 10px;
}
#one {
background-color: green;
}
#two {
background-color: blue;
}
]]></style>
</head>
<body>
The two divs should be side-by-side, not one on top of another. No red should be visible.
<br />
<div class="container">
<div class="box-sized" id="one">LEFT HALF</div>
<div class="box-sized" id="two">RIGHT HALF</div>
</div>
</body>
</html>

View File

@ -0,0 +1,46 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Reference: Box Sizing - Border-Box with min/max width/height</title>
<link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
<style type="text/css"><![CDATA[
.container {
min-width: 500px;
max-width: 700px;
min-height: 70px;
max-height: 90px;
border: 2px solid black;
position: absolute;
left: 25px;
top: 25px;
background-color: red;
}
.box-sized {
min-width: 240px;
max-width: 340px;
min-height: 60px;
max-height: 80px;
z-index: 1;
float: left;
border: 5px solid black;
}
#one {
background-color: green;
}
#two {
background-color: blue;
}
]]></style>
</head>
<body>
The two divs should be side-by-side, not one on top of another. No red should be visible.
<br />
<div class="container">
<div class="box-sized" id="one">LEFT HALF</div>
<div class="box-sized" id="two">RIGHT HALF</div>
</div>
</body>
</html>

View File

@ -0,0 +1,49 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Box Sizing - Border-Box with min/max width/height</title>
<link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
<link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
<meta name="assert" content="-moz-box-sizing: border-box should make the element's (length) width be the distance from the left border edge to the right border edge and the height be the distance from the top border edge to the bottom border edge." />
<style type="text/css"><![CDATA[
.container {
min-width: 500px;
max-width: 700px;
min-height: 70px;
max-height: 90px;
border: 2px solid black;
position: absolute;
left: 25px;
top: 25px;
background-color: red;
}
.box-sized {
-moz-box-sizing: border-box;
min-width: 250px;
max-width: 350px;
min-height: 70px;
max-height: 90px;
z-index: 1;
float: left;
border: 5px solid black;
}
#one {
background-color: green;
}
#two {
background-color: blue;
}
]]></style>
</head>
<body>
The two divs should be side-by-side, not one on top of another. No red should be visible.
<br />
<div class="container">
<div class="box-sized" id="one">LEFT HALF</div>
<div class="box-sized" id="two">RIGHT HALF</div>
</div>
</body>
</html>

View File

@ -0,0 +1,41 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Reference: Box Sizing - Content-Box with specified width/height</title>
<link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
<style type="text/css"><![CDATA[
.container {
width: 300px;
height: 110px;
border: 2px solid black;
position: absolute;
left: 25px;
top: 25px;
background-color: red;
}
.box-sized {
width: 150px;
height: 110px;
z-index: 1;
float: left;
}
#one {
background-color: green;
}
#two {
background-color: blue;
}
]]></style>
</head>
<body>
The two divs should be side-by-side, not one on top of another. No red should be visible.
<br />
<div class="container">
<div class="box-sized" id="one">LEFT HALF</div>
<div class="box-sized" id="two">RIGHT HALF</div>
</div>
</body>
</html>

View File

@ -0,0 +1,44 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Box Sizing - Content-Box with specified width/height</title>
<link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
<link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
<meta name="assert" content="-moz-box-sizing: content-box should make the element's (percentage) width be the distance from the left content edge to the right content edge and the height be the distance from the top content edge to the bottom content edge."/>
<style type="text/css"><![CDATA[
.container {
width: 300px;
height: 110px;
border: 2px solid black;
position: absolute;
left: 25px;
top: 25px;
background-color: red;
}
.box-sized {
-moz-box-sizing: content-box;
width: 50%;
height: 100%;
z-index: 1;
float: left;
}
#one {
background-color: green;
}
#two {
background-color: blue;
}
]]></style>
</head>
<body>
The two divs should be side-by-side, not one on top of another. No red should be visible.
<br />
<div class="container">
<div class="box-sized" id="one">LEFT HALF</div>
<div class="box-sized" id="two">RIGHT HALF</div>
</div>
</body>
</html>

View File

@ -0,0 +1,42 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Reference: Box Sizing - Content-Box with specified width/height</title>
<link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
<style type="text/css"><![CDATA[
.container {
width: 300px;
height: 100px;
border: 2px solid black;
position: absolute;
left: 25px;
top: 25px;
background-color: red;
}
.box-sized {
width: 140px;
height: 90px;
z-index: 1;
float: left;
padding: 5px 5px;
}
#one {
background-color: green;
}
#two {
background-color: blue;
}
]]></style>
</head>
<body>
The two divs should be side-by-side, not one on top of another. No red should be visible.
<br />
<div class="container">
<div class="box-sized" id="one">LEFT HALF</div>
<div class="box-sized" id="two">RIGHT HALF</div>
</div>
</body>
</html>

View File

@ -0,0 +1,45 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Box Sizing - Content-Box with specified width/height</title>
<link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
<link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
<meta name="assert" content="-moz-box-sizing: content-box should make the element's (calc) width be the distance from the left content edge to the right content edge and the height be the distance from the top content edge to the bottom content edge."/>
<style type="text/css"><![CDATA[
.container {
width: 300px;
height: 100px;
border: 2px solid black;
position: absolute;
left: 25px;
top: 25px;
background-color: red;
}
.box-sized {
-moz-box-sizing: content-box;
width: calc(50% - 10px);
height: calc(100% - 10px);
z-index: 1;
float: left;
padding: 5px 5px;
}
#one {
background-color: green;
}
#two {
background-color: blue;
}
]]></style>
</head>
<body>
The two divs should be side-by-side, not one on top of another. No red should be visible.
<br />
<div class="container">
<div class="box-sized" id="one">LEFT HALF</div>
<div class="box-sized" id="two">RIGHT HALF</div>
</div>
</body>
</html>

View File

@ -0,0 +1,43 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Reference: Box Sizing - Content-Box with min/max width/height</title>
<link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
<style type="text/css"><![CDATA[
.container {
min-width: 500px;
max-width: 700px;
height: 90px;
border: 2px solid black;
position: absolute;
left: 25px;
top: 25px;
background-color: red;
}
.box-sized {
min-width: 250px;
max-width: 350px;
height: 100%;
z-index: 1;
float: left;
}
#one {
background-color: green;
}
#two {
background-color: blue;
}
]]></style>
</head>
<body>
The two divs should be side-by-side, not one on top of another. No red should be visible.
<br />
<div class="container">
<div class="box-sized" id="one">LEFT HALF</div>
<div class="box-sized" id="two">RIGHT HALF</div>
</div>
</body>
</html>

View File

@ -0,0 +1,45 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Box Sizing - Content-Box with min/max width/height</title>
<link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
<link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
<meta name="assert" content="-moz-box-sizing: content-box should make the element's (percentage) width be the distance from the left content edge to the right content edge and the height be the distance from the top content edge to the bottom content edge."/>
<style type="text/css"><![CDATA[
.container {
min-width: 500px;
max-width: 700px;
height: 90px;
border: 2px solid black;
position: absolute;
left: 25px;
top: 25px;
background-color: red;
}
.box-sized {
-moz-box-sizing: content-box;
width: 50%;
height: 100%;
z-index: 1;
float: left;
}
#one {
background-color: green;
}
#two {
background-color: blue;
}
]]></style>
</head>
<body>
The two divs should be side-by-side, not one on top of another. No red should be visible.
<br />
<div class="container">
<div class="box-sized" id="one">LEFT HALF</div>
<div class="box-sized" id="two">RIGHT HALF</div>
</div>
</body>
</html>

View File

@ -0,0 +1,40 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Reference: Box Sizing - Padding-Box with specified width/height</title>
<link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
<style type="text/css"><![CDATA[
.container {
width: 300px;
border: 2px solid black;
position: absolute;
left: 25px;
top: 25px;
background-color: red;
}
.box-sized {
width: 140px;
z-index: 1;
float: left;
padding: 0px 5px;
}
#one {
background-color: green;
}
#two {
background-color: blue;
}
]]></style>
</head>
<body>
The two divs should be side-by-side, not one on top of another. No red should be visible.
<br />
<div class="container">
<div class="box-sized" id="one">LEFT HALF</div>
<div class="box-sized" id="two">RIGHT HALF</div>
</div>
</body>
</html>

View File

@ -0,0 +1,43 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Box Sizing - Padding-Box with specified width/height</title>
<link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
<link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
<meta name="assert" content="-moz-box-sizing: padding-box should make the element's (percentage) width be the distance from the left padding edge to the right padding edge."/>
<style type="text/css"><![CDATA[
.container {
width: 300px;
border: 2px solid black;
position: absolute;
left: 25px;
top: 25px;
background-color: red;
}
.box-sized {
-moz-box-sizing: padding-box;
width: 50%;
z-index: 1;
float: left;
padding: 0px 5px;
}
#one {
background-color: green;
}
#two {
background-color: blue;
}
]]></style>
</head>
<body>
The two divs should be side-by-side, not one on top of another. No red should be visible.
<br />
<div class="container">
<div class="box-sized" id="one">LEFT HALF</div>
<div class="box-sized" id="two">RIGHT HALF</div>
</div>
</body>
</html>

View File

@ -0,0 +1,42 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Reference: Box Sizing - Padding-Box with specified width/height</title>
<link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
<style type="text/css"><![CDATA[
.container {
width: 300px;
height: 400px;
border: 2px solid black;
position: absolute;
left: 25px;
top: 25px;
background-color: red;
}
.box-sized {
width: 130px;
height: 350px;
z-index: 1;
float: left;
padding: 25px 10px;
}
#one {
background-color: green;
}
#two {
background-color: blue;
}
]]></style>
</head>
<body>
The two divs should be side-by-side, not one on top of another. No red should be visible.
<br />
<div class="container">
<div class="box-sized" id="one">LEFT HALF</div>
<div class="box-sized" id="two">RIGHT HALF</div>
</div>
</body>
</html>

View File

@ -0,0 +1,45 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Box Sizing - Padding-Box with specified width/height</title>
<link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
<link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
<meta name="assert" content="-moz-box-sizing: padding-box should make the element's (percentage) width be the distance from the left padding edge to the right padding edge and the height be the distance from the top padding edge to the bottom padding edge."/>
<style type="text/css"><![CDATA[
.container {
width: 300px;
height: 400px;
border: 2px solid black;
position: absolute;
left: 25px;
top: 25px;
background-color: red;
}
.box-sized {
-moz-box-sizing: padding-box;
width: 50%;
height: 100%;
z-index: 1;
float: left;
padding: 25px 10px;
}
#one {
background-color: green;
}
#two {
background-color: blue;
}
]]></style>
</head>
<body>
The two divs should be side-by-side, not one on top of another. No red should be visible.
<br />
<div class="container">
<div class="box-sized" id="one">LEFT HALF</div>
<div class="box-sized" id="two">RIGHT HALF</div>
</div>
</body>
</html>

View File

@ -0,0 +1,42 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Reference: Box Sizing - Padding-Box with min/max width/height</title>
<link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
<style type="text/css"><![CDATA[
.container {
width: 500px;
height: 70px;
border: 2px solid black;
position: absolute;
left: 25px;
top: 25px;
background-color: red;
}
.box-sized {
height: calc(100% - 10px);
width: calc(50% - 10px);
z-index: 1;
float: left;
padding: 5px 5px;
}
#one {
background-color: green;
}
#two {
background-color: blue;
}
]]></style>
</head>
<body>
The two divs should be side-by-side, not one on top of another. No red should be visible.
<br />
<div class="container">
<div class="box-sized" id="one">LEFT HALF</div>
<div class="box-sized" id="two">RIGHT HALF</div>
</div>
</body>
</html>

View File

@ -0,0 +1,49 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Box Sizing - Padding-Box with min/max width/height</title>
<link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
<link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
<meta name="assert" content="-moz-box-sizing: padding-box should make the element's (calc) width be the distance from the left padding edge to the right padding edge and the height be the distance from the top padding edge to the bottom padding edge."/>
<style type="text/css"><![CDATA[
.container {
min-width: 500px;
max-width: 700px;
min-height: 70px;
max-height: 90px;
border: 2px solid black;
position: absolute;
left: 25px;
top: 25px;
background-color: red;
}
.box-sized {
-moz-box-sizing: padding-box;
min-width: 250px;
max-width: 350px;
min-height: 70px;
max-height: 90px;
z-index: 1;
float: left;
padding: 5px 5px;
}
#one {
background-color: green;
}
#two {
background-color: blue;
}
]]></style>
</head>
<body>
The two divs should be side-by-side, not one on top of another. No red should be visible.
<br />
<div class="container">
<div class="box-sized" id="one">LEFT HALF</div>
<div class="box-sized" id="two">RIGHT HALF</div>
</div>
</body>
</html>

View File

@ -0,0 +1,52 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Reference: Min/Max Height and Width Constraints on Replaced Elements with Box-Sizing</title>
<link href="http://fantasai.inkedblade.net/contact" title="Elika J. Etemad" rel="author"></link>
<link href="mailto:sjohnson@mozilla.com" title="Scott Johnson" rel="author"></link>
<meta content="image" name="flags"></meta>
<!--
<link rel="help" href="http://www.w3.org/TR/2012/WD-css3-ui-20120117/#box-sizing">
-->
<style type="text/css">
p {
display: inline-block;
background-color: white;
margin: 0px 0px;
padding: 0px 0px;
}
.with-padding {
padding: 5px 5px;
}
#img {
width: 75px;
height: 75px;
}
</style>
</head>
<body>
<div>All rectangles should be the same size.</div>
<p><img class="with-padding" src="support/replaced-min-max.png" alt="FAIL" title="Test 0"></img></p>
<p><img id="img" class="with-padding" title="Test 1" alt="FAIL" src="support/replaced-min-max-1.png"></img></p>
<p><img id="img" class="with-padding" title="Test 2" alt="FAIL" src="support/replaced-min-max-2.png"></img></p>
<p><img id="img" class="with-padding" title="Test 3" alt="FAIL" src="support/replaced-min-max-3.png"></img></p>
<p><img id="img" class="with-padding" title="Test 4" alt="FAIL" src="support/replaced-min-max-4.png"></img></p>
<p><img id="img" class="with-padding" title="Test 5" alt="FAIL" src="support/replaced-min-max-5.png"></img></p>
<p><img id="img" class="with-padding" title="Test 6" alt="FAIL" src="support/replaced-min-max-6.png"></img></p>
<p><img id="img" class="with-padding" title="Test 7" alt="FAIL" src="support/replaced-min-max-7.png"></img></p>
<p><img id="img" class="with-padding" title="Test 8" alt="FAIL" src="support/replaced-min-max-8.png"></img></p>
<p><img id="img" class="with-padding" title="Test 9" alt="FAIL" src="support/replaced-min-max-9.png"></img></p>
<p><img id="img" class="with-padding" title="Test 10" alt="FAIL" src="support/replaced-min-max-10.png"></img></p>
<p><img id="img" class="with-padding" title="Test 11" alt="FAIL" src="support/replaced-min-max-11.png"></img></p>
<p><img id="img" class="with-padding" title="Test 12" alt="FAIL" src="support/replaced-min-max-12.png"></img></p>
<p><img id="img" class="with-padding" title="Test 13" alt="FAIL" src="support/replaced-min-max-13.png"></img></p>
<p><img id="img" class="with-padding" title="Test 14" alt="FAIL" src="support/replaced-min-max-14.png"></img></p>
<p><img id="img" class="with-padding" title="Test 15" alt="FAIL" src="support/replaced-min-max-15.png"></img></p>
<p><img id="img" class="with-padding" title="Test 16" alt="FAIL" src="support/replaced-min-max-16.png"></img></p>
<p><img id="img" class="with-padding" title="Test 17" alt="FAIL" src="support/replaced-min-max-17.png"></img></p>
<p><img id="img" class="with-padding" title="Test 18" alt="FAIL" src="support/replaced-min-max-18.png"></img></p>
<p><img id="img" class="with-padding" title="Test 19" alt="FAIL" src="support/replaced-min-max-19.png"></img></p>
</body>
</html>

View File

@ -0,0 +1,156 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Min/Max Height and Width Constraints on Replaced Elements with Box-Sizing</title>
<link href="http://fantasai.inkedblade.net/contact" title="Elika J. Etemad" rel="author"></link>
<link href="mailto:sjohnson@mozilla.com" title="Scott Johnson" rel="author"></link>
<link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
<meta content="image" name="flags"></meta>
<meta name="assert" content="All images should be sized at 75px x 75px, with 5px of padding around each." />
<!--
This test is derived from replaced-min-max-001, part of the W3C CSS 2.1
test suite.
-->
<style type="text/css">
p {
display: inline-block;
background-color: white;
padding: 0px 0px;
margin: 0px 0px;
}
.with-padding {
padding: 5px 5px;
-moz-box-sizing: padding-box;
}
#img1 {
min-width: 70px;
max-width: 115px;
min-height: 55px;
max-height: 130px;
}
#img2 {
max-width: 85px;
min-height: 70px;
}
#img3 {
max-width: 85px;
min-height: 85px;
}
#img4 {
min-width: 85px;
max-height: 110px;
}
#img5 {
min-width: 85px;
max-height: 85px;
}
#img6 {
min-width: 70px;
max-height: 85px;
}
#img7 {
min-width: 85px;
max-height: 85px;
}
#img8 {
max-width: 110px;
min-height: 85px;
}
#img9 {
max-width: 85px;
min-height: 85px;
}
#img10 {
min-width: 85px;
max-width: 160px;
max-height: 85px;
}
#img11 {
min-width: 35px;
max-width: 235px;
max-height: 85px;
}
#img12 {
max-width: 85px;
min-height: 85px;
max-height: 160px;
}
#img13 {
max-width: 85px;
min-height: 35px;
max-height: 235px;
}
#img14 {
min-width: 60px;
max-width: 110px;
min-height: 85px;
}
#img15 {
min-width: 65px;
max-width: 85px;
min-height: 85px;
}
#img16 {
min-width: 85px;
min-height: 60px;
max-height: 110px;
}
#img17 {
min-width: 85px;
min-height: 65px;
max-height: 85px;
}
#img18 {
min-width: 85px;
max-height: 85px;
}
#img19 {
max-width: 85px;
min-height: 85px;
}
</style>
</head>
<body>
<div>All rectangles should be the same size.</div>
<p><img id="img0" class="with-padding" src="support/replaced-min-max.png" alt="FAIL" title="Test 0"></img></p>
<p><img id="img1" class="with-padding" title="Test 1" alt="FAIL" src="support/replaced-min-max-1.png"></img></p>
<p><img id="img2" class="with-padding" title="Test 2" alt="FAIL" src="support/replaced-min-max-2.png"></img></p>
<p><img id="img3" class="with-padding" title="Test 3" alt="FAIL" src="support/replaced-min-max-3.png"></img></p>
<p><img id="img4" class="with-padding" title="Test 4" alt="FAIL" src="support/replaced-min-max-4.png"></img></p>
<p><img id="img5" class="with-padding" title="Test 5" alt="FAIL" src="support/replaced-min-max-5.png"></img></p>
<p><img id="img6" class="with-padding" title="Test 6" alt="FAIL" src="support/replaced-min-max-6.png"></img></p>
<p><img id="img7" class="with-padding" title="Test 7" alt="FAIL" src="support/replaced-min-max-7.png"></img></p>
<p><img id="img8" class="with-padding" title="Test 8" alt="FAIL" src="support/replaced-min-max-8.png"></img></p>
<p><img id="img9" class="with-padding" title="Test 9" alt="FAIL" src="support/replaced-min-max-9.png"></img></p>
<p><img id="img10" class="with-padding" title="Test 10" alt="FAIL" src="support/replaced-min-max-10.png"></img></p>
<p><img id="img11" class="with-padding" title="Test 11" alt="FAIL" src="support/replaced-min-max-11.png"></img></p>
<p><img id="img12" class="with-padding" title="Test 12" alt="FAIL" src="support/replaced-min-max-12.png"></img></p>
<p><img id="img13" class="with-padding" title="Test 13" alt="FAIL" src="support/replaced-min-max-13.png"></img></p>
<p><img id="img14" class="with-padding" title="Test 14" alt="FAIL" src="support/replaced-min-max-14.png"></img></p>
<p><img id="img15" class="with-padding" title="Test 15" alt="FAIL" src="support/replaced-min-max-15.png"></img></p>
<p><img id="img16" class="with-padding" title="Test 16" alt="FAIL" src="support/replaced-min-max-16.png"></img></p>
<p><img id="img17" class="with-padding" title="Test 17" alt="FAIL" src="support/replaced-min-max-17.png"></img></p>
<p><img id="img18" class="with-padding" title="Test 18" alt="FAIL" src="support/replaced-min-max-18.png"></img></p>
<p><img id="img19" class="with-padding" title="Test 19" alt="FAIL" src="support/replaced-min-max-19.png"></img></p>
</body>
</html>

View File

@ -0,0 +1,53 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Reference: Min/Max Height and Width Constraints on Replaced Elements with Box-Sizing</title>
<link href="http://fantasai.inkedblade.net/contact" title="Elika J. Etemad" rel="author"></link>
<link href="mailto:sjohnson@mozilla.com" title="Scott Johnson" rel="author"></link>
<meta content="image" name="flags"></meta>
<!--
<link rel="help" href="http://www.w3.org/TR/2012/WD-css3-ui-20120117/#box-sizing">
-->
<style type="text/css">
p {
display: inline-block;
background-color: white;
margin: 0px 0px;
padding: 0px 0px;
}
.with-borderpadding {
padding: 5px 5px;
border: 5px solid blue;
}
#img {
width: 75px;
height: 75px;
}
</style>
</head>
<body>
<div>All rectangles should be the same size.</div>
<p><img class="with-borderpadding" src="support/replaced-min-max.png" alt="FAIL" title="Test 0"></img></p>
<p><img id="img" class="with-borderpadding" title="Test 1" alt="FAIL" src="support/replaced-min-max-1.png"></img></p>
<p><img id="img" class="with-borderpadding" title="Test 2" alt="FAIL" src="support/replaced-min-max-2.png"></img></p>
<p><img id="img" class="with-borderpadding" title="Test 3" alt="FAIL" src="support/replaced-min-max-3.png"></img></p>
<p><img id="img" class="with-borderpadding" title="Test 4" alt="FAIL" src="support/replaced-min-max-4.png"></img></p>
<p><img id="img" class="with-borderpadding" title="Test 5" alt="FAIL" src="support/replaced-min-max-5.png"></img></p>
<p><img id="img" class="with-borderpadding" title="Test 6" alt="FAIL" src="support/replaced-min-max-6.png"></img></p>
<p><img id="img" class="with-borderpadding" title="Test 7" alt="FAIL" src="support/replaced-min-max-7.png"></img></p>
<p><img id="img" class="with-borderpadding" title="Test 8" alt="FAIL" src="support/replaced-min-max-8.png"></img></p>
<p><img id="img" class="with-borderpadding" title="Test 9" alt="FAIL" src="support/replaced-min-max-9.png"></img></p>
<p><img id="img" class="with-borderpadding" title="Test 10" alt="FAIL" src="support/replaced-min-max-10.png"></img></p>
<p><img id="img" class="with-borderpadding" title="Test 11" alt="FAIL" src="support/replaced-min-max-11.png"></img></p>
<p><img id="img" class="with-borderpadding" title="Test 12" alt="FAIL" src="support/replaced-min-max-12.png"></img></p>
<p><img id="img" class="with-borderpadding" title="Test 13" alt="FAIL" src="support/replaced-min-max-13.png"></img></p>
<p><img id="img" class="with-borderpadding" title="Test 14" alt="FAIL" src="support/replaced-min-max-14.png"></img></p>
<p><img id="img" class="with-borderpadding" title="Test 15" alt="FAIL" src="support/replaced-min-max-15.png"></img></p>
<p><img id="img" class="with-borderpadding" title="Test 16" alt="FAIL" src="support/replaced-min-max-16.png"></img></p>
<p><img id="img" class="with-borderpadding" title="Test 17" alt="FAIL" src="support/replaced-min-max-17.png"></img></p>
<p><img id="img" class="with-borderpadding" title="Test 18" alt="FAIL" src="support/replaced-min-max-18.png"></img></p>
<p><img id="img" class="with-borderpadding" title="Test 19" alt="FAIL" src="support/replaced-min-max-19.png"></img></p>
</body>
</html>

View File

@ -0,0 +1,157 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Min/Max Height and Width Constraints on Replaced Elements with Box-Sizing</title>
<link href="http://fantasai.inkedblade.net/contact" title="Elika J. Etemad" rel="author"></link>
<link href="mailto:sjohnson@mozilla.com" title="Scott Johnson" rel="author"></link>
<link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
<meta content="image" name="flags"></meta>
<meta name="assert" content="All images should be sized at 75px x 75px, with 5px of padding and 5px of blue border around each." />
<!--
This test is derived from replaced-min-max-001, part of the W3C CSS 2.1
test suite.
-->
<style type="text/css">
p {
display: inline-block;
background-color: white;
padding: 0px 0px;
margin: 0px 0px;
}
.with-borderpadding {
padding: 5px 5px;
border: 5px solid blue;
-moz-box-sizing: border-box;
}
#img1 {
min-width: 80px;
max-width: 125px;
min-height: 65px;
max-height: 140px;
}
#img2 {
max-width: 95px;
min-height: 80px;
}
#img3 {
max-width: 95px;
min-height: 95px;
}
#img4 {
min-width: 95px;
max-height: 120px;
}
#img5 {
min-width: 95px;
max-height: 95px;
}
#img6 {
min-width: 80px;
max-height: 95px;
}
#img7 {
min-width: 95px;
max-height: 95px;
}
#img8 {
max-width: 120px;
min-height: 95px;
}
#img9 {
max-width: 95px;
min-height: 95px;
}
#img10 {
min-width: 95px;
max-width: 170px;
max-height: 95px;
}
#img11 {
min-width: 45px;
max-width: 245px;
max-height: 95px;
}
#img12 {
max-width: 95px;
min-height: 95px;
max-height: 170px;
}
#img13 {
max-width: 95px;
min-height: 45px;
max-height: 245px;
}
#img14 {
min-width: 70px;
max-width: 120px;
min-height: 95px;
}
#img15 {
min-width: 75px;
max-width: 95px;
min-height: 95px;
}
#img16 {
min-width: 95px;
min-height: 70px;
max-height: 120px;
}
#img17 {
min-width: 95px;
min-height: 75px;
max-height: 95px;
}
#img18 {
min-width: 95px;
max-height: 95px;
}
#img19 {
max-width: 95px;
min-height: 95px;
}
</style>
</head>
<body>
<div>All rectangles should be the same size.</div>
<p><img id="img0" class="with-borderpadding" src="support/replaced-min-max.png" alt="FAIL" title="Test 0"></img></p>
<p><img id="img1" class="with-borderpadding" title="Test 1" alt="FAIL" src="support/replaced-min-max-1.png"></img></p>
<p><img id="img2" class="with-borderpadding" title="Test 2" alt="FAIL" src="support/replaced-min-max-2.png"></img></p>
<p><img id="img3" class="with-borderpadding" title="Test 3" alt="FAIL" src="support/replaced-min-max-3.png"></img></p>
<p><img id="img4" class="with-borderpadding" title="Test 4" alt="FAIL" src="support/replaced-min-max-4.png"></img></p>
<p><img id="img5" class="with-borderpadding" title="Test 5" alt="FAIL" src="support/replaced-min-max-5.png"></img></p>
<p><img id="img6" class="with-borderpadding" title="Test 6" alt="FAIL" src="support/replaced-min-max-6.png"></img></p>
<p><img id="img7" class="with-borderpadding" title="Test 7" alt="FAIL" src="support/replaced-min-max-7.png"></img></p>
<p><img id="img8" class="with-borderpadding" title="Test 8" alt="FAIL" src="support/replaced-min-max-8.png"></img></p>
<p><img id="img9" class="with-borderpadding" title="Test 9" alt="FAIL" src="support/replaced-min-max-9.png"></img></p>
<p><img id="img10" class="with-borderpadding" title="Test 10" alt="FAIL" src="support/replaced-min-max-10.png"></img></p>
<p><img id="img11" class="with-borderpadding" title="Test 11" alt="FAIL" src="support/replaced-min-max-11.png"></img></p>
<p><img id="img12" class="with-borderpadding" title="Test 12" alt="FAIL" src="support/replaced-min-max-12.png"></img></p>
<p><img id="img13" class="with-borderpadding" title="Test 13" alt="FAIL" src="support/replaced-min-max-13.png"></img></p>
<p><img id="img14" class="with-borderpadding" title="Test 14" alt="FAIL" src="support/replaced-min-max-14.png"></img></p>
<p><img id="img15" class="with-borderpadding" title="Test 15" alt="FAIL" src="support/replaced-min-max-15.png"></img></p>
<p><img id="img16" class="with-borderpadding" title="Test 16" alt="FAIL" src="support/replaced-min-max-16.png"></img></p>
<p><img id="img17" class="with-borderpadding" title="Test 17" alt="FAIL" src="support/replaced-min-max-17.png"></img></p>
<p><img id="img18" class="with-borderpadding" title="Test 18" alt="FAIL" src="support/replaced-min-max-18.png"></img></p>
<p><img id="img19" class="with-borderpadding" title="Test 19" alt="FAIL" src="support/replaced-min-max-19.png"></img></p>
</body>
</html>

View File

@ -0,0 +1,48 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Reference: Min/Max Height and Width Constraints on Replaced Elements with Box-Sizing</title>
<link href="http://fantasai.inkedblade.net/contact" title="Elika J. Etemad" rel="author"></link>
<link href="mailto:sjohnson@mozilla.com" title="Scott Johnson" rel="author"></link>
<meta content="image" name="flags"></meta>
<!--
<link rel="help" href="http://www.w3.org/TR/2012/WD-css3-ui-20120117/#box-sizing">
-->
<style type="text/css">
p {
display: inline-block;
background-color: white;
margin: 0px 0px;
padding: 0px 0px;
}
#img {
width: 75px;
height: 75px;
}
</style>
</head>
<body>
<div>All rectangles should be the same size.</div>
<p><img src="support/replaced-min-max.png" alt="FAIL" title="Test 0"></img></p>
<p><img id="img" title="Test 1" alt="FAIL" src="support/replaced-min-max-1.png"></img></p>
<p><img id="img" title="Test 2" alt="FAIL" src="support/replaced-min-max-2.png"></img></p>
<p><img id="img" title="Test 3" alt="FAIL" src="support/replaced-min-max-3.png"></img></p>
<p><img id="img" title="Test 4" alt="FAIL" src="support/replaced-min-max-4.png"></img></p>
<p><img id="img" title="Test 5" alt="FAIL" src="support/replaced-min-max-5.png"></img></p>
<p><img id="img" title="Test 6" alt="FAIL" src="support/replaced-min-max-6.png"></img></p>
<p><img id="img" title="Test 7" alt="FAIL" src="support/replaced-min-max-7.png"></img></p>
<p><img id="img" title="Test 8" alt="FAIL" src="support/replaced-min-max-8.png"></img></p>
<p><img id="img" title="Test 9" alt="FAIL" src="support/replaced-min-max-9.png"></img></p>
<p><img id="img" title="Test 10" alt="FAIL" src="support/replaced-min-max-10.png"></img></p>
<p><img id="img" title="Test 11" alt="FAIL" src="support/replaced-min-max-11.png"></img></p>
<p><img id="img" title="Test 12" alt="FAIL" src="support/replaced-min-max-12.png"></img></p>
<p><img id="img" title="Test 13" alt="FAIL" src="support/replaced-min-max-13.png"></img></p>
<p><img id="img" title="Test 14" alt="FAIL" src="support/replaced-min-max-14.png"></img></p>
<p><img id="img" title="Test 15" alt="FAIL" src="support/replaced-min-max-15.png"></img></p>
<p><img id="img" title="Test 16" alt="FAIL" src="support/replaced-min-max-16.png"></img></p>
<p><img id="img" title="Test 17" alt="FAIL" src="support/replaced-min-max-17.png"></img></p>
<p><img id="img" title="Test 18" alt="FAIL" src="support/replaced-min-max-18.png"></img></p>
<p><img id="img" title="Test 19" alt="FAIL" src="support/replaced-min-max-19.png"></img></p>
</body>
</html>

View File

@ -0,0 +1,155 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Min/Max Height and Width Constraints on Replaced Elements with Box-Sizing</title>
<link href="http://fantasai.inkedblade.net/contact" title="Elika J. Etemad" rel="author"></link>
<link href="mailto:sjohnson@mozilla.com" title="Scott Johnson" rel="author"></link>
<link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
<meta content="image" name="flags"></meta>
<meta name="assert" content="All images should be sized at 75px x 75px." />
<!--
This test is derived from replaced-min-max-001, part of the W3C CSS 2.1
test suite.
-->
<style type="text/css">
p {
display: inline-block;
background-color: white;
padding: 0px 0px;
margin: 0px 0px;
}
.content-box {
-moz-box-sizing: content-box;
}
#img1 {
min-width: 60px;
max-width: 125px;
min-height: 45px;
max-height: 120px;
}
#img2 {
max-width: 75px;
min-height: 60px;
}
#img3 {
max-width: 75px;
min-height: 75px;
}
#img4 {
min-width: 75px;
max-height: 100px;
}
#img5 {
min-width: 75px;
max-height: 75px;
}
#img6 {
min-width: 60px;
max-height: 75px;
}
#img7 {
min-width: 75px;
max-height: 75px;
}
#img8 {
max-width: 100px;
min-height: 75px;
}
#img9 {
max-width: 75px;
min-height: 75px;
}
#img10 {
min-width: 75px;
max-width: 150px;
max-height: 75px;
}
#img11 {
min-width: 25px;
max-width: 225px;
max-height: 75px;
}
#img12 {
max-width: 75px;
min-height: 75px;
max-height: 150px;
}
#img13 {
max-width: 75px;
min-height: 25px;
max-height: 225px;
}
#img14 {
min-width: 50px;
max-width: 100px;
min-height: 75px;
}
#img15 {
min-width: 55px;
max-width: 75px;
min-height: 75px;
}
#img16 {
min-width: 75px;
min-height: 50px;
max-height: 100px;
}
#img17 {
min-width: 75px;
min-height: 55px;
max-height: 75px;
}
#img18 {
min-width: 75px;
max-height: 75px;
}
#img19 {
max-width: 75px;
min-height: 75px;
}
</style>
</head>
<body>
<div>All rectangles should be the same size.</div>
<p><img id="img0" class="content-box" src="support/replaced-min-max.png" alt="FAIL" title="Test 0"></img></p>
<p><img id="img1" class="content-box" title="Test 1" alt="FAIL" src="support/replaced-min-max-1.png"></img></p>
<p><img id="img2" class="content-box" title="Test 2" alt="FAIL" src="support/replaced-min-max-2.png"></img></p>
<p><img id="img3" class="content-box" title="Test 3" alt="FAIL" src="support/replaced-min-max-3.png"></img></p>
<p><img id="img4" class="content-box" title="Test 4" alt="FAIL" src="support/replaced-min-max-4.png"></img></p>
<p><img id="img5" class="content-box" title="Test 5" alt="FAIL" src="support/replaced-min-max-5.png"></img></p>
<p><img id="img6" class="content-box" title="Test 6" alt="FAIL" src="support/replaced-min-max-6.png"></img></p>
<p><img id="img7" class="content-box" title="Test 7" alt="FAIL" src="support/replaced-min-max-7.png"></img></p>
<p><img id="img8" class="content-box" title="Test 8" alt="FAIL" src="support/replaced-min-max-8.png"></img></p>
<p><img id="img9" class="content-box" title="Test 9" alt="FAIL" src="support/replaced-min-max-9.png"></img></p>
<p><img id="img10" class="content-box" title="Test 10" alt="FAIL" src="support/replaced-min-max-10.png"></img></p>
<p><img id="img11" class="content-box" title="Test 11" alt="FAIL" src="support/replaced-min-max-11.png"></img></p>
<p><img id="img12" class="content-box" title="Test 12" alt="FAIL" src="support/replaced-min-max-12.png"></img></p>
<p><img id="img13" class="content-box" title="Test 13" alt="FAIL" src="support/replaced-min-max-13.png"></img></p>
<p><img id="img14" class="content-box" title="Test 14" alt="FAIL" src="support/replaced-min-max-14.png"></img></p>
<p><img id="img15" class="content-box" title="Test 15" alt="FAIL" src="support/replaced-min-max-15.png"></img></p>
<p><img id="img16" class="content-box" title="Test 16" alt="FAIL" src="support/replaced-min-max-16.png"></img></p>
<p><img id="img17" class="content-box" title="Test 17" alt="FAIL" src="support/replaced-min-max-17.png"></img></p>
<p><img id="img18" class="content-box" title="Test 18" alt="FAIL" src="support/replaced-min-max-18.png"></img></p>
<p><img id="img19" class="content-box" title="Test 19" alt="FAIL" src="support/replaced-min-max-19.png"></img></p>
</body>
</html>

View File

@ -0,0 +1,13 @@
== box-sizing-border-box-001.xht box-sizing-border-box-001-ref.xht
== box-sizing-border-box-002.xht box-sizing-border-box-002-ref.xht
== box-sizing-border-box-003.xht box-sizing-border-box-003-ref.xht
== box-sizing-border-box-004.xht box-sizing-border-box-004-ref.xht
== box-sizing-content-box-001.xht box-sizing-content-box-001-ref.xht
== box-sizing-content-box-002.xht box-sizing-content-box-002-ref.xht
== box-sizing-content-box-003.xht box-sizing-content-box-003-ref.xht
== box-sizing-padding-box-001.xht box-sizing-padding-box-001-ref.xht
== box-sizing-padding-box-002.xht box-sizing-padding-box-002-ref.xht
== box-sizing-padding-box-003.xht box-sizing-padding-box-003-ref.xht
== box-sizing-replaced-001.xht box-sizing-replaced-001-ref.xht
== box-sizing-replaced-002.xht box-sizing-replaced-002-ref.xht
== box-sizing-replaced-003.xht box-sizing-replaced-003-ref.xht

Binary file not shown.

After

Width:  |  Height:  |  Size: 957 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -230,7 +230,8 @@ nsChangeHint nsStyleFont::CalcFontDifference(const nsFont& aFont1, const nsFont&
(aFont1.variantNumeric == aFont2.variantNumeric) &&
(aFont1.variantPosition == aFont2.variantPosition) &&
(aFont1.fontFeatureSettings == aFont2.fontFeatureSettings) &&
(aFont1.languageOverride == aFont2.languageOverride)) {
(aFont1.languageOverride == aFont2.languageOverride) &&
(aFont1.systemFont == aFont2.systemFont)) {
if ((aFont1.decorations == aFont2.decorations)) {
return NS_STYLE_HINT_NONE;
}

View File

@ -208,13 +208,16 @@ Preferences::SizeOfIncludingThisAndOtherStuff(mozilla::MallocSizeOf aMallocSizeO
return n;
}
NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(PreferencesMallocSizeOf)
class PreferencesReporter MOZ_FINAL : public nsIMemoryReporter
class PreferenceServiceReporter MOZ_FINAL : public MemoryMultiReporter
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIMEMORYREPORTER
PreferenceServiceReporter()
: MemoryMultiReporter("preference-service")
{}
NS_IMETHOD CollectReports(nsIMemoryReporterCallback* aCallback,
nsISupports* aData);
protected:
static const uint32_t kSuspectReferentCount = 1000;
static PLDHashOperator CountReferents(PrefCallback* aKey,
@ -222,15 +225,6 @@ protected:
void* aClosure);
};
NS_IMPL_ISUPPORTS1(PreferencesReporter, nsIMemoryReporter)
NS_IMETHODIMP
PreferencesReporter::GetName(nsACString& aName)
{
aName.AssignLiteral("preference-service");
return NS_OK;
}
struct PreferencesReferentCount {
PreferencesReferentCount() : numStrong(0), numWeakAlive(0), numWeakDead(0) {}
size_t numStrong;
@ -242,9 +236,9 @@ struct PreferencesReferentCount {
};
PLDHashOperator
PreferencesReporter::CountReferents(PrefCallback* aKey,
nsAutoPtr<PrefCallback>& aCallback,
void* aClosure)
PreferenceServiceReporter::CountReferents(PrefCallback* aKey,
nsAutoPtr<PrefCallback>& aCallback,
void* aClosure)
{
PreferencesReferentCount* referentCount =
static_cast<PreferencesReferentCount*>(aClosure);
@ -279,8 +273,8 @@ PreferencesReporter::CountReferents(PrefCallback* aKey,
}
NS_IMETHODIMP
PreferencesReporter::CollectReports(nsIMemoryReporterCallback* aCb,
nsISupports* aClosure)
PreferenceServiceReporter::CollectReports(nsIMemoryReporterCallback* aCb,
nsISupports* aClosure)
{
#define REPORT(_path, _kind, _units, _amount, _desc) \
do { \
@ -293,7 +287,7 @@ PreferencesReporter::CollectReports(nsIMemoryReporterCallback* aCb,
REPORT(NS_LITERAL_CSTRING("explicit/preferences"),
nsIMemoryReporter::KIND_HEAP, nsIMemoryReporter::UNITS_BYTES,
Preferences::SizeOfIncludingThisAndOtherStuff(PreferencesMallocSizeOf),
Preferences::SizeOfIncludingThisAndOtherStuff(MallocSizeOf),
"Memory used by the preferences system.");
nsPrefBranch* rootBranch =
@ -347,7 +341,7 @@ class AddPreferencesMemoryReporterRunnable : public nsRunnable
{
NS_IMETHOD Run()
{
return NS_RegisterMemoryReporter(new PreferencesReporter());
return NS_RegisterMemoryReporter(new PreferenceServiceReporter());
}
};
} // anonymous namespace

View File

@ -24,13 +24,13 @@
#include "mozilla/MemoryReporting.h"
namespace mozilla {
class PreferencesReporter;
class PreferenceServiceReporter;
} // namespace mozilla;
class nsPrefBranch;
class PrefCallback : public PLDHashEntryHdr {
friend class mozilla::PreferencesReporter;
friend class mozilla::PreferenceServiceReporter;
public:
typedef PrefCallback* KeyType;
@ -178,7 +178,7 @@ class nsPrefBranch : public nsIPrefBranchInternal,
public nsIObserver,
public nsSupportsWeakReference
{
friend class mozilla::PreferencesReporter;
friend class mozilla::PreferenceServiceReporter;
public:
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIPREFBRANCH

View File

@ -34,6 +34,7 @@ class CentOSBootstrapper(BaseBootstrapper):
'libXt-devel',
'mercurial',
'mesa-libGL-devel',
'pulseaudio-libs-devel',
'wireless-tools-devel',
'yasm')

View File

@ -21,6 +21,7 @@ class DebianBootstrapper(BaseBootstrapper):
'libgtk2.0-dev',
'libiw-dev',
'libnotify-dev',
'libpulse-dev',
'libxt-dev',
'mercurial',
'mesa-common-dev',

View File

@ -29,6 +29,7 @@ class FedoraBootstrapper(BaseBootstrapper):
'libXt-devel',
'mercurial',
'mesa-libGL-devel',
'pulseaudio-libs-devel',
'wireless-tools-devel',
'yasm')

View File

@ -59,7 +59,7 @@ StorageSQLiteDistinguishedAmount()
return ::sqlite3_memory_used();
}
class StorageSQLiteReporter MOZ_FINAL : public nsIMemoryReporter
class StorageSQLiteReporter MOZ_FINAL : public MemoryMultiReporter
{
private:
Service *mService; // a weakref because Service contains a strongref to this
@ -68,10 +68,9 @@ private:
nsCString mSchemaDesc;
public:
NS_DECL_THREADSAFE_ISUPPORTS
StorageSQLiteReporter(Service *aService)
: mService(aService)
: MemoryMultiReporter("storage-sqlite")
, mService(aService)
{
mStmtDesc = NS_LITERAL_CSTRING(
"Memory (approximate) used by all prepared statements used by "
@ -86,12 +85,6 @@ public:
"associated with connections to this database.");
}
NS_IMETHOD GetName(nsACString &aName)
{
aName.AssignLiteral("storage-sqlite-multi");
return NS_OK;
}
// Warning: To get a Connection's measurements requires holding its lock.
// There may be a delay getting the lock if another thread is accessing the
// Connection. This isn't very nice if CollectReports is called from the
@ -204,11 +197,6 @@ private:
}
};
NS_IMPL_ISUPPORTS1(
StorageSQLiteReporter,
nsIMemoryReporter
)
////////////////////////////////////////////////////////////////////////////////
//// Service

View File

@ -90,8 +90,12 @@ endif
mochitest-remote: DM_TRANS?=adb
mochitest-remote:
@if [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \
echo "please prepare your host with the environment variable MOZ_HOST_BIN"; \
@if [ "${MOZ_HOST_BIN}" = "" ]; then \
echo "environment variable MOZ_HOST_BIN must be set to a directory containing host xpcshell"; \
elif [ ! -d ${MOZ_HOST_BIN} ]; then \
echo "MOZ_HOST_BIN does not specify a directory"; \
elif [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \
echo "xpcshell not found in MOZ_HOST_BIN"; \
elif [ "${TEST_DEVICE}" = "" -a "$(DM_TRANS)" != "adb" ]; then \
echo "please prepare your host with the environment variable TEST_DEVICE"; \
else \
@ -103,8 +107,12 @@ mochitest-robotium: mochitest-robocop
mochitest-robocop: DM_TRANS?=adb
mochitest-robocop:
@if [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \
echo "please prepare your host with the environment variable MOZ_HOST_BIN"; \
@if [ "${MOZ_HOST_BIN}" = "" ]; then \
echo "environment variable MOZ_HOST_BIN must be set to a directory containing host xpcshell"; \
elif [ ! -d ${MOZ_HOST_BIN} ]; then \
echo "MOZ_HOST_BIN does not specify a directory"; \
elif [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \
echo "xpcshell not found in MOZ_HOST_BIN"; \
elif [ "${TEST_DEVICE}" = "" -a "$(DM_TRANS)" != "adb" ]; then \
echo "please prepare your host with the environment variable TEST_DEVICE"; \
else \
@ -212,8 +220,12 @@ reftest:
reftest-remote: TEST_PATH?=layout/reftests/reftest.list
reftest-remote: DM_TRANS?=adb
reftest-remote:
@if [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \
echo "please prepare your host with the environment variable MOZ_HOST_BIN"; \
@if [ "${MOZ_HOST_BIN}" = "" ]; then \
echo "environment variable MOZ_HOST_BIN must be set to a directory containing host xpcshell"; \
elif [ ! -d ${MOZ_HOST_BIN} ]; then \
echo "MOZ_HOST_BIN does not specify a directory"; \
elif [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \
echo "xpcshell not found in MOZ_HOST_BIN"; \
elif [ "${TEST_DEVICE}" = "" -a "$(DM_TRANS)" != "adb" ]; then \
echo "please prepare your host with the environment variable TEST_DEVICE"; \
else \
@ -224,8 +236,12 @@ reftest-remote:
reftest-b2g: TEST_PATH?=layout/reftests/reftest.list
reftest-b2g:
@if [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \
echo "please set the MOZ_HOST_BIN environment variable"; \
@if [ "${MOZ_HOST_BIN}" = "" ]; then \
echo "environment variable MOZ_HOST_BIN must be set to a directory containing host xpcshell"; \
elif [ ! -d ${MOZ_HOST_BIN} ]; then \
echo "MOZ_HOST_BIN does not specify a directory"; \
elif [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \
echo "xpcshell not found in MOZ_HOST_BIN"; \
elif [ "${B2G_PATH}" = "" -o "${ADB_PATH}" = "" ]; then \
echo "please set the B2G_PATH and ADB_PATH environment variables"; \
else \

View File

@ -48,11 +48,6 @@ XPCOMUtils.defineLazyGetter(this, "nsGzipConverter",
let gMgr = Cc["@mozilla.org/memory-reporter-manager;1"]
.getService(Ci.nsIMemoryReporterManager);
// We need to know about "child-memory-reporter-update" events from child
// processes.
Services.obs.addObserver(updateAboutMemoryFromReporters,
"child-memory-reporter-update", false);
let gUnnamedProcessStr = "Main Process";
let gIsDiff = false;
@ -120,8 +115,6 @@ function debug(x)
function onUnload()
{
Services.obs.removeObserver(updateAboutMemoryFromReporters,
"child-memory-reporter-update");
}
//---------------------------------------------------------------------------
@ -388,11 +381,6 @@ function doMMU()
function doMeasure()
{
// Notify any children that they should measure memory consumption, then
// update the page. If any reports come back from children,
// updateAboutMemoryFromReporters() will be called again and the page will
// regenerate.
Services.obs.notifyObservers(null, "child-memory-reporter-request", null);
updateAboutMemoryFromReporters();
}
@ -402,10 +390,7 @@ function doMeasure()
*/
function updateAboutMemoryFromReporters()
{
// First, clear the contents of main. Necessary because
// updateAboutMemoryFromReporters() might be called more than once due to the
// "child-memory-reporter-update" observer.
updateMainAndFooter("", SHOW_FOOTER);
updateMainAndFooter("Measuring...", HIDE_FOOTER);
try {
let processLiveMemoryReports =
@ -416,12 +401,13 @@ function updateAboutMemoryFromReporters()
aDescription, /* presence = */ undefined);
}
let e = gMgr.enumerateReporters();
while (e.hasMoreElements()) {
let mr = e.getNext().QueryInterface(Ci.nsIMemoryReporter);
mr.collectReports(handleReport, null);
let displayReportsAndFooter = function() {
updateMainAndFooter("", SHOW_FOOTER);
aDisplayReports();
}
aDisplayReports();
gMgr.getReports(handleReport, null,
displayReportsAndFooter, null);
}
// Process the reports from the live memory reporters.
@ -1841,9 +1827,11 @@ function saveReportsToFile()
let dumper = Cc["@mozilla.org/memory-info-dumper;1"]
.getService(Ci.nsIMemoryInfoDumper);
dumper.dumpMemoryReportsToNamedFile(fp.file.path);
let finishDumping = () => {
updateMainAndFooter("Saved reports to " + fp.file.path, HIDE_FOOTER);
}
updateMainAndFooter("Saved reports to " + fp.file.path, HIDE_FOOTER);
dumper.dumpMemoryReportsToNamedFile(fp.file.path, finishDumping, null);
}
};
fp.open(fpCallback);

View File

@ -1,12 +0,0 @@
#
# 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/.
ifndef MOZ_ASAN
MOCHITEST_CHROME_FILES += \
remote.xul \
test_memoryReporters.xul \
test_memoryReporters2.xul \
$(NULL)
endif

Some files were not shown because too many files have changed in this diff Show More