Closed
Bug 1367217
Opened 8 years ago
Closed 8 years ago
ClearAllUndisplayedContentIn and ClearAllUndisplayedContentIn duplicate work
Categories
(Core :: Layout, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: bzbarsky, Assigned: MatsPalmgren_bugz)
References
Details
Attachments
(1 file)
7.22 KB,
patch
|
dholbert
:
review+
|
Details | Diff | Splinter Review |
These two functions are always called together, like so:
ClearAllDisplayContentsIn(node->mContent);
ClearAllUndisplayedContentIn(node->mContent);
or
ClearAllUndisplayedContentIn(content);
ClearAllDisplayContentsIn(content);
or
ClearAllDisplayContentsIn(aContent);
ClearAllUndisplayedContentIn(aContent);
Then ClearAllUndisplayedContentIn does:
FlattenedChildIterator iter(aParentContent);
for (nsIContent* child = iter.GetNextChild(); child; child = iter.GetNextChild()) {
if (child->GetParent() != aParentContent) {
ClearUndisplayedContentIn(child, child->GetParent());
}
}
while ClearAllDisplayContentsIn does:
FlattenedChildIterator iter(aParentContent);
for (nsIContent* child = iter.GetNextChild(); child; child = iter.GetNextChild()) {
if (child->GetParent() != aParentContent) {
ClearDisplayContentsIn(child, child->GetParent());
ClearUndisplayedContentIn(child, child->GetParent());
}
}
That second walk over the kids repeats all the work from the first walk and adds a bit more. Could we just do a single walk over the kids that does the work from ClearAllDisplayContentsIn?
Flags: needinfo?(mats)
Updated•8 years ago
|
Whiteboard: [qf] → [qf:p1]
Assignee | ||
Comment 1•8 years ago
|
||
Yeah, I think we should just merge these two methods.
Re: the loop at the end - we could skip that altogether if aParentContent
had a HaveXBLOrShadowDOMChildren flag or a cheap way to test that, does it?
Assignee: nobody → mats
Flags: needinfo?(mats) → needinfo?(bzbarsky)
Assignee | ||
Comment 2•8 years ago
|
||
Assignee | ||
Comment 3•8 years ago
|
||
Attachment #8875377 -
Flags: review?(dholbert)
Comment 4•8 years ago
|
||
Comment on attachment 8875377 [details] [diff] [review]
Merge ClearAllUndisplayedContentIn / ClearAllDisplayContentsIn to avoid doing duplicated work
Review of attachment 8875377 [details] [diff] [review]:
-----------------------------------------------------------------
r=me (looks like this preserves existing behavior, aside from the duplicate-work elimination)
Thanks!
Attachment #8875377 -
Flags: review?(dholbert) → review+
Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ee20b7f985f5
Merge ClearAllUndisplayedContentIn / ClearAllDisplayContentsIn to avoid doing duplicated work. r=dholbert
Reporter | ||
Comment 6•8 years ago
|
||
> we could skip that altogether if aParentContent had a HaveXBLOrShadowDOMChildren
> flag or a cheap way to test that, does it?
I don't know of one offhand.
Flags: needinfo?(bzbarsky)
Comment 7•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Updated•3 years ago
|
Performance Impact: --- → P1
Whiteboard: [qf:p1]
You need to log in
before you can comment on or make changes to this bug.
Description
•