Bug 346833. Content for :before and :after no longer exposed. r=ginn.chen, sr=roc

This commit is contained in:
aaronleventhal%moonset.net 2006-09-08 14:42:25 +00:00
Родитель cadc9b51db
Коммит 0c9a982c2d
2 изменённых файлов: 26 добавлений и 25 удалений

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

@ -272,15 +272,29 @@ NS_IMETHODIMP nsAccessibleTreeWalker::GetFirstChild()
void nsAccessibleTreeWalker::UpdateFrame(PRBool aTryFirstChild)
{
if (mState.frame) {
mState.frame = aTryFirstChild? mState.frame->GetFirstChild(nsnull) :
mState.frame->GetNextSibling();
if (mState.frame && mState.siblingIndex < 0 &&
mState.frame->GetContent()->IsNativeAnonymous()) {
if (!mState.frame) {
return;
}
if (aTryFirstChild) {
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.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()
{
if (!mBulletAccessible || !mWeakShell) {
nsAccessibleWrap::CacheChildren();
if (!mWeakShell || mAccChildCount != eChildCountUninitialized) {
return;
}
if (mAccChildCount == eChildCountUninitialized) {
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();
nsAccessibleWrap::CacheChildren();
nsCOMPtr<nsPIAccessible> privatePrevAccessible = mBulletAccessible.get();
while (walker.mState.accessible) {
++ childCount;
privatePrevAccessible->SetNextSibling(walker.mState.accessible);
privatePrevAccessible = do_QueryInterface(walker.mState.accessible);
privatePrevAccessible->SetParent(this);
walker.GetNextSibling();
}
mAccChildCount = childCount;
if (mBulletAccessible) {
mBulletAccessible->SetNextSibling(mFirstChild);
mBulletAccessible->SetParent(this); // Set weak parent;
SetFirstChild(mBulletAccessible);
++ mAccChildCount;
}
}