зеркало из https://github.com/mozilla/pjs.git
Bug 282588. MozillaContentWindowClass on frames and iframes confuses screen readers. r=ere, sr=neil
This commit is contained in:
Родитель
88149e22ef
Коммит
7b4facebc5
|
@ -675,8 +675,17 @@ nsSubDocumentFrame::ShowDocShell()
|
||||||
if (treeItem) {
|
if (treeItem) {
|
||||||
treeItem->GetItemType(&itemType);
|
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)) {
|
if (NS_FAILED(rv)) {
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
|
@ -209,8 +209,9 @@ enum nsCursor { ///(normal cursor, usually rendered as an arrow)
|
||||||
|
|
||||||
enum nsContentType {
|
enum nsContentType {
|
||||||
eContentTypeInherit = -1,
|
eContentTypeInherit = -1,
|
||||||
eContentTypeUI = 0, // eContentTypeUI must equal 0
|
eContentTypeUI = 0,
|
||||||
eContentTypeContent = 1 // eContentTypeContent must equal 1
|
eContentTypeContent = 1,
|
||||||
|
eContentTypeContentFrame = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
enum nsTopLevelWidgetZPlacement { // for PlaceBehind()
|
enum nsTopLevelWidgetZPlacement { // for PlaceBehind()
|
||||||
|
|
|
@ -4281,6 +4281,7 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT
|
||||||
nsToolkit::mGetClassName((HWND)wParam, className, kMaxClassNameLength);
|
nsToolkit::mGetClassName((HWND)wParam, className, kMaxClassNameLength);
|
||||||
if (wcscmp(className, kWClassNameUI) &&
|
if (wcscmp(className, kWClassNameUI) &&
|
||||||
wcscmp(className, kWClassNameContent) &&
|
wcscmp(className, kWClassNameContent) &&
|
||||||
|
wcscmp(className, kWClassNameContentFrame) &&
|
||||||
wcscmp(className, kWClassNameGeneral)) {
|
wcscmp(className, kWClassNameGeneral)) {
|
||||||
isMozWindowTakingFocus = PR_FALSE;
|
isMozWindowTakingFocus = PR_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -4398,6 +4399,7 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT
|
||||||
nsToolkit::mGetClassName((HWND)wParam, className, kMaxClassNameLength);
|
nsToolkit::mGetClassName((HWND)wParam, className, kMaxClassNameLength);
|
||||||
if (wcscmp(className, kWClassNameUI) &&
|
if (wcscmp(className, kWClassNameUI) &&
|
||||||
wcscmp(className, kWClassNameContent) &&
|
wcscmp(className, kWClassNameContent) &&
|
||||||
|
wcscmp(className, kWClassNameContentFrame) &&
|
||||||
wcscmp(className, kWClassNameGeneral)) {
|
wcscmp(className, kWClassNameGeneral)) {
|
||||||
isMozWindowTakingFocus = PR_FALSE;
|
isMozWindowTakingFocus = PR_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -4791,6 +4793,11 @@ LPCWSTR nsWindow::WindowClassW()
|
||||||
BOOL succeeded = nsToolkit::mRegisterClass(&wc) != 0;
|
BOOL succeeded = nsToolkit::mRegisterClass(&wc) != 0;
|
||||||
nsWindow::sIsRegistered = succeeded;
|
nsWindow::sIsRegistered = succeeded;
|
||||||
|
|
||||||
|
wc.lpszClassName = kWClassNameContentFrame;
|
||||||
|
if (!nsToolkit::mRegisterClass(&wc)) {
|
||||||
|
nsWindow::sIsRegistered = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
wc.lpszClassName = kWClassNameContent;
|
wc.lpszClassName = kWClassNameContent;
|
||||||
if (!nsToolkit::mRegisterClass(&wc)) {
|
if (!nsToolkit::mRegisterClass(&wc)) {
|
||||||
nsWindow::sIsRegistered = FALSE;
|
nsWindow::sIsRegistered = FALSE;
|
||||||
|
@ -4817,6 +4824,9 @@ LPCWSTR nsWindow::WindowClassW()
|
||||||
if (mContentType == eContentTypeContent) {
|
if (mContentType == eContentTypeContent) {
|
||||||
return kWClassNameContent;
|
return kWClassNameContent;
|
||||||
}
|
}
|
||||||
|
if (mContentType == eContentTypeContentFrame) {
|
||||||
|
return kWClassNameContentFrame;
|
||||||
|
}
|
||||||
if (mContentType == eContentTypeUI) {
|
if (mContentType == eContentTypeUI) {
|
||||||
return kWClassNameUI;
|
return kWClassNameUI;
|
||||||
}
|
}
|
||||||
|
@ -4870,6 +4880,9 @@ LPCTSTR nsWindow::WindowClass()
|
||||||
if (classNameW == kWClassNameContent) {
|
if (classNameW == kWClassNameContent) {
|
||||||
return kClassNameContent;
|
return kClassNameContent;
|
||||||
}
|
}
|
||||||
|
if (classNameW == kWClassNameContentFrame) {
|
||||||
|
return kClassNameContentFrame;
|
||||||
|
}
|
||||||
return kClassNameGeneral;
|
return kClassNameGeneral;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -87,10 +87,12 @@ const PRUint32 kMaxClassNameLength = 40;
|
||||||
const LPCWSTR kWClassNameHidden = L"MozillaHiddenWindowClass";
|
const LPCWSTR kWClassNameHidden = L"MozillaHiddenWindowClass";
|
||||||
const LPCWSTR kWClassNameUI = L"MozillaUIWindowClass";
|
const LPCWSTR kWClassNameUI = L"MozillaUIWindowClass";
|
||||||
const LPCWSTR kWClassNameContent = L"MozillaContentWindowClass";
|
const LPCWSTR kWClassNameContent = L"MozillaContentWindowClass";
|
||||||
|
const LPCWSTR kWClassNameContentFrame = L"MozillaContentFrameWindowClass";
|
||||||
const LPCWSTR kWClassNameGeneral = L"MozillaWindowClass";
|
const LPCWSTR kWClassNameGeneral = L"MozillaWindowClass";
|
||||||
const LPCSTR kClassNameHidden = "MozillaHiddenWindowClass";
|
const LPCSTR kClassNameHidden = "MozillaHiddenWindowClass";
|
||||||
const LPCSTR kClassNameUI = "MozillaUIWindowClass";
|
const LPCSTR kClassNameUI = "MozillaUIWindowClass";
|
||||||
const LPCSTR kClassNameContent = "MozillaContentWindowClass";
|
const LPCSTR kClassNameContent = "MozillaContentWindowClass";
|
||||||
|
const LPCSTR kClassNameContentFrame = "MozillaContentFrameWindowClass";
|
||||||
const LPCSTR kClassNameGeneral = "MozillaWindowClass";
|
const LPCSTR kClassNameGeneral = "MozillaWindowClass";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Загрузка…
Ссылка в новой задаче