Bug 906116 - part3.3: Replace NS_STYLE_HINT_FRAMECHANGE with nsChangeHint_ReconstructFrame. r=dbaron

Use ReconstructFrame to replace NS_STYLE_HINT_FRAMECHANGE in many places, such
as HTML*Element::GetAttributeChangeHint and HTMLFrameSetElement::SetAttr.

MozReview-Commit-ID: EHbc4RMeuu0

--HG--
extra : rebase_source : afffc0d2ee2861a58dee82f0af06a67f4b8e3a78
This commit is contained in:
Jeremy Chen 2016-07-06 13:06:14 +08:00
parent 0d17d1e151
commit 122a1b7056
9 changed files with 17 additions and 17 deletions

View File

@ -83,9 +83,9 @@ HTMLFrameSetElement::SetAttr(int32_t aNameSpaceID,
if (aAttribute == nsGkAtoms::rows && aNameSpaceID == kNameSpaceID_None) {
int32_t oldRows = mNumRows;
ParseRowCol(aValue, mNumRows, &mRowSpecs);
if (mNumRows != oldRows) {
mCurrentRowColHint = NS_STYLE_HINT_FRAMECHANGE;
mCurrentRowColHint = nsChangeHint_ReconstructFrame;
}
} else if (aAttribute == nsGkAtoms::cols &&
aNameSpaceID == kNameSpaceID_None) {
@ -93,14 +93,14 @@ HTMLFrameSetElement::SetAttr(int32_t aNameSpaceID,
ParseRowCol(aValue, mNumCols, &mColSpecs);
if (mNumCols != oldCols) {
mCurrentRowColHint = NS_STYLE_HINT_FRAMECHANGE;
mCurrentRowColHint = nsChangeHint_ReconstructFrame;
}
}
rv = nsGenericHTMLElement::SetAttr(aNameSpaceID, aAttribute, aPrefix,
aValue, aNotify);
mCurrentRowColHint = NS_STYLE_HINT_REFLOW;
return rv;
}

View File

@ -343,11 +343,11 @@ HTMLImageElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
nsGenericHTMLElement::GetAttributeChangeHint(aAttribute, aModType);
if (aAttribute == nsGkAtoms::usemap ||
aAttribute == nsGkAtoms::ismap) {
retval |= NS_STYLE_HINT_FRAMECHANGE;
retval |= nsChangeHint_ReconstructFrame;
} else if (aAttribute == nsGkAtoms::alt) {
if (aModType == nsIDOMMutationEvent::ADDITION ||
aModType == nsIDOMMutationEvent::REMOVAL) {
retval |= NS_STYLE_HINT_FRAMECHANGE;
retval |= nsChangeHint_ReconstructFrame;
}
}
return retval;

View File

@ -5682,20 +5682,20 @@ HTMLInputElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
// buttons we show for type=file.
aAttribute == nsGkAtoms::directory ||
aAttribute == nsGkAtoms::webkitdirectory) {
retval |= NS_STYLE_HINT_FRAMECHANGE;
retval |= nsChangeHint_ReconstructFrame;
} else if (mType == NS_FORM_INPUT_IMAGE &&
(aAttribute == nsGkAtoms::alt ||
aAttribute == nsGkAtoms::value)) {
// We might need to rebuild our alt text. Just go ahead and
// reconstruct our frame. This should be quite rare..
retval |= NS_STYLE_HINT_FRAMECHANGE;
retval |= nsChangeHint_ReconstructFrame;
} else if (aAttribute == nsGkAtoms::value) {
retval |= NS_STYLE_HINT_REFLOW;
} else if (aAttribute == nsGkAtoms::size &&
IsSingleLineTextControl(false)) {
retval |= NS_STYLE_HINT_REFLOW;
} else if (PlaceholderApplies() && aAttribute == nsGkAtoms::placeholder) {
retval |= NS_STYLE_HINT_FRAMECHANGE;
retval |= nsChangeHint_ReconstructFrame;
}
return retval;
}

View File

@ -1413,7 +1413,7 @@ HTMLSelectElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
nsGenericHTMLFormElementWithState::GetAttributeChangeHint(aAttribute, aModType);
if (aAttribute == nsGkAtoms::multiple ||
aAttribute == nsGkAtoms::size) {
retval |= NS_STYLE_HINT_FRAMECHANGE;
retval |= nsChangeHint_ReconstructFrame;
}
return retval;
}

View File

@ -440,7 +440,7 @@ HTMLTextAreaElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
} else if (aAttribute == nsGkAtoms::wrap) {
retval |= nsChangeHint_ReconstructFrame;
} else if (aAttribute == nsGkAtoms::placeholder) {
retval |= NS_STYLE_HINT_FRAMECHANGE;
retval |= nsChangeHint_ReconstructFrame;
}
return retval;
}

View File

@ -1444,7 +1444,7 @@ nsXULElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
// value attribute is being added or removed, then we need to
// return a hint of frame change. (See bugzilla bug 95475 for
// details.)
retval = NS_STYLE_HINT_FRAMECHANGE;
retval = nsChangeHint_ReconstructFrame;
} else {
// if left or top changes we reflow. This will happen in xul
// containers that manage positioned children such as a stack.

View File

@ -4677,7 +4677,7 @@ ElementRestyler::RestyleUndisplayedNodes(nsRestyleHint aChildRestyleHint,
if (display->mDisplay != aDisplay) {
NS_ASSERTION(element, "Must have undisplayed content");
mChangeList->AppendChange(nullptr, element,
NS_STYLE_HINT_FRAMECHANGE);
nsChangeHint_ReconstructFrame);
// The node should be removed from the undisplayed map when
// we reframe it.
} else {

View File

@ -9876,7 +9876,7 @@ ReframeImageBoxes(nsIFrame *aFrame, void *aClosure)
nsStyleChangeList *list = static_cast<nsStyleChangeList*>(aClosure);
if (aFrame->GetType() == nsGkAtoms::imageBoxFrame) {
list->AppendChange(aFrame, aFrame->GetContent(),
NS_STYLE_HINT_FRAMECHANGE);
nsChangeHint_ReconstructFrame);
return false; // don't walk descendants
}
return true; // walk descendants

View File

@ -102,7 +102,7 @@ nsCSSPropList.h</a>
 Insert the property in the list alphabetically, using the existing
property names as a template. The format of the entry you will create is:
</p>
<pre>CSS_PROP(-moz-force-broken-image-icons, force_broken_image_icons, MozForceBrokenImageIcons, NS_STYLE_HINT_FRAMECHANGE) // bug 58646</pre>
<pre>CSS_PROP(-moz-force-broken-image-icons, force_broken_image_icons, MozForceBrokenImageIcons, nsChangeHint_ReconstructFrame) // bug 58646</pre>
<p>The first value is the formal property name, in other words the property
name as it is seen by the CSS parser.<br>
@ -335,7 +335,7 @@ is the CalcDifference change for our example:<br>
}
return NS_STYLE_HINT_VISUAL;
}
<b>return NS_STYLE_HINT_FRAMECHANGE;
<b>return nsChangeHint_ReconstructFrame;
</b>}
</pre>
<h3>CSSStyleRule</h3>