This commit is contained in:
Margaret Leibovic 2011-09-13 09:38:41 -07:00
Родитель 0af5e76901 c7688439bc
Коммит 39c72c1e46
81 изменённых файлов: 689 добавлений и 473 удалений

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

@ -7,6 +7,10 @@
(^|/)ID$ (^|/)ID$
(^|/)\.DS_Store$ (^|/)\.DS_Store$
# Vim swap files.
^\.sw.$
.[^/]*\.sw.$
# User files that may appear at the root # User files that may appear at the root
^\.mozconfig ^\.mozconfig
^mozconfig$ ^mozconfig$

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

@ -1612,7 +1612,7 @@ nsHTMLEditRules::WillInsertBreak(nsISelection *aSelection, PRBool *aCancel, PRBo
} }
nsCOMPtr<nsIDOMNode> listItem = IsInListItem(blockParent); nsCOMPtr<nsIDOMNode> listItem = IsInListItem(blockParent);
if (listItem) if (listItem && listItem != hostNode)
{ {
res = ReturnInListItem(aSelection, listItem, node, offset); res = ReturnInListItem(aSelection, listItem, node, offset);
*aHandled = PR_TRUE; *aHandled = PR_TRUE;
@ -6507,6 +6507,7 @@ nsHTMLEditRules::MakeTransitionList(nsCOMArray<nsIDOMNode>& inArrayOfNodes,
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// IsInListItem: if aNode is the descendant of a listitem, return that li. // IsInListItem: if aNode is the descendant of a listitem, return that li.
// But table element boundaries are stoppers on the search. // But table element boundaries are stoppers on the search.
// Also stops on the active editor host (contenteditable).
// Also test if aNode is an li itself. // Also test if aNode is an li itself.
// //
nsCOMPtr<nsIDOMNode> nsCOMPtr<nsIDOMNode>
@ -6520,6 +6521,7 @@ nsHTMLEditRules::IsInListItem(nsIDOMNode *aNode)
while (parent) while (parent)
{ {
if (!mHTMLEditor->IsNodeInActiveEditor(parent)) return nsnull;
if (nsHTMLEditUtils::IsTableElement(parent)) return nsnull; if (nsHTMLEditUtils::IsTableElement(parent)) return nsnull;
if (nsHTMLEditUtils::IsListItem(parent)) return parent; if (nsHTMLEditUtils::IsListItem(parent)) return parent;
tmp=parent; tmp->GetParentNode(getter_AddRefs(parent)); tmp=parent; tmp->GetParentNode(getter_AddRefs(parent));

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

@ -73,6 +73,7 @@ _TEST_FILES = \
file_bug549262.html \ file_bug549262.html \
test_bug550434.html \ test_bug550434.html \
test_bug551704.html \ test_bug551704.html \
test_bug570144.html \
test_bug592592.html \ test_bug592592.html \
test_bug597784.html \ test_bug597784.html \
test_bug599322.html \ test_bug599322.html \

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

@ -84,8 +84,8 @@ function split(element, caretPos) {
// put the caret on the requested position // put the caret on the requested position
var range = document.createRange(); var range = document.createRange();
var sel = window.getSelection(); var sel = window.getSelection();
range.setStart(element.firstChild, len); range.setStart(element.firstChild, pos);
range.setEnd(element.firstChild, len); range.setEnd(element.firstChild, pos);
sel.addRange(range); sel.addRange(range);
// simulates a [Return] keypress // simulates a [Return] keypress

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

@ -0,0 +1,123 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=570144
-->
<head>
<title>Test for Bug 570144</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=570144">Mozilla Bug 570144</a>
<p id="display"></p>
<div id="content">
<!-- editable paragraphs in list item -->
<section id="test1">
<ol>
<li><p contenteditable>foo</p></li>
</ol>
<ul>
<li><p contenteditable>foo</p></li>
</ul>
<dl>
<dt>foo</dt>
<dd><p contenteditable>bar</p></dd>
</dl>
</section>
<!-- paragraphs in editable list item -->
<section id="test2">
<ol>
<li contenteditable><p>foo</p></li>
</ol>
<ul>
<li contenteditable><p>foo</p></li>
</ul>
<dl>
<dt>foo</dt>
<dd contenteditable><p>bar</p></dd>
</dl>
</section>
<!-- paragraphs in editable list -->
<section id="test3">
<ol contenteditable>
<li><p>foo</p></li>
</ol>
<ul contenteditable>
<li><p>foo</p></li>
</ul>
<dl contenteditable>
<dt>foo</dt>
<dd><p>bar</p></dd>
</dl>
</section>
</div>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 570144 **/
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(runTests);
function try2split(list) {
var editor = list.hasAttribute("contenteditable")
? list : list.querySelector("*[contenteditable]");
editor.focus();
// put the caret at the end of the paragraph
var selection = window.getSelection();
if (editor.nodeName.toLowerCase() == "p")
selection.selectAllChildren(editor);
else
selection.selectAllChildren(editor.querySelector("p"));
selection.collapseToEnd();
// simulate a [Return] keypress
synthesizeKey("VK_RETURN", {});
}
function testSection(element, context, shouldCreateLI, shouldCreateP) {
var nbLI = shouldCreateLI ? 2 : 1; // number of expected list items
var nbP = shouldCreateP ? 2 : 1; // number of expected paragraphs
function message(nodeName, dup) {
return context + ":[Return] should " + (dup ? "" : "not ")
+ "create another <" + nodeName + ">."
}
var msgP = message("p", shouldCreateP);
var msgLI = message("li", shouldCreateLI);
var msgDT = message("dt", shouldCreateLI);
var msgDD = message("dd", false);
const ol = element.querySelector("ol");
try2split(ol);
is(ol.querySelectorAll("li").length, nbLI, msgLI);
is(ol.querySelectorAll("p").length, nbP, msgP);
const ul = element.querySelector("ul");
try2split(ul);
is(ul.querySelectorAll("li").length, nbLI, msgLI);
is(ul.querySelectorAll("p").length, nbP, msgP);
const dl = element.querySelector("dl");
try2split(dl);
is(dl.querySelectorAll("dt").length, nbLI, msgDT);
is(dl.querySelectorAll("dd").length, 1, msgDD);
is(dl.querySelectorAll("p").length, nbP, msgP);
}
function runTests() {
testSection(document.getElementById("test1"), "editable paragraph in list item", false, false);
testSection(document.getElementById("test2"), "paragraph in editable list item", false, true);
testSection(document.getElementById("test3"), "paragraph in editable list", true, false);
/* Note: concerning #test3, it would be preferrable that [Return] creates
* another paragraph in another list item (i.e. last argument = 'true').
* Currently it just creates an empty list item, which is acceptable.
*/
SimpleTest.finish();
}
</script>
</pre>
</body>
</html>

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

@ -0,0 +1,18 @@
<!DOCTYPE html>
<head>
<style type="text/css">
@font-face {
font-family: foo;
src: url(Prototype.ttf);
}
body {
font-family: foo;
font-size: 2000px;
font-weight: 900;
}
</style>
</head>
<body>
xyzzy
</body>
</html>

Двоичные данные
gfx/tests/crashtests/Prototype.ttf Normal file

Двоичный файл не отображается.

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

@ -84,3 +84,4 @@ load 594654-1.xhtml
load 595727-1.html load 595727-1.html
load 633453-1.html load 633453-1.html
load 633322-1.html load 633322-1.html
load 686190-1.html

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

@ -1111,10 +1111,10 @@ struct GlyphBuffer {
void Flush(cairo_t *aCR, PRBool aDrawToPath, PRBool aReverse, void Flush(cairo_t *aCR, PRBool aDrawToPath, PRBool aReverse,
PRBool aFinish = PR_FALSE) { PRBool aFinish = PR_FALSE) {
// Ensure there's enough room for at least two glyphs in the // Ensure there's enough room for a glyph to be added to the buffer
// buffer (because we may allocate two glyphs between flushes) if (!aFinish && mNumGlyphs < GLYPH_BUFFER_SIZE) {
if (!aFinish && mNumGlyphs + 2 <= GLYPH_BUFFER_SIZE)
return; return;
}
if (aReverse) { if (aReverse) {
for (PRUint32 i = 0; i < mNumGlyphs/2; ++i) { for (PRUint32 i = 0; i < mNumGlyphs/2; ++i) {
@ -1222,6 +1222,7 @@ gfxFont::Draw(gfxTextRun *aTextRun, PRUint32 aStart, PRUint32 aEnd,
} }
glyph->x = ToDeviceUnits(glyphX, devUnitsPerAppUnit); glyph->x = ToDeviceUnits(glyphX, devUnitsPerAppUnit);
glyph->y = ToDeviceUnits(y, devUnitsPerAppUnit); glyph->y = ToDeviceUnits(y, devUnitsPerAppUnit);
glyphs.Flush(cr, aDrawToPath, isRTL);
// synthetic bolding by multi-striking with 1-pixel offsets // synthetic bolding by multi-striking with 1-pixel offsets
// at least once, more if there's room (large font sizes) // at least once, more if there's room (large font sizes)
@ -1237,10 +1238,9 @@ gfxFont::Draw(gfxTextRun *aTextRun, PRUint32 aStart, PRUint32 aEnd,
devUnitsPerAppUnit); devUnitsPerAppUnit);
doubleglyph->y = glyph->y; doubleglyph->y = glyph->y;
strikeOffset += synBoldOnePixelOffset; strikeOffset += synBoldOnePixelOffset;
glyphs.Flush(cr, aDrawToPath, isRTL);
} while (--strikeCount > 0); } while (--strikeCount > 0);
} }
glyphs.Flush(cr, aDrawToPath, isRTL);
} else { } else {
PRUint32 glyphCount = glyphData->GetGlyphCount(); PRUint32 glyphCount = glyphData->GetGlyphCount();
if (glyphCount > 0) { if (glyphCount > 0) {
@ -1275,6 +1275,7 @@ gfxFont::Draw(gfxTextRun *aTextRun, PRUint32 aStart, PRUint32 aEnd,
} }
glyph->x = ToDeviceUnits(glyphX, devUnitsPerAppUnit); glyph->x = ToDeviceUnits(glyphX, devUnitsPerAppUnit);
glyph->y = ToDeviceUnits(y + details->mYOffset, devUnitsPerAppUnit); glyph->y = ToDeviceUnits(y + details->mYOffset, devUnitsPerAppUnit);
glyphs.Flush(cr, aDrawToPath, isRTL);
if (IsSyntheticBold()) { if (IsSyntheticBold()) {
double strikeOffset = synBoldOnePixelOffset; double strikeOffset = synBoldOnePixelOffset;
@ -1289,10 +1290,9 @@ gfxFont::Draw(gfxTextRun *aTextRun, PRUint32 aStart, PRUint32 aEnd,
devUnitsPerAppUnit); devUnitsPerAppUnit);
doubleglyph->y = glyph->y; doubleglyph->y = glyph->y;
strikeOffset += synBoldOnePixelOffset; strikeOffset += synBoldOnePixelOffset;
glyphs.Flush(cr, aDrawToPath, isRTL);
} while (--strikeCount > 0); } while (--strikeCount > 0);
} }
glyphs.Flush(cr, aDrawToPath, isRTL);
} }
x += direction*advance; x += direction*advance;
} }

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

@ -989,7 +989,9 @@ public:
void imull_i32r(RegisterID src, int32_t value, RegisterID dst) void imull_i32r(RegisterID src, int32_t value, RegisterID dst)
{ {
FIXME_INSN_PRINTING; js::JaegerSpew(js::JSpew_Insns,
IPFX "imull %d, %s, %s\n",
MAYBE_PAD, value, nameIReg(4, src), nameIReg(4, dst));
m_formatter.oneByteOp(OP_IMUL_GvEvIz, dst, src); m_formatter.oneByteOp(OP_IMUL_GvEvIz, dst, src);
m_formatter.immediate32(value); m_formatter.immediate32(value);
} }

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

