Closed
Bug 1316277
Opened 8 years ago
Closed 7 years ago
Consider removing mRegisteredIntersectionObservers from DOMSlots
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
RESOLVED
FIXED
mozilla58
People
(Reporter: smaug, Assigned: tschneider)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 3 obsolete files)
9.17 KB,
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
DOMSlots is becoming heavy. Is there a reason to use it for a rarely used feature like
IntersectionObservers? Couldn't a global hashtable (similar to what is used for EventListenerManager for nodes) be used? Or perhaps properties (nsINode::Set/GetProperty)
Updated•8 years ago
|
Priority: -- → P3
Assignee | ||
Updated•8 years ago
|
Blocks: intersection-observer
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → tschneider
Assignee | ||
Comment 1•7 years ago
|
||
Updated•7 years ago
|
status-firefox57:
--- → wontfix
Assignee | ||
Comment 2•7 years ago
|
||
Attachment #8910459 -
Attachment is obsolete: true
Assignee | ||
Updated•7 years ago
|
Attachment #8911235 -
Flags: review?(mrbkap)
Comment 3•7 years ago
|
||
Comment on attachment 8911235 [details] [diff] [review]
Move intersection observer list from DOMSlots to a property
Review of attachment 8911235 [details] [diff] [review]:
-----------------------------------------------------------------
I have one comment to address that needs to happen before checkin. I'll stamp the next patch.
::: dom/base/Element.cpp
@@ +4152,5 @@
> + if (!observers) {
> + observers = new nsDataHashtable<nsRefPtrHashKey<DOMIntersectionObserver>,
> + int32_t>();
> + SetProperty(nsGkAtoms::intersectionobserverlist, observers,
> + nsINode::DeleteProperty<bool>);
This looks wrong. The template parameter to nsINode::DeleteProperty is the type of the pointer that the property points to. Here, we're not storing a bool, but rather a hashtable. It would probably help readability here to typedef `nsDataHashtable<nsRefPtrHashKey<DOMIntersectionObserver>, int32_t>` to something like IntersectionObserverList (maybe a private typedef on Element?) and use that.
Attachment #8911235 -
Flags: review?(mrbkap) → review-
Assignee | ||
Comment 4•7 years ago
|
||
Addressed review comments.
Attachment #8911235 -
Attachment is obsolete: true
Attachment #8912356 -
Flags: review?(mrbkap)
Comment 5•7 years ago
|
||
Comment on attachment 8912356 [details] [diff] [review]
Move intersection observer list from DOMSlots to a property
Review of attachment 8912356 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks!
Attachment #8912356 -
Flags: review?(mrbkap) → review+
Assignee | ||
Comment 6•7 years ago
|
||
Attachment #8912356 -
Attachment is obsolete: true
Assignee | ||
Comment 7•7 years ago
|
||
Comment on attachment 8915708 [details] [diff] [review]
Move intersection observer list from DOMSlots to a property
Blake, need you to give this another review since I had to make 2 important changes to the patch:
1. Previous patch accidentally removed slots->Unlink();, leading to memory leaks.
2. Setting the property if not defined should only happen if we actually need it. The previous patch always set the property, even if we only called RegisteredIntersectionObservers to check its presence.
Attachment #8915708 -
Flags: review?(mrbkap)
Comment 8•7 years ago
|
||
Comment on attachment 8915708 [details] [diff] [review]
Move intersection observer list from DOMSlots to a property
Review of attachment 8915708 [details] [diff] [review]:
-----------------------------------------------------------------
Sorry for missing that stuff the last time.
Attachment #8915708 -
Flags: review?(mrbkap) → review+
Pushed by tschneider@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ce5016d6b5df
Move intersection observer list from DOMSlots to a property. r=mrbkap
Comment 10•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox58:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•