Backed out changeset 3138300cf7c8 (bug 1916081) for causing Wc failures on replace_documentElement_children_after_window_closed.html CLOSED TREE

This commit is contained in:
Norisz Fay 2024-09-04 06:58:57 +03:00
Родитель fc663f2185
Коммит 31c9c0f6e5
3 изменённых файлов: 10 добавлений и 45 удалений

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

@ -863,14 +863,16 @@ nsresult HTMLEditor::FocusedElementOrDocumentBecomesNotEditable(
// the editing state change. Note that if the window of the HTMLEditor has
// already lost focus, we don't need to do that and we should not touch the
// other windows.
if (const RefPtr<nsPresContext> presContext = aDocument.GetPresContext()) {
const RefPtr<Element> focusedElementInDocument =
Element::FromNodeOrNull(aDocument.GetUnretargetedFocusedContent());
MOZ_ASSERT_IF(focusedElementInDocument,
focusedElementInDocument->GetPresContext(
Element::PresContextFor::eForComposedDoc));
IMEStateManager::MaybeOnEditableStateDisabled(*presContext,
focusedElementInDocument);
if (aHTMLEditor->OurWindowHasFocus()) {
if (RefPtr<nsPresContext> presContext = aHTMLEditor->GetPresContext()) {
RefPtr<Element> focusedElement =
nsFocusManager::GetFocusedElementStatic();
MOZ_ASSERT_IF(focusedElement,
focusedElement->GetPresContext(
Element::PresContextFor::eForComposedDoc));
IMEStateManager::MaybeOnEditableStateDisabled(*presContext,
focusedElement);
}
}
return rv;

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

@ -1,3 +0,0 @@
[replace_documentElement_children_after_window_closed.html]
disabled:
if verify: crash in verify mode

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

@ -1,34 +0,0 @@
<!doctype html>
<html class="reftest-wait">
<head>
<meta charset="utf-8">
<script>
let waitForWindowClose;
addEventListener("load", () => {
try {
document.documentElement.setHTML("", {});
} catch (e) {}
Promise.all([waitForWindowClose]).then(
() => document.documentElement.removeAttribute("class")
);
});
</script>
</head>
<body>
<header contenteditable="true">
<script>
(() => {
document.querySelector("header[contenteditable]").focus();
const db = indexedDB.open("DB_FOO", 1);
waitForWindowClose = new Promise(resolve => {
db.onsuccess = () => {
window.close();
}
resolve();
});
})();
</script>
<iframe src="&gt;"></iframe>
</header>
</body>
</html>