Backout changeset aabe14890eb2 (bug 1190172 part 5)

--HG--
extra : rebase_source : 3177e815345d5f5c3c28729da7aa8ffbe05790d2
This commit is contained in:
Masayuki Nakano 2016-04-23 20:00:35 +09:00
Родитель a3991f4cac
Коммит a82e07913d
2 изменённых файлов: 12 добавлений и 7 удалений

Просмотреть файл

@ -677,7 +677,7 @@ protected:
nsresult RemoveInlinePropertyImpl(nsIAtom* aProperty,
const nsAString* aAttribute);
bool NodeIsProperty(nsINode& aNode);
bool NodeIsProperty(nsIDOMNode *aNode);
bool IsAtFrontOfNode(nsIDOMNode *aNode, int32_t aOffset);
bool IsAtEndOfNode(nsIDOMNode *aNode, int32_t aOffset);
bool IsOnlyAttribute(const nsIContent* aElement, const nsAString& aAttribute);

Просмотреть файл

@ -586,7 +586,7 @@ nsHTMLEditor::SplitStyleAbovePoint(nsCOMPtr<nsINode>* aNode,
// node is href - test if really <a href=...
(aProperty == nsGkAtoms::href && nsHTMLEditUtils::IsLink(node)) ||
// or node is any prop, and we asked to split them all
(!aProperty && NodeIsProperty(node)) ||
(!aProperty && NodeIsProperty(GetAsDOMNode(node))) ||
// or the style is specified in the style attribute
isSet) {
// Found a style node we need to split
@ -684,11 +684,16 @@ nsHTMLEditor::ClearStyle(nsCOMPtr<nsINode>* aNode, int32_t* aOffset,
return NS_OK;
}
bool
nsHTMLEditor::NodeIsProperty(nsINode& aNode)
bool nsHTMLEditor::NodeIsProperty(nsIDOMNode *aNode)
{
return IsContainer(&aNode) && IsEditable(&aNode) && !IsBlockNode(&aNode) &&
!aNode.IsHTMLElement(nsGkAtoms::a);
NS_ENSURE_TRUE(aNode, false);
if (!IsContainer(aNode)) return false;
if (!IsEditable(aNode)) return false;
if (IsBlockNode(aNode)) return false;
if (NodeIsType(aNode, nsGkAtoms::a)) {
return false;
}
return true;
}
nsresult nsHTMLEditor::ApplyDefaultProperties()
@ -735,7 +740,7 @@ nsHTMLEditor::RemoveStyleInside(nsIContent& aNode,
// and for named anchors
(aProperty == nsGkAtoms::name && nsHTMLEditUtils::IsNamedAnchor(&aNode)) ||
// or node is any prop and we asked for that
(!aProperty && NodeIsProperty(aNode))
(!aProperty && NodeIsProperty(aNode.AsDOMNode()))
)
) {
nsresult res;