mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 796839 - Part 2 - Don't set inline properties on empty text nodes; r=roc
This part, similar to the previous one, ensures that we skip empty text nodes when setting inline properties. Previously we were implicitly getting this behavior becasue we were calling IsEditable, but we need to be explicit about this.
This commit is contained in:
parent
9d564e7cf4
commit
9fe0740025
@ -54,6 +54,15 @@ class nsISupports;
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
static bool
|
||||
IsEmptyTextNode(nsHTMLEditor* aThis, nsINode* aNode)
|
||||
{
|
||||
bool isEmptyTextNode = false;
|
||||
return nsEditor::IsTextNode(aNode) &&
|
||||
NS_SUCCEEDED(aThis->IsEmptyNode(aNode, &isEmptyTextNode)) &&
|
||||
isEmptyTextNode;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsHTMLEditor::AddDefaultProperty(nsIAtom *aProperty,
|
||||
const nsAString & aAttribute,
|
||||
const nsAString & aValue)
|
||||
@ -424,7 +433,7 @@ nsHTMLEditor::SetInlinePropertyOnNodeImpl(nsIContent* aNode,
|
||||
for (nsIContent* child = aNode->GetFirstChild();
|
||||
child;
|
||||
child = child->GetNextSibling()) {
|
||||
if (IsEditable(child)) {
|
||||
if (IsEditable(child) && !IsEmptyTextNode(this, child)) {
|
||||
arrayOfNodes.AppendObject(child);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user