Bug 1426869 - "td.contenteditable=true focus breaks text selection" [r=masayuki]
--- 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);