Bug 160936. Add type nsChangeHint for style hints. Make it a set of bits. Make sure an NS_STYLE_HINT_REFLOW always also does a repaint of the frame. r=dbaron,sr=kin

This commit is contained in:
roc+%cs.cmu.edu 2002-08-24 14:41:28 +00:00
parent 95bad7466f
commit cb32a0f906
131 changed files with 1150 additions and 1133 deletions

View File

@ -42,6 +42,7 @@
#include "nsEvent.h"
#include "nsAString.h"
#include "nsString.h"
#include "nsChangeHint.h"
class nsIAtom;
class nsIArena;
@ -346,7 +347,7 @@ public:
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint) = 0; // See nsStyleConsts fot hint values
nsChangeHint aHint) = 0;
NS_IMETHOD ContentAppended(nsIContent* aContainer,
PRInt32 aNewIndexInContainer) = 0;
NS_IMETHOD ContentInserted(nsIContent* aContainer,
@ -364,7 +365,7 @@ public:
// to document observers
NS_IMETHOD StyleRuleChanged(nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint) = 0; // See nsStyleConsts fot hint values
nsChangeHint aHint) = 0;
NS_IMETHOD StyleRuleAdded(nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule) = 0;
NS_IMETHOD StyleRuleRemoved(nsIStyleSheet* aStyleSheet,

View File

@ -39,6 +39,7 @@
#define nsIDocumentObserver_h___
#include "nsISupports.h"
#include "nsChangeHint.h"
class nsIAtom;
class nsIContent;
@ -159,7 +160,7 @@ public:
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint) = 0; // See nsStyleConsts fot hint values
nsChangeHint aHint) = 0;
/**
* Notifcation that the content model has had data appended to the
@ -288,7 +289,7 @@ public:
NS_IMETHOD StyleRuleChanged(nsIDocument *aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint) = 0; // See nsStyleConsts fot hint values
nsChangeHint aHint) = 0;
/**
* A StyleRule has just been added to a style sheet.

View File

@ -39,6 +39,7 @@
#define nsIStyledContent_h___
#include "nsIContent.h"
#include "nsChangeHint.h"
class nsString;
class nsIStyleRule;
@ -71,7 +72,7 @@ public:
* All other attributes return NS_STYLE_HINT_CONTENT
*/
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const = 0;
nsChangeHint& aHint) const = 0;
};

View File

@ -204,7 +204,7 @@ public:
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint) { return NS_OK; }
nsChangeHint aHint) { return NS_OK; }
NS_IMETHOD ContentAppended(nsIDocument *aDocument,
nsIContent* aContainer,
PRInt32 aNewIndexInContainer);
@ -231,7 +231,7 @@ public:
NS_IMETHOD StyleRuleChanged(nsIDocument *aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint) { return NS_OK; }
nsChangeHint aHint) { return NS_OK; }
NS_IMETHOD StyleRuleAdded(nsIDocument *aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule) { return NS_OK; }

View File

@ -2215,7 +2215,7 @@ nsDocument::AttributeChanged(nsIContent* aChild,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint)
nsChangeHint aHint)
{
NS_ABORT_IF_FALSE(aChild, "Null child!");
@ -2241,7 +2241,7 @@ nsDocument::AttributeChanged(nsIContent* aChild,
NS_IMETHODIMP
nsDocument::StyleRuleChanged(nsIStyleSheet* aStyleSheet, nsIStyleRule* aStyleRule,
PRInt32 aHint)
nsChangeHint aHint)
{
PRInt32 i;
// Get new value of count for every iteration in case

View File

@ -177,7 +177,7 @@ public:
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint) { return NS_OK; }
nsChangeHint aHint) { return NS_OK; }
NS_IMETHOD ContentAppended(nsIDocument *aDocument,
nsIContent* aContainer,
PRInt32 aNewIndexInContainer)
@ -205,7 +205,7 @@ public:
NS_IMETHOD StyleRuleChanged(nsIDocument *aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint) { return NS_OK; }
nsChangeHint aHint) { return NS_OK; }
NS_IMETHOD StyleRuleAdded(nsIDocument *aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule) { return NS_OK; }
@ -497,7 +497,7 @@ public:
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint);
nsChangeHint aHint);
NS_IMETHOD ContentAppended(nsIContent* aContainer,
PRInt32 aNewIndexInContainer);
NS_IMETHOD ContentInserted(nsIContent* aContainer,
@ -513,7 +513,7 @@ public:
NS_IMETHOD StyleRuleChanged(nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint); // See nsStyleConsts fot hint values
nsChangeHint aHint); // See nsStyleConsts fot hint values
NS_IMETHOD StyleRuleAdded(nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule);
NS_IMETHOD StyleRuleRemoved(nsIStyleSheet* aStyleSheet,

View File

@ -2198,9 +2198,8 @@ nsGenericElement::GetInlineStyleRule(nsIStyleRule** aStyleRule)
}
NS_IMETHODIMP
nsGenericElement::GetMappedAttributeImpact(const nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32& aHint) const
nsGenericElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
nsChangeHint& aHint) const
{
aHint = NS_STYLE_HINT_CONTENT; // by default, never map attributes to style
return NS_OK;

View File

@ -402,7 +402,7 @@ public:
NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker);
NS_IMETHOD GetInlineStyleRule(nsIStyleRule** aStyleRule);
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute,
PRInt32 aModType, PRInt32& aHint) const;
PRInt32 aModType, nsChangeHint& aHint) const;
// nsIXMLContent interface methods
NS_IMETHOD MaybeTriggerAutoLink(nsIWebShell *aShell);

View File

