Bug 1114853 - Part 4: Bail out if selections are mismatch. r=roc

This commit is contained in:
Morris Tseng 2014-12-29 20:02:00 +01:00
parent e7f67cb34b
commit 12213f1f19
2 changed files with 7 additions and 0 deletions

View File

@ -69,6 +69,7 @@ function doCommand(cmd) {
function dispatchTest(e) {
iframe.addEventListener("mozbrowserloadend", function onloadend2(e) {
iframe.removeEventListener("mozbrowserloadend", onloadend2);
iframe.focus();
SimpleTest.executeSoon(function() { testSelectAll(e); });
});

View File

@ -1089,6 +1089,12 @@ SelectionCarets::NotifySelectionChanged(nsIDOMDocument* aDoc,
int16_t aReason)
{
SELECTIONCARETS_LOG("aSel (%p), Reason=%d", aSel, aReason);
if (aSel != GetSelection()) {
SELECTIONCARETS_LOG("Return for selection mismatch!");
return NS_OK;
}
if (!aReason || (aReason & (nsISelectionListener::DRAG_REASON |
nsISelectionListener::KEYPRESS_REASON |
nsISelectionListener::MOUSEDOWN_REASON))) {