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 12:57:08 +00:00
Родитель c74feab691
Коммит 7e79c9e667
3 изменённых файлов: 27 добавлений и 12 удалений

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

@ -1351,9 +1351,14 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
if (content->IsNodeOfType(nsINode::eTEXT)) {
// --- Create HTML for visible text frames ---
if (frame->IsEmpty()) {
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);
}

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

@ -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
// 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.

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

@ -3052,14 +3052,19 @@ nsTextPaintStyle::GetResolvedForeColor(nscolor aColor,
#ifdef ACCESSIBILITY
NS_IMETHODIMP nsTextFrame::GetAccessible(nsIAccessible** aAccessible)
{
if (!IsEmpty() || GetNextInFlow()) {
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