Merge inbound to m-c

This commit is contained in:
Wes Kocher 2013-11-21 19:14:06 -08:00
commit e32eda92b7
74 changed files with 3334 additions and 916 deletions

View File

@ -368,6 +368,17 @@ if test -n "$GNU_CC" -a -z "$CLANG_CC" ; then
fi
fi
dnl ========================================================
dnl Disable compiling sources in unified mode.
dnl ========================================================
MOZ_ARG_DISABLE_BOOL(unified-compilation,
[ --disable-unified-compilation
Disable unified compilation of some C/C++ sources],
MOZ_DISABLE_UNIFIED_COMPILATION=1,
MOZ_DISABLE_UNIFIED_COMPILATION=)
AC_SUBST(MOZ_DISABLE_UNIFIED_COMPILATION)
dnl ========================================================
dnl Special win32 checks
dnl ========================================================

View File

@ -15,6 +15,7 @@
#include "mozilla/layers/CompositorTypes.h" // for DiagnosticTypes, etc
#include "mozilla/layers/LayersTypes.h" // for LayersBackend
#include "nsTraceRefcnt.h" // for MOZ_COUNT_CTOR, etc
#include "nsRegion.h"
/**
* Different elements of a web pages are rendered into separate "layers" before
@ -291,16 +292,24 @@ public:
/**
* Start a new frame.
*
* aInvalidRect is the invalid region of the screen; it can be ignored for
* compositors where the performance for compositing the entire window is
* sufficient.
*
* aClipRectIn is the clip rect for the window in window space (optional).
* aTransform is the transform from user space to window space.
* aRenderBounds bounding rect for rendering, in user space.
*
* If aClipRectIn is null, this method sets *aClipRectOut to the clip rect
* actually used for rendering (if aClipRectIn is non-null, we will use that
* for the clip rect).
*
* If aRenderBoundsOut is non-null, it will be set to the render bounds
* actually used by the compositor in window space.
*/
virtual void BeginFrame(const gfx::Rect* aClipRectIn,
virtual void BeginFrame(const nsIntRegion& aInvalidRegion,
const gfx::Rect* aClipRectIn,
const gfxMatrix& aTransform,
const gfx::Rect& aRenderBounds,
gfx::Rect* aClipRectOut = nullptr,

View File

@ -110,6 +110,7 @@ struct LayerPropertiesBase : public LayerProperties
: mLayer(aLayer)
, mMaskLayer(nullptr)
, mVisibleRegion(aLayer->GetVisibleRegion())
, mInvalidRegion(aLayer->GetInvalidRegion())
, mTransform(aLayer->GetTransform())
, mOpacity(aLayer->GetOpacity())
, mUseClipRect(!!aLayer->GetClipRect())
@ -201,6 +202,7 @@ struct LayerPropertiesBase : public LayerProperties
nsRefPtr<Layer> mLayer;
nsAutoPtr<LayerPropertiesBase> mMaskLayer;
nsIntRegion mVisibleRegion;
nsIntRegion mInvalidRegion;
gfx3DMatrix mTransform;
float mOpacity;
nsIntRect mClipRect;
@ -320,7 +322,6 @@ struct ImageLayerProperties : public LayerPropertiesBase
{
ImageLayerProperties(ImageLayer* aImage)
: LayerPropertiesBase(aImage)
, mVisibleRegion(aImage->GetVisibleRegion())
, mContainer(aImage->GetContainer())
, mFilter(aImage->GetFilter())
, mScaleToSize(aImage->GetScaleToSize())
@ -348,7 +349,6 @@ struct ImageLayerProperties : public LayerPropertiesBase
return nsIntRect();
}
nsIntRegion mVisibleRegion;
nsRefPtr<ImageContainer> mContainer;
GraphicsFilter mFilter;
gfxIntSize mScaleToSize;

View File

@ -1223,6 +1223,7 @@ public:
* marked as needed to be recomposited.
*/
const nsIntRegion& GetInvalidRegion() { return mInvalidRegion; }
const void SetInvalidRegion(const nsIntRegion& aRect) { mInvalidRegion = aRect; }
/**
* Mark the entirety of the layer's visible region as being invalid.

View File

@ -418,9 +418,7 @@ BasicCompositor::DrawQuad(const gfx::Rect& aRect,
gfx::Float aOpacity,
const gfx::Matrix4x4 &aTransform)
{
RefPtr<DrawTarget> buffer = mRenderTarget
? mRenderTarget->mDrawTarget
: mDrawTarget;
RefPtr<DrawTarget> buffer = mRenderTarget->mDrawTarget;
// For 2D drawing, |dest| and |buffer| are the same surface. For 3D drawing,
// |dest| is a temporary surface.
@ -551,7 +549,8 @@ BasicCompositor::DrawQuad(const gfx::Rect& aRect,
}
void
BasicCompositor::BeginFrame(const gfx::Rect *aClipRectIn,
BasicCompositor::BeginFrame(const nsIntRegion& aInvalidRegion,
const gfx::Rect *aClipRectIn,
const gfxMatrix& aTransform,
const gfx::Rect& aRenderBounds,
gfx::Rect *aClipRectOut /* = nullptr */,
@ -562,6 +561,18 @@ BasicCompositor::BeginFrame(const gfx::Rect *aClipRectIn,
Rect rect = Rect(0, 0, intRect.width, intRect.height);
mWidgetSize = intRect.Size();
nsIntRect invalidRect = aInvalidRegion.GetBounds();
mInvalidRect = IntRect(invalidRect.x, invalidRect.y, invalidRect.width, invalidRect.height);
mInvalidRegion = aInvalidRegion;
if (aRenderBoundsOut) {
*aRenderBoundsOut = Rect();
}
if (mInvalidRect.width <= 0 || mInvalidRect.height <= 0) {
return;
}
if (mCopyTarget) {
// If we have a copy target, then we don't have a widget-provided mDrawTarget (currently). Create a dummy
// placeholder so that CreateRenderTarget() works.
@ -570,17 +581,22 @@ BasicCompositor::BeginFrame(const gfx::Rect *aClipRectIn,
mDrawTarget = mWidget->StartRemoteDrawing();
}
if (!mDrawTarget) {
if (aRenderBoundsOut) {
*aRenderBoundsOut = Rect();
}
return;
}
// Setup an intermediate render target to buffer all compositing. We will
// copy this into mDrawTarget (the widget), and/or mCopyTarget in EndFrame()
RefPtr<CompositingRenderTarget> target = CreateRenderTarget(IntRect(0, 0, intRect.width, intRect.height), INIT_MODE_CLEAR);
RefPtr<CompositingRenderTarget> target = CreateRenderTarget(mInvalidRect, INIT_MODE_CLEAR);
SetRenderTarget(target);
// We only allocate a surface sized to the invalidated region, so we need to
// translate future coordinates.
Matrix transform;
transform.Translate(-invalidRect.x, -invalidRect.y);
mRenderTarget->mDrawTarget->SetTransform(transform);
gfxUtils::ClipToRegion(mRenderTarget->mDrawTarget, aInvalidRegion);
if (aRenderBoundsOut) {
*aRenderBoundsOut = rect;
}
@ -599,20 +615,26 @@ void
BasicCompositor::EndFrame()
{
mRenderTarget->mDrawTarget->PopClip();
mRenderTarget->mDrawTarget->PopClip();
// Note: Most platforms require us to buffer drawing to the widget surface.
// That's why we don't draw to mDrawTarget directly.
RefPtr<SourceSurface> source = mRenderTarget->mDrawTarget->Snapshot();
if (mCopyTarget) {
mCopyTarget->CopySurface(source,
IntRect(0, 0, mWidgetSize.width, mWidgetSize.height),
IntPoint(0, 0));
} else {
// Most platforms require us to buffer drawing to the widget surface.
// That's why we don't draw to mDrawTarget directly.
mDrawTarget->CopySurface(source,
IntRect(0, 0, mWidgetSize.width, mWidgetSize.height),
IntPoint(0, 0));
RefPtr<DrawTarget> dest(mCopyTarget ? mCopyTarget : mDrawTarget);
// The source DrawTarget is clipped to the invalidation region, so we have
// to copy the individual rectangles in the region or else we'll draw blank
// pixels.
nsIntRegionRectIterator iter(mInvalidRegion);
for (const nsIntRect *r = iter.Next(); r; r = iter.Next()) {
dest->CopySurface(source,
IntRect(r->x - mInvalidRect.x, r->y - mInvalidRect.y, r->width, r->height),
IntPoint(r->x, r->y));
}
if (!mCopyTarget) {
mWidget->EndRemoteDrawing();
}
mDrawTarget = nullptr;
mRenderTarget = nullptr;
}
@ -620,6 +642,7 @@ BasicCompositor::EndFrame()
void
BasicCompositor::AbortFrame()
{
mRenderTarget->mDrawTarget->PopClip();
mRenderTarget->mDrawTarget->PopClip();
mDrawTarget = nullptr;
mRenderTarget = nullptr;

View File

@ -84,7 +84,8 @@ public:
gfx::Float aOpacity,
const gfx::Matrix4x4 &aTransform) MOZ_OVERRIDE;
virtual void BeginFrame(const gfx::Rect *aClipRectIn,
virtual void BeginFrame(const nsIntRegion& aInvalidRegion,
const gfx::Rect *aClipRectIn,
const gfxMatrix& aTransform,
const gfx::Rect& aRenderBounds,
gfx::Rect *aClipRectOut = nullptr,
@ -137,6 +138,9 @@ private:
// An optional destination target to copy the results
// to after drawing is completed.
RefPtr<gfx::DrawTarget> mCopyTarget;
gfx::IntRect mInvalidRect;
nsIntRegion mInvalidRegion;
};
} // namespace layers

View File

@ -294,6 +294,16 @@ ClientLayerManager::FlushRendering()
}
}
void
ClientLayerManager::SendInvalidRegion(const nsIntRegion& aRegion)
{
if (mWidget) {
if (CompositorChild* remoteRenderer = mWidget->GetRemoteRenderer()) {
remoteRenderer->SendNotifyRegionInvalidated(aRegion);
}
}
}
void
ClientLayerManager::ForwardTransaction()
{

View File

@ -79,6 +79,7 @@ public:
}
virtual void FlushRendering() MOZ_OVERRIDE;
void SendInvalidRegion(const nsIntRegion& aRegion);
virtual bool NeedsWidgetInvalidation() MOZ_OVERRIDE { return false; }

View File

@ -145,6 +145,9 @@ void
LayerManagerComposite::BeginTransaction()
{
mInTransaction = true;
if (Compositor::GetBackend() == LAYERS_BASIC) {
mClonedLayerTreeProperties = LayerProperties::CloneFrom(GetRoot());
}
}
void
@ -196,6 +199,15 @@ LayerManagerComposite::EndTransaction(DrawThebesLayerCallback aCallback,
return;
}
if (mRoot && mClonedLayerTreeProperties) {
nsIntRegion invalid = mClonedLayerTreeProperties->ComputeDifferences(mRoot, nullptr);
mClonedLayerTreeProperties = nullptr;
mInvalidRegion.Or(mInvalidRegion, invalid);
} else {
mInvalidRegion.Or(mInvalidRegion, mRenderBounds);
}
if (mRoot && !(aFlags & END_NO_IMMEDIATE_REDRAW)) {
if (aFlags & END_NO_COMPOSITE) {
// Apply pending tree updates before recomputing effective
@ -343,13 +355,16 @@ LayerManagerComposite::Render()
clipRect = *mRoot->GetClipRect();
WorldTransformRect(clipRect);
Rect rect(clipRect.x, clipRect.y, clipRect.width, clipRect.height);
mCompositor->BeginFrame(&rect, mWorldMatrix, bounds, nullptr, &actualBounds);
mCompositor->BeginFrame(mInvalidRegion, &rect, mWorldMatrix, bounds, nullptr, &actualBounds);
} else {
gfx::Rect rect;
mCompositor->BeginFrame(nullptr, mWorldMatrix, bounds, &rect, &actualBounds);
mCompositor->BeginFrame(mInvalidRegion, nullptr, mWorldMatrix, bounds, &rect, &actualBounds);
clipRect = nsIntRect(rect.x, rect.y, rect.width, rect.height);
}
// Reset the invalid region now that we've begun compositing.
mInvalidRegion.SetEmpty();
if (actualBounds.IsEmpty()) {
mCompositor->GetWidget()->PostRender(this);
return;

View File

@ -28,6 +28,7 @@
#include "nsRect.h" // for nsIntRect
#include "nsRegion.h" // for nsIntRegion
#include "nscore.h" // for nsAString, etc
#include "LayerTreeInvalidation.h"
class gfxASurface;
class gfxContext;
@ -228,6 +229,11 @@ public:
void SetCompositorID(uint32_t aID);
void AddInvalidRegion(const nsIntRegion& aRegion)
{
mInvalidRegion.Or(mInvalidRegion, aRegion);
}
Compositor* GetCompositor() const
{
return mCompositor;
@ -275,7 +281,10 @@ private:
DrawThebesLayerCallback mThebesLayerCallback;
void *mThebesLayerCallbackData;
gfxMatrix mWorldMatrix;
bool mInTransaction;
nsIntRegion mInvalidRegion;
nsAutoPtr<LayerProperties> mClonedLayerTreeProperties;
};
/**

View File

@ -623,7 +623,8 @@ CompositorD3D11::DrawQuad(const gfx::Rect& aRect,
}
void
CompositorD3D11::BeginFrame(const Rect* aClipRectIn,
CompositorD3D11::BeginFrame(const nsIntRegion& aInvalidRegion,
const Rect* aClipRectIn,
const gfxMatrix& aTransform,
const Rect& aRenderBounds,
Rect* aClipRectOut,

View File

@ -100,7 +100,8 @@ public:
* Start a new frame. If aClipRectIn is null, sets *aClipRectOut to the
* screen dimensions.
*/
virtual void BeginFrame(const gfx::Rect *aClipRectIn,
virtual void BeginFrame(const nsIntRegion& aInvalidRegion,
const gfx::Rect *aClipRectIn,
const gfxMatrix& aTransform,
const gfx::Rect& aRenderBounds,
gfx::Rect *aClipRectOut = nullptr,

View File

@ -439,7 +439,8 @@ CompositorD3D9::SetMask(const EffectChain &aEffectChain, uint32_t aMaskTexture)
}
void
CompositorD3D9::BeginFrame(const Rect *aClipRectIn,
CompositorD3D9::BeginFrame(const nsIntRegion& aInvalidRegion,
const Rect *aClipRectIn,
const gfxMatrix& aTransform,
const Rect& aRenderBounds,
Rect *aClipRectOut,

View File

@ -61,7 +61,8 @@ public:
gfx::Float aOpacity,
const gfx::Matrix4x4 &aTransform) MOZ_OVERRIDE;
virtual void BeginFrame(const gfx::Rect *aClipRectIn,
virtual void BeginFrame(const nsIntRegion& aInvalidRegion,
const gfx::Rect *aClipRectIn,
const gfxMatrix& aTransform,
const gfx::Rect& aRenderBounds,
gfx::Rect *aClipRectOut = nullptr,

View File

@ -322,6 +322,15 @@ CompositorParent::RecvFlushRendering()
return true;
}
bool
CompositorParent::RecvNotifyRegionInvalidated(const nsIntRegion& aRegion)
{
if (mLayerManager) {
mLayerManager->AddInvalidRegion(aRegion);
}
return true;
}
void
CompositorParent::ActorDestroy(ActorDestroyReason why)
{
@ -896,6 +905,7 @@ public:
SurfaceDescriptor* aOutSnapshot)
{ return true; }
virtual bool RecvFlushRendering() MOZ_OVERRIDE { return true; }
virtual bool RecvNotifyRegionInvalidated(const nsIntRegion& aRegion) { return true; }
virtual PLayerTransactionParent*
AllocPLayerTransactionParent(const nsTArray<LayersBackend>& aBackendHints,

View File

@ -88,6 +88,8 @@ public:
SurfaceDescriptor* aOutSnapshot);
virtual bool RecvFlushRendering() MOZ_OVERRIDE;
virtual bool RecvNotifyRegionInvalidated(const nsIntRegion& aRegion) MOZ_OVERRIDE;
virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
virtual void ShadowLayersUpdated(LayerTransactionParent* aLayerTree,

View File

@ -284,6 +284,7 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
layer->SetMaskLayer(nullptr);
}
layer->SetAnimations(common.animations());
layer->SetInvalidRegion(common.invalidRegion());
typedef SpecificLayerAttributes Specific;
const SpecificLayerAttributes& specific = attrs.specific();

View File

@ -200,7 +200,8 @@ struct CommonLayerAttributes {
nullable PLayer maskLayer;
// Animated colors will only honored for ColorLayers.
Animation[] animations;
};
nsIntRegion invalidRegion;
};
struct ThebesLayerAttributes {
nsIntRegion validRegion;

View File

@ -9,6 +9,7 @@ include LayersSurfaces;
include protocol PGrallocBuffer;
include protocol PLayerTransaction;
include "mozilla/GfxMessageUtils.h";
include "nsRegion.h";
using struct mozilla::null_t from "ipc/IPCMessageUtils.h";
using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
@ -64,6 +65,9 @@ parent:
// that hint is ignored.
sync PLayerTransaction(LayersBackend[] layersBackendHints, uint64_t id)
returns (TextureFactoryIdentifier textureFactoryIdentifier, bool success);
// Notify the compositor that a region of the screen has been invalidated.
async NotifyRegionInvalidated(nsIntRegion region);
};
} // layers

View File

@ -536,6 +536,7 @@ ShadowLayerForwarder::EndTransaction(InfallibleTArray<EditReply>* aReplies, bool
}
common.maskLayerParent() = nullptr;
common.animations() = mutant->GetAnimations();
common.invalidRegion() = mutant->GetInvalidRegion();
attrs.specific() = null_t();
mutant->FillSpecificAttributes(attrs.specific());

View File

@ -755,8 +755,11 @@ CalculatePOTSize(const IntSize& aSize, GLContext* gl)
}
void
CompositorOGL::BeginFrame(const Rect *aClipRectIn, const gfxMatrix& aTransform,
const Rect& aRenderBounds, Rect *aClipRectOut,
CompositorOGL::BeginFrame(const nsIntRegion& aInvalidRegion,
const Rect *aClipRectIn,
const gfxMatrix& aTransform,
const Rect& aRenderBounds,
Rect *aClipRectOut,
Rect *aRenderBoundsOut)
{
PROFILER_LABEL("CompositorOGL", "BeginFrame");

View File

@ -243,7 +243,8 @@ private:
/* Start a new frame. If aClipRectIn is null and aClipRectOut is non-null,
* sets *aClipRectOut to the screen dimensions.
*/
virtual void BeginFrame(const gfx::Rect *aClipRectIn,
virtual void BeginFrame(const nsIntRegion& aInvalidRegion,
const gfx::Rect *aClipRectIn,
const gfxMatrix& aTransform,
const gfx::Rect& aRenderBounds,
gfx::Rect *aClipRectOut = nullptr,

View File

@ -162,6 +162,7 @@ var ignoreFunctions = {
// Bug 940765 - fetching preferences should not GC
"PrefHashEntry* pref_HashTableLookup(void*)": true,
"uint8 mozilla::Preferences::InitStaticMembers()": true, // Temporary, see bug 940765
// These are a little overzealous -- these destructors *can* GC if they end
// up wrapping a pending exception. See bug 898815 for the heavyweight fix.

View File

@ -355,9 +355,7 @@ frontend::CompileScript(ExclusiveContext *cx, LifoAlloc *alloc, HandleObject sco
if (!FoldConstants(cx, &pn, &parser))
return nullptr;
// Inferring names for functions in compiled scripts is currently only
// supported while on the main thread. See bug 895395.
if (cx->isJSContext() && !NameFunctions(cx->asJSContext(), pn))
if (!NameFunctions(cx, pn))
return nullptr;
if (!EmitTree(cx, &bce, pn))

View File

@ -23,7 +23,7 @@ class NameResolver
{
static const size_t MaxParents = 100;
JSContext *cx;
ExclusiveContext *cx;
size_t nparents; /* number of parents in the parents array */
ParseNode *parents[MaxParents]; /* history of ParseNodes we've been looking at */
StringBuffer *buf; /* when resolving, buffer to append to */
@ -262,7 +262,7 @@ class NameResolver
}
public:
explicit NameResolver(JSContext *cx) : cx(cx), nparents(0), buf(nullptr) {}
explicit NameResolver(ExclusiveContext *cx) : cx(cx), nparents(0), buf(nullptr) {}
/*
* Resolve all names for anonymous functions recursively within the
@ -331,7 +331,7 @@ class NameResolver
} /* anonymous namespace */
bool
frontend::NameFunctions(JSContext *cx, ParseNode *pn)
frontend::NameFunctions(ExclusiveContext *cx, ParseNode *pn)
{
NameResolver nr(cx);
nr.resolve(pn);

View File

@ -10,12 +10,15 @@
#include "js/TypeDecls.h"
namespace js {
class ExclusiveContext;
namespace frontend {
class ParseNode;
bool
NameFunctions(JSContext *cx, ParseNode *pn);
NameFunctions(ExclusiveContext *cx, ParseNode *pn);
} /* namespace frontend */
} /* namespace js */

View File

@ -0,0 +1,5 @@
setJitCompilerOption("baseline.usecount.trigger", 0);
var arr = new Uint8ClampedArray(1);
for (var i = 0; i < 2; ++i)
arr[0] = 4294967296;
assertEq(arr[0], 255);

View File

@ -346,7 +346,7 @@ class AsmJSModule
JS_ASSERT(name->isTenured());
}
ProfiledBlocksFunction(const ProfiledBlocksFunction &copy)
ProfiledBlocksFunction(ProfiledBlocksFunction &&copy)
: ProfiledFunction(copy.name, copy.startCodeOffset, copy.endCodeOffset),
endInlineCodeOffset(copy.endInlineCodeOffset), blocks(mozilla::Move(copy.blocks))
{ }
@ -566,7 +566,7 @@ class AsmJSModule
bool trackPerfProfiledBlocks(JSAtom *name, unsigned startCodeOffset, unsigned endInlineCodeOffset,
unsigned endCodeOffset, jit::BasicBlocksVector &basicBlocks) {
ProfiledBlocksFunction func(name, startCodeOffset, endInlineCodeOffset, endCodeOffset, basicBlocks);
return perfProfiledBlocksFunctions_.append(func);
return perfProfiledBlocksFunctions_.append(mozilla::Move(func));
}
unsigned numPerfBlocksFunctions() const {
return perfProfiledBlocksFunctions_.length();

View File

@ -1637,6 +1637,13 @@ IonCompile(JSContext *cx, JSScript *script,
BaselineInspector inspector(script);
BaselineFrameInspector *baselineFrameInspector = nullptr;
if (baselineFrame) {
baselineFrameInspector = NewBaselineFrameInspector(temp, baselineFrame);
if (!baselineFrameInspector)
return AbortReason_Alloc;
}
AutoFlushCache afc("IonCompile", cx->runtime()->jitRuntime());
AutoTempAllocatorRooter root(cx, temp);
@ -1647,7 +1654,7 @@ IonCompile(JSContext *cx, JSScript *script,
IonBuilder *builder = alloc->new_<IonBuilder>((JSContext *) nullptr,
CompileCompartment::get(cx->compartment()),
temp, graph, constraints,
&inspector, info, baselineFrame);
&inspector, info, baselineFrameInspector);
if (!builder)
return AbortReason_Alloc;

View File

@ -37,9 +37,73 @@ using namespace js::jit;
using mozilla::DebugOnly;
using mozilla::Maybe;
class jit::BaselineFrameInspector
{
public:
types::Type thisType;
JSObject *singletonScopeChain;
Vector<types::Type, 4, IonAllocPolicy> argTypes;
Vector<types::Type, 4, IonAllocPolicy> varTypes;
BaselineFrameInspector(TempAllocator *temp)
: thisType(types::Type::UndefinedType()),
singletonScopeChain(nullptr),
argTypes(*temp),
varTypes(*temp)
{}
};
BaselineFrameInspector *
jit::NewBaselineFrameInspector(TempAllocator *temp, BaselineFrame *frame)
{
JS_ASSERT(frame);
BaselineFrameInspector *inspector = temp->lifoAlloc()->new_<BaselineFrameInspector>(temp);
if (!inspector)
return nullptr;
// Note: copying the actual values into a temporary structure for use
// during compilation could capture nursery pointers, so the values' types
// are recorded instead.
inspector->thisType = types::GetValueType(frame->thisValue());
if (frame->scopeChain()->hasSingletonType())
inspector->singletonScopeChain = frame->scopeChain();
JSScript *script = frame->script();
if (script->function()) {
if (!inspector->argTypes.reserve(frame->numFormalArgs()))
return nullptr;
for (size_t i = 0; i < frame->numFormalArgs(); i++) {
if (script->formalIsAliased(i))
inspector->argTypes.infallibleAppend(types::Type::UndefinedType());
else if (!script->argsObjAliasesFormals())
inspector->argTypes.infallibleAppend(types::GetValueType(frame->unaliasedFormal(i)));
else if (frame->hasArgsObj())
inspector->argTypes.infallibleAppend(types::GetValueType(frame->argsObj().arg(i)));
else
inspector->argTypes.infallibleAppend(types::Type::UndefinedType());
}
}
if (!inspector->varTypes.reserve(frame->script()->nfixed))
return nullptr;
for (size_t i = 0; i < frame->script()->nfixed; i++) {
if (script->varIsAliased(i))
inspector->varTypes.infallibleAppend(types::Type::UndefinedType());
else
inspector->varTypes.infallibleAppend(types::GetValueType(frame->unaliasedVar(i)));
}
return inspector;
}
IonBuilder::IonBuilder(JSContext *analysisContext, CompileCompartment *comp, TempAllocator *temp, MIRGraph *graph,
types::CompilerConstraintList *constraints,
BaselineInspector *inspector, CompileInfo *info, BaselineFrame *baselineFrame,
BaselineInspector *inspector, CompileInfo *info, BaselineFrameInspector *baselineFrame,
size_t inliningDepth, uint32_t loopDepth)
: MIRGenerator(comp, temp, graph, info),
backgroundCodegen_(nullptr),
@ -859,7 +923,7 @@ IonBuilder::initParameters()
// frame to determine possible initial types for 'this' and parameters.
if (thisTypes->empty() && baselineFrame_) {
if (!thisTypes->addType(types::GetValueType(baselineFrame_->thisValue()), alloc_->lifoAlloc()))
if (!thisTypes->addType(baselineFrame_->thisType, alloc_->lifoAlloc()))
return false;
}
@ -872,7 +936,7 @@ IonBuilder::initParameters()
if (types->empty() && baselineFrame_ &&
!script_->baselineScript()->modifiesArguments())
{
if (!types->addType(types::GetValueType(baselineFrame_->argv()[i]), alloc_->lifoAlloc()))
if (!types->addType(baselineFrame_->argTypes[i], alloc_->lifoAlloc()))
return false;
}
@ -5814,30 +5878,23 @@ IonBuilder::newPendingLoopHeader(MBasicBlock *predecessor, jsbytecode *pc, bool
MPhi *phi = block->getSlot(i)->toPhi();
// Get the value from the baseline frame.
Value existingValue;
// Get the type from the baseline frame.
types::Type existingType = types::Type::UndefinedType();
uint32_t arg = i - info().firstArgSlot();
uint32_t var = i - info().firstLocalSlot();
if (info().fun() && i == info().thisSlot()) {
existingValue = baselineFrame_->thisValue();
} else if (arg < info().nargs()) {
if (info().needsArgsObj())
existingValue = baselineFrame_->argsObj().arg(arg);
else
existingValue = baselineFrame_->unaliasedFormal(arg);
} else {
existingValue = baselineFrame_->unaliasedVar(var);
}
if (info().fun() && i == info().thisSlot())
existingType = baselineFrame_->thisType;
else if (arg < info().nargs())
existingType = baselineFrame_->argTypes[arg];
else
existingType = baselineFrame_->varTypes[var];
// Extract typeset from value.
MIRType type = existingValue.isDouble()
? MIRType_Double
: MIRTypeFromValueType(existingValue.extractNonDoubleType());
types::Type ntype = types::GetValueType(existingValue);
types::TemporaryTypeSet *typeSet =
alloc_->lifoAlloc()->new_<types::TemporaryTypeSet>(ntype);
alloc_->lifoAlloc()->new_<types::TemporaryTypeSet>(existingType);
if (!typeSet)
return nullptr;
MIRType type = MIRTypeFromValueType(typeSet->getKnownTypeTag());
phi->addBackedgeType(type, typeSet);
}
}
@ -9110,7 +9167,7 @@ IonBuilder::jsop_this()
}
if (thisTypes->getKnownTypeTag() == JSVAL_TYPE_OBJECT ||
(thisTypes->empty() && baselineFrame_ && baselineFrame_->thisValue().isObject()))
(thisTypes->empty() && baselineFrame_ && baselineFrame_->thisType.isSomeObject()))
{
// This is safe, because if the entry type of |this| is an object, it
// will necessarily be an object throughout the entire function. OSR
@ -9294,12 +9351,13 @@ IonBuilder::hasStaticScopeObject(ScopeCoordinate sc, JSObject **pcall)
// entering the Ion code a different call object will be created.
if (script() == outerScript && baselineFrame_ && info().osrPc()) {
JSObject *scope = baselineFrame_->scopeChain();
if (scope->is<CallObject>() &&
scope->as<CallObject>().callee().nonLazyScript() == outerScript)
JSObject *singletonScope = baselineFrame_->singletonScopeChain;
if (singletonScope &&
singletonScope->is<CallObject>() &&
singletonScope->as<CallObject>().callee().nonLazyScript() == outerScript)
{
JS_ASSERT(scope->hasSingletonType());
*pcall = scope;
JS_ASSERT(singletonScope->hasSingletonType());
*pcall = singletonScope;
return true;
}
}

View File

@ -24,6 +24,12 @@ namespace jit {
class CodeGenerator;
class CallInfo;
class BaselineInspector;
class BaselineFrameInspector;
// Records information about a baseline frame for compilation that is stable
// when later used off thread.
BaselineFrameInspector *
NewBaselineFrameInspector(TempAllocator *temp, BaselineFrame *frame);
class IonBuilder : public MIRGenerator
{
@ -207,7 +213,7 @@ class IonBuilder : public MIRGenerator
public:
IonBuilder(JSContext *analysisContext, CompileCompartment *comp, TempAllocator *temp, MIRGraph *graph,
types::CompilerConstraintList *constraints,
BaselineInspector *inspector, CompileInfo *info, BaselineFrame *baselineFrame,
BaselineInspector *inspector, CompileInfo *info, BaselineFrameInspector *baselineFrame,
size_t inliningDepth = 0, uint32_t loopDepth = 0);
bool build();
@ -745,7 +751,7 @@ class IonBuilder : public MIRGenerator
bool init();
JSContext *analysisContext;
BaselineFrame *baselineFrame_;
BaselineFrameInspector *baselineFrame_;
AbortReason abortReason_;
TypeRepresentationSetHash *reprSetHash_;

View File

@ -605,7 +605,11 @@ MacroAssembler::clampDoubleToUint8(FloatRegister input, Register output)
addDouble(ScratchFloatReg, input);
Label outOfRange;
branchTruncateDouble(input, output, &outOfRange);
// Truncate to int32 and ensure the result <= 255. This relies on the
// processor setting output to a value > 255 for doubles outside the int32
// range (for instance 0x80000000).
cvttsd2si(input, output);
branch32(Assembler::Above, output, Imm32(255), &outOfRange);
{
// Check if we had a tie.

View File

@ -5364,9 +5364,13 @@ JS::GetGCNumber()
}
JS::AutoAssertNoGC::AutoAssertNoGC()
: runtime(js::TlsPerThreadData.get()->runtimeFromMainThread())
: runtime(nullptr)
{
gcNumber = runtime->gcNumber;
js::PerThreadData *data = js::TlsPerThreadData.get();
if (data) {
runtime = data->runtimeFromMainThread();
gcNumber = runtime->gcNumber;
}
}
JS::AutoAssertNoGC::AutoAssertNoGC(JSRuntime *rt)
@ -5376,6 +5380,9 @@ JS::AutoAssertNoGC::AutoAssertNoGC(JSRuntime *rt)
JS::AutoAssertNoGC::~AutoAssertNoGC()
{
MOZ_ASSERT(gcNumber == runtime->gcNumber, "GC ran inside an AutoAssertNoGC scope.");
if (runtime)
MOZ_ASSERT(gcNumber == runtime->gcNumber, "GC ran inside an AutoAssertNoGC scope.");
else
MOZ_ASSERT(!js::TlsPerThreadData.get(), "Runtime created within AutoAssertNoGC scope?");
}
#endif

View File

@ -209,6 +209,10 @@ class Type
return (JSValueType) data;
}
bool isSomeObject() const {
return data == JSVAL_TYPE_OBJECT || data > JSVAL_TYPE_UNKNOWN;
}
bool isAnyObject() const {
return data == JSVAL_TYPE_OBJECT;
}

View File

@ -346,7 +346,7 @@ js::ObjectImpl::numFixedSlotsForCompilation() const
#ifdef JSGC_GENERATIONAL
// The compiler does not have access to nursery things, so if this object
// is in the nursery we can fall back to numFixedSlots().
if (!isTenured())
if (IsInsideNursery(GetGCThingRuntime(this), this))
return numFixedSlots();
#endif
gc::AllocKind kind = tenuredGetAllocKind();

View File

@ -8111,6 +8111,9 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
} else if (nsGkAtoms::legendFrame == frameType) {
newFrame = NS_NewLegendFrame(shell, styleContext);
newFrame->Init(content, aParentFrame, aFrame);
} else if (nsGkAtoms::flexContainerFrame == frameType) {
newFrame = NS_NewFlexContainerFrame(shell, styleContext);
newFrame->Init(content, aParentFrame, aFrame);
} else {
NS_RUNTIMEABORT("unexpected frame type");
}

View File

@ -515,6 +515,21 @@ protected:
// in our constructor).
};
// Helper function to calculate the sum of our flex items'
// margin-box main sizes.
static nscoord
SumFlexItemMarginBoxMainSizes(const FlexboxAxisTracker& aAxisTracker,
const nsTArray<FlexItem>& aItems)
{
nscoord sum = 0;
for (uint32_t i = 0; i < aItems.Length(); ++i) {
const FlexItem& item = aItems[i];
sum += item.GetMainSize() +
item.GetMarginBorderPaddingSizeInAxis(aAxisTracker.GetMainAxis());
}
return sum;
}
// Helper-function to find the first non-anonymous-box descendent of aFrame.
static nsIFrame*
GetFirstNonAnonBoxDescendant(nsIFrame* aFrame)
@ -1987,7 +2002,9 @@ nscoord
nsFlexContainerFrame::ComputeFlexContainerMainSize(
const nsHTMLReflowState& aReflowState,
const FlexboxAxisTracker& aAxisTracker,
const nsTArray<FlexItem>& aItems)
const nsTArray<FlexItem>& aItems,
nscoord aAvailableHeightForContent,
nsReflowStatus& aStatus)
{
if (IsAxisHorizontal(aAxisTracker.GetMainAxis())) {
// Horizontal case is easy -- our main size is our computed width
@ -1995,23 +2012,96 @@ nsFlexContainerFrame::ComputeFlexContainerMainSize(
return aReflowState.ComputedWidth();
}
// Vertical case, with non-auto-height:
if (aReflowState.ComputedHeight() != NS_AUTOHEIGHT) {
return aReflowState.ComputedHeight();
nscoord effectiveComputedHeight = GetEffectiveComputedHeight(aReflowState);
if (effectiveComputedHeight != NS_INTRINSICSIZE) {
// Vertical case, with fixed height:
if (aAvailableHeightForContent == NS_UNCONSTRAINEDSIZE ||
effectiveComputedHeight < aAvailableHeightForContent) {
// Not in a fragmenting context, OR no need to fragment because we have
// more available height than we need. Either way, just use our fixed
// height. (Note that the reflow state has already done the appropriate
// min/max-height clamping.)
return effectiveComputedHeight;
}
// Fragmenting *and* our fixed height is too tall for available height:
// Mark incomplete so we get a next-in-flow, and take up all of the
// available height (or the amount of height required by our children, if
// that's larger; but of course not more than our own computed height).
// XXXdholbert For now, we don't support pushing children to our next
// continuation or splitting children, so "amount of height required by
// our children" is just the sum of our children's heights.
NS_FRAME_SET_INCOMPLETE(aStatus);
nscoord sumOfChildHeights =
SumFlexItemMarginBoxMainSizes(aAxisTracker, aItems);
if (sumOfChildHeights <= aAvailableHeightForContent) {
return aAvailableHeightForContent;
}
return std::min(effectiveComputedHeight, sumOfChildHeights);
}
// Vertical case, with auto-height:
// Resolve auto-height to the sum of our items' hypothetical outer main
// sizes (their outer heights), clamped to our computed min/max main-size
// properties (min-height & max-height).
nscoord sumOfChildHeights = 0;
for (uint32_t i = 0; i < aItems.Length(); ++i) {
sumOfChildHeights +=
aItems[i].GetMainSize() +
aItems[i].GetMarginBorderPaddingSizeInAxis(aAxisTracker.GetMainAxis());
// XXXdholbert Handle constrained-aAvailableHeightForContent case here.
nscoord sumOfChildHeights =
SumFlexItemMarginBoxMainSizes(aAxisTracker, aItems);
return NS_CSS_MINMAX(sumOfChildHeights,
aReflowState.mComputedMinHeight,
aReflowState.mComputedMaxHeight);
}
nscoord
nsFlexContainerFrame::ComputeFlexContainerCrossSize(
const nsHTMLReflowState& aReflowState,
const FlexboxAxisTracker& aAxisTracker,
nscoord aLineCrossSize,
nscoord aAvailableHeightForContent,
bool* aIsDefinite,
nsReflowStatus& aStatus)
{
MOZ_ASSERT(aIsDefinite, "outparam pointer must be non-null");
if (IsAxisHorizontal(aAxisTracker.GetCrossAxis())) {
// Cross axis is horizontal: our cross size is our computed width
// (which is already resolved).
*aIsDefinite = true;
return aReflowState.ComputedWidth();
}
return NS_CSS_MINMAX(sumOfChildHeights,
nscoord effectiveComputedHeight = GetEffectiveComputedHeight(aReflowState);
if (effectiveComputedHeight != NS_INTRINSICSIZE) {
// Cross-axis is vertical, and we have a fixed height:
*aIsDefinite = true;
if (aAvailableHeightForContent == NS_UNCONSTRAINEDSIZE ||
effectiveComputedHeight < aAvailableHeightForContent) {
// Not in a fragmenting context, OR no need to fragment because we have
// more available height than we need. Either way, just use our fixed
// height. (Note that the reflow state has already done the appropriate
// min/max-height clamping.)
return effectiveComputedHeight;
}
// Fragmenting *and* our fixed height is too tall for available height:
// Mark incomplete so we get a next-in-flow, and take up all of the
// available height (or the amount of height required by our children, if
// that's larger; but of course not more than our own computed height).
// XXXdholbert For now, we don't support pushing children to our next
// continuation or splitting children, so "amount of height required by
// our children" is just our line-height.
NS_FRAME_SET_INCOMPLETE(aStatus);
if (aLineCrossSize <= aAvailableHeightForContent) {
return aAvailableHeightForContent;
}
return std::min(effectiveComputedHeight, aLineCrossSize);
}
// Cross axis is vertical and we have auto-height: shrink-wrap our line(s),
// subject to our min-size / max-size constraints in that (vertical) axis.
// XXXdholbert Handle constrained-aAvailableHeightForContent case here.
*aIsDefinite = false;
return NS_CSS_MINMAX(aLineCrossSize,
aReflowState.mComputedMinHeight,
aReflowState.mComputedMaxHeight);
}
@ -2229,8 +2319,21 @@ nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
axisTracker, items);
NS_ENSURE_SUCCESS(rv, rv);
// If we're being fragmented into a constrained height, subtract off
// borderpadding-top from it, to get the available height for our
// content box. (Don't subtract if we're skipping top border/padding,
// though.)
nscoord availableHeightForContent = aReflowState.availableHeight;
if (availableHeightForContent != NS_UNCONSTRAINEDSIZE &&
!(GetSkipSides() & (1 << NS_SIDE_TOP))) {
availableHeightForContent -= aReflowState.mComputedBorderPadding.top;
// (Don't let that push availableHeightForContent below zero, though):
availableHeightForContent = std::max(availableHeightForContent, 0);
}
const nscoord contentBoxMainSize =
ComputeFlexContainerMainSize(aReflowState, axisTracker, items);
ComputeFlexContainerMainSize(aReflowState, axisTracker, items,
availableHeightForContent, aStatus);
ResolveFlexibleLengths(axisTracker, contentBoxMainSize, items);
@ -2277,34 +2380,20 @@ nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
// 'align-content' is 'stretch' -- if it is, we need to give each line an
// additional share of our flex container's desired cross-size. (if it's
// not NS_AUTOHEIGHT and there's any cross-size left over to distribute)
bool isCrossSizeDefinite;
const nscoord contentBoxCrossSize =
ComputeFlexContainerCrossSize(aReflowState, axisTracker,
lineCrossAxisPosnTracker.GetLineCrossSize(),
availableHeightForContent,
&isCrossSizeDefinite, aStatus);
// Calculate the content-box cross size of our flex container:
nscoord contentBoxCrossSize =
GET_CROSS_COMPONENT(axisTracker,
aReflowState.ComputedWidth(),
aReflowState.ComputedHeight());
if (contentBoxCrossSize == NS_AUTOHEIGHT) {
// Unconstrained 'auto' cross-size: shrink-wrap our line(s), subject
// to our min-size / max-size constraints in that axis.
nscoord minCrossSize = GET_CROSS_COMPONENT(axisTracker,
aReflowState.mComputedMinWidth,
aReflowState.mComputedMinHeight);
nscoord maxCrossSize = GET_CROSS_COMPONENT(axisTracker,
aReflowState.mComputedMaxWidth,
aReflowState.mComputedMaxHeight);
contentBoxCrossSize =
NS_CSS_MINMAX(lineCrossAxisPosnTracker.GetLineCrossSize(),
minCrossSize, maxCrossSize);
}
if (lineCrossAxisPosnTracker.GetLineCrossSize() !=
contentBoxCrossSize) {
if (isCrossSizeDefinite) {
// XXXdholbert When we support multi-line flex containers, we should
// distribute any extra space among or between our lines here according
// to 'align-content'. For now, we do the single-line special behavior:
// "If the flex container has only a single line (even if it's a
// multi-line flex container), the cross size of the flex line is the
// flex container's inner cross size."
// "If the flex container has only a single line (even if it's a multi-line
// flex container) and has a definite cross size, the cross size of the
// flex line is the flex container's inner cross size."
lineCrossAxisPosnTracker.SetLineCrossSize(contentBoxCrossSize);
}
@ -2461,8 +2550,9 @@ nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
aDesiredSize.width = desiredContentBoxSize.width +
containerBorderPadding.LeftRight();
// Does *NOT* include bottom border/padding yet (we add that a bit lower down)
aDesiredSize.height = desiredContentBoxSize.height +
containerBorderPadding.TopBottom();
containerBorderPadding.top;
if (flexContainerAscent == nscoord_MIN) {
// Still don't have our baseline set -- this happens if we have no
@ -2473,12 +2563,36 @@ nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
"Have flex items but didn't get an ascent - that's odd "
"(or there are just gigantic sizes involved)");
// Per spec, just use the bottom of content-box.
flexContainerAscent = aDesiredSize.height -
aReflowState.mComputedBorderPadding.bottom;
flexContainerAscent = aDesiredSize.height;
}
aDesiredSize.ascent = flexContainerAscent;
// Now: If we're complete, add bottom border/padding to desired height
// (unless that pushes us over available height, in which case we become
// incomplete (unless we already weren't asking for any height, in which case
// we stay complete to avoid looping forever)).
// NOTE: If we're auto-height, we allow our bottom border/padding to push us
// over the available height without requesting a continuation, for
// consistency with the behavior of "display:block" elements.
if (NS_FRAME_IS_COMPLETE(aStatus)) {
// NOTE: We can't use containerBorderPadding.bottom for this, because if
// we're auto-height, ApplySkipSides will have zeroed it (because it
// assumed we might get a continuation). We have the correct value in
// aReflowState.mComputedBorderPadding.bottom, though, so we use that.
nscoord desiredHeightWithBottomBP =
aDesiredSize.height + aReflowState.mComputedBorderPadding.bottom;
if (aDesiredSize.height == 0 ||
desiredHeightWithBottomBP <= aReflowState.availableHeight ||
aReflowState.ComputedHeight() == NS_INTRINSICSIZE) {
// Update desired height to include bottom border/padding
aDesiredSize.height = desiredHeightWithBottomBP;
} else {
// We couldn't fit bottom border/padding, so we'll need a continuation.
NS_FRAME_SET_INCOMPLETE(aStatus);
}
}
// Overflow area = union(my overflow area, kids' overflow areas)
aDesiredSize.SetOverflowAreasToDesiredBounds();
for (nsFrameList::Enumerator e(mFrames); !e.AtEnd(); e.Next()) {

View File

@ -106,7 +106,16 @@ protected:
nscoord ComputeFlexContainerMainSize(const nsHTMLReflowState& aReflowState,
const FlexboxAxisTracker& aAxisTracker,
const nsTArray<FlexItem>& aFlexItems);
const nsTArray<FlexItem>& aFlexItems,
nscoord aAvailableHeightForContent,
nsReflowStatus& aStatus);
nscoord ComputeFlexContainerCrossSize(const nsHTMLReflowState& aReflowState,
const FlexboxAxisTracker& aAxisTracker,
nscoord aLineCrossSize,
nscoord aAvailableHeightForContent,
bool* aIsDefinite,
nsReflowStatus& aStatus);
void PositionItemInMainAxis(MainAxisPositionTracker& aMainAxisPosnTracker,
FlexItem& aItem);

View File

@ -0,0 +1,99 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<html>
<head>
<style>
.multicol {
height: 10px;
width: 100px;
-moz-column-width: 20px;
-moz-column-fill: auto;
border: 2px solid orange;
}
.flexContainer {
background: teal;
/* border-width is 0 by default; some sub-testcases will increase it. */
border: 0 dashed black;
}
</style>
</head>
<body>
<!-- NO BORDERS/PADDING -->
<!-- ================== -->
<!-- content fits exactly into 1 column: -->
<div class="multicol">
<div class="flexContainer" style="height: 10px"></div>
</div>
<!-- content fits, but margin-top pushes it to overflow: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
margin-top: 2px;"></div>
</div>
<!-- content is too tall, by 1px: -->
<div class="multicol">
<div class="flexContainer" style="height: 11px"></div>
</div>
<!-- BORDERS/PADDING ON TOP -->
<!-- ====================== -->
<!-- content fits, but border-top makes us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-top-width: 2px"></div>
</div>
<!-- content fits, but padding-top makes us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
padding-top: 2px"></div>
</div>
<!-- content fits, but border/padding-top make us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-top-width: 1px;
padding-top: 1px"></div>
</div>
<!-- BORDERS/PADDING ON BOTTOM -->
<!-- ========================= -->
<!-- content fits, but border-bottom-width makes us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-bottom-width: 2px"></div>
</div>
<!-- content fits, but padding-bottom makes us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
padding-bottom: 2px"></div>
</div>
<!-- content fits, but border/padding-bottom make us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-bottom-width: 1px;
padding-bottom: 1px"></div>
</div>
<!-- BORDERS/PADDING ON TOP AND BOTTOM -->
<!-- ================================= -->
<!-- content fits, but border-top/bottom combined make us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-top-width: 1px;
border-bottom-width: 1px"></div>
</div>
<!-- content fits, but padding-top/bottom combined make us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
padding-top: 1px;
padding-bottom: 1px"></div>
</div>
</body>
</html>

View File

@ -0,0 +1,105 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!-- Testcase for how we fragment an empty fixed-height flex container, with
various combinations of margin/border/padding helping it to be too tall,
and with the flex container having "flex-direction: row".
-->
<html>
<head>
<style>
.multicol {
height: 10px;
width: 100px;
-moz-column-width: 20px;
-moz-column-fill: auto;
border: 2px solid orange;
}
.flexContainer {
display: flex;
flex-direction: row;
background: teal;
/* border-width is 0 by default; some sub-testcases will increase it. */
border: 0 dashed black;
}
</style>
</head>
<body>
<!-- NO BORDERS/PADDING -->
<!-- ================== -->
<!-- content fits exactly into 1 column: -->
<div class="multicol">
<div class="flexContainer" style="height: 10px"></div>
</div>
<!-- content fits, but margin-top pushes it to overflow: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
margin-top: 2px;"></div>
</div>
<!-- content is too tall, by 1px: -->
<div class="multicol">
<div class="flexContainer" style="height: 11px"></div>
</div>
<!-- BORDERS/PADDING ON TOP -->
<!-- ====================== -->
<!-- content fits, but border-top makes us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-top-width: 2px"></div>
</div>
<!-- content fits, but padding-top makes us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
padding-top: 2px"></div>
</div>
<!-- content fits, but border/padding-top make us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-top-width: 1px;
padding-top: 1px"></div>
</div>
<!-- BORDERS/PADDING ON BOTTOM -->
<!-- ========================= -->
<!-- content fits, but border-bottom-width makes us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-bottom-width: 2px"></div>
</div>
<!-- content fits, but padding-bottom makes us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
padding-bottom: 2px"></div>
</div>
<!-- content fits, but border/padding-bottom make us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-bottom-width: 1px;
padding-bottom: 1px"></div>
</div>
<!-- BORDERS/PADDING ON TOP AND BOTTOM -->
<!-- ================================= -->
<!-- content fits, but border-top/bottom combined make us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-top-width: 1px;
border-bottom-width: 1px"></div>
</div>
<!-- content fits, but padding-top/bottom combined make us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
padding-top: 1px;
padding-bottom: 1px"></div>
</div>
</body>
</html>

View File

@ -0,0 +1,105 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!-- Testcase for how we fragment an empty fixed-height flex container, with
various combinations of margin/border/padding helping it to be too tall,
and with the flex container having "flex-direction: row-reverse".
-->
<html>
<head>
<style>
.multicol {
height: 10px;
width: 100px;
-moz-column-width: 20px;
-moz-column-fill: auto;
border: 2px solid orange;
}
.flexContainer {
display: flex;
flex-direction: row-reverse;
background: teal;
/* border-width is 0 by default; some sub-testcases will increase it. */
border: 0 dashed black;
}
</style>
</head>
<body>
<!-- NO BORDERS/PADDING -->
<!-- ================== -->
<!-- content fits exactly into 1 column: -->
<div class="multicol">
<div class="flexContainer" style="height: 10px"></div>
</div>
<!-- content fits, but margin-top pushes it to overflow: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
margin-top: 2px;"></div>
</div>
<!-- content is too tall, by 1px: -->
<div class="multicol">
<div class="flexContainer" style="height: 11px"></div>
</div>
<!-- BORDERS/PADDING ON TOP -->
<!-- ====================== -->
<!-- content fits, but border-top makes us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-top-width: 2px"></div>
</div>
<!-- content fits, but padding-top makes us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
padding-top: 2px"></div>
</div>
<!-- content fits, but border/padding-top make us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-top-width: 1px;
padding-top: 1px"></div>
</div>
<!-- BORDERS/PADDING ON BOTTOM -->
<!-- ========================= -->
<!-- content fits, but border-bottom-width makes us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-bottom-width: 2px"></div>
</div>
<!-- content fits, but padding-bottom makes us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
padding-bottom: 2px"></div>
</div>
<!-- content fits, but border/padding-bottom make us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-bottom-width: 1px;
padding-bottom: 1px"></div>
</div>
<!-- BORDERS/PADDING ON TOP AND BOTTOM -->
<!-- ================================= -->
<!-- content fits, but border-top/bottom combined make us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-top-width: 1px;
border-bottom-width: 1px"></div>
</div>
<!-- content fits, but padding-top/bottom combined make us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
padding-top: 1px;
padding-bottom: 1px"></div>
</div>
</body>
</html>

View File

@ -0,0 +1,105 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!-- Testcase for how we fragment an empty fixed-height flex container, with
various combinations of margin/border/padding helping it to be too tall,
and with the flex container having "flex-direction: column".
-->
<html>
<head>
<style>
.multicol {
height: 10px;
width: 100px;
-moz-column-width: 20px;
-moz-column-fill: auto;
border: 2px solid orange;
}
.flexContainer {
display: flex;
flex-direction: column;
background: teal;
/* border-width is 0 by default; some sub-testcases will increase it. */
border: 0 dashed black;
}
</style>
</head>
<body>
<!-- NO BORDERS/PADDING -->
<!-- ================== -->
<!-- content fits exactly into 1 column: -->
<div class="multicol">
<div class="flexContainer" style="height: 10px"></div>
</div>
<!-- content fits, but margin-top pushes it to overflow: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
margin-top: 2px;"></div>
</div>
<!-- content is too tall, by 1px: -->
<div class="multicol">
<div class="flexContainer" style="height: 11px"></div>
</div>
<!-- BORDERS/PADDING ON TOP -->
<!-- ====================== -->
<!-- content fits, but border-top makes us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-top-width: 2px"></div>
</div>
<!-- content fits, but padding-top makes us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
padding-top: 2px"></div>
</div>
<!-- content fits, but border/padding-top make us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-top-width: 1px;
padding-top: 1px"></div>
</div>
<!-- BORDERS/PADDING ON BOTTOM -->
<!-- ========================= -->
<!-- content fits, but border-bottom-width makes us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-bottom-width: 2px"></div>
</div>
<!-- content fits, but padding-bottom makes us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
padding-bottom: 2px"></div>
</div>
<!-- content fits, but border/padding-bottom make us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-bottom-width: 1px;
padding-bottom: 1px"></div>
</div>
<!-- BORDERS/PADDING ON TOP AND BOTTOM -->
<!-- ================================= -->
<!-- content fits, but border-top/bottom combined make us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-top-width: 1px;
border-bottom-width: 1px"></div>
</div>
<!-- content fits, but padding-top/bottom combined make us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
padding-top: 1px;
padding-bottom: 1px"></div>
</div>
</body>
</html>

View File

@ -0,0 +1,105 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!-- Testcase for how we fragment an empty fixed-height flex container, with
various combinations of margin/border/padding helping it to be too tall,
and with the flex container having "flex-direction: column-reverse".
-->
<html>
<head>
<style>
.multicol {
height: 10px;
width: 100px;
-moz-column-width: 20px;
-moz-column-fill: auto;
border: 2px solid orange;
}
.flexContainer {
display: flex;
flex-direction: column-reverse;
background: teal;
/* border-width is 0 by default; some sub-testcases will increase it. */
border: 0 dashed black;
}
</style>
</head>
<body>
<!-- NO BORDERS/PADDING -->
<!-- ================== -->
<!-- content fits exactly into 1 column: -->
<div class="multicol">
<div class="flexContainer" style="height: 10px"></div>
</div>
<!-- content fits, but margin-top pushes it to overflow: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
margin-top: 2px;"></div>
</div>
<!-- content is too tall, by 1px: -->
<div class="multicol">
<div class="flexContainer" style="height: 11px"></div>
</div>
<!-- BORDERS/PADDING ON TOP -->
<!-- ====================== -->
<!-- content fits, but border-top makes us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-top-width: 2px"></div>
</div>
<!-- content fits, but padding-top makes us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
padding-top: 2px"></div>
</div>
<!-- content fits, but border/padding-top make us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-top-width: 1px;
padding-top: 1px"></div>
</div>
<!-- BORDERS/PADDING ON BOTTOM -->
<!-- ========================= -->
<!-- content fits, but border-bottom-width makes us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-bottom-width: 2px"></div>
</div>
<!-- content fits, but padding-bottom makes us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
padding-bottom: 2px"></div>
</div>
<!-- content fits, but border/padding-bottom make us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-bottom-width: 1px;
padding-bottom: 1px"></div>
</div>
<!-- BORDERS/PADDING ON TOP AND BOTTOM -->
<!-- ================================= -->
<!-- content fits, but border-top/bottom combined make us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
border-top-width: 1px;
border-bottom-width: 1px"></div>
</div>
<!-- content fits, but padding-top/bottom combined make us too tall: -->
<div class="multicol">
<div class="flexContainer" style="height: 9px;
padding-top: 1px;
padding-bottom: 1px"></div>
</div>
</body>
</html>

View File

@ -0,0 +1,109 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!-- Testcase for how we fragment an empty fixed-height flex container, with
various combinations of margin/border/padding helping it to be too tall,
with the flex container overflowing its fixed-height-block parent,
and with the flex container having "flex-direction: row".
-->
<html>
<head>
<style>
.multicol {
height: 10px;
width: 100px;
-moz-column-width: 20px;
-moz-column-fill: auto;
border: 2px solid orange;
}
.fixedHeightBlock {
height: 2px;
}
.flexContainer {
display: flex;
flex-direction: row;
background: teal;
/* border-width is 0 by default; some sub-testcases will increase it. */
border: 0 dashed black;
}
</style>
</head>
<body>
<!-- NO BORDERS/PADDING -->
<!-- ================== -->
<!-- content fits exactly into 1 column: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 10px"></div>
</div></div>
<!-- content fits, but margin-top pushes it to overflow: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
margin-top: 2px;"></div>
</div></div>
<!-- content is too tall, by 1px: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 11px"></div>
</div></div>
<!-- BORDERS/PADDING ON TOP -->
<!-- ====================== -->
<!-- content fits, but border-top makes us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
border-top-width: 2px"></div>
</div></div>
<!-- content fits, but padding-top makes us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
padding-top: 2px"></div>
</div></div>
<!-- content fits, but border/padding-top make us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
border-top-width: 1px;
padding-top: 1px"></div>
</div></div>
<!-- BORDERS/PADDING ON BOTTOM -->
<!-- ========================= -->
<!-- content fits, but border-bottom-width makes us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
border-bottom-width: 2px"></div>
</div></div>
<!-- content fits, but padding-bottom makes us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
padding-bottom: 2px"></div>
</div></div>
<!-- content fits, but border/padding-bottom make us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
border-bottom-width: 1px;
padding-bottom: 1px"></div>
</div></div>
<!-- BORDERS/PADDING ON TOP AND BOTTOM -->
<!-- ================================= -->
<!-- content fits, but border-top/bottom combined make us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
border-top-width: 1px;
border-bottom-width: 1px"></div>
</div></div>
<!-- content fits, but padding-top/bottom combined make us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
padding-top: 1px;
padding-bottom: 1px"></div>
</div></div>
</body>
</html>

View File

@ -0,0 +1,109 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!-- Testcase for how we fragment an empty fixed-height flex container, with
various combinations of margin/border/padding helping it to be too tall,
with the flex container overflowing its fixed-height-block parent,
and with the flex container having "flex-direction: row-reverse".
-->
<html>
<head>
<style>
.multicol {
height: 10px;
width: 100px;
-moz-column-width: 20px;
-moz-column-fill: auto;
border: 2px solid orange;
}
.fixedHeightBlock {
height: 2px;
}
.flexContainer {
display: flex;
flex-direction: row-reverse;
background: teal;
/* border-width is 0 by default; some sub-testcases will increase it. */
border: 0 dashed black;
}
</style>
</head>
<body>
<!-- NO BORDERS/PADDING -->
<!-- ================== -->
<!-- content fits exactly into 1 column: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 10px"></div>
</div></div>
<!-- content fits, but margin-top pushes it to overflow: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
margin-top: 2px;"></div>
</div></div>
<!-- content is too tall, by 1px: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 11px"></div>
</div></div>
<!-- BORDERS/PADDING ON TOP -->
<!-- ====================== -->
<!-- content fits, but border-top makes us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
border-top-width: 2px"></div>
</div></div>
<!-- content fits, but padding-top makes us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
padding-top: 2px"></div>
</div></div>
<!-- content fits, but border/padding-top make us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
border-top-width: 1px;
padding-top: 1px"></div>
</div></div>
<!-- BORDERS/PADDING ON BOTTOM -->
<!-- ========================= -->
<!-- content fits, but border-bottom-width makes us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
border-bottom-width: 2px"></div>
</div></div>
<!-- content fits, but padding-bottom makes us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
padding-bottom: 2px"></div>
</div></div>
<!-- content fits, but border/padding-bottom make us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
border-bottom-width: 1px;
padding-bottom: 1px"></div>
</div></div>
<!-- BORDERS/PADDING ON TOP AND BOTTOM -->
<!-- ================================= -->
<!-- content fits, but border-top/bottom combined make us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
border-top-width: 1px;
border-bottom-width: 1px"></div>
</div></div>
<!-- content fits, but padding-top/bottom combined make us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
padding-top: 1px;
padding-bottom: 1px"></div>
</div></div>
</body>
</html>

View File

@ -0,0 +1,109 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!-- Testcase for how we fragment an empty fixed-height flex container, with
various combinations of margin/border/padding helping it to be too tall,
with the flex container overflowing its fixed-height-block parent,
and with the flex container having "flex-direction: column".
-->
<html>
<head>
<style>
.multicol {
height: 10px;
width: 100px;
-moz-column-width: 20px;
-moz-column-fill: auto;
border: 2px solid orange;
}
.fixedHeightBlock {
height: 2px;
}
.flexContainer {
display: flex;
flex-direction: column;
background: teal;
/* border-width is 0 by default; some sub-testcases will increase it. */
border: 0 dashed black;
}
</style>
</head>
<body>
<!-- NO BORDERS/PADDING -->
<!-- ================== -->
<!-- content fits exactly into 1 column: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 10px"></div>
</div></div>
<!-- content fits, but margin-top pushes it to overflow: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
margin-top: 2px;"></div>
</div></div>
<!-- content is too tall, by 1px: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 11px"></div>
</div></div>
<!-- BORDERS/PADDING ON TOP -->
<!-- ====================== -->
<!-- content fits, but border-top makes us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
border-top-width: 2px"></div>
</div></div>
<!-- content fits, but padding-top makes us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
padding-top: 2px"></div>
</div></div>
<!-- content fits, but border/padding-top make us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
border-top-width: 1px;
padding-top: 1px"></div>
</div></div>
<!-- BORDERS/PADDING ON BOTTOM -->
<!-- ========================= -->
<!-- content fits, but border-bottom-width makes us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
border-bottom-width: 2px"></div>
</div></div>
<!-- content fits, but padding-bottom makes us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
padding-bottom: 2px"></div>
</div></div>
<!-- content fits, but border/padding-bottom make us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
border-bottom-width: 1px;
padding-bottom: 1px"></div>
</div></div>
<!-- BORDERS/PADDING ON TOP AND BOTTOM -->
<!-- ================================= -->
<!-- content fits, but border-top/bottom combined make us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
border-top-width: 1px;
border-bottom-width: 1px"></div>
</div></div>
<!-- content fits, but padding-top/bottom combined make us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
padding-top: 1px;
padding-bottom: 1px"></div>
</div></div>
</body>
</html>

View File

@ -0,0 +1,109 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!-- Testcase for how we fragment an empty fixed-height flex container, with
various combinations of margin/border/padding helping it to be too tall,
with the flex container overflowing its fixed-height-block parent,
and with the flex container having "flex-direction: column-reverse".
-->
<html>
<head>
<style>
.multicol {
height: 10px;
width: 100px;
-moz-column-width: 20px;
-moz-column-fill: auto;
border: 2px solid orange;
}
.fixedHeightBlock {
height: 2px;
}
.flexContainer {
display: flex;
flex-direction: column-reverse;
background: teal;
/* border-width is 0 by default; some sub-testcases will increase it. */
border: 0 dashed black;
}
</style>
</head>
<body>
<!-- NO BORDERS/PADDING -->
<!-- ================== -->
<!-- content fits exactly into 1 column: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 10px"></div>
</div></div>
<!-- content fits, but margin-top pushes it to overflow: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
margin-top: 2px;"></div>
</div></div>
<!-- content is too tall, by 1px: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 11px"></div>
</div></div>
<!-- BORDERS/PADDING ON TOP -->
<!-- ====================== -->
<!-- content fits, but border-top makes us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
border-top-width: 2px"></div>
</div></div>
<!-- content fits, but padding-top makes us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
padding-top: 2px"></div>
</div></div>
<!-- content fits, but border/padding-top make us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
border-top-width: 1px;
padding-top: 1px"></div>
</div></div>
<!-- BORDERS/PADDING ON BOTTOM -->
<!-- ========================= -->
<!-- content fits, but border-bottom-width makes us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
border-bottom-width: 2px"></div>
</div></div>
<!-- content fits, but padding-bottom makes us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
padding-bottom: 2px"></div>
</div></div>
<!-- content fits, but border/padding-bottom make us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
border-bottom-width: 1px;
padding-bottom: 1px"></div>
</div></div>
<!-- BORDERS/PADDING ON TOP AND BOTTOM -->
<!-- ================================= -->
<!-- content fits, but border-top/bottom combined make us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
border-top-width: 1px;
border-bottom-width: 1px"></div>
</div></div>
<!-- content fits, but padding-top/bottom combined make us too tall: -->
<div class="multicol"><div class="fixedHeightBlock">
<div class="flexContainer" style="height: 9px;
padding-top: 1px;
padding-bottom: 1px"></div>
</div></div>
</body>
</html>

View File

@ -0,0 +1,136 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!-- Testcase for how we fragment an empty fixed-height flex container, with
margin/border/padding that are larger than the available height,
and with the flex container having "flex-direction: row".
-->
<html>
<head>
<style>
.multicol {
height: 10px;
width: 100px;
-moz-column-width: 20px;
-moz-column-fill: auto;
border: 2px solid orange;
margin-bottom: 2px;
}
.flexContainer {
background: teal;
/* border-width is 0 by default; some sub-testcases will increase it. */
border: 0 dashed black;
}
</style>
</head>
<body>
<!-- MARGIN LARGER THAN AVAILABLE HEIGHT -->
<!-- =================================== -->
<!-- margin-top is the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
margin-top: 10px"></div>
</div>
<!-- margin-top is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
margin-top: 11px"></div>
</div>
<!-- margin-bottom is exactly the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
margin-bottom: 10px"></div>
</div>
<!-- margin-bottom is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
margin-bottom: 11px"></div>
</div>
<!-- BORDER LARGER THAN AVAILABLE HEIGHT -->
<!-- =================================== -->
<!-- border-top-width is the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-top-width: 10px"></div>
</div>
<!-- border-top-width is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-top-width: 11px"></div>
</div>
<!-- border-bottom-width is exactly the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-bottom-width: 10px"></div>
</div>
<!-- border-bottom-width is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-bottom-width: 11px"></div>
</div>
<!-- PADDING LARGER THAN AVAILABLE HEIGHT -->
<!-- ==================================== -->
<!-- padding-top is the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
padding-top: 10px"></div>
</div>
<!-- padding-top is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
padding-top: 11px"></div>
</div>
<!-- padding-bottom is exactly the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
padding-bottom: 10px"></div>
</div>
<!-- padding-bottom is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
padding-bottom: 11px"></div>
</div>
<!-- BORDER+PADDING LARGER THAN AVAILABLE HEIGHT -->
<!-- =========================================== -->
<!-- border+padding-top is the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-top: 5px;
padding-top: 5px"></div>
</div>
<!-- padding-top is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-top: 6px;
padding-top: 6px"></div>
</div>
<!-- padding-bottom is exactly the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-bottom: 5px;
padding-bottom: 5px"></div>
</div>
<!-- padding-bottom is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-bottom: 6px;
padding-bottom: 6px"></div>
</div>
</body>
</html>

View File

@ -0,0 +1,138 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!-- Testcase for how we fragment an empty fixed-height flex container, with
margin/border/padding that are larger than the available height,
and with the flex container having "flex-direction: row".
-->
<html>
<head>
<style>
.multicol {
height: 10px;
width: 100px;
-moz-column-width: 20px;
-moz-column-fill: auto;
border: 2px solid orange;
margin-bottom: 2px;
}
.flexContainer {
display: flex;
flex-direction: row;
background: teal;
/* border-width is 0 by default; some sub-testcases will increase it. */
border: 0 dashed black;
}
</style>
</head>
<body>
<!-- MARGIN LARGER THAN AVAILABLE HEIGHT -->
<!-- =================================== -->
<!-- margin-top is the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
margin-top: 10px"></div>
</div>
<!-- margin-top is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
margin-top: 11px"></div>
</div>
<!-- margin-bottom is exactly the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
margin-bottom: 10px"></div>
</div>
<!-- margin-bottom is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
margin-bottom: 11px"></div>
</div>
<!-- BORDER LARGER THAN AVAILABLE HEIGHT -->
<!-- =================================== -->
<!-- border-top-width is the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-top-width: 10px"></div>
</div>
<!-- border-top-width is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-top-width: 11px"></div>
</div>
<!-- border-bottom-width is exactly the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-bottom-width: 10px"></div>
</div>
<!-- border-bottom-width is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-bottom-width: 11px"></div>
</div>
<!-- PADDING LARGER THAN AVAILABLE HEIGHT -->
<!-- ==================================== -->
<!-- padding-top is the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
padding-top: 10px"></div>
</div>
<!-- padding-top is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
padding-top: 11px"></div>
</div>
<!-- padding-bottom is exactly the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
padding-bottom: 10px"></div>
</div>
<!-- padding-bottom is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
padding-bottom: 11px"></div>
</div>
<!-- BORDER+PADDING LARGER THAN AVAILABLE HEIGHT -->
<!-- =========================================== -->
<!-- border+padding-top is the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-top: 5px;
padding-top: 5px"></div>
</div>
<!-- padding-top is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-top: 6px;
padding-top: 6px"></div>
</div>
<!-- padding-bottom is exactly the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-bottom: 5px;
padding-bottom: 5px"></div>
</div>
<!-- padding-bottom is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-bottom: 6px;
padding-bottom: 6px"></div>
</div>
</body>
</html>

View File

@ -0,0 +1,138 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!-- Testcase for how we fragment an empty fixed-height flex container, with
margin/border/padding that are larger than the available height,
and with the flex container having "flex-direction: row-reverse".
-->
<html>
<head>
<style>
.multicol {
height: 10px;
width: 100px;
-moz-column-width: 20px;
-moz-column-fill: auto;
border: 2px solid orange;
margin-bottom: 2px;
}
.flexContainer {
display: flex;
flex-direction: row-reverse;
background: teal;
/* border-width is 0 by default; some sub-testcases will increase it. */
border: 0 dashed black;
}
</style>
</head>
<body>
<!-- MARGIN LARGER THAN AVAILABLE HEIGHT -->
<!-- =================================== -->
<!-- margin-top is the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
margin-top: 10px"></div>
</div>
<!-- margin-top is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
margin-top: 11px"></div>
</div>
<!-- margin-bottom is exactly the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
margin-bottom: 10px"></div>
</div>
<!-- margin-bottom is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
margin-bottom: 11px"></div>
</div>
<!-- BORDER LARGER THAN AVAILABLE HEIGHT -->
<!-- =================================== -->
<!-- border-top-width is the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-top-width: 10px"></div>
</div>
<!-- border-top-width is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-top-width: 11px"></div>
</div>
<!-- border-bottom-width is exactly the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-bottom-width: 10px"></div>
</div>
<!-- border-bottom-width is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-bottom-width: 11px"></div>
</div>
<!-- PADDING LARGER THAN AVAILABLE HEIGHT -->
<!-- ==================================== -->
<!-- padding-top is the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
padding-top: 10px"></div>
</div>
<!-- padding-top is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
padding-top: 11px"></div>
</div>
<!-- padding-bottom is exactly the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
padding-bottom: 10px"></div>
</div>
<!-- padding-bottom is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
padding-bottom: 11px"></div>
</div>
<!-- BORDER+PADDING LARGER THAN AVAILABLE HEIGHT -->
<!-- =========================================== -->
<!-- border+padding-top is the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-top: 5px;
padding-top: 5px"></div>
</div>
<!-- padding-top is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-top: 6px;
padding-top: 6px"></div>
</div>
<!-- padding-bottom is exactly the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-bottom: 5px;
padding-bottom: 5px"></div>
</div>
<!-- padding-bottom is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-bottom: 6px;
padding-bottom: 6px"></div>
</div>
</body>
</html>

View File

@ -0,0 +1,138 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!-- Testcase for how we fragment an empty fixed-height flex container, with
margin/border/padding that are larger than the available height,
and with the flex container having "flex-direction: column".
-->
<html>
<head>
<style>
.multicol {
height: 10px;
width: 100px;
-moz-column-width: 20px;
-moz-column-fill: auto;
border: 2px solid orange;
margin-bottom: 2px;
}
.flexContainer {
display: flex;
flex-direction: column;
background: teal;
/* border-width is 0 by default; some sub-testcases will increase it. */
border: 0 dashed black;
}
</style>
</head>
<body>
<!-- MARGIN LARGER THAN AVAILABLE HEIGHT -->
<!-- =================================== -->
<!-- margin-top is the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
margin-top: 10px"></div>
</div>
<!-- margin-top is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
margin-top: 11px"></div>
</div>
<!-- margin-bottom is exactly the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
margin-bottom: 10px"></div>
</div>
<!-- margin-bottom is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
margin-bottom: 11px"></div>
</div>
<!-- BORDER LARGER THAN AVAILABLE HEIGHT -->
<!-- =================================== -->
<!-- border-top-width is the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-top-width: 10px"></div>
</div>
<!-- border-top-width is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-top-width: 11px"></div>
</div>
<!-- border-bottom-width is exactly the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-bottom-width: 10px"></div>
</div>
<!-- border-bottom-width is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-bottom-width: 11px"></div>
</div>
<!-- PADDING LARGER THAN AVAILABLE HEIGHT -->
<!-- ==================================== -->
<!-- padding-top is the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
padding-top: 10px"></div>
</div>
<!-- padding-top is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
padding-top: 11px"></div>
</div>
<!-- padding-bottom is exactly the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
padding-bottom: 10px"></div>
</div>
<!-- padding-bottom is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
padding-bottom: 11px"></div>
</div>
<!-- BORDER+PADDING LARGER THAN AVAILABLE HEIGHT -->
<!-- =========================================== -->
<!-- border+padding-top is the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-top: 5px;
padding-top: 5px"></div>
</div>
<!-- padding-top is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-top: 6px;
padding-top: 6px"></div>
</div>
<!-- padding-bottom is exactly the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-bottom: 5px;
padding-bottom: 5px"></div>
</div>
<!-- padding-bottom is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-bottom: 6px;
padding-bottom: 6px"></div>
</div>
</body>
</html>

View File

@ -0,0 +1,138 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!-- Testcase for how we fragment an empty fixed-height flex container, with
margin/border/padding that are larger than the available height,
and with the flex container having "flex-direction: column-reverse".
-->
<html>
<head>
<style>
.multicol {
height: 10px;
width: 100px;
-moz-column-width: 20px;
-moz-column-fill: auto;
border: 2px solid orange;
margin-bottom: 2px;
}
.flexContainer {
display: flex;
flex-direction: column-reverse;
background: teal;
/* border-width is 0 by default; some sub-testcases will increase it. */
border: 0 dashed black;
}
</style>
</head>
<body>
<!-- MARGIN LARGER THAN AVAILABLE HEIGHT -->
<!-- =================================== -->
<!-- margin-top is the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
margin-top: 10px"></div>
</div>
<!-- margin-top is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
margin-top: 11px"></div>
</div>
<!-- margin-bottom is exactly the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
margin-bottom: 10px"></div>
</div>
<!-- margin-bottom is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
margin-bottom: 11px"></div>
</div>
<!-- BORDER LARGER THAN AVAILABLE HEIGHT -->
<!-- =================================== -->
<!-- border-top-width is the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-top-width: 10px"></div>
</div>
<!-- border-top-width is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-top-width: 11px"></div>
</div>
<!-- border-bottom-width is exactly the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-bottom-width: 10px"></div>
</div>
<!-- border-bottom-width is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-bottom-width: 11px"></div>
</div>
<!-- PADDING LARGER THAN AVAILABLE HEIGHT -->
<!-- ==================================== -->
<!-- padding-top is the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
padding-top: 10px"></div>
</div>
<!-- padding-top is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
padding-top: 11px"></div>
</div>
<!-- padding-bottom is exactly the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
padding-bottom: 10px"></div>
</div>
<!-- padding-bottom is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
padding-bottom: 11px"></div>
</div>
<!-- BORDER+PADDING LARGER THAN AVAILABLE HEIGHT -->
<!-- =========================================== -->
<!-- border+padding-top is the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-top: 5px;
padding-top: 5px"></div>
</div>
<!-- padding-top is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-top: 6px;
padding-top: 6px"></div>
</div>
<!-- padding-bottom is exactly the available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-bottom: 5px;
padding-bottom: 5px"></div>
</div>
<!-- padding-bottom is larger than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px;
border-bottom: 6px;
padding-bottom: 6px"></div>
</div>
</body>
</html>

View File

@ -0,0 +1,62 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<html>
<head>
<style>
.multicol {
height: 10px;
width: 100px;
-moz-column-width: 20px;
-moz-column-fill: auto;
border: 2px solid orange;
margin-bottom: 15px; /* (just for spacing between testcases) */
}
.flexContainer {
background: teal;
border: 1px dashed black;
}
.item {
display: block;
width: 100%;
height: 20px;
}
</style>
</head>
<body>
<!-- auto-height container: -->
<div class="multicol">
<div class="flexContainer">
<img src="" class="item">
</div>
</div>
<!-- fixed-height container, smaller than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px">
<img src="" class="item">
</div>
</div>
<!-- fixed-height container, between available height and child height: -->
<div class="multicol">
<div class="flexContainer" style="height: 15px">
<img src="" class="item">
</div>
</div>
<!-- fixed-height container, same as child height: -->
<div class="multicol">
<div class="flexContainer" style="height: 20px">
<img src="" class="item">
</div>
</div>
<!-- fixed-height container, larger than child height: -->
<div class="multicol">
<div class="flexContainer" style="height: 24px">
<img src="" class="item">
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,66 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!-- Testcase for how we fragment a flex container with a single unbreakable
child, with the flex container having "flex-direction: row".
-->
<html>
<head>
<style>
.multicol {
height: 10px;
width: 100px;
-moz-column-width: 20px;
-moz-column-fill: auto;
border: 2px solid orange;
margin-bottom: 15px; /* (just for spacing between testcases) */
}
.flexContainer {
display: flex;
flex-direction: row;
background: teal;
border: 1px dashed black;
}
.item {
width: 100%;
height: 20px;
}
</style>
</head>
<body>
<!-- auto-height container: -->
<div class="multicol">
<div class="flexContainer">
<img src="" class="item">
</div>
</div>
<!-- fixed-height container, smaller than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px">
<img src="" class="item">
</div>
</div>
<!-- fixed-height container, between available height and child height: -->
<div class="multicol">
<div class="flexContainer" style="height: 15px">
<img src="" class="item">
</div>
</div>
<!-- fixed-height container, same as child height: -->
<div class="multicol">
<div class="flexContainer" style="height: 20px">
<img src="" class="item">
</div>
</div>
<!-- fixed-height container, larger than child height: -->
<div class="multicol">
<div class="flexContainer" style="height: 24px">
<img src="" class="item">
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,66 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!-- Testcase for how we fragment a flex container with a single unbreakable
child, with the flex container having "flex-direction: row-reverse".
-->
<html>
<head>
<style>
.multicol {
height: 10px;
width: 100px;
-moz-column-width: 20px;
-moz-column-fill: auto;
border: 2px solid orange;
margin-bottom: 15px; /* (just for spacing between testcases) */
}
.flexContainer {
display: flex;
flex-direction: row-reverse;
background: teal;
border: 1px dashed black;
}
.item {
width: 100%;
height: 20px;
}
</style>
</head>
<body>
<!-- auto-height container: -->
<div class="multicol">
<div class="flexContainer">
<img src="" class="item">
</div>
</div>
<!-- fixed-height container, smaller than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px">
<img src="" class="item">
</div>
</div>
<!-- fixed-height container, between available height and child height: -->
<div class="multicol">
<div class="flexContainer" style="height: 15px">
<img src="" class="item">
</div>
</div>
<!-- fixed-height container, same as child height: -->
<div class="multicol">
<div class="flexContainer" style="height: 20px">
<img src="" class="item">
</div>
</div>
<!-- fixed-height container, larger than child height: -->
<div class="multicol">
<div class="flexContainer" style="height: 24px">
<img src="" class="item">
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,67 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!-- Testcase for how we fragment a flex container with a single unbreakable
child, with the flex container having "flex-direction: column".
-->
<html>
<head>
<style>
.multicol {
height: 10px;
width: 100px;
-moz-column-width: 20px;
-moz-column-fill: auto;
border: 2px solid orange;
margin-bottom: 15px; /* (just for spacing between testcases) */
}
.flexContainer {
display: flex;
flex-direction: column;
background: teal;
border: 1px dashed black;
}
.item {
width: 100%;
height: 20px;
flex: none;
}
</style>
</head>
<body>
<!-- auto-height container: -->
<div class="multicol">
<div class="flexContainer">
<img src="" class="item">
</div>
</div>
<!-- fixed-height container, smaller than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px">
<img src="" class="item">
</div>
</div>
<!-- fixed-height container, between available height and child height: -->
<div class="multicol">
<div class="flexContainer" style="height: 15px">
<img src="" class="item">
</div>
</div>
<!-- fixed-height container, same as child height: -->
<div class="multicol">
<div class="flexContainer" style="height: 20px">
<img src="" class="item">
</div>
</div>
<!-- fixed-height container, larger than child height: -->
<div class="multicol">
<div class="flexContainer" style="height: 24px">
<img src="" class="item">
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,68 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!-- Testcase for how we fragment a flex container with a single unbreakable
child, with the flex container having "flex-direction: column-reverse".
-->
<html>
<head>
<style>
.multicol {
height: 10px;
width: 100px;
-moz-column-width: 20px;
-moz-column-fill: auto;
border: 2px solid orange;
margin-bottom: 15px; /* (just for spacing between testcases) */
}
.flexContainer {
display: flex;
flex-direction: column-reverse;
justify-content: flex-end;
background: teal;
border: 1px dashed black;
}
.item {
width: 100%;
height: 20px;
flex: none;
}
</style>
</head>
<body>
<!-- auto-height container: -->
<div class="multicol">
<div class="flexContainer">
<img src="" class="item">
</div>
</div>
<!-- fixed-height container, smaller than available height: -->
<div class="multicol">
<div class="flexContainer" style="height: 8px">
<img src="" class="item">
</div>
</div>
<!-- fixed-height container, between available height and child height: -->
<div class="multicol">
<div class="flexContainer" style="height: 15px">
<img src="" class="item">
</div>
</div>
<!-- fixed-height container, same as child height: -->
<div class="multicol">
<div class="flexContainer" style="height: 20px">
<img src="" class="item">
</div>
</div>
<!-- fixed-height container, larger than child height: -->
<div class="multicol">
<div class="flexContainer" style="height: 24px">
<img src="" class="item">
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,25 @@
# Tests with an empty flex container being fragmented:
== flexbox-empty-1a.html flexbox-empty-1-ref.html
== flexbox-empty-1b.html flexbox-empty-1-ref.html
== flexbox-empty-1c.html flexbox-empty-1-ref.html
== flexbox-empty-1d.html flexbox-empty-1-ref.html
# Tests with an empty flex container that overflows a short fixed-height block
# being fragmented:
== flexbox-empty-1e.html flexbox-empty-1-ref.html
== flexbox-empty-1f.html flexbox-empty-1-ref.html
== flexbox-empty-1g.html flexbox-empty-1-ref.html
== flexbox-empty-1h.html flexbox-empty-1-ref.html
# Tests with an empty flex container being fragmented, with margin, border,
# and/or padding being taller than the available height:
== flexbox-empty-2a.html flexbox-empty-2-ref.html
== flexbox-empty-2b.html flexbox-empty-2-ref.html
== flexbox-empty-2c.html flexbox-empty-2-ref.html
== flexbox-empty-2d.html flexbox-empty-2-ref.html
# Tests for how we fragment a flex container with one unbreakable child
== flexbox-unbreakable-child-1a.html flexbox-unbreakable-child-1-ref.html
== flexbox-unbreakable-child-1b.html flexbox-unbreakable-child-1-ref.html
== flexbox-unbreakable-child-1c.html flexbox-unbreakable-child-1-ref.html
== flexbox-unbreakable-child-1d.html flexbox-unbreakable-child-1-ref.html

View File

@ -9,6 +9,9 @@
# tests over to the w3c-css directory, so that they can become part of the
# W3C's test suite.
# SUBDIRECTORY: Reftests for paginated flex containers
include pagination/reftest.list
# Tests for cross-axis alignment (align-self / align-items properties)
fails == flexbox-align-self-baseline-horiz-2.xhtml flexbox-align-self-baseline-horiz-2-ref.xhtml # bug 793456, and possibly others
# This one fails on windows R (but not Ru, strangely). On Windows R, the

View File

@ -14,18 +14,18 @@ if CONFIG['MOZ_REPLACE_MALLOC']:
'malloc_decls.h',
'replace_malloc.h',
]
UNIFIED_SOURCES += [
SOURCES += [
'jemalloc_config.c',
'mozmemory_wrap.c',
]
if CONFIG['MOZ_JEMALLOC3']:
UNIFIED_SOURCES += [
SOURCES += [
'mozjemalloc_compat.c',
]
if CONFIG['MOZ_REPLACE_MALLOC']:
UNIFIED_SOURCES += [
SOURCES += [
'replace_malloc.c',
]

View File

@ -4,14 +4,8 @@
# 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/.
# These cannot be built unified because they both define static arena_purge
# functions with different types.
SOURCES += [
'src/src/arena.c',
'src/src/ctl.c',
]
UNIFIED_SOURCES += [
'src/src/atomic.c',
'src/src/base.c',
'src/src/bitmap.c',
@ -19,6 +13,7 @@ UNIFIED_SOURCES += [
'src/src/chunk_dss.c',
'src/src/chunk_mmap.c',
'src/src/ckh.c',
'src/src/ctl.c',
'src/src/extent.c',
'src/src/hash.c',
'src/src/huge.c',
@ -37,7 +32,7 @@ UNIFIED_SOURCES += [
# Only OSX needs the zone allocation implementation,
# but only if replace-malloc is not enabled.
if CONFIG['OS_TARGET'] == 'Darwin' and not CONFIG['MOZ_REPLACE_MALLOC']:
UNIFIED_SOURCES += [
SOURCES += [
'src/src/zone.c',
]

View File

@ -32,7 +32,7 @@ if CONFIG['WRAP_STL_INCLUDES']:
'msvc_throw_wrapper.cpp',
]
UNIFIED_SOURCES += [
SOURCES += [
'mozalloc.cpp',
'mozalloc_abort.cpp',
'mozalloc_oom.cpp',

View File

@ -353,18 +353,24 @@ class RecursiveMakeBackend(CommonBackend):
UNIFIED_CMMSRCS='mm',
UNIFIED_CPPSRCS='cpp',
)
do_unify = not self.environment.substs.get(
'MOZ_DISABLE_UNIFIED_COMPILATION')
# Sorted so output is consistent and we don't bump mtimes.
for k, v in sorted(obj.variables.items()):
if k in unified_suffixes.keys():
self._add_unified_build_rules(backend_file, v,
backend_file.objdir,
unified_prefix='Unified_%s_%s' %
(unified_suffixes[k],
backend_file.relobjdir.replace('/', '_')),
unified_suffix=unified_suffixes[k],
unified_files_makefile_variable=k,
include_curdir_build_rules=False)
backend_file.write('%s += $(%s)\n' % (k[len('UNIFIED_'):], k))
if k in unified_suffixes:
if do_unify:
self._add_unified_build_rules(backend_file, v,
backend_file.objdir,
unified_prefix='Unified_%s_%s' % (
unified_suffixes[k],
backend_file.relobjdir.replace('/', '_')),
unified_suffix=unified_suffixes[k],
unified_files_makefile_variable=k,
include_curdir_build_rules=False)
backend_file.write('%s += $(%s)\n' % (k[len('UNIFIED_'):], k))
else:
backend_file.write('%s += %s\n' % (
k[len('UNIFIED_'):], ' '.join(sorted(v))))
elif isinstance(v, list):
for item in v:
backend_file.write('%s += %s\n' % (k, item))

File diff suppressed because it is too large Load Diff

View File

@ -108,24 +108,29 @@ DataReportingService.prototype = Object.freeze({
case "profile-after-change":
this._os.removeObserver(this, "profile-after-change");
this._os.addObserver(this, "sessionstore-windows-restored", true);
this._prefs = new Preferences(HEALTHREPORT_BRANCH);
try {
this._prefs = new Preferences(HEALTHREPORT_BRANCH);
// We don't initialize the sessions recorder unless Health Report is
// around to provide pruning of data.
//
// FUTURE consider having the SessionsRecorder always enabled and/or
// living in its own XPCOM service.
if (this._prefs.get("service.enabled", true)) {
this.sessionRecorder = new SessionRecorder(SESSIONS_BRANCH);
this.sessionRecorder.onStartup();
// We don't initialize the sessions recorder unless Health Report is
// around to provide pruning of data.
//
// FUTURE consider having the SessionsRecorder always enabled and/or
// living in its own XPCOM service.
if (this._prefs.get("service.enabled", true)) {
this.sessionRecorder = new SessionRecorder(SESSIONS_BRANCH);
this.sessionRecorder.onStartup();
}
// We can't interact with prefs until after the profile is present.
let policyPrefs = new Preferences(POLICY_BRANCH);
this.policy = new DataReportingPolicy(policyPrefs, this._prefs, this);
this._os.addObserver(this, "sessionstore-windows-restored", true);
} catch (ex) {
Cu.reportError("Exception when initializing data reporting service: " +
CommonUtils.exceptionStr(ex));
}
// We can't interact with prefs until after the profile is present.
let policyPrefs = new Preferences(POLICY_BRANCH);
this.policy = new DataReportingPolicy(policyPrefs, this._prefs, this);
break;
case "sessionstore-windows-restored":
@ -187,7 +192,9 @@ DataReportingService.prototype = Object.freeze({
this.timer.cancel();
}
this.policy.stopPolling();
if (this.policy) {
this.policy.stopPolling();
}
break;
}
},
@ -220,6 +227,11 @@ DataReportingService.prototype = Object.freeze({
},
_loadHealthReporter: function () {
// This should never happen. It was added to help trace down bug 924307.
if (!this.policy) {
throw new Error("this.policy not set.");
}
let ns = {};
// Lazy import so application startup isn't adversely affected.

View File

@ -10,6 +10,22 @@ Cu.import("resource://gre/modules/Services.jsm");
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
Cu.import("resource://gre/modules/RemoteAddonsChild.jsm");
let SyncHandler = {
init: function() {
sendAsyncMessage("SetSyncHandler", {}, {handler: this});
},
getFocusedElementAndWindow: function() {
let fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
let focusedWindow = {};
let elt = fm.getFocusedElementForWindow(content, true, focusedWindow);
return [elt, focusedWindow.value];
},
};
SyncHandler.init();
let WebProgressListener = {
init: function() {
let webProgress = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
@ -33,10 +49,8 @@ let WebProgressListener = {
},
_setupObjects: function setupObjects(aWebProgress) {
let win = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
return {
contentWindow: win,
contentWindow: content,
// DOMWindow is not necessarily the content-window with subframes.
DOMWindow: aWebProgress.DOMWindow
};

View File

@ -679,11 +679,15 @@
return false;
let elt = document.commandDispatcher.focusedElement;
let win = document.commandDispatcher.focusedWindow;
// Temporary fix for e10s.
if (elt instanceof XULElement && elt.tagName == "xul:browser" &&
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
if (elt instanceof XULElement &&
elt.localName == "browser" &&
elt.namespaceURI == XUL_NS &&
elt.getAttribute("remote")) {
elt = elt.contentDocument.activeElement;
[elt, win] = elt.syncHandler.getFocusedElementAndWindow();
}
if (elt) {
@ -697,7 +701,6 @@
return false;
}
let win = document.commandDispatcher.focusedWindow;
if (win && !this._mimeTypeIsTextBased(win.document.contentType))
return false;

View File

@ -107,6 +107,12 @@
onget="return this.contentWindow ? this.contentWindow.document : null"
readonly="true"/>
<field name="_syncHandler">null</field>
<property name="syncHandler"
onget="return this._syncHandler"
readonly="true"/>
<field name="_imageDocument">null</field>
<property name="imageDocument"
@ -121,6 +127,7 @@
this.messageManager.addMessageListener("DOMTitleChanged", this);
this.messageManager.addMessageListener("ImageDocumentLoaded", this);
this.messageManager.addMessageListener("SetSyncHandler", this);
this.messageManager.loadFrameScript("chrome://global/content/browser-child.js", true);
if (this.hasAttribute("selectpopup")) {
@ -159,6 +166,10 @@
};
break;
case "SetSyncHandler":
this._syncHandler = aMessage.objects.handler;
break;
case "Forms:ShowDropDown": {
Cu.import("resource://gre/modules/SelectParentHelper.jsm");
let dropdown = document.getElementById(this.getAttribute("selectpopup"));

View File

@ -1959,6 +1959,71 @@ gdk_window_flash(GdkWindow * aGdkWindow,
#endif // DEBUG
#endif
struct ExposeRegion
{
nsIntRegion mRegion;
#if (MOZ_WIDGET_GTK == 2)
GdkRectangle *mRects;
GdkRectangle *mRectsEnd;
ExposeRegion() : mRects(nullptr)
{
}
~ExposeRegion()
{
g_free(mRects);
}
bool Init(GdkEventExpose *aEvent)
{
gint nrects;
gdk_region_get_rectangles(aEvent->region, &mRects, &nrects);
if (nrects > MAX_RECTS_IN_REGION) {
// Just use the bounding box
mRects[0] = aEvent->area;
nrects = 1;
}
mRectsEnd = mRects + nrects;
for (GdkRectangle *r = mRects; r < mRectsEnd; r++) {
mRegion.Or(mRegion, nsIntRect(r->x, r->y, r->width, r->height));
LOGDRAW(("\t%d %d %d %d\n", r->x, r->y, r->width, r->height));
}
return true;
}
#else
# ifdef cairo_copy_clip_rectangle_list
# error "Looks like we're including Mozilla's cairo instead of system cairo"
# endif
cairo_rectangle_list_t *mRects;
ExposeRegion() : mRects(nullptr)
{
}
~ExposeRegion()
{
cairo_rectangle_list_destroy(mRects);
}
bool Init(cairo_t* cr)
{
if (mRects->status != CAIRO_STATUS_SUCCESS) {
NS_WARNING("Failed to obtain cairo rectangle list.");
return false;
}
for (int i = 0; i < mRects->num_rectangles; i++) {
const cairo_rectangle_t& r = mRects->rectangles[i];
mRegion.Or(mRegion, nsIntRect(r.x, r.y, r.width, r.height));
LOGDRAW(("\t%d %d %d %d\n", r.x, r.y, r.width, r.height));
}
return true;
}
#endif
};
#if (MOZ_WIDGET_GTK == 2)
gboolean
nsWindow::OnExposeEvent(GdkEventExpose *aEvent)
@ -1980,6 +2045,17 @@ nsWindow::OnExposeEvent(cairo_t *cr)
if (!listener)
return FALSE;
ExposeRegion exposeRegion;
#if (MOZ_WIDGET_GTK == 2)
if (!exposeRegion.Init(aEvent)) {
#else
if (!exposeRegion.Init(cr)) {
#endif
return FALSE;
}
nsIntRegion &region = exposeRegion.mRegion;
ClientLayerManager *clientLayers =
(GetLayerManager()->GetBackendType() == LAYERS_CLIENT)
? static_cast<ClientLayerManager*>(GetLayerManager())
@ -1991,6 +2067,7 @@ nsWindow::OnExposeEvent(cairo_t *cr)
// We need to paint to the screen even if nothing changed, since if we
// don't have a compositing window manager, our pixels could be stale.
clientLayers->SetNeedsComposite(true);
clientLayers->SendInvalidRegion(region);
}
// Dispatch WillPaintWindow notification to allow scripts etc. to run
@ -2016,52 +2093,10 @@ nsWindow::OnExposeEvent(cairo_t *cr)
clientLayers->SetNeedsComposite(false);
}
#if (MOZ_WIDGET_GTK == 2)
GdkRectangle *rects;
gint nrects;
gdk_region_get_rectangles(aEvent->region, &rects, &nrects);
if (MOZ_UNLIKELY(!rects)) // OOM
return FALSE;
#else
#ifdef cairo_copy_clip_rectangle_list
#error "Looks like we're including Mozilla's cairo instead of system cairo"
#else
cairo_rectangle_list_t *rects;
rects = cairo_copy_clip_rectangle_list(cr);
if (MOZ_UNLIKELY(rects->status != CAIRO_STATUS_SUCCESS)) {
NS_WARNING("Failed to obtain cairo rectangle list.");
return FALSE;
}
#endif
#endif
// GTK3 TODO?
#if (MOZ_WIDGET_GTK == 2)
if (nrects > MAX_RECTS_IN_REGION) {
// Just use the bounding box
rects[0] = aEvent->area;
nrects = 1;
}
#endif
LOGDRAW(("sending expose event [%p] %p 0x%lx (rects follow):\n",
(void *)this, (void *)mGdkWindow,
gdk_x11_window_get_xid(mGdkWindow)));
nsIntRegion region;
#if (MOZ_WIDGET_GTK == 2)
GdkRectangle *r = rects;
GdkRectangle *r_end = rects + nrects;
#else
cairo_rectangle_t *r = rects->rectangles;
cairo_rectangle_t *r_end = r + rects->num_rectangles;
#endif
for (; r < r_end; ++r) {
region.Or(region, nsIntRect(r->x, r->y, r->width, r->height));
LOGDRAW(("\t%d %d %d %d\n", r->x, r->y, r->width, r->height));
}
// Our bounds may have changed after calling WillPaintWindow. Clip
// to the new bounds here. The region is relative to this
// window.
@ -2103,19 +2138,13 @@ nsWindow::OnExposeEvent(cairo_t *cr)
}
if (region.IsEmpty()) {
#if (MOZ_WIDGET_GTK == 2)
g_free(rects);
#else
cairo_rectangle_list_destroy(rects);
#endif
return TRUE;
}
// If this widget uses OMTC...
if (GetLayerManager()->GetBackendType() == LAYERS_CLIENT) {
listener->PaintWindow(this, region);
listener->DidPaintWindow();
g_free(rects);
return TRUE;
} else if (GetLayerManager()->GetBackendType() == mozilla::layers::LAYERS_OPENGL) {
LayerManagerOGL *manager = static_cast<LayerManagerOGL*>(GetLayerManager());
@ -2123,8 +2152,6 @@ nsWindow::OnExposeEvent(cairo_t *cr)
listener->PaintWindow(this, region);
listener->DidPaintWindow();
g_free(rects);
return TRUE;
}
@ -2227,20 +2254,14 @@ nsWindow::OnExposeEvent(cairo_t *cr)
# ifdef MOZ_HAVE_SHMIMAGE
if (nsShmImage::UseShm() && MOZ_LIKELY(!mIsDestroyed)) {
#if (MOZ_WIDGET_GTK == 2)
mShmImage->Put(mGdkWindow, rects, r_end);
mShmImage->Put(mGdkWindow, exposeRegion.mRects, exposeRegion.mRectsEnd);
#else
mShmImage->Put(mGdkWindow, rects);
mShmImage->Put(mGdkWindow, exposeRegion.mRects);
#endif
}
# endif // MOZ_HAVE_SHMIMAGE
#endif // MOZ_X11
#if (MOZ_WIDGET_GTK == 2)
g_free(rects);
#else
cairo_rectangle_list_destroy(rects);
#endif
listener->DidPaintWindow();
// Synchronously flush any new dirty areas
@ -5971,7 +5992,6 @@ nsWindow::GetSurfaceForGdkDrawable(GdkDrawable* aDrawable,
}
#endif
#if (MOZ_WIDGET_GTK == 2)
TemporaryRef<DrawTarget>
nsWindow::StartRemoteDrawing()
{
@ -5987,7 +6007,6 @@ nsWindow::StartRemoteDrawing()
return gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(surf, size);
}
#endif
// return the gfxASurface for rendering to this widget
gfxASurface*

View File

@ -197,9 +197,7 @@ public:
guint aTime,
gpointer aData);
#if (MOZ_WIDGET_GTK == 2)
mozilla::TemporaryRef<mozilla::gfx::DrawTarget> StartRemoteDrawing() MOZ_OVERRIDE;
#endif
private:
void UpdateAlpha(gfxPattern* aPattern, nsIntRect aBoundsRect);

View File

@ -528,6 +528,8 @@ protected:
HDC mPaintDC; // only set during painting
HDC mCompositeDC; // only set during StartRemoteDrawing
nsIntRect mLastPaintBounds;
#ifdef CAIRO_HAS_D2D_SURFACE
nsRefPtr<gfxD2DSurface> mD2DWindowSurface; // Surface for this window.
#endif

View File

@ -45,6 +45,7 @@ using mozilla::plugins::PluginInstanceParent;
#include "LayerManagerD3D10.h"
#endif
#include "mozilla/layers/CompositorParent.h"
#include "ClientLayerManager.h"
#include "nsUXThemeData.h"
#include "nsUXThemeConstants.h"
@ -213,23 +214,20 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t aNestingLevel)
return true;
}
// Do an early async composite so that we at least have something on screen
// in the right place, even if the content is out of date.
if (GetLayerManager()->GetBackendType() == LAYERS_CLIENT &&
mCompositorParent) {
ClientLayerManager *clientLayerManager =
(GetLayerManager()->GetBackendType() == LAYERS_CLIENT)
? static_cast<ClientLayerManager*>(GetLayerManager())
: nullptr;
if (clientLayerManager && mCompositorParent &&
!mBounds.IsEqualEdges(mLastPaintBounds))
{
// Do an early async composite so that we at least have something on the
// screen in the right place, even if the content is out of date.
mCompositorParent->ScheduleRenderOnCompositorThread();
}
mLastPaintBounds = mBounds;
nsIWidgetListener* listener = GetPaintListener();
if (listener) {
listener->WillPaintWindow(this);
}
// Re-get the listener since the will paint notification may have killed it.
listener = GetPaintListener();
if (!listener)
return false;
bool result = true;
PAINTSTRUCT ps;
#ifdef MOZ_XUL
@ -273,6 +271,30 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t aNestingLevel)
bool forceRepaint = nullptr != aDC;
#endif
nsIntRegion region = GetRegionToPaint(forceRepaint, ps, hDC);
if (clientLayerManager && mCompositorParent) {
// We need to paint to the screen even if nothing changed, since if we
// don't have a compositing window manager, our pixels could be stale.
clientLayerManager->SetNeedsComposite(true);
clientLayerManager->SendInvalidRegion(region);
}
nsIWidgetListener* listener = GetPaintListener();
if (listener) {
listener->WillPaintWindow(this);
}
// Re-get the listener since the will paint notification may have killed it.
listener = GetPaintListener();
if (!listener) {
return false;
}
if (clientLayerManager && mCompositorParent && clientLayerManager->NeedsComposite()) {
mCompositorParent->ScheduleRenderOnCompositorThread();
clientLayerManager->SetNeedsComposite(false);
}
bool result = true;
if (!region.IsEmpty() && listener)
{
// Should probably pass in a real region here, using GetRandomRgn

View File

@ -77,7 +77,6 @@ Break(const char *aMsg);
using namespace mozilla;
static bool sIsMultiprocess = false;
static const char *sMultiprocessDescription = nullptr;
static Atomic<int32_t> gAssertionCount;
@ -180,7 +179,6 @@ nsDebugImpl::GetIsDebuggerAttached(bool* aResult)
/* static */ void
nsDebugImpl::SetMultiprocessMode(const char *aDesc)
{
sIsMultiprocess = true;
sMultiprocessDescription = aDesc;
}
@ -315,15 +313,12 @@ NS_DebugBreak(uint32_t aSeverity, const char *aStr, const char *aExpr,
# define PrintToBuffer(...) PR_sxprintf(StuffFixedBuffer, &buf, __VA_ARGS__)
// If we're multiprocess, print "[PID]" or "[Desc PID]" at the beginning of
// the message.
if (sIsMultiprocess) {
PrintToBuffer("[");
if (sMultiprocessDescription) {
PrintToBuffer("%s ", sMultiprocessDescription);
}
PrintToBuffer("%d] ", base::GetCurrentProcId());
// Print "[PID]" or "[Desc PID]" at the beginning of the message.
PrintToBuffer("[");
if (sMultiprocessDescription) {
PrintToBuffer("%s ", sMultiprocessDescription);
}
PrintToBuffer("%d] ", base::GetCurrentProcId());
PrintToBuffer("%s: ", sevString);

View File

@ -25,6 +25,17 @@
#include "nsStaticAtom.h"
#include "nsCOMPtr.h"
#include "mozilla/IntegerPrintfMacros.h"
#ifdef XP_WIN
#include <windows.h>
#include <process.h>
#define getpid() _getpid()
#define pthread_self() GetCurrentThreadId()
#else
#include <pthread.h>
#include <unistd.h>
#endif
using mozilla::Atomic;
// ---------------------------------------------------------------------------
@ -66,6 +77,8 @@ class nsStringStats
printf(" -- LEAKED %d !!!\n", mAdoptCount - mAdoptFreeCount);
else
printf("\n");
printf(" => Process ID: %" PRIuPTR ", Thread ID: %" PRIuPTR "\n",
uintptr_t(getpid()), uintptr_t(pthread_self()));
}
Atomic<int32_t> mAllocCount;