merge mozilla-inbound ot mozilla-central

This commit is contained in:
Carsten "Tomcat" Book 2014-04-17 12:47:30 +02:00
commit 65e5a62b23
47 changed files with 465 additions and 302 deletions

View File

@ -1436,15 +1436,21 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
if (tag == nsGkAtoms::abbr ||
tag == nsGkAtoms::acronym ||
tag == nsGkAtoms::article ||
tag == nsGkAtoms::aside ||
tag == nsGkAtoms::blockquote ||
tag == nsGkAtoms::form ||
tag == nsGkAtoms::footer ||
tag == nsGkAtoms::header ||
tag == nsGkAtoms::h1 ||
tag == nsGkAtoms::h2 ||
tag == nsGkAtoms::h3 ||
tag == nsGkAtoms::h4 ||
tag == nsGkAtoms::h5 ||
tag == nsGkAtoms::h6 ||
tag == nsGkAtoms::q) {
tag == nsGkAtoms::nav ||
tag == nsGkAtoms::q ||
tag == nsGkAtoms::section) {
nsRefPtr<Accessible> accessible =
new HyperTextAccessibleWrap(aContent, document);
return accessible.forget();

View File

@ -3,7 +3,8 @@ const Cu = Components.utils;
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
this.EXPORTED_SYMBOLS = ['Roles', 'Events', 'Relations', 'Filters', 'States'];
this.EXPORTED_SYMBOLS = ['Roles', 'Events', 'Relations',
'Filters', 'States', 'Prefilters'];
function ConstantsMap (aObject, aPrefix, aMap = {}, aModifier = null) {
let offset = aPrefix.length;
@ -35,6 +36,12 @@ XPCOMUtils.defineLazyGetter(
return ConstantsMap(Ci.nsIAccessibleRelation, 'RELATION_');
});
XPCOMUtils.defineLazyGetter(
this, 'Prefilters',
function() {
return ConstantsMap(Ci.nsIAccessibleTraversalRule, 'PREFILTER_');
});
XPCOMUtils.defineLazyGetter(
this, 'Filters',
function() {

View File

@ -19,6 +19,8 @@ XPCOMUtils.defineLazyModuleGetter(this, 'Filters',
'resource://gre/modules/accessibility/Constants.jsm');
XPCOMUtils.defineLazyModuleGetter(this, 'States',
'resource://gre/modules/accessibility/Constants.jsm');
XPCOMUtils.defineLazyModuleGetter(this, 'Prefilters',
'resource://gre/modules/accessibility/Constants.jsm');
let gSkipEmptyImages = new PrefCache('accessibility.accessfu.skip_empty_images');
@ -146,21 +148,18 @@ var gSimpleMatchFunc = function gSimpleMatchFunc(aAccessible) {
}
};
var gSimplePreFilter = Ci.nsIAccessibleTraversalRule.PREFILTER_DEFUNCT |
Ci.nsIAccessibleTraversalRule.PREFILTER_INVISIBLE |
Ci.nsIAccessibleTraversalRule.PREFILTER_ARIA_HIDDEN |
Ci.nsIAccessibleTraversalRule.PREFILTER_TRANSPARENT;
var gSimplePreFilter = Prefilters.DEFUNCT |
Prefilters.INVISIBLE |
Prefilters.ARIA_HIDDEN |
Prefilters.TRANSPARENT;
this.TraversalRules = {
Simple: new BaseTraversalRule(gSimpleTraversalRoles, gSimpleMatchFunc),
SimpleOnScreen: new BaseTraversalRule(
gSimpleTraversalRoles, gSimpleMatchFunc,
Ci.nsIAccessibleTraversalRule.PREFILTER_DEFUNCT |
Ci.nsIAccessibleTraversalRule.PREFILTER_INVISIBLE |
Ci.nsIAccessibleTraversalRule.PREFILTER_ARIA_HIDDEN |
Ci.nsIAccessibleTraversalRule.PREFILTER_TRANSPARENT |
Ci.nsIAccessibleTraversalRule.PREFILTER_OFFSCREEN),
Prefilters.DEFUNCT | Prefilters.INVISIBLE | Prefilters.ARIA_HIDDEN |
Prefilters.TRANSPARENT | Prefilters.OFFSCREEN),
Anchor: new BaseTraversalRule(
[Roles.LINK],

View File

@ -29,6 +29,15 @@
testRole("aside", ROLE_NOTE);
testRole("section", ROLE_SECTION);
// Bug 996821
// Check that landmark elements get accessibles with styled overflow.
testRole("section_overflow", ROLE_SECTION);
testRole("nav_overflow", ROLE_SECTION);
testRole("header_overflow", ROLE_HEADER);
testRole("aside_overflow", ROLE_NOTE);
testRole("footer_overflow", ROLE_FOOTER);
testRole("article_overflow", ROLE_DOCUMENT);
// test html:div
testRole("sec", ROLE_SECTION);
@ -127,6 +136,19 @@
<aside id="aside">by the way I am an aside</aside>
<section id="section">a section</section>
<section style="overflow: hidden;" id="section_overflow">
<nav style="overflow: hidden;"
id="nav_overflow">overflow nav</nav>
<header style="overflow: hidden;"
id="header_overflow">overflow header</header>
<aside style="overflow: hidden;"
id="aside_overflow">overflow aside</aside>
<footer style="overflow: hidden;"
id="footer_overflow">overflow footer</footer>
</section>
<article style="overflow: hidden;"
id="article_overflow">overflow article</article>
<p id="p">A paragraph for comparison.</p>
<div id="sec">A normal div</div>
<blockquote id="quote">A citation</blockquote>

View File

@ -34,14 +34,14 @@
<preference id="browser.download.useDownloadDir"
name="browser.download.useDownloadDir"
type="bool"/>
<preference id="browser.download.folderList"
name="browser.download.folderList"
type="int"/>
<preference id="browser.download.dir"
name="browser.download.dir"
type="file"
onchange="gMainPane.displayDownloadDirPref();"/>
<preference id="browser.download.folderList"
name="browser.download.folderList"
type="int"/>
<!-- Tab preferences
Preferences:

View File

@ -1,7 +1,7 @@
// this will take strings_to_send.length*500 ms = 5 sec
var timer = null;
var strings_to_send = ["data\r\n\nda", "ta", ":", "de", "layed1\n\n",
var strings_to_send = ["retry:999999999\ndata\r\n\nda", "ta", ":", "de", "layed1\n\n",
"",
"",
"data:delayed2\n\n", "", ""];

View File

@ -37,7 +37,7 @@ namespace mozilla {
* Even though the ring buffer is divided into fixed size slots, it still can
* store the data which size is larger than one slot size.
* */
#define BUFFER_SLOT_NUM 8192
#define BUFFER_SLOT_NUM 512
#define BUFFER_SLOT_DEFAULT_SIZE 256
#define BUFFER_SLOT_MAX_SIZE 8192
#define BUFFER_SLOT_INVALID -1

View File

@ -8,7 +8,6 @@
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/PopupNotifications.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PeerConnectionIdp",
"resource://gre/modules/media/PeerConnectionIdp.jsm");

View File

@ -229,7 +229,11 @@ GetRetainedImageFromSourceSurface(SourceSurface *aSurface)
TemporaryRef<SourceSurface>
DrawTargetCG::OptimizeSourceSurface(SourceSurface *aSurface) const
{
return nullptr;
if (aSurface->GetType() == SurfaceType::COREGRAPHICS_IMAGE ||
aSurface->GetType() == SurfaceType::COREGRAPHICS_CGCONTEXT) {
return aSurface;
}
return aSurface->GetDataSurface();
}
class UnboundnessFixer

View File

@ -1204,8 +1204,27 @@ DrawTargetD2D::CreateSourceSurfaceFromData(unsigned char *aData,
TemporaryRef<SourceSurface>
DrawTargetD2D::OptimizeSourceSurface(SourceSurface *aSurface) const
{
// Unsupported!
return nullptr;
if (aSurface->GetType() == SurfaceType::D2D1_BITMAP ||
aSurface->GetType() == SurfaceType::D2D1_DRAWTARGET) {
return aSurface;
}
RefPtr<DataSourceSurface> data = aSurface->GetDataSurface();
DataSourceSurface::MappedSurface map;
if (!data->Map(DataSourceSurface::MapType::READ, &map)) {
return nullptr;
}
RefPtr<SourceSurfaceD2D> newSurf = new SourceSurfaceD2D();
bool success = newSurf->InitFromData(map.mData, data->GetSize(), map.mStride, data->GetFormat(), mRT);
data->Unmap();
if (!success) {
return nullptr;
}
return newSurf;
}
TemporaryRef<SourceSurface>

View File

@ -921,6 +921,34 @@ DrawTargetD2D1::GetImageForSurface(SourceSurface *aSurface, Matrix &aSourceTrans
return image;
}
TemporaryRef<SourceSurface>
DrawTargetD2D1::OptimizeSourceSurface(SourceSurface* aSurface) const
{
if (aSurface->GetType() == SurfaceType::D2D1_1_IMAGE) {
return aSurface;
}
RefPtr<DataSourceSurface> data = aSurface->GetDataSurface();
DataSourceSurface::MappedSurface map;
if (!data->Map(DataSourceSurface::MapType::READ, &map)) {
return nullptr;
}
RefPtr<ID2D1Bitmap1> bitmap;
HRESULT hr = mDC->CreateBitmap(D2DIntSize(data->GetSize()), map.mData, map.mStride,
D2D1::BitmapProperties1(D2D1_BITMAP_OPTIONS_NONE, D2DPixelFormat(data->GetFormat())),
byRef(bitmap));
data->Unmap();
if (!bitmap) {
return nullptr;
}
return new SourceSurfaceD2D1(bitmap.get(), mDC, data->GetFormat(), data->GetSize());
}
void
DrawTargetD2D1::PushD2DLayer(ID2D1DeviceContext *aDC, ID2D1Geometry *aGeometry, const D2D1_MATRIX_3X2_F &aTransform)
{

View File

@ -104,7 +104,7 @@ public:
const IntSize &aSize,
int32_t aStride,
SurfaceFormat aFormat) const;
virtual TemporaryRef<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const { return nullptr; }
virtual TemporaryRef<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const;
virtual TemporaryRef<SourceSurface>
CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const { return nullptr; }

View File

@ -602,16 +602,7 @@ DrawTargetSkia::OptimizeSourceSurface(SourceSurface *aSurface) const
return aSurface;
}
if (aSurface->GetType() != SurfaceType::DATA) {
return nullptr;
}
RefPtr<DataSourceSurface> data = aSurface->GetDataSurface();
RefPtr<SourceSurface> surface = CreateSourceSurfaceFromData(data->GetData(),
data->GetSize(),
data->Stride(),
data->GetFormat());
return data.forget();
return aSurface->GetDataSurface();
}
TemporaryRef<SourceSurface>

View File

@ -432,7 +432,7 @@ public:
template<size_t N>
static void InitializeExtensionsBitSet(std::bitset<N>& extensionsBitset, const char* extStr, const char** extList, bool verbose = false)
{
char* exts = strdup(extStr);
char* exts = ::strdup(extStr);
if (verbose)
printf_stderr("Extensions: %s\n", exts);

View File

@ -6024,15 +6024,20 @@ StackArgBytes(const VectorT &argTypes)
return iter.stackBytesConsumedSoFar();
}
static unsigned
StackDecrementForCall(MacroAssembler &masm, unsigned bytesToPush)
{
// Include extra padding so that, after pushing the bytesToPush,
// the stack is aligned for a call instruction.
unsigned alreadyPushed = AlignmentAtPrologue + masm.framePushed();
return AlignBytes(alreadyPushed + bytesToPush, StackAlignment) - alreadyPushed;
}
template <class VectorT>
static unsigned
StackDecrementForCall(MacroAssembler &masm, const VectorT &argTypes, unsigned extraBytes = 0)
{
// Include extra padding so that, after pushing the arguments and
// extraBytes, the stack is aligned for a call instruction.
unsigned argBytes = StackArgBytes(argTypes);
unsigned alreadyPushed = AlignmentAtPrologue + masm.framePushed();
return AlignBytes(alreadyPushed + extraBytes + argBytes, StackAlignment) - alreadyPushed;
return StackDecrementForCall(masm, StackArgBytes(argTypes) + extraBytes);
}
static const unsigned FramePushedAfterSave = NonVolatileRegs.gprs().size() * sizeof(intptr_t) +
@ -6300,8 +6305,10 @@ GenerateFFIInterpreterExit(ModuleCompiler &m, const ModuleCompiler::ExitDescript
masm.align(CodeAlignment);
m.setInterpExitOffset(exitIndex);
masm.setFramePushed(0);
#if defined(JS_CODEGEN_ARM)
masm.Push(lr);
#endif
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
MIRType typeArray[] = { MIRType_Pointer, // cx
MIRType_Pointer, // exitDatum
MIRType_Int32, // argc
@ -6316,7 +6323,7 @@ GenerateFFIInterpreterExit(ModuleCompiler &m, const ModuleCompiler::ExitDescript
masm.reserveStack(stackDec);
// Fill the argument array.
unsigned offsetToCallerStackArgs = NativeFrameSize + masm.framePushed();
unsigned offsetToCallerStackArgs = AlignmentAtPrologue + masm.framePushed();
unsigned offsetToArgv = StackArgBytes(invokeArgTypes);
Register scratch = ABIArgGenerator::NonArgReturnVolatileReg0;
FillArgumentArray(m, exit.sig().args(), offsetToArgv, offsetToCallerStackArgs, scratch);
@ -6387,59 +6394,6 @@ GenerateFFIInterpreterExit(ModuleCompiler &m, const ModuleCompiler::ExitDescript
// registers to restore.
masm.freeStack(stackDec);
masm.ret();
#else
const unsigned arrayLength = Max<size_t>(1, exit.sig().args().length());
const unsigned arraySize = arrayLength * sizeof(Value);
const unsigned reserveSize = AlignBytes(arraySize, StackAlignment) +
ShadowStackSpace;
const unsigned callerArgsOffset = reserveSize + NativeFrameSize + sizeof(int32_t);
masm.setFramePushed(0);
masm.Push(lr);
masm.reserveStack(reserveSize + sizeof(int32_t));
// Store arguments
FillArgumentArray(m, exit.sig().args(), ShadowStackSpace, callerArgsOffset, IntArgReg0);
// argument 0: cx
Register activation = IntArgReg3;
LoadAsmJSActivationIntoRegister(masm, activation);
LoadJSContextFromActivation(masm, activation, IntArgReg0);
// argument 1: exitIndex
masm.mov(ImmWord(exitIndex), IntArgReg1);
// argument 2: argc
masm.mov(ImmWord(exit.sig().args().length()), IntArgReg2);
// argument 3: argv
Address argv(StackPointer, ShadowStackSpace);
masm.lea(Operand(argv), IntArgReg3);
AssertStackAlignment(masm);
switch (exit.sig().retType().which()) {
case RetType::Void:
masm.call(AsmJSImm_InvokeFromAsmJS_Ignore);
masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, throwLabel);
break;
case RetType::Signed:
masm.call(AsmJSImm_InvokeFromAsmJS_ToInt32);
masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, throwLabel);
masm.unboxInt32(argv, ReturnReg);
break;
case RetType::Double:
masm.call(AsmJSImm_InvokeFromAsmJS_ToNumber);
masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, throwLabel);
masm.loadDouble(argv, ReturnFloatReg);
break;
case RetType::Float:
MOZ_ASSUME_UNREACHABLE("Float32 shouldn't be returned from a FFI");
break;
}
masm.freeStack(reserveSize + sizeof(int32_t));
masm.ret();
#endif
}
static void
@ -6452,11 +6406,8 @@ GenerateOOLConvert(ModuleCompiler &m, RetType retType, Label *throwLabel)
MIRTypeVector callArgTypes(m.cx());
callArgTypes.infallibleAppend(typeArray, ArrayLength(typeArray));
// Reserve space for a call to InvokeFromAsmJS_* and an array of values
// passed to this FFI call.
unsigned arraySize = sizeof(Value);
unsigned stackDec = StackDecrementForCall(masm, callArgTypes, arraySize);
masm.reserveStack(stackDec);
// The stack is assumed to be aligned. The frame is allocated by GenerateFFIIonExit and
// the stack usage here needs to kept in sync with GenerateFFIIonExit.
// Store value
unsigned offsetToArgv = StackArgBytes(callArgTypes);
@ -6504,8 +6455,6 @@ GenerateOOLConvert(ModuleCompiler &m, RetType retType, Label *throwLabel)
default:
MOZ_ASSUME_UNREACHABLE("Unsupported convert type");
}
masm.freeStack(stackDec);
}
static void
@ -6517,29 +6466,57 @@ GenerateFFIIonExit(ModuleCompiler &m, const ModuleCompiler::ExitDescriptor &exit
m.setIonExitOffset(exitIndex);
masm.setFramePushed(0);
RegisterSet restoreSet = RegisterSet::Intersect(RegisterSet::All(),
RegisterSet::Not(RegisterSet::Volatile()));
#if defined(JS_CODEGEN_ARM)
masm.Push(lr);
#if defined(JS_CODEGEN_X64)
masm.Push(HeapReg);
#elif defined(JS_CODEGEN_ARM)
// The lr register holds the return address and needs to be saved. The GlobalReg
// (r10) and HeapReg (r11) also need to be restored before returning to asm.js code.
// The NANReg also needs to be restored, but is a constant and is reloaded before
// returning to asm.js code.
masm.PushRegsInMask(RegisterSet(GeneralRegisterSet((1<<GlobalReg.code()) |
(1<<HeapReg.code()) |
(1<<lr.code())),
FloatRegisterSet(uint32_t(0))));
#endif
masm.PushRegsInMask(restoreSet);
// Arguments are in the following order on the stack:
// The stack frame is used for the call into Ion and also for calls into C for OOL
// conversion of the result. A frame large enough for both is allocated.
//
// Arguments to the Ion function are in the following order on the stack:
// descriptor | callee | argc | this | arg1 | arg2 | ...
// Reserve and align space for the arguments
MIRTypeVector emptyVector(m.cx());
unsigned argBytes = 3 * sizeof(size_t) + (1 + exit.sig().args().length()) * sizeof(Value);
unsigned extraBytes = 0;
// On ARM, we call with ma_callIonNoPush which, following the Ion calling convention,
// stores the return address into *sp. This means we need to include an extra word of
// space before the arguments in the stack allocation. (On x86/x64, the call
// instruction does the push itself and the ABI just requires us to be aligned before
// the call instruction.)
unsigned offsetToArgs = 0;
#if defined(JS_CODEGEN_ARM)
extraBytes += sizeof(size_t);
offsetToArgs += sizeof(size_t);
#endif
unsigned stackDec = StackDecrementForCall(masm, emptyVector, argBytes + extraBytes);
masm.reserveStack(stackDec - extraBytes);
unsigned stackDecForIonCall = StackDecrementForCall(masm, argBytes + offsetToArgs);
// Reserve space for a call to AsmJSImm_CoerceInPlace_* and an array of values used by
// OOLConvert which reuses the same frame. This code needs to be kept in sync with the
// stack usage in GenerateOOLConvert.
MIRType typeArray[] = { MIRType_Pointer, MIRType_Pointer }; // cx, argv
MIRTypeVector callArgTypes(m.cx());
callArgTypes.infallibleAppend(typeArray, ArrayLength(typeArray));
unsigned stackDecForOOLCall = StackDecrementForCall(masm, callArgTypes, sizeof(Value));
// Allocate a frame large enough for both of the above calls.
unsigned stackDec = Max(stackDecForIonCall, stackDecForOOLCall);
masm.reserveStack(stackDec);
AssertStackAlignment(masm);
// 1. Descriptor
uint32_t descriptor = MakeFrameDescriptor(masm.framePushed() + extraBytes, JitFrame_Entry);
masm.storePtr(ImmWord(uintptr_t(descriptor)), Address(StackPointer, 0));
size_t argOffset = offsetToArgs;
uint32_t descriptor = MakeFrameDescriptor(masm.framePushed(), JitFrame_Entry);
masm.storePtr(ImmWord(uintptr_t(descriptor)), Address(StackPointer, argOffset));
argOffset += sizeof(size_t);
// 2. Callee
Register callee = ABIArgGenerator::NonArgReturnVolatileReg0;
@ -6561,24 +6538,26 @@ GenerateFFIIonExit(ModuleCompiler &m, const ModuleCompiler::ExitDescriptor &exit
masm.loadPtr(Address(callee, offsetof(AsmJSModule::ExitDatum, fun)), callee);
// 2.3. Save callee
masm.storePtr(callee, Address(StackPointer, sizeof(size_t)));
masm.storePtr(callee, Address(StackPointer, argOffset));
argOffset += sizeof(size_t);
// 3. Argc
unsigned argc = exit.sig().args().length();
masm.storePtr(ImmWord(uintptr_t(argc)), Address(StackPointer, 2 * sizeof(size_t)));
masm.storePtr(ImmWord(uintptr_t(argc)), Address(StackPointer, argOffset));
argOffset += sizeof(size_t);
// 4. |this| value
masm.storeValue(UndefinedValue(), Address(StackPointer, 3 * sizeof(size_t)));
masm.storeValue(UndefinedValue(), Address(StackPointer, argOffset));
argOffset += sizeof(Value);
// 5. Fill the arguments
unsigned offsetToArgs = 3 * sizeof(size_t) + sizeof(Value);
unsigned offsetToCallerStackArgs = masm.framePushed();
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
offsetToCallerStackArgs += NativeFrameSize;
#else
offsetToCallerStackArgs += ShadowStackSpace;
#endif
FillArgumentArray(m, exit.sig().args(), offsetToArgs, offsetToCallerStackArgs, scratch);
FillArgumentArray(m, exit.sig().args(), argOffset, offsetToCallerStackArgs, scratch);
argOffset += exit.sig().args().length() * sizeof(Value);
JS_ASSERT(argOffset == offsetToArgs + argBytes);
// Get the pointer to the ion code
Label done, oolConvert;
@ -6590,36 +6569,94 @@ GenerateFFIIonExit(ModuleCompiler &m, const ModuleCompiler::ExitDescriptor &exit
masm.branchIfFunctionHasNoScript(callee, &ionFailed);
#endif
masm.loadPtr(Address(callee, JSFunction::offsetOfNativeOrScript()), scratch);
masm.loadBaselineOrIonNoArgCheck(scratch, scratch, SequentialExecution, maybeDebugBreakpoint);
masm.loadPtr(Address(callee, JSFunction::offsetOfNativeOrScript()), callee);
masm.loadBaselineOrIonNoArgCheck(callee, callee, SequentialExecution, maybeDebugBreakpoint);
LoadAsmJSActivationIntoRegister(masm, callee);
masm.push(scratch);
masm.setupUnalignedABICall(1, scratch);
masm.passABIArg(callee);
masm.callWithABI(AsmJSImm_EnableActivationFromAsmJS);
masm.pop(scratch);
AssertStackAlignment(masm);
{
// Enable Activation.
//
// This sequence requires four registers, and needs to preserve the 'callee'
// register, so there are five live registers.
JS_ASSERT(callee == AsmJSIonExitRegCallee);
Register reg0 = AsmJSIonExitRegE0;
Register reg1 = AsmJSIonExitRegE1;
Register reg2 = AsmJSIonExitRegE2;
Register reg3 = AsmJSIonExitRegE3;
LoadAsmJSActivationIntoRegister(masm, reg0);
// The following is inlined:
// JSContext *cx = activation->cx();
// Activation *act = cx->mainThread().activation();
// act.active_ = true;
// act.prevIonTop_ = cx->mainThread().ionTop;
// act.prevJitJSContext_ = cx->mainThread().jitJSContext;
// cx->mainThread().jitJSContext = cx;
// On the ARM store8() uses the secondScratchReg (lr) as a temp.
size_t offsetOfActivation = offsetof(JSRuntime, mainThread) +
PerThreadData::offsetOfActivation();
size_t offsetOfIonTop = offsetof(JSRuntime, mainThread) + offsetof(PerThreadData, ionTop);
size_t offsetOfJitJSContext = offsetof(JSRuntime, mainThread) +
offsetof(PerThreadData, jitJSContext);
masm.loadPtr(Address(reg0, AsmJSActivation::offsetOfContext()), reg3);
masm.loadPtr(Address(reg3, JSContext::offsetOfRuntime()), reg0);
masm.loadPtr(Address(reg0, offsetOfActivation), reg1);
masm.store8(Imm32(1), Address(reg1, JitActivation::offsetOfActiveUint8()));
masm.loadPtr(Address(reg0, offsetOfIonTop), reg2);
masm.storePtr(reg2, Address(reg1, JitActivation::offsetOfPrevIonTop()));
masm.loadPtr(Address(reg0, offsetOfJitJSContext), reg2);
masm.storePtr(reg2, Address(reg1, JitActivation::offsetOfPrevJitJSContext()));
masm.storePtr(reg3, Address(reg0, offsetOfJitJSContext));
}
// 2. Call
#if defined(JS_CODEGEN_ARM) && defined(DEBUG)
// ARM still needs to push, before stack is aligned
masm.Push(scratch);
AssertStackAlignment(masm);
#if defined(JS_CODEGEN_ARM)
masm.ma_callIonNoPush(callee);
// The return address has been popped from the stack, so adjust the stack
// without changing the frame-pushed counter to keep the stack aligned.
masm.subPtr(Imm32(4), sp);
#else
masm.callIon(callee);
#endif
AssertStackAlignment(masm);
#if defined(JS_CODEGEN_ARM) && defined(DEBUG)
masm.freeStack(sizeof(size_t));
#endif
masm.callIon(scratch);
masm.freeStack(stackDec - extraBytes);
masm.push(JSReturnReg_Type);
masm.push(JSReturnReg_Data);
LoadAsmJSActivationIntoRegister(masm, callee);
masm.setupUnalignedABICall(1, scratch);
masm.passABIArg(callee);
masm.callWithABI(AsmJSImm_DisableActivationFromAsmJS);
masm.pop(JSReturnReg_Data);
masm.pop(JSReturnReg_Type);
{
// Disable Activation.
//
// This sequence needs three registers, and must preserve the JSReturnReg_Data and
// JSReturnReg_Type, so there are five live registers.
JS_ASSERT(JSReturnReg_Data == AsmJSIonExitRegReturnData);
JS_ASSERT(JSReturnReg_Type == AsmJSIonExitRegReturnType);
Register reg0 = AsmJSIonExitRegD0;
Register reg1 = AsmJSIonExitRegD1;
Register reg2 = AsmJSIonExitRegD2;
LoadAsmJSActivationIntoRegister(masm, reg0);
// The following is inlined:
// JSContext *cx = activation->cx();
// Activation *act = cx->mainThread().activation();
// act.active_ = false;
// cx->mainThread().ionTop = prevIonTop_;
// cx->mainThread().jitJSContext = prevJitJSContext_;
// On the ARM store8() uses the secondScratchReg (lr) as a temp.
size_t offsetOfActivation = offsetof(JSRuntime, mainThread) +
PerThreadData::offsetOfActivation();
size_t offsetOfIonTop = offsetof(JSRuntime, mainThread) + offsetof(PerThreadData, ionTop);
size_t offsetOfJitJSContext = offsetof(JSRuntime, mainThread) +
offsetof(PerThreadData, jitJSContext);
masm.loadPtr(Address(reg0, AsmJSActivation::offsetOfContext()), reg0);
masm.loadPtr(Address(reg0, JSContext::offsetOfRuntime()), reg0);
masm.loadPtr(Address(reg0, offsetOfActivation), reg1);
masm.store8(Imm32(0), Address(reg1, JitActivation::offsetOfActiveUint8()));
masm.loadPtr(Address(reg1, JitActivation::offsetOfPrevIonTop()), reg2);
masm.storePtr(reg2, Address(reg0, offsetOfIonTop));
masm.loadPtr(Address(reg1, JitActivation::offsetOfPrevJitJSContext()), reg2);
masm.storePtr(reg2, Address(reg0, offsetOfJitJSContext));
}
#ifdef DEBUG
masm.branchTestMagicValue(Assembler::Equal, JSReturnOperand, JS_ION_ERROR, throwLabel);
@ -6645,8 +6682,20 @@ GenerateFFIIonExit(ModuleCompiler &m, const ModuleCompiler::ExitDescriptor &exit
}
masm.bind(&done);
masm.PopRegsInMask(restoreSet);
masm.freeStack(stackDec);
#if defined(JS_CODEGEN_ARM)
masm.ma_vimm(GenericNaN(), NANReg);
masm.PopRegsInMask(RegisterSet(GeneralRegisterSet((1<<GlobalReg.code()) |
(1<<HeapReg.code()) |
(1<<pc.code())),
FloatRegisterSet(uint32_t(0))));
#else
# if defined(JS_CODEGEN_X64)
masm.Pop(HeapReg);
# endif
masm.ret();
#endif
JS_ASSERT(masm.framePushed() == 0);
// oolConvert
if (oolConvert.used()) {

View File

@ -149,24 +149,6 @@ CoerceInPlace_ToNumber(JSContext *cx, MutableHandleValue val)
return true;
}
static void
EnableActivationFromAsmJS(AsmJSActivation *activation)
{
JSContext *cx = activation->cx();
Activation *act = cx->mainThread().activation();
JS_ASSERT(act->isJit());
act->asJit()->setActive(cx);
}
static void
DisableActivationFromAsmJS(AsmJSActivation *activation)
{
JSContext *cx = activation->cx();
Activation *act = cx->mainThread().activation();
JS_ASSERT(act->isJit());
act->asJit()->setActive(cx, false);
}
namespace js {
// Defined in AsmJS.cpp:
@ -242,10 +224,6 @@ AddressOf(AsmJSImmKind kind, ExclusiveContext *cx)
return RedirectCall(FuncCast(CoerceInPlace_ToNumber), Args_General2);
case AsmJSImm_ToInt32:
return RedirectCall(FuncCast<int32_t (double)>(js::ToInt32), Args_Int_Double);
case AsmJSImm_EnableActivationFromAsmJS:
return RedirectCall(FuncCast(EnableActivationFromAsmJS), Args_General1);
case AsmJSImm_DisableActivationFromAsmJS:
return RedirectCall(FuncCast(DisableActivationFromAsmJS), Args_General1);
#if defined(JS_CODEGEN_ARM)
case AsmJSImm_aeabi_idivmod:
return RedirectCall(FuncCast(__aeabi_idivmod), Args_General2);

View File

@ -80,7 +80,6 @@ class ABIArgGenerator
uint32_t stackBytesConsumedSoFar() const { return stackOffset_; }
static const Register NonArgReturnVolatileReg0;
static const Register NonArgReturnVolatileReg1;
};
static MOZ_CONSTEXPR_VAR Register PreBarrierReg = r1;
@ -98,6 +97,22 @@ static MOZ_CONSTEXPR_VAR FloatRegister ScratchFloatReg = { FloatRegisters::d15 }
static MOZ_CONSTEXPR_VAR FloatRegister NANReg = { FloatRegisters::d14 };
// Registers used in the GenerateFFIIonExit Enable Activation block.
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegCallee = r4;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE0 = r0;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE1 = r1;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE2 = r2;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE3 = r3;
// Registers used in the GenerateFFIIonExit Disable Activation block.
// None of these may be the second scratch register (lr).
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegReturnData = r2;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegReturnType = r3;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD0 = r0;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD1 = r1;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD2 = r4;
static MOZ_CONSTEXPR_VAR FloatRegister d0 = {FloatRegisters::d0};
static MOZ_CONSTEXPR_VAR FloatRegister d1 = {FloatRegisters::d1};
static MOZ_CONSTEXPR_VAR FloatRegister d2 = {FloatRegisters::d2};

View File

@ -690,8 +690,6 @@ enum AsmJSImmKind
AsmJSImm_CoerceInPlace_ToInt32,
AsmJSImm_CoerceInPlace_ToNumber,
AsmJSImm_ToInt32,
AsmJSImm_EnableActivationFromAsmJS,
AsmJSImm_DisableActivationFromAsmJS,
#if defined(JS_CODEGEN_ARM)
AsmJSImm_aeabi_idivmod,
AsmJSImm_aeabi_uidivmod,

View File

@ -136,6 +136,20 @@ static MOZ_CONSTEXPR_VAR Register ForkJoinGetSliceReg_temp0 = rbx;
static MOZ_CONSTEXPR_VAR Register ForkJoinGetSliceReg_temp1 = rcx;
static MOZ_CONSTEXPR_VAR Register ForkJoinGetSliceReg_output = rsi;
// Registers used in the GenerateFFIIonExit Enable Activation block.
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegCallee = r10;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE0 = rax;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE1 = rdi;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE2 = rbx;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE3 = rsi;
// Registers used in the GenerateFFIIonExit Disable Activation block.
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegReturnData = ecx;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegReturnType = ecx;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD0 = rax;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD1 = rdi;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD2 = rbx;
class ABIArgGenerator
{
#if defined(XP_WIN)

View File

@ -87,6 +87,20 @@ class ABIArgGenerator
static MOZ_CONSTEXPR_VAR Register OsrFrameReg = edx;
static MOZ_CONSTEXPR_VAR Register PreBarrierReg = edx;
// Registers used in the GenerateFFIIonExit Enable Activation block.
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegCallee = ecx;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE0 = edi;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE1 = eax;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE2 = ebx;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE3 = edx;
// Registers used in the GenerateFFIIonExit Disable Activation block.
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegReturnData = edx;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegReturnType = ecx;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD0 = edi;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD1 = eax;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD2 = esi;
// GCC stack is aligned on 16 bytes, but we don't maintain the invariant in
// jitted code.
#if defined(__GNUC__)

View File

@ -408,6 +408,10 @@ struct JSContext : public js::ExclusiveContext,
JSRuntime *runtime() const { return runtime_; }
js::PerThreadData &mainThread() const { return runtime()->mainThread; }
static size_t offsetOfRuntime() {
return offsetof(JSContext, runtime_);
}
friend class js::ExclusiveContext;
friend class JS::AutoSaveExceptionState;

View File

@ -583,6 +583,9 @@ class PerThreadData : public PerThreadDataFriendFields
static unsigned offsetOfAsmJSActivationStackReadOnly() {
return offsetof(PerThreadData, asmJSActivationStack_);
}
static unsigned offsetOfActivation() {
return offsetof(PerThreadData, activation_);
}
js::AsmJSActivation *asmJSActivationStackFromAnyThread() const {
return asmJSActivationStack_;

View File

@ -1516,6 +1516,9 @@ jit::JitActivation::~JitActivation()
}
}
// setActive() is inlined in GenerateFFIIonExit() with explicit masm instructions so
// changes to the logic here need to be reflected in GenerateFFIIonExit() in the enable
// and disable activation instruction sequences.
void
jit::JitActivation::setActive(JSContext *cx, bool active)
{

View File

@ -1335,6 +1335,16 @@ class JitActivation : public Activation
bool firstFrameIsConstructing() const {
return firstFrameIsConstructing_;
}
static size_t offsetOfPrevIonTop() {
return offsetof(JitActivation, prevIonTop_);
}
static size_t offsetOfPrevJitJSContext() {
return offsetof(JitActivation, prevJitJSContext_);
}
static size_t offsetOfActiveUint8() {
JS_ASSERT(sizeof(bool) == 1);
return offsetof(JitActivation, active_);
}
#ifdef CHECK_OSIPOINT_REGISTERS
void setCheckRegs(bool check) {

View File

@ -376,19 +376,6 @@ XPCWrappedNative::GetNewOrUsed(xpcObjectHelper& helper,
if (parent != plannedParent) {
XPCWrappedNativeScope* betterScope = GetObjectScope(parent);
if (MOZ_UNLIKELY(!betterScope)) {
printf_stderr("Uh oh, hit an object without a scope! Crashing shortly.\n");
printf_stderr("IsMainThread: %u\n", (uint32_t) NS_IsMainThread());
char* className = nullptr;
sciWrapper.GetCallback()->GetClassName(&className);
printf_stderr("SH Class Name: %s\n", className);
nsMemory::Free(className);
printf_stderr("plannedParent object class: %s\n", js::GetObjectClass(plannedParent)->name);
printf_stderr("plannedParent Global class: %s\n", js::GetObjectClass(js::GetGlobalForObjectCrossCompartment(plannedParent))->name);
printf_stderr("parent Object class: %s\n", js::GetObjectClass(parent)->name);
printf_stderr("parent Global class: %s\n", js::GetObjectClass(js::GetGlobalForObjectCrossCompartment(parent))->name);
MOZ_CRASH();
}
if (betterScope != Scope)
return GetNewOrUsed(helper, betterScope, Interface, resultWrapper);

View File

@ -738,7 +738,7 @@ protected:
bool ParseTextAlignLast(nsCSSValue& aValue);
bool ParseTextDecoration();
bool ParseTextDecorationLine(nsCSSValue& aValue);
bool ParseTextCombineHorizontal(nsCSSValue& aValue);
bool ParseTextCombineUpright(nsCSSValue& aValue);
bool ParseTextOverflow(nsCSSValue& aValue);
bool ParseTouchAction(nsCSSValue& aValue);
@ -9322,8 +9322,8 @@ CSSParserImpl::ParseSingleValueProperty(nsCSSValue& aValue,
return ParseTextAlignLast(aValue);
case eCSSProperty_text_decoration_line:
return ParseTextDecorationLine(aValue);
case eCSSProperty_text_combine_horizontal:
return ParseTextCombineHorizontal(aValue);
case eCSSProperty_text_combine_upright:
return ParseTextCombineUpright(aValue);
case eCSSProperty_text_overflow:
return ParseTextOverflow(aValue);
case eCSSProperty_touch_action:
@ -12433,16 +12433,16 @@ CSSParserImpl::ParseTouchAction(nsCSSValue& aValue)
}
bool
CSSParserImpl::ParseTextCombineHorizontal(nsCSSValue& aValue)
CSSParserImpl::ParseTextCombineUpright(nsCSSValue& aValue)
{
if (!ParseVariant(aValue, VARIANT_HK,
nsCSSProps::kTextCombineHorizontalKTable)) {
nsCSSProps::kTextCombineUprightKTable)) {
return false;
}
// if 'digits', need to check for an explicit number [2, 3, 4]
if (eCSSUnit_Enumerated == aValue.GetUnit() &&
aValue.GetIntValue() == NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_2) {
aValue.GetIntValue() == NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_2) {
if (!GetToken(true)) {
return true;
}
@ -12451,11 +12451,11 @@ CSSParserImpl::ParseTextCombineHorizontal(nsCSSValue& aValue)
case 2: // already set, nothing to do
break;
case 3:
aValue.SetIntValue(NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_3,
aValue.SetIntValue(NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_3,
eCSSUnit_Enumerated);
break;
case 4:
aValue.SetIntValue(NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_4,
aValue.SetIntValue(NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_4,
eCSSUnit_Enumerated);
break;
default:

View File

@ -3011,15 +3011,15 @@ CSS_PROP_SHORTHAND(
CSS_PROPERTY_PARSE_FUNCTION,
"")
CSS_PROP_TEXT(
text-combine-horizontal,
text_combine_horizontal,
TextCombineHorizontal,
text-combine-upright,
text_combine_upright,
TextCombineUpright,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_VALUE_PARSER_FUNCTION,
"layout.css.vertical-text.enabled",
0,
kTextCombineHorizontalKTable,
offsetof(nsStyleText, mTextCombineHorizontal),
kTextCombineUprightKTable,
offsetof(nsStyleText, mTextCombineUpright),
eStyleAnimType_EnumU8)
CSS_PROP_TEXTRESET(
-moz-text-decoration-color,

View File

@ -1570,10 +1570,10 @@ KTableValue nsCSSProps::kTextAlignLastKTable[] = {
eCSSKeyword_UNKNOWN,-1
};
const KTableValue nsCSSProps::kTextCombineHorizontalKTable[] = {
eCSSKeyword_none, NS_STYLE_TEXT_COMBINE_HORIZ_NONE,
eCSSKeyword_all, NS_STYLE_TEXT_COMBINE_HORIZ_ALL,
eCSSKeyword_digits, NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_2, // w/o number ==> 2
const KTableValue nsCSSProps::kTextCombineUprightKTable[] = {
eCSSKeyword_none, NS_STYLE_TEXT_COMBINE_UPRIGHT_NONE,
eCSSKeyword_all, NS_STYLE_TEXT_COMBINE_UPRIGHT_ALL,
eCSSKeyword_digits, NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_2, // w/o number ==> 2
eCSSKeyword_UNKNOWN,-1
};

View File

@ -618,7 +618,7 @@ public:
// "layout.css.text-align-true-value.enabled" changes:
static KTableValue kTextAlignKTable[];
static KTableValue kTextAlignLastKTable[];
static const KTableValue kTextCombineHorizontalKTable[];
static const KTableValue kTextCombineUprightKTable[];
static const KTableValue kTextDecorationLineKTable[];
static const KTableValue kTextDecorationStyleKTable[];
static const KTableValue kTextOrientationKTable[];

View File

@ -953,13 +953,13 @@ nsCSSValue::AppendToString(nsCSSProperty aProperty, nsAString& aResult,
switch(aProperty) {
case eCSSProperty_text_combine_horizontal:
if (intValue <= NS_STYLE_TEXT_COMBINE_HORIZ_ALL) {
case eCSSProperty_text_combine_upright:
if (intValue <= NS_STYLE_TEXT_COMBINE_UPRIGHT_ALL) {
AppendASCIItoUTF16(nsCSSProps::LookupPropertyValue(aProperty, intValue),
aResult);
} else if (intValue == NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_2) {
} else if (intValue == NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_2) {
aResult.AppendLiteral("digits 2");
} else if (intValue == NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_3) {
} else if (intValue == NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_3) {
aResult.AppendLiteral("digits 3");
} else {
aResult.AppendLiteral("digits 4");

View File

@ -3125,18 +3125,18 @@ nsComputedDOMStyle::DoGetTextAlignLast()
}
CSSValue*
nsComputedDOMStyle::DoGetTextCombineHorizontal()
nsComputedDOMStyle::DoGetTextCombineUpright()
{
nsROCSSPrimitiveValue *val = new nsROCSSPrimitiveValue;
uint8_t tch = StyleText()->mTextCombineHorizontal;
uint8_t tch = StyleText()->mTextCombineUpright;
if (tch <= NS_STYLE_TEXT_COMBINE_HORIZ_ALL) {
if (tch <= NS_STYLE_TEXT_COMBINE_UPRIGHT_ALL) {
val->SetIdent(
nsCSSProps::ValueToKeywordEnum(tch,
nsCSSProps::kTextCombineHorizontalKTable));
} else if (tch <= NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_2) {
nsCSSProps::kTextCombineUprightKTable));
} else if (tch <= NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_2) {
val->SetString(NS_LITERAL_STRING("digits 2"));
} else if (tch <= NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_3) {
} else if (tch <= NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_3) {
val->SetString(NS_LITERAL_STRING("digits 3"));
} else {
val->SetString(NS_LITERAL_STRING("digits 4"));

View File

@ -376,7 +376,7 @@ private:
mozilla::dom::CSSValue* DoGetLineHeight();
mozilla::dom::CSSValue* DoGetTextAlign();
mozilla::dom::CSSValue* DoGetTextAlignLast();
mozilla::dom::CSSValue* DoGetTextCombineHorizontal();
mozilla::dom::CSSValue* DoGetTextCombineUpright();
mozilla::dom::CSSValue* DoGetTextDecoration();
mozilla::dom::CSSValue* DoGetTextDecorationColor();
mozilla::dom::CSSValue* DoGetTextDecorationLine();

View File

@ -195,7 +195,7 @@ COMPUTED_STYLE_PROP(right, Right)
//// COMPUTED_STYLE_PROP(size, Size)
COMPUTED_STYLE_PROP(table_layout, TableLayout)
COMPUTED_STYLE_PROP(text_align, TextAlign)
COMPUTED_STYLE_PROP(text_combine_horizontal, TextCombineHorizontal)
COMPUTED_STYLE_PROP(text_combine_upright, TextCombineUpright)
COMPUTED_STYLE_PROP(text_decoration, TextDecoration)
COMPUTED_STYLE_PROP(text_indent, TextIndent)
COMPUTED_STYLE_PROP(text_orientation, TextOrientation)

View File

@ -4261,13 +4261,13 @@ nsRuleNode::ComputeTextData(void* aStartStruct,
parentText->mTextOrientation,
NS_STYLE_TEXT_ORIENTATION_AUTO, 0, 0, 0, 0);
// text-combine-horizontal: enum, inherit, initial
SetDiscrete(*aRuleData->ValueForTextCombineHorizontal(),
text->mTextCombineHorizontal,
// text-combine-upright: enum, inherit, initial
SetDiscrete(*aRuleData->ValueForTextCombineUpright(),
text->mTextCombineUpright,
canStoreInRuleTree,
SETDSC_ENUMERATED | SETDSC_UNSET_INHERIT,
parentText->mTextCombineHorizontal,
NS_STYLE_TEXT_COMBINE_HORIZ_NONE, 0, 0, 0, 0);
parentText->mTextCombineUpright,
NS_STYLE_TEXT_COMBINE_UPRIGHT_NONE, 0, 0, 0, 0);
COMPUTE_END_INHERITED(Text, text)
}

View File

@ -843,11 +843,11 @@ static inline mozilla::css::Side operator++(mozilla::css::Side& side, int) {
#define NS_STYLE_TEXT_ORIENTATION_SIDEWAYS 2
// See nsStyleText
#define NS_STYLE_TEXT_COMBINE_HORIZ_NONE 0
#define NS_STYLE_TEXT_COMBINE_HORIZ_ALL 1
#define NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_2 2
#define NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_3 3
#define NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_4 4
#define NS_STYLE_TEXT_COMBINE_UPRIGHT_NONE 0
#define NS_STYLE_TEXT_COMBINE_UPRIGHT_ALL 1
#define NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_2 2
#define NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_3 3
#define NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_4 4
// See nsStyleText
#define NS_STYLE_LINE_HEIGHT_BLOCK_HEIGHT 0

View File

@ -3058,7 +3058,7 @@ nsStyleText::nsStyleText(void)
mHyphens = NS_STYLE_HYPHENS_MANUAL;
mTextSizeAdjust = NS_STYLE_TEXT_SIZE_ADJUST_AUTO;
mTextOrientation = NS_STYLE_TEXT_ORIENTATION_AUTO;
mTextCombineHorizontal = NS_STYLE_TEXT_COMBINE_HORIZ_NONE;
mTextCombineUpright = NS_STYLE_TEXT_COMBINE_UPRIGHT_NONE;
mControlCharacterVisibility = NS_STYLE_CONTROL_CHARACTER_VISIBILITY_HIDDEN;
mLetterSpacing.SetNormalValue();
@ -3082,7 +3082,7 @@ nsStyleText::nsStyleText(const nsStyleText& aSource)
mHyphens(aSource.mHyphens),
mTextSizeAdjust(aSource.mTextSizeAdjust),
mTextOrientation(aSource.mTextOrientation),
mTextCombineHorizontal(aSource.mTextCombineHorizontal),
mTextCombineUpright(aSource.mTextCombineUpright),
mControlCharacterVisibility(aSource.mControlCharacterVisibility),
mTabSize(aSource.mTabSize),
mWordSpacing(aSource.mWordSpacing),
@ -3107,7 +3107,7 @@ nsChangeHint nsStyleText::CalcDifference(const nsStyleText& aOther) const
return NS_STYLE_HINT_FRAMECHANGE;
}
if (mTextCombineHorizontal != aOther.mTextCombineHorizontal ||
if (mTextCombineUpright != aOther.mTextCombineUpright ||
mControlCharacterVisibility != aOther.mControlCharacterVisibility) {
return nsChangeHint_ReconstructFrame;
}

View File

@ -1526,7 +1526,7 @@ struct nsStyleText {
uint8_t mHyphens; // [inherited] see nsStyleConsts.h
uint8_t mTextSizeAdjust; // [inherited] see nsStyleConsts.h
uint8_t mTextOrientation; // [inherited] see nsStyleConsts.h
uint8_t mTextCombineHorizontal; // [inherited] see nsStyleConsts.h
uint8_t mTextCombineUpright; // [inherited] see nsStyleConsts.h
uint8_t mControlCharacterVisibility; // [inherited] see nsStyleConsts.h
int32_t mTabSize; // [inherited] see nsStyleConsts.h

View File

@ -4398,8 +4398,8 @@ if (SpecialPowers.getBoolPref("layout.css.vertical-text.enabled")) {
other_values: [ "upright", "sideways" ],
invalid_values: [ "none", "3em" ]
},
"text-combine-horizontal": {
domProp: "textCombineHorizontal",
"text-combine-upright": {
domProp: "textCombineUpright",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "none" ],

View File

@ -68,7 +68,7 @@ function step() {
// ----
var gProps = {
"layout.css.vertical-text.enabled": ["text-combine-horizontal", "text-orientation", "writing-mode"],
"layout.css.vertical-text.enabled": ["text-combine-upright", "text-orientation", "writing-mode"],
"layout.css.font-features.enabled": ["font-kerning", "font-synthesis", "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", "font-variant-ligatures", "font-variant-numeric", "font-variant-position"],
"layout.css.image-orientation.enabled": ["image-orientation"],
"layout.css.mix-blend-mode.enabled": ["mix-blend-mode"],

View File

@ -1687,6 +1687,11 @@ function RecordResult(testRunTime, errorMsg, scriptResults)
function LoadFailed(why)
{
++gTestResults.FailedLoad;
// Once bug 896840 is fixed, this can go away, but for now it will give log
// output that is TBPL starable for bug 789751 and bug 720452.
if (!why) {
gDumpLog("REFTEST TEST-UNEXPECTED-FAIL | load failed with unknown reason\n");
}
gDumpLog("REFTEST TEST-UNEXPECTED-FAIL | " +
gURLs[0]["url" + gState].spec + " | load failed: " + why + "\n");
FlushTestLog();

View File

@ -126,6 +126,7 @@ struct RtspConnectionHandler : public AHandler {
mSetupTracksSuccessful(false),
mSeekPending(false),
mPausePending(false),
mAborted(false),
mFirstAccessUnit(true),
mNTPAnchorUs(-1),
mMediaAnchorUs(-1),
@ -412,6 +413,7 @@ struct RtspConnectionHandler : public AHandler {
{
int32_t result;
CHECK(msg->findInt32("result", &result));
mAborted = false;
LOGI("connection request completed with result %d (%s)",
result, strerror(-result));
@ -459,6 +461,10 @@ struct RtspConnectionHandler : public AHandler {
LOGI("DESCRIBE completed with result %d (%s)",
result, strerror(-result));
if (mAborted) {
LOGV("we're aborted, dropping stale packet.");
break;
}
if (result == OK) {
sp<RefBase> obj;
@ -578,6 +584,10 @@ struct RtspConnectionHandler : public AHandler {
LOGI("SETUP(%d) completed with result %d (%s)",
index, result, strerror(-result));
if (mAborted) {
LOGV("we're aborted, dropping stale packet.");
break;
}
if (result == OK) {
CHECK(track != NULL);
@ -711,6 +721,10 @@ struct RtspConnectionHandler : public AHandler {
LOGI("PLAY completed with result %d (%s)",
result, strerror(-result));
if (mAborted) {
LOGV("we're aborted, dropping stale packet.");
break;
}
if (result == OK) {
sp<RefBase> obj;
@ -816,6 +830,7 @@ struct RtspConnectionHandler : public AHandler {
mReceivedFirstRTCPPacket = false;
mReceivedFirstRTPPacket = false;
mSeekable = false;
mAborted = true;
sp<AMessage> reply = new AMessage('tear', id());
@ -955,6 +970,11 @@ struct RtspConnectionHandler : public AHandler {
break;
}
if (mAborted) {
LOGV("we're aborted, dropping stale packet.");
break;
}
if (seqNum < track->mFirstSeqNumInSegment) {
LOGV("dropping stale access-unit (%d < %d)",
seqNum, track->mFirstSeqNumInSegment);
@ -1047,6 +1067,10 @@ struct RtspConnectionHandler : public AHandler {
LOGI("PLAY completed with result %d (%s)",
result, strerror(-result));
if (mAborted) {
LOGV("we're aborted, dropping stale packet.");
break;
}
mCheckPending = false;
postAccessUnitTimeoutCheck();
@ -1301,6 +1325,7 @@ private:
bool mSetupTracksSuccessful;
bool mSeekPending;
bool mPausePending;
bool mAborted;
bool mFirstAccessUnit;
int64_t mNTPAnchorUs;

View File

@ -16,7 +16,6 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Timer.jsm");
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://gre/modules/FxAccountsCommon.js");
Cu.import("resource://gre/modules/FxAccountsUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "FxAccountsClient",
"resource://gre/modules/FxAccountsClient.jsm");
@ -201,6 +200,47 @@ AccountState.prototype = {
},
}
/**
* Copies properties from a given object to another object.
*
* @param from (object)
* The object we read property descriptors from.
* @param to (object)
* The object that we set property descriptors on.
* @param options (object) (optional)
* {keys: [...]}
* Lets the caller pass the names of all properties they want to be
* copied. Will copy all properties of the given source object by
* default.
* {bind: object}
* Lets the caller specify the object that will be used to .bind()
* all function properties we find to. Will bind to the given target
* object by default.
*/
function copyObjectProperties(from, to, opts = {}) {
let keys = (opts && opts.keys) || Object.keys(from);
let thisArg = (opts && opts.bind) || to;
for (let prop of keys) {
let desc = Object.getOwnPropertyDescriptor(from, prop);
if (typeof(desc.value) == "function") {
desc.value = desc.value.bind(thisArg);
}
if (desc.get) {
desc.get = desc.get.bind(thisArg);
}
if (desc.set) {
desc.set = desc.set.bind(thisArg);
}
Object.defineProperty(to, prop, desc);
}
}
/**
* The public API's constructor.
*/
@ -211,11 +251,11 @@ this.FxAccounts = function (mockInternal) {
// Copy all public properties to the 'external' object.
let prototype = FxAccountsInternal.prototype;
let options = {keys: publicProperties, bind: internal};
FxAccountsUtils.copyObjectProperties(prototype, external, options);
copyObjectProperties(prototype, external, options);
// Copy all of the mock's properties to the internal object.
if (mockInternal && !mockInternal.onlySetInternal) {
FxAccountsUtils.copyObjectProperties(mockInternal, internal);
copyObjectProperties(mockInternal, internal);
}
if (mockInternal) {

View File

@ -1,49 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
this.EXPORTED_SYMBOLS = ["FxAccountsUtils"];
this.FxAccountsUtils = Object.freeze({
/**
* Copies properties from a given object to another object.
*
* @param from (object)
* The object we read property descriptors from.
* @param to (object)
* The object that we set property descriptors on.
* @param options (object) (optional)
* {keys: [...]}
* Lets the caller pass the names of all properties they want to be
* copied. Will copy all properties of the given source object by
* default.
* {bind: object}
* Lets the caller specify the object that will be used to .bind()
* all function properties we find to. Will bind to the given target
* object by default.
*/
copyObjectProperties: function (from, to, opts = {}) {
let keys = (opts && opts.keys) || Object.keys(from);
let thisArg = (opts && opts.bind) || to;
for (let prop of keys) {
let desc = Object.getOwnPropertyDescriptor(from, prop);
if (typeof(desc.value) == "function") {
desc.value = desc.value.bind(thisArg);
}
if (desc.get) {
desc.get = desc.get.bind(thisArg);
}
if (desc.set) {
desc.set = desc.set.bind(thisArg);
}
Object.defineProperty(to, prop, desc);
}
}
});

View File

@ -12,8 +12,7 @@ EXTRA_JS_MODULES += [
'Credentials.jsm',
'FxAccounts.jsm',
'FxAccountsClient.jsm',
'FxAccountsCommon.js',
'FxAccountsUtils.jsm'
'FxAccountsCommon.js'
]
# For now, we will only be using the FxA manager in B2G.

View File

@ -79,15 +79,13 @@ StartupCache::CollectReports(nsIHandleReportCallback* aHandleReport,
"mapping.");
return NS_OK;
};
}
static const char sStartupCacheName[] = "startupCache." SC_WORDSIZE "." SC_ENDIAN;
#if defined(XP_WIN) && defined(MOZ_METRO)
static const char sMetroStartupCacheName[] = "metroStartupCache." SC_WORDSIZE "." SC_ENDIAN;
#endif
static NS_DEFINE_CID(kZipReaderCID, NS_ZIPREADER_CID);
StartupCache*
StartupCache::GetSingleton()
{

View File

@ -2,17 +2,11 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsID.h"
#include "prprf.h"
#include "nsMemory.h"
static const char gIDFormat[] =
"{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}";
static const char gIDFormat2[] =
"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x";
/**
* Multiplies the_int_var with 16 (0x10) and adds the value of the
* hexadecimal digit the_char. If it fails it returns false from
@ -51,8 +45,8 @@ static const char gIDFormat2[] =
*/
#define PARSE_HYPHEN(char_pointer) if(*(char_pointer++) != '-') return false
/*
/*
* Turns a {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} string into
* an nsID. It can also handle the old format without the { and }.
*/
@ -81,19 +75,22 @@ bool nsID::Parse(const char *aIDStr)
PARSE_CHARS_TO_NUM(aIDStr, m3[i], 2);
i++;
}
return expectFormat1 ? *aIDStr == '}' : true;
}
#ifndef XPCOM_GLUE_AVOID_NSPR
static const char gIDFormat[] =
"{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}";
/*
* Returns an allocated string in {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
* format. The string is allocated with NS_Alloc and should be freed by
* the caller.
*/
char *nsID::ToString() const
char *nsID::ToString() const
{
char *res = (char*)NS_Alloc(NSID_LENGTH);

View File

@ -17,7 +17,6 @@
*/
static const int32_t kMinGrowArrayBy = 8;
static const int32_t kMaxGrowArrayBy = 1024;
static const int32_t kAutoClearCompactSizeFactor = 4;
/**
* This is the threshold (in bytes) of the mImpl struct, past which
@ -31,7 +30,6 @@ static const int32_t kLinearThreshold = 24 * sizeof(void *);
*/
#define SIZEOF_IMPL(n_) (sizeof(Impl) + sizeof(void *) * ((n_) - 1))
/**
* Compute the number of elements that an mImpl struct of |n| bytes
* will hold.