Skip to content

Commit

Permalink
Bug 725069 - Part 2: Only accept text and element nodes for the edita…
Browse files Browse the repository at this point in the history
…bility check; r=roc
  • Loading branch information
ehsan committed Feb 8, 2012
1 parent b560fc0 commit 4bb54b9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions editor/libeditor/base/nsEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3636,12 +3636,14 @@ nsEditor::IsEditable(nsIContent *aNode)
// rely on frameless textnodes being visible.
return false;
}
if (aNode->NodeType() == nsIDOMNode::COMMENT_NODE)
return false;
if (aNode->NodeType() != nsIDOMNode::TEXT_NODE)
return true; // not a text node; not invisible

return IsTextInDirtyFrameVisible(aNode);
switch (aNode->NodeType()) {
case nsIDOMNode::ELEMENT_NODE:
return true; // not a text node; not invisible
case nsIDOMNode::TEXT_NODE:
return IsTextInDirtyFrameVisible(aNode);
default:
return false;
}
}

bool
Expand Down

0 comments on commit 4bb54b9

Please sign in to comment.