mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 750062 - Assert preconditions in IsVisTextNode; r=ehsan
This commit is contained in:
parent
9abc05b1d6
commit
4df91dc293
@ -3645,6 +3645,9 @@ nsEditor::IsContainer(nsIDOMNode *aNode)
|
||||
bool
|
||||
nsEditor::IsTextInDirtyFrameVisible(nsIContent *aNode)
|
||||
{
|
||||
MOZ_ASSERT(aNode);
|
||||
MOZ_ASSERT(aNode->NodeType() == nsIDOMNode::TEXT_NODE);
|
||||
|
||||
// virtual method
|
||||
//
|
||||
// If this is a simple non-html editor,
|
||||
|
@ -568,6 +568,9 @@ public:
|
||||
bool IsEditable(nsIDOMNode *aNode);
|
||||
bool IsEditable(nsIContent *aNode);
|
||||
|
||||
/**
|
||||
* aNode must be a non-null text node.
|
||||
*/
|
||||
virtual bool IsTextInDirtyFrameVisible(nsIContent *aNode);
|
||||
|
||||
/** returns true if aNode is a MozEditorBogus node */
|
||||
|
@ -4591,6 +4591,9 @@ nsHTMLEditor::GetLastEditableLeaf(nsIDOMNode *aNode, nsCOMPtr<nsIDOMNode> *aOutL
|
||||
bool
|
||||
nsHTMLEditor::IsTextInDirtyFrameVisible(nsIContent *aNode)
|
||||
{
|
||||
MOZ_ASSERT(aNode);
|
||||
MOZ_ASSERT(aNode->NodeType() == nsIDOMNode::TEXT_NODE);
|
||||
|
||||
bool isEmptyTextNode;
|
||||
nsresult rv = IsVisTextNode(aNode, &isEmptyTextNode, false);
|
||||
if (NS_FAILED(rv)) {
|
||||
@ -4611,13 +4614,11 @@ nsHTMLEditor::IsVisTextNode(nsIContent* aNode,
|
||||
bool* outIsEmptyNode,
|
||||
bool aSafeToAskFrames)
|
||||
{
|
||||
NS_ENSURE_TRUE(aNode && outIsEmptyNode, NS_ERROR_NULL_POINTER);
|
||||
*outIsEmptyNode = true;
|
||||
MOZ_ASSERT(aNode);
|
||||
MOZ_ASSERT(aNode->NodeType() == nsIDOMNode::TEXT_NODE);
|
||||
MOZ_ASSERT(outIsEmptyNode);
|
||||
|
||||
// callers job to only call us with text nodes
|
||||
if (!aNode->IsNodeOfType(nsINode::eTEXT)) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
*outIsEmptyNode = true;
|
||||
|
||||
PRUint32 length = aNode->TextLength();
|
||||
if (aSafeToAskFrames)
|
||||
|
@ -388,8 +388,15 @@ public:
|
||||
// aSelection is optional -- if null, we get current seletion
|
||||
nsresult CollapseSelectionToDeepestNonTableFirstChild(nsISelection *aSelection, nsIDOMNode *aNode);
|
||||
|
||||
/**
|
||||
* aNode must be a non-null text node.
|
||||
*/
|
||||
virtual bool IsTextInDirtyFrameVisible(nsIContent *aNode);
|
||||
|
||||
/**
|
||||
* aNode must be a non-null text node.
|
||||
* outIsEmptyNode must be non-null.
|
||||
*/
|
||||
nsresult IsVisTextNode(nsIContent* aNode,
|
||||
bool* outIsEmptyNode,
|
||||
bool aSafeToAskFrames);
|
||||
|
Loading…
Reference in New Issue
Block a user