@ -40,7 +40,6 @@
#include "nsStyleConsts.h"
#include "nsString.h"
#include "nsUnitConversion.h"
#include "nsIPresContext.h"
#include "nsIStyleRule.h"
#include "nsISupportsArray.h"
@ -54,6 +53,7 @@
#include "prenv.h"
#include "nsRuleNode.h"
#include "nsUnitConversion.h"
#ifdef DEBUG
// #define NOISY_DEBUG
@ -102,7 +102,7 @@ public:
virtual nsresult ClearStyleData(nsIPresContext* aPresContext, nsIStyleRule* aRule);
NS_IMETHOD CalcStyleDifference(nsIStyleContext* aOther, PRInt32& aHint);
NS_IMETHOD CalcStyleDifference(nsIStyleContext* aOther, nsChangeHint& aHint);
#ifdef DEBUG
virtual void DumpRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent);
@ -547,7 +547,7 @@ nsStyleContext::ClearStyleData(nsIPresContext* aPresContext, nsIStyleRule* aRule
}
NS_IMETHODIMP
nsStyleContext::CalcStyleDifference(nsIStyleContext* aOther, PRInt32& aHint)
nsStyleContext::CalcStyleDifference(nsIStyleContext* aOther, nsChangeHint& aHint)
{
if (aOther) {
// If our rule nodes are the same, then we are looking at the same style
@ -560,71 +560,70 @@ nsStyleContext::CalcStyleDifference(nsIStyleContext* aOther, PRInt32& aHint)
if (ruleNode == mRuleNode)
return NS_OK;
PRInt32 maxHint = NS_STYLE_HINT_MAX;
PRInt32 hint;
nsChangeHint maxHint = NS_STYLE_HINT_FRAMECHANGE;
// We begin by examining those style structs that are capable of causing the maximal
// difference, a FRAMECHANGE.
// FRAMECHANGE Structs: Display, XUL, Content, UserInterface, Quotes
if (aHint < maxHint) {
// FRAMECHANGE Structs: Display, XUL, Content, UserInterface, Visibility, Quotes
if (!NS_IsHintSubset(maxHint, aHint)) {
const nsStyleDisplay* display = (const nsStyleDisplay*)PeekStyleData(eStyleStruct_Display);
if (display) {
const nsStyleDisplay* otherDisplay = (const nsStyleDisplay*)aOther->GetStyleData(eStyleStruct_Display);
if (display != otherDisplay) {
hint = display->CalcDifference(*otherDisplay);
if (aHint < hint)
aHint = hint;
NS_UpdateHint(aHint, display->CalcDifference(*otherDisplay));
}
}
}
#ifdef INCLUDE_XUL
if (aHint < maxHint) {
if (!NS_IsHintSubset(maxHint, aHint)) {
const nsStyleXUL* xul = (const nsStyleXUL*)PeekStyleData(eStyleStruct_XUL);
if (xul) {
const nsStyleXUL* otherXUL = (const nsStyleXUL*)aOther->GetStyleData(eStyleStruct_XUL);
if (xul != otherXUL) {
hint = xul->CalcDifference(*otherXUL);
if (aHint < hint)
aHint = hint;
NS_UpdateHint(aHint, xul->CalcDifference(*otherXUL));
}
}
}
#endif
if (aHint < maxHint) {
if (!NS_IsHintSubset(maxHint, aHint)) {
const nsStyleContent* content = (const nsStyleContent*)PeekStyleData(eStyleStruct_Content);
if (content) {
const nsStyleContent* otherContent = (const nsStyleContent*)aOther->GetStyleData(eStyleStruct_Content);
if (content != otherContent) {
hint = content->CalcDifference(*otherContent);
if (aHint < hint)
aHint = hint;
NS_UpdateHint(aHint, content->CalcDifference(*otherContent));
}
}
}
if (aHint < maxHint) {
if (!NS_IsHintSubset(maxHint, aHint)) {
const nsStyleUserInterface* ui = (const nsStyleUserInterface*)PeekStyleData(eStyleStruct_UserInterface);
if (ui) {
const nsStyleUserInterface* otherUI = (const nsStyleUserInterface*)aOther->GetStyleData(eStyleStruct_UserInterface);
if (ui != otherUI) {
hint = ui->CalcDifference(*otherUI);
if (aHint < hint)
aHint = hint;
NS_UpdateHint(aHint, ui->CalcDifference(*otherUI));
}
}
}
if (!NS_IsHintSubset(maxHint, aHint)) {
const nsStyleVisibility* vis = (const nsStyleVisibility*)PeekStyleData(eStyleStruct_Visibility);
if (vis) {
const nsStyleVisibility* otherVis = (const nsStyleVisibility*)aOther->GetStyleData(eStyleStruct_Visibility);
if (vis != otherVis) {
NS_UpdateHint(aHint, vis->CalcDifference(*otherVis));
}
}
}
#ifdef MOZ_SVG
if (aHint < maxHint) {
if (!NS_IsHintSubset(maxHint, aHint)) {
const nsStyleSVG* svg = (const nsStyleSVG*)PeekStyleData(eStyleStruct_SVG);
if (svg) {
const nsStyleSVG* otherSVG = (const nsStyleSVG*)aOther->GetStyleData(eStyleStruct_SVG);
if (svg != otherSVG) {
hint = svg->CalcDifference(*otherSVG);
if (aHint < hint)
aHint = hint;
NS_UpdateHint(aHint, svg->CalcDifference(*otherSVG));
}
}
}
@ -632,14 +631,12 @@ nsStyleContext::CalcStyleDifference(nsIStyleContext* aOther, PRInt32& aHint)
// If the quotes implementation is ever going to change we might not need
// a framechange here and a reflow should be sufficient. See bug 35768.
if (aHint < maxHint) {
if (!NS_IsHintSubset(maxHint, aHint)) {
const nsStyleQuotes* quotes = (const nsStyleQuotes*)PeekStyleData(eStyleStruct_Quotes);
if (quotes) {
const nsStyleQuotes* otherQuotes = (const nsStyleQuotes*)aOther->GetStyleData(eStyleStruct_Quotes);
if (quotes != otherQuotes) {
hint = quotes->CalcDifference(*otherQuotes);
if (aHint < hint)
aHint = hint;
NS_UpdateHint(aHint, quotes->CalcDifference(*otherQuotes));
}
}
}
@ -649,135 +646,103 @@ nsStyleContext::CalcStyleDifference(nsIStyleContext* aOther, PRInt32& aHint)
// The following structs cause (as their maximal difference) a reflow to occur.
// REFLOW Structs: Font, Margin, Padding, Border, List, Position, Text, TextReset,
// Visibility, Table, TableBorder
if (aHint < maxHint) {
// Table, TableBorder
if (!NS_IsHintSubset(maxHint, aHint)) {
const nsStyleFont* font = (const nsStyleFont*)PeekStyleData(eStyleStruct_Font);
if (font) {
const nsStyleFont* otherFont = (const nsStyleFont*)aOther->GetStyleData(eStyleStruct_Font);
if (font != otherFont) {
hint = font->CalcDifference(*otherFont);
if (aHint < hint)
aHint = hint;
NS_UpdateHint(aHint, font->CalcDifference(*otherFont));
}
}
}
if (aHint < maxHint) {
if (!NS_IsHintSubset(maxHint, aHint)) {
const nsStyleMargin* margin = (const nsStyleMargin*)PeekStyleData(eStyleStruct_Margin);
if (margin) {
const nsStyleMargin* otherMargin = (const nsStyleMargin*)aOther->GetStyleData(eStyleStruct_Margin);
if (margin != otherMargin) {
hint = margin->CalcDifference(*otherMargin);
if (aHint < hint)
aHint = hint;
NS_UpdateHint(aHint, margin->CalcDifference(*otherMargin));
}
}
}
if (aHint < maxHint) {
if (!NS_IsHintSubset(maxHint, aHint)) {
const nsStylePadding* padding = (const nsStylePadding*)PeekStyleData(eStyleStruct_Padding);
if (padding) {
const nsStylePadding* otherPadding = (const nsStylePadding*)aOther->GetStyleData(eStyleStruct_Padding);
if (padding != otherPadding) {
hint = padding->CalcDifference(*otherPadding);
if (aHint < hint)
aHint = hint;
NS_UpdateHint(aHint, padding->CalcDifference(*otherPadding));
}
}
}
if (aHint < maxHint) {
if (!NS_IsHintSubset(maxHint, aHint)) {
const nsStyleBorder* border = (const nsStyleBorder*)PeekStyleData(eStyleStruct_Border);
if (border) {
const nsStyleBorder* otherBorder = (const nsStyleBorder*)aOther->GetStyleData(eStyleStruct_Border);
if (border != otherBorder) {
hint = border->CalcDifference(*otherBorder);
if (aHint < hint)
aHint = hint;
NS_UpdateHint(aHint, border->CalcDifference(*otherBorder));
}
}
}
if (aHint < maxHint) {
if (!NS_IsHintSubset(maxHint, aHint)) {
const nsStyleList* list = (const nsStyleList*)PeekStyleData(eStyleStruct_List);
if (list) {
const nsStyleList* otherList = (const nsStyleList*)aOther->GetStyleData(eStyleStruct_List);
if (list != otherList) {
hint = list->CalcDifference(*otherList);
if (aHint < hint)
aHint = hint;
NS_UpdateHint(aHint, list->CalcDifference(*otherList));
}
}
}
if (aHint < maxHint) {
if (!NS_IsHintSubset(maxHint, aHint)) {
const nsStylePosition* pos = (const nsStylePosition*)PeekStyleData(eStyleStruct_Position);
if (pos) {
const nsStylePosition* otherPosition = (const nsStylePosition*)aOther->GetStyleData(eStyleStruct_Position);
if (pos != otherPosition) {
hint = pos->CalcDifference(*otherPosition);
if (aHint < hint)
aHint = hint;
NS_UpdateHint(aHint, pos->CalcDifference(*otherPosition));
}
}
}
if (aHint < maxHint) {
if (!NS_IsHintSubset(maxHint, aHint)) {
const nsStyleText* text = (const nsStyleText*)PeekStyleData(eStyleStruct_Text);
if (text) {
const nsStyleText* otherText = (const nsStyleText*)aOther->GetStyleData(eStyleStruct_Text);
if (text != otherText) {
hint = text->CalcDifference(*otherText);
if (aHint < hint)
aHint = hint;
NS_UpdateHint(aHint, text->CalcDifference(*otherText));
}
}
}
if (aHint < maxHint) {
if (!NS_IsHintSubset(maxHint, aHint)) {
const nsStyleTextReset* text = (const nsStyleTextReset*)PeekStyleData(eStyleStruct_TextReset);
if (text) {
const nsStyleTextReset* otherText = (const nsStyleTextReset*)aOther->GetStyleData(eStyleStruct_TextReset);
if (text != otherText) {
hint = text->CalcDifference(*otherText);
if (aHint < hint)
aHint = hint;
NS_UpdateHint(aHint, text->CalcDifference(*otherText));
}
}
}
if (aHint < maxHint) {
const nsStyleVisibility* vis = (const nsStyleVisibility*)PeekStyleData(eStyleStruct_Visibility);
if (vis) {
const nsStyleVisibility* otherVis = (const nsStyleVisibility*)aOther->GetStyleData(eStyleStruct_Visibility);
if (vis != otherVis) {
hint = vis->CalcDifference(*otherVis);
if (aHint < hint)
aHint = hint;
}
}
}
if (aHint < maxHint) {
if (!NS_IsHintSubset(maxHint, aHint)) {
const nsStyleTable* table = (const nsStyleTable*)PeekStyleData(eStyleStruct_Table);
if (table) {
const nsStyleTable* otherTable = (const nsStyleTable*)aOther->GetStyleData(eStyleStruct_Table);
if (table != otherTable) {
hint = table->CalcDifference(*otherTable);
if (aHint < hint)
aHint = hint;
NS_UpdateHint(aHint, table->CalcDifference(*otherTable));
}
}
}
if (aHint < maxHint) {
if (!NS_IsHintSubset(maxHint, aHint)) {
const nsStyleTableBorder* table = (const nsStyleTableBorder*)PeekStyleData(eStyleStruct_TableBorder);
if (table) {
const nsStyleTableBorder* otherTable = (const nsStyleTableBorder*)aOther->GetStyleData(eStyleStruct_TableBorder);
if (table != otherTable) {
hint = table->CalcDifference(*otherTable);
if (aHint < hint)
aHint = hint;
NS_UpdateHint(aHint, table->CalcDifference(*otherTable));
}
}
}
@ -788,50 +753,42 @@ nsStyleContext::CalcStyleDifference(nsIStyleContext* aOther, PRInt32& aHint)
// The following structs cause (as their maximal difference) a re-render to occur.
// VISUAL Structs: Color, Background, Outline, UIReset
if (aHint < maxHint) {
if (!NS_IsHintSubset(maxHint, aHint)) {
const nsStyleColor* color = (const nsStyleColor*)PeekStyleData(eStyleStruct_Color);
if (color) {
const nsStyleColor* otherColor = (const nsStyleColor*)aOther->GetStyleData(eStyleStruct_Color);
if (color != otherColor) {
hint = color->CalcDifference(*otherColor);
if (aHint < hint)
aHint = hint;
NS_UpdateHint(aHint, color->CalcDifference(*otherColor));
}
}
}
if (aHint < maxHint) {
if (!NS_IsHintSubset(maxHint, aHint)) {
const nsStyleBackground* background = (const nsStyleBackground*)PeekStyleData(eStyleStruct_Background);
if (background) {
const nsStyleBackground* otherBackground = (const nsStyleBackground*)aOther->GetStyleData(eStyleStruct_Background);
if (background != otherBackground) {
hint = background->CalcDifference(*otherBackground);
if (aHint < hint)
aHint = hint;
NS_UpdateHint(aHint, background->CalcDifference(*otherBackground));
}
}
}
if (aHint < maxHint) {
if (!NS_IsHintSubset(maxHint, aHint)) {
const nsStyleOutline* outline = (const nsStyleOutline*)PeekStyleData(eStyleStruct_Outline);
if (outline) {
const nsStyleOutline* otherOutline = (const nsStyleOutline*)aOther->GetStyleData(eStyleStruct_Outline);
if (outline != otherOutline) {
hint = outline->CalcDifference(*otherOutline);
if (aHint < hint)
aHint = hint;
NS_UpdateHint(aHint, outline->CalcDifference(*otherOutline));
}
}
}
if (aHint < maxHint) {
if (!NS_IsHintSubset(maxHint, aHint)) {
const nsStyleUIReset* ui = (const nsStyleUIReset*)PeekStyleData(eStyleStruct_UIReset);
if (ui) {
const nsStyleUIReset* otherUI = (const nsStyleUIReset*)aOther->GetStyleData(eStyleStruct_UIReset);
if (ui != otherUI) {
hint = ui->CalcDifference(*otherUI);
if (aHint < hint)
aHint = hint;
NS_UpdateHint(aHint, ui->CalcDifference(*otherUI));
}
}
}

View File

@ -243,7 +243,7 @@ public:
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint); // See nsStyleConsts fot hint values
nsChangeHint aHint); // See nsStyleConsts fot hint values
// xxx style rules enumeration
@ -251,7 +251,7 @@ public:
NS_IMETHOD StyleRuleChanged(nsIPresContext* aPresContext,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint); // See nsStyleConsts fot hint values
nsChangeHint aHint); // See nsStyleConsts fot hint values
NS_IMETHOD StyleRuleAdded(nsIPresContext* aPresContext,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule);
@ -1581,7 +1581,7 @@ StyleSetImpl::AttributeChanged(nsIPresContext* aPresContext,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint)
nsChangeHint aHint)
{
return mFrameConstructor->AttributeChanged(aPresContext, aContent,
aNameSpaceID, aAttribute, aModType, aHint);
@ -1593,7 +1593,7 @@ NS_IMETHODIMP
StyleSetImpl::StyleRuleChanged(nsIPresContext* aPresContext,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint)
nsChangeHint aHint)
{
return mFrameConstructor->StyleRuleChanged(aPresContext, aStyleSheet, aStyleRule, aHint);
}

View File

@ -1649,7 +1649,7 @@ nsGenericHTMLElement::SetAttr(PRInt32 aNameSpaceID,
}
// set as string value to avoid another string copy
PRBool impact = NS_STYLE_HINT_NONE;
nsChangeHint impact = NS_STYLE_HINT_NONE;
PRInt32 modHint = modification ? PRInt32(nsIDOMMutationEvent::MODIFICATION)
: PRInt32(nsIDOMMutationEvent::ADDITION);
GetMappedAttributeImpact(aAttribute, modHint, impact);
@ -1662,7 +1662,8 @@ nsGenericHTMLElement::SetAttr(PRInt32 aNameSpaceID,
NS_ENSURE_SUCCESS(result, result);
}
result = mAttributes->SetAttributeFor(aAttribute, aValue,
(NS_STYLE_HINT_CONTENT < impact),
(impact & ~(nsChangeHint_AttrChange | nsChangeHint_Aural
| nsChangeHint_Content)) != 0,
this, sheet);
}
@ -1860,9 +1861,9 @@ PRBool nsGenericHTMLElement::IsEventName(nsIAtom* aName)
aName == nsLayoutAtoms::onDOMNodeRemoved);
}
static PRInt32 GetStyleImpactFrom(const nsHTMLValue& aValue)
static nsChangeHint GetStyleImpactFrom(const nsHTMLValue& aValue)
{
PRInt32 hint = NS_STYLE_HINT_NONE;
nsChangeHint hint = NS_STYLE_HINT_NONE;
if (eHTMLUnit_ISupports == aValue.GetUnit()) {
nsCOMPtr<nsISupports> supports(dont_AddRef(aValue.GetISupportsValue()));
@ -1887,7 +1888,7 @@ nsGenericHTMLElement::SetHTMLAttribute(nsIAtom* aAttribute,
{
nsresult result = NS_OK;
PRBool impact = NS_STYLE_HINT_NONE;
nsChangeHint impact = NS_STYLE_HINT_NONE;
GetMappedAttributeImpact(aAttribute, nsIDOMMutationEvent::MODIFICATION,
impact);
nsCOMPtr<nsIHTMLStyleSheet> sheet;
@ -1911,7 +1912,7 @@ nsGenericHTMLElement::SetHTMLAttribute(nsIAtom* aAttribute,
if (nsHTMLAtoms::style == aAttribute) {
nsHTMLValue oldValue;
PRInt32 oldImpact = NS_STYLE_HINT_NONE;
nsChangeHint oldImpact = NS_STYLE_HINT_NONE;
// Either we have no listeners or it's a real modification. To
// cover the former case we need to check the return value of
// GetHTMLAttribute
@ -1921,9 +1922,7 @@ nsGenericHTMLElement::SetHTMLAttribute(nsIAtom* aAttribute,
oldImpact = GetStyleImpactFrom(oldValue);
}
impact = GetStyleImpactFrom(aValue);
if (impact < oldImpact) {
impact = oldImpact;
}
NS_UpdateHint(impact, oldImpact);
}
}
sheet = dont_AddRef(GetAttrStyleSheet(mDocument));
@ -1934,7 +1933,8 @@ nsGenericHTMLElement::SetHTMLAttribute(nsIAtom* aAttribute,
}
PRInt32 count;
result = mAttributes->SetAttributeFor(aAttribute, aValue,
(NS_STYLE_HINT_CONTENT < impact),
(impact & ~(nsChangeHint_AttrChange | nsChangeHint_Aural
| nsChangeHint_Content)) != 0,
this, sheet, count);
if (0 == count) {
delete mAttributes;
@ -1991,7 +1991,8 @@ nsGenericHTMLElement::SetHTMLAttribute(nsIAtom* aAttribute,
}
PRInt32 count;
result = mAttributes->SetAttributeFor(aAttribute, aValue,
(NS_STYLE_HINT_CONTENT < impact),
(impact & ~(nsChangeHint_AttrChange | nsChangeHint_Aural
| nsChangeHint_Content)) != 0,
this, sheet, count);
if (0 == count) {
delete mAttributes;
@ -2019,7 +2020,7 @@ nsGenericHTMLElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
}
}
PRInt32 impact = NS_STYLE_HINT_UNKNOWN;
nsChangeHint impact = NS_STYLE_HINT_UNKNOWN;
if (mDocument) {
if (aNotify) {
mDocument->BeginUpdate();
@ -2556,7 +2557,7 @@ nsGenericHTMLElement::AttributeToString(nsIAtom* aAttribute,
NS_IMETHODIMP
nsGenericHTMLElement::GetMappedAttributeImpact(const nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if (!GetCommonMappedAttributesImpact(aAttribute, aHint)) {
aHint = NS_STYLE_HINT_CONTENT;
@ -3498,7 +3499,7 @@ nsGenericHTMLElement::MapCommonAttributesInto(const nsIHTMLMappedAttributes* aAt
PRBool
nsGenericHTMLElement::GetCommonMappedAttributesImpact(const nsIAtom* aAttribute,
PRInt32& aHint)
nsChangeHint& aHint)
{
if (nsHTMLAtoms::dir == aAttribute) {
aHint = NS_STYLE_HINT_REFLOW; // XXX really? possibly FRAMECHANGE?
@ -3529,7 +3530,7 @@ nsGenericHTMLElement::GetCommonMappedAttributesImpact(const nsIAtom* aAttribute,
PRBool
nsGenericHTMLElement::GetImageMappedAttributesImpact(const nsIAtom* aAttribute,
PRInt32& aHint)
nsChangeHint& aHint)
{
if ((nsHTMLAtoms::width == aAttribute) ||
(nsHTMLAtoms::height == aAttribute) ||
@ -3572,7 +3573,7 @@ nsGenericHTMLElement::MapAlignAttributeInto(const nsIHTMLMappedAttributes* aAttr
PRBool
nsGenericHTMLElement::GetImageAlignAttributeImpact(const nsIAtom* aAttribute,
PRInt32& aHint)
nsChangeHint& aHint)
{
if ((nsHTMLAtoms::align == aAttribute)) {
aHint = NS_STYLE_HINT_FRAMECHANGE;
@ -3703,7 +3704,7 @@ nsGenericHTMLElement::MapImageBorderAttributeInto(const nsIHTMLMappedAttributes*
PRBool
nsGenericHTMLElement::GetImageBorderAttributeImpact(const nsIAtom* aAttribute,
PRInt32& aHint)
nsChangeHint& aHint)
{
if ((nsHTMLAtoms::border == aAttribute)) {
aHint = NS_STYLE_HINT_REFLOW;
@ -3774,7 +3775,7 @@ nsGenericHTMLElement::MapBackgroundAttributesInto(const nsIHTMLMappedAttributes*
PRBool
nsGenericHTMLElement::GetBackgroundAttributesImpact(const nsIAtom* aAttribute,
PRInt32& aHint)
nsChangeHint& aHint)
{
if ((nsHTMLAtoms::background == aAttribute) ||
(nsHTMLAtoms::bgcolor == aAttribute)) {

View File

@ -223,7 +223,7 @@ public:
const nsHTMLValue& aValue,
nsAString& aResult) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
#ifdef DEBUG
@ -635,7 +635,7 @@ public:
* @return whether the impact was set
*/
static PRBool GetCommonMappedAttributesImpact(const nsIAtom* aAttribute,
PRInt32& aHint);
nsChangeHint& aHint);
/**
* Get the style impact of image attributes (width, height, hspace and vspace
@ -646,7 +646,7 @@ public:
* @return whether the impact was set
*/
static PRBool GetImageMappedAttributesImpact(const nsIAtom* aAttribute,
PRInt32& aHint);
nsChangeHint& aHint);
/**
* Get the style impact of image align attributes (align currently). To be
* called from GetMappedAttributeImpact().
@ -656,7 +656,7 @@ public:
* @return whether the impact was set
*/
static PRBool GetImageAlignAttributeImpact(const nsIAtom* aAttribute,
PRInt32& aHint);
nsChangeHint& aHint);
/**
* Helper to map the align attribute into a style struct.
@ -703,7 +703,7 @@ public:
* @return whether the impact was set
*/
static PRBool GetImageBorderAttributeImpact(const nsIAtom* aAttribute,
PRInt32& aHint);
nsChangeHint& aHint);
/**
* Helper to map the background attributes (currently background and bgcolor)
@ -724,7 +724,7 @@ public:
* @return whether the impact was set
*/
static PRBool GetBackgroundAttributesImpact(const nsIAtom* aAttribute,
PRInt32& aHint);
nsChangeHint& aHint);
/**
* Get the primary frame for a piece of content.

View File

@ -85,7 +85,7 @@ public:
nsAString& aResult) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
@ -234,7 +234,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes,
NS_IMETHODIMP
nsHTMLAppletElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if (!GetCommonMappedAttributesImpact(aAttribute, aHint)) {
if (!GetImageMappedAttributesImpact(aAttribute, aHint)) {

View File

@ -75,7 +75,7 @@ public:
const nsHTMLValue& aValue,
nsAString& aResult) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
@ -217,7 +217,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes,
NS_IMETHODIMP
nsHTMLBRElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if (!GetCommonMappedAttributesImpact(aAttribute, aHint)) {
if (nsHTMLAtoms::clear == aAttribute) {

View File

@ -68,7 +68,7 @@ public:
NS_DECL_NSIDOMHTMLBASEFONTELEMENT
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
@ -158,7 +158,7 @@ NS_IMPL_STRING_ATTR(nsHTMLBaseFontElement, Size, size)
NS_IMETHODIMP
nsHTMLBaseFontElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if ((nsHTMLAtoms::color == aAttribute) ||
(nsHTMLAtoms::face == aAttribute) ||

View File

@ -127,7 +127,7 @@ public:
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker);
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
@ -737,7 +737,7 @@ nsHTMLBodyElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
NS_IMETHODIMP
nsHTMLBodyElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if ((aAttribute == nsHTMLAtoms::link) ||
(aAttribute == nsHTMLAtoms::vlink) ||

View File

@ -73,7 +73,7 @@ public:
const nsAString& aValue,
nsHTMLValue& aResult);
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
@ -180,7 +180,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aD
NS_IMETHODIMP
nsHTMLDListElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if (aAttribute == nsHTMLAtoms::compact) {
aHint = NS_STYLE_HINT_CONTENT; // handled by ua.css?

View File

@ -80,7 +80,7 @@ public:
const nsHTMLValue& aValue,
nsAString& aResult) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
@ -224,7 +224,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aD
NS_IMETHODIMP
nsHTMLDirectoryElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if (aAttribute == nsHTMLAtoms::type) {
aHint = NS_STYLE_HINT_REFLOW;

View File

@ -78,7 +78,7 @@ public:
const nsHTMLValue& aValue,
nsAString& aResult) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
@ -231,7 +231,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aD
NS_IMETHODIMP
nsHTMLDivElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if (aAttribute == nsHTMLAtoms::align) {
aHint = NS_STYLE_HINT_REFLOW;

View File

@ -78,7 +78,7 @@ public:
const nsHTMLValue& aValue,
nsAString& aResult) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
@ -306,16 +306,15 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes,
}
NS_IMETHODIMP
nsHTMLFontElement::GetMappedAttributeImpact(const nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32& aHint) const
nsHTMLFontElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
nsChangeHint& aHint) const
{
if (aAttribute == nsHTMLAtoms::color) {
aHint = NS_STYLE_HINT_VISUAL;
}
else if ((aAttribute == nsHTMLAtoms::face) ||
(aAttribute == nsHTMLAtoms::pointSize) ||
(aAttribute == nsHTMLAtoms::size) ||
(aAttribute == nsHTMLAtoms::size) ||
(aAttribute == nsHTMLAtoms::fontWeight)) {
aHint = NS_STYLE_HINT_REFLOW;
}

View File

@ -89,7 +89,7 @@ public:
const nsHTMLValue& aValue,
nsAString& aResult) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
@ -113,7 +113,7 @@ private:
* The style hint to return for the rows/cols attrs in
* GetMappedAttributeImpact
*/
PRInt32 mCurrentRowColHint;
nsChangeHint mCurrentRowColHint;
/**
* The parsed representation of the "rows" attribute
*/
@ -385,7 +385,7 @@ nsHTMLFrameSetElement::AttributeToString(nsIAtom* aAttribute,
NS_IMETHODIMP
nsHTMLFrameSetElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if ((aAttribute == nsHTMLAtoms::rows) ||
(aAttribute == nsHTMLAtoms::cols)) {

View File

@ -75,7 +75,7 @@ public:
const nsHTMLValue& aValue,
nsAString& aResult) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
@ -275,7 +275,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes,
NS_IMETHODIMP
nsHTMLHRElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if (aAttribute == nsHTMLAtoms::noshade) {
aHint = NS_STYLE_HINT_VISUAL;

View File

@ -75,7 +75,7 @@ public:
const nsHTMLValue& aValue,
nsAString& aResult) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
@ -213,7 +213,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aD
NS_IMETHODIMP
nsHTMLHeadingElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if (aAttribute == nsHTMLAtoms::align) {
aHint = NS_STYLE_HINT_REFLOW;

View File

@ -115,7 +115,7 @@ public:
}
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
@ -487,7 +487,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes,
NS_IMETHODIMP
nsHTMLIFrameElement::GetMappedAttributeImpact(const nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if ((aAttribute == nsHTMLAtoms::width) ||
(aAttribute == nsHTMLAtoms::height)) {

View File

@ -129,7 +129,7 @@ public:
nsAString& aResult) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
NS_IMETHOD HandleDOMEvent(nsIPresContext* aPresContext, nsEvent* aEvent,
nsIDOMEvent** aDOMEvent, PRUint32 aFlags,
@ -559,7 +559,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes,
NS_IMETHODIMP
nsHTMLImageElement::GetMappedAttributeImpact(const nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if ((aAttribute == nsHTMLAtoms::usemap) ||
(aAttribute == nsHTMLAtoms::ismap) ||

View File

@ -176,7 +176,7 @@ public:
const nsHTMLValue& aValue,
nsAString& aResult) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
NS_IMETHOD HandleDOMEvent(nsIPresContext* aPresContext, nsEvent* aEvent,
nsIDOMEvent** aDOMEvent, PRUint32 aFlags,
@ -1927,7 +1927,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes,
NS_IMETHODIMP
nsHTMLInputElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if (aAttribute == nsHTMLAtoms::value) {
aHint = NS_STYLE_HINT_REFLOW;

View File

@ -75,7 +75,7 @@ public:
const nsHTMLValue& aValue,
nsAString& aResult) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
@ -242,7 +242,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes,
NS_IMETHODIMP
nsHTMLLIElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if (aAttribute == nsHTMLAtoms::type) {
aHint = NS_STYLE_HINT_REFLOW;

View File

@ -72,7 +72,7 @@ public:
NS_DECL_NSIDOMHTMLMAPELEMENT
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
NS_IMETHOD SetDocument(nsIDocument* aDocument, PRBool aDeep,
PRBool aCompileEventHandlers);
#ifdef DEBUG
@ -217,7 +217,7 @@ NS_IMPL_STRING_ATTR(nsHTMLMapElement, Name, name)
NS_IMETHODIMP
nsHTMLMapElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if (aAttribute == nsHTMLAtoms::name) {
aHint = NS_STYLE_HINT_RECONSTRUCT_ALL;

View File

@ -82,7 +82,7 @@ public:
nsAString& aResult) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
@ -224,7 +224,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aD
NS_IMETHODIMP
nsHTMLMenuElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if (aAttribute == nsHTMLAtoms::type) {
aHint = NS_STYLE_HINT_REFLOW;

View File

@ -76,7 +76,7 @@ public:
nsAString& aResult) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
@ -260,7 +260,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aD
NS_IMETHODIMP
nsHTMLOListElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if (aAttribute == nsHTMLAtoms::type) {
aHint = NS_STYLE_HINT_REFLOW;

View File

@ -85,7 +85,7 @@ public:
nsAString& aResult) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
@ -310,7 +310,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes,
NS_IMETHODIMP
nsHTMLObjectElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if (!GetCommonMappedAttributesImpact(aAttribute, aHint)) {
if (!GetImageBorderAttributeImpact(aAttribute, aHint)) {

View File

@ -105,7 +105,7 @@ public:
const nsAString& aValue,
nsHTMLValue& aResult);
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
@ -491,7 +491,7 @@ nsHTMLOptionElement::StringToAttribute(nsIAtom* aAttribute,
NS_IMETHODIMP
nsHTMLOptionElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
nsIFormControlFrame* fcFrame = GetSelectFrame();

View File

@ -78,7 +78,7 @@ public:
const nsHTMLValue& aValue,
nsAString& aResult) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
@ -215,7 +215,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aD
NS_IMETHODIMP
nsHTMLParagraphElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if (aAttribute == nsHTMLAtoms::align) {
aHint = NS_STYLE_HINT_REFLOW;

View File

@ -77,7 +77,7 @@ public:
const nsAString& aValue,
nsHTMLValue& aResult);
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
@ -257,7 +257,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes,
NS_IMETHODIMP
nsHTMLPreElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if ((aAttribute == nsHTMLAtoms::variable) ||
(aAttribute == nsHTMLAtoms::wrap) ||

View File

@ -233,7 +233,7 @@ public:
nsHTMLValue& aResult);
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute,
PRInt32 aModType, PRInt32& aHint) const;
PRInt32 aModType, nsChangeHint& aHint) const;
protected:
@ -1849,7 +1849,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes,
NS_IMETHODIMP
nsHTMLSelectElement::GetMappedAttributeImpact(const nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if (aAttribute == nsHTMLAtoms::multiple) {
aHint = NS_STYLE_HINT_FRAMECHANGE;

View File

@ -102,7 +102,7 @@ public:
nsAString& aResult) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute,
PRInt32 aModType, PRInt32& aHint) const;
PRInt32 aModType, nsChangeHint& aHint) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
@ -420,7 +420,7 @@ PlainMapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes,
NS_IMETHODIMP
nsHTMLSharedLeafElement::GetMappedAttributeImpact(const nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if (mNodeInfo->Equals(nsHTMLAtoms::embed)) {
if (!GetCommonMappedAttributesImpact(aAttribute, aHint)) {

View File

@ -102,7 +102,7 @@ public:
nsAString& aResult) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute,
PRInt32 aModType, PRInt32& aHint) const;
PRInt32 aModType, nsChangeHint& aHint) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
@ -420,7 +420,7 @@ PlainMapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes,
NS_IMETHODIMP
nsHTMLSharedLeafElement::GetMappedAttributeImpact(const nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if (mNodeInfo->Equals(nsHTMLAtoms::embed)) {
if (!GetCommonMappedAttributesImpact(aAttribute, aHint)) {

View File

@ -85,7 +85,7 @@ public:
nsAString& aResult) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
@ -310,7 +310,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes,
NS_IMETHODIMP
nsHTMLObjectElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if (!GetCommonMappedAttributesImpact(aAttribute, aHint)) {
if (!GetImageBorderAttributeImpact(aAttribute, aHint)) {

View File

@ -76,7 +76,7 @@ public:
nsAString& aResult) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
@ -219,7 +219,7 @@ void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleDat
NS_IMETHODIMP
nsHTMLTableCaptionElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if (aAttribute == nsHTMLAtoms::align) {
aHint = NS_STYLE_HINT_REFLOW;

View File

@ -85,7 +85,7 @@ public:
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker);
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
@ -486,7 +486,7 @@ void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes,
NS_IMETHODIMP
nsHTMLTableCellElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if ((aAttribute == nsHTMLAtoms::align) ||
(aAttribute == nsHTMLAtoms::valign) ||

View File

@ -81,7 +81,7 @@ public:
nsAString& aResult) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
@ -324,7 +324,7 @@ void ColMapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes,
NS_IMETHODIMP
nsHTMLTableColElement::GetMappedAttributeImpact(const nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if ((aAttribute == nsHTMLAtoms::width) ||
(aAttribute == nsHTMLAtoms::align) ||

View File

@ -90,7 +90,7 @@ public:
nsAString& aResult) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
@ -1508,7 +1508,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes,
NS_IMETHODIMP
nsHTMLTableElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if ((aAttribute == nsHTMLAtoms::layout) ||
(aAttribute == nsHTMLAtoms::cellpadding) ||

View File

@ -188,7 +188,7 @@ public:
nsAString& aResult) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
@ -646,7 +646,7 @@ void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleDat
NS_IMETHODIMP
nsHTMLTableRowElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if ((aAttribute == nsHTMLAtoms::align) ||
(aAttribute == nsHTMLAtoms::valign) ||

View File

@ -80,7 +80,7 @@ public:
nsAString& aResult) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
@ -375,7 +375,7 @@ void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleDat
NS_IMETHODIMP
nsHTMLTableSectionElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if ((aAttribute == nsHTMLAtoms::align) ||
(aAttribute == nsHTMLAtoms::valign) ||

View File

@ -133,7 +133,7 @@ public:
nsHTMLValue& aResult);
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
NS_IMETHOD HandleDOMEvent(nsIPresContext* aPresContext, nsEvent* aEvent,
nsIDOMEvent** aDOMEvent, PRUint32 aFlags,
nsEventStatus* aEventStatus);
@ -619,7 +619,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes,
NS_IMETHODIMP
nsHTMLTextAreaElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
// XXX Bug 50280 - It is unclear why we need to do this here for
// rows and cols and why the AttributeChanged method in

View File

@ -79,7 +79,7 @@ public:
nsAString& aResult) const;
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
@ -241,7 +241,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aD
NS_IMETHODIMP
nsHTMLUListElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if (aAttribute == nsHTMLAtoms::type) {
aHint = NS_STYLE_HINT_REFLOW;

View File

@ -208,7 +208,7 @@ nsHTMLUnknownElement::SetAttribute(PRInt32 aNameSpaceID,
}
// set as string value to avoid another string copy
PRBool impact = NS_STYLE_HINT_NONE;
nsChangeHint impact = NS_STYLE_HINT_NONE;
GetMappedAttributeImpact(aAttribute, nsIDOMMutationEvent::MODIFICATION, impact);
nsCOMPtr<nsIHTMLStyleSheet> sheet(dont_AddRef(GetAttrStyleSheet(mDocument)));
@ -217,7 +217,8 @@ nsHTMLUnknownElement::SetAttribute(PRInt32 aNameSpaceID,
NS_ENSURE_SUCCESS(result, result);
}
result = mAttributes->SetAttributeFor(aAttribute, aValue,
(NS_STYLE_HINT_CONTENT < impact),
(impact & ~(nsChangeHint_AttrChange | nsChangeHint_Aural
| nsChangeHint_Content)) != 0,
this, sheet);
}

View File

@ -306,7 +306,7 @@ public:
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint) { return NS_OK; }
nsChangeHint aHint) { return NS_OK; }
NS_IMETHOD ContentAppended(nsIDocument *aDocument,
nsIContent* aContainer,
PRInt32 aNewIndexInContainer)
@ -334,7 +334,7 @@ public:
NS_IMETHOD StyleRuleChanged(nsIDocument *aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint) { return NS_OK; }
nsChangeHint aHint) { return NS_OK; }
NS_IMETHOD StyleRuleAdded(nsIDocument *aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule) { return NS_OK; }

View File

@ -1476,7 +1476,7 @@ nsHTMLDocument::AttributeWillChange(nsIContent* aContent, PRInt32 aNameSpaceID,
NS_IMETHODIMP
nsHTMLDocument::AttributeChanged(nsIContent* aContent, PRInt32 aNameSpaceID,
nsIAtom* aAttribute, PRInt32 aModType, PRInt32 aHint)
nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint aHint)
{
NS_ABORT_IF_FALSE(aContent, "Null content!");

View File

@ -143,7 +143,7 @@ public:
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint);
nsChangeHint aHint);
NS_IMETHOD AttributeWillChange(nsIContent* aChild,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute);

View File

@ -39,7 +39,9 @@
#define nsCSS1Parser_h___
#include "nsISupports.h"
#include "nsChangeHint.h"
#include "nsAString.h"
class nsIStyleRule;
class nsICSSStyleSheet;
class nsIUnicharInputStream;
@ -93,7 +95,7 @@ public:
nsIURI* aBaseURL,
nsCSSDeclaration* aDeclaration,
PRBool aParseOnlyOneDecl,
PRInt32* aHint) = 0;
nsChangeHint* aHint) = 0;
NS_IMETHOD ParseRule(const nsAString& aRule,
nsIURI* aBaseURL,
@ -103,7 +105,7 @@ public:
const nsAString& aPropValue,
nsIURI* aBaseURL,
nsCSSDeclaration* aDeclaration,
PRInt32* aHint) = 0;
nsChangeHint* aHint) = 0;
// Charset management method:
// Set the charset before calling any of the Parse emthods if you want the

View File

@ -45,6 +45,7 @@
#include "nsCSSProps.h"
#include "nsUnitConversion.h"
#include "nsVoidArray.h"
#include "nsFont.h"
#include "nsStyleConsts.h"
@ -4865,7 +4866,7 @@ PRBool nsCSSDeclaration::AppendValueToString(nsCSSProperty aProperty, const nsCS
PRInt32 intValue = aValue.GetIntValue();
if (NS_STYLE_TEXT_DECORATION_NONE != intValue) {
PRInt32 mask;
for (mask = NS_STYLE_TEXT_DECORATION_UNDERLINE;
for (mask = NS_STYLE_TEXT_DECORATION_UNDERLINE;
mask <= NS_STYLE_TEXT_DECORATION_BLINK;
mask <<= 1) {
if ((mask & intValue) == mask) {
@ -6162,19 +6163,17 @@ nsCSSDeclaration::GetNthProperty(PRUint32 aIndex, nsAString& aReturn)
return NS_OK;
}
PRInt32
nsChangeHint
nsCSSDeclaration::GetStyleImpact() const
{
PRInt32 hint = NS_STYLE_HINT_NONE;
nsChangeHint hint = NS_STYLE_HINT_NONE;
if (nsnull != mOrder) {
PRInt32 count = mOrder->Count();
PRInt32 index;
for (index = 0; index < count; index++) {
nsCSSProperty property = (nsCSSProperty)mOrder->ValueAt(index);
if (eCSSProperty_UNKNOWN < property) {
if (hint < nsCSSProps::kHintTable[property]) {
hint = nsCSSProps::kHintTable[property];
}
NS_UpdateHint(hint, nsCSSProps::kHintTable[property]);
}
}
}

View File

@ -592,7 +592,7 @@ public:
PRUint32 Count();
nsresult GetNthProperty(PRUint32 aIndex, nsAString& aReturn);
PRInt32 GetStyleImpact() const;
nsChangeHint GetStyleImpact() const;
nsresult ToString(nsAString& aString);

View File

@ -169,7 +169,7 @@ public:
nsIURI* aBaseURL,
nsCSSDeclaration* aDeclaration,
PRBool aParseOnlyOneDecl,
PRInt32* aHint);
nsChangeHint* aHint);
NS_IMETHOD ParseRule(const nsAString& aRule,
nsIURI* aBaseURL,
@ -179,7 +179,7 @@ public:
const nsAString& aPropValue,
nsIURI* aBaseURL,
nsCSSDeclaration* aDeclaration,
PRInt32* aHint);
nsChangeHint* aHint);
NS_IMETHOD GetCharset(/*out*/nsAString &aCharsetDest) const;
// sets the out-param to the current charset, as set by SetCharset
@ -248,9 +248,9 @@ protected:
PRBool ParseDeclaration(PRInt32& aErrorCode,
nsCSSDeclaration* aDeclaration,
PRBool aCheckForBraces,
PRInt32& aChangeHint);
nsChangeHint& aChangeHint);
PRBool ParseProperty(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
nsCSSProperty aPropID, PRInt32& aChangeHint);
nsCSSProperty aPropID, nsChangeHint& aChangeHint);
PRBool ParseSingleValueProperty(PRInt32& aErrorCode, nsCSSValue& aValue,
nsCSSProperty aPropID);
@ -259,52 +259,52 @@ protected:
#endif
// Property specific parsing routines
PRBool ParseAppearance(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParseAppearance(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
PRBool ParseAzimuth(PRInt32& aErrorCode, nsCSSValue& aValue);
PRBool ParseBackground(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParseBackgroundPosition(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParseBorder(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParseBorderColor(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParseBorderColors(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint,
PRBool ParseBackground(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
PRBool ParseBackgroundPosition(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
PRBool ParseBorder(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
PRBool ParseBorderColor(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
PRBool ParseBorderColors(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint,
nsCSSProperty aProperty);
PRBool ParseBorderSpacing(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParseBorderSpacing(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
PRBool ParseBorderSide(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
const nsCSSProperty aPropIDs[], PRInt32& aChangeHint);
PRBool ParseBorderStyle(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParseBorderWidth(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParseBorderRadius(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
const nsCSSProperty aPropIDs[], nsChangeHint& aChangeHint);
PRBool ParseBorderStyle(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
PRBool ParseBorderWidth(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
PRBool ParseBorderRadius(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
#ifdef ENABLE_OUTLINE
PRBool ParseOutlineRadius(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParseOutlineRadius(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
#endif
PRBool ParseClip(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParseContent(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParseClip(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
PRBool ParseContent(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
PRBool ParseCounterData(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
nsCSSProperty aPropID, PRInt32& aChangeHint);
PRBool ParseCue(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParseCursor(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParseFont(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
nsCSSProperty aPropID, nsChangeHint& aChangeHint);
PRBool ParseCue(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
PRBool ParseCursor(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
PRBool ParseFont(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
PRBool ParseFontWeight(PRInt32& aErrorCode, nsCSSValue& aValue);
PRBool ParseFamily(PRInt32& aErrorCode, nsCSSValue& aValue);
PRBool ParseImageRegion(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParseListStyle(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParseMargin(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParseImageRegion(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
PRBool ParseListStyle(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
PRBool ParseMargin(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
PRBool ParseMarks(PRInt32& aErrorCode, nsCSSValue& aValue);
#ifdef ENABLE_OUTLINE
PRBool ParseOutline(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParseOutline(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
#endif
PRBool ParsePadding(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParsePause(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParsePlayDuring(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParseQuotes(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParseSize(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParsePadding(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
PRBool ParsePause(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
PRBool ParsePlayDuring(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
PRBool ParseQuotes(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
PRBool ParseSize(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
PRBool ParseTextDecoration(PRInt32& aErrorCode, nsCSSValue& aValue);
PRBool ParseTextShadow(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint);
PRBool ParseTextShadow(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint);
// Reused utility parsing routines
nsresult AppendValue(nsCSSDeclaration* aDeclaration, nsCSSProperty aPropID,
const nsCSSValue& aValue, PRInt32& aChangeHint);
const nsCSSValue& aValue, nsChangeHint& aChangeHint);
PRBool ParseBoxProperties(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
const nsCSSProperty aPropIDs[], PRInt32& aChangeHint);
const nsCSSProperty aPropIDs[], nsChangeHint& aChangeHint);
PRInt32 ParseChoice(PRInt32& aErrorCode, nsCSSValue aValues[],
const nsCSSProperty aPropIDs[], PRInt32 aNumIDs);
PRBool ParseColor(PRInt32& aErrorCode, nsCSSValue& aValue);
@ -685,11 +685,11 @@ CSSParserImpl::ParseStyleAttribute(const nsAString& aAttributeValue,
}
NS_IMETHODIMP
CSSParserImpl::ParseAndAppendDeclaration(const nsAString& aBuffer,
nsIURI* aBaseURL,
nsCSSDeclaration* aDeclaration,
PRBool aParseOnlyOneDecl,
PRInt32* aHint)
CSSParserImpl::ParseAndAppendDeclaration(const nsAString& aBuffer,
nsIURI* aBaseURL,
nsCSSDeclaration* aDeclaration,
PRBool aParseOnlyOneDecl,
nsChangeHint* aHint)
{
// NS_ASSERTION(nsnull != aBaseURL, "need base URL");
@ -713,7 +713,7 @@ CSSParserImpl::ParseAndAppendDeclaration(const nsAString& aBuffer,
mSection = eCSSSection_General;
PRInt32 errorCode = NS_OK;
PRInt32 hint = NS_STYLE_HINT_NONE;
nsChangeHint hint = NS_STYLE_HINT_NONE;
if (nsnull != aHint) {
*aHint = hint;
@ -721,8 +721,8 @@ CSSParserImpl::ParseAndAppendDeclaration(const nsAString& aBuffer,
do {
if (ParseDeclaration(errorCode, aDeclaration, PR_FALSE, hint)) {
if (aHint && hint > *aHint) {
*aHint = hint;
if (aHint) {
NS_UpdateHint(*aHint, hint);
}
} else {
if (errorCode != -1) { // -1 means EOF so we ignore that
@ -800,7 +800,7 @@ CSSParserImpl::ParseProperty(const nsAString& aPropName,
const nsAString& aPropValue,
nsIURI* aBaseURL,
nsCSSDeclaration* aDeclaration,
PRInt32* aHint)
nsChangeHint* aHint)
{
NS_ASSERTION(nsnull != aBaseURL, "need base URL");
NS_ASSERTION(nsnull != aDeclaration, "Need declaration to parse into!");
@ -825,7 +825,7 @@ CSSParserImpl::ParseProperty(const nsAString& aPropName,
mSection = eCSSSection_General;
PRInt32 errorCode = NS_OK;
PRInt32 hint = NS_STYLE_HINT_NONE;
nsChangeHint hint = NS_STYLE_HINT_NONE;
if (aHint) {
*aHint = hint;
@ -853,8 +853,8 @@ CSSParserImpl::ParseProperty(const nsAString& aPropName,
}
CLEAR_ERROR();
if (aHint && hint > *aHint) {
*aHint = hint;
if (aHint) {
NS_UpdateHint(*aHint, hint);
}
ReleaseScanner();
@ -2474,7 +2474,7 @@ CSSParserImpl::ParseDeclarationBlock(PRInt32& aErrorCode,
PRInt32 count = 0;
PRBool dropDeclaration = PR_FALSE;
for (;;) {
PRInt32 hint = NS_STYLE_HINT_NONE;
nsChangeHint hint = NS_STYLE_HINT_NONE;
if (ParseDeclaration(aErrorCode, declaration, aCheckForBraces, hint)) {
count++; // count declarations
}
@ -2676,7 +2676,7 @@ PRBool
CSSParserImpl::ParseDeclaration(PRInt32& aErrorCode,
nsCSSDeclaration* aDeclaration,
PRBool aCheckForBraces,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
// Get property name
nsCSSToken* tk = &mToken;
@ -3403,9 +3403,9 @@ done:
return found;
}
static PRInt32 ComputeChangeHint(nsCSSProperty aPropID,
const nsCSSValue& aOldValue,
const nsCSSValue& aValue)
static nsChangeHint ComputeChangeHint(nsCSSProperty aPropID,
const nsCSSValue& aOldValue,
const nsCSSValue& aValue)
{
NS_ASSERTION(aOldValue != aValue,
"ComputeChangeHint should not be called with equal values");
@ -3434,7 +3434,7 @@ static PRInt32 ComputeChangeHint(nsCSSProperty aPropID,
}
nsresult CSSParserImpl::AppendValue(nsCSSDeclaration* aDeclaration, nsCSSProperty aPropID,
const nsCSSValue& aValue, PRInt32& aChangeHint)
const nsCSSValue& aValue, nsChangeHint& aChangeHint)
{
nsresult result;
nsCSSValue oldValue;
@ -3443,10 +3443,7 @@ nsresult CSSParserImpl::AppendValue(nsCSSDeclaration* aDeclaration, nsCSSPropert
if (aValue != oldValue) {
result = aDeclaration->AppendValue(aPropID, aValue);
PRInt32 newHint = ComputeChangeHint(aPropID, oldValue, aValue);
if (aChangeHint < newHint) {
aChangeHint = newHint;
}
NS_UpdateHint(aChangeHint, ComputeChangeHint(aPropID, oldValue, aValue));
}
return result;
}
@ -3459,7 +3456,7 @@ nsresult CSSParserImpl::AppendValue(nsCSSDeclaration* aDeclaration, nsCSSPropert
PRBool CSSParserImpl::ParseBoxProperties(PRInt32& aErrorCode,
nsCSSDeclaration* aDeclaration,
const nsCSSProperty aPropIDs[],
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
// Get up to four values for the property
nsCSSValue values[4];
@ -3507,7 +3504,7 @@ PRBool CSSParserImpl::ParseBoxProperties(PRInt32& aErrorCode,
PRBool CSSParserImpl::ParseProperty(PRInt32& aErrorCode,
nsCSSDeclaration* aDeclaration,
nsCSSProperty aPropID,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
switch (aPropID) { // handle shorthand or multiple properties
case eCSSProperty_appearance:
@ -4064,7 +4061,7 @@ PRBool CSSParserImpl::ParseAzimuth(PRInt32& aErrorCode, nsCSSValue& aValue)
}
PRBool CSSParserImpl::ParseAppearance(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
nsCSSValue appearance;
if (!ParseVariant(aErrorCode, appearance, VARIANT_HK, nsCSSProps::kAppearanceKTable))
@ -4079,7 +4076,7 @@ PRBool CSSParserImpl::ParseAppearance(PRInt32& aErrorCode, nsCSSDeclaration* aDe
}
PRBool CSSParserImpl::ParseBackground(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
const PRInt32 numProps = 6;
static const nsCSSProperty kBackgroundIDs[numProps] = {
@ -4220,7 +4217,7 @@ PRBool CSSParserImpl::ParseBackground(PRInt32& aErrorCode, nsCSSDeclaration* aDe
PRBool CSSParserImpl::ParseBackgroundPosition(PRInt32& aErrorCode,
nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
// First try a number or a length value
nsCSSValue xValue;
@ -4342,7 +4339,7 @@ static const nsCSSProperty kOutlineRadiusIDs[] = {
};
PRBool CSSParserImpl::ParseBorder(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
const PRInt32 numProps = 3;
static const nsCSSProperty kBorderIDs[] = {
@ -4381,13 +4378,13 @@ PRBool CSSParserImpl::ParseBorder(PRInt32& aErrorCode, nsCSSDeclaration* aDeclar
}
PRBool CSSParserImpl::ParseBorderColor(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
return ParseBoxProperties(aErrorCode, aDeclaration, kBorderColorIDs, aChangeHint);
}
PRBool CSSParserImpl::ParseBorderSpacing(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
nsCSSValue xValue;
if (ParsePositiveVariant(aErrorCode, xValue, VARIANT_HL, nsnull)) {
@ -4417,7 +4414,7 @@ PRBool CSSParserImpl::ParseBorderSpacing(PRInt32& aErrorCode, nsCSSDeclaration*
}
PRBool CSSParserImpl::ParseBorderSide(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
const nsCSSProperty aPropIDs[], PRInt32& aChangeHint)
const nsCSSProperty aPropIDs[], nsChangeHint& aChangeHint)
{
const PRInt32 numProps = 3;
nsCSSValue values[numProps];
@ -4445,33 +4442,33 @@ PRBool CSSParserImpl::ParseBorderSide(PRInt32& aErrorCode, nsCSSDeclaration* aDe
}
PRBool CSSParserImpl::ParseBorderStyle(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
return ParseBoxProperties(aErrorCode, aDeclaration, kBorderStyleIDs, aChangeHint);
}
PRBool CSSParserImpl::ParseBorderWidth(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
return ParseBoxProperties(aErrorCode, aDeclaration, kBorderWidthIDs, aChangeHint);
}
PRBool CSSParserImpl::ParseBorderRadius(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
return ParseBoxProperties(aErrorCode, aDeclaration, kBorderRadiusIDs, aChangeHint);
}
#ifdef ENABLE_OUTLINE
PRBool CSSParserImpl::ParseOutlineRadius(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
return ParseBoxProperties(aErrorCode, aDeclaration, kOutlineRadiusIDs, aChangeHint);
}
#endif
PRBool CSSParserImpl::ParseBorderColors(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint, nsCSSProperty aProperty)
nsChangeHint& aChangeHint, nsCSSProperty aProperty)
{
nsCSSValue value;
if (ParseVariant(aErrorCode, value, VARIANT_HCK|VARIANT_NONE, nsCSSProps::kBorderColorKTable)) {
@ -4505,7 +4502,7 @@ PRBool CSSParserImpl::ParseBorderColors(PRInt32& aErrorCode, nsCSSDeclaration* a
}
PRBool CSSParserImpl::ParseClip(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
static const nsCSSProperty kClipIDs[] = {
eCSSProperty_clip_top,
@ -4576,7 +4573,7 @@ PRBool CSSParserImpl::ParseClip(PRInt32& aErrorCode, nsCSSDeclaration* aDeclarat
}
PRBool CSSParserImpl::ParseImageRegion(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
static const nsCSSProperty kImageRegionIDs[] = {
eCSSProperty_image_region_top,
@ -4646,7 +4643,7 @@ PRBool CSSParserImpl::ParseImageRegion(PRInt32& aErrorCode, nsCSSDeclaration* aD
#define VARIANT_CONTENT (VARIANT_STRING | VARIANT_URL | VARIANT_COUNTER | VARIANT_ATTR | \
VARIANT_KEYWORD)
PRBool CSSParserImpl::ParseContent(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
nsCSSValue value;
if (ParseVariant(aErrorCode, value, VARIANT_CONTENT | VARIANT_INHERIT,
@ -4668,9 +4665,7 @@ PRBool CSSParserImpl::ParseContent(PRInt32& aErrorCode, nsCSSDeclaration* aDecla
while (nsnull != list) {
if (ExpectEndProperty(aErrorCode, PR_TRUE)) {
if (aChangeHint < nsCSSProps::kHintTable[eCSSProperty_content]) {
aChangeHint = nsCSSProps::kHintTable[eCSSProperty_content];
}
NS_UpdateHint(aChangeHint, nsCSSProps::kHintTable[eCSSProperty_content]);
aErrorCode = aDeclaration->AppendStructValue(eCSSProperty_content, listHead);
return NS_SUCCEEDED(aErrorCode);
}
@ -4694,7 +4689,7 @@ PRBool CSSParserImpl::ParseContent(PRInt32& aErrorCode, nsCSSDeclaration* aDecla
}
PRBool CSSParserImpl::ParseCounterData(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
nsCSSProperty aPropID, PRInt32& aChangeHint)
nsCSSProperty aPropID, nsChangeHint& aChangeHint)
{
nsString* ident = NextIdent(aErrorCode);
if (nsnull == ident) {
@ -4732,9 +4727,7 @@ PRBool CSSParserImpl::ParseCounterData(PRInt32& aErrorCode, nsCSSDeclaration* aD
while (nsnull != data) {
if (ExpectEndProperty(aErrorCode, PR_TRUE)) {
if (aChangeHint < nsCSSProps::kHintTable[aPropID]) {
aChangeHint = nsCSSProps::kHintTable[aPropID];
}
NS_UpdateHint(aChangeHint, nsCSSProps::kHintTable[aPropID]);
aErrorCode = aDeclaration->AppendStructValue(aPropID, dataHead);
return NS_SUCCEEDED(aErrorCode);
}
@ -4744,9 +4737,7 @@ PRBool CSSParserImpl::ParseCounterData(PRInt32& aErrorCode, nsCSSDeclaration* aD
if ((eCSSToken_Number == mToken.mType) && (mToken.mIntegerValid)) {
data->mValue.SetIntValue(mToken.mInteger, eCSSUnit_Integer);
if (ExpectEndProperty(aErrorCode, PR_TRUE)) {
if (aChangeHint < nsCSSProps::kHintTable[aPropID]) {
aChangeHint = nsCSSProps::kHintTable[aPropID];
}
NS_UpdateHint(aChangeHint, nsCSSProps::kHintTable[aPropID]);
aErrorCode = aDeclaration->AppendStructValue(aPropID, dataHead);
return NS_SUCCEEDED(aErrorCode);
}
@ -4774,7 +4765,7 @@ PRBool CSSParserImpl::ParseCounterData(PRInt32& aErrorCode, nsCSSDeclaration* aD
}
PRBool CSSParserImpl::ParseCue(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
nsCSSValue before;
if (ParseSingleValueProperty(aErrorCode, before, eCSSProperty_cue_before)) {
@ -4799,7 +4790,7 @@ PRBool CSSParserImpl::ParseCue(PRInt32& aErrorCode, nsCSSDeclaration* aDeclarati
}
PRBool CSSParserImpl::ParseCursor(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
nsCSSValue value;
if (ParseVariant(aErrorCode, value, VARIANT_AHUK, nsCSSProps::kCursorKTable)) {
@ -4818,9 +4809,7 @@ PRBool CSSParserImpl::ParseCursor(PRInt32& aErrorCode, nsCSSDeclaration* aDeclar
}
}
if (ExpectEndProperty(aErrorCode, PR_TRUE)) {
if (aChangeHint < nsCSSProps::kHintTable[eCSSProperty_cursor]) {
aChangeHint = nsCSSProps::kHintTable[eCSSProperty_cursor];
}
NS_UpdateHint(aChangeHint, nsCSSProps::kHintTable[eCSSProperty_cursor]);
aErrorCode = aDeclaration->AppendStructValue(eCSSProperty_cursor, listHead);
return NS_SUCCEEDED(aErrorCode);
}
@ -4851,7 +4840,7 @@ PRBool CSSParserImpl::ParseCursor(PRInt32& aErrorCode, nsCSSDeclaration* aDeclar
PRBool CSSParserImpl::ParseFont(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
static const nsCSSProperty fontIDs[] = {
eCSSProperty_font_style,
@ -5037,7 +5026,7 @@ PRBool CSSParserImpl::ParseFamily(PRInt32& aErrorCode, nsCSSValue& aValue)
}
PRBool CSSParserImpl::ParseListStyle(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
const PRInt32 numProps = 3;
static const nsCSSProperty listStyleIDs[] = {
@ -5071,7 +5060,7 @@ PRBool CSSParserImpl::ParseListStyle(PRInt32& aErrorCode, nsCSSDeclaration* aDec
}
PRBool CSSParserImpl::ParseMargin(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
static const nsCSSProperty kMarginSideIDs[] = {
eCSSProperty_margin_top,
@ -5102,7 +5091,7 @@ PRBool CSSParserImpl::ParseMarks(PRInt32& aErrorCode, nsCSSValue& aValue)
#ifdef ENABLE_OUTLINE
PRBool CSSParserImpl::ParseOutline(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
const PRInt32 numProps = 3;
static const nsCSSProperty kOutlineIDs[] = {
@ -5137,7 +5126,7 @@ PRBool CSSParserImpl::ParseOutline(PRInt32& aErrorCode, nsCSSDeclaration* aDecla
#endif
PRBool CSSParserImpl::ParsePadding(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
static const nsCSSProperty kPaddingSideIDs[] = {
eCSSProperty_padding_top,
@ -5149,7 +5138,7 @@ PRBool CSSParserImpl::ParsePadding(PRInt32& aErrorCode, nsCSSDeclaration* aDecla
}
PRBool CSSParserImpl::ParsePause(PRInt32& aErrorCode,
nsCSSDeclaration* aDeclaration, PRInt32& aChangeHint)
nsCSSDeclaration* aDeclaration, nsChangeHint& aChangeHint)
{
nsCSSValue before;
if (ParseSingleValueProperty(aErrorCode, before, eCSSProperty_pause_before)) {
@ -5175,7 +5164,7 @@ PRBool CSSParserImpl::ParsePause(PRInt32& aErrorCode,
PRBool CSSParserImpl::ParsePlayDuring(PRInt32& aErrorCode,
nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
nsCSSValue playDuring;
nsCSSValue flags;
@ -5199,7 +5188,7 @@ PRBool CSSParserImpl::ParsePlayDuring(PRInt32& aErrorCode,
PRBool CSSParserImpl::ParseQuotes(PRInt32& aErrorCode,
nsCSSDeclaration* aDeclaration,
PRInt32 &aChangeHint)
nsChangeHint &aChangeHint)
{
nsCSSValue open;
if (ParseVariant(aErrorCode, open, VARIANT_HOS, nsnull)) {
@ -5215,9 +5204,7 @@ PRBool CSSParserImpl::ParseQuotes(PRInt32& aErrorCode,
// get mandatory close
if (ParseVariant(aErrorCode, quotes->mClose, VARIANT_STRING, nsnull)) {
if (ExpectEndProperty(aErrorCode, PR_TRUE)) {
if (aChangeHint < nsCSSProps::kHintTable[eCSSProperty_quotes]) {
aChangeHint = nsCSSProps::kHintTable[eCSSProperty_quotes];
}
NS_UpdateHint(aChangeHint, nsCSSProps::kHintTable[eCSSProperty_quotes]);
aErrorCode = aDeclaration->AppendStructValue(eCSSProperty_quotes, quotesHead);
return NS_SUCCEEDED(aErrorCode);
}
@ -5246,7 +5233,7 @@ PRBool CSSParserImpl::ParseQuotes(PRInt32& aErrorCode,
}
PRBool CSSParserImpl::ParseSize(PRInt32& aErrorCode, nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
nsCSSValue width;
if (ParseVariant(aErrorCode, width, VARIANT_AHKL, nsCSSProps::kPageSizeKTable)) {
@ -5294,7 +5281,7 @@ PRBool CSSParserImpl::ParseTextDecoration(PRInt32& aErrorCode, nsCSSValue& aValu
PRBool CSSParserImpl::ParseTextShadow(PRInt32& aErrorCode,
nsCSSDeclaration* aDeclaration,
PRInt32& aChangeHint)
nsChangeHint& aChangeHint)
{
nsCSSValue value;
if (ParseVariant(aErrorCode, value, VARIANT_HC | VARIANT_LENGTH | VARIANT_NONE, nsnull)) {
@ -5348,9 +5335,7 @@ PRBool CSSParserImpl::ParseTextShadow(PRInt32& aErrorCode,
}
else {
if (ExpectEndProperty(aErrorCode, PR_TRUE)) {
if (aChangeHint < nsCSSProps::kHintTable[eCSSProperty_text_shadow]) {
aChangeHint = nsCSSProps::kHintTable[eCSSProperty_text_shadow];
}
NS_UpdateHint(aChangeHint, nsCSSProps::kHintTable[eCSSProperty_text_shadow]);
aErrorCode = aDeclaration->AppendStructValue(eCSSProperty_text_shadow, shadowHead);
return NS_SUCCEEDED(aErrorCode);
}

View File

@ -45,6 +45,7 @@
#include "nsCSSProps.h"
#include "nsUnitConversion.h"
#include "nsVoidArray.h"
#include "nsFont.h"
#include "nsStyleConsts.h"
@ -4865,7 +4866,7 @@ PRBool nsCSSDeclaration::AppendValueToString(nsCSSProperty aProperty, const nsCS
PRInt32 intValue = aValue.GetIntValue();
if (NS_STYLE_TEXT_DECORATION_NONE != intValue) {
PRInt32 mask;
for (mask = NS_STYLE_TEXT_DECORATION_UNDERLINE;
for (mask = NS_STYLE_TEXT_DECORATION_UNDERLINE;
mask <= NS_STYLE_TEXT_DECORATION_BLINK;
mask <<= 1) {
if ((mask & intValue) == mask) {
@ -6162,19 +6163,17 @@ nsCSSDeclaration::GetNthProperty(PRUint32 aIndex, nsAString& aReturn)
return NS_OK;
}
PRInt32
nsChangeHint
nsCSSDeclaration::GetStyleImpact() const
{
PRInt32 hint = NS_STYLE_HINT_NONE;
nsChangeHint hint = NS_STYLE_HINT_NONE;
if (nsnull != mOrder) {
PRInt32 count = mOrder->Count();
PRInt32 index;
for (index = 0; index < count; index++) {
nsCSSProperty property = (nsCSSProperty)mOrder->ValueAt(index);
if (eCSSProperty_UNKNOWN < property) {
if (hint < nsCSSProps::kHintTable[property]) {
hint = nsCSSProps::kHintTable[property];
}
NS_UpdateHint(hint, nsCSSProps::kHintTable[property]);
}
}
}

View File

@ -592,7 +592,7 @@ public:
PRUint32 Count();
nsresult GetNthProperty(PRUint32 aIndex, nsAString& aReturn);
PRInt32 GetStyleImpact() const;
nsChangeHint GetStyleImpact() const;
nsresult ToString(nsAString& aString);

View File

@ -1284,7 +1284,7 @@ DOMCSSDeclarationImpl::ParsePropertyValue(const nsAString& aPropName,
return result;
}
PRInt32 hint;
nsChangeHint hint;
if (owningDoc) {
owningDoc->BeginUpdate();
}
@ -1348,7 +1348,7 @@ DOMCSSDeclarationImpl::ParseDeclaration(const nsAString& aDecl,
}
}
PRInt32 hint;
nsChangeHint hint;
result = cssParser->ParseAndAppendDeclaration(aDecl, baseURI, decl,
aParseOnlyOneDecl, &hint);

View File

@ -86,7 +86,7 @@ nsDOMCSSAttributeDeclaration::RemoveProperty(const nsAString& aPropertyName,
nsHTMLAtoms::style);
}
PRInt32 hint = NS_STYLE_HINT_NONE;
nsChangeHint hint = NS_STYLE_HINT_NONE;
nsCSSProperty prop = nsCSSProps::LookupProperty(aPropertyName);
nsCSSValue val;
@ -271,7 +271,7 @@ nsDOMCSSAttributeDeclaration::ParsePropertyValue(const nsAString& aPropName,
return result;
}
PRInt32 hint = NS_STYLE_HINT_NONE;
nsChangeHint hint = NS_STYLE_HINT_NONE;
if (doc) {
doc->BeginUpdate();
doc->AttributeWillChange(mContent, kNameSpaceID_None, nsHTMLAtoms::style);
@ -315,7 +315,7 @@ nsDOMCSSAttributeDeclaration::ParseDeclaration(const nsAString& aDecl,
getter_AddRefs(cssParser));
if (NS_SUCCEEDED(result)) {
PRInt32 hint = NS_STYLE_HINT_NONE;
nsChangeHint hint = NS_STYLE_HINT_NONE;
if (doc) {
doc->BeginUpdate();
@ -342,10 +342,10 @@ nsDOMCSSAttributeDeclaration::ParseDeclaration(const nsAString& aDecl,
}
}
PRInt32 newHint = NS_STYLE_HINT_NONE;
nsChangeHint newHint = NS_STYLE_HINT_NONE;
result = cssParser->ParseAndAppendDeclaration(aDecl, baseURI, decl,
aParseOnlyOneDecl, &newHint);
hint = PR_MAX(hint, newHint);
NS_UpdateHint(hint, newHint);
if (result == NS_CSS_PARSER_DROP_DECLARATION) {
SetCSSDeclaration(declClone);

View File

@ -2,6 +2,7 @@
# This is a list of local files which get copied to the mozilla:dist:content directory
#
nsBidiUtils.h
nsChangeHint.h
nsCSSAtomList.h
nsCSSAtoms.h
nsCSSKeywordList.h

View File

@ -29,6 +29,7 @@ include $(DEPTH)/config/autoconf.mk
MODULE = content
EXPORTS = \
nsChangeHint.h \
nsCSSAtomList.h \
nsCSSAtoms.h \
nsCSSKeywordList.h \

View File

@ -39,6 +39,7 @@
#define nsCSSProps_h___
#include "nsString.h"
#include "nsChangeHint.h"
/*
Declare the enum list using the magic of preprocessing
@ -80,7 +81,7 @@ public:
static PRInt32 SearchKeywordTableInt(PRInt32 aValue, const PRInt32 aTable[]);
static const nsAFlatCString& SearchKeywordTable(PRInt32 aValue, const PRInt32 aTable[]);
static const PRInt32 kHintTable[];
static const nsChangeHint kHintTable[];
// Keyword/Enum value tables
static const PRInt32 kAppearanceKTable[];

View File

@ -0,0 +1,118 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Corporation
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsChangeHint_h___
#define nsChangeHint_h___
#include "prtypes.h"
// Defines for various style related constants
enum nsChangeHint {
nsChangeHint_None = 0, // change has no impact
nsChangeHint_Unknown = 0x01, // change has unknown impact
nsChangeHint_AttrChange = 0x02, // change should cause notification to frame but nothing else
nsChangeHint_Aural = 0x04, // change was aural
nsChangeHint_Content = 0x08, // change was contentual (e.g., SRC=)
nsChangeHint_RepaintFrame = 0x10, // change was visual only (e.g., COLOR=)
nsChangeHint_ReflowFrame = 0x20, // change requires reflow (e.g., WIDTH=)
nsChangeHint_SyncFrameView = 0x40, // change requires view to be updated, if there is one (e.g., clip:)
nsChangeHint_ReconstructFrame = 0x80, // change requires frame change (e.g., display:)
// This subsumes all the above
nsChangeHint_ReconstructDoc = 0x100
// change requires reconstruction of entire document (e.g., style sheet change)
// This subsumes all the above
// TBD: add nsChangeHint_ForceFrameView to force frame reconstruction if the frame doesn't yet
// have a view
};
#ifdef DEBUG_roc
// Redefine these operators to return nothing. This will catch any use
// of these operators on hints. We should not be using these operators
// on nsChangeHints
inline void operator<(nsChangeHint s1, nsChangeHint s2) {}
inline void operator>(nsChangeHint s1, nsChangeHint s2) {}
inline void operator!=(nsChangeHint s1, nsChangeHint s2) {}
inline void operator==(nsChangeHint s1, nsChangeHint s2) {}
inline void operator<=(nsChangeHint s1, nsChangeHint s2) {}
inline void operator>=(nsChangeHint s1, nsChangeHint s2) {}
#endif
// Operators on nsChangeHints
// Merge two hints, taking the union
inline nsChangeHint NS_CombineHint(nsChangeHint aH1, nsChangeHint aH2) {
return (nsChangeHint)(aH1 | aH2);
}
// Merge the "src" hint into the "dst" hint
// Returns true iff the destination changed
inline PRBool NS_UpdateHint(nsChangeHint& aDest, nsChangeHint aSrc) {
nsChangeHint r = (nsChangeHint)(aDest | aSrc);
PRBool changed = (int)r != (int)aDest;
aDest = r;
return changed;
}
// Returns true iff the second hint contains all the hints of the first hint
inline PRBool NS_IsHintSubset(nsChangeHint aSubset, nsChangeHint aSuperSet) {
return (aSubset & aSuperSet) == aSubset;
}
// Redefine the old NS_STYLE_HINT constants in terms of the new hint structure
const nsChangeHint NS_STYLE_HINT_UNKNOWN = nsChangeHint_Unknown;
const nsChangeHint NS_STYLE_HINT_NONE = nsChangeHint_None;
const nsChangeHint NS_STYLE_HINT_ATTRCHANGE = nsChangeHint_AttrChange;
const nsChangeHint NS_STYLE_HINT_AURAL = (nsChangeHint)
(nsChangeHint_AttrChange | nsChangeHint_Aural);
const nsChangeHint NS_STYLE_HINT_CONTENT = (nsChangeHint)
(nsChangeHint_AttrChange | nsChangeHint_Aural | nsChangeHint_Content);
const nsChangeHint NS_STYLE_HINT_VISUAL = (nsChangeHint)
(nsChangeHint_AttrChange | nsChangeHint_Aural | nsChangeHint_Content | nsChangeHint_RepaintFrame
| nsChangeHint_SyncFrameView);
const nsChangeHint NS_STYLE_HINT_REFLOW = (nsChangeHint)
(nsChangeHint_AttrChange | nsChangeHint_Aural | nsChangeHint_Content | nsChangeHint_RepaintFrame
| nsChangeHint_SyncFrameView | nsChangeHint_ReflowFrame);
const nsChangeHint NS_STYLE_HINT_FRAMECHANGE = (nsChangeHint)
(nsChangeHint_AttrChange | nsChangeHint_Aural | nsChangeHint_Content | nsChangeHint_RepaintFrame
| nsChangeHint_SyncFrameView | nsChangeHint_ReflowFrame | nsChangeHint_ReconstructFrame);
const nsChangeHint NS_STYLE_HINT_RECONSTRUCT_ALL = (nsChangeHint)
(nsChangeHint_AttrChange | nsChangeHint_Aural | nsChangeHint_Content | nsChangeHint_RepaintFrame
| nsChangeHint_SyncFrameView | nsChangeHint_ReflowFrame | nsChangeHint_ReconstructFrame
| nsChangeHint_ReconstructDoc);
#endif /* nsChangeHint_h___ */

View File

@ -46,6 +46,7 @@
#include "nsVoidArray.h"
#include "nsStyleCoord.h"
#include "nsStyleConsts.h"
#include "nsChangeHint.h"
#include "nsIStyleSet.h"
#include "nsIPresContext.h"
#include "nsIPresShell.h"
@ -95,8 +96,8 @@ struct nsStyleFont : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Font)
PRInt32 CalcDifference(const nsStyleFont& aOther) const;
static PRInt32 CalcFontDifference(const nsFont& aFont1, const nsFont& aFont2);
nsChangeHint CalcDifference(const nsStyleFont& aOther) const;
static nsChangeHint CalcFontDifference(const nsFont& aFont1, const nsFont& aFont2);
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW;
void Destroy(nsIPresContext* aContext);
@ -120,7 +121,7 @@ struct nsStyleColor : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Color)
PRInt32 CalcDifference(const nsStyleColor& aOther) const;
nsChangeHint CalcDifference(const nsStyleColor& aOther) const;
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
@ -154,7 +155,7 @@ struct nsStyleBackground : public nsStyleStruct {
aContext->FreeToShell(sizeof(nsStyleBackground), this);
};
PRInt32 CalcDifference(const nsStyleBackground& aOther) const;
nsChangeHint CalcDifference(const nsStyleBackground& aOther) const;
PRUint8 mBackgroundAttachment; // [reset] See nsStyleConsts.h
PRUint8 mBackgroundFlags; // [reset] See nsStyleConsts.h
@ -192,7 +193,7 @@ struct nsStyleMargin: public nsStyleStruct {
void Destroy(nsIPresContext* aContext);
void RecalcData();
PRInt32 CalcDifference(const nsStyleMargin& aOther) const;
nsChangeHint CalcDifference(const nsStyleMargin& aOther) const;
nsStyleSides mMargin; // [reset] length, percent, auto, inherit
@ -225,7 +226,7 @@ struct nsStylePadding: public nsStyleStruct {
void Destroy(nsIPresContext* aContext);
void RecalcData();
PRInt32 CalcDifference(const nsStylePadding& aOther) const;
nsChangeHint CalcDifference(const nsStylePadding& aOther) const;
nsStyleSides mPadding; // [reset] length, percent, inherit
@ -303,7 +304,7 @@ struct nsStyleBorder: public nsStyleStruct {
PRBool IsBorderSideVisible(PRUint8 aSide) const;
void RecalcData();
PRInt32 CalcDifference(const nsStyleBorder& aOther) const;
nsChangeHint CalcDifference(const nsStyleBorder& aOther) const;
nsStyleSides mBorder; // [reset] length, enum (see nsStyleConsts.h)
nsStyleSides mBorderRadius; // [reset] length, percent, inherit
@ -475,7 +476,7 @@ struct nsStyleOutline: public nsStyleStruct {
};
void RecalcData();
PRInt32 CalcDifference(const nsStyleOutline& aOther) const;
nsChangeHint CalcDifference(const nsStyleOutline& aOther) const;
nsStyleSides mOutlineRadius; // [reset] length, percent, inherit
// (top=topLeft, right=topRight, bottom=bottomRight, left=bottomLeft)
@ -558,7 +559,7 @@ struct nsStyleList : public nsStyleStruct {
aContext->FreeToShell(sizeof(nsStyleList), this);
};
PRInt32 CalcDifference(const nsStyleList& aOther) const;
nsChangeHint CalcDifference(const nsStyleList& aOther) const;
PRUint8 mListStyleType; // [inherited] See nsStyleConsts.h
PRUint8 mListStylePosition; // [inherited]
@ -583,7 +584,7 @@ struct nsStylePosition : public nsStyleStruct {
aContext->FreeToShell(sizeof(nsStylePosition), this);
};
PRInt32 CalcDifference(const nsStylePosition& aOther) const;
nsChangeHint CalcDifference(const nsStylePosition& aOther) const;
nsStyleSides mOffset; // [reset]
nsStyleCoord mWidth; // [reset] coord, percent, auto, inherit
@ -613,7 +614,7 @@ struct nsStyleTextReset : public nsStyleStruct {
aContext->FreeToShell(sizeof(nsStyleTextReset), this);
};
PRInt32 CalcDifference(const nsStyleTextReset& aOther) const;
nsChangeHint CalcDifference(const nsStyleTextReset& aOther) const;
PRUint8 mTextDecoration; // [reset] see nsStyleConsts.h
#ifdef IBMBIDI
@ -640,7 +641,7 @@ struct nsStyleText : public nsStyleStruct {
aContext->FreeToShell(sizeof(nsStyleText), this);
};
PRInt32 CalcDifference(const nsStyleText& aOther) const;
nsChangeHint CalcDifference(const nsStyleText& aOther) const;
PRUint8 mTextAlign; // [inherited] see nsStyleConsts.h
PRUint8 mTextTransform; // [inherited] see nsStyleConsts.h
@ -673,7 +674,7 @@ struct nsStyleVisibility : public nsStyleStruct {
aContext->FreeToShell(sizeof(nsStyleVisibility), this);
};
PRInt32 CalcDifference(const nsStyleVisibility& aOther) const;
nsChangeHint CalcDifference(const nsStyleVisibility& aOther) const;
PRUint8 mDirection; // [inherited] see nsStyleConsts.h NS_STYLE_DIRECTION_*
PRUint8 mVisible; // [inherited]
@ -707,7 +708,7 @@ struct nsStyleDisplay : public nsStyleStruct {
aContext->FreeToShell(sizeof(nsStyleDisplay), this);
};
PRInt32 CalcDifference(const nsStyleDisplay& aOther) const;
nsChangeHint CalcDifference(const nsStyleDisplay& aOther) const;
PRUint8 mDisplay; // [reset] see nsStyleConsts.h NS_STYLE_DISPLAY_*
PRUint8 mOriginalDisplay; // [reset] saved mDisplay for position:absolute/fixed
@ -762,7 +763,7 @@ struct nsStyleTable: public nsStyleStruct {
aContext->FreeToShell(sizeof(nsStyleTable), this);
};
PRInt32 CalcDifference(const nsStyleTable& aOther) const;
nsChangeHint CalcDifference(const nsStyleTable& aOther) const;
PRUint8 mLayoutStrategy;// [reset] see nsStyleConsts.h NS_STYLE_TABLE_LAYOUT_*
PRUint8 mFrame; // [reset] see nsStyleConsts.h NS_STYLE_TABLE_FRAME_*
@ -788,7 +789,7 @@ struct nsStyleTableBorder: public nsStyleStruct {
aContext->FreeToShell(sizeof(nsStyleTableBorder), this);
};
PRInt32 CalcDifference(const nsStyleTableBorder& aOther) const;
nsChangeHint CalcDifference(const nsStyleTableBorder& aOther) const;
PRUint8 mBorderCollapse;// [inherited]
nsStyleCoord mBorderSpacingX;// [inherited]
@ -839,7 +840,7 @@ struct nsStyleQuotes : public nsStyleStruct {
aContext->FreeToShell(sizeof(nsStyleQuotes), this);
};
PRInt32 CalcDifference(const nsStyleQuotes& aOther) const;
nsChangeHint CalcDifference(const nsStyleQuotes& aOther) const;
PRUint32 QuotesCount(void) const { return mQuotesCount; } // [inherited]
@ -900,7 +901,7 @@ struct nsStyleContent: public nsStyleStruct {
aContext->FreeToShell(sizeof(nsStyleContent), this);
};
PRInt32 CalcDifference(const nsStyleContent& aOther) const;
nsChangeHint CalcDifference(const nsStyleContent& aOther) const;
PRUint32 ContentCount(void) const { return mContentCount; } // [reset]
nsresult GetContentAt(PRUint32 aIndex, nsStyleContentType& aType, nsString& aContent) const {
@ -1039,7 +1040,7 @@ struct nsStyleUIReset: public nsStyleStruct {
aContext->FreeToShell(sizeof(nsStyleUIReset), this);
};
PRInt32 CalcDifference(const nsStyleUIReset& aOther) const;
nsChangeHint CalcDifference(const nsStyleUIReset& aOther) const;
PRUint8 mUserSelect; // [reset] (selection-style)
PRUnichar mKeyEquivalent; // [reset] XXX what type should this be?
@ -1064,7 +1065,7 @@ struct nsStyleUserInterface: public nsStyleStruct {
aContext->FreeToShell(sizeof(nsStyleUserInterface), this);
};
PRInt32 CalcDifference(const nsStyleUserInterface& aOther) const;
nsChangeHint CalcDifference(const nsStyleUserInterface& aOther) const;
PRUint8 mUserInput; // [inherited]
PRUint8 mUserModify; // [inherited] (modify-content)
@ -1092,7 +1093,7 @@ struct nsStyleXUL : public nsStyleStruct {
aContext->FreeToShell(sizeof(nsStyleXUL), this);
};
PRInt32 CalcDifference(const nsStyleXUL& aOther) const;
nsChangeHint CalcDifference(const nsStyleXUL& aOther) const;
PRUint8 mBoxAlign; // [reset] see nsStyleConsts.h
PRUint8 mBoxDirection; // [reset] see nsStyleConsts.h
@ -1131,7 +1132,7 @@ struct nsStyleSVG : public nsStyleStruct {
aContext->FreeToShell(sizeof(nsStyleSVG), this);
};
PRInt32 CalcDifference(const nsStyleSVG& aOther) const;
nsChangeHint CalcDifference(const nsStyleSVG& aOther) const;
// all [inherit]ed
nsStyleSVGPaint mFill;

View File

@ -1284,7 +1284,7 @@ PRBool nsCSSProps::GetColorName(PRInt32 aPropValue, nsCString &aStr)
// define array of all CSS property hints
#define CSS_PROP(_name, _id, _hint) NS_STYLE_HINT_##_hint,
const PRInt32 nsCSSProps::kHintTable[eCSSProperty_COUNT] = {
const nsChangeHint nsCSSProps::kHintTable[eCSSProperty_COUNT] = {
#include "nsCSSPropList.h"
};
#undef CSS_PROP

View File

@ -249,7 +249,7 @@ nsStyleFont::Destroy(nsIPresContext* aContext) {
aContext->FreeToShell(sizeof(nsStyleFont), this);
}
PRInt32 nsStyleFont::CalcDifference(const nsStyleFont& aOther) const
nsChangeHint nsStyleFont::CalcDifference(const nsStyleFont& aOther) const
{
if (mSize == aOther.mSize) {
return CalcFontDifference(mFont, aOther.mFont);
@ -257,7 +257,7 @@ PRInt32 nsStyleFont::CalcDifference(const nsStyleFont& aOther) const
return NS_STYLE_HINT_REFLOW;
}
PRInt32 nsStyleFont::CalcFontDifference(const nsFont& aFont1, const nsFont& aFont2)
nsChangeHint nsStyleFont::CalcFontDifference(const nsFont& aFont1, const nsFont& aFont2)
{
if ((aFont1.size == aFont2.size) &&
(aFont1.sizeAdjust == aFont2.sizeAdjust) &&
@ -346,7 +346,7 @@ void nsStyleMargin::RecalcData()
mHasCachedMargin = PR_FALSE;
}
PRInt32 nsStyleMargin::CalcDifference(const nsStyleMargin& aOther) const
nsChangeHint nsStyleMargin::CalcDifference(const nsStyleMargin& aOther) const
{
if (mMargin == aOther.mMargin) {
return NS_STYLE_HINT_NONE;
@ -404,7 +404,7 @@ void nsStylePadding::RecalcData()
mHasCachedPadding = PR_FALSE;
}
PRInt32 nsStylePadding::CalcDifference(const nsStylePadding& aOther) const
nsChangeHint nsStylePadding::CalcDifference(const nsStylePadding& aOther) const
{
if (mPadding == aOther.mPadding) {
return NS_STYLE_HINT_NONE;
@ -552,7 +552,7 @@ void nsStyleBorder::RecalcData()
}
}
PRInt32 nsStyleBorder::CalcDifference(const nsStyleBorder& aOther) const
nsChangeHint nsStyleBorder::CalcDifference(const nsStyleBorder& aOther) const
{
if ((mBorder == aOther.mBorder) &&
(mFloatEdge == aOther.mFloatEdge)) {
@ -668,8 +668,7 @@ nsStyleOutline::RecalcData(void)
mHasCachedOutline = PR_FALSE;
}
PRInt32
nsStyleOutline::CalcDifference(const nsStyleOutline& aOther) const
nsChangeHint nsStyleOutline::CalcDifference(const nsStyleOutline& aOther) const
{
if ((mOutlineWidth != aOther.mOutlineWidth) ||
(mOutlineStyle != aOther.mOutlineStyle) ||
@ -701,7 +700,7 @@ nsStyleList::nsStyleList(const nsStyleList& aSource)
mListStyleImage = aSource.mListStyleImage;
}
PRInt32 nsStyleList::CalcDifference(const nsStyleList& aOther) const
nsChangeHint nsStyleList::CalcDifference(const nsStyleList& aOther) const
{
if (mListStylePosition == aOther.mListStylePosition)
if (mListStyleImage == aOther.mListStyleImage)
@ -741,8 +740,7 @@ nsStyleXUL::nsStyleXUL(const nsStyleXUL& aSource)
memcpy((nsStyleXUL*)this, &aSource, sizeof(nsStyleXUL));
}
PRInt32
nsStyleXUL::CalcDifference(const nsStyleXUL& aOther) const
nsChangeHint nsStyleXUL::CalcDifference(const nsStyleXUL& aOther) const
{
if (mBoxAlign == aOther.mBoxAlign &&
mBoxDirection == aOther.mBoxDirection &&
@ -804,8 +802,7 @@ nsStyleSVG::nsStyleSVG(const nsStyleSVG& aSource)
mStrokeWidth = aSource.mStrokeWidth;
}
PRInt32
nsStyleSVG::CalcDifference(const nsStyleSVG& aOther) const
nsChangeHint nsStyleSVG::CalcDifference(const nsStyleSVG& aOther) const
{
if ( mFill.mType != aOther.mFill.mType ||
mFillOpacity != aOther.mFillOpacity ||
@ -860,7 +857,7 @@ nsStylePosition::nsStylePosition(const nsStylePosition& aSource)
memcpy((nsStylePosition*)this, &aSource, sizeof(nsStylePosition));
}
PRInt32 nsStylePosition::CalcDifference(const nsStylePosition& aOther) const
nsChangeHint nsStylePosition::CalcDifference(const nsStylePosition& aOther) const
{
if ((mOffset == aOther.mOffset) &&
(mWidth == aOther.mWidth) &&
@ -898,7 +895,7 @@ nsStyleTable::nsStyleTable(const nsStyleTable& aSource)
memcpy((nsStyleTable*)this, &aSource, sizeof(nsStyleTable));
}
PRInt32 nsStyleTable::CalcDifference(const nsStyleTable& aOther) const
nsChangeHint nsStyleTable::CalcDifference(const nsStyleTable& aOther) const
{
if ((mLayoutStrategy == aOther.mLayoutStrategy) &&
(mFrame == aOther.mFrame) &&
@ -936,7 +933,7 @@ nsStyleTableBorder::nsStyleTableBorder(const nsStyleTableBorder& aSource)
memcpy((nsStyleTableBorder*)this, &aSource, sizeof(nsStyleTableBorder));
}
PRInt32 nsStyleTableBorder::CalcDifference(const nsStyleTableBorder& aOther) const
nsChangeHint nsStyleTableBorder::CalcDifference(const nsStyleTableBorder& aOther) const
{
if ((mBorderCollapse == aOther.mBorderCollapse) &&
(mCaptionSide == aOther.mCaptionSide) &&
@ -964,7 +961,7 @@ nsStyleColor::nsStyleColor(const nsStyleColor& aSource)
mColor = aSource.mColor;
}
PRInt32 nsStyleColor::CalcDifference(const nsStyleColor& aOther) const
nsChangeHint nsStyleColor::CalcDifference(const nsStyleColor& aOther) const
{
if (mColor == aOther.mColor)
return NS_STYLE_HINT_NONE;
@ -996,11 +993,11 @@ nsStyleBackground::nsStyleBackground(const nsStyleBackground& aSource)
mBackgroundImage = aSource.mBackgroundImage;
}
PRInt32 nsStyleBackground::CalcDifference(const nsStyleBackground& aOther) const
nsChangeHint nsStyleBackground::CalcDifference(const nsStyleBackground& aOther) const
{
if (mBackgroundAttachment != aOther.mBackgroundAttachment
&& (NS_STYLE_BG_ATTACHMENT_FIXED == mBackgroundAttachment) ||
(NS_STYLE_BG_ATTACHMENT_FIXED == aOther.mBackgroundAttachment))
&& ((NS_STYLE_BG_ATTACHMENT_FIXED == mBackgroundAttachment) ||
(NS_STYLE_BG_ATTACHMENT_FIXED == aOther.mBackgroundAttachment)))
// this might require creation of a view
return NS_STYLE_HINT_FRAMECHANGE;
@ -1050,7 +1047,7 @@ nsStyleDisplay::nsStyleDisplay(const nsStyleDisplay& aSource)
mClip = aSource.mClip;
}
PRInt32 nsStyleDisplay::CalcDifference(const nsStyleDisplay& aOther) const
nsChangeHint nsStyleDisplay::CalcDifference(const nsStyleDisplay& aOther) const
{
if (mBinding != aOther.mBinding || mPosition != aOther.mPosition)
return NS_STYLE_HINT_FRAMECHANGE;
@ -1101,7 +1098,7 @@ nsStyleVisibility::nsStyleVisibility(const nsStyleVisibility& aSource)
mOpacity = aSource.mOpacity;
}
PRInt32 nsStyleVisibility::CalcDifference(const nsStyleVisibility& aOther) const
nsChangeHint nsStyleVisibility::CalcDifference(const nsStyleVisibility& aOther) const
{
if (mOpacity != aOther.mOpacity
&& ((mOpacity < 1.0) != (aOther.mOpacity < 1.0)))
@ -1182,8 +1179,7 @@ nsStyleContent::nsStyleContent(const nsStyleContent& aSource)
}
}
PRInt32
nsStyleContent::CalcDifference(const nsStyleContent& aOther) const
nsChangeHint nsStyleContent::CalcDifference(const nsStyleContent& aOther) const
{
if (mContentCount == aOther.mContentCount) {
if ((mMarkerOffset == aOther.mMarkerOffset) &&
@ -1245,8 +1241,7 @@ nsStyleQuotes::nsStyleQuotes(const nsStyleQuotes& aSource)
}
}
PRInt32
nsStyleQuotes::CalcDifference(const nsStyleQuotes& aOther) const
nsChangeHint nsStyleQuotes::CalcDifference(const nsStyleQuotes& aOther) const
{
// If the quotes implementation is ever going to change we might not need
// a framechange here and a reflow should be sufficient. See bug 35768.
@ -1283,7 +1278,7 @@ nsStyleTextReset::nsStyleTextReset(const nsStyleTextReset& aSource)
nsStyleTextReset::~nsStyleTextReset(void) { }
PRInt32 nsStyleTextReset::CalcDifference(const nsStyleTextReset& aOther) const
nsChangeHint nsStyleTextReset::CalcDifference(const nsStyleTextReset& aOther) const
{
if (mVerticalAlign == aOther.mVerticalAlign
#ifdef IBMBIDI
@ -1320,7 +1315,7 @@ nsStyleText::nsStyleText(const nsStyleText& aSource)
nsStyleText::~nsStyleText(void) { }
PRInt32 nsStyleText::CalcDifference(const nsStyleText& aOther) const
nsChangeHint nsStyleText::CalcDifference(const nsStyleText& aOther) const
{
if ((mTextAlign == aOther.mTextAlign) &&
(mTextTransform == aOther.mTextTransform) &&
@ -1360,7 +1355,7 @@ nsStyleUserInterface::~nsStyleUserInterface(void)
{
}
PRInt32 nsStyleUserInterface::CalcDifference(const nsStyleUserInterface& aOther) const
nsChangeHint nsStyleUserInterface::CalcDifference(const nsStyleUserInterface& aOther) const
{
if ((mCursor != aOther.mCursor) ||
(mCursorImage != aOther.mCursorImage))
@ -1409,7 +1404,7 @@ nsStyleUIReset::~nsStyleUIReset(void)
{
}
PRInt32 nsStyleUIReset::CalcDifference(const nsStyleUIReset& aOther) const
nsChangeHint nsStyleUIReset::CalcDifference(const nsStyleUIReset& aOther) const
{
if (mForceBrokenImageIcon == aOther.mForceBrokenImageIcon) {
if (mResizer == aOther.mResizer &&

View File

@ -453,7 +453,7 @@ nsSVGElement::GetInlineStyleRule(nsIStyleRule** aStyleRule)
NS_IMETHODIMP
nsSVGElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
// we don't rely on the cssframeconstructor to map attribute changes
// to changes in our frames. an exception is css.

View File

@ -146,7 +146,7 @@ public:
NS_IMETHOD GetInlineStyleRule(nsIStyleRule** aStyleRule);
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
// nsIDOMNode
NS_DECL_NSIDOMNODE

View File

@ -311,7 +311,7 @@ public:
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint) { return NS_OK; }
nsChangeHint aHint) { return NS_OK; }
NS_IMETHOD ContentAppended(nsIDocument* aDocument,
nsIContent* aContainer,
PRInt32 aNewIndexInContainer);
@ -338,7 +338,7 @@ public:
NS_IMETHOD StyleRuleChanged(nsIDocument* aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint) { return NS_OK; }
nsChangeHint aHint) { return NS_OK; }
NS_IMETHOD StyleRuleAdded(nsIDocument* aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule) { return NS_OK; }

View File

@ -416,7 +416,7 @@ static PRBool HasMutationListeners(nsIContent* aContent, PRUint32 aType)
//----------------------------------------------------------------------
static PRInt32
static nsChangeHint
StyleHintFor(nsINodeInfo* aNodeInfo)
{
nsCOMPtr<nsIAtom> tagName;
@ -3882,7 +3882,7 @@ nsXULElement::GetInlineStyleRule(nsIStyleRule** aStyleRule)
NS_IMETHODIMP
nsXULElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
aHint = NS_STYLE_HINT_CONTENT; // by default, never map attributes to style

View File

@ -472,7 +472,7 @@ public:
NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker);
NS_IMETHOD GetInlineStyleRule(nsIStyleRule** aStyleRule);
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
// nsIXULContent

View File

@ -2156,7 +2156,7 @@ nsXULDocument::AttributeChanged(nsIContent* aElement,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint)
nsChangeHint aHint)
{
nsresult rv;
@ -2359,8 +2359,8 @@ nsXULDocument::AttributeWillChange(nsIContent* aChild,
NS_IMETHODIMP
nsXULDocument::StyleRuleChanged(nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint)
nsIStyleRule* aStyleRule,
nsChangeHint aHint)
{
for (PRInt32 i = mObservers.Count() - 1; i >= 0; --i) {
nsIDocumentObserver* observer = (nsIDocumentObserver*)mObservers[i];

View File

@ -287,7 +287,7 @@ public:
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint); // See nsStyleConsts fot hint values
nsChangeHint aHint);
NS_IMETHOD ContentAppended(nsIContent* aContainer,
PRInt32 aNewIndexInContainer);
@ -310,7 +310,7 @@ public:
NS_IMETHOD StyleRuleChanged(nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint); // See nsStyleConsts fot hint values
nsChangeHint aHint);
NS_IMETHOD StyleRuleAdded(nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule);

View File

@ -139,7 +139,7 @@ public:
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint);
nsChangeHint aHint);
NS_IMETHOD DocumentWillBeDestroyed(nsIDocument* aDocument);
@ -1778,7 +1778,7 @@ nsXULContentBuilder::AttributeChanged(nsIDocument* aDocument,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint)
nsChangeHint aHint)
{
// Handle "open" and "close" cases. We do this handling before
// we've notified the observer, so that content is already created

View File

@ -349,7 +349,7 @@ nsXULTemplateBuilder::AttributeChanged(nsIDocument *aDocument,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint)
nsChangeHint aHint)
{
// Check for a change to the 'ref' attribute on an atom, in which
// case we may need to nuke and rebuild the entire content model
@ -422,7 +422,7 @@ NS_IMETHODIMP
nsXULTemplateBuilder::StyleRuleChanged(nsIDocument *aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint)
nsChangeHint aHint)
{
return NS_OK;
}

View File

@ -123,7 +123,7 @@ public:
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint);
nsChangeHint aHint);
NS_IMETHOD ContentAppended(nsIDocument *aDocument,
nsIContent* aContainer,
@ -158,7 +158,7 @@ public:
NS_IMETHOD StyleRuleChanged(nsIDocument *aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint);
nsChangeHint aHint);
NS_IMETHOD StyleRuleAdded(nsIDocument *aDocument,
nsIStyleSheet* aStyleSheet,

View File

@ -630,7 +630,7 @@ inDOMView::PerformActionOnCell(const PRUnichar *action, PRInt32 row, const PRUni
NS_IMETHODIMP
inDOMView::AttributeChanged(nsIDocument *aDocument, nsIContent* aContent, PRInt32 aNameSpaceID,
nsIAtom* aAttribute, PRInt32 aModType, PRInt32 aHint)
nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint aHint)
{
if (!mTree)
return NS_ERROR_FAILURE;

View File

@ -68,7 +68,7 @@ public:
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint);
nsChangeHint aHint);
NS_IMETHOD ContentAppended(nsIDocument *aDocument,
nsIContent* aContainer,
PRInt32 aNewIndexInContainer);
@ -107,7 +107,7 @@ public:
NS_IMETHOD StyleRuleChanged(nsIDocument *aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint) { return NS_OK; }
nsChangeHint aHint) { return NS_OK; }
NS_IMETHOD StyleRuleAdded(nsIDocument *aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule) { return NS_OK; }

View File

@ -266,7 +266,7 @@ nsXPathResult::AttributeChanged(nsIDocument* aDocument,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint)
nsChangeHint aHint)
{
Invalidate();
return NS_OK;
@ -338,7 +338,7 @@ NS_IMETHODIMP
nsXPathResult::StyleRuleChanged(nsIDocument* aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint)
nsChangeHint aHint)
{
return NS_OK;
}

View File

@ -99,7 +99,7 @@ public:
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint);
nsChangeHint aHint);
NS_IMETHOD ContentAppended(nsIDocument* aDocument,
nsIContent* aContainer,
PRInt32 aNewIndexInContainer);
@ -126,7 +126,7 @@ public:
NS_IMETHOD StyleRuleChanged(nsIDocument* aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint);
nsChangeHint aHint);
NS_IMETHOD StyleRuleAdded(nsIDocument* aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule);

View File

@ -10311,24 +10311,24 @@ nsCSSFrameConstructor::ProcessRestyledFrames(nsStyleChangeList& aChangeList,
while (0 < count--) {
nsIFrame* frame;
nsIContent* content;
PRInt32 hint;
nsChangeHint hint;
aChangeList.ChangeAt(count, frame, content, hint);
switch (hint) {
case NS_STYLE_HINT_RECONSTRUCT_ALL:
NS_ERROR("This shouldn't happen");
break;
case NS_STYLE_HINT_FRAMECHANGE:
RecreateFramesForContent(aPresContext, content);
break;
case NS_STYLE_HINT_REFLOW:
if (hint & nsChangeHint_ReconstructDoc) {
NS_ERROR("This shouldn't happen");
}
if (hint & nsChangeHint_ReconstructFrame) {
RecreateFramesForContent(aPresContext, content);
} else {
if (hint & nsChangeHint_ReflowFrame) {
StyleChangeReflow(aPresContext, frame, nsnull);
break;
case NS_STYLE_HINT_VISUAL:
}
if (hint & nsChangeHint_RepaintFrame) {
ApplyRenderingChangeToTree(aPresContext, frame, nsnull);
break;
case NS_STYLE_HINT_CONTENT:
default:
break;
}
if (hint & nsChangeHint_SyncFrameView) {
// TBD: split out view sync from ApplyRenderingChange and friends
}
}
}
aChangeList.Clear();
@ -10424,8 +10424,8 @@ nsCSSFrameConstructor::ContentStatesChanged(nsIPresContext* aPresContext,
if (primaryFrame1) {
nsStyleChangeList changeList1;
nsStyleChangeList changeList2;
PRInt32 frameChange1 = NS_STYLE_HINT_NONE;
PRInt32 frameChange2 = NS_STYLE_HINT_NONE;
nsChangeHint frameChange1 = NS_STYLE_HINT_NONE;
nsChangeHint frameChange2 = NS_STYLE_HINT_NONE;
frameManager->ComputeStyleChangeFor(aPresContext, primaryFrame1,
kNameSpaceID_Unknown, nsnull,
changeList1, NS_STYLE_HINT_NONE, frameChange1);
@ -10440,7 +10440,7 @@ nsCSSFrameConstructor::ContentStatesChanged(nsIPresContext* aPresContext,
ApplyRenderingChangeToTree(aPresContext, primaryFrame1, nsnull);
}
if ((frameChange1 != NS_STYLE_HINT_RECONSTRUCT_ALL) && (primaryFrame2)) {
if (!(frameChange1 & nsChangeHint_ReconstructDoc) && (primaryFrame2)) {
frameManager->ComputeStyleChangeFor(aPresContext, primaryFrame2,
kNameSpaceID_Unknown, nsnull,
changeList2, NS_STYLE_HINT_NONE, frameChange2);
@ -10455,37 +10455,30 @@ nsCSSFrameConstructor::ContentStatesChanged(nsIPresContext* aPresContext,
}
}
if ((frameChange1 == NS_STYLE_HINT_RECONSTRUCT_ALL) ||
(frameChange2 == NS_STYLE_HINT_RECONSTRUCT_ALL)) {
if ((frameChange1 & nsChangeHint_ReconstructDoc) ||
(frameChange2 & nsChangeHint_ReconstructDoc)) {
result = ReconstructDocElementHierarchy(aPresContext);
}
else {
switch (frameChange1) {
case NS_STYLE_HINT_FRAMECHANGE:
result = RecreateFramesForContent(aPresContext, aContent1);
changeList1.Clear();
break;
case NS_STYLE_HINT_REFLOW:
case NS_STYLE_HINT_VISUAL:
case NS_STYLE_HINT_CONTENT:
if (frameChange1 & nsChangeHint_ReconstructFrame) {
result = RecreateFramesForContent(aPresContext, aContent1);
changeList1.Clear();
} else {
if (frameChange1 & ~(nsChangeHint_AttrChange | nsChangeHint_Aural)) {
// let primary frame deal with it
result = primaryFrame1->ContentStateChanged(aPresContext, aContent1, frameChange1);
default:
break;
}
}
switch (frameChange2) {
case NS_STYLE_HINT_FRAMECHANGE:
if (frameChange2 & nsChangeHint_ReconstructFrame) {
result = RecreateFramesForContent(aPresContext, aContent2);
changeList2.Clear();
break;
case NS_STYLE_HINT_REFLOW:
case NS_STYLE_HINT_VISUAL:
case NS_STYLE_HINT_CONTENT:
} else {
if (frameChange2 & ~(nsChangeHint_AttrChange | nsChangeHint_Aural)) {
// let primary frame deal with it
result = primaryFrame2->ContentStateChanged(aPresContext, aContent2, frameChange2);
// then process any children that need it
default:
break;
}
}
ProcessRestyledFrames(changeList1, aPresContext);
ProcessRestyledFrames(changeList2, aPresContext);
@ -10493,7 +10486,7 @@ nsCSSFrameConstructor::ContentStatesChanged(nsIPresContext* aPresContext,
}
else if (primaryFrame2) {
nsStyleChangeList changeList;
PRInt32 frameChange = NS_STYLE_HINT_NONE;
nsChangeHint frameChange = NS_STYLE_HINT_NONE;
frameManager->ComputeStyleChangeFor(aPresContext, primaryFrame2,
kNameSpaceID_Unknown, nsnull,
changeList, NS_STYLE_HINT_NONE, frameChange);
@ -10507,23 +10500,17 @@ nsCSSFrameConstructor::ContentStatesChanged(nsIPresContext* aPresContext,
ApplyRenderingChangeToTree(aPresContext, primaryFrame2, nsnull);
}
switch (frameChange) { // max change needed for top level frames
case NS_STYLE_HINT_RECONSTRUCT_ALL:
result = ReconstructDocElementHierarchy(aPresContext);
changeList.Clear();
break;
case NS_STYLE_HINT_FRAMECHANGE:
result = RecreateFramesForContent(aPresContext, aContent2);
changeList.Clear();
break;
case NS_STYLE_HINT_REFLOW:
case NS_STYLE_HINT_VISUAL:
case NS_STYLE_HINT_CONTENT:
// let primary frame deal with it
result = primaryFrame2->ContentStateChanged(aPresContext, aContent2, frameChange);
// then process any children that need it
default:
break;
// max change needed for top level frames
if (frameChange & nsChangeHint_ReconstructDoc) {
result = ReconstructDocElementHierarchy(aPresContext);
changeList.Clear();
} else if (frameChange & nsChangeHint_ReconstructFrame) {
result = RecreateFramesForContent(aPresContext, aContent2);
changeList.Clear();
} else if (frameChange & ~(nsChangeHint_AttrChange | nsChangeHint_Aural)) {
// let primary frame deal with it
result = primaryFrame2->ContentStateChanged(aPresContext, aContent2, frameChange);
// then process any children that need it
}
ProcessRestyledFrames(changeList, aPresContext);
}
@ -10546,7 +10533,7 @@ nsCSSFrameConstructor::AttributeChanged(nsIPresContext* aPresContext,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint)
nsChangeHint aHint)
{
nsresult result = NS_OK;
@ -10570,10 +10557,6 @@ nsCSSFrameConstructor::AttributeChanged(nsIPresContext* aPresContext,
primaryStyleFrame = styleContextProvider;
}
PRBool reconstruct = PR_FALSE;
PRBool restyle = PR_FALSE;
PRBool reframe = PR_FALSE;
#if 0
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
("HTMLStyleSheet::AttributeChanged: content=%p[%s] frame=%p",
@ -10581,32 +10564,18 @@ nsCSSFrameConstructor::AttributeChanged(nsIPresContext* aPresContext,
#endif
// the style tag has its own interpretation based on aHint
if (NS_STYLE_HINT_UNKNOWN == aHint) {
if (aHint & nsChangeHint_Unknown) {
nsCOMPtr<nsIStyledContent> styledContent = do_QueryInterface(aContent);
if (styledContent) {
// Get style hint from HTML content object.
styledContent->GetMappedAttributeImpact(aAttribute, aModType, aHint);
}
}
switch (aHint) {
default:
case NS_STYLE_HINT_RECONSTRUCT_ALL:
reconstruct = PR_TRUE;
case NS_STYLE_HINT_FRAMECHANGE:
reframe = PR_TRUE;
case NS_STYLE_HINT_REFLOW:
case NS_STYLE_HINT_VISUAL:
case NS_STYLE_HINT_UNKNOWN:
case NS_STYLE_HINT_CONTENT:
case NS_STYLE_HINT_AURAL:
restyle = PR_TRUE;
break;
case NS_STYLE_HINT_NONE:
case NS_STYLE_HINT_ATTRCHANGE:
break;
}
PRBool reconstruct = (aHint & nsChangeHint_ReconstructDoc) != 0;
PRBool reframe = (aHint & (nsChangeHint_ReconstructDoc | nsChangeHint_ReconstructFrame)) != 0;
PRBool restyle = (aHint & ~(nsChangeHint_AttrChange)) != 0;
#ifdef INCLUDE_XUL
// The following listbox widget trap prevents offscreen listbox widget
// content from being removed and re-inserted (which is what would
@ -10712,7 +10681,7 @@ nsCSSFrameConstructor::AttributeChanged(nsIPresContext* aPresContext,
}
// apply changes
if (primaryFrame && aHint == NS_STYLE_HINT_ATTRCHANGE)
if (primaryFrame && (aHint & nsChangeHint_AttrChange) && !(aHint & ~(nsChangeHint_AttrChange)))
result = primaryFrame->AttributeChanged(aPresContext, aContent, aNameSpaceID, aAttribute, aModType, aHint);
else if (reconstruct) {
result = ReconstructDocElementHierarchy(aPresContext);
@ -10724,7 +10693,7 @@ nsCSSFrameConstructor::AttributeChanged(nsIPresContext* aPresContext,
// If there is no frame then there is no point in re-styling it,
// is there?
if (primaryFrame) {
PRInt32 maxHint = aHint;
nsChangeHint maxHint = aHint;
nsStyleChangeList changeList;
// put primary frame on list to deal with, re-resolve may update or add next in flows
changeList.AppendChange(primaryFrame, aContent, maxHint);
@ -10767,18 +10736,14 @@ nsCSSFrameConstructor::AttributeChanged(nsIPresContext* aPresContext,
maxHint = NS_STYLE_HINT_VISUAL;
}
switch (maxHint) { // maxHint is hint for primary only
case NS_STYLE_HINT_RECONSTRUCT_ALL:
result = ReconstructDocElementHierarchy(aPresContext);
changeList.Clear();
break;
case NS_STYLE_HINT_FRAMECHANGE:
result = RecreateFramesForContent(aPresContext, aContent);
changeList.Clear();
break;
case NS_STYLE_HINT_REFLOW:
case NS_STYLE_HINT_VISUAL:
case NS_STYLE_HINT_CONTENT:
// maxHint is hint for primary only
if (maxHint & nsChangeHint_ReconstructDoc) {
result = ReconstructDocElementHierarchy(aPresContext);
changeList.Clear();
} else if (maxHint & nsChangeHint_ReconstructFrame) {
result = RecreateFramesForContent(aPresContext, aContent);
changeList.Clear();
} else if (maxHint & ~(nsChangeHint_AttrChange | nsChangeHint_Aural)) {
// let the frame deal with it, since we don't know how to
result = primaryFrame->AttributeChanged(aPresContext, aContent, aNameSpaceID, aAttribute, aModType, maxHint);
@ -10787,8 +10752,6 @@ nsCSSFrameConstructor::AttributeChanged(nsIPresContext* aPresContext,
// them, as well. Currently, inline and block frames don't
// do anything on this notification, so it's not that big a
// deal.
default:
break;
}
// handle any children (primary may be on list too)
ProcessRestyledFrames(changeList, aPresContext);
@ -10806,7 +10769,7 @@ NS_IMETHODIMP
nsCSSFrameConstructor::StyleRuleChanged(nsIPresContext* aPresContext,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint)
nsChangeHint aHint)
{
nsresult result = NS_OK;
nsCOMPtr<nsIPresShell> shell;
@ -10818,26 +10781,15 @@ nsCSSFrameConstructor::StyleRuleChanged(nsIPresContext* aPresContext,
return NS_OK;
}
PRBool reframe = PR_FALSE;
PRBool reflow = PR_FALSE;
PRBool render = PR_FALSE;
PRBool restyle = PR_FALSE;
switch (aHint) {
default:
case NS_STYLE_HINT_UNKNOWN:
case NS_STYLE_HINT_FRAMECHANGE:
reframe = PR_TRUE;
case NS_STYLE_HINT_REFLOW:
reflow = PR_TRUE;
case NS_STYLE_HINT_VISUAL:
render = PR_TRUE;
case NS_STYLE_HINT_CONTENT:
case NS_STYLE_HINT_AURAL:
restyle = PR_TRUE;
break;
case NS_STYLE_HINT_NONE:
break;
}
PRBool reframe = (aHint & (nsChangeHint_ReconstructDoc | nsChangeHint_ReconstructFrame
| nsChangeHint_Unknown)) != 0;
PRBool reflow = (aHint & (nsChangeHint_ReconstructDoc | nsChangeHint_ReconstructFrame
| nsChangeHint_ReflowFrame | nsChangeHint_Unknown)) != 0;
PRBool render = (aHint & (nsChangeHint_ReconstructDoc | nsChangeHint_ReconstructFrame
| nsChangeHint_ReflowFrame | nsChangeHint_RepaintFrame
| nsChangeHint_Unknown)) != 0;
PRBool restyle = (aHint & ~(nsChangeHint_AttrChange)) != 0;
// TBD: add "review" to update view?
if (restyle) {
nsCOMPtr<nsIStyleSet> set;

View File

@ -44,6 +44,7 @@
#include "nsILayoutHistoryState.h"
#include "nsIXBLService.h"
#include "nsIServiceManager.h"
#include "nsStyleConsts.h"
class nsIDocument;
struct nsFrameItems;
@ -130,13 +131,13 @@ public:
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint);
nsChangeHint aHint);
// Style change notifications
NS_IMETHOD StyleRuleChanged(nsIPresContext* aPresContext,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint); // See nsStyleConsts fot hint values
nsChangeHint aHint);
NS_IMETHOD StyleRuleAdded(nsIPresContext* aPresContext,
nsIStyleSheet* aStyleSheet,

118
layout/base/nsChangeHint.h Normal file
View File

@ -0,0 +1,118 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Corporation
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsChangeHint_h___
#define nsChangeHint_h___
#include "prtypes.h"
// Defines for various style related constants
enum nsChangeHint {
nsChangeHint_None = 0, // change has no impact
nsChangeHint_Unknown = 0x01, // change has unknown impact
nsChangeHint_AttrChange = 0x02, // change should cause notification to frame but nothing else
nsChangeHint_Aural = 0x04, // change was aural
nsChangeHint_Content = 0x08, // change was contentual (e.g., SRC=)
nsChangeHint_RepaintFrame = 0x10, // change was visual only (e.g., COLOR=)
nsChangeHint_ReflowFrame = 0x20, // change requires reflow (e.g., WIDTH=)
nsChangeHint_SyncFrameView = 0x40, // change requires view to be updated, if there is one (e.g., clip:)
nsChangeHint_ReconstructFrame = 0x80, // change requires frame change (e.g., display:)
// This subsumes all the above
nsChangeHint_ReconstructDoc = 0x100
// change requires reconstruction of entire document (e.g., style sheet change)
// This subsumes all the above
// TBD: add nsChangeHint_ForceFrameView to force frame reconstruction if the frame doesn't yet
// have a view
};
#ifdef DEBUG_roc
// Redefine these operators to return nothing. This will catch any use
// of these operators on hints. We should not be using these operators
// on nsChangeHints
inline void operator<(nsChangeHint s1, nsChangeHint s2) {}
inline void operator>(nsChangeHint s1, nsChangeHint s2) {}
inline void operator!=(nsChangeHint s1, nsChangeHint s2) {}
inline void operator==(nsChangeHint s1, nsChangeHint s2) {}
inline void operator<=(nsChangeHint s1, nsChangeHint s2) {}
inline void operator>=(nsChangeHint s1, nsChangeHint s2) {}
#endif
// Operators on nsChangeHints
// Merge two hints, taking the union
inline nsChangeHint NS_CombineHint(nsChangeHint aH1, nsChangeHint aH2) {
return (nsChangeHint)(aH1 | aH2);
}
// Merge the "src" hint into the "dst" hint
// Returns true iff the destination changed
inline PRBool NS_UpdateHint(nsChangeHint& aDest, nsChangeHint aSrc) {
nsChangeHint r = (nsChangeHint)(aDest | aSrc);
PRBool changed = (int)r != (int)aDest;
aDest = r;
return changed;
}
// Returns true iff the second hint contains all the hints of the first hint
inline PRBool NS_IsHintSubset(nsChangeHint aSubset, nsChangeHint aSuperSet) {
return (aSubset & aSuperSet) == aSubset;
}
// Redefine the old NS_STYLE_HINT constants in terms of the new hint structure
const nsChangeHint NS_STYLE_HINT_UNKNOWN = nsChangeHint_Unknown;
const nsChangeHint NS_STYLE_HINT_NONE = nsChangeHint_None;
const nsChangeHint NS_STYLE_HINT_ATTRCHANGE = nsChangeHint_AttrChange;
const nsChangeHint NS_STYLE_HINT_AURAL = (nsChangeHint)
(nsChangeHint_AttrChange | nsChangeHint_Aural);
const nsChangeHint NS_STYLE_HINT_CONTENT = (nsChangeHint)
(nsChangeHint_AttrChange | nsChangeHint_Aural | nsChangeHint_Content);
const nsChangeHint NS_STYLE_HINT_VISUAL = (nsChangeHint)
(nsChangeHint_AttrChange | nsChangeHint_Aural | nsChangeHint_Content | nsChangeHint_RepaintFrame
| nsChangeHint_SyncFrameView);
const nsChangeHint NS_STYLE_HINT_REFLOW = (nsChangeHint)
(nsChangeHint_AttrChange | nsChangeHint_Aural | nsChangeHint_Content | nsChangeHint_RepaintFrame
| nsChangeHint_SyncFrameView | nsChangeHint_ReflowFrame);
const nsChangeHint NS_STYLE_HINT_FRAMECHANGE = (nsChangeHint)
(nsChangeHint_AttrChange | nsChangeHint_Aural | nsChangeHint_Content | nsChangeHint_RepaintFrame
| nsChangeHint_SyncFrameView | nsChangeHint_ReflowFrame | nsChangeHint_ReconstructFrame);
const nsChangeHint NS_STYLE_HINT_RECONSTRUCT_ALL = (nsChangeHint)
(nsChangeHint_AttrChange | nsChangeHint_Aural | nsChangeHint_Content | nsChangeHint_RepaintFrame
| nsChangeHint_SyncFrameView | nsChangeHint_ReflowFrame | nsChangeHint_ReconstructFrame
| nsChangeHint_ReconstructDoc);
#endif /* nsChangeHint_h___ */

View File

@ -339,8 +339,8 @@ public:
PRInt32 aAttrNameSpaceID,
nsIAtom* aAttribute,
nsStyleChangeList& aChangeList,
PRInt32 aMinChange,
PRInt32& aTopLevelChange);
nsChangeHint aMinChange,
nsChangeHint& aTopLevelChange);
NS_IMETHOD AttributeAffectsStyle(nsIAtom *aAttribute, nsIContent *aContent,
PRBool &aAffects);
@ -417,8 +417,8 @@ private:
PRInt32 aAttrNameSpaceID,
nsIAtom* aAttribute,
nsStyleChangeList& aChangeList,
PRInt32 aMinChange,
PRInt32& aResultChange);
nsChangeHint aMinChange,
nsChangeHint& aResultChange);
nsresult RevokePostedEvents();
CantRenderReplacedElementEvent** FindPostedEventFor(nsIFrame* aFrame);
@ -1656,16 +1656,15 @@ HasAttributeContent(nsIStyleContext* aStyleContext,
return result;
}
static PRInt32
static nsChangeHint
CaptureChange(nsIStyleContext* aOldContext, nsIStyleContext* aNewContext,
nsIFrame* aFrame, nsIContent* aContent,
nsStyleChangeList& aChangeList, PRInt32 aMinChange)
nsStyleChangeList& aChangeList, nsChangeHint aMinChange)
{
PRInt32 ourChange = NS_STYLE_HINT_NONE;
nsChangeHint ourChange = NS_STYLE_HINT_NONE;
aOldContext->CalcStyleDifference(aNewContext, ourChange);
if (aMinChange < ourChange) {
if (NS_UpdateHint(aMinChange, ourChange)) {
aChangeList.AppendChange(aFrame, aContent, ourChange);
aMinChange = ourChange;
}
return aMinChange;
}
@ -1677,8 +1676,8 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext,
PRInt32 aAttrNameSpaceID,
nsIAtom* aAttribute,
nsStyleChangeList& aChangeList,
PRInt32 aMinChange,
PRInt32& aResultChange)
nsChangeHint aMinChange,
nsChangeHint& aResultChange)
{
// XXXldb get new context from prev-in-flow if possible, to avoid
// duplication. (Or should we just let |GetContext| handle that?)
@ -1773,7 +1772,8 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext,
if (newContext != oldContext) {
aMinChange = CaptureChange(oldContext, newContext, aFrame, content, aChangeList, aMinChange);
if (aMinChange < NS_STYLE_HINT_FRAMECHANGE) { // if frame gets regenerated, let it keep old context
if (!(aMinChange & (nsChangeHint_ReconstructFrame | nsChangeHint_ReconstructDoc))) {
// if frame gets regenerated, let it keep old context
aFrame->SetStyleContext(aPresContext, newContext);
}
// if old context had image and new context does not have the same image,
@ -1789,7 +1789,10 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext,
}
else {
if (pseudoTag && pseudoTag != nsHTMLAtoms::mozNonElementPseudo &&
aAttribute && (aMinChange < NS_STYLE_HINT_REFLOW) &&
aAttribute &&
(!(aMinChange &
(nsChangeHint_ReflowFrame | nsChangeHint_ReconstructFrame
| nsChangeHint_ReconstructDoc))) &&
HasAttributeContent(oldContext, aAttrNameSpaceID, aAttribute)) {
aChangeList.AppendChange(aFrame, content, NS_STYLE_HINT_REFLOW);
}
@ -1821,11 +1824,12 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext,
if (oldExtraContext != newExtraContext) {
aMinChange = CaptureChange(oldExtraContext, newExtraContext, aFrame,
content, aChangeList, aMinChange);
if (aMinChange < NS_STYLE_HINT_FRAMECHANGE) {
if (!(aMinChange & (nsChangeHint_ReconstructFrame | nsChangeHint_ReconstructDoc))) {
aFrame->SetAdditionalStyleContext(contextIndex, newExtraContext);
}
}
else {
#if 0
// XXXldb |oldContext| is null by this point, so this will
// never do anything.
if (pseudoTag && pseudoTag != nsHTMLAtoms::mozNonElementPseudo &&
@ -1833,6 +1837,7 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext,
HasAttributeContent(oldContext, aAttrNameSpaceID, aAttribute)) {
aChangeList.AppendChange(aFrame, content, NS_STYLE_HINT_REFLOW);
}
#endif
}
NS_RELEASE(newExtraContext);
}
@ -1888,7 +1893,7 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext,
aResultChange = aMinChange;
if (aMinChange < NS_STYLE_HINT_FRAMECHANGE) {
if (!(aMinChange & (nsChangeHint_ReconstructFrame | nsChangeHint_ReconstructDoc))) {
// There is no need to waste time crawling into a frame's children on a frame change.
// The act of reconstructing frames will force new style contexts to be resolved on all
// of this frame's descendants anyway, so we want to avoid wasting time processing
@ -1897,7 +1902,7 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext,
// now do children
PRInt32 listIndex = 0;
nsIAtom* childList = nsnull;
PRInt32 childChange;
nsChangeHint childChange;
do {
nsIFrame* child = nsnull;
@ -1959,8 +1964,8 @@ FrameManager::ComputeStyleChangeFor(nsIPresContext* aPresContext,
PRInt32 aAttrNameSpaceID,
nsIAtom* aAttribute,
nsStyleChangeList& aChangeList,
PRInt32 aMinChange,
PRInt32& aTopLevelChange)
nsChangeHint aMinChange,
nsChangeHint& aTopLevelChange)
{
NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_AVAILABLE);
aTopLevelChange = NS_STYLE_HINT_NONE;
@ -1975,18 +1980,16 @@ FrameManager::ComputeStyleChangeFor(nsIPresContext* aPresContext,
#endif
do {
PRInt32 frameChange;
nsChangeHint frameChange;
ReResolveStyleContext(aPresContext, frame, nsnull,
aAttrNameSpaceID, aAttribute,
aChangeList, aMinChange, frameChange);
#ifdef NS_DEBUG
VerifyStyleTree(aPresContext, frame, nsnull);
#endif
if (aTopLevelChange < frameChange) {
aTopLevelChange = frameChange;
}
NS_UpdateHint(aTopLevelChange, frameChange);
if (aTopLevelChange >= NS_STYLE_HINT_FRAMECHANGE) {
if (aTopLevelChange & (nsChangeHint_ReconstructDoc | nsChangeHint_ReconstructFrame)) {
// If it's going to cause a framechange, then don't bother with
// the continutaions since they'll be clobbered by the frame
// reconstruct anyway.

View File

@ -968,7 +968,7 @@ IncrementalReflow::AddCommand(nsIPresContext *aPresContext,
if (gVerifyReflowFlags & VERIFY_REFLOW_NOISY_RC)
printf("requeuing command %p because %p was already scheduled "
"for the same frame",
aCommand, target->mReflowCommand);
(void*)aCommand, (void*)target->mReflowCommand);
#endif
return PR_FALSE;
@ -1200,7 +1200,7 @@ public:
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint);
nsChangeHint aHint);
NS_IMETHOD ContentAppended(nsIDocument *aDocument,
nsIContent* aContainer,
PRInt32 aNewIndexInContainer);
@ -1227,7 +1227,7 @@ public:
NS_IMETHOD StyleRuleChanged(nsIDocument *aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint);
nsChangeHint aHint);
NS_IMETHOD StyleRuleAdded(nsIDocument *aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule);
@ -2749,7 +2749,8 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight)
mFrameManager->GetRootFrame(&rootFrame);
if (root) {
MOZ_TIMER_DEBUGLOG(("Reset and start: Frame Creation: PresShell::InitialReflow(), this=%p\n", this));
MOZ_TIMER_DEBUGLOG(("Reset and start: Frame Creation: PresShell::InitialReflow(), this=%p\n",
(void*)this));
MOZ_TIMER_RESET(mFrameCreationWatch);
MOZ_TIMER_START(mFrameCreationWatch);
CtlStyleWatch(kStyleWatchEnable,mStyleSet);
@ -2765,13 +2766,15 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight)
// content object down
mStyleSet->ContentInserted(mPresContext, nsnull, root, 0);
VERIFY_STYLE_TREE;
MOZ_TIMER_DEBUGLOG(("Stop: Frame Creation: PresShell::InitialReflow(), this=%p\n", this));
MOZ_TIMER_DEBUGLOG(("Stop: Frame Creation: PresShell::InitialReflow(), this=%p\n",
(void*)this));
MOZ_TIMER_STOP(mFrameCreationWatch);
CtlStyleWatch(kStyleWatchDisable,mStyleSet);
}
if (rootFrame) {
MOZ_TIMER_DEBUGLOG(("Reset and start: Reflow: PresShell::InitialReflow(), this=%p\n", this));
MOZ_TIMER_DEBUGLOG(("Reset and start: Reflow: PresShell::InitialReflow(), this=%p\n",
(void*)this));
MOZ_TIMER_RESET(mReflowWatch);
MOZ_TIMER_START(mReflowWatch);
// Kick off a top-down reflow
@ -2831,7 +2834,7 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight)
VERIFY_STYLE_TREE;
NS_IF_RELEASE(rcx);
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, ("exit nsPresShell::InitialReflow"));
MOZ_TIMER_DEBUGLOG(("Stop: Reflow: PresShell::InitialReflow(), this=%p\n", this));
MOZ_TIMER_DEBUGLOG(("Stop: Reflow: PresShell::InitialReflow(), this=%p\n", (void*)this));
MOZ_TIMER_STOP(mReflowWatch);
mIsReflowing = PR_FALSE;
@ -3597,7 +3600,7 @@ PresShell::BeginLoad(nsIDocument *aDocument)
{
#ifdef MOZ_PERF_METRICS
// Reset style resolution stopwatch maintained by style set
MOZ_TIMER_DEBUGLOG(("Reset: Style Resolution: PresShell::BeginLoad(), this=%p\n", this));
MOZ_TIMER_DEBUGLOG(("Reset: Style Resolution: PresShell::BeginLoad(), this=%p\n", (void*)this));
CtlStyleWatch(kStyleWatchReset,mStyleSet);
#endif
mDocumentLoading = PR_TRUE;
@ -5209,7 +5212,7 @@ PresShell::AttributeChanged(nsIDocument *aDocument,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint)
nsChangeHint aHint)
{
nsresult rv = NS_OK;
// XXXwaterson it might be more elegant to wait until after the
@ -5451,12 +5454,12 @@ PresShell::ReconstructStyleData(PRBool aRebuildRuleTree)
set->BeginRuleTreeReconstruct();
}
PRInt32 frameChange = NS_STYLE_HINT_NONE;
nsChangeHint frameChange = NS_STYLE_HINT_NONE;
frameManager->ComputeStyleChangeFor(mPresContext, rootFrame,
kNameSpaceID_Unknown, nsnull,
changeList, NS_STYLE_HINT_NONE, frameChange);
if (frameChange == NS_STYLE_HINT_RECONSTRUCT_ALL)
if (frameChange & nsChangeHint_ReconstructDoc)
set->ReconstructDocElementHierarchy(mPresContext);
else {
cssFrameConstructor->ProcessRestyledFrames(changeList, mPresContext);
@ -5514,7 +5517,7 @@ NS_IMETHODIMP
PresShell::StyleRuleChanged(nsIDocument *aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint)
nsChangeHint aHint)
{
WillCauseReflow();
nsresult rv = mStyleSet->StyleRuleChanged(mPresContext, aStyleSheet,
@ -7540,7 +7543,7 @@ void ReflowCountMgr::Add(const char * aName, nsReflowReason aType, nsIFrame * aF
nsnull != mIndiFrameCounts &&
aFrame != nsnull) {
char * key = new char[16];
sprintf(key, "%p", aFrame);
sprintf(key, "%p", (void*)aFrame);
IndiReflowCounter * counter = (IndiReflowCounter *)PL_HashTableLookup(mIndiFrameCounts, key);
if (counter == nsnull) {
counter = new IndiReflowCounter(this);
@ -7568,7 +7571,7 @@ void ReflowCountMgr::PaintCount(const char * aName,
nsnull != mIndiFrameCounts &&
aFrame != nsnull) {
char * key = new char[16];
sprintf(key, "%p", aFrame);
sprintf(key, "%p", (void*)aFrame);
IndiReflowCounter * counter = (IndiReflowCounter *)PL_HashTableLookup(mIndiFrameCounts, key);
if (counter != nsnull && counter->mName.EqualsWithConversion(aName)) {
aRenderingContext->PushState();
@ -7708,13 +7711,13 @@ static void RecurseIndiTotals(nsIPresContext* aPresContext,
}
char key[16];
sprintf(key, "%p", aParentFrame);
sprintf(key, "%p", (void*)aParentFrame);
IndiReflowCounter * counter = (IndiReflowCounter *)PL_HashTableLookup(aHT, key);
if (counter) {
counter->mHasBeenOutput = PR_TRUE;
char * name = ToNewCString(counter->mName);
for (PRInt32 i=0;i<aLevel;i++) printf(" ");
printf("%s - %p [%d][", name, aParentFrame, counter->mCount);
printf("%s - %p [%d][", name, (void*)aParentFrame, counter->mCount);
for (PRInt32 inx=0;inx<5;inx++) {
if (inx != 0) printf(",");
printf("%d", counter->mCounter.GetTotalByType(nsReflowReason(inx)));
@ -7738,7 +7741,7 @@ PRIntn ReflowCountMgr::DoSingleIndi(PLHashEntry *he, PRIntn i, void *arg)
IndiReflowCounter * counter = (IndiReflowCounter *)he->value;
if (counter && !counter->mHasBeenOutput) {
char * name = ToNewCString(counter->mName);
printf("%s - %p [%d][", name, counter->mFrame, counter->mCount);
printf("%s - %p [%d][", name, (void*)counter->mFrame, counter->mCount);
for (PRInt32 inx=0;inx<5;inx++) {
if (inx != 0) printf(",");
printf("%d", counter->mCounter.GetTotalByType(nsReflowReason(inx)));

View File

@ -61,7 +61,7 @@ nsStyleChangeList::~nsStyleChangeList(void)
nsresult
nsStyleChangeList::ChangeAt(PRInt32 aIndex, nsIFrame*& aFrame, nsIContent*& aContent,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if ((0 <= aIndex) && (aIndex < mCount)) {
aFrame = mArray[aIndex].mFrame;
@ -73,12 +73,14 @@ nsStyleChangeList::ChangeAt(PRInt32 aIndex, nsIFrame*& aFrame, nsIContent*& aCon
}
nsresult
nsStyleChangeList::AppendChange(nsIFrame* aFrame, nsIContent* aContent, PRInt32 aHint)
nsStyleChangeList::AppendChange(nsIFrame* aFrame, nsIContent* aContent, nsChangeHint aHint)
{
NS_ASSERTION(aFrame || (aHint >= NS_STYLE_HINT_FRAMECHANGE), "must have frame");
NS_ASSERTION(aContent || (aHint < NS_STYLE_HINT_FRAMECHANGE), "must have content");
NS_ASSERTION(aFrame || (aHint & (nsChangeHint_ReconstructFrame | nsChangeHint_ReconstructDoc)),
"must have frame");
NS_ASSERTION(aContent || !(aHint & (nsChangeHint_ReconstructFrame | nsChangeHint_ReconstructDoc)),
"must have content");
if ((0 < mCount) && (NS_STYLE_HINT_FRAMECHANGE == aHint)) { // filter out all other changes for same content
if ((0 < mCount) && (aHint & nsChangeHint_ReconstructFrame)) { // filter out all other changes for same content
if (aContent) {
PRInt32 index = mCount;
while (0 < index--) {
@ -95,9 +97,7 @@ nsStyleChangeList::AppendChange(nsIFrame* aFrame, nsIContent* aContent, PRInt32
PRInt32 last = mCount - 1;
if ((0 < mCount) && aFrame && (aFrame == mArray[last].mFrame)) { // same as last frame
if (mArray[last].mHint < aHint) {
mArray[last].mHint = aHint;
}
NS_UpdateHint(mArray[last].mHint, aHint);
}
else {
if (mCount == mArraySize) {

View File

@ -38,6 +38,8 @@
#define nsStyleChangeList_h___
#include "nsError.h"
#include "nsChangeHint.h"
class nsIFrame;
class nsIContent;
@ -45,7 +47,7 @@ class nsIContent;
struct nsStyleChangeData {
nsIFrame* mFrame;
nsIContent* mContent;
PRInt32 mHint;
nsChangeHint mHint;
};
static const PRUint32 kStyleChangeBufferSize = 10;
@ -60,9 +62,9 @@ public:
}
nsresult ChangeAt(PRInt32 aIndex, nsIFrame*& aFrame, nsIContent*& aContent,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
nsresult AppendChange(nsIFrame* aFrame, nsIContent* aContent, PRInt32 aHint);
nsresult AppendChange(nsIFrame* aFrame, nsIContent* aContent, nsChangeHint aHint);
void Clear(void);

View File

@ -41,20 +41,6 @@
// XXX fold this into nsIStyleContext and group by nsStyleXXX struct
// Defines for various style related constants
// Style change hints
#define NS_STYLE_HINT_UNKNOWN -1
#define NS_STYLE_HINT_NONE 0 // change has no impact
#define NS_STYLE_HINT_ATTRCHANGE 1 // change should cause notification to frame but nothing else
#define NS_STYLE_HINT_AURAL 2 // change was aural
#define NS_STYLE_HINT_CONTENT 3 // change was contentual (ie: SRC=)
#define NS_STYLE_HINT_VISUAL 4 // change was visual only (ie: COLOR=)
#define NS_STYLE_HINT_REFLOW 5 // change requires reflow (ie: WIDTH=)
#define NS_STYLE_HINT_FRAMECHANGE 6 // change requires frame change (ie: display:)
#define NS_STYLE_HINT_RECONSTRUCT_ALL 7 // change requires reconstruction of entire document (ie: style sheet change)
#define NS_STYLE_HINT_MAX NS_STYLE_HINT_RECONSTRUCT_ALL
// Indicies into border/padding/margin arrays
#define NS_SIDE_TOP 0
#define NS_SIDE_RIGHT 1

View File

@ -40,6 +40,7 @@
#include "nsISupports.h"
#include "nsIStatefulFrame.h"
#include "nsString.h"
#include "nsChangeHint.h"
class nsIAtom;
class nsIContent;
@ -171,8 +172,8 @@ public:
PRInt32 aAttrNameSpaceID,
nsIAtom* aAttribute,
nsStyleChangeList& aChangeList,
PRInt32 aMinChange,
PRInt32& aTopLevelChange) = 0;
nsChangeHint aMinChange,
nsChangeHint& aTopLevelChange) = 0;
// Determine whether an attribute affects style
NS_IMETHOD AttributeAffectsStyle(nsIAtom *aAttribute, nsIContent *aContent,

View File

@ -47,6 +47,7 @@
#include "nsStyleCoord.h"
#include "nsStyleStruct.h"
#include "nsStyleConsts.h"
#include "nsChangeHint.h"
#include "nsCOMPtr.h"
#include "nsILanguageAtom.h"
@ -91,7 +92,7 @@ public:
// context, and will not instantiate new data in order to compute a difference.
// That is why the old context must always be used (since the new context will
// have no data on it yet) for determining the actual difference.
NS_IMETHOD CalcStyleDifference(nsIStyleContext* aOther, PRInt32& aHint) = 0;
NS_IMETHOD CalcStyleDifference(nsIStyleContext* aOther, nsChangeHint& aHint) = 0;
NS_IMETHOD GetRuleNode(nsRuleNode** aResult)=0;
NS_IMETHOD AddStyleBit(const PRUint32& aBit)=0;

View File

@ -39,6 +39,7 @@
#include "nsISupports.h"
#include "nsIStyleSet.h"
#include "nsChangeHint.h"
class nsIPresShell;
class nsIPresContext;
@ -225,7 +226,7 @@ public:
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint) = 0;
nsChangeHint aHint) = 0;
/////////////// Style change notifications //////////////////
@ -245,7 +246,7 @@ public:
NS_IMETHOD StyleRuleChanged(nsIPresContext* aPresContext,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint) = 0; // See nsStyleConsts fot hint values
nsChangeHint aHint) = 0; // See nsStyleConsts fot hint values
/**
* A StyleRule has just been added to a style sheet.

View File

@ -40,6 +40,7 @@
#include <stdio.h>
#include "nsISupports.h"
#include "nsChangeHint.h"
class nsIAtom;
class nsIStyleRule;
@ -239,13 +240,13 @@ public:
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint) = 0; // See nsStyleConsts fot hint values
nsChangeHint aHint) = 0;
// Style change notifications
NS_IMETHOD StyleRuleChanged(nsIPresContext* aPresContext,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint) = 0; // See nsStyleConsts fot hint values
nsChangeHint aHint) = 0;
NS_IMETHOD StyleRuleAdded(nsIPresContext* aPresContext,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule) = 0;

View File

@ -38,6 +38,8 @@
#define nsStyleChangeList_h___
#include "nsError.h"
#include "nsChangeHint.h"
class nsIFrame;
class nsIContent;
@ -45,7 +47,7 @@ class nsIContent;
struct nsStyleChangeData {
nsIFrame* mFrame;
nsIContent* mContent;
PRInt32 mHint;
nsChangeHint mHint;
};
static const PRUint32 kStyleChangeBufferSize = 10;
@ -60,9 +62,9 @@ public:
}
nsresult ChangeAt(PRInt32 aIndex, nsIFrame*& aFrame, nsIContent*& aContent,
PRInt32& aHint) const;
nsChangeHint& aHint) const;
nsresult AppendChange(nsIFrame* aFrame, nsIContent* aContent, PRInt32 aHint);
nsresult AppendChange(nsIFrame* aFrame, nsIContent* aContent, nsChangeHint aHint);
void Clear(void);

View File

@ -41,20 +41,6 @@
// XXX fold this into nsIStyleContext and group by nsStyleXXX struct
// Defines for various style related constants
// Style change hints
#define NS_STYLE_HINT_UNKNOWN -1
#define NS_STYLE_HINT_NONE 0 // change has no impact
#define NS_STYLE_HINT_ATTRCHANGE 1 // change should cause notification to frame but nothing else
#define NS_STYLE_HINT_AURAL 2 // change was aural
#define NS_STYLE_HINT_CONTENT 3 // change was contentual (ie: SRC=)
#define NS_STYLE_HINT_VISUAL 4 // change was visual only (ie: COLOR=)
#define NS_STYLE_HINT_REFLOW 5 // change requires reflow (ie: WIDTH=)
#define NS_STYLE_HINT_FRAMECHANGE 6 // change requires frame change (ie: display:)
#define NS_STYLE_HINT_RECONSTRUCT_ALL 7 // change requires reconstruction of entire document (ie: style sheet change)
#define NS_STYLE_HINT_MAX NS_STYLE_HINT_RECONSTRUCT_ALL
// Indicies into border/padding/margin arrays
#define NS_SIDE_TOP 0
#define NS_SIDE_RIGHT 1

View File

@ -61,7 +61,7 @@ nsStyleChangeList::~nsStyleChangeList(void)
nsresult
nsStyleChangeList::ChangeAt(PRInt32 aIndex, nsIFrame*& aFrame, nsIContent*& aContent,
PRInt32& aHint) const
nsChangeHint& aHint) const
{
if ((0 <= aIndex) && (aIndex < mCount)) {
aFrame = mArray[aIndex].mFrame;
@ -73,12 +73,14 @@ nsStyleChangeList::ChangeAt(PRInt32 aIndex, nsIFrame*& aFrame, nsIContent*& aCon
}
nsresult
nsStyleChangeList::AppendChange(nsIFrame* aFrame, nsIContent* aContent, PRInt32 aHint)
nsStyleChangeList::AppendChange(nsIFrame* aFrame, nsIContent* aContent, nsChangeHint aHint)
{
NS_ASSERTION(aFrame || (aHint >= NS_STYLE_HINT_FRAMECHANGE), "must have frame");
NS_ASSERTION(aContent || (aHint < NS_STYLE_HINT_FRAMECHANGE), "must have content");
NS_ASSERTION(aFrame || (aHint & (nsChangeHint_ReconstructFrame | nsChangeHint_ReconstructDoc)),
"must have frame");
NS_ASSERTION(aContent || !(aHint & (nsChangeHint_ReconstructFrame | nsChangeHint_ReconstructDoc)),
"must have content");
if ((0 < mCount) && (NS_STYLE_HINT_FRAMECHANGE == aHint)) { // filter out all other changes for same content
if ((0 < mCount) && (aHint & nsChangeHint_ReconstructFrame)) { // filter out all other changes for same content
if (aContent) {
PRInt32 index = mCount;
while (0 < index--) {
@ -95,9 +97,7 @@ nsStyleChangeList::AppendChange(nsIFrame* aFrame, nsIContent* aContent, PRInt32
PRInt32 last = mCount - 1;
if ((0 < mCount) && aFrame && (aFrame == mArray[last].mFrame)) { // same as last frame
if (mArray[last].mHint < aHint) {
mArray[last].mHint = aHint;
}
NS_UpdateHint(mArray[last].mHint, aHint);
}
else {
if (mCount == mArraySize) {

View File

@ -665,7 +665,7 @@ nsContainerFrame::SyncFrameViewAfterReflow(nsIPresContext* aPresContext,
} else if (position->mZIndex.GetUnit() == eStyleUnit_Auto) {
autoZIndex = PR_TRUE;
}
vm->SetViewZIndex(aView, autoZIndex, zIndex, oldTopMost);
// There are two types of clipping:

View File

@ -4907,14 +4907,14 @@ void DR_State::DisplayFrameTypeInfo(nsIFrame* aFrame,
nsIFrameDebug* frameDebug;
if (NS_SUCCEEDED(aFrame->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**)&frameDebug))) {
frameDebug->GetFrameName(name);
printf("%s %p ", NS_LossyConvertUCS2toASCII(name).get(), aFrame);
printf("%s %p ", NS_LossyConvertUCS2toASCII(name).get(), (void*)aFrame);
}
else {
printf("%s %p ", frameTypeInfo->mNameAbbrev, aFrame);
printf("%s %p ", frameTypeInfo->mNameAbbrev, (void*)aFrame);
}
}
else {
printf("%s %p ", frameTypeInfo->mNameAbbrev, aFrame);
printf("%s %p ", frameTypeInfo->mNameAbbrev, (void*)aFrame);
}
}
}
@ -5020,7 +5020,7 @@ void DR_State::PrettyUC(nscoord aSize,
strcpy(aBuf, "UC");
}
else {
if(0xdeadbeef == aSize)
if(0xdeadbeefU == aSize)
{
strcpy(aBuf, "deadbeef");
}
@ -5075,11 +5075,11 @@ static void DisplayReflowEnterPrint(nsIPresContext* aPresContext,
nsIFrame* inFlow;
aFrame->GetPrevInFlow(&inFlow);
if (inFlow) {
printf("pif=%p ", inFlow);
printf("pif=%p ", (void*)inFlow);
}
aFrame->GetNextInFlow(&inFlow);
if (inFlow) {
printf("nif=%p ", inFlow);
printf("nif=%p ", (void*)inFlow);
}
if (aChanged)
printf("CHANGED \n");

View File

@ -110,7 +110,7 @@ public:
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint);
nsChangeHint aHint);
NS_IMETHOD ContentAppended(nsIDocument *aDocument,
nsIContent* aContainer,
PRInt32 aNewIndexInContainer) { return NS_OK; }
@ -137,7 +137,7 @@ public:
NS_IMETHOD StyleRuleChanged(nsIDocument *aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint) { return NS_OK; }
nsChangeHint aHint) { return NS_OK; }
NS_IMETHOD StyleRuleAdded(nsIDocument *aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule) { return NS_OK; }
@ -878,7 +878,7 @@ nsGfxScrollFrameInner::AttributeChanged(nsIDocument *aDocument,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint)
nsChangeHint aHint)
{
if (mHScrollbarBox && mVScrollbarBox && (mHasHorizontalScrollbar || mHasVerticalScrollbar))
{

View File

@ -891,7 +891,6 @@ nsImageMap::UpdateAreas()
// Get rid of old area data
FreeAreas();
nsresult rv = NS_OK;
PRInt32 i, n;
PRBool containsBlock = PR_FALSE, containsArea = PR_FALSE;
@ -1155,7 +1154,7 @@ nsImageMap::AttributeChanged(nsIDocument *aDocument,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint)
nsChangeHint aHint)
{
// If the parent of the changing content node is our map then update
// the map.
@ -1249,7 +1248,7 @@ NS_IMETHODIMP
nsImageMap::StyleRuleChanged(nsIDocument *aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint)
nsChangeHint aHint)
{
return NS_OK;
}

View File

@ -117,7 +117,7 @@ public:
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType,
PRInt32 aHint);
nsChangeHint aHint);
NS_IMETHOD ContentAppended(nsIDocument *aDocument,
nsIContent* aContainer,
PRInt32 aNewIndexInContainer);
@ -144,7 +144,7 @@ public:
NS_IMETHOD StyleRuleChanged(nsIDocument *aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule,
PRInt32 aHint);
nsChangeHint aHint);
NS_IMETHOD StyleRuleAdded(nsIDocument *aDocument,
nsIStyleSheet* aStyleSheet,
nsIStyleRule* aStyleRule);

View File

@ -665,7 +665,7 @@ nsContainerFrame::SyncFrameViewAfterReflow(nsIPresContext* aPresContext,
} else if (position->mZIndex.GetUnit() == eStyleUnit_Auto) {
autoZIndex = PR_TRUE;
}
vm->SetViewZIndex(aView, autoZIndex, zIndex, oldTopMost);
// There are two types of clipping:

Some files were not shown because too many files have changed in this diff Show More