зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1214177 - Restore pointer-events:normal in layout editor inputs. r=pbro
This commit is contained in:
Родитель
88e06512eb
Коммит
6667721dc2
|
@ -12,8 +12,10 @@ const TEST_URI = "<style>" +
|
|||
"#div1 { margin-top: 5px }" +
|
||||
"#div2 { border-bottom: 1em solid black; }" +
|
||||
"#div3 { padding: 2em; }" +
|
||||
"#div4 { margin: 1px; }" +
|
||||
"</style>" +
|
||||
"<div id='div1'></div><div id='div2'></div><div id='div3'></div>";
|
||||
"<div id='div1'></div><div id='div2'></div>" +
|
||||
"<div id='div3'></div><div id='div4'></div>";
|
||||
|
||||
function getStyle(node, property) {
|
||||
return node.style.getPropertyValue(property);
|
||||
|
@ -144,3 +146,34 @@ function*(inspector, view) {
|
|||
is(getStyle(node, "margin-right"), "", "Should be the right margin-top on the element.")
|
||||
is(span.textContent, 10, "Should have the right value in the box model.");
|
||||
});
|
||||
|
||||
addTest("Test that clicking in the editor input does not remove focus",
|
||||
function*(inspector, view) {
|
||||
let node = content.document.getElementById("div4");
|
||||
|
||||
yield selectNode("#div4", inspector);
|
||||
|
||||
let span = view.doc.querySelector(".margin.top > span");
|
||||
is(span.textContent, 1, "Should have the right value in the box model.");
|
||||
|
||||
EventUtils.synthesizeMouseAtCenter(span, {}, view.doc.defaultView);
|
||||
let editor = view.doc.querySelector(".styleinspector-propertyeditor");
|
||||
ok(editor, "Should have opened the editor.");
|
||||
|
||||
info("Click in the already opened editor input");
|
||||
EventUtils.synthesizeMouseAtCenter(editor, {}, view.doc.defaultView);
|
||||
is(editor, view.doc.activeElement,
|
||||
"Inplace editor input should still have focus.");
|
||||
|
||||
info("Check the input can still be used as expected");
|
||||
EventUtils.synthesizeKey("VK_UP", {}, view.doc.defaultView);
|
||||
yield waitForUpdate(inspector);
|
||||
|
||||
is(editor.value, "2px", "Should have the right value in the editor.");
|
||||
is(getStyle(node, "margin-top"), "2px", "Should have updated the margin.");
|
||||
EventUtils.synthesizeKey("VK_RETURN", {}, view.doc.defaultView);
|
||||
|
||||
is(getStyle(node, "margin-top"), "2px",
|
||||
"Should be the right margin-top on the element.");
|
||||
is(span.textContent, 2, "Should have the right value in the box model.");
|
||||
});
|
||||
|
|
|
@ -126,14 +126,12 @@ body.theme-sidebar {
|
|||
#main > p {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#main > p {
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#main > p > span {
|
||||
#main > p > span,
|
||||
#main > p > input {
|
||||
vertical-align: middle;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче