Bug 873418 - ContentEditable elements are ignored when fluffing is activated. r=roc

This commit is contained in:
Vivien Nicolas 2013-08-06 12:33:29 +02:00
parent cf096b566a
commit e5049a2b28
2 changed files with 14 additions and 0 deletions

View File

@ -167,6 +167,9 @@ IsElementClickable(nsIFrame* aFrame, nsIAtom* stopAt = nullptr)
nsGkAtoms::button, eIgnoreCase)) {
return true;
}
if (content->IsEditable()) {
return true;
}
nsCOMPtr<nsIURI> linkURI;
if (content->IsLink(getter_AddRefs(linkURI))) {
return true;

View File

@ -43,6 +43,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=780847
<div class="target" id="t7" onmousedown="x=1" hidden></div>
<div class="target" id="t7_over" hidden></div>
<div id="t8" contenteditable="true" class="target" hidden></div>
</div>
<pre id="test">
<script type="application/javascript">
@ -191,6 +193,15 @@ function runTest() {
setShowing("t7", false);
setShowing("t7_over", false);
// Check that contenteditable elements are considered clickable for fluffing.
setShowing("t8", true);
var rect = document.getElementById("t8").getBoundingClientRect();
testMouseClick("t8", rect.left + 1, rect.top + 1, "t8", "content editable enabled for mouse input");
testMouseClick("t8", rect.left + 1, rect.top + 1, "t8", "content editable enabled for touch input", {
inputSource: SpecialPowers.Ci.nsIDOMMouseEvent.MOZ_SOURCE_TOUCH
});
setShowing("t8", false);
// Not yet tested:
// -- visited link weight
// -- "Closest" using Euclidean distance