Bug 1550561 - Support edit context menu on HTML inputs in chrome documents. r=bgrins

Differential Revision: https://phabricator.services.mozilla.com/D30552

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tim Nguyen 2019-05-12 13:45:53 +00:00
Родитель 035ea12dc3
Коммит e99e478383
3 изменённых файлов: 3 добавлений и 2 удалений

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

@ -64,7 +64,7 @@ window.addEventListener("contextmenu", (e) => {
// Note that there's not a risk of e.target being XBL anonymous content for <textbox> (which manages
// its own context menu), because e.target will be the XBL binding parent in that case.
let needsContextMenu = e.target.ownerDocument == document && !e.defaultPrevented && (
(e.target.localName == "textarea" && e.target.namespaceURI == HTML_NS)
(["textarea", "input"].includes(e.target.localName) && e.target.namespaceURI == HTML_NS)
|| e.target.closest("textbox[is='search-textbox']")
);

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

@ -24,7 +24,7 @@
</commandset>
<html:textarea />
<html:input />
<textbox is="search-textbox"/>
</window>

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

@ -21,6 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1513343
const elements = [
win.document.querySelector("textarea"),
win.document.querySelector("input"),
win.document.querySelector("textbox[is='search-textbox']"),
];
for (const element of elements) {