Bug 405248 - Space between embedded objects characters is missing r=aaronleventhal a=mtschrep

This commit is contained in:
Evan.Yan@Sun.COM 2007-12-19 04:57:08 -08:00
parent 4386dbad59
commit 1211290d23
3 changed files with 27 additions and 12 deletions

View File

@ -1351,8 +1351,13 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
if (content->IsNodeOfType(nsINode::eTEXT)) {
// --- Create HTML for visible text frames ---
if (frame->IsEmpty()) {
*aIsHidden = PR_TRUE;
return NS_OK;
nsAutoString renderedWhitespace;
frame->GetRenderedText(&renderedWhitespace, nsnull, nsnull, 0, 1);
if (renderedWhitespace.IsEmpty()) {
// Really empty -- nothing is rendered
*aIsHidden = PR_TRUE;
return NS_OK;
}
}
frame->GetAccessible(getter_AddRefs(newAcc));
return InitAccessible(newAcc, aAccessible, nsnull);

View File

@ -937,12 +937,17 @@ PRBool nsAccessible::IsVisible(PRBool *aIsOffscreen)
&rectVisibility);
if (rectVisibility == nsRectVisibility_kZeroAreaRect) {
if (frame->GetNextContinuation()) {
nsIAtom *frameType = frame->GetType();
if (frameType == nsAccessibilityAtoms::textFrame) {
// Zero area rects can occur in the first frame of a multi-frame text flow,
// in which case the next frame exists because the text flow is visible
rectVisibility = nsRectVisibility_kVisible;
// in which case the rendered text is not empty and the frame should not be marked invisible
nsAutoString renderedText;
frame->GetRenderedText (&renderedText, nsnull, nsnull, 0, 1);
if (!renderedText.IsEmpty()) {
rectVisibility = nsRectVisibility_kVisible;
}
}
else if (IsCorrectFrameType(frame, nsAccessibilityAtoms::inlineFrame)) {
else if (frameType == nsAccessibilityAtoms::inlineFrame) {
// Yuck. Unfortunately inline frames can contain larger frames inside of them,
// so we can't really believe this is a zero area rect without checking more deeply.
// GetBounds() will do that for us.

View File

@ -3052,14 +3052,19 @@ nsTextPaintStyle::GetResolvedForeColor(nscolor aColor,
#ifdef ACCESSIBILITY
NS_IMETHODIMP nsTextFrame::GetAccessible(nsIAccessible** aAccessible)
{
if (!IsEmpty() || GetNextInFlow()) {
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
if (accService) {
return accService->CreateHTMLTextAccessible(static_cast<nsIFrame*>(this), aAccessible);
if (IsEmpty()) {
nsAutoString renderedWhitespace;
GetRenderedText(&renderedWhitespace, nsnull, nsnull, 0, 1);
if (renderedWhitespace.IsEmpty()) {
return NS_ERROR_FAILURE;
}
}
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
if (accService) {
return accService->CreateHTMLTextAccessible(static_cast<nsIFrame*>(this), aAccessible);
}
return NS_ERROR_FAILURE;
}
#endif