mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 20:35:50 +00:00
Remove remaining user of CSS-property-based style hints. b=158713 r+sr=bzbarsky
This commit is contained in:
parent
6f90413097
commit
b10e90f02b
@ -1931,26 +1931,6 @@ PRBool nsGenericHTMLElement::IsEventName(nsIAtom* aName)
|
||||
aName == nsLayoutAtoms::onDOMNodeRemoved);
|
||||
}
|
||||
|
||||
static nsChangeHint GetStyleImpactFrom(const nsHTMLValue& aValue)
|
||||
{
|
||||
nsChangeHint hint = NS_STYLE_HINT_NONE;
|
||||
|
||||
if (eHTMLUnit_ISupports == aValue.GetUnit()) {
|
||||
nsCOMPtr<nsISupports> supports(dont_AddRef(aValue.GetISupportsValue()));
|
||||
nsCOMPtr<nsICSSStyleRule> cssRule(do_QueryInterface(supports));
|
||||
|
||||
if (cssRule) {
|
||||
nsCSSDeclaration* declaration = cssRule->GetDeclaration();
|
||||
|
||||
if (declaration) {
|
||||
hint = declaration->GetStyleImpact();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return hint;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsGenericHTMLElement::SetHTMLAttribute(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
@ -2097,24 +2077,11 @@ nsGenericHTMLElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
|
||||
}
|
||||
}
|
||||
|
||||
nsChangeHint impact = NS_STYLE_HINT_UNKNOWN;
|
||||
if (mDocument) {
|
||||
if (aNotify) {
|
||||
mDocument->BeginUpdate();
|
||||
|
||||
mDocument->AttributeWillChange(this, aNameSpaceID, aAttribute);
|
||||
|
||||
if (aNameSpaceID == kNameSpaceID_None &&
|
||||
aAttribute == nsHTMLAtoms::style) {
|
||||
nsHTMLValue oldValue;
|
||||
if (NS_CONTENT_ATTR_NOT_THERE != GetHTMLAttribute(aAttribute,
|
||||
oldValue)) {
|
||||
impact = GetStyleImpactFrom(oldValue);
|
||||
}
|
||||
else {
|
||||
impact = NS_STYLE_HINT_NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nsGenericElement::HasMutationListeners(this, NS_EVENT_BITS_MUTATION_ATTRMODIFIED)) {
|
||||
@ -2165,7 +2132,9 @@ nsGenericHTMLElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
|
||||
binding->AttributeChanged(aAttribute, aNameSpaceID, PR_TRUE, aNotify);
|
||||
|
||||
if (aNotify) {
|
||||
mDocument->AttributeChanged(this, aNameSpaceID, aAttribute, nsIDOMMutationEvent::REMOVAL, impact);
|
||||
mDocument->AttributeChanged(this, aNameSpaceID, aAttribute,
|
||||
nsIDOMMutationEvent::REMOVAL,
|
||||
NS_STYLE_HINT_UNKNOWN);
|
||||
mDocument->EndUpdate();
|
||||
}
|
||||
}
|
||||
|
@ -1218,19 +1218,6 @@ nsCSSDeclaration::GetNthProperty(PRUint32 aIndex, nsAString& aReturn) const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsChangeHint
|
||||
nsCSSDeclaration::GetStyleImpact() const
|
||||
{
|
||||
nsChangeHint hint = NS_STYLE_HINT_NONE;
|
||||
for (PRInt32 index = mOrder.Count() - 1; index >= 0; --index) {
|
||||
nsCSSProperty property = OrderValueAt(index);
|
||||
if (eCSSProperty_UNKNOWN < property) {
|
||||
NS_UpdateHint(hint, nsCSSProps::kHintTable[property]);
|
||||
}
|
||||
}
|
||||
return hint;
|
||||
}
|
||||
|
||||
nsCSSDeclaration*
|
||||
nsCSSDeclaration::Clone() const
|
||||
{
|
||||
|
@ -90,9 +90,6 @@ public:
|
||||
PRUint32 Count() const;
|
||||
nsresult GetNthProperty(PRUint32 aIndex, nsAString& aReturn) const;
|
||||
|
||||
// XXX This should go away, along with the rest of the property-based hints.
|
||||
nsChangeHint GetStyleImpact() const;
|
||||
|
||||
nsresult ToString(nsAString& aString) const;
|
||||
|
||||
nsCSSDeclaration* Clone() const;
|
||||
|
@ -73,7 +73,6 @@ public:
|
||||
static PRInt32 SearchKeywordTableInt(PRInt32 aValue, const PRInt32 aTable[]);
|
||||
static const nsAFlatCString& SearchKeywordTable(PRInt32 aValue, const PRInt32 aTable[]);
|
||||
|
||||
static const nsChangeHint kHintTable[eCSSProperty_COUNT];
|
||||
static const nsCSSType kTypeTable[eCSSProperty_COUNT_no_shorthands];
|
||||
static const nsStyleStructID kSIDTable[eCSSProperty_COUNT_no_shorthands];
|
||||
|
||||
|
@ -1335,16 +1335,6 @@ PRBool nsCSSProps::GetColorName(PRInt32 aPropValue, nsCString &aStr)
|
||||
return rv;
|
||||
}
|
||||
|
||||
// define array of all CSS property hints
|
||||
const nsChangeHint nsCSSProps::kHintTable[eCSSProperty_COUNT] = {
|
||||
#define CSS_PROP(name_, id_, method_, hint_, datastruct_, member_, type_, iscoord_) hint_,
|
||||
#include "nsCSSPropList.h"
|
||||
#undef CSS_PROP
|
||||
#define CSS_PROP_SHORTHAND(name_, id_, method_, hint_) hint_,
|
||||
#include "nsCSSPropList.h"
|
||||
#undef CSS_PROP_SHORTHAND
|
||||
};
|
||||
|
||||
// define array of all CSS property types
|
||||
const nsCSSType nsCSSProps::kTypeTable[eCSSProperty_COUNT_no_shorthands] = {
|
||||
#define CSS_PROP(name_, id_, method_, hint_, datastruct_, member_, type_, iscoord_) type_,
|
||||
|
@ -1218,19 +1218,6 @@ nsCSSDeclaration::GetNthProperty(PRUint32 aIndex, nsAString& aReturn) const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsChangeHint
|
||||
nsCSSDeclaration::GetStyleImpact() const
|
||||
{
|
||||
nsChangeHint hint = NS_STYLE_HINT_NONE;
|
||||
for (PRInt32 index = mOrder.Count() - 1; index >= 0; --index) {
|
||||
nsCSSProperty property = OrderValueAt(index);
|
||||
if (eCSSProperty_UNKNOWN < property) {
|
||||
NS_UpdateHint(hint, nsCSSProps::kHintTable[property]);
|
||||
}
|
||||
}
|
||||
return hint;
|
||||
}
|
||||
|
||||
nsCSSDeclaration*
|
||||
nsCSSDeclaration::Clone() const
|
||||
{
|
||||
|
@ -90,9 +90,6 @@ public:
|
||||
PRUint32 Count() const;
|
||||
nsresult GetNthProperty(PRUint32 aIndex, nsAString& aReturn) const;
|
||||
|
||||
// XXX This should go away, along with the rest of the property-based hints.
|
||||
nsChangeHint GetStyleImpact() const;
|
||||
|
||||
nsresult ToString(nsAString& aString) const;
|
||||
|
||||
nsCSSDeclaration* Clone() const;
|
||||
|
@ -1335,16 +1335,6 @@ PRBool nsCSSProps::GetColorName(PRInt32 aPropValue, nsCString &aStr)
|
||||
return rv;
|
||||
}
|
||||
|
||||
// define array of all CSS property hints
|
||||
const nsChangeHint nsCSSProps::kHintTable[eCSSProperty_COUNT] = {
|
||||
#define CSS_PROP(name_, id_, method_, hint_, datastruct_, member_, type_, iscoord_) hint_,
|
||||
#include "nsCSSPropList.h"
|
||||
#undef CSS_PROP
|
||||
#define CSS_PROP_SHORTHAND(name_, id_, method_, hint_) hint_,
|
||||
#include "nsCSSPropList.h"
|
||||
#undef CSS_PROP_SHORTHAND
|
||||
};
|
||||
|
||||
// define array of all CSS property types
|
||||
const nsCSSType nsCSSProps::kTypeTable[eCSSProperty_COUNT_no_shorthands] = {
|
||||
#define CSS_PROP(name_, id_, method_, hint_, datastruct_, member_, type_, iscoord_) type_,
|
||||
|
@ -73,7 +73,6 @@ public:
|
||||
static PRInt32 SearchKeywordTableInt(PRInt32 aValue, const PRInt32 aTable[]);
|
||||
static const nsAFlatCString& SearchKeywordTable(PRInt32 aValue, const PRInt32 aTable[]);
|
||||
|
||||
static const nsChangeHint kHintTable[eCSSProperty_COUNT];
|
||||
static const nsCSSType kTypeTable[eCSSProperty_COUNT_no_shorthands];
|
||||
static const nsStyleStructID kSIDTable[eCSSProperty_COUNT_no_shorthands];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user