Bug 282588. MozillaContentWindowClass on frames and iframes confuses screen readers. r=ere, sr=neil

This commit is contained in:
aaronleventhal%moonset.net 2005-02-18 14:24:43 +00:00
parent 42a221afef
commit 6f010e6426
4 changed files with 38 additions and 13 deletions

View File

@ -675,8 +675,17 @@ nsSubDocumentFrame::ShowDocShell()
if (treeItem) {
treeItem->GetItemType(&itemType);
}
rv = CreateViewAndWidget(itemType == nsIDocShellTreeItem::typeChrome ?
eContentTypeUI : eContentTypeContent);
nsContentType contentType;
if (itemType == nsIDocShellTreeItem::typeChrome) {
contentType = eContentTypeUI;
}
else {
nsCOMPtr<nsIDocShellTreeItem> sameTypeParent;
treeItem->GetSameTypeParent(getter_AddRefs(sameTypeParent));
contentType = sameTypeParent ? eContentTypeContentFrame : eContentTypeContent;
}
rv = CreateViewAndWidget(contentType);
if (NS_FAILED(rv)) {
return rv;
}

View File

@ -209,8 +209,9 @@ enum nsCursor { ///(normal cursor, usually rendered as an arrow)
enum nsContentType {
eContentTypeInherit = -1,
eContentTypeUI = 0, // eContentTypeUI must equal 0
eContentTypeContent = 1 // eContentTypeContent must equal 1
eContentTypeUI = 0,
eContentTypeContent = 1,
eContentTypeContentFrame = 2
};
enum nsTopLevelWidgetZPlacement { // for PlaceBehind()

View File

@ -4281,6 +4281,7 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT
nsToolkit::mGetClassName((HWND)wParam, className, kMaxClassNameLength);
if (wcscmp(className, kWClassNameUI) &&
wcscmp(className, kWClassNameContent) &&
wcscmp(className, kWClassNameContentFrame) &&
wcscmp(className, kWClassNameGeneral)) {
isMozWindowTakingFocus = PR_FALSE;
}
@ -4398,6 +4399,7 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT
nsToolkit::mGetClassName((HWND)wParam, className, kMaxClassNameLength);
if (wcscmp(className, kWClassNameUI) &&
wcscmp(className, kWClassNameContent) &&
wcscmp(className, kWClassNameContentFrame) &&
wcscmp(className, kWClassNameGeneral)) {
isMozWindowTakingFocus = PR_FALSE;
}
@ -4791,6 +4793,11 @@ LPCWSTR nsWindow::WindowClassW()
BOOL succeeded = nsToolkit::mRegisterClass(&wc) != 0;
nsWindow::sIsRegistered = succeeded;
wc.lpszClassName = kWClassNameContentFrame;
if (!nsToolkit::mRegisterClass(&wc)) {
nsWindow::sIsRegistered = FALSE;
}
wc.lpszClassName = kWClassNameContent;
if (!nsToolkit::mRegisterClass(&wc)) {
nsWindow::sIsRegistered = FALSE;
@ -4817,6 +4824,9 @@ LPCWSTR nsWindow::WindowClassW()
if (mContentType == eContentTypeContent) {
return kWClassNameContent;
}
if (mContentType == eContentTypeContentFrame) {
return kWClassNameContentFrame;
}
if (mContentType == eContentTypeUI) {
return kWClassNameUI;
}
@ -4870,6 +4880,9 @@ LPCTSTR nsWindow::WindowClass()
if (classNameW == kWClassNameContent) {
return kClassNameContent;
}
if (classNameW == kWClassNameContentFrame) {
return kClassNameContentFrame;
}
return kClassNameGeneral;
}

View File

@ -83,15 +83,17 @@ class nsIFile;
* For example, changing the window classes
* could break touchpad scrolling or screen readers.
*/
const PRUint32 kMaxClassNameLength = 40;
const LPCWSTR kWClassNameHidden = L"MozillaHiddenWindowClass";
const LPCWSTR kWClassNameUI = L"MozillaUIWindowClass";
const LPCWSTR kWClassNameContent = L"MozillaContentWindowClass";
const LPCWSTR kWClassNameGeneral = L"MozillaWindowClass";
const LPCSTR kClassNameHidden = "MozillaHiddenWindowClass";
const LPCSTR kClassNameUI = "MozillaUIWindowClass";
const LPCSTR kClassNameContent = "MozillaContentWindowClass";
const LPCSTR kClassNameGeneral = "MozillaWindowClass";
const PRUint32 kMaxClassNameLength = 40;
const LPCWSTR kWClassNameHidden = L"MozillaHiddenWindowClass";
const LPCWSTR kWClassNameUI = L"MozillaUIWindowClass";
const LPCWSTR kWClassNameContent = L"MozillaContentWindowClass";
const LPCWSTR kWClassNameContentFrame = L"MozillaContentFrameWindowClass";
const LPCWSTR kWClassNameGeneral = L"MozillaWindowClass";
const LPCSTR kClassNameHidden = "MozillaHiddenWindowClass";
const LPCSTR kClassNameUI = "MozillaUIWindowClass";
const LPCSTR kClassNameContent = "MozillaContentWindowClass";
const LPCSTR kClassNameContentFrame = "MozillaContentFrameWindowClass";
const LPCSTR kClassNameGeneral = "MozillaWindowClass";
/**
* Native IMM wrapper