mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Bug 1276562 - Hang when inserting a bulleted or numbered list into a contentEditable, r=yzen
This commit is contained in:
parent
7d48b7906b
commit
80432e7d0a
@ -92,6 +92,17 @@ HTMLLIAccessible::Bounds() const
|
||||
return rect;
|
||||
}
|
||||
|
||||
bool
|
||||
HTMLLIAccessible::InsertChildAt(uint32_t aIndex, Accessible* aChild)
|
||||
{
|
||||
// Adjust index if there's a bullet.
|
||||
if (mBullet && aIndex == 0 && aChild != mBullet) {
|
||||
return HyperTextAccessible::InsertChildAt(aIndex + 1, aChild);
|
||||
}
|
||||
|
||||
return HyperTextAccessible::InsertChildAt(aIndex, aChild);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// HTMLLIAccessible: public
|
||||
|
||||
|
@ -53,6 +53,8 @@ public:
|
||||
virtual a11y::role NativeRole() override;
|
||||
virtual uint64_t NativeState() override;
|
||||
|
||||
virtual bool InsertChildAt(uint32_t aIndex, Accessible* aChild) override;
|
||||
|
||||
// HTMLLIAccessible
|
||||
HTMLListBulletAccessible* Bullet() const { return mBullet; }
|
||||
void UpdateBullet(bool aHasBullet);
|
||||
|
@ -157,7 +157,7 @@ public:
|
||||
virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
|
||||
virtual Relation RelationByType(RelationType aRelationType) override;
|
||||
|
||||
bool InsertChildAt(uint32_t aIndex, Accessible* aChild) override;
|
||||
virtual bool InsertChildAt(uint32_t aIndex, Accessible* aChild) override;
|
||||
|
||||
protected:
|
||||
virtual ~HTMLTableAccessible() {}
|
||||
|
@ -82,6 +82,28 @@
|
||||
this.onProcessed = function showProcessor_onProcessed()
|
||||
{
|
||||
testLiAccessibleTree();
|
||||
gSequence.processNext();
|
||||
}
|
||||
};
|
||||
|
||||
function textReplaceProcessor()
|
||||
{
|
||||
this.liNode = getNode("li");
|
||||
|
||||
this.process = function textReplaceProcessor_process()
|
||||
{
|
||||
this.liNode.textContent = "hey";
|
||||
}
|
||||
|
||||
this.onProcessed = function textReplaceProcessor_onProcessed()
|
||||
{
|
||||
var tree = {
|
||||
LISTITEM: [
|
||||
{ STATICTEXT: [] },
|
||||
{ TEXT_LEAF: [] }
|
||||
]
|
||||
};
|
||||
testAccessibleTree(this.liNode, tree);
|
||||
SimpleTest.finish();
|
||||
}
|
||||
};
|
||||
@ -89,8 +111,9 @@
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Test
|
||||
|
||||
var gSequence = null;
|
||||
//gA11yEventDumpToConsole = true;
|
||||
|
||||
var gSequence = null;
|
||||
function doTest()
|
||||
{
|
||||
testLiAccessibleTree();
|
||||
@ -101,6 +124,8 @@
|
||||
"hide HTML li");
|
||||
gSequence.append(new showProcessor(), EVENT_SHOW, getNode("li"),
|
||||
"show HTML li");
|
||||
gSequence.append(new textReplaceProcessor(), EVENT_REORDER, getNode("li"),
|
||||
"change text of HTML li");
|
||||
|
||||
gSequence.processNext(); // SimpleTest.finish() will be called in the end
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user