From 538103114f5d05089dd76ca51e84a7f2de1a3c80 Mon Sep 17 00:00:00 2001 From: "aaronleventhal%moonset.net" Date: Fri, 13 Apr 2007 11:38:46 +0000 Subject: [PATCH] Bug 356829. Do not expose table layout-guess=true when table is inside editable area. r=ginn.chen --- accessible/src/base/nsDocAccessible.cpp | 3 +++ accessible/src/html/nsHTMLTableAccessible.cpp | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/accessible/src/base/nsDocAccessible.cpp b/accessible/src/base/nsDocAccessible.cpp index c3798dd0814..a2319489e1e 100644 --- a/accessible/src/base/nsDocAccessible.cpp +++ b/accessible/src/base/nsDocAccessible.cpp @@ -228,6 +228,9 @@ nsDocAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState) if (!editor) { *aState |= nsIAccessibleStates::STATE_READONLY; } + else if (aExtraState) { + *aExtraState |= nsIAccessibleStates::EXT_STATE_EDITABLE; + } return NS_OK; } diff --git a/accessible/src/html/nsHTMLTableAccessible.cpp b/accessible/src/html/nsHTMLTableAccessible.cpp index 75b5ea2290d..2e470865505 100644 --- a/accessible/src/html/nsHTMLTableAccessible.cpp +++ b/accessible/src/html/nsHTMLTableAccessible.cpp @@ -785,6 +785,15 @@ NS_IMETHODIMP nsHTMLTableAccessible::IsProbablyForLayout(PRBool *aIsProbablyForL return NS_ERROR_FAILURE; // Table shut down } + nsCOMPtr docAccessible = do_QueryInterface(nsCOMPtr(GetDocAccessible())); + if (docAccessible) { + PRUint32 state, extState; + docAccessible->GetFinalState(&state, &extState); + if (extState & nsIAccessibleStates::EXT_STATE_EDITABLE) { // Need to see all elements while document is being edited + RETURN_LAYOUT_ANSWER(PR_FALSE, "In editable document"); + } + } + // Check role and role attribute PRBool hasNonTableRole = (Role(this) != nsIAccessibleRole::ROLE_TABLE); if (hasNonTableRole) {