зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1190172 - Back out for now, requested by Masayuki at bug 1191356 comment 23
This commit is contained in:
Родитель
829d16bdb2
Коммит
a1bda4c481
|
@ -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)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче