mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 1330060 part 1. Move GetInlineStyleDeclaration up to Element so it doesn't have to be virtual. r=bkelly
This commit is contained in:
parent
4bdd0944f9
commit
34c39939f2
@ -2001,8 +2001,17 @@ Element::IsInteractiveHTMLContent(bool aIgnoreTabindex) const
|
||||
}
|
||||
|
||||
DeclarationBlock*
|
||||
Element::GetInlineStyleDeclaration()
|
||||
Element::GetInlineStyleDeclaration() const
|
||||
{
|
||||
if (!MayHaveStyle()) {
|
||||
return nullptr;
|
||||
}
|
||||
const nsAttrValue* attrVal = mAttrsAndChildren.GetAttr(nsGkAtoms::style);
|
||||
|
||||
if (attrVal && attrVal->Type() == nsAttrValue::eCSSDeclaration) {
|
||||
return attrVal->GetCSSDeclarationValue();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -267,7 +267,7 @@ public:
|
||||
/**
|
||||
* Get the inline style declaration, if any, for this element.
|
||||
*/
|
||||
virtual DeclarationBlock* GetInlineStyleDeclaration();
|
||||
DeclarationBlock* GetInlineStyleDeclaration() const;
|
||||
|
||||
/**
|
||||
* Set the inline style declaration for this element. This will send
|
||||
|
@ -93,21 +93,6 @@ nsStyledElement::SetInlineStyleDeclaration(DeclarationBlock* aDeclaration,
|
||||
aNotify, kDontCallAfterSetAttr);
|
||||
}
|
||||
|
||||
DeclarationBlock*
|
||||
nsStyledElement::GetInlineStyleDeclaration()
|
||||
{
|
||||
if (!MayHaveStyle()) {
|
||||
return nullptr;
|
||||
}
|
||||
const nsAttrValue* attrVal = mAttrsAndChildren.GetAttr(nsGkAtoms::style);
|
||||
|
||||
if (attrVal && attrVal->Type() == nsAttrValue::eCSSDeclaration) {
|
||||
return attrVal->GetCSSDeclarationValue();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Others and helpers
|
||||
|
||||
|
@ -44,7 +44,6 @@ public:
|
||||
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) override;
|
||||
|
||||
// Element interface methods
|
||||
virtual mozilla::DeclarationBlock* GetInlineStyleDeclaration() override;
|
||||
virtual nsresult SetInlineStyleDeclaration(mozilla::DeclarationBlock* aDeclaration,
|
||||
const nsAString* aSerialized,
|
||||
bool aNotify) override;
|
||||
|
Loading…
Reference in New Issue
Block a user