Skip to content

Commit af48354

Browse files
masayuki-nakanomoz-wptsync-bot
authored andcommitted
Make nsGenericHTMLElement::GetAssociatedEditor return an extant editor
This is used only for notifying editors of new `spellcheck` value when `spellcheck` attr is changed. Therefore, it does not need to create new `TextEditor`s immediately because new `TextEditor` will be initialized with the latest `spellcheck` value. And also the root caller is `AfterSetAttr`. So, any script shouldn't run when initializing new `TextEditor` instances. So, the method should return only extant `TextEditor` when it's a `TextControlElement`. Additionally, this refactors the related methods to return a raw pointer of `EditorBase`. Differential Revision: https://phabricator.services.mozilla.com/D320015 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=2040051 gecko-commit: 56eb775c98df1dcd7c908656df11b9a4c3c63240 gecko-commit-git: 306c6d3d179b01aac89274e4c35c0bfe78eab85d gecko-reviewers: dom-core-reviewers, smaug
1 parent 6c7127b commit af48354

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<script>
6+
"use strict";
7+
8+
addEventListener("DOMContentLoaded", async () => {
9+
const iframe = document.querySelector("iframe");
10+
for (let i = 0; i < 20; i++) {
11+
const waitForLoad = new Promise(resolve => {
12+
iframe.addEventListener("load", resolve, {once: true});
13+
});
14+
iframe.srcdoc =
15+
`<style>` +
16+
`input {` +
17+
` grid-column-end: line_name_0;` +
18+
` position: fixed !important;` +
19+
` inset: anchor(inside);` +
20+
`}` +
21+
`</style>` +
22+
`<` + `script>` +
23+
`addEventListener("DOMContentLoaded", () => {` +
24+
` focus();` +
25+
` const input = document.querySelector("input[type=number]");` +
26+
` document.documentElement.setAttribute("spellcheck", "false");` +
27+
` document.documentElement.style.display = "none";` +
28+
` document.documentElement.getBoundingClientRect();` +
29+
` document.documentElement.style.display = "";` +
30+
` input.setAttribute("type", "password");` +
31+
`}, {once: true});` +
32+
`</` + `script>` +
33+
`<input type="number" value="63">`;
34+
await waitForLoad;
35+
}
36+
}, {once: true});
37+
</script>
38+
</head>
39+
<body>
40+
<iframe></iframe>
41+
</body>
42+
</html>

0 commit comments

Comments
 (0)