mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
73b1eb5bc6
This is a rework for the issue in bug 1516963. The condition `aFrame->IsFrameOfType(nsIFrame::eReplaced)` was added to avoid breaking editor/libeditor/tests/test_abs_positioner_positioning_elements.html because it contains blockified (position:absolute) images in contenteditable, and we don't want these images to use frame edge. But for non-editable undraggable images, which have display:inline, we want them to use frame edge to avoid being selected by a single-clicking. Note that non-editable draggable images use a different code patch to handle their operations. I think it easier to understand by checking the frame types directly. As for images, we want non-editable images to use frame edge, but not those editable ones because editor has its own logic to handle all the dragging operations, etc. Using frame edge for editable images makes them undraggable, and fails test_abs_positioner_positioning_elements.html. Add more tests for empty inline-grid, inline-flex, inline-table, video, to ensure the behavior is not changed. We don't want them to be selected by a single-clicking, either. Note I only test video's selection is collapsed when single-clicking because I failed to turn off picture-in-picture on <video> in test_reftests_with_caret.html. Differential Revision: https://phabricator.services.mozilla.com/D34909 --HG-- extra : moz-landing-system : lando
34 lines
1.1 KiB
HTML
34 lines
1.1 KiB
HTML
<!DOCTYPE HTML>
|
|
<html class="reftest-wait">
|
|
<title>Bug 1516963: Test AccessibleCaret doesn't show when clicking on an undraggable image button.</title>
|
|
<script src="/tests/SimpleTest/EventUtils.js"></script>
|
|
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
<style>
|
|
#container {
|
|
border: 1px solid blue;
|
|
width: 100px;
|
|
height: 100px;
|
|
background-color: yellow;
|
|
}
|
|
input {
|
|
border: 0;
|
|
outline: 0;
|
|
}
|
|
</style>
|
|
<script>
|
|
document.addEventListener("selectionchange", () => {
|
|
ok(window.getSelection().isCollapsed, "The selection should be collapsed!");
|
|
});
|
|
|
|
function click() {
|
|
let img = document.getElementById("img");
|
|
synthesizeMouseAtCenter(img, {});
|
|
setTimeout(() => { document.documentElement.removeAttribute("class"); });
|
|
}
|
|
</script>
|
|
<body onload="SimpleTest.waitForFocus(click);">
|
|
<div id="container"><input draggable="false" width="60px" height="40px" type="image" src="chrome/blue-32x32.png" id="img"></div>
|
|
</body>
|
|
</html>
|