@ -1031,13 +1031,13 @@ class ScriptAnalysis
bool hasPushedTypes(const jsbytecode *pc) { return getCode(pc).pushedTypes != NULL; } bool hasPushedTypes(const jsbytecode *pc) { return getCode(pc).pushedTypes != NULL; }
types::TypeBarrier *typeBarriers(uint32 offset) { types::TypeBarrier *typeBarriers(JSContext *cx, uint32 offset) {
if (getCode(offset).typeBarriers) if (getCode(offset).typeBarriers)
pruneTypeBarriers(offset); pruneTypeBarriers(cx, offset);
return getCode(offset).typeBarriers; return getCode(offset).typeBarriers;
} }
types::TypeBarrier *typeBarriers(const jsbytecode *pc) { types::TypeBarrier *typeBarriers(JSContext *cx, const jsbytecode *pc) {
return typeBarriers(pc - script->code); return typeBarriers(cx, pc - script->code);
} }
void addTypeBarrier(JSContext *cx, const jsbytecode *pc, void addTypeBarrier(JSContext *cx, const jsbytecode *pc,
types::TypeSet *target, types::Type type); types::TypeSet *target, types::Type type);
@ -1045,7 +1045,7 @@ class ScriptAnalysis
types::TypeSet *target, JSObject *singleton, jsid singletonId); types::TypeSet *target, JSObject *singleton, jsid singletonId);
/* Remove obsolete type barriers at the given offset. */ /* Remove obsolete type barriers at the given offset. */
void pruneTypeBarriers(uint32 offset); void pruneTypeBarriers(JSContext *cx, uint32 offset);
/* /*
* Remove still-active type barriers at the given offset. If 'all' is set, * Remove still-active type barriers at the given offset. If 'all' is set,

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

@ -1801,7 +1801,7 @@ JS_EnumerateStandardClasses(JSContext *cx, JSObject *obj)
* Since ES5 15.1.1.3 undefined can't be deleted. * Since ES5 15.1.1.3 undefined can't be deleted.
*/ */
atom = rt->atomState.typeAtoms[JSTYPE_VOID]; atom = rt->atomState.typeAtoms[JSTYPE_VOID];
if (!obj->nativeContains(ATOM_TO_JSID(atom)) && if (!obj->nativeContains(cx, ATOM_TO_JSID(atom)) &&
!obj->defineProperty(cx, ATOM_TO_JSID(atom), UndefinedValue(), !obj->defineProperty(cx, ATOM_TO_JSID(atom), UndefinedValue(),
PropertyStub, StrictPropertyStub, PropertyStub, StrictPropertyStub,
JSPROP_PERMANENT | JSPROP_READONLY)) { JSPROP_PERMANENT | JSPROP_READONLY)) {
@ -1877,7 +1877,7 @@ static JSIdArray *
EnumerateIfResolved(JSContext *cx, JSObject *obj, JSAtom *atom, JSIdArray *ida, EnumerateIfResolved(JSContext *cx, JSObject *obj, JSAtom *atom, JSIdArray *ida,
jsint *ip, JSBool *foundp) jsint *ip, JSBool *foundp)
{ {
*foundp = obj->nativeContains(ATOM_TO_JSID(atom)); *foundp = obj->nativeContains(cx, ATOM_TO_JSID(atom));
if (*foundp) if (*foundp)
ida = AddAtomToArray(cx, atom, ida, ip); ida = AddAtomToArray(cx, atom, ida, ip);
return ida; return ida;
@ -3347,7 +3347,7 @@ JS_AlreadyHasOwnPropertyById(JSContext *cx, JSObject *obj, jsid id, JSBool *foun
return JS_TRUE; return JS_TRUE;
} }
*foundp = obj->nativeContains(id); *foundp = obj->nativeContains(cx, id);
return JS_TRUE; return JS_TRUE;
} }

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

@ -347,7 +347,7 @@ JSObject::arrayGetOwnDataElement(JSContext *cx, size_t i, Value *vp)
if (!IndexToId(cx, this, i, &hole, &id)) if (!IndexToId(cx, this, i, &hole, &id))
return false; return false;
const Shape *shape = nativeLookup(id); const Shape *shape = nativeLookup(cx, id);
if (!shape || !shape->isDataDescriptor()) if (!shape || !shape->isDataDescriptor())
vp->setMagic(JS_ARRAY_HOLE); vp->setMagic(JS_ARRAY_HOLE);
else else
@ -1104,7 +1104,7 @@ static bool
AddLengthProperty(JSContext *cx, JSObject *obj) AddLengthProperty(JSContext *cx, JSObject *obj)
{ {
const jsid lengthId = ATOM_TO_JSID(cx->runtime->atomState.lengthAtom); const jsid lengthId = ATOM_TO_JSID(cx->runtime->atomState.lengthAtom);
JS_ASSERT(!obj->nativeLookup(lengthId)); JS_ASSERT(!obj->nativeLookup(cx, lengthId));
return obj->addProperty(cx, lengthId, array_length_getter, array_length_setter, return obj->addProperty(cx, lengthId, array_length_getter, array_length_setter,
SHAPE_INVALID_SLOT, JSPROP_PERMANENT | JSPROP_SHARED, 0, 0); SHAPE_INVALID_SLOT, JSPROP_PERMANENT | JSPROP_SHARED, 0, 0);

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

@ -1718,7 +1718,7 @@ js_LexicalLookup(JSTreeContext *tc, JSAtom *atom, jsint *slotp, JSStmtInfo *stmt
JSObject *obj = stmt->blockBox->object; JSObject *obj = stmt->blockBox->object;
JS_ASSERT(obj->isStaticBlock()); JS_ASSERT(obj->isStaticBlock());
const Shape *shape = obj->nativeLookup(ATOM_TO_JSID(atom)); const Shape *shape = obj->nativeLookup(tc->parser->context, ATOM_TO_JSID(atom));
if (shape) { if (shape) {
JS_ASSERT(shape->hasShortID()); JS_ASSERT(shape->hasShortID());
@ -1779,7 +1779,7 @@ LookupCompileTimeConstant(JSContext *cx, JSCodeGenerator *cg, JSAtom *atom,
JS_ASSERT(cg->compileAndGo()); JS_ASSERT(cg->compileAndGo());
obj = cg->scopeChain(); obj = cg->scopeChain();
const Shape *shape = obj->nativeLookup(ATOM_TO_JSID(atom)); const Shape *shape = obj->nativeLookup(cx, ATOM_TO_JSID(atom));
if (shape) { if (shape) {
/* /*
* We're compiling code that will be executed immediately, * We're compiling code that will be executed immediately,
@ -4353,7 +4353,7 @@ static JSBool
EmitVariables(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn, EmitVariables(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn,
JSBool inLetHead, ptrdiff_t *headNoteIndex) JSBool inLetHead, ptrdiff_t *headNoteIndex)
{ {
bool let, forInVar, first; bool forInVar, first;
ptrdiff_t off, noteIndex, tmp; ptrdiff_t off, noteIndex, tmp;
JSParseNode *pn2, *pn3, *next; JSParseNode *pn2, *pn3, *next;
JSOp op; JSOp op;
@ -4375,7 +4375,7 @@ EmitVariables(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn,
* to the start of the block, a 'for (let x = i...) ...' loop evaluates i * to the start of the block, a 'for (let x = i...) ...' loop evaluates i
* in the containing scope, and puts x in the loop body's scope. * in the containing scope, and puts x in the loop body's scope.
*/ */
let = (pn->pn_op == JSOP_NOP); DebugOnly<bool> let = (pn->pn_op == JSOP_NOP);
forInVar = (pn->pn_xflags & PNX_FORINVAR) != 0; forInVar = (pn->pn_xflags & PNX_FORINVAR) != 0;
off = noteIndex = -1; off = noteIndex = -1;
@ -5954,7 +5954,6 @@ js_EmitTree(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn)
case TOK_CATCH: case TOK_CATCH:
{ {
ptrdiff_t catchStart, guardJump; ptrdiff_t catchStart, guardJump;
JSObject *blockObj;
/* /*
* Morph STMT_BLOCK to STMT_CATCH, note the block entry code offset, * Morph STMT_BLOCK to STMT_CATCH, note the block entry code offset,
@ -5964,7 +5963,6 @@ js_EmitTree(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn)
JS_ASSERT(stmt->type == STMT_BLOCK && (stmt->flags & SIF_SCOPE)); JS_ASSERT(stmt->type == STMT_BLOCK && (stmt->flags & SIF_SCOPE));
stmt->type = STMT_CATCH; stmt->type = STMT_CATCH;
catchStart = stmt->update; catchStart = stmt->update;
blockObj = stmt->blockBox->object;
/* Go up one statement info record to the TRY or FINALLY record. */ /* Go up one statement info record to the TRY or FINALLY record. */
stmt = stmt->down; stmt = stmt->down;

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

@ -1207,7 +1207,7 @@ StackFrame::getValidCalleeObject(JSContext *cx, Value *vp)
continue; continue;
if (thisp->hasMethodBarrier()) { if (thisp->hasMethodBarrier()) {
const Shape *shape = thisp->nativeLookup(ATOM_TO_JSID(fun->methodAtom())); const Shape *shape = thisp->nativeLookup(cx, ATOM_TO_JSID(fun->methodAtom()));
if (shape) { if (shape) {
/* /*
* Two cases follow: the method barrier was not crossed * Two cases follow: the method barrier was not crossed
@ -2313,11 +2313,11 @@ LookupInterpretedFunctionPrototype(JSContext *cx, JSObject *funobj)
#endif #endif
jsid id = ATOM_TO_JSID(cx->runtime->atomState.classPrototypeAtom); jsid id = ATOM_TO_JSID(cx->runtime->atomState.classPrototypeAtom);
const Shape *shape = funobj->nativeLookup(id); const Shape *shape = funobj->nativeLookup(cx, id);
if (!shape) { if (!shape) {
if (!ResolveInterpretedFunctionPrototype(cx, funobj)) if (!ResolveInterpretedFunctionPrototype(cx, funobj))
return NULL; return NULL;
shape = funobj->nativeLookup(id); shape = funobj->nativeLookup(cx, id);
} }
JS_ASSERT(!shape->configurable()); JS_ASSERT(!shape->configurable());
JS_ASSERT(shape->isDataDescriptor()); JS_ASSERT(shape->isDataDescriptor());

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

@ -326,9 +326,9 @@ ClassMethodIsNative(JSContext *cx, JSObject *obj, Class *clasp, jsid methodid, N
JS_ASSERT(obj->getClass() == clasp); JS_ASSERT(obj->getClass() == clasp);
Value v; Value v;
if (!HasDataProperty(obj, methodid, &v)) { if (!HasDataProperty(cx, obj, methodid, &v)) {
JSObject *proto = obj->getProto(); JSObject *proto = obj->getProto();
if (!proto || proto->getClass() != clasp || !HasDataProperty(proto, methodid, &v)) if (!proto || proto->getClass() != clasp || !HasDataProperty(cx, proto, methodid, &v))
return false; return false;
} }

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

@ -143,6 +143,15 @@ GetGCObjectKind(size_t numSlots, bool isArray = false)
return slotsToThingKind[numSlots]; return slotsToThingKind[numSlots];
} }
static inline AllocKind
GetGCObjectFixedSlotsKind(size_t numFixedSlots)
{
extern AllocKind slotsToThingKind[];
JS_ASSERT(numFixedSlots < SLOTS_TO_THING_KIND_LIMIT);
return slotsToThingKind[numFixedSlots];
}
static inline bool static inline bool
IsBackgroundAllocKind(AllocKind kind) IsBackgroundAllocKind(AllocKind kind)
{ {

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

@ -756,16 +756,16 @@ TypeSet::addFilterPrimitives(JSContext *cx, TypeSet *target, FilterKind filter)
/* If id is a normal slotful 'own' property of an object, get its shape. */ /* If id is a normal slotful 'own' property of an object, get its shape. */
static inline const Shape * static inline const Shape *
GetSingletonShape(JSObject *obj, jsid id) GetSingletonShape(JSContext *cx, JSObject *obj, jsid id)
{ {
const Shape *shape = obj->nativeLookup(id); const Shape *shape = obj->nativeLookup(cx, id);
if (shape && shape->hasDefaultGetterOrIsMethod() && shape->slot != SHAPE_INVALID_SLOT) if (shape && shape->hasDefaultGetterOrIsMethod() && shape->slot != SHAPE_INVALID_SLOT)
return shape; return shape;
return NULL; return NULL;
} }
void void
ScriptAnalysis::pruneTypeBarriers(uint32 offset) ScriptAnalysis::pruneTypeBarriers(JSContext *cx, uint32 offset)
{ {
TypeBarrier **pbarrier = &getCode(offset).typeBarriers; TypeBarrier **pbarrier = &getCode(offset).typeBarriers;
while (*pbarrier) { while (*pbarrier) {
@ -777,7 +777,7 @@ ScriptAnalysis::pruneTypeBarriers(uint32 offset)
} }
if (barrier->singleton) { if (barrier->singleton) {
JS_ASSERT(barrier->type.isPrimitive(JSVAL_TYPE_UNDEFINED)); JS_ASSERT(barrier->type.isPrimitive(JSVAL_TYPE_UNDEFINED));
const Shape *shape = GetSingletonShape(barrier->singleton, barrier->singletonId); const Shape *shape = GetSingletonShape(cx, barrier->singleton, barrier->singletonId);
if (shape && !barrier->singleton->nativeGetSlot(shape->slot).isUndefined()) { if (shape && !barrier->singleton->nativeGetSlot(shape->slot).isUndefined()) {
/* /*
* When we analyzed the script the singleton had an 'own' * When we analyzed the script the singleton had an 'own'
@ -805,7 +805,7 @@ static const uint32 BARRIER_OBJECT_LIMIT = 10;
void ScriptAnalysis::breakTypeBarriers(JSContext *cx, uint32 offset, bool all) void ScriptAnalysis::breakTypeBarriers(JSContext *cx, uint32 offset, bool all)
{ {
pruneTypeBarriers(offset); pruneTypeBarriers(cx, offset);
TypeBarrier **pbarrier = &getCode(offset).typeBarriers; TypeBarrier **pbarrier = &getCode(offset).typeBarriers;
while (*pbarrier) { while (*pbarrier) {
@ -1004,7 +1004,7 @@ PropertyAccess(JSContext *cx, JSScript *script, jsbytecode *pc, TypeObject *obje
* to remove the barrier after the property becomes defined, * to remove the barrier after the property becomes defined,
* even if no undefined value is ever observed at pc. * even if no undefined value is ever observed at pc.
*/ */
const Shape *shape = GetSingletonShape(object->singleton, id); const Shape *shape = GetSingletonShape(cx, object->singleton, id);
if (shape && object->singleton->nativeGetSlot(shape->slot).isUndefined()) if (shape && object->singleton->nativeGetSlot(shape->slot).isUndefined())
script->analysis()->addSingletonTypeBarrier(cx, pc, target, object->singleton, id); script->analysis()->addSingletonTypeBarrier(cx, pc, target, object->singleton, id);
} }
@ -2728,7 +2728,7 @@ TypeObject::addProperty(JSContext *cx, jsid id, Property **pprop)
shape = shape->previous(); shape = shape->previous();
} }
} else { } else {
const Shape *shape = singleton->nativeLookup(id); const Shape *shape = singleton->nativeLookup(cx, id);
if (shape) if (shape)
UpdatePropertyType(cx, &base->types, singleton, shape, false); UpdatePropertyType(cx, &base->types, singleton, shape, false);
} }

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

@ -3755,9 +3755,9 @@ BEGIN_CASE(JSOP_SETMETHOD)
{ {
#ifdef DEBUG #ifdef DEBUG
if (entry->directHit()) { if (entry->directHit()) {
JS_ASSERT(obj->nativeContains(*shape)); JS_ASSERT(obj->nativeContains(cx, *shape));
} else { } else {
JS_ASSERT(obj2->nativeContains(*shape)); JS_ASSERT(obj2->nativeContains(cx, *shape));
JS_ASSERT(entry->vcapTag() == 1); JS_ASSERT(entry->vcapTag() == 1);
JS_ASSERT(entry->kshape != entry->vshape()); JS_ASSERT(entry->kshape != entry->vshape());
JS_ASSERT(!shape->hasSlot()); JS_ASSERT(!shape->hasSlot());

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

@ -592,8 +592,6 @@ static int
js_SuspendThread(JSThinLock *tl) js_SuspendThread(JSThinLock *tl)
{ {
JSFatLock *fl; JSFatLock *fl;
PRStatus stat;
if (tl->fat == NULL) if (tl->fat == NULL)
fl = tl->fat = GetFatlock(tl); fl = tl->fat = GetFatlock(tl);
else else
@ -602,7 +600,7 @@ js_SuspendThread(JSThinLock *tl)
fl->susp++; fl->susp++;
PR_Lock(fl->slock); PR_Lock(fl->slock);
js_UnlockGlobal(tl); js_UnlockGlobal(tl);
stat = PR_WaitCondVar(fl->svar, PR_INTERVAL_NO_TIMEOUT); DebugOnly<PRStatus> stat = PR_WaitCondVar(fl->svar, PR_INTERVAL_NO_TIMEOUT);
JS_ASSERT(stat != PR_FAILURE); JS_ASSERT(stat != PR_FAILURE);
PR_Unlock(fl->slock); PR_Unlock(fl->slock);
js_LockGlobal(tl); js_LockGlobal(tl);
@ -622,13 +620,11 @@ static void
js_ResumeThread(JSThinLock *tl) js_ResumeThread(JSThinLock *tl)
{ {
JSFatLock *fl = tl->fat; JSFatLock *fl = tl->fat;
PRStatus stat;
JS_ASSERT(fl != NULL); JS_ASSERT(fl != NULL);
JS_ASSERT(fl->susp > 0); JS_ASSERT(fl->susp > 0);
PR_Lock(fl->slock); PR_Lock(fl->slock);
js_UnlockGlobal(tl); js_UnlockGlobal(tl);
stat = PR_NotifyCondVar(fl->svar); DebugOnly<PRStatus> stat = PR_NotifyCondVar(fl->svar);
JS_ASSERT(stat != PR_FAILURE); JS_ASSERT(stat != PR_FAILURE);
PR_Unlock(fl->slock); PR_Unlock(fl->slock);
} }

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

@ -3117,7 +3117,7 @@ js_CreateThisFromTrace(JSContext *cx, JSObject *ctor, uintN protoSlot)
JS_ASSERT(ctor->isFunction()); JS_ASSERT(ctor->isFunction());
JS_ASSERT(ctor->getFunctionPrivate()->isInterpreted()); JS_ASSERT(ctor->getFunctionPrivate()->isInterpreted());
jsid id = ATOM_TO_JSID(cx->runtime->atomState.classPrototypeAtom); jsid id = ATOM_TO_JSID(cx->runtime->atomState.classPrototypeAtom);
const Shape *shape = ctor->nativeLookup(id); const Shape *shape = ctor->nativeLookup(cx, id);
JS_ASSERT(shape->slot == protoSlot); JS_ASSERT(shape->slot == protoSlot);
JS_ASSERT(!shape->configurable()); JS_ASSERT(!shape->configurable());
JS_ASSERT(!shape->isMethod()); JS_ASSERT(!shape->isMethod());
@ -4115,7 +4115,7 @@ DefineStandardSlot(JSContext *cx, JSObject *obj, JSProtoKey key, JSAtom *atom,
if (!obj->ensureClassReservedSlots(cx)) if (!obj->ensureClassReservedSlots(cx))
return false; return false;
const Shape *shape = obj->nativeLookup(id); const Shape *shape = obj->nativeLookup(cx, id);
if (!shape) { if (!shape) {
uint32 slot = 2 * JSProto_LIMIT + key; uint32 slot = 2 * JSProto_LIMIT + key;
if (!js_SetReservedSlot(cx, obj, slot, v)) if (!js_SetReservedSlot(cx, obj, slot, v))
@ -4965,7 +4965,7 @@ PurgeProtoChain(JSContext *cx, JSObject *obj, jsid id)
obj = obj->getProto(); obj = obj->getProto();
continue; continue;
} }
shape = obj->nativeLookup(id); shape = obj->nativeLookup(cx, id);
if (shape) { if (shape) {
PCMETER(JS_PROPERTY_CACHE(cx).pcpurges++); PCMETER(JS_PROPERTY_CACHE(cx).pcpurges++);
obj->shadowingShapeChange(cx, *shape); obj->shadowingShapeChange(cx, *shape);
@ -5204,7 +5204,7 @@ DefineNativeProperty(JSContext *cx, JSObject *obj, jsid id, const Value &value,
} }
} }
if (const Shape *existingShape = obj->nativeLookup(id)) { if (const Shape *existingShape = obj->nativeLookup(cx, id)) {
if (existingShape->hasSlot()) if (existingShape->hasSlot())
AbortRecordingIfUnexpectedGlobalWrite(cx, obj, existingShape->slot); AbortRecordingIfUnexpectedGlobalWrite(cx, obj, existingShape->slot);
@ -5356,7 +5356,7 @@ CallResolveOp(JSContext *cx, JSObject *start, JSObject *obj, jsid id, uintN flag
} }
if (!obj->nativeEmpty()) { if (!obj->nativeEmpty()) {
if (const Shape *shape = obj->nativeLookup(id)) { if (const Shape *shape = obj->nativeLookup(cx, id)) {
*objp = obj; *objp = obj;
*propp = (JSProperty *) shape; *propp = (JSProperty *) shape;
} }
@ -5375,7 +5375,7 @@ LookupPropertyWithFlagsInline(JSContext *cx, JSObject *obj, jsid id, uintN flags
/* Search scopes starting with obj and following the prototype link. */ /* Search scopes starting with obj and following the prototype link. */
JSObject *start = obj; JSObject *start = obj;
while (true) { while (true) {
const Shape *shape = obj->nativeLookup(id); const Shape *shape = obj->nativeLookup(cx, id);
if (shape) { if (shape) {
*objp = obj; *objp = obj;
*propp = (JSProperty *) shape; *propp = (JSProperty *) shape;
@ -5670,7 +5670,7 @@ js_NativeGetInline(JSContext *cx, JSObject *receiver, JSObject *obj, JSObject *p
if (pobj->containsSlot(slot) && if (pobj->containsSlot(slot) &&
(JS_LIKELY(cx->runtime->propertyRemovals == sample) || (JS_LIKELY(cx->runtime->propertyRemovals == sample) ||
pobj->nativeContains(*shape))) { pobj->nativeContains(cx, *shape))) {
if (!pobj->methodWriteBarrier(cx, *shape, *vp)) if (!pobj->methodWriteBarrier(cx, *shape, *vp))
return false; return false;
pobj->nativeSetSlot(slot, *vp); pobj->nativeSetSlot(slot, *vp);
@ -5737,7 +5737,7 @@ js_NativeSet(JSContext *cx, JSObject *obj, const Shape *shape, bool added, bool
if (obj->containsSlot(slot) && if (obj->containsSlot(slot) &&
(JS_LIKELY(cx->runtime->propertyRemovals == sample) || (JS_LIKELY(cx->runtime->propertyRemovals == sample) ||
obj->nativeContains(*shape))) { obj->nativeContains(cx, *shape))) {
if (!added) { if (!added) {
AbortRecordingIfUnexpectedGlobalWrite(cx, obj, slot); AbortRecordingIfUnexpectedGlobalWrite(cx, obj, slot);
if (!obj->methodWriteBarrier(cx, *shape, *vp)) if (!obj->methodWriteBarrier(cx, *shape, *vp))
@ -6348,9 +6348,9 @@ js_DeleteProperty(JSContext *cx, JSObject *obj, jsid id, Value *rval, JSBool str
namespace js { namespace js {
bool bool
HasDataProperty(JSObject *obj, jsid methodid, Value *vp) HasDataProperty(JSContext *cx, JSObject *obj, jsid methodid, Value *vp)
{ {
if (const Shape *shape = obj->nativeLookup(methodid)) { if (const Shape *shape = obj->nativeLookup(cx, methodid)) {
if (shape->hasDefaultGetterOrIsMethod() && obj->containsSlot(shape->slot)) { if (shape->hasDefaultGetterOrIsMethod() && obj->containsSlot(shape->slot)) {
*vp = obj->nativeGetSlot(shape->slot); *vp = obj->nativeGetSlot(shape->slot);
return true; return true;

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

@ -425,11 +425,11 @@ struct JSObject : js::gc::Cell {
public: public:
inline const js::Shape *lastProperty() const; inline const js::Shape *lastProperty() const;
inline js::Shape **nativeSearch(jsid id, bool adding = false); inline js::Shape **nativeSearch(JSContext *cx, jsid id, bool adding = false);
inline const js::Shape *nativeLookup(jsid id); inline const js::Shape *nativeLookup(JSContext *cx, jsid id);
inline bool nativeContains(jsid id); inline bool nativeContains(JSContext *cx, jsid id);
inline bool nativeContains(const js::Shape &shape); inline bool nativeContains(JSContext *cx, const js::Shape &shape);
enum { enum {
DELEGATE = 0x01, DELEGATE = 0x01,
@ -1984,7 +1984,7 @@ namespace js {
* store the property value in *vp. * store the property value in *vp.
*/ */
extern bool extern bool
HasDataProperty(JSObject *obj, jsid methodid, js::Value *vp); HasDataProperty(JSContext *cx, JSObject *obj, jsid methodid, js::Value *vp);
extern JSBool extern JSBool
CheckAccess(JSContext *cx, JSObject *obj, jsid id, JSAccessMode mode, CheckAccess(JSContext *cx, JSObject *obj, jsid id, JSAccessMode mode,

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

@ -143,7 +143,7 @@ JSObject::getProperty(JSContext *cx, JSObject *receiver, jsid id, js::Value *vp)
} else { } else {
if (!js_GetProperty(cx, this, receiver, id, vp)) if (!js_GetProperty(cx, this, receiver, id, vp))
return false; return false;
JS_ASSERT_IF(!hasSingletonType() && nativeContains(js_CheckForStringIndex(id)), JS_ASSERT_IF(!hasSingletonType() && nativeContains(cx, js_CheckForStringIndex(id)),
js::types::TypeHasProperty(cx, type(), id, *vp)); js::types::TypeHasProperty(cx, type(), id, *vp));
} }
return true; return true;
@ -253,7 +253,7 @@ JSObject::methodReadBarrier(JSContext *cx, const js::Shape &shape, js::Value *vp
{ {
JS_ASSERT(canHaveMethodBarrier()); JS_ASSERT(canHaveMethodBarrier());
JS_ASSERT(hasMethodBarrier()); JS_ASSERT(hasMethodBarrier());
JS_ASSERT(nativeContains(shape)); JS_ASSERT(nativeContains(cx, shape));
JS_ASSERT(shape.isMethod()); JS_ASSERT(shape.isMethod());
JS_ASSERT(shape.methodObject() == vp->toObject()); JS_ASSERT(shape.methodObject() == vp->toObject());
JS_ASSERT(shape.writable()); JS_ASSERT(shape.writable());
@ -1007,28 +1007,28 @@ JSObject::setOwnShape(uint32 s)
} }
inline js::Shape ** inline js::Shape **
JSObject::nativeSearch(jsid id, bool adding) JSObject::nativeSearch(JSContext *cx, jsid id, bool adding)
{ {
return js::Shape::search(compartment()->rt, &lastProp, id, adding); return js::Shape::search(cx, &lastProp, id, adding);
} }
inline const js::Shape * inline const js::Shape *
JSObject::nativeLookup(jsid id) JSObject::nativeLookup(JSContext *cx, jsid id)
{ {
JS_ASSERT(isNative()); JS_ASSERT(isNative());
return SHAPE_FETCH(nativeSearch(id)); return SHAPE_FETCH(nativeSearch(cx, id));
} }
inline bool inline bool
JSObject::nativeContains(jsid id) JSObject::nativeContains(JSContext *cx, jsid id)
{ {
return nativeLookup(id) != NULL; return nativeLookup(cx, id) != NULL;
} }
inline bool inline bool
JSObject::nativeContains(const js::Shape &shape) JSObject::nativeContains(JSContext *cx, const js::Shape &shape)
{ {
return nativeLookup(shape.propid) == &shape; return nativeLookup(cx, shape.propid) == &shape;
} }
inline const js::Shape * inline const js::Shape *
@ -1567,7 +1567,12 @@ CopyInitializerObject(JSContext *cx, JSObject *baseobj, types::TypeObject *type)
JS_ASSERT(baseobj->getClass() == &ObjectClass); JS_ASSERT(baseobj->getClass() == &ObjectClass);
JS_ASSERT(!baseobj->inDictionaryMode()); JS_ASSERT(!baseobj->inDictionaryMode());
JSObject *obj = NewBuiltinClassInstance(cx, &ObjectClass, baseobj->getAllocKind()); gc::AllocKind kind = gc::GetGCObjectFixedSlotsKind(baseobj->numFixedSlots());
#ifdef JS_THREADSAFE
kind = gc::GetBackgroundAllocKind(kind);
#endif
JS_ASSERT(kind == baseobj->getAllocKind());
JSObject *obj = NewBuiltinClassInstance(cx, &ObjectClass, kind);
if (!obj || !obj->ensureSlots(cx, baseobj->numSlots())) if (!obj || !obj->ensureSlots(cx, baseobj->numSlots()))
return NULL; return NULL;
@ -1589,7 +1594,7 @@ DefineConstructorAndPrototype(JSContext *cx, GlobalObject *global,
JS_ASSERT(proto); JS_ASSERT(proto);
jsid id = ATOM_TO_JSID(cx->runtime->atomState.classAtoms[key]); jsid id = ATOM_TO_JSID(cx->runtime->atomState.classAtoms[key]);
JS_ASSERT(!global->nativeLookup(id)); JS_ASSERT(!global->nativeLookup(cx, id));
/* Set these first in case AddTypePropertyId looks for this class. */ /* Set these first in case AddTypePropertyId looks for this class. */
global->setSlot(key, ObjectValue(*ctor)); global->setSlot(key, ObjectValue(*ctor));

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

@ -1675,7 +1675,7 @@ DecompileDestructuring(SprintStack *ss, jsbytecode *pc, jsbytecode *endpc)
ptrdiff_t head; ptrdiff_t head;
JSContext *cx; JSContext *cx;
JSPrinter *jp; JSPrinter *jp;
JSOp op, saveop; JSOp op;
const JSCodeSpec *cs; const JSCodeSpec *cs;
uintN oplen; uintN oplen;
jsint i, lasti; jsint i, lasti;
@ -1710,7 +1710,6 @@ DecompileDestructuring(SprintStack *ss, jsbytecode *pc, jsbytecode *endpc)
#endif #endif
LOAD_OP_DATA(pc); LOAD_OP_DATA(pc);
saveop = op;
switch (op) { switch (op) {
case JSOP_POP: case JSOP_POP:

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

@ -70,7 +70,7 @@ PropertyCache::fill(JSContext *cx, JSObject *obj, uintN scopeIndex, JSObject *po
* Check for fill from js_SetPropertyHelper where the setter removed shape * Check for fill from js_SetPropertyHelper where the setter removed shape
* from pobj (via unwatch or delete, e.g.). * from pobj (via unwatch or delete, e.g.).
*/ */
if (!pobj->nativeContains(*shape)) { if (!pobj->nativeContains(cx, *shape)) {
PCMETER(oddfills++); PCMETER(oddfills++);
return JS_NO_PROP_CACHE_FILL; return JS_NO_PROP_CACHE_FILL;
} }
@ -399,7 +399,7 @@ PropertyCache::fullTest(JSContext *cx, jsbytecode *pc, JSObject **objp, JSObject
jsid id = ATOM_TO_JSID(atom); jsid id = ATOM_TO_JSID(atom);
id = js_CheckForStringIndex(id); id = js_CheckForStringIndex(id);
JS_ASSERT(pobj->nativeContains(id)); JS_ASSERT(pobj->nativeContains(cx, id));
#endif #endif
*pobjp = pobj; *pobjp = pobj;
return NULL; return NULL;

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

@ -783,17 +783,17 @@ JSObject::initRegExp(JSContext *cx, js::RegExp *re)
JS_ASSERT(!nativeEmpty()); JS_ASSERT(!nativeEmpty());
} }
JS_ASSERT(nativeLookup(ATOM_TO_JSID(cx->runtime->atomState.lastIndexAtom))->slot == JS_ASSERT(nativeLookup(cx, ATOM_TO_JSID(cx->runtime->atomState.lastIndexAtom))->slot ==
JSObject::JSSLOT_REGEXP_LAST_INDEX); JSObject::JSSLOT_REGEXP_LAST_INDEX);
JS_ASSERT(nativeLookup(ATOM_TO_JSID(cx->runtime->atomState.sourceAtom))->slot == JS_ASSERT(nativeLookup(cx, ATOM_TO_JSID(cx->runtime->atomState.sourceAtom))->slot ==
JSObject::JSSLOT_REGEXP_SOURCE); JSObject::JSSLOT_REGEXP_SOURCE);
JS_ASSERT(nativeLookup(ATOM_TO_JSID(cx->runtime->atomState.globalAtom))->slot == JS_ASSERT(nativeLookup(cx, ATOM_TO_JSID(cx->runtime->atomState.globalAtom))->slot ==
JSObject::JSSLOT_REGEXP_GLOBAL); JSObject::JSSLOT_REGEXP_GLOBAL);
JS_ASSERT(nativeLookup(ATOM_TO_JSID(cx->runtime->atomState.ignoreCaseAtom))->slot == JS_ASSERT(nativeLookup(cx, ATOM_TO_JSID(cx->runtime->atomState.ignoreCaseAtom))->slot ==
JSObject::JSSLOT_REGEXP_IGNORE_CASE); JSObject::JSSLOT_REGEXP_IGNORE_CASE);
JS_ASSERT(nativeLookup(ATOM_TO_JSID(cx->runtime->atomState.multilineAtom))->slot == JS_ASSERT(nativeLookup(cx, ATOM_TO_JSID(cx->runtime->atomState.multilineAtom))->slot ==
JSObject::JSSLOT_REGEXP_MULTILINE); JSObject::JSSLOT_REGEXP_MULTILINE);
JS_ASSERT(nativeLookup(ATOM_TO_JSID(cx->runtime->atomState.stickyAtom))->slot == JS_ASSERT(nativeLookup(cx, ATOM_TO_JSID(cx->runtime->atomState.stickyAtom))->slot ==
JSObject::JSSLOT_REGEXP_STICKY); JSObject::JSSLOT_REGEXP_STICKY);
setPrivate(re); setPrivate(re);

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

@ -170,9 +170,10 @@ PropertyTable::init(JSRuntime *rt, Shape *lastProp)
} }
bool bool
Shape::hashify(JSRuntime *rt) Shape::hashify(JSContext *cx)
{ {
JS_ASSERT(!hasTable()); JS_ASSERT(!hasTable());
JSRuntime *rt = cx->runtime;
PropertyTable *table = rt->new_<PropertyTable>(entryCount()); PropertyTable *table = rt->new_<PropertyTable>(entryCount());
if (!table) if (!table)
return false; return false;
@ -366,7 +367,7 @@ Shape::getChild(JSContext *cx, const js::Shape &child, Shape **listp)
newShape->setTable(table); newShape->setTable(table);
} else { } else {
if (!newShape->hasTable()) if (!newShape->hasTable())
newShape->hashify(cx->runtime); newShape->hashify(cx);
} }
return newShape; return newShape;
} }
@ -493,7 +494,7 @@ Shape::newDictionaryList(JSContext *cx, Shape **listp)
root->listp = listp; root->listp = listp;
JS_ASSERT(root->inDictionary()); JS_ASSERT(root->inDictionary());
root->hashify(cx->runtime); root->hashify(cx);
return root; return root;
} }
@ -635,7 +636,7 @@ JSObject::addProperty(JSContext *cx, jsid id,
NormalizeGetterAndSetter(cx, this, id, attrs, flags, getter, setter); NormalizeGetterAndSetter(cx, this, id, attrs, flags, getter, setter);
/* Search for id with adding = true in order to claim its entry. */ /* Search for id with adding = true in order to claim its entry. */
Shape **spp = nativeSearch(id, true); Shape **spp = nativeSearch(cx, id, true);
JS_ASSERT(!SHAPE_FETCH(spp)); JS_ASSERT(!SHAPE_FETCH(spp));
return addPropertyInternal(cx, id, getter, setter, slot, attrs, flags, shortid, spp); return addPropertyInternal(cx, id, getter, setter, slot, attrs, flags, shortid, spp);
} }
@ -654,7 +655,7 @@ JSObject::addPropertyInternal(JSContext *cx, jsid id,
if (lastProp->entryCount() >= PropertyTree::MAX_HEIGHT) { if (lastProp->entryCount() >= PropertyTree::MAX_HEIGHT) {
if (!toDictionaryMode(cx)) if (!toDictionaryMode(cx))
return NULL; return NULL;
spp = nativeSearch(id, true); spp = nativeSearch(cx, id, true);
table = lastProp->getTable(); table = lastProp->getTable();
} }
} else if (lastProp->hasTable()) { } else if (lastProp->hasTable()) {
@ -742,7 +743,7 @@ JSObject::putProperty(JSContext *cx, jsid id,
NormalizeGetterAndSetter(cx, this, id, attrs, flags, getter, setter); NormalizeGetterAndSetter(cx, this, id, attrs, flags, getter, setter);
/* Search for id in order to claim its entry if table has been allocated. */ /* Search for id in order to claim its entry if table has been allocated. */
Shape **spp = nativeSearch(id, true); Shape **spp = nativeSearch(cx, id, true);
Shape *shape = SHAPE_FETCH(spp); Shape *shape = SHAPE_FETCH(spp);
if (!shape) { if (!shape) {
/* /*
@ -788,7 +789,7 @@ JSObject::putProperty(JSContext *cx, jsid id,
if (shape != lastProp && !inDictionaryMode()) { if (shape != lastProp && !inDictionaryMode()) {
if (!toDictionaryMode(cx)) if (!toDictionaryMode(cx))
return NULL; return NULL;
spp = nativeSearch(shape->propid); spp = nativeSearch(cx, shape->propid);
shape = SHAPE_FETCH(spp); shape = SHAPE_FETCH(spp);
} }
@ -893,7 +894,7 @@ JSObject::changeProperty(JSContext *cx, const Shape *shape, uintN attrs, uintN m
{ {
JS_ASSERT_IF(inDictionaryMode(), !lastProp->frozen()); JS_ASSERT_IF(inDictionaryMode(), !lastProp->frozen());
JS_ASSERT(!JSID_IS_VOID(shape->propid)); JS_ASSERT(!JSID_IS_VOID(shape->propid));
JS_ASSERT(nativeContains(*shape)); JS_ASSERT(nativeContains(cx, *shape));
attrs |= shape->attrs & mask; attrs |= shape->attrs & mask;
@ -964,7 +965,7 @@ JSObject::changeProperty(JSContext *cx, const Shape *shape, uintN attrs, uintN m
if (newShape) { if (newShape) {
JS_ASSERT(newShape == lastProp); JS_ASSERT(newShape == lastProp);
if (newShape->hasTable()) { if (newShape->hasTable()) {
Shape **spp = nativeSearch(shape->propid); Shape **spp = nativeSearch(cx, shape->propid);
JS_ASSERT(SHAPE_FETCH(spp) == newShape); JS_ASSERT(SHAPE_FETCH(spp) == newShape);
} }
} }
@ -989,7 +990,7 @@ JSObject::changeProperty(JSContext *cx, const Shape *shape, uintN attrs, uintN m
bool bool
JSObject::removeProperty(JSContext *cx, jsid id) JSObject::removeProperty(JSContext *cx, jsid id)
{ {
Shape **spp = nativeSearch(id); Shape **spp = nativeSearch(cx, id);
Shape *shape = SHAPE_FETCH(spp); Shape *shape = SHAPE_FETCH(spp);
if (!shape) if (!shape)
return true; return true;
@ -1006,7 +1007,7 @@ JSObject::removeProperty(JSContext *cx, jsid id)
if (shape != lastProp && !inDictionaryMode()) { if (shape != lastProp && !inDictionaryMode()) {
if (!toDictionaryMode(cx)) if (!toDictionaryMode(cx))
return false; return false;
spp = nativeSearch(shape->propid); spp = nativeSearch(cx, shape->propid);
shape = SHAPE_FETCH(spp); shape = SHAPE_FETCH(spp);
} }
@ -1036,7 +1037,7 @@ JSObject::removeProperty(JSContext *cx, jsid id)
*/ */
const Shape *aprop = lastProp; const Shape *aprop = lastProp;
for (int n = 50; --n >= 0 && aprop->parent; aprop = aprop->parent) for (int n = 50; --n >= 0 && aprop->parent; aprop = aprop->parent)
JS_ASSERT_IF(aprop != shape, nativeContains(*aprop)); JS_ASSERT_IF(aprop != shape, nativeContains(cx, *aprop));
#endif #endif
} }
} }

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

@ -367,7 +367,7 @@ struct Shape : public js::gc::Cell
else to obj->lastProp */ else to obj->lastProp */
}; };
static inline js::Shape **search(JSRuntime *rt, js::Shape **startp, jsid id, static inline js::Shape **search(JSContext *cx, js::Shape **startp, jsid id,
bool adding = false); bool adding = false);
static js::Shape *newDictionaryShape(JSContext *cx, const js::Shape &child, js::Shape **listp); static js::Shape *newDictionaryShape(JSContext *cx, const js::Shape &child, js::Shape **listp);
static js::Shape *newDictionaryList(JSContext *cx, js::Shape **listp); static js::Shape *newDictionaryList(JSContext *cx, js::Shape **listp);
@ -377,7 +377,7 @@ struct Shape : public js::gc::Cell
js::Shape *getChild(JSContext *cx, const js::Shape &child, js::Shape **listp); js::Shape *getChild(JSContext *cx, const js::Shape &child, js::Shape **listp);
bool hashify(JSRuntime *rt); bool hashify(JSContext *cx);
void setTable(js::PropertyTable *t) const { void setTable(js::PropertyTable *t) const {
JS_ASSERT_IF(t && t->freelist != SHAPE_INVALID_SLOT, t->freelist < slotSpan); JS_ASSERT_IF(t && t->freelist != SHAPE_INVALID_SLOT, t->freelist < slotSpan);
@ -704,14 +704,14 @@ js_GenerateShape(JSContext *cx);
namespace js { namespace js {
JS_ALWAYS_INLINE js::Shape ** JS_ALWAYS_INLINE js::Shape **
Shape::search(JSRuntime *rt, js::Shape **startp, jsid id, bool adding) Shape::search(JSContext *cx, js::Shape **startp, jsid id, bool adding)
{ {
js::Shape *start = *startp; js::Shape *start = *startp;
if (start->hasTable()) if (start->hasTable())
return start->getTable()->search(id, adding); return start->getTable()->search(id, adding);
if (start->numLinearSearches == PropertyTable::MAX_LINEAR_SEARCHES) { if (start->numLinearSearches == PropertyTable::MAX_LINEAR_SEARCHES) {
if (start->hashify(rt)) if (start->hashify(cx))
return start->getTable()->search(id, adding); return start->getTable()->search(id, adding);
/* OOM! Don't increment numLinearSearches, to keep hasTable() false. */ /* OOM! Don't increment numLinearSearches, to keep hasTable() false. */
JS_ASSERT(!start->hasTable()); JS_ASSERT(!start->hasTable());

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

@ -164,7 +164,7 @@ StringObject::init(JSContext *cx, JSString *str)
} }
JS_ASSERT(*shapep == lastProperty()); JS_ASSERT(*shapep == lastProperty());
JS_ASSERT(!nativeEmpty()); JS_ASSERT(!nativeEmpty());
JS_ASSERT(nativeLookup(ATOM_TO_JSID(cx->runtime->atomState.lengthAtom))->slot == LENGTH_SLOT); JS_ASSERT(nativeLookup(cx, ATOM_TO_JSID(cx->runtime->atomState.lengthAtom))->slot == LENGTH_SLOT);
setStringThis(str); setStringThis(str);
return true; return true;

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

@ -88,7 +88,7 @@ Bindings::lookup(JSContext *cx, JSAtom *name, uintN *indexp) const
return NONE; return NONE;
Shape *shape = Shape *shape =
SHAPE_FETCH(Shape::search(cx->runtime, const_cast<Shape **>(&lastBinding), SHAPE_FETCH(Shape::search(cx, const_cast<Shape **>(&lastBinding),
ATOM_TO_JSID(name))); ATOM_TO_JSID(name)));
if (!shape) if (!shape)
return NONE; return NONE;

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

@ -11556,7 +11556,7 @@ TraceRecorder::callNative(uintN argc, JSOp mode)
if (js_GetClassPrototype(cx, NULL, JSProto_RegExp, &proto)) { if (js_GetClassPrototype(cx, NULL, JSProto_RegExp, &proto)) {
Value pval; Value pval;
jsid id = ATOM_TO_JSID(cx->runtime->atomState.testAtom); jsid id = ATOM_TO_JSID(cx->runtime->atomState.testAtom);
if (HasDataProperty(proto, id, &pval) && if (HasDataProperty(cx, proto, id, &pval) &&
IsNativeFunction(pval, js_regexp_test)) IsNativeFunction(pval, js_regexp_test))
{ {
vp[0] = pval; vp[0] = pval;
@ -12065,7 +12065,7 @@ SafeLookup(JSContext *cx, JSObject* obj, jsid id, JSObject** pobjp, const Shape*
if (obj->getOps()->lookupProperty) if (obj->getOps()->lookupProperty)
return false; return false;
if (const Shape *shape = obj->nativeLookup(id)) { if (const Shape *shape = obj->nativeLookup(cx, id)) {
*pobjp = obj; *pobjp = obj;
*shapep = shape; *shapep = shape;
return true; return true;
@ -12136,7 +12136,7 @@ TraceRecorder::nativeSet(JSObject* obj, LIns* obj_ins, const Shape* shape,
{ {
uint32 slot = shape->slot; uint32 slot = shape->slot;
JS_ASSERT((slot != SHAPE_INVALID_SLOT) == shape->hasSlot()); JS_ASSERT((slot != SHAPE_INVALID_SLOT) == shape->hasSlot());
JS_ASSERT_IF(shape->hasSlot(), obj->nativeContains(*shape)); JS_ASSERT_IF(shape->hasSlot(), obj->nativeContains(cx, *shape));
/* /*
* We do not trace assignment to properties that have both a non-default * We do not trace assignment to properties that have both a non-default
@ -12181,7 +12181,7 @@ TraceRecorder::nativeSet(JSObject* obj, LIns* obj_ins, const Shape* shape,
// Because the trace is type-specialized to the global object's // Because the trace is type-specialized to the global object's
// slots, no run-time check is needed. Avoid recording a global // slots, no run-time check is needed. Avoid recording a global
// shape change, though. // shape change, though.
JS_ASSERT(obj->nativeContains(*shape)); JS_ASSERT(obj->nativeContains(cx, *shape));
if (IsFunctionObject(obj->getSlot(slot))) if (IsFunctionObject(obj->getSlot(slot)))
RETURN_STOP("can't trace set of function-valued global property"); RETURN_STOP("can't trace set of function-valued global property");
} else { } else {
@ -12521,7 +12521,7 @@ TraceRecorder::recordInitPropertyOp(jsbytecode op)
// shape or because the id appears more than once in the initializer), just // shape or because the id appears more than once in the initializer), just
// set it. The existing property can't be an accessor property: we wouldn't // set it. The existing property can't be an accessor property: we wouldn't
// get here, as JSOP_SETTER can't be recorded. // get here, as JSOP_SETTER can't be recorded.
if (const Shape* shape = obj->nativeLookup(id)) { if (const Shape* shape = obj->nativeLookup(cx, id)) {
// Don't assign a bare (non-cloned) function to an ordinary or method // Don't assign a bare (non-cloned) function to an ordinary or method
// property. The opposite case, assigning some other value to a method, // property. The opposite case, assigning some other value to a method,
// is OK. nativeSet emits code that trips the write barrier. // is OK. nativeSet emits code that trips the write barrier.
@ -14179,7 +14179,7 @@ TraceRecorder::propTail(JSObject* obj, LIns* obj_ins, JSObject* obj2, PCVal pcva
if (pcval.isShape()) { if (pcval.isShape()) {
shape = pcval.toShape(); shape = pcval.toShape();
JS_ASSERT(obj2->nativeContains(*shape)); JS_ASSERT(obj2->nativeContains(cx, *shape));
if (setflags && !shape->hasDefaultSetter()) if (setflags && !shape->hasDefaultSetter())
RETURN_STOP("non-stub setter"); RETURN_STOP("non-stub setter");

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

@ -144,7 +144,7 @@ WatchpointMap::triggerWatchpoint(JSContext *cx, JSObject *obj, jsid id, Value *v
Value old; Value old;
old.setUndefined(); old.setUndefined();
if (obj->isNative()) { if (obj->isNative()) {
if (const Shape *shape = obj->nativeLookup(id)) { if (const Shape *shape = obj->nativeLookup(cx, id)) {
uint32 slot = shape->slot; uint32 slot = shape->slot;
if (obj->containsSlot(slot)) { if (obj->containsSlot(slot)) {
if (shape->isMethod()) { if (shape->isMethod()) {
@ -157,7 +157,7 @@ WatchpointMap::triggerWatchpoint(JSContext *cx, JSObject *obj, jsid id, Value *v
Value method = ObjectValue(shape->methodObject()); Value method = ObjectValue(shape->methodObject());
if (!obj->methodReadBarrier(cx, *shape, &method)) if (!obj->methodReadBarrier(cx, *shape, &method))
return false; return false;
shape = obj->nativeLookup(id); shape = obj->nativeLookup(cx, id);
JS_ASSERT(shape->isDataDescriptor()); JS_ASSERT(shape->isDataDescriptor());
JS_ASSERT(!shape->isMethod()); JS_ASSERT(!shape->isMethod());
old = method; old = method;

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

@ -259,7 +259,7 @@ mjit::Compiler::scanInlineCalls(uint32 index, uint32 depth)
continue; continue;
/* Not inlining at monitored call sites or those with type barriers. */ /* Not inlining at monitored call sites or those with type barriers. */
if (code->monitoredTypes || code->monitoredTypesReturn || analysis->typeBarriers(pc) != NULL) if (code->monitoredTypes || code->monitoredTypesReturn || analysis->typeBarriers(cx, pc) != NULL)
continue; continue;
uint32 argc = GET_ARGC(pc); uint32 argc = GET_ARGC(pc);
@ -5927,7 +5927,7 @@ mjit::Compiler::jsop_getgname(uint32 index)
* then bake its address into the jitcode and guard against future * then bake its address into the jitcode and guard against future
* reallocation of the global object's slots. * reallocation of the global object's slots.
*/ */
const js::Shape *shape = globalObj->nativeLookup(ATOM_TO_JSID(atom)); const js::Shape *shape = globalObj->nativeLookup(cx, ATOM_TO_JSID(atom));
if (shape && shape->hasDefaultGetterOrIsMethod() && shape->hasSlot()) { if (shape && shape->hasDefaultGetterOrIsMethod() && shape->hasSlot()) {
Value *value = &globalObj->getSlotRef(shape->slot); Value *value = &globalObj->getSlotRef(shape->slot);
if (!value->isUndefined() && if (!value->isUndefined() &&
@ -6150,7 +6150,7 @@ mjit::Compiler::jsop_setgname(JSAtom *atom, bool usePropertyCache, bool popGuara
types::TypeSet *types = globalObj->getType(cx)->getProperty(cx, id, false); types::TypeSet *types = globalObj->getType(cx)->getProperty(cx, id, false);
if (!types) if (!types)
return; return;
const js::Shape *shape = globalObj->nativeLookup(ATOM_TO_JSID(atom)); const js::Shape *shape = globalObj->nativeLookup(cx, ATOM_TO_JSID(atom));
if (shape && !shape->isMethod() && shape->hasDefaultSetter() && if (shape && !shape->isMethod() && shape->hasDefaultSetter() &&
shape->writable() && shape->hasSlot() && shape->writable() && shape->hasSlot() &&
!types->isOwnProperty(cx, globalObj->getType(cx), true)) { !types->isOwnProperty(cx, globalObj->getType(cx), true)) {
@ -7241,7 +7241,7 @@ mjit::Compiler::hasTypeBarriers(jsbytecode *pc)
return js_CodeSpec[*pc].format & JOF_TYPESET; return js_CodeSpec[*pc].format & JOF_TYPESET;
#endif #endif
return analysis->typeBarriers(pc) != NULL; return analysis->typeBarriers(cx, pc) != NULL;
} }
void void

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

@ -662,8 +662,6 @@ mjit::Compiler::jsop_binary_full(FrameEntry *lhs, FrameEntry *rhs, JSOp op,
case JSOP_MUL: case JSOP_MUL:
{ {
JS_ASSERT(reg.isSet());
MaybeJump storeNegZero; MaybeJump storeNegZero;
bool maybeNegZero = !ignoreOverflow; bool maybeNegZero = !ignoreOverflow;
bool hasConstant = (lhs->isConstant() || rhs->isConstant()); bool hasConstant = (lhs->isConstant() || rhs->isConstant());
@ -680,10 +678,19 @@ mjit::Compiler::jsop_binary_full(FrameEntry *lhs, FrameEntry *rhs, JSOp op,
storeNegZero = masm.branch32(Assembler::LessThan, nonConstReg, Imm32(0)); storeNegZero = masm.branch32(Assembler::LessThan, nonConstReg, Imm32(0));
} }
if (cannotOverflow) if (cannotOverflow) {
if (reg.isSet())
masm.mul32(reg.reg(), regs.result); masm.mul32(reg.reg(), regs.result);
else else
masm.mul32(Imm32(value), regs.result, regs.result);
} else {
if (reg.isSet()) {
overflow = masm.branchMul32(Assembler::Overflow, reg.reg(), regs.result); overflow = masm.branchMul32(Assembler::Overflow, reg.reg(), regs.result);
} else {
overflow = masm.branchMul32(Assembler::Overflow, Imm32(value), regs.result,
regs.result);
}
}
if (maybeNegZero) { if (maybeNegZero) {
if (hasConstant) { if (hasConstant) {

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

@ -2653,9 +2653,8 @@ FrameState::allocForBinary(FrameEntry *lhs, FrameEntry *rhs, JSOp op, BinaryAllo
} }
/* /*
* Data is a little more complicated. If the op is MUL, not all CPUs * Allocate data registers. If the op is not commutative, the LHS
* have multiplication on immediates, so a register is needed. Also, * _must_ be in a register.
* if the op is not commutative, the LHS _must_ be in a register.
*/ */
JS_ASSERT_IF(lhs->isConstant(), !rhs->isConstant()); JS_ASSERT_IF(lhs->isConstant(), !rhs->isConstant());
JS_ASSERT_IF(rhs->isConstant(), !lhs->isConstant()); JS_ASSERT_IF(rhs->isConstant(), !lhs->isConstant());
@ -2664,23 +2663,16 @@ FrameState::allocForBinary(FrameEntry *lhs, FrameEntry *rhs, JSOp op, BinaryAllo
if (backingLeft->data.inMemory()) { if (backingLeft->data.inMemory()) {
alloc.lhsData = tempRegForData(lhs); alloc.lhsData = tempRegForData(lhs);
pinReg(alloc.lhsData.reg()); pinReg(alloc.lhsData.reg());
} else if (op == JSOP_MUL || !commu) { } else if (!commu) {
JS_ASSERT(lhs->isConstant()); JS_ASSERT(lhs->isConstant());
alloc.lhsData = allocReg(); alloc.lhsData = allocReg();
alloc.extraFree = alloc.lhsData; alloc.extraFree = alloc.lhsData;
masm.move(Imm32(lhs->getValue().toInt32()), alloc.lhsData.reg()); masm.move(Imm32(lhs->getValue().toInt32()), alloc.lhsData.reg());
} }
} }
if (!alloc.rhsData.isSet()) { if (!alloc.rhsData.isSet() && backingRight->data.inMemory()) {
if (backingRight->data.inMemory()) {
alloc.rhsData = tempRegForData(rhs); alloc.rhsData = tempRegForData(rhs);
pinReg(alloc.rhsData.reg()); pinReg(alloc.rhsData.reg());
} else if (op == JSOP_MUL) {
JS_ASSERT(rhs->isConstant());
alloc.rhsData = allocReg();
alloc.extraFree = alloc.rhsData;
masm.move(Imm32(rhs->getValue().toInt32()), alloc.rhsData.reg());
}
} }
alloc.lhsNeedsRemat = false; alloc.lhsNeedsRemat = false;

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

@ -87,7 +87,7 @@ ic::GetGlobalName(VMFrame &f, ic::GetGlobalNameIC *ic)
JSAtom *atom = f.script()->getAtom(GET_INDEX(f.pc())); JSAtom *atom = f.script()->getAtom(GET_INDEX(f.pc()));
jsid id = ATOM_TO_JSID(atom); jsid id = ATOM_TO_JSID(atom);
const Shape *shape = obj->nativeLookup(id); const Shape *shape = obj->nativeLookup(f.cx, id);
if (!shape || if (!shape ||
!shape->hasDefaultGetterOrIsMethod() || !shape->hasDefaultGetterOrIsMethod() ||
!shape->hasSlot()) !shape->hasSlot())
@ -322,7 +322,7 @@ ic::SetGlobalName(VMFrame &f, ic::SetGlobalNameIC *ic)
JSObject *obj = f.fp()->scopeChain().getGlobal(); JSObject *obj = f.fp()->scopeChain().getGlobal();
JSScript *script = f.script(); JSScript *script = f.script();
JSAtom *atom = script->getAtom(GET_INDEX(f.pc())); JSAtom *atom = script->getAtom(GET_INDEX(f.pc()));
const Shape *shape = obj->nativeLookup(ATOM_TO_JSID(atom)); const Shape *shape = obj->nativeLookup(f.cx, ATOM_TO_JSID(atom));
LookupStatus status = UpdateSetGlobalName(f, ic, obj, shape); LookupStatus status = UpdateSetGlobalName(f, ic, obj, shape);
if (status == Lookup_Error) if (status == Lookup_Error)

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

@ -182,9 +182,9 @@ stubs::SetName(VMFrame &f, JSAtom *origAtom)
{ {
#ifdef DEBUG #ifdef DEBUG
if (entry->directHit()) { if (entry->directHit()) {
JS_ASSERT(obj->nativeContains(*shape)); JS_ASSERT(obj->nativeContains(cx, *shape));
} else { } else {
JS_ASSERT(obj2->nativeContains(*shape)); JS_ASSERT(obj2->nativeContains(cx, *shape));
JS_ASSERT(entry->vcapTag() == 1); JS_ASSERT(entry->vcapTag() == 1);
JS_ASSERT(entry->kshape != entry->vshape()); JS_ASSERT(entry->kshape != entry->vshape());
JS_ASSERT(!shape->hasSlot()); JS_ASSERT(!shape->hasSlot());

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

@ -175,6 +175,7 @@ XPC_MSG_DEF(NS_ERROR_IN_PROGRESS , "The requested action coul
XPC_MSG_DEF(NS_ERROR_ALREADY_OPENED , "Channel is already open") XPC_MSG_DEF(NS_ERROR_ALREADY_OPENED , "Channel is already open")
XPC_MSG_DEF(NS_ERROR_INVALID_CONTENT_ENCODING , "The content encoding of the source document is incorrect") XPC_MSG_DEF(NS_ERROR_INVALID_CONTENT_ENCODING , "The content encoding of the source document is incorrect")
XPC_MSG_DEF(NS_ERROR_CORRUPTED_CONTENT , "Corrupted content was received from server") XPC_MSG_DEF(NS_ERROR_CORRUPTED_CONTENT , "Corrupted content was received from server")
XPC_MSG_DEF(NS_ERROR_FIRST_HEADER_FIELD_COMPONENT_EMPTY, "Couldn't extract first component from potentially corrupted header field")
XPC_MSG_DEF(NS_ERROR_ALREADY_CONNECTED , "The connection is already established") XPC_MSG_DEF(NS_ERROR_ALREADY_CONNECTED , "The connection is already established")
XPC_MSG_DEF(NS_ERROR_NOT_CONNECTED , "The connection does not exist") XPC_MSG_DEF(NS_ERROR_NOT_CONNECTED , "The connection does not exist")
XPC_MSG_DEF(NS_ERROR_CONNECTION_REFUSED , "The connection was refused") XPC_MSG_DEF(NS_ERROR_CONNECTION_REFUSED , "The connection was refused")

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

@ -1910,6 +1910,11 @@ nsCSSFrameConstructor::ConstructTable(nsFrameConstructorState& aState,
else else
innerFrame = NS_NewTableFrame(mPresShell, styleContext); innerFrame = NS_NewTableFrame(mPresShell, styleContext);
if (!innerFrame) {
newFrame->Destroy();
return NS_ERROR_OUT_OF_MEMORY;
}
InitAndRestoreFrame(aState, content, newFrame, nsnull, innerFrame); InitAndRestoreFrame(aState, content, newFrame, nsnull, innerFrame);
// Put the newly created frames into the right child list // Put the newly created frames into the right child list
@ -2479,9 +2484,9 @@ nsCSSFrameConstructor::ConstructDocElementFrame(Element* aDocEle
// Figure out which frame has the main style for the document element, // Figure out which frame has the main style for the document element,
// assigning it to mRootElementStyleFrame. // assigning it to mRootElementStyleFrame.
// Backgrounds should be propagated from that frame to the viewport. // Backgrounds should be propagated from that frame to the viewport.
PRBool isChild; mRootElementStyleFrame = contentFrame->GetParentStyleContextFrame();
contentFrame->GetParentStyleContextFrame(state.mPresContext, bool isChild = mRootElementStyleFrame &&
&mRootElementStyleFrame, &isChild); mRootElementStyleFrame->GetParent() == contentFrame;
if (!isChild) { if (!isChild) {
mRootElementStyleFrame = mRootElementFrame; mRootElementStyleFrame = mRootElementFrame;
} }
@ -5788,13 +5793,8 @@ nsCSSFrameConstructor::IsValidSibling(nsIFrame* aSibling,
// if we haven't already, construct a style context to find the display type of aContent // if we haven't already, construct a style context to find the display type of aContent
if (UNSET_DISPLAY == aDisplay) { if (UNSET_DISPLAY == aDisplay) {
nsRefPtr<nsStyleContext> styleContext; nsRefPtr<nsStyleContext> styleContext;
nsIFrame* styleParent; nsIFrame* styleParent = aSibling->GetParentStyleContextFrame();
PRBool providerIsChild; if (!styleParent) {
if (NS_FAILED(aSibling->
GetParentStyleContextFrame(aSibling->PresContext(),
&styleParent,
&providerIsChild)) ||
!styleParent) {
NS_NOTREACHED("Shouldn't happen"); NS_NOTREACHED("Shouldn't happen");
return PR_FALSE; return PR_FALSE;
} }
@ -6680,11 +6680,9 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
if (captionItems.NotEmpty()) { // append the caption to the outer table if (captionItems.NotEmpty()) { // append the caption to the outer table
NS_ASSERTION(nsGkAtoms::tableFrame == frameType, "how did that happen?"); NS_ASSERTION(nsGkAtoms::tableFrame == frameType, "how did that happen?");
nsIFrame* outerTable = parentFrame->GetParent(); nsIFrame* outerTable = parentFrame->GetParent();
if (outerTable) {
state.mFrameManager->AppendFrames(outerTable, nsIFrame::kCaptionList, state.mFrameManager->AppendFrames(outerTable, nsIFrame::kCaptionList,
captionItems); captionItems);
} }
}
if (frameItems.NotEmpty()) { // append the in-flow kids if (frameItems.NotEmpty()) { // append the in-flow kids
AppendFrames(state, parentFrame, frameItems, prevSibling); AppendFrames(state, parentFrame, frameItems, prevSibling);

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

@ -587,10 +587,7 @@ VerifyContextParent(nsPresContext* aPresContext, nsIFrame* aFrame,
// as the parent context instead of asking the frame // as the parent context instead of asking the frame
// get the parent context from the frame (indirectly) // get the parent context from the frame (indirectly)
nsIFrame* providerFrame = nsnull; nsIFrame* providerFrame = aFrame->GetParentStyleContextFrame();
PRBool providerIsChild;
aFrame->GetParentStyleContextFrame(aPresContext,
&providerFrame, &providerIsChild);
if (providerFrame) if (providerFrame)
aParentContext = providerFrame->GetStyleContext(); aParentContext = providerFrame->GetStyleContext();
// aParentContext could still be null // aParentContext could still be null
@ -808,13 +805,11 @@ nsFrameManager::ReparentStyleContext(nsIFrame* aFrame)
// XXXbz can oldContext really ever be null? // XXXbz can oldContext really ever be null?
if (oldContext) { if (oldContext) {
nsRefPtr<nsStyleContext> newContext; nsRefPtr<nsStyleContext> newContext;
nsIFrame* providerFrame = nsnull; nsIFrame* providerFrame = aFrame->GetParentStyleContextFrame();
PRBool providerIsChild = PR_FALSE; bool isChild = providerFrame && providerFrame->GetParent() == aFrame;
nsIFrame* providerChild = nsnull;
aFrame->GetParentStyleContextFrame(GetPresContext(), &providerFrame,
&providerIsChild);
nsStyleContext* newParentContext = nsnull; nsStyleContext* newParentContext = nsnull;
if (providerIsChild) { nsIFrame* providerChild = nsnull;
if (isChild) {
ReparentStyleContext(providerFrame); ReparentStyleContext(providerFrame);
newParentContext = providerFrame->GetStyleContext(); newParentContext = providerFrame->GetStyleContext();
providerChild = providerFrame; providerChild = providerFrame;
@ -1107,11 +1102,9 @@ nsFrameManager::ReResolveStyleContext(nsPresContext *aPresContext,
nsIFrame* resolvedChild = nsnull; nsIFrame* resolvedChild = nsnull;
// Get the frame providing the parent style context. If it is a // Get the frame providing the parent style context. If it is a
// child, then resolve the provider first. // child, then resolve the provider first.
nsIFrame* providerFrame = nsnull; nsIFrame* providerFrame = aFrame->GetParentStyleContextFrame();
PRBool providerIsChild = PR_FALSE; bool isChild = providerFrame && providerFrame->GetParent() == aFrame;
aFrame->GetParentStyleContextFrame(aPresContext, if (!isChild) {
&providerFrame, &providerIsChild);
if (!providerIsChild) {
if (providerFrame) if (providerFrame)
parentContext = providerFrame->GetStyleContext(); parentContext = providerFrame->GetStyleContext();
else else

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

@ -6520,15 +6520,6 @@ nsFrame::ConsiderChildOverflow(nsOverflowAreas& aOverflowAreas,
} }
} }
NS_IMETHODIMP
nsFrame::GetParentStyleContextFrame(nsPresContext* aPresContext,
nsIFrame** aProviderFrame,
PRBool* aIsChild)
{
return DoGetParentStyleContextFrame(aPresContext, aProviderFrame, aIsChild);
}
/** /**
* This function takes a "special" frame and _if_ that frame is an anonymous * This function takes a "special" frame and _if_ that frame is an anonymous
* block created by an ib split it returns the block's preceding inline. This * block created by an ib split it returns the block's preceding inline. This
@ -6575,26 +6566,22 @@ GetIBSpecialSiblingForAnonymousBlock(nsIFrame* aFrame)
* Also skip anonymous scrolled-content parents; inherit directly from the * Also skip anonymous scrolled-content parents; inherit directly from the
* outer scroll frame. * outer scroll frame.
*/ */
static nsresult static nsIFrame*
GetCorrectedParent(nsPresContext* aPresContext, nsIFrame* aFrame, GetCorrectedParent(const nsIFrame* aFrame)
nsIFrame** aSpecialParent)
{ {
nsIFrame *parent = aFrame->GetParent(); nsIFrame *parent = aFrame->GetParent();
if (!parent) { if (!parent) {
*aSpecialParent = nsnull; return nsnull;
} else { }
nsIAtom* pseudo = aFrame->GetStyleContext()->GetPseudo();
// Outer tables are always anon boxes; if we're in here for an outer // Outer tables are always anon boxes; if we're in here for an outer
// table, that actually means its the _inner_ table that wants to // table, that actually means its the _inner_ table that wants to
// know its parent. So get the pseudo of the inner in that case. // know its parent. So get the pseudo of the inner in that case.
nsIAtom* pseudo = aFrame->GetStyleContext()->GetPseudo();
if (pseudo == nsCSSAnonBoxes::tableOuter) { if (pseudo == nsCSSAnonBoxes::tableOuter) {
pseudo = aFrame->GetFirstPrincipalChild() pseudo = aFrame->GetFirstPrincipalChild()->GetStyleContext()->GetPseudo();
->GetStyleContext()->GetPseudo();
} }
*aSpecialParent = nsFrame::CorrectStyleParentFrame(parent, pseudo); return nsFrame::CorrectStyleParentFrame(parent, pseudo);
}
return NS_OK;
} }
/* static */ /* static */
@ -6659,17 +6646,13 @@ nsFrame::CorrectStyleParentFrame(nsIFrame* aProspectiveParent,
return nsnull; return nsnull;
} }
nsresult nsIFrame*
nsFrame::DoGetParentStyleContextFrame(nsPresContext* aPresContext, nsFrame::DoGetParentStyleContextFrame()
nsIFrame** aProviderFrame,
PRBool* aIsChild)
{ {
*aIsChild = PR_FALSE;
*aProviderFrame = nsnull;
if (mContent && !mContent->GetParent() && if (mContent && !mContent->GetParent() &&
!GetStyleContext()->GetPseudo()) { !GetStyleContext()->GetPseudo()) {
// we're a frame for the root. We have no style context parent. // we're a frame for the root. We have no style context parent.
return NS_OK; return nsnull;
} }
if (!(mState & NS_FRAME_OUT_OF_FLOW)) { if (!(mState & NS_FRAME_OUT_OF_FLOW)) {
@ -6679,17 +6662,16 @@ nsFrame::DoGetParentStyleContextFrame(nsPresContext* aPresContext,
* inline. We can get to it using GetIBSpecialSiblingForAnonymousBlock. * inline. We can get to it using GetIBSpecialSiblingForAnonymousBlock.
*/ */
if (mState & NS_FRAME_IS_SPECIAL) { if (mState & NS_FRAME_IS_SPECIAL) {
*aProviderFrame = GetIBSpecialSiblingForAnonymousBlock(this); nsIFrame* specialSibling = GetIBSpecialSiblingForAnonymousBlock(this);
if (specialSibling) {
if (*aProviderFrame) { return specialSibling;
return NS_OK;
} }
} }
// If this frame is one of the blocks that split an inline, we must // If this frame is one of the blocks that split an inline, we must
// return the "special" inline parent, i.e., the parent that this // return the "special" inline parent, i.e., the parent that this
// frame would have if we didn't mangle the frame structure. // frame would have if we didn't mangle the frame structure.
return GetCorrectedParent(aPresContext, this, aProviderFrame); return GetCorrectedParent(this);
} }
// For out-of-flow frames, we must resolve underneath the // For out-of-flow frames, we must resolve underneath the
@ -6701,22 +6683,15 @@ nsFrame::DoGetParentStyleContextFrame(nsPresContext* aPresContext,
// have placeholders. Use their first-in-flow's placeholder. // have placeholders. Use their first-in-flow's placeholder.
oofFrame = oofFrame->GetFirstInFlow(); oofFrame = oofFrame->GetFirstInFlow();
} }
nsIFrame *placeholder = nsIFrame* placeholder = oofFrame->PresContext()->FrameManager()->
aPresContext->FrameManager()->GetPlaceholderFrameFor(oofFrame); GetPlaceholderFrameFor(oofFrame);
if (!placeholder) { if (!placeholder) {
NS_NOTREACHED("no placeholder frame for out-of-flow frame"); NS_NOTREACHED("no placeholder frame for out-of-flow frame");
GetCorrectedParent(aPresContext, this, aProviderFrame); return GetCorrectedParent(this);
return NS_ERROR_FAILURE;
} }
return static_cast<nsFrame*>(placeholder)-> return placeholder->GetParentStyleContextFrame();
GetParentStyleContextFrame(aPresContext, aProviderFrame, aIsChild);
} }
//-----------------------------------------------------------------------------------
void void
nsFrame::GetLastLeaf(nsPresContext* aPresContext, nsIFrame **aFrame) nsFrame::GetLastLeaf(nsPresContext* aPresContext, nsIFrame **aFrame)
{ {

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

@ -268,9 +268,18 @@ public:
virtual already_AddRefed<nsAccessible> CreateAccessible(); virtual already_AddRefed<nsAccessible> CreateAccessible();
#endif #endif
NS_IMETHOD GetParentStyleContextFrame(nsPresContext* aPresContext, virtual nsIFrame* GetParentStyleContextFrame() {
nsIFrame** aProviderFrame, return DoGetParentStyleContextFrame();
PRBool* aIsChild); }
/**
* Do the work for getting the parent style context frame so that
* other frame's |GetParentStyleContextFrame| methods can call this
* method on *another* frame. (This function handles out-of-flow
* frames by using the frame manager's placeholder map and it also
* handles block-within-inline and generated content wrappers.)
*/
nsIFrame* DoGetParentStyleContextFrame();
virtual PRBool IsEmpty(); virtual PRBool IsEmpty();
virtual PRBool IsSelfEmpty(); virtual PRBool IsSelfEmpty();
@ -399,15 +408,6 @@ public:
nsHTMLReflowMetrics& aMetrics, nsHTMLReflowMetrics& aMetrics,
nsReflowStatus& aStatus); nsReflowStatus& aStatus);
// Do the work for getting the parent style context frame so that
// other frame's |GetParentStyleContextFrame| methods can call this
// method on *another* frame. (This function handles out-of-flow
// frames by using the frame manager's placeholder map and it also
// handles block-within-inline and generated content wrappers.)
nsresult DoGetParentStyleContextFrame(nsPresContext* aPresContext,
nsIFrame** aProviderFrame,
PRBool* aIsChild);
// Incorporate the child overflow areas into aOverflowAreas. // Incorporate the child overflow areas into aOverflowAreas.
// If the child does not have a overflow, use the child area. // If the child does not have a overflow, use the child area.
void ConsiderChildOverflow(nsOverflowAreas& aOverflowAreas, void ConsiderChildOverflow(nsOverflowAreas& aOverflowAreas,

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

@ -2396,19 +2396,11 @@ public:
* this frame returns a child frame, then the child frame must be sure * this frame returns a child frame, then the child frame must be sure
* to return a grandparent or higher! * to return a grandparent or higher!
* *
* @param aPresContext: PresContext * @return The frame whose style context should be the parent of this frame's
* @param aProviderFrame: The frame whose style context should be the * style context. Null is permitted, and means that this frame's
* parent of this frame's style context. Null * style context should be the root of the style context tree.
* is permitted, and means that this frame's
* style context should be the root of the
* style context tree.
* @param aIsChild: True if |aProviderFrame| is set to a child
* of this frame; false if it is an ancestor or
* null.
*/ */
NS_IMETHOD GetParentStyleContextFrame(nsPresContext* aPresContext, virtual nsIFrame* GetParentStyleContextFrame() = 0;
nsIFrame** aProviderFrame,
PRBool* aIsChild) = 0;
/** /**
* Determines whether a frame is visible for painting; * Determines whether a frame is visible for painting;

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

@ -191,20 +191,15 @@ nsPlaceholderFrame::CanContinueTextRun() const
return mOutOfFlowFrame->CanContinueTextRun(); return mOutOfFlowFrame->CanContinueTextRun();
} }
NS_IMETHODIMP nsIFrame*
nsPlaceholderFrame::GetParentStyleContextFrame(nsPresContext* aPresContext, nsPlaceholderFrame::GetParentStyleContextFrame()
nsIFrame** aProviderFrame,
PRBool* aIsChild)
{ {
NS_PRECONDITION(GetParent(), "How can we not have a parent here?"); NS_PRECONDITION(GetParent(), "How can we not have a parent here?");
*aIsChild = PR_FALSE;
// Lie about our pseudo so we can step out of all anon boxes and // Lie about our pseudo so we can step out of all anon boxes and
// pseudo-elements. The other option would be to reimplement the // pseudo-elements. The other option would be to reimplement the
// {ib} split gunk here. // {ib} split gunk here.
*aProviderFrame = return CorrectStyleParentFrame(GetParent(), nsGkAtoms::placeholderFrame);
CorrectStyleParentFrame(GetParent(), nsGkAtoms::placeholderFrame);
return NS_OK;
} }

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

@ -174,9 +174,8 @@ public:
} }
#endif #endif
NS_IMETHOD GetParentStyleContextFrame(nsPresContext* aPresContext, virtual nsIFrame* GetParentStyleContextFrame();
nsIFrame** aProviderFrame,
PRBool* aIsChild);
/** /**
* @return the out-of-flow for aFrame if aFrame is a placeholder; otherwise * @return the out-of-flow for aFrame if aFrame is a placeholder; otherwise
* aFrame * aFrame

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

@ -198,8 +198,7 @@ function openSubmenu()
synthesizeKey("5", {}); synthesizeKey("5", {});
} }
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForFocus(doTest);
addLoadEvent(doTest);
]]></script> ]]></script>
</window> </window>

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

@ -458,8 +458,8 @@ nsMathMLmtableOuterFrame::AttributeChanged(PRInt32 aNameSpaceID,
// mtable is simple and only has one (pseudo) row-group inside our inner-table // mtable is simple and only has one (pseudo) row-group inside our inner-table
nsIFrame* tableFrame = mFrames.FirstChild(); nsIFrame* tableFrame = mFrames.FirstChild();
if (!tableFrame || tableFrame->GetType() != nsGkAtoms::tableFrame) NS_ASSERTION(tableFrame && tableFrame->GetType() == nsGkAtoms::tableFrame,
return NS_OK; "should always have an inner table frame");
nsIFrame* rgFrame = tableFrame->GetFirstPrincipalChild(); nsIFrame* rgFrame = tableFrame->GetFirstPrincipalChild();
if (!rgFrame || rgFrame->GetType() != nsGkAtoms::tableRowGroupFrame) if (!rgFrame || rgFrame->GetType() != nsGkAtoms::tableRowGroupFrame)
return NS_OK; return NS_OK;
@ -548,8 +548,8 @@ nsMathMLmtableOuterFrame::GetRowFrameAt(nsPresContext* aPresContext,
// if our inner table says that the index is valid, find the row now // if our inner table says that the index is valid, find the row now
if (0 <= aRowIndex && aRowIndex <= rowCount) { if (0 <= aRowIndex && aRowIndex <= rowCount) {
nsIFrame* tableFrame = mFrames.FirstChild(); nsIFrame* tableFrame = mFrames.FirstChild();
if (!tableFrame || tableFrame->GetType() != nsGkAtoms::tableFrame) NS_ASSERTION(tableFrame && tableFrame->GetType() == nsGkAtoms::tableFrame,
return nsnull; "should always have an inner table frame");
nsIFrame* rgFrame = tableFrame->GetFirstPrincipalChild(); nsIFrame* rgFrame = tableFrame->GetFirstPrincipalChild();
if (!rgFrame || rgFrame->GetType() != nsGkAtoms::tableRowGroupFrame) if (!rgFrame || rgFrame->GetType() != nsGkAtoms::tableRowGroupFrame)
return nsnull; return nsnull;

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

@ -309,6 +309,6 @@ random-if(Android) == object--auto-auto--px-px.html object--auto-auto--px
== dynamic--inline-resize-cb-width.xhtml standalone-sanity-width-300px.svg == dynamic--inline-resize-cb-width.xhtml standalone-sanity-width-300px.svg
skip == dynamic--inline-resize-window-height.xhtml pass.svg # XXX breaks the reftest run as the window height somehow is not restored skip == dynamic--inline-resize-window-height.xhtml pass.svg # XXX breaks the reftest run as the window height somehow is not restored
skip == dynamic--inline-resize-window-width.xhtml pass.svg # Fails way too much skip == dynamic--inline-resize-window-width.xhtml pass.svg # Fails way too much
fails == dynamic--object-svg-unloaded.xhtml pass.svg fails random-if(Android) == dynamic--object-svg-unloaded.xhtml pass.svg
# == dynamic--object--auto-auto--pct-px.html # == dynamic--object--auto-auto--pct-px.html

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

@ -336,10 +336,7 @@ nsTableColGroupFrame::RemoveFrame(ChildListID aListID,
nsTableColFrame* nextCol; nsTableColFrame* nextCol;
while (col && col->GetColType() == eColAnonymousCol) { while (col && col->GetColType() == eColAnonymousCol) {
#ifdef DEBUG #ifdef DEBUG
nsIFrame* providerFrame; nsIFrame* providerFrame = colFrame->GetParentStyleContextFrame();
PRBool isChild;
colFrame->GetParentStyleContextFrame(PresContext(), &providerFrame,
&isChild);
if (colFrame->GetStyleContext()->GetParent() == if (colFrame->GetStyleContext()->GetParent() ==
providerFrame->GetStyleContext()) { providerFrame->GetStyleContext()) {
NS_ASSERTION(col->GetStyleContext() == colFrame->GetStyleContext() && NS_ASSERTION(col->GetStyleContext() == colFrame->GetStyleContext() &&

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

@ -161,10 +161,8 @@ struct BCPropertyData
BCPixelSize mRightCellBorderWidth; BCPixelSize mRightCellBorderWidth;
}; };
NS_IMETHODIMP nsIFrame*
nsTableFrame::GetParentStyleContextFrame(nsPresContext* aPresContext, nsTableFrame::GetParentStyleContextFrame()
nsIFrame** aProviderFrame,
PRBool* aIsChild)
{ {
// Since our parent, the table outer frame, returned this frame, we // Since our parent, the table outer frame, returned this frame, we
// must return whatever our parent would normally have returned. // must return whatever our parent would normally have returned.
@ -172,13 +170,10 @@ nsTableFrame::GetParentStyleContextFrame(nsPresContext* aPresContext,
NS_PRECONDITION(mParent, "table constructed without outer table"); NS_PRECONDITION(mParent, "table constructed without outer table");
if (!mContent->GetParent() && !GetStyleContext()->GetPseudo()) { if (!mContent->GetParent() && !GetStyleContext()->GetPseudo()) {
// We're the root. We have no style context parent. // We're the root. We have no style context parent.
*aIsChild = PR_FALSE; return nsnull;
*aProviderFrame = nsnull;
return NS_OK;
} }
return static_cast<nsFrame*>(mParent)-> return static_cast<nsFrame*>(GetParent())->DoGetParentStyleContextFrame();
DoGetParentStyleContextFrame(aPresContext, aProviderFrame, aIsChild);
} }

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

@ -349,9 +349,7 @@ public:
nsFrameList& GetColGroups(); nsFrameList& GetColGroups();
NS_IMETHOD GetParentStyleContextFrame(nsPresContext* aPresContext, virtual nsIFrame* GetParentStyleContextFrame();
nsIFrame** aProviderFrame,
PRBool* aIsChild);
/** /**
* Get the "type" of the frame * Get the "type" of the frame

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

@ -117,10 +117,8 @@ nsTableCaptionFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
return result; return result;
} }
NS_IMETHODIMP nsIFrame*
nsTableCaptionFrame::GetParentStyleContextFrame(nsPresContext* aPresContext, nsTableCaptionFrame::GetParentStyleContextFrame()
nsIFrame** aProviderFrame,
PRBool* aIsChild)
{ {
NS_PRECONDITION(mContent->GetParent(), NS_PRECONDITION(mContent->GetParent(),
"How could we not have a parent here?"); "How could we not have a parent here?");
@ -131,17 +129,13 @@ nsTableCaptionFrame::GetParentStyleContextFrame(nsPresContext* aPresContext,
if (outerFrame && outerFrame->GetType() == nsGkAtoms::tableOuterFrame) { if (outerFrame && outerFrame->GetType() == nsGkAtoms::tableOuterFrame) {
nsIFrame* innerFrame = outerFrame->GetFirstPrincipalChild(); nsIFrame* innerFrame = outerFrame->GetFirstPrincipalChild();
if (innerFrame) { if (innerFrame) {
*aProviderFrame = return nsFrame::CorrectStyleParentFrame(innerFrame,
nsFrame::CorrectStyleParentFrame(innerFrame,
GetStyleContext()->GetPseudo()); GetStyleContext()->GetPseudo());
*aIsChild = PR_FALSE;
return NS_OK;
} }
} }
NS_NOTREACHED("Where is our inner table frame?"); NS_NOTREACHED("Where is our inner table frame?");
return nsBlockFrame::GetParentStyleContextFrame(aPresContext, aProviderFrame, return nsBlockFrame::GetParentStyleContextFrame();
aIsChild);
} }
#ifdef ACCESSIBILITY #ifdef ACCESSIBILITY
@ -245,23 +239,15 @@ nsTableOuterFrame::SetInitialChildList(ChildListID aListID,
if (kCaptionList == aListID) { if (kCaptionList == aListID) {
// the frame constructor already checked for table-caption display type // the frame constructor already checked for table-caption display type
mCaptionFrames.SetFrames(aChildList); mCaptionFrames.SetFrames(aChildList);
mCaptionFrame = mCaptionFrames.FirstChild();
} }
else { else {
NS_ASSERTION(aListID == kPrincipalList, "wrong childlist"); NS_ASSERTION(aListID == kPrincipalList, "wrong childlist");
NS_ASSERTION(mFrames.IsEmpty(), "Frame leak!"); NS_ASSERTION(mFrames.IsEmpty(), "Frame leak!");
mInnerTableFrame = nsnull; NS_ASSERTION(aChildList.FirstChild() &&
if (aChildList.NotEmpty()) { nsGkAtoms::tableFrame == aChildList.FirstChild()->GetType(),
if (nsGkAtoms::tableFrame == aChildList.FirstChild()->GetType()) { "expected a table frame");
mInnerTableFrame = (nsTableFrame*)aChildList.FirstChild();
mFrames.SetFrames(aChildList); mFrames.SetFrames(aChildList);
} }
else {
NS_ERROR("expected a table frame");
return NS_ERROR_INVALID_ARG;
}
}
}
return NS_OK; return NS_OK;
} }
@ -279,7 +265,6 @@ nsTableOuterFrame::AppendFrames(ChildListID aListID,
aFrameList.FirstChild()->GetType() == nsGkAtoms::tableCaptionFrame, aFrameList.FirstChild()->GetType() == nsGkAtoms::tableCaptionFrame,
"appending non-caption frame to captionList"); "appending non-caption frame to captionList");
mCaptionFrames.AppendFrames(this, aFrameList); mCaptionFrames.AppendFrames(this, aFrameList);
mCaptionFrame = mCaptionFrames.FirstChild();
rv = NS_OK; rv = NS_OK;
// Reflow the new caption frame. It's already marked dirty, so // Reflow the new caption frame. It's already marked dirty, so
@ -308,7 +293,6 @@ nsTableOuterFrame::InsertFrames(ChildListID aListID,
aFrameList.FirstChild()->GetType() == nsGkAtoms::tableCaptionFrame, aFrameList.FirstChild()->GetType() == nsGkAtoms::tableCaptionFrame,
"inserting non-caption frame into captionList"); "inserting non-caption frame into captionList");
mCaptionFrames.InsertFrames(nsnull, aPrevFrame, aFrameList); mCaptionFrames.InsertFrames(nsnull, aPrevFrame, aFrameList);
mCaptionFrame = mCaptionFrames.FirstChild();
// Reflow the new caption frame. It's already marked dirty, so // Reflow the new caption frame. It's already marked dirty, so
// just tell the pres shell. // just tell the pres shell.
@ -334,12 +318,11 @@ nsTableOuterFrame::RemoveFrame(ChildListID aListID,
if (HasSideCaption()) { if (HasSideCaption()) {
// The old caption width had an effect on the inner table width so // The old caption width had an effect on the inner table width so
// we're going to need to reflow it. Mark it dirty // we're going to need to reflow it. Mark it dirty
mInnerTableFrame->AddStateBits(NS_FRAME_IS_DIRTY); InnerTableFrame()->AddStateBits(NS_FRAME_IS_DIRTY);
} }
// Remove the frame and destroy it // Remove the frame and destroy it
mCaptionFrames.DestroyFrame(aOldFrame); mCaptionFrames.DestroyFrame(aOldFrame);
mCaptionFrame = mCaptionFrames.FirstChild();
PresContext()->PresShell()-> PresContext()->PresShell()->
FrameNeedsReflow(this, nsIPresShell::eTreeChange, FrameNeedsReflow(this, nsIPresShell::eTreeChange,
@ -360,7 +343,7 @@ nsTableOuterFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// If there's no caption, take a short cut to avoid having to create // If there's no caption, take a short cut to avoid having to create
// the special display list set and then sort it. // the special display list set and then sort it.
if (!mCaptionFrame) if (mCaptionFrames.IsEmpty())
return BuildDisplayListForInnerTable(aBuilder, aDirtyRect, aLists); return BuildDisplayListForInnerTable(aBuilder, aDirtyRect, aLists);
nsDisplayListCollection set; nsDisplayListCollection set;
@ -368,7 +351,8 @@ nsTableOuterFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
nsDisplayListSet captionSet(set, set.BlockBorderBackgrounds()); nsDisplayListSet captionSet(set, set.BlockBorderBackgrounds());
rv = BuildDisplayListForChild(aBuilder, mCaptionFrame, aDirtyRect, captionSet); rv = BuildDisplayListForChild(aBuilder, mCaptionFrames.FirstChild(),
aDirtyRect, captionSet);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
// Now we have to sort everything by content order, since the caption // Now we have to sort everything by content order, since the caption
@ -400,15 +384,11 @@ nsTableOuterFrame::SetSelected(PRBool aSelected,
SelectionType aType) SelectionType aType)
{ {
nsFrame::SetSelected(aSelected, aType); nsFrame::SetSelected(aSelected, aType);
if (mInnerTableFrame) { InnerTableFrame()->SetSelected(aSelected, aType);
mInnerTableFrame->SetSelected(aSelected, aType);
}
} }
NS_IMETHODIMP nsIFrame*
nsTableOuterFrame::GetParentStyleContextFrame(nsPresContext* aPresContext, nsTableOuterFrame::GetParentStyleContextFrame()
nsIFrame** aProviderFrame,
PRBool* aIsChild)
{ {
// The table outer frame and the (inner) table frame split the style // The table outer frame and the (inner) table frame split the style
// data by giving the table frame the style context associated with // data by giving the table frame the style context associated with
@ -420,14 +400,7 @@ nsTableOuterFrame::GetParentStyleContextFrame(nsPresContext* aPresContext,
// children of the table inherit directly from the inner table, and // children of the table inherit directly from the inner table, and
// the outer table's style context is a leaf. // the outer table's style context is a leaf.
if (!mInnerTableFrame) { return InnerTableFrame();
*aProviderFrame = this;
*aIsChild = PR_FALSE;
return NS_ERROR_FAILURE;
}
*aProviderFrame = mInnerTableFrame;
*aIsChild = PR_TRUE;
return NS_OK;
} }
// INCREMENTAL REFLOW HELPER FUNCTIONS // INCREMENTAL REFLOW HELPER FUNCTIONS
@ -441,8 +414,9 @@ nsTableOuterFrame::InitChildReflowState(nsPresContext& aPresContext,
nsMargin collapsePadding(0,0,0,0); nsMargin collapsePadding(0,0,0,0);
nsMargin* pCollapseBorder = nsnull; nsMargin* pCollapseBorder = nsnull;
nsMargin* pCollapsePadding = nsnull; nsMargin* pCollapsePadding = nsnull;
if ((aReflowState.frame == mInnerTableFrame) && (mInnerTableFrame->IsBorderCollapse())) { if (aReflowState.frame == InnerTableFrame() &&
collapseBorder = mInnerTableFrame->GetIncludedOuterBCBorder(); InnerTableFrame()->IsBorderCollapse()) {
collapseBorder = InnerTableFrame()->GetIncludedOuterBCBorder();
pCollapseBorder = &collapseBorder; pCollapseBorder = &collapseBorder;
pCollapsePadding = &collapsePadding; pCollapsePadding = &collapsePadding;
} }
@ -495,11 +469,12 @@ GetContainingBlockSize(const nsHTMLReflowState& aOuterRS)
nsTableOuterFrame::GetMinWidth(nsRenderingContext *aRenderingContext) nsTableOuterFrame::GetMinWidth(nsRenderingContext *aRenderingContext)
{ {
nscoord width = nsLayoutUtils::IntrinsicForContainer(aRenderingContext, nscoord width = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
mInnerTableFrame, nsLayoutUtils::MIN_WIDTH); InnerTableFrame(), nsLayoutUtils::MIN_WIDTH);
DISPLAY_MIN_WIDTH(this, width); DISPLAY_MIN_WIDTH(this, width);
if (mCaptionFrame) { if (mCaptionFrames.NotEmpty()) {
nscoord capWidth = nscoord capWidth =
nsLayoutUtils::IntrinsicForContainer(aRenderingContext, mCaptionFrame, nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
mCaptionFrames.FirstChild(),
nsLayoutUtils::MIN_WIDTH); nsLayoutUtils::MIN_WIDTH);
if (HasSideCaption()) { if (HasSideCaption()) {
width += capWidth; width += capWidth;
@ -519,15 +494,16 @@ nsTableOuterFrame::GetPrefWidth(nsRenderingContext *aRenderingContext)
DISPLAY_PREF_WIDTH(this, maxWidth); DISPLAY_PREF_WIDTH(this, maxWidth);
maxWidth = nsLayoutUtils::IntrinsicForContainer(aRenderingContext, maxWidth = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
mInnerTableFrame, nsLayoutUtils::PREF_WIDTH); InnerTableFrame(), nsLayoutUtils::PREF_WIDTH);
if (mCaptionFrame) { if (mCaptionFrames.NotEmpty()) {
PRUint8 captionSide = GetCaptionSide(); PRUint8 captionSide = GetCaptionSide();
switch(captionSide) { switch(captionSide) {
case NS_STYLE_CAPTION_SIDE_LEFT: case NS_STYLE_CAPTION_SIDE_LEFT:
case NS_STYLE_CAPTION_SIDE_RIGHT: case NS_STYLE_CAPTION_SIDE_RIGHT:
{ {
nscoord capMin = nscoord capMin =
nsLayoutUtils::IntrinsicForContainer(aRenderingContext, mCaptionFrame, nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
mCaptionFrames.FirstChild(),
nsLayoutUtils::MIN_WIDTH); nsLayoutUtils::MIN_WIDTH);
maxWidth += capMin; maxWidth += capMin;
} }
@ -547,7 +523,8 @@ nsTableOuterFrame::GetPrefWidth(nsRenderingContext *aRenderingContext)
iwt = nsLayoutUtils::PREF_WIDTH; iwt = nsLayoutUtils::PREF_WIDTH;
} }
nscoord capPref = nscoord capPref =
nsLayoutUtils::IntrinsicForContainer(aRenderingContext, mCaptionFrame, nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
mCaptionFrames.FirstChild(),
iwt); iwt);
maxWidth = NS_MAX(maxWidth, capPref); maxWidth = NS_MAX(maxWidth, capPref);
} }
@ -604,22 +581,23 @@ nsTableOuterFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
PRUint8 captionSide = GetCaptionSide(); PRUint8 captionSide = GetCaptionSide();
nscoord width; nscoord width;
if (captionSide == NO_SIDE) { if (captionSide == NO_SIDE) {
width = ChildShrinkWrapWidth(aRenderingContext, mInnerTableFrame, width = ChildShrinkWrapWidth(aRenderingContext, InnerTableFrame(),
aCBSize, aAvailableWidth); aCBSize, aAvailableWidth);
} else if (captionSide == NS_STYLE_CAPTION_SIDE_LEFT || } else if (captionSide == NS_STYLE_CAPTION_SIDE_LEFT ||
captionSide == NS_STYLE_CAPTION_SIDE_RIGHT) { captionSide == NS_STYLE_CAPTION_SIDE_RIGHT) {
nscoord capWidth = ChildShrinkWrapWidth(aRenderingContext, mCaptionFrame, nscoord capWidth = ChildShrinkWrapWidth(aRenderingContext,
mCaptionFrames.FirstChild(),
aCBSize, aAvailableWidth); aCBSize, aAvailableWidth);
width = capWidth + ChildShrinkWrapWidth(aRenderingContext, width = capWidth + ChildShrinkWrapWidth(aRenderingContext,
mInnerTableFrame, aCBSize, InnerTableFrame(), aCBSize,
aAvailableWidth - capWidth); aAvailableWidth - capWidth);
} else if (captionSide == NS_STYLE_CAPTION_SIDE_TOP || } else if (captionSide == NS_STYLE_CAPTION_SIDE_TOP ||
captionSide == NS_STYLE_CAPTION_SIDE_BOTTOM) { captionSide == NS_STYLE_CAPTION_SIDE_BOTTOM) {
nscoord margin; nscoord margin;
width = ChildShrinkWrapWidth(aRenderingContext, mInnerTableFrame, width = ChildShrinkWrapWidth(aRenderingContext, InnerTableFrame(),
aCBSize, aAvailableWidth, &margin); aCBSize, aAvailableWidth, &margin);
nscoord capWidth = ChildShrinkWrapWidth(aRenderingContext, nscoord capWidth = ChildShrinkWrapWidth(aRenderingContext,
mCaptionFrame, aCBSize, mCaptionFrames.FirstChild(), aCBSize,
width - margin); width - margin);
if (capWidth > width) if (capWidth > width)
width = capWidth; width = capWidth;
@ -627,11 +605,11 @@ nsTableOuterFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
NS_ASSERTION(captionSide == NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE || NS_ASSERTION(captionSide == NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE ||
captionSide == NS_STYLE_CAPTION_SIDE_BOTTOM_OUTSIDE, captionSide == NS_STYLE_CAPTION_SIDE_BOTTOM_OUTSIDE,
"unexpected caption-side"); "unexpected caption-side");
width = ChildShrinkWrapWidth(aRenderingContext, mInnerTableFrame, width = ChildShrinkWrapWidth(aRenderingContext, InnerTableFrame(),
aCBSize, aAvailableWidth); aCBSize, aAvailableWidth);
nscoord capWidth = ChildShrinkWrapWidth(aRenderingContext, nscoord capWidth = ChildShrinkWrapWidth(aRenderingContext,
mCaptionFrame, aCBSize, mCaptionFrames.FirstChild(),
aAvailableWidth); aCBSize, aAvailableWidth);
if (capWidth > width) if (capWidth > width)
width = capWidth; width = capWidth;
} }
@ -642,8 +620,8 @@ nsTableOuterFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
PRUint8 PRUint8
nsTableOuterFrame::GetCaptionSide() nsTableOuterFrame::GetCaptionSide()
{ {
if (mCaptionFrame) { if (mCaptionFrames.NotEmpty()) {
return mCaptionFrame->GetStyleTableBorder()->mCaptionSide; return mCaptionFrames.FirstChild()->GetStyleTableBorder()->mCaptionSide;
} }
else { else {
return NO_SIDE; // no caption return NO_SIDE; // no caption
@ -653,7 +631,8 @@ nsTableOuterFrame::GetCaptionSide()
PRUint8 PRUint8
nsTableOuterFrame::GetCaptionVerticalAlign() nsTableOuterFrame::GetCaptionVerticalAlign()
{ {
const nsStyleCoord& va = mCaptionFrame->GetStyleTextReset()->mVerticalAlign; const nsStyleCoord& va =
mCaptionFrames.FirstChild()->GetStyleTextReset()->mVerticalAlign;
return (va.GetUnit() == eStyleUnit_Enumerated) return (va.GetUnit() == eStyleUnit_Enumerated)
? va.GetIntValue() ? va.GetIntValue()
: NS_STYLE_VERTICAL_ALIGN_TOP; : NS_STYLE_VERTICAL_ALIGN_TOP;
@ -668,13 +647,13 @@ nsTableOuterFrame::SetDesiredSize(PRUint8 aCaptionSide,
{ {
aWidth = aHeight = 0; aWidth = aHeight = 0;
nsRect innerRect = mInnerTableFrame->GetRect(); nsRect innerRect = InnerTableFrame()->GetRect();
nscoord innerWidth = innerRect.width; nscoord innerWidth = innerRect.width;
nsRect captionRect(0,0,0,0); nsRect captionRect(0,0,0,0);
nscoord captionWidth = 0; nscoord captionWidth = 0;
if (mCaptionFrame) { if (mCaptionFrames.NotEmpty()) {
captionRect = mCaptionFrame->GetRect(); captionRect = mCaptionFrames.FirstChild()->GetRect();
captionWidth = captionRect.width; captionWidth = captionRect.width;
} }
switch(aCaptionSide) { switch(aCaptionSide) {
@ -715,7 +694,7 @@ nsTableOuterFrame::GetCaptionOrigin(PRUint32 aCaptionSide,
(NS_UNCONSTRAINEDSIZE == aCaptionSize.width) || (NS_UNCONSTRAINEDSIZE == aCaptionSize.height)) { (NS_UNCONSTRAINEDSIZE == aCaptionSize.width) || (NS_UNCONSTRAINEDSIZE == aCaptionSize.height)) {
return NS_OK; return NS_OK;
} }
if (!mCaptionFrame) return NS_OK; if (mCaptionFrames.IsEmpty()) return NS_OK;
NS_ASSERTION(NS_AUTOMARGIN != aCaptionMargin.left, "The computed caption margin is auto?"); NS_ASSERTION(NS_AUTOMARGIN != aCaptionMargin.left, "The computed caption margin is auto?");
NS_ASSERTION(NS_AUTOMARGIN != aCaptionMargin.top, "The computed caption margin is auto?"); NS_ASSERTION(NS_AUTOMARGIN != aCaptionMargin.top, "The computed caption margin is auto?");
@ -894,7 +873,7 @@ nsTableOuterFrame::OuterBeginReflowChild(nsPresContext* aPresContext,
// work around pixel rounding errors, round down to ensure we don't exceed the avail height in // work around pixel rounding errors, round down to ensure we don't exceed the avail height in
nscoord availHeight = aOuterRS.availableHeight; nscoord availHeight = aOuterRS.availableHeight;
if (NS_UNCONSTRAINEDSIZE != availHeight) { if (NS_UNCONSTRAINEDSIZE != availHeight) {
if (mCaptionFrame == aChildFrame) { if (mCaptionFrames.FirstChild() == aChildFrame) {
availHeight = NS_UNCONSTRAINEDSIZE; availHeight = NS_UNCONSTRAINEDSIZE;
} else { } else {
nsMargin margin; nsMargin margin;
@ -918,14 +897,14 @@ nsTableOuterFrame::OuterBeginReflowChild(nsPresContext* aPresContext,
InitChildReflowState(*aPresContext, childRS); InitChildReflowState(*aPresContext, childRS);
// see if we need to reset top of page due to a caption // see if we need to reset top of page due to a caption
if (mCaptionFrame) { if (mCaptionFrames.NotEmpty()) {
PRUint8 captionSide = GetCaptionSide(); PRUint8 captionSide = GetCaptionSide();
if (((captionSide == NS_STYLE_CAPTION_SIDE_BOTTOM || if (((captionSide == NS_STYLE_CAPTION_SIDE_BOTTOM ||
captionSide == NS_STYLE_CAPTION_SIDE_BOTTOM_OUTSIDE) && captionSide == NS_STYLE_CAPTION_SIDE_BOTTOM_OUTSIDE) &&
mCaptionFrame == aChildFrame) || mCaptionFrames.FirstChild() == aChildFrame) ||
((captionSide == NS_STYLE_CAPTION_SIDE_TOP || ((captionSide == NS_STYLE_CAPTION_SIDE_TOP ||
captionSide == NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE) && captionSide == NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE) &&
mInnerTableFrame == aChildFrame)) { InnerTableFrame() == aChildFrame)) {
childRS.mFlags.mIsTopOfPage = PR_FALSE; childRS.mFlags.mIsTopOfPage = PR_FALSE;
} }
} }
@ -955,9 +934,9 @@ nsTableOuterFrame::UpdateReflowMetrics(PRUint8 aCaptionSide,
aMet.width, aMet.height); aMet.width, aMet.height);
aMet.SetOverflowAreasToDesiredBounds(); aMet.SetOverflowAreasToDesiredBounds();
ConsiderChildOverflow(aMet.mOverflowAreas, mInnerTableFrame); ConsiderChildOverflow(aMet.mOverflowAreas, InnerTableFrame());
if (mCaptionFrame) { if (mCaptionFrames.NotEmpty()) {
ConsiderChildOverflow(aMet.mOverflowAreas, mCaptionFrame); ConsiderChildOverflow(aMet.mOverflowAreas, mCaptionFrames.FirstChild());
} }
FinishAndStoreOverflow(&aMet); FinishAndStoreOverflow(&aMet);
} }
@ -970,12 +949,6 @@ NS_METHOD nsTableOuterFrame::Reflow(nsPresContext* aPresContext,
DO_GLOBAL_REFLOW_COUNT("nsTableOuterFrame"); DO_GLOBAL_REFLOW_COUNT("nsTableOuterFrame");
DISPLAY_REFLOW(aPresContext, this, aOuterRS, aDesiredSize, aStatus); DISPLAY_REFLOW(aPresContext, this, aOuterRS, aDesiredSize, aStatus);
// We desperately need an inner table frame,
// if this fails fix the frame constructor
if (mFrames.IsEmpty() || !mInnerTableFrame) {
NS_ERROR("incomplete children");
return NS_ERROR_FAILURE;
}
nsresult rv = NS_OK; nsresult rv = NS_OK;
PRUint8 captionSide = GetCaptionSide(); PRUint8 captionSide = GetCaptionSide();
@ -999,36 +972,37 @@ NS_METHOD nsTableOuterFrame::Reflow(nsPresContext* aPresContext,
nsHTMLReflowState *innerRS = nsHTMLReflowState *innerRS =
static_cast<nsHTMLReflowState*>((void*) innerRSSpace); static_cast<nsHTMLReflowState*>((void*) innerRSSpace);
nsRect origInnerRect = mInnerTableFrame->GetRect(); nsRect origInnerRect = InnerTableFrame()->GetRect();
nsRect origInnerVisualOverflow = mInnerTableFrame->GetVisualOverflowRect(); nsRect origInnerVisualOverflow = InnerTableFrame()->GetVisualOverflowRect();
PRBool innerFirstReflow = PRBool innerFirstReflow =
(mInnerTableFrame->GetStateBits() & NS_FRAME_FIRST_REFLOW) != 0; (InnerTableFrame()->GetStateBits() & NS_FRAME_FIRST_REFLOW) != 0;
nsRect origCaptionRect; nsRect origCaptionRect;
nsRect origCaptionVisualOverflow; nsRect origCaptionVisualOverflow;
PRBool captionFirstReflow; PRBool captionFirstReflow;
if (mCaptionFrame) { if (mCaptionFrames.NotEmpty()) {
origCaptionRect = mCaptionFrame->GetRect(); origCaptionRect = mCaptionFrames.FirstChild()->GetRect();
origCaptionVisualOverflow = mCaptionFrame->GetVisualOverflowRect(); origCaptionVisualOverflow =
mCaptionFrames.FirstChild()->GetVisualOverflowRect();
captionFirstReflow = captionFirstReflow =
(mCaptionFrame->GetStateBits() & NS_FRAME_FIRST_REFLOW) != 0; (mCaptionFrames.FirstChild()->GetStateBits() & NS_FRAME_FIRST_REFLOW) != 0;
} }
// ComputeAutoSize has to match this logic. // ComputeAutoSize has to match this logic.
if (captionSide == NO_SIDE) { if (captionSide == NO_SIDE) {
// We don't have a caption. // We don't have a caption.
OuterBeginReflowChild(aPresContext, mInnerTableFrame, aOuterRS, OuterBeginReflowChild(aPresContext, InnerTableFrame(), aOuterRS,
innerRSSpace, aOuterRS.ComputedWidth()); innerRSSpace, aOuterRS.ComputedWidth());
} else if (captionSide == NS_STYLE_CAPTION_SIDE_LEFT || } else if (captionSide == NS_STYLE_CAPTION_SIDE_LEFT ||
captionSide == NS_STYLE_CAPTION_SIDE_RIGHT) { captionSide == NS_STYLE_CAPTION_SIDE_RIGHT) {
// nsTableCaptionFrame::ComputeAutoSize takes care of making side // nsTableCaptionFrame::ComputeAutoSize takes care of making side
// captions small. Compute the caption's size first, and tell the // captions small. Compute the caption's size first, and tell the
// table to fit in what's left. // table to fit in what's left.
OuterBeginReflowChild(aPresContext, mCaptionFrame, aOuterRS, OuterBeginReflowChild(aPresContext, mCaptionFrames.FirstChild(), aOuterRS,
captionRSSpace, aOuterRS.ComputedWidth()); captionRSSpace, aOuterRS.ComputedWidth());
nscoord innerAvailWidth = aOuterRS.ComputedWidth() - nscoord innerAvailWidth = aOuterRS.ComputedWidth() -
(captionRS->ComputedWidth() + captionRS->mComputedMargin.LeftRight() + (captionRS->ComputedWidth() + captionRS->mComputedMargin.LeftRight() +
captionRS->mComputedBorderPadding.LeftRight()); captionRS->mComputedBorderPadding.LeftRight());
OuterBeginReflowChild(aPresContext, mInnerTableFrame, aOuterRS, OuterBeginReflowChild(aPresContext, InnerTableFrame(), aOuterRS,
innerRSSpace, innerAvailWidth); innerRSSpace, innerAvailWidth);
} else if (captionSide == NS_STYLE_CAPTION_SIDE_TOP || } else if (captionSide == NS_STYLE_CAPTION_SIDE_TOP ||
@ -1041,7 +1015,7 @@ NS_METHOD nsTableOuterFrame::Reflow(nsPresContext* aPresContext,
// table box inside it // table box inside it
// We don't actually make our anonymous box that width (if we did, // We don't actually make our anonymous box that width (if we did,
// it would break 'auto' margins), but this effectively does that. // it would break 'auto' margins), but this effectively does that.
OuterBeginReflowChild(aPresContext, mInnerTableFrame, aOuterRS, OuterBeginReflowChild(aPresContext, InnerTableFrame(), aOuterRS,
innerRSSpace, aOuterRS.ComputedWidth()); innerRSSpace, aOuterRS.ComputedWidth());
// It's good that CSS 2.1 says not to include margins, since we // It's good that CSS 2.1 says not to include margins, since we
// can't, since they already been converted so they exactly // can't, since they already been converted so they exactly
@ -1050,16 +1024,16 @@ NS_METHOD nsTableOuterFrame::Reflow(nsPresContext* aPresContext,
// GetCaptionOrigin, though.) // GetCaptionOrigin, though.)
nscoord innerBorderWidth = innerRS->ComputedWidth() + nscoord innerBorderWidth = innerRS->ComputedWidth() +
innerRS->mComputedBorderPadding.LeftRight(); innerRS->mComputedBorderPadding.LeftRight();
OuterBeginReflowChild(aPresContext, mCaptionFrame, aOuterRS, OuterBeginReflowChild(aPresContext, mCaptionFrames.FirstChild(), aOuterRS,
captionRSSpace, innerBorderWidth); captionRSSpace, innerBorderWidth);
} else { } else {
NS_ASSERTION(captionSide == NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE || NS_ASSERTION(captionSide == NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE ||
captionSide == NS_STYLE_CAPTION_SIDE_BOTTOM_OUTSIDE, captionSide == NS_STYLE_CAPTION_SIDE_BOTTOM_OUTSIDE,
"unexpected caption-side"); "unexpected caption-side");
// Size the table and the caption independently. // Size the table and the caption independently.
OuterBeginReflowChild(aPresContext, mCaptionFrame, aOuterRS, OuterBeginReflowChild(aPresContext, mCaptionFrames.FirstChild(), aOuterRS,
captionRSSpace, aOuterRS.ComputedWidth()); captionRSSpace, aOuterRS.ComputedWidth());
OuterBeginReflowChild(aPresContext, mInnerTableFrame, aOuterRS, OuterBeginReflowChild(aPresContext, InnerTableFrame(), aOuterRS,
innerRSSpace, aOuterRS.ComputedWidth()); innerRSSpace, aOuterRS.ComputedWidth());
} }
@ -1067,10 +1041,10 @@ NS_METHOD nsTableOuterFrame::Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics captionMet; nsHTMLReflowMetrics captionMet;
nsSize captionSize; nsSize captionSize;
nsMargin captionMargin; nsMargin captionMargin;
if (mCaptionFrame) { if (mCaptionFrames.NotEmpty()) {
nsReflowStatus capStatus; // don't let the caption cause incomplete nsReflowStatus capStatus; // don't let the caption cause incomplete
rv = OuterDoReflowChild(aPresContext, mCaptionFrame, *captionRS, rv = OuterDoReflowChild(aPresContext, mCaptionFrames.FirstChild(),
captionMet, capStatus); *captionRS, captionMet, capStatus);
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
captionSize.width = captionMet.width; captionSize.width = captionMet.width;
captionSize.height = captionMet.height; captionSize.height = captionMet.height;
@ -1114,7 +1088,7 @@ NS_METHOD nsTableOuterFrame::Reflow(nsPresContext* aPresContext,
// Then, now that we know how much to reduce the width of the inner // Then, now that we know how much to reduce the width of the inner
// table to account for side captions, reflow the inner table. // table to account for side captions, reflow the inner table.
nsHTMLReflowMetrics innerMet; nsHTMLReflowMetrics innerMet;
rv = OuterDoReflowChild(aPresContext, mInnerTableFrame, *innerRS, rv = OuterDoReflowChild(aPresContext, InnerTableFrame(), *innerRS,
innerMet, aStatus); innerMet, aStatus);
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
nsSize innerSize; nsSize innerSize;
@ -1130,12 +1104,12 @@ NS_METHOD nsTableOuterFrame::Reflow(nsPresContext* aPresContext,
// XXX Need to recompute inner table's auto margins for the case of side // XXX Need to recompute inner table's auto margins for the case of side
// captions. (Caption's are broken too, but that should be fixed earlier.) // captions. (Caption's are broken too, but that should be fixed earlier.)
if (mCaptionFrame) { if (mCaptionFrames.NotEmpty()) {
nsPoint captionOrigin; nsPoint captionOrigin;
GetCaptionOrigin(captionSide, containSize, innerSize, GetCaptionOrigin(captionSide, containSize, innerSize,
innerMargin, captionSize, captionMargin, captionOrigin); innerMargin, captionSize, captionMargin, captionOrigin);
FinishReflowChild(mCaptionFrame, aPresContext, captionRS, captionMet, FinishReflowChild(mCaptionFrames.FirstChild(), aPresContext, captionRS,
captionOrigin.x, captionOrigin.y, 0); captionMet, captionOrigin.x, captionOrigin.y, 0);
captionRS->~nsHTMLReflowState(); captionRS->~nsHTMLReflowState();
} }
// XXX If the height is constrained then we need to check whether // XXX If the height is constrained then we need to check whether
@ -1144,14 +1118,14 @@ NS_METHOD nsTableOuterFrame::Reflow(nsPresContext* aPresContext,
nsPoint innerOrigin; nsPoint innerOrigin;
GetInnerOrigin(captionSide, containSize, captionSize, GetInnerOrigin(captionSide, containSize, captionSize,
captionMargin, innerSize, innerMargin, innerOrigin); captionMargin, innerSize, innerMargin, innerOrigin);
FinishReflowChild(mInnerTableFrame, aPresContext, innerRS, innerMet, FinishReflowChild(InnerTableFrame(), aPresContext, innerRS, innerMet,
innerOrigin.x, innerOrigin.y, 0); innerOrigin.x, innerOrigin.y, 0);
innerRS->~nsHTMLReflowState(); innerRS->~nsHTMLReflowState();
nsTableFrame::InvalidateFrame(mInnerTableFrame, origInnerRect, nsTableFrame::InvalidateFrame(InnerTableFrame(), origInnerRect,
origInnerVisualOverflow, innerFirstReflow); origInnerVisualOverflow, innerFirstReflow);
if (mCaptionFrame) { if (mCaptionFrames.NotEmpty()) {
nsTableFrame::InvalidateFrame(mCaptionFrame, origCaptionRect, nsTableFrame::InvalidateFrame(mCaptionFrames.FirstChild(), origCaptionRect,
origCaptionVisualOverflow, origCaptionVisualOverflow,
captionFirstReflow); captionFirstReflow);
} }
@ -1181,9 +1155,7 @@ nsTableOuterFrame::GetCellDataAt(PRInt32 aRowIndex, PRInt32 aColIndex,
PRInt32& aActualRowSpan, PRInt32& aActualColSpan, PRInt32& aActualRowSpan, PRInt32& aActualColSpan,
PRBool& aIsSelected) PRBool& aIsSelected)
{ {
NS_ASSERTION(mInnerTableFrame, "no inner table frame yet?"); return InnerTableFrame()->GetCellDataAt(aRowIndex, aColIndex, aCell,
return mInnerTableFrame->GetCellDataAt(aRowIndex, aColIndex, aCell,
aStartRowIndex, aStartColIndex, aStartRowIndex, aStartColIndex,
aRowSpan, aColSpan, aActualRowSpan, aRowSpan, aColSpan, aActualRowSpan,
aActualColSpan, aIsSelected); aActualColSpan, aIsSelected);
@ -1192,9 +1164,7 @@ nsTableOuterFrame::GetCellDataAt(PRInt32 aRowIndex, PRInt32 aColIndex,
NS_IMETHODIMP NS_IMETHODIMP
nsTableOuterFrame::GetTableSize(PRInt32& aRowCount, PRInt32& aColCount) nsTableOuterFrame::GetTableSize(PRInt32& aRowCount, PRInt32& aColCount)
{ {
NS_ASSERTION(mInnerTableFrame, "no inner table frame yet?"); return InnerTableFrame()->GetTableSize(aRowCount, aColCount);
return mInnerTableFrame->GetTableSize(aRowCount, aColCount);
} }
NS_IMETHODIMP NS_IMETHODIMP
@ -1202,9 +1172,7 @@ nsTableOuterFrame::GetIndexByRowAndColumn(PRInt32 aRow, PRInt32 aColumn,
PRInt32 *aIndex) PRInt32 *aIndex)
{ {
NS_ENSURE_ARG_POINTER(aIndex); NS_ENSURE_ARG_POINTER(aIndex);
return InnerTableFrame()->GetIndexByRowAndColumn(aRow, aColumn, aIndex);
NS_ASSERTION(mInnerTableFrame, "no inner table frame yet?");
return mInnerTableFrame->GetIndexByRowAndColumn(aRow, aColumn, aIndex);
} }
NS_IMETHODIMP NS_IMETHODIMP
@ -1213,9 +1181,7 @@ nsTableOuterFrame::GetRowAndColumnByIndex(PRInt32 aIndex,
{ {
NS_ENSURE_ARG_POINTER(aRow); NS_ENSURE_ARG_POINTER(aRow);
NS_ENSURE_ARG_POINTER(aColumn); NS_ENSURE_ARG_POINTER(aColumn);
return InnerTableFrame()->GetRowAndColumnByIndex(aIndex, aRow, aColumn);
NS_ASSERTION(mInnerTableFrame, "no inner table frame yet?");
return mInnerTableFrame->GetRowAndColumnByIndex(aIndex, aRow, aColumn);
} }
/*---------------- end of nsITableLayout implementation ------------------*/ /*---------------- end of nsITableLayout implementation ------------------*/

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

@ -41,9 +41,7 @@
#include "nsHTMLContainerFrame.h" #include "nsHTMLContainerFrame.h"
#include "nsBlockFrame.h" #include "nsBlockFrame.h"
#include "nsITableLayout.h" #include "nsITableLayout.h"
#include "nsTableFrame.h"
struct nsStyleTable;
class nsTableFrame;
class nsTableCaptionFrame : public nsBlockFrame class nsTableCaptionFrame : public nsBlockFrame
{ {
@ -59,9 +57,8 @@ public:
nsSize aMargin, nsSize aBorder, nsSize aMargin, nsSize aBorder,
nsSize aPadding, PRBool aShrinkWrap); nsSize aPadding, PRBool aShrinkWrap);
NS_IMETHOD GetParentStyleContextFrame(nsPresContext* aPresContext, virtual nsIFrame* GetParentStyleContextFrame();
nsIFrame** aProviderFrame,
PRBool* aIsChild);
#ifdef ACCESSIBILITY #ifdef ACCESSIBILITY
virtual already_AddRefed<nsAccessible> CreateAccessible(); virtual already_AddRefed<nsAccessible> CreateAccessible();
#endif #endif
@ -169,9 +166,7 @@ public:
void SetSelected(PRBool aSelected, void SetSelected(PRBool aSelected,
SelectionType aType); SelectionType aType);
NS_IMETHOD GetParentStyleContextFrame(nsPresContext* aPresContext, virtual nsIFrame* GetParentStyleContextFrame();
nsIFrame** aProviderFrame,
PRBool* aIsChild);
/*---------------- nsITableLayout methods ------------------------*/ /*---------------- nsITableLayout methods ------------------------*/
@ -262,17 +257,15 @@ protected:
nscoord aAvailableWidth, nscoord aAvailableWidth,
nsMargin& aMargin); nsMargin& aMargin);
nsTableFrame* InnerTableFrame() {
return static_cast<nsTableFrame*>(mFrames.FirstChild());
}
private: private:
// used to keep track of this frame's children. They are redundant with mFrames, but more convient
nsTableFrame* mInnerTableFrame;
nsFrameList mCaptionFrames; nsFrameList mCaptionFrames;
nsIFrame* mCaptionFrame;
}; };
inline PRIntn nsTableOuterFrame::GetSkipSides() const inline PRIntn nsTableOuterFrame::GetSkipSides() const
{ return 0; } { return 0; }
#endif #endif

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

@ -141,6 +141,11 @@ nsMenuBarListener::ToggleMenuActiveState()
nsresult nsresult
nsMenuBarListener::KeyUp(nsIDOMEvent* aKeyEvent) nsMenuBarListener::KeyUp(nsIDOMEvent* aKeyEvent)
{ {
nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aKeyEvent);
if (!keyEvent) {
return NS_OK;
}
InitAccessKey(); InitAccessKey();
//handlers shouldn't be triggered by non-trusted events. //handlers shouldn't be triggered by non-trusted events.
@ -159,7 +164,6 @@ nsMenuBarListener::KeyUp(nsIDOMEvent* aKeyEvent)
// On a press of the ALT key by itself, we toggle the menu's // On a press of the ALT key by itself, we toggle the menu's
// active/inactive state. // active/inactive state.
// Get the ascii key code. // Get the ascii key code.
nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aKeyEvent);
PRUint32 theChar; PRUint32 theChar;
keyEvent->GetKeyCode(&theChar); keyEvent->GetKeyCode(&theChar);

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

@ -146,8 +146,6 @@ nsMenuPopupFrame::Init(nsIContent* aContent,
nsresult rv = nsBoxFrame::Init(aContent, aParent, aPrevInFlow); nsresult rv = nsBoxFrame::Init(aContent, aParent, aPrevInFlow);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
nsPresContext* presContext = PresContext();
// lookup if we're allowed to overlap the OS bar (menubar/taskbar) from the // lookup if we're allowed to overlap the OS bar (menubar/taskbar) from the
// look&feel object // look&feel object
mMenuCanOverlapOSBar = mMenuCanOverlapOSBar =

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

@ -864,7 +864,7 @@ function searchFailed() {
let failLabel = strings.formatStringFromName("addonsSearchFail.label", let failLabel = strings.formatStringFromName("addonsSearchFail.label",
[brand.GetStringFromName("brandShortName")], 1); [brand.GetStringFromName("brandShortName")], 1);
let failButton = strings.GetStringFromName("addonsSearchFail.button"); let failButton = strings.GetStringFromName("addonsSearchFail.retryButton");
ExtensionsView.displaySectionMessage("repo", failLabel, failButton, true); ExtensionsView.displaySectionMessage("repo", failLabel, failButton, true);
} }

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

@ -6,7 +6,7 @@ addonsSearchNone.search=No matches found
addonsSearchNone.recommended=No recommended add-ons addonsSearchNone.recommended=No recommended add-ons
addonsSearchNone.button=Try Again addonsSearchNone.button=Try Again
addonsSearchFail.label=%S couldn't retrieve add-ons addonsSearchFail.label=%S couldn't retrieve add-ons
addonsSearchFail.button=OK addonsSearchFail.retryButton=Retry
addonsSearchSuccess2.button=Clear Search addonsSearchSuccess2.button=Clear Search
addonsBrowseAll.label=Browse all add-ons addonsBrowseAll.label=Browse all add-ons
addonsBrowseAll.description=addons.mozilla.org has many to explore addonsBrowseAll.description=addons.mozilla.org has many to explore

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

@ -1110,6 +1110,7 @@ pref("font.language.group", "chrome://global/locale/intl.propert
pref("intl.uidirection.ar", "rtl"); pref("intl.uidirection.ar", "rtl");
pref("intl.uidirection.he", "rtl"); pref("intl.uidirection.he", "rtl");
pref("intl.uidirection.fa", "rtl"); pref("intl.uidirection.fa", "rtl");
pref("intl.uidirection.ur", "rtl");
// use en-US hyphenation by default for content tagged with plain lang="en" // use en-US hyphenation by default for content tagged with plain lang="en"
pref("intl.hyphenation-alias.en", "en-us"); pref("intl.hyphenation-alias.en", "en-us");

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

@ -152,6 +152,17 @@
#define NS_ERROR_CORRUPTED_CONTENT \ #define NS_ERROR_CORRUPTED_CONTENT \
NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 29) NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 29)
/**
* While parsing for the first component of a header field using
* syntax as in Content-Disposition or Content-Type, the first component
* was found to be empty, such as in:
*
* Content-Disposition: ; filename=foo
*/
#define NS_ERROR_FIRST_HEADER_FIELD_COMPONENT_EMPTY \
NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 34)
/****************************************************************************** /******************************************************************************
* Connectivity error codes: * Connectivity error codes:
*/ */

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

@ -1943,8 +1943,13 @@ NS_GetContentDispositionFromHeader(const nsACString& aHeader, nsIChannel *aChan
nsAutoString dispToken; nsAutoString dispToken;
rv = mimehdrpar->GetParameter(aHeader, "", fallbackCharset, PR_TRUE, nsnull, rv = mimehdrpar->GetParameter(aHeader, "", fallbackCharset, PR_TRUE, nsnull,
dispToken); dispToken);
if (NS_FAILED(rv))
return nsIChannel::DISPOSITION_ATTACHMENT; if (NS_FAILED(rv)) {
// special case (see bug 272541): empty disposition type handled as "inline"
return rv == NS_ERROR_FIRST_HEADER_FIELD_COMPONENT_EMPTY
? nsIChannel::DISPOSITION_INLINE
: nsIChannel::DISPOSITION_ATTACHMENT;
}
return NS_GetContentDispositionFromToken(dispToken); return NS_GetContentDispositionFromToken(dispToken);
} }

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

@ -57,6 +57,7 @@
#include "nsMIMEHeaderParamImpl.h" #include "nsMIMEHeaderParamImpl.h"
#include "nsReadableUtils.h" #include "nsReadableUtils.h"
#include "nsNativeCharsetUtils.h" #include "nsNativeCharsetUtils.h"
#include "nsNetError.h"
// static functions declared below are moved from mailnews/mime/src/comi18n.cpp // static functions declared below are moved from mailnews/mime/src/comi18n.cpp
@ -181,7 +182,8 @@ nsMIMEHeaderParamImpl::GetParameterInternal(const char *aHeaderValue,
for (; *str && *str != ';' && !nsCRT::IsAsciiSpace(*str); ++str) for (; *str && *str != ';' && !nsCRT::IsAsciiSpace(*str); ++str)
; ;
if (str == start) if (str == start)
return NS_ERROR_UNEXPECTED; return NS_ERROR_FIRST_HEADER_FIELD_COMPONENT_EMPTY;
*aResult = (char *) nsMemory::Clone(start, (str - start) + 1); *aResult = (char *) nsMemory::Clone(start, (str - start) + 1);
NS_ENSURE_TRUE(*aResult, NS_ERROR_OUT_OF_MEMORY); NS_ENSURE_TRUE(*aResult, NS_ERROR_OUT_OF_MEMORY);
(*aResult)[str - start] = '\0'; // null-terminate (*aResult)[str - start] = '\0'; // null-terminate

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

@ -776,7 +776,7 @@ HttpBaseChannel::nsContentEncodings::PrepareForNext(void)
NS_IMETHODIMP NS_IMETHODIMP
HttpBaseChannel::GetRequestMethod(nsACString& aMethod) HttpBaseChannel::GetRequestMethod(nsACString& aMethod)
{ {
aMethod = mRequestHead.Method(); mRequestHead.Method()->ToUTF8String(aMethod);
return NS_OK; return NS_OK;
} }
@ -785,16 +785,27 @@ HttpBaseChannel::SetRequestMethod(const nsACString& aMethod)
{ {
ENSURE_CALLED_BEFORE_ASYNC_OPEN(); ENSURE_CALLED_BEFORE_ASYNC_OPEN();
const nsCString& flatMethod = PromiseFlatCString(aMethod); nsCAutoString upperCaseMethod;
ToUpperCase(aMethod, upperCaseMethod);
// Method names are restricted to valid HTTP tokens. // Method names are restricted to valid HTTP tokens.
if (!nsHttp::IsValidToken(flatMethod)) if (!nsHttp::IsValidToken(upperCaseMethod))
return NS_ERROR_INVALID_ARG; return NS_ERROR_INVALID_ARG;
nsHttpAtom atom = nsHttp::ResolveAtom(flatMethod.get()); nsCOMPtr<nsIAtom> atom = do_GetAtom(upperCaseMethod);
if (!atom)
return NS_ERROR_FAILURE;
// We've changed method names to case sensitive in bug 477578. Some
// methods are kept case insensitive to keep backward compatibility and
// to satisfy XMLHttpRequest specification which demands it.
#define HTTP_METHOD_ATOM(name_, value_)
#define HTTP_CASE_INSENSITIVE_METHOD_ATOM(name_, value_) \
if (nsHttp::name_ == atom) {} else
#include "nsHttpAtomList.h"
#undef HTTP_CASE_INSENSITIVE_METHOD_ATOM
#undef HTTP_METHOD_ATOM
{ // upper case atom doesn't match any case insensitive atom
atom = do_GetAtom(aMethod);
}
mRequestHead.SetMethod(atom); mRequestHead.SetMethod(atom);
return NS_OK; return NS_OK;
} }
@ -1543,7 +1554,7 @@ HttpBaseChannel::SetupReplacementChannel(nsIURI *newURI,
PRInt64 len = clen ? nsCRT::atoll(clen) : -1; PRInt64 len = clen ? nsCRT::atoll(clen) : -1;
uploadChannel2->ExplicitSetUploadStream( uploadChannel2->ExplicitSetUploadStream(
mUploadStream, nsDependentCString(ctype), len, mUploadStream, nsDependentCString(ctype), len,
nsDependentCString(mRequestHead.Method()), nsAtomCString(mRequestHead.Method()),
mUploadStreamHasHeaders); mUploadStreamHasHeaders);
} else { } else {
if (mUploadStreamHasHeaders) { if (mUploadStreamHasHeaders) {
@ -1570,7 +1581,7 @@ HttpBaseChannel::SetupReplacementChannel(nsIURI *newURI,
// we set the upload stream above. This means SetRequestMethod() will // we set the upload stream above. This means SetRequestMethod() will
// be called twice if ExplicitSetUploadStream() gets called above. // be called twice if ExplicitSetUploadStream() gets called above.
httpChannel->SetRequestMethod(nsDependentCString(mRequestHead.Method())); httpChannel->SetRequestMethod(nsAtomCString(mRequestHead.Method()));
} }
// convey the referrer if one was used for this channel to the next one // convey the referrer if one was used for this channel to the next one
if (mReferrer) if (mReferrer)

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

@ -1072,7 +1072,7 @@ HttpChannelChild::AsyncOpen(nsIStreamListener *listener, nsISupports *aContext)
SendAsyncOpen(IPC::URI(mURI), IPC::URI(mOriginalURI), SendAsyncOpen(IPC::URI(mURI), IPC::URI(mOriginalURI),
IPC::URI(mDocumentURI), IPC::URI(mReferrer), mLoadFlags, IPC::URI(mDocumentURI), IPC::URI(mReferrer), mLoadFlags,
mRequestHeaders, mRequestHead.Method(), mRequestHeaders, nsAtomCString(mRequestHead.Method()),
IPC::InputStream(mUploadStream), mUploadStreamHasHeaders, IPC::InputStream(mUploadStream), mUploadStreamHasHeaders,
mPriority, mRedirectionLimit, mAllowPipelining, mPriority, mRedirectionLimit, mAllowPipelining,
mForceAllowThirdPartyCookie, mSendResumeAt, mForceAllowThirdPartyCookie, mSendResumeAt,

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

@ -132,7 +132,7 @@ HttpChannelParent::RecvAsyncOpen(const IPC::URI& aURI,
const IPC::URI& aReferrerURI, const IPC::URI& aReferrerURI,
const PRUint32& loadFlags, const PRUint32& loadFlags,
const RequestHeaderTuples& requestHeaders, const RequestHeaderTuples& requestHeaders,
const nsHttpAtom& requestMethod, const nsCString& requestMethod,
const IPC::InputStream& uploadStream, const IPC::InputStream& uploadStream,
const PRBool& uploadStreamHasHeaders, const PRBool& uploadStreamHasHeaders,
const PRUint16& priority, const PRUint16& priority,
@ -190,7 +190,7 @@ HttpChannelParent::RecvAsyncOpen(const IPC::URI& aURI,
httpChan->SetNotificationCallbacks(channelListener); httpChan->SetNotificationCallbacks(channelListener);
httpChan->SetRequestMethod(nsDependentCString(requestMethod.get())); httpChan->SetRequestMethod(requestMethod);
nsCOMPtr<nsIInputStream> stream(uploadStream); nsCOMPtr<nsIInputStream> stream(uploadStream);
if (stream) { if (stream) {

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

@ -86,7 +86,7 @@ protected:
const IPC::URI& referrerUri, const IPC::URI& referrerUri,
const PRUint32& loadFlags, const PRUint32& loadFlags,
const RequestHeaderTuples& requestHeaders, const RequestHeaderTuples& requestHeaders,
const nsHttpAtom& requestMethod, const nsCString& requestMethod,
const IPC::InputStream& uploadStream, const IPC::InputStream& uploadStream,
const PRBool& uploadStreamHasHeaders, const PRBool& uploadStreamHasHeaders,
const PRUint16& priority, const PRUint16& priority,

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

@ -47,7 +47,6 @@ include "prio.h";
using RequestHeaderTuples; using RequestHeaderTuples;
using nsHttpResponseHead; using nsHttpResponseHead;
using nsHttpAtom;
using IPC::URI; using IPC::URI;
using IPC::InputStream; using IPC::InputStream;
using PRNetAddr; using PRNetAddr;
@ -70,7 +69,7 @@ parent:
URI referrer, URI referrer,
PRUint32 loadFlags, PRUint32 loadFlags,
RequestHeaderTuples requestHeaders, RequestHeaderTuples requestHeaders,
nsHttpAtom requestMethod, nsCString requestMethod,
InputStream uploadStream, InputStream uploadStream,
PRBool uploadStreamHasHeaders, PRBool uploadStreamHasHeaders,
PRUint16 priority, PRUint16 priority,

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

@ -42,6 +42,7 @@
#include "mozilla/Mutex.h" #include "mozilla/Mutex.h"
#include "nsCRT.h" #include "nsCRT.h"
#include "prbit.h" #include "prbit.h"
#include "nsStaticAtom.h"
#if defined(PR_LOGGING) #if defined(PR_LOGGING)
PRLogModuleInfo *gHttpLog = nsnull; PRLogModuleInfo *gHttpLog = nsnull;
@ -60,6 +61,23 @@ enum {
}; };
#undef HTTP_ATOM #undef HTTP_ATOM
// define all method atoms
#define HTTP_METHOD_ATOM(name_, value_) nsIAtom* nsHttp::name_;
#include "nsHttpAtomList.h"
#undef HTTP_METHOD_ATOM
#define HTTP_METHOD_ATOM(name_, value_) \
NS_STATIC_ATOM_BUFFER(name_##_buffer, value_)
#include "nsHttpAtomList.h"
#undef HTTP_METHOD_ATOM
static const nsStaticAtom methodAtomsInfo[] = {
#define HTTP_METHOD_ATOM(name_, value_) \
NS_STATIC_ATOM(name_##_buffer, &nsHttp::name_),
#include "nsHttpAtomList.h"
#undef HTTP_METHOD_ATOM
};
using namespace mozilla; using namespace mozilla;
// we keep a linked list of atoms allocated on the heap for easy clean up when // we keep a linked list of atoms allocated on the heap for easy clean up when
@ -184,6 +202,12 @@ nsHttp::DestroyAtomTable()
} }
} }
void
nsHttp::CreateMethodAtoms()
{
NS_RegisterStaticAtoms(methodAtomsInfo, NS_ARRAY_LENGTH(methodAtomsInfo));
}
// this function may be called from multiple threads // this function may be called from multiple threads
nsHttpAtom nsHttpAtom
nsHttp::ResolveAtom(const char *str) nsHttp::ResolveAtom(const char *str)

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

@ -67,6 +67,7 @@
#include "nsPromiseFlatString.h" #include "nsPromiseFlatString.h"
#include "nsURLHelper.h" #include "nsURLHelper.h"
#include "netCore.h" #include "netCore.h"
#include "nsIAtom.h"
#if defined(PR_LOGGING) #if defined(PR_LOGGING)
// //
@ -164,6 +165,8 @@ struct nsHttp
static nsresult CreateAtomTable(); static nsresult CreateAtomTable();
static void DestroyAtomTable(); static void DestroyAtomTable();
static void CreateMethodAtoms();
// will dynamically add atoms to the table if they don't already exist // will dynamically add atoms to the table if they don't already exist
static nsHttpAtom ResolveAtom(const char *); static nsHttpAtom ResolveAtom(const char *);
static nsHttpAtom ResolveAtom(const nsACString &s) static nsHttpAtom ResolveAtom(const nsACString &s)
@ -215,6 +218,10 @@ struct nsHttp
#define HTTP_ATOM(_name, _value) static nsHttpAtom _name; #define HTTP_ATOM(_name, _value) static nsHttpAtom _name;
#include "nsHttpAtomList.h" #include "nsHttpAtomList.h"
#undef HTTP_ATOM #undef HTTP_ATOM
#define HTTP_METHOD_ATOM(_name, _value) static nsIAtom* _name;
#include "nsHttpAtomList.h"
#undef HTTP_METHOD_ATOM
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

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

@ -50,6 +50,7 @@
The second argument to HTTP_ATOM is the string value of the atom. The second argument to HTTP_ATOM is the string value of the atom.
******/ ******/
#if defined(HTTP_ATOM)
HTTP_ATOM(Accept, "Accept") HTTP_ATOM(Accept, "Accept")
HTTP_ATOM(Accept_Encoding, "Accept-Encoding") HTTP_ATOM(Accept_Encoding, "Accept-Encoding")
HTTP_ATOM(Accept_Language, "Accept-Language") HTTP_ATOM(Accept_Language, "Accept-Language")
@ -123,26 +124,40 @@ HTTP_ATOM(Vary, "Vary")
HTTP_ATOM(Version, "Version") HTTP_ATOM(Version, "Version")
HTTP_ATOM(WWW_Authenticate, "WWW-Authenticate") HTTP_ATOM(WWW_Authenticate, "WWW-Authenticate")
HTTP_ATOM(Warning, "Warning") HTTP_ATOM(Warning, "Warning")
#endif
// methods are atoms too. // methods are atoms too.
// //
// Note: winnt.h defines DELETE macro, so we'll just keep the methods mixedcase // Note: winnt.h defines DELETE macro, so we'll just keep the methods mixedcase
// even though they're normally written all uppercase. -- darin // even though they're normally written all uppercase. -- darin
HTTP_ATOM(Connect, "CONNECT") #if defined(HTTP_METHOD_ATOM)
HTTP_ATOM(Copy, "COPY")
HTTP_ATOM(Delete, "DELETE") #if !defined(HTTP_CASE_INSENSITIVE_METHOD_ATOM)
HTTP_ATOM(Get, "GET") #define HTTP_CASE_INSENSITIVE_METHOD_ATOM HTTP_METHOD_ATOM
HTTP_ATOM(Head, "HEAD") #define UNDEF_HTTP_CASE_INSENSITIVE_METHOD_ATOM
HTTP_ATOM(Index, "INDEX") #endif
HTTP_ATOM(Lock, "LOCK") HTTP_CASE_INSENSITIVE_METHOD_ATOM(Connect, "CONNECT")
HTTP_ATOM(M_Post, "M-POST") HTTP_METHOD_ATOM (Copy, "COPY")
HTTP_ATOM(Mkcol, "MKCOL") HTTP_CASE_INSENSITIVE_METHOD_ATOM(Delete, "DELETE")
HTTP_ATOM(Move, "MOVE") HTTP_CASE_INSENSITIVE_METHOD_ATOM(Get, "GET")
HTTP_ATOM(Options, "OPTIONS") HTTP_CASE_INSENSITIVE_METHOD_ATOM(Head, "HEAD")
HTTP_ATOM(Post, "POST") HTTP_METHOD_ATOM (Index, "INDEX")
HTTP_ATOM(Propfind, "PROPFIND") HTTP_METHOD_ATOM (Lock, "LOCK")
HTTP_ATOM(Proppatch, "PROPPATCH") HTTP_METHOD_ATOM (M_Post, "M-POST")
HTTP_ATOM(Put, "PUT") HTTP_METHOD_ATOM (Mkcol, "MKCOL")
HTTP_ATOM(Trace, "TRACE") HTTP_METHOD_ATOM (Move, "MOVE")
HTTP_ATOM(Unlock, "UNLOCK") HTTP_CASE_INSENSITIVE_METHOD_ATOM(Options, "OPTIONS")
HTTP_CASE_INSENSITIVE_METHOD_ATOM(Post, "POST")
HTTP_METHOD_ATOM (Propfind, "PROPFIND")
HTTP_METHOD_ATOM (Proppatch, "PROPPATCH")
HTTP_CASE_INSENSITIVE_METHOD_ATOM(Put, "PUT")
HTTP_CASE_INSENSITIVE_METHOD_ATOM(Trace, "TRACE")
HTTP_CASE_INSENSITIVE_METHOD_ATOM(Track, "TRACK")
HTTP_METHOD_ATOM (Unlock, "UNLOCK")
#if defined(UNDEF_HTTP_CASE_INSENSITIVE_METHOD_ATOM)
#undef UNDEF_HTTP_CASE_INSENSITIVE_METHOD_ATOM
#undef HTTP_CASE_INSENSITIVE_METHOD_ATOM
#endif
#endif

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

@ -2412,7 +2412,9 @@ nsHttpChannel::CheckCache()
rv = mCacheEntry->GetMetaDataElement("request-method", getter_Copies(buf)); rv = mCacheEntry->GetMetaDataElement("request-method", getter_Copies(buf));
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
nsHttpAtom method = nsHttp::ResolveAtom(buf); nsCOMPtr<nsIAtom> method = do_GetAtom(buf);
NS_ENSURE_TRUE(method, NS_ERROR_OUT_OF_MEMORY);
if (method == nsHttp::Head) { if (method == nsHttp::Head) {
// The cached response does not contain an entity. We can only reuse // The cached response does not contain an entity. We can only reuse
// the response if the current request is also HEAD. // the response if the current request is also HEAD.
@ -2981,7 +2983,7 @@ nsHttpChannel::AddCacheEntryHeaders(nsICacheEntryDescriptor *entry)
// Store the HTTP request method with the cache entry so we can distinguish // Store the HTTP request method with the cache entry so we can distinguish
// for example GET and HEAD responses. // for example GET and HEAD responses.
rv = entry->SetMetaDataElement("request-method", rv = entry->SetMetaDataElement("request-method",
mRequestHead.Method().get()); nsAtomCString(mRequestHead.Method()).get());
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
// Store the HTTP authorization scheme used if any... // Store the HTTP authorization scheme used if any...

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

@ -238,6 +238,8 @@ nsHttpHandler::Init()
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return rv;
nsHttp::CreateMethodAtoms();
mIOService = do_GetService(NS_IOSERVICE_CONTRACTID, &rv); mIOService = do_GetService(NS_IOSERVICE_CONTRACTID, &rv);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
NS_WARNING("unable to continue without io service"); NS_WARNING("unable to continue without io service");

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

@ -47,7 +47,7 @@ nsHttpRequestHead::Flatten(nsACString &buf, PRBool pruneProxyHeaders)
{ {
// note: the first append is intentional. // note: the first append is intentional.
buf.Append(mMethod.get()); buf.Append(nsAtomCString(mMethod));
buf.Append(' '); buf.Append(' ');
buf.Append(mRequestURI); buf.Append(mRequestURI);
buf.AppendLiteral(" HTTP/"); buf.AppendLiteral(" HTTP/");

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

@ -55,12 +55,12 @@ public:
nsHttpRequestHead() : mMethod(nsHttp::Get), mVersion(NS_HTTP_VERSION_1_1) {} nsHttpRequestHead() : mMethod(nsHttp::Get), mVersion(NS_HTTP_VERSION_1_1) {}
~nsHttpRequestHead() {} ~nsHttpRequestHead() {}
void SetMethod(nsHttpAtom method) { mMethod = method; } void SetMethod(nsIAtom *method) { mMethod = method; }
void SetVersion(nsHttpVersion version) { mVersion = version; } void SetVersion(nsHttpVersion version) { mVersion = version; }
void SetRequestURI(const nsCSubstring &s) { mRequestURI = s; } void SetRequestURI(const nsCSubstring &s) { mRequestURI = s; }
nsHttpHeaderArray &Headers() { return mHeaders; } nsHttpHeaderArray &Headers() { return mHeaders; }
nsHttpAtom Method() { return mMethod; } nsIAtom *Method() { return mMethod; }
nsHttpVersion Version() { return mVersion; } nsHttpVersion Version() { return mVersion; }
const nsCSubstring &RequestURI() { return mRequestURI; } const nsCSubstring &RequestURI() { return mRequestURI; }
@ -77,7 +77,7 @@ public:
private: private:
nsHttpHeaderArray mHeaders; nsHttpHeaderArray mHeaders;
nsHttpAtom mMethod; nsCOMPtr<nsIAtom> mMethod;
nsHttpVersion mVersion; nsHttpVersion mVersion;
nsCString mRequestURI; nsCString mRequestURI;
}; };

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

@ -0,0 +1,37 @@
/**
* Test for bug 272541: - Empty disposition type treated as "attachment"
*/
const Cr = Components.results
var tests = [
[ /* the actual bug */
"; filename=foo.html",
Cr.NS_ERROR_FIRST_HEADER_FIELD_COMPONENT_EMPTY],
[ /* regression check, but see bug 671204 */
"filename=foo.html",
"filename=foo.html"],
[ /* sanity check */
"attachment; filename=foo.html",
"attachment"],
];
function run_test() {
var mhp = Components.classes["@mozilla.org/network/mime-hdrparam;1"]
.getService(Components.interfaces.nsIMIMEHeaderParam);
var unused = { value : null };
for (var i = 0; i < tests.length; ++i) {
dump("Testing " + tests[i] + "\n");
try {
do_check_eq(mhp.getParameter(tests[i][0], "", "UTF-8", true, unused),
tests[i][1]);
}
catch (e) {
do_check_eq(e.result, tests[i][1]);
}
}
}

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

@ -0,0 +1,42 @@
const Cc = Components.classes;
const Ci = Components.interfaces;
const testMethods = [
["get", "GET"],
["post", "POST"],
["head", "HEAD"],
["put", "PUT"],
["delete", "DELETE"],
["connect", "CONNECT"],
["options", "OPTIONS"],
["trace", "TRACE"],
["track", "TRACK"],
["copy", "copy"],
["index", "index"],
["lock", "lock"],
["m-post", "m-post"],
["mkcol", "mkcol"],
["move", "move"],
["propfind", "propfind"],
["proppatch", "proppatch"],
["unlock", "unlock"],
["link", "link"],
["foo", "foo"],
["foO", "foO"],
["fOo", "fOo"],
["Foo", "Foo"]
]
function run_test() {
var ios =
Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
var chan = ios.newChannel("http://localhost/", null, null)
.QueryInterface(Components.interfaces.nsIHttpChannel);
for (var i = 0; i < testMethods.length; i++) {
chan.requestMethod = testMethods[i][0];
do_check_eq(chan.requestMethod, testMethods[i][1]);
}
}

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

@ -16,6 +16,7 @@ skip-if = os == "android"
[test_bug248970_cookie.js] [test_bug248970_cookie.js]
[test_bug261425.js] [test_bug261425.js]
[test_bug263127.js] [test_bug263127.js]
[test_bug272541.js]
[test_bug321706.js] [test_bug321706.js]
[test_bug331825.js] [test_bug331825.js]
[test_bug336501.js] [test_bug336501.js]
@ -44,6 +45,7 @@ skip-if = os == "android"
skip-if = os == "android" skip-if = os == "android"
[test_bug468594.js] [test_bug468594.js]
[test_bug470716.js] [test_bug470716.js]
[test_bug477578.js]
[test_bug479413.js] [test_bug479413.js]
[test_bug479485.js] [test_bug479485.js]
[test_bug482601.js] [test_bug482601.js]

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

@ -50,8 +50,8 @@ selectDownloadDir=Select Download Folder
unknownAccept.label=Save File unknownAccept.label=Save File
unknownCancel.label=Cancel unknownCancel.label=Cancel
fileType=%S file fileType=%S file
# LOCALIZATION NOTE (fileSizeWithType): first %S is type, second %S is size, and third %S is unit # LOCALIZATION NOTE (orderedFileSizeWithType): first %S is type, second %S is size, and third %S is unit
fileSizeWithType=%1S (%2S %3S) orderedFileSizeWithType=%1$S (%2$S %3$S)
# LOCALIZATION NOTE (wpsDefaultOS2): OS/2 only, WPS refers to the Workplace Shell and should probably not be translated # LOCALIZATION NOTE (wpsDefaultOS2): OS/2 only, WPS refers to the Workplace Shell and should probably not be translated
wpsDefaultOS2=WPS Default wpsDefaultOS2=WPS Default

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

@ -616,7 +616,7 @@ nsUnknownContentTypeDialog.prototype = {
let [size, unit] = DownloadUtils. let [size, unit] = DownloadUtils.
convertByteUnits(this.mLauncher.contentLength); convertByteUnits(this.mLauncher.contentLength);
type.value = this.dialogElement("strings") type.value = this.dialogElement("strings")
.getFormattedString("fileSizeWithType", .getFormattedString("orderedFileSizeWithType",
[typeString, size, unit]); [typeString, size, unit]);
} }
else { else {

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

@ -280,6 +280,8 @@ nsNativeDragTarget::DragEnter(LPDATAOBJECT pIDataSource,
// Mask effect coming from function call with effect preferred by the source. // Mask effect coming from function call with effect preferred by the source.
mMovePreferred = (preferredEffect & DROPEFFECT_MOVE) != 0; mMovePreferred = (preferredEffect & DROPEFFECT_MOVE) != 0;
nsMemory::Free(tempOutData);
} else { } else {
mMovePreferred = PR_FALSE; mMovePreferred = PR_FALSE;
} }

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

@ -105,7 +105,6 @@ unsigned char *_mbsstr( const unsigned char *str,
#endif #endif
ILCreateFromPathWPtr nsLocalFile::sILCreateFromPathW = NULL; ILCreateFromPathWPtr nsLocalFile::sILCreateFromPathW = NULL;
ILFreePtr nsLocalFile::sILFree = NULL;
SHOpenFolderAndSelectItemsPtr nsLocalFile::sSHOpenFolderAndSelectItems = NULL; SHOpenFolderAndSelectItemsPtr nsLocalFile::sSHOpenFolderAndSelectItems = NULL;
PRLibrary *nsLocalFile::sLibShell = NULL; PRLibrary *nsLocalFile::sLibShell = NULL;
@ -2739,8 +2738,7 @@ nsLocalFile::RevealUsingShell()
{ {
// All of these shell32.dll related pointers should be non NULL // All of these shell32.dll related pointers should be non NULL
// on XP and later. // on XP and later.
if (!sLibShell || !sILCreateFromPathW || if (!sLibShell || !sILCreateFromPathW || !sSHOpenFolderAndSelectItems) {
!sILFree || !sSHOpenFolderAndSelectItems) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
@ -2757,11 +2755,11 @@ nsLocalFile::RevealUsingShell()
} }
const ITEMIDLIST* selection[] = { dir }; const ITEMIDLIST* selection[] = { dir };
UINT count = sizeof(selection) / sizeof(ITEMIDLIST); UINT count = PR_ARRAY_SIZE(selection);
//Perform the open of the directory. //Perform the open of the directory.
hr = sSHOpenFolderAndSelectItems(dir, count, selection, 0); hr = sSHOpenFolderAndSelectItems(dir, count, selection, 0);
sILFree(dir); CoTaskMemFree(dir);
} }
else { else {
// Obtain the parent path of the item we are revealing. // Obtain the parent path of the item we are revealing.
@ -2781,18 +2779,18 @@ nsLocalFile::RevealUsingShell()
// Set the item in the directory to select to the file we want to reveal. // Set the item in the directory to select to the file we want to reveal.
ITEMIDLIST *item = sILCreateFromPathW(mResolvedPath.get()); ITEMIDLIST *item = sILCreateFromPathW(mResolvedPath.get());
if (!item) { if (!item) {
sILFree(dir); CoTaskMemFree(dir);
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
const ITEMIDLIST* selection[] = { item }; const ITEMIDLIST* selection[] = { item };
UINT count = sizeof(selection) / sizeof(ITEMIDLIST); UINT count = PR_ARRAY_SIZE(selection);
//Perform the selection of the file. //Perform the selection of the file.
hr = sSHOpenFolderAndSelectItems(dir, count, selection, 0); hr = sSHOpenFolderAndSelectItems(dir, count, selection, 0);
sILFree(dir); CoTaskMemFree(dir);
sILFree(item); CoTaskMemFree(item);
} }
if (SUCCEEDED(hr)) { if (SUCCEEDED(hr)) {
@ -3106,9 +3104,6 @@ nsLocalFile::GlobalInit()
PR_FindFunctionSymbol(sLibShell, PR_FindFunctionSymbol(sLibShell,
"ILCreateFromPathW"); "ILCreateFromPathW");
// ILFree is available in XP and up.
sILFree = (ILFreePtr) PR_FindFunctionSymbol(sLibShell, "ILFree");
// SHOpenFolderAndSelectItems is available in XP and up. // SHOpenFolderAndSelectItems is available in XP and up.
sSHOpenFolderAndSelectItems = (SHOpenFolderAndSelectItemsPtr) sSHOpenFolderAndSelectItems = (SHOpenFolderAndSelectItemsPtr)
PR_FindFunctionSymbol(sLibShell, PR_FindFunctionSymbol(sLibShell,

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

@ -64,8 +64,7 @@ DEFINE_OLEGUID(IID_IPersistFile, 0x0000010BL, 0, 0);
#include <sys/stat.h> #include <sys/stat.h>
typedef LPITEMIDLIST (WINAPI *ILCreateFromPathWPtr)(PCWSTR); typedef LPITEMIDLIST (WINAPI *ILCreateFromPathWPtr)(PCWSTR);
typedef void (WINAPI *ILFreePtr)(LPITEMIDLIST); typedef HRESULT (WINAPI *SHOpenFolderAndSelectItemsPtr)(PCIDLIST_ABSOLUTE, UINT,
typedef HRESULT (WINAPI *SHOpenFolderAndSelectItemsPtr)(LPCITEMIDLIST, UINT,
PCUITEMID_CHILD_ARRAY, PCUITEMID_CHILD_ARRAY,
DWORD); DWORD);
@ -140,7 +139,6 @@ private:
nsresult RevealUsingShell(); // Uses newer shell API to reveal the path nsresult RevealUsingShell(); // Uses newer shell API to reveal the path
static ILCreateFromPathWPtr sILCreateFromPathW; static ILCreateFromPathWPtr sILCreateFromPathW;
static ILFreePtr sILFree;
static SHOpenFolderAndSelectItemsPtr sSHOpenFolderAndSelectItems; static SHOpenFolderAndSelectItemsPtr sSHOpenFolderAndSelectItems;
static PRLibrary *sLibShell; static PRLibrary *sLibShell;
}; };