зеркало из https://github.com/mozilla/pjs.git
Bug 346833. Content for :before and :after no longer exposed. r=ginn.chen, sr=roc
This commit is contained in:
Родитель
af06ddacaf
Коммит
720911f967
|
@ -272,15 +272,29 @@ NS_IMETHODIMP nsAccessibleTreeWalker::GetFirstChild()
|
||||||
|
|
||||||
void nsAccessibleTreeWalker::UpdateFrame(PRBool aTryFirstChild)
|
void nsAccessibleTreeWalker::UpdateFrame(PRBool aTryFirstChild)
|
||||||
{
|
{
|
||||||
if (mState.frame) {
|
if (!mState.frame) {
|
||||||
mState.frame = aTryFirstChild? mState.frame->GetFirstChild(nsnull) :
|
return;
|
||||||
mState.frame->GetNextSibling();
|
}
|
||||||
if (mState.frame && mState.siblingIndex < 0 &&
|
if (aTryFirstChild) {
|
||||||
mState.frame->GetContent()->IsNativeAnonymous()) {
|
nsIFrame *parentFrame = mState.frame;
|
||||||
|
mState.frame = mState.frame->GetFirstChild(nsnull);
|
||||||
|
if (mState.frame && mState.siblingIndex < 0) {
|
||||||
|
// Container frames can contain generated content frames from
|
||||||
|
// :before and :after style rules, so we walk their frame trees
|
||||||
|
// instead of content trees
|
||||||
mState.domNode = do_QueryInterface(mState.frame->GetContent());
|
mState.domNode = do_QueryInterface(mState.frame->GetContent());
|
||||||
mState.siblingIndex = eSiblingsWalkFrames;
|
mState.siblingIndex = eSiblingsWalkFrames;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
nsIContent *currentContent = mState.frame->GetContent();
|
||||||
|
while (PR_TRUE) { // Get next sibling with different content
|
||||||
|
mState.frame = mState.frame->GetNextSibling();
|
||||||
|
if (!mState.frame || mState.frame->GetContent() != currentContent) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -254,30 +254,17 @@ NS_IMETHODIMP nsHTMLLIAccessible::GetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *wid
|
||||||
|
|
||||||
void nsHTMLLIAccessible::CacheChildren()
|
void nsHTMLLIAccessible::CacheChildren()
|
||||||
{
|
{
|
||||||
if (!mBulletAccessible || !mWeakShell) {
|
if (!mWeakShell || mAccChildCount != eChildCountUninitialized) {
|
||||||
nsAccessibleWrap::CacheChildren();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mAccChildCount == eChildCountUninitialized) {
|
nsAccessibleWrap::CacheChildren();
|
||||||
SetFirstChild(mBulletAccessible);
|
|
||||||
mBulletAccessible->SetParent(this); // Set weak parent;
|
|
||||||
PRInt32 childCount = 1;
|
|
||||||
PRBool allowsAnonChildren = PR_FALSE;
|
|
||||||
GetAllowsAnonChildAccessibles(&allowsAnonChildren);
|
|
||||||
nsAccessibleTreeWalker walker(mWeakShell, mDOMNode, allowsAnonChildren);
|
|
||||||
walker.mState.frame = GetFrame();
|
|
||||||
walker.GetFirstChild();
|
|
||||||
|
|
||||||
nsCOMPtr<nsPIAccessible> privatePrevAccessible = mBulletAccessible.get();
|
if (mBulletAccessible) {
|
||||||
while (walker.mState.accessible) {
|
mBulletAccessible->SetNextSibling(mFirstChild);
|
||||||
++ childCount;
|
mBulletAccessible->SetParent(this); // Set weak parent;
|
||||||
privatePrevAccessible->SetNextSibling(walker.mState.accessible);
|
SetFirstChild(mBulletAccessible);
|
||||||
privatePrevAccessible = do_QueryInterface(walker.mState.accessible);
|
++ mAccChildCount;
|
||||||
privatePrevAccessible->SetParent(this);
|
|
||||||
walker.GetNextSibling();
|
|
||||||
}
|
|
||||||
mAccChildCount = childCount;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче