Bug 1426869 - "td.contenteditable=true focus breaks text selection" [r=masayuki]
authorJet Villegas <bugs>
Tue, 09 Jan 2018 08:00:00 +0200
changeset 751762 b3118b4fae1372c3aa57caf4b16af9834ce46539
parent 751761 cafa6e286cc522770fa311d01b67f8522d95aa3f
child 751763 b5ad0c384202b82b67d25949bbf6cde061b99cbe
push id98047
push userbmo:continuation@gmail.com
push dateTue, 06 Feb 2018 22:02:37 +0000
reviewersmasayuki
bugs1426869
milestone60.0a1
Bug 1426869 - "td.contenteditable=true focus breaks text selection" [r=masayuki]
layout/generic/nsFrameSelection.cpp
--- a/layout/generic/nsFrameSelection.cpp
+++ b/layout/generic/nsFrameSelection.cpp
@@ -1398,16 +1398,17 @@ nsFrameSelection::TakeFocus(nsIContent* 
 
     //find out if we are inside a table. if so, find out which one and which cell
     //once we do that, the next time we get a takefocus, check the parent tree.
     //if we are no longer inside same table ,cell then switch to table selection mode.
     // BUT only do this in an editor
 
     NS_ENSURE_STATE(mShell);
     bool editableCell = false;
+    mCellParent = nullptr;
     RefPtr<nsPresContext> context = mShell->GetPresContext();
     if (context) {
       RefPtr<HTMLEditor> htmlEditor = nsContentUtils::GetHTMLEditor(context);
       if (htmlEditor) {
         nsINode* cellparent = GetCellParent(aNewFocus);
         nsCOMPtr<nsINode> editorHostNode = htmlEditor->GetActiveEditingHost();
         editableCell = cellparent && editorHostNode &&
                    nsContentUtils::ContentIsDescendantOf(cellparent, editorHostNode);