Bug 737786 - 5/5 - Add pointer-events: none; in ::-moz-placeholder styling and test it. r=bz

This commit is contained in:
Mounir Lamouri 2012-11-09 10:27:03 +00:00
parent 71b0fc695a
commit 7fcb75455c
3 changed files with 17 additions and 3 deletions

View File

@ -20,6 +20,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549170
<textarea id='t'
onmouseup="mouseHandler(event);"
onmousedown="mouseHandler(event);"></textarea>
<input id='ip' placeholder='foo'
onmouseup="mouseHandler(event);"
onmousedown="mouseHandler(event);">
<textarea id='tp' placeholder='foo'
onmouseup="mouseHandler(event);"
onmousedown="mouseHandler(event);"></textarea>
<pre id="test">
<script type="application/javascript">
@ -38,8 +44,7 @@ function mouseHandler(aEvent)
is(nodeName, "DIV", "An inner div should be the target of the event");
ok(classList.contains("anonymous-div") && !classList.contains("placeholder"),
"The target div class doesn't correcspond to the editor div class");
ok(classList.contains("anonymous-div"), "the target div should be the editor div");
}
function checkMouseEvents(element)
@ -61,6 +66,8 @@ function runTests()
{
checkMouseEvents(document.getElementById('i'));
checkMouseEvents(document.getElementById('t'));
checkMouseEvents(document.getElementById('ip'));
checkMouseEvents(document.getElementById('tp'));
SimpleTest.finish();
}

View File

@ -163,6 +163,12 @@ textarea::-moz-placeholder {
overflow: hidden !important;
/*
* The placeholder should be ignored by pointer otherwise, we might have some
* unexpected behavior like the resize handle not being selectable.
*/
pointer-events: none !important;
color: GrayText;
}

View File

@ -2485,7 +2485,8 @@ CSS_PROP_VISIBILITY(
pointer-events,
pointer_events,
PointerEvents,
CSS_PROPERTY_PARSE_VALUE,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
"",
VARIANT_HK,
kPointerEventsKTable,