Rename {nsIDocument,nsIDocumentObserver,nsIFrame}::ContentChanged to CharacterDataChanged, since that's the only thing it's used for. Replace its nsISupports* parameter with a PRBool, since we don't need to allocate an object to pass a boolean parameter. Remove some (but probably not all) unneeded implementations on frames whose content is never a text node. b=234960 r+sr=jst

This commit is contained in:
dbaron@dbaron.org
2004-02-20 21:38:31 +00:00
parent 952e02d640
commit f4264ddfc8
51 changed files with 138 additions and 544 deletions

View File

@@ -400,9 +400,9 @@ public:
nsPoint& aPoint,
PRInt32& aCursor);
NS_IMETHOD ContentChanged(nsIPresContext* aPresContext,
nsIContent* aChild,
nsISupports* aSubContent);
NS_IMETHOD CharacterDataChanged(nsIPresContext* aPresContext,
nsIContent* aChild,
PRBool aAppend);
NS_IMETHOD GetNextInFlow(nsIFrame** aNextInFlow) const {
*aNextInFlow = mNextInFlow;
@@ -1364,25 +1364,18 @@ nsTextFrame::GetLastInFlow() const
}
NS_IMETHODIMP
nsTextFrame::ContentChanged(nsIPresContext* aPresContext,
nsIContent* aChild,
nsISupports* aSubContent)
nsTextFrame::CharacterDataChanged(nsIPresContext* aPresContext,
nsIContent* aChild,
PRBool aAppend)
{
nsIFrame* targetTextFrame = this;
PRBool markAllDirty = PR_TRUE;
if (aSubContent) {
nsCOMPtr<nsITextContentChangeData> tccd = do_QueryInterface(aSubContent);
if (tccd) {
nsITextContentChangeData::ChangeType type;
tccd->GetChangeType(&type);
if (nsITextContentChangeData::Append == type) {
markAllDirty = PR_FALSE;
nsTextFrame* frame = (nsTextFrame*)GetLastInFlow();
frame->mState |= NS_FRAME_IS_DIRTY;
targetTextFrame = frame;
}
}
if (aAppend) {
markAllDirty = PR_FALSE;
nsTextFrame* frame = (nsTextFrame*)GetLastInFlow();
frame->mState |= NS_FRAME_IS_DIRTY;
targetTextFrame = frame;
}
if (markAllDirty) {
@@ -5308,7 +5301,7 @@ nsTextFrame::Reflow(nsIPresContext* aPresContext,
// We can avoid actually measuring the text if:
// - this is a resize reflow
// - we're not dirty (see ContentChanged() function)
// - we're not dirty (see CharacterDataChanged() function)
// - we don't have a next in flow
// - the previous reflow successfully reflowed all text in the
// available space