mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Backout changeset b3a4fcd6e166 (bug 1190172 part 4)
--HG-- extra : rebase_source : ea006b33268fb46c0aac352a8ca63194102c51f8
This commit is contained in:
parent
a82e07913d
commit
4656c119c1
@ -678,6 +678,7 @@ protected:
|
||||
const nsAString* aAttribute);
|
||||
|
||||
bool NodeIsProperty(nsIDOMNode *aNode);
|
||||
bool HasAttr(nsIDOMNode *aNode, const nsAString *aAttribute);
|
||||
bool IsAtFrontOfNode(nsIDOMNode *aNode, int32_t aOffset);
|
||||
bool IsAtEndOfNode(nsIDOMNode *aNode, int32_t aOffset);
|
||||
bool IsOnlyAttribute(const nsIContent* aElement, const nsAString& aAttribute);
|
||||
|
@ -848,6 +848,26 @@ nsHTMLEditor::IsOnlyAttribute(const nsIContent* aContent,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool nsHTMLEditor::HasAttr(nsIDOMNode* aNode,
|
||||
const nsAString* aAttribute)
|
||||
{
|
||||
NS_ENSURE_TRUE(aNode, false);
|
||||
if (!aAttribute || aAttribute->IsEmpty()) {
|
||||
// everybody has the 'null' attribute
|
||||
return true;
|
||||
}
|
||||
|
||||
// get element
|
||||
nsCOMPtr<dom::Element> element = do_QueryInterface(aNode);
|
||||
NS_ENSURE_TRUE(element, false);
|
||||
|
||||
nsCOMPtr<nsIAtom> atom = NS_Atomize(*aAttribute);
|
||||
NS_ENSURE_TRUE(atom, false);
|
||||
|
||||
return element->HasAttr(kNameSpaceID_None, atom);
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsHTMLEditor::PromoteRangeIfStartsOrEndsInNamedAnchor(nsRange* inRange)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user