Closed
Bug 465928
Opened 16 years ago
Closed 16 years ago
Avoid SetInvalidateTextRuns in nsBlockFrame::DoRemoveFrame
Categories
(Core :: Layout, defect, P3)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla1.9.1b3
People
(Reporter: roc, Assigned: roc)
References
Details
(Keywords: fixed1.9.1)
Attachments
(2 files, 1 obsolete file)
25.27 KB,
patch
|
dbaron
:
review+
dbaron
:
superreview+
beltzner
:
approval1.9.1+
|
Details | Diff | Splinter Review |
7.16 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
When a frame is complete and we delete its unnecessary (now empty) continuations, we don't need to call SetInvalidateTextRuns on the lines containing those continuations, because we're not removing any actual content. Fixing this requires propagating a flag through DeleteNextInFlowChild to indicate whether we're in that common case. This lets us reduce the amount of textrun reconstruction we do.
Attachment #349167 -
Flags: superreview?(dbaron)
Attachment #349167 -
Flags: review?(dbaron)
Comment on attachment 349167 [details] [diff] [review] fix > nsBlockFrame::DoRemoveFrame(nsIFrame* aDeletedFrame, PRBool aDestroyFrames, > static_cast<nsContainerFrame*>(nif->GetParent()) >- ->nsContainerFrame::DeleteNextInFlowChild(presContext, nif); >+ ->nsContainerFrame::DeleteNextInFlowChild(presContext, nif, aRemovingEmptyFrames); you should wrap to another line rather than cross the 80th column > nsBlockFrame::DeleteNextInFlowChild(nsPresContext* aPresContext, >+ nsContainerFrame::DeleteNextInFlowChild(aPresContext, aNextInFlow, aDeletingEmptyFrames); Same here >+ * @param aRemovingEmptyFrames all frames we're removing are empty >+ * so lines do not need to be marked dirty Do you mean text runs rather than lines? Or is there something else here? > nsresult DoRemoveFrame(nsIFrame* aDeletedFrame, PRBool aDestroyFrames = PR_TRUE, >- PRBool aRemoveOnlyFluidContinuations = PR_TRUE); >+ PRBool aRemoveOnlyFluidContinuations = PR_TRUE, >+ PRBool aRemovingEmptyFrames = PR_FALSE); Having three default parameters, two of which are true and one of which is false, seems very ugly and a bit dangerous. How many callers depend on the default parameters? Could the defaults be dropped? Is it possible to rename your new one such that the default could be true (e.g., to aInvalidateTextRuns)? (Do you think that would improve things?) r+sr=dbaron
Attachment #349167 -
Flags: superreview?(dbaron)
Attachment #349167 -
Flags: superreview+
Attachment #349167 -
Flags: review?(dbaron)
Attachment #349167 -
Flags: review+
Assignee | ||
Comment 2•16 years ago
|
||
(In reply to comment #1) > (From update of attachment 349167 [details] [diff] [review]) > > nsBlockFrame::DoRemoveFrame(nsIFrame* aDeletedFrame, PRBool aDestroyFrames, > > > static_cast<nsContainerFrame*>(nif->GetParent()) > >- ->nsContainerFrame::DeleteNextInFlowChild(presContext, nif); > >+ ->nsContainerFrame::DeleteNextInFlowChild(presContext, nif, aRemovingEmptyFrames); > > you should wrap to another line rather than cross the 80th column > > > nsBlockFrame::DeleteNextInFlowChild(nsPresContext* aPresContext, > > >+ nsContainerFrame::DeleteNextInFlowChild(aPresContext, aNextInFlow, aDeletingEmptyFrames); > > Same here OK > >+ * @param aRemovingEmptyFrames all frames we're removing are empty > >+ * so lines do not need to be marked dirty > > Do you mean text runs rather than lines? Or is there something else here? I guess just "text runs do not need to be invalidated". > > nsresult DoRemoveFrame(nsIFrame* aDeletedFrame, PRBool aDestroyFrames = PR_TRUE, > >- PRBool aRemoveOnlyFluidContinuations = PR_TRUE); > >+ PRBool aRemoveOnlyFluidContinuations = PR_TRUE, > >+ PRBool aRemovingEmptyFrames = PR_FALSE); > > Having three default parameters, two of which are true and one of which is > false, seems very ugly and a bit dangerous. How many callers depend on the > default parameters? Could the defaults be dropped? Is it possible to rename > your new one such that the default could be true (e.g., to > aInvalidateTextRuns)? (Do you think that would improve things?) Would it be better if I made them into a single flags word?
(In reply to comment #2) > Would it be better if I made them into a single flags word? It might, if you think that would come out cleanly (which it might, especially if the flag were always the uncommon case). I'm mainly concerned about (a) readability and (b) the risk of bugs caused by omitting one of the parameters or getting them in the wrong order.
Assignee | ||
Comment 4•16 years ago
|
||
I'll do that then.
Assignee | ||
Comment 5•16 years ago
|
||
Attachment #349167 -
Attachment is obsolete: true
Attachment #349550 -
Flags: superreview?(dbaron)
Attachment #349550 -
Flags: review?(dbaron)
Attachment #349550 -
Flags: superreview?(dbaron)
Attachment #349550 -
Flags: superreview+
Attachment #349550 -
Flags: review?(dbaron)
Attachment #349550 -
Flags: review+
Comment on attachment 349550 [details] [diff] [review] with flags >+ * PRESERVE_REMOVED_FRAMES does NOT work on out of flow frames so >+ * always use PR_TRUE for out of flows. s/always use PR_TRUE/it should not be passed/ or something like that r+sr=dbaron
Assignee | ||
Updated•16 years ago
|
Whiteboard: [needs landing]
Assignee | ||
Updated•16 years ago
|
Flags: blocking1.9.1? → wanted1.9.1+
Priority: -- → P3
Assignee | ||
Comment 8•16 years ago
|
||
Pushed to trunk as fde162441213 and 2ad0cb394376
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing] → [needs 191 approval]
Assignee | ||
Comment 9•16 years ago
|
||
Comment on attachment 349550 [details] [diff] [review] with flags Avoids textrun reconstruction; performance win on bug 430332
Attachment #349550 -
Flags: approval1.9.1?
Comment 10•16 years ago
|
||
Comment on attachment 349550 [details] [diff] [review] with flags a191=beltzner
Attachment #349550 -
Flags: approval1.9.1? → approval1.9.1+
Assignee | ||
Updated•16 years ago
|
Whiteboard: [needs 191 approval] → [needs 191 landing]
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/8c8b403e4094 http://hg.mozilla.org/releases/mozilla-1.9.1/rev/67c5b542ea9e
Comment 12•16 years ago
|
||
Comment on attachment 349550 [details] [diff] [review] with flags >+ * PRESERVE_REMOVED_FRAMES does NOT work on out of flow frames so [snip] >+ enum { >+ PERSERVE_REMOVED_FRAMES = 0x01, I just ran across this typo when perusing nsBlockFrame.cpp ("pERserve instead of pREserve in the enum value name). It's spelled correctly in all the comments, and incorrectly in all the code. Looks like this file just needs a s/PERSERVE/PRESERVE/.
Comment 13•16 years ago
|
||
Updated•16 years ago
|
Attachment #356784 -
Attachment description: followup typo fix: s/PERSERVE/PRESERVE → followup typo fix: s/PERSERVE/PRESERVE/ in nsBlockFrame.*
Updated•16 years ago
|
Attachment #356784 -
Flags: review?(roc)
Assignee | ||
Updated•16 years ago
|
Attachment #356784 -
Flags: review?(roc) → review+
Comment 14•16 years ago
|
||
Followup typo fix landed on mozilla-central and 191 branch: http://hg.mozilla.org/mozilla-central/rev/9daec2349061 http://hg.mozilla.org/releases/mozilla-1.9.1/rev/703fdc2d941e
You need to log in
before you can comment on or make changes to this bug.
Description
•