reworked attribute storage to seperate attributes mapped in to style from
those that aren't This lets the style system optimize style contexts better. git-svn-id: svn://10.0.0.236/trunk@38541 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -691,7 +691,7 @@ nsHTMLSelectElement::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
static void
|
||||
MapAttributesInto(nsIHTMLAttributes* aAttributes,
|
||||
MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes,
|
||||
nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
@@ -719,6 +719,24 @@ MapAttributesInto(nsIHTMLAttributes* aAttributes,
|
||||
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aContext, aPresContext);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::GetMappedAttributeImpact(const nsIAtom* aAttribute,
|
||||
PRInt32& aHint) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::multiple) {
|
||||
aHint = NS_STYLE_HINT_FRAMECHANGE;
|
||||
}
|
||||
else if ((aAttribute == nsHTMLAtoms::align) ||
|
||||
(aAttribute == nsHTMLAtoms::size)) {
|
||||
aHint = NS_STYLE_HINT_REFLOW;
|
||||
}
|
||||
else if (! nsGenericHTMLElement::GetCommonMappedAttributesImpact(aAttribute, aHint)) {
|
||||
aHint = NS_STYLE_HINT_CONTENT;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::GetAttributeMappingFunctions(nsMapAttributesFunc& aFontMapFunc,
|
||||
nsMapAttributesFunc& aMapFunc) const
|
||||
@@ -1083,17 +1101,3 @@ nsOptionList::Clear()
|
||||
mElements.Clear();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::GetStyleHintForAttributeChange(
|
||||
const nsIAtom* aAttribute,
|
||||
PRInt32 *aHint) const
|
||||
{
|
||||
if (nsHTMLAtoms::multiple == aAttribute) {
|
||||
*aHint = NS_STYLE_HINT_FRAMECHANGE;
|
||||
} else if (nsHTMLAtoms::size == aAttribute) {
|
||||
*aHint = NS_STYLE_HINT_REFLOW;
|
||||
} else {
|
||||
nsGenericHTMLElement::GetStyleHintForCommonAttributes(this, aAttribute, aHint);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user