Closed
Bug 1433413
Opened 8 years ago
Closed 8 years ago
Optimize IsEventTargetChrome
Categories
(Core :: DOM: Events, enhancement, P2)
Core
DOM: Events
Tracking
()
RESOLVED
FIXED
mozilla60
Tracking | Status | |
---|---|---|
firefox60 | --- | fixed |
People
(Reporter: smaug, Assigned: smaug)
References
Details
Attachments
(1 file)
1.29 KB,
patch
|
masayuki
:
review+
|
Details | Diff | Splinter Review |
We could just QI to nsINode and get its owner doc. I don't see reason to QI to nsIDocument.
This would make mOnlySystemGroupDispatchInContent a tad less heavy.
Assignee | ||
Comment 1•8 years ago
|
||
remote: View your change here:
remote: https://hg.mozilla.org/try/rev/fb71cc216b0aa23c4926c6aa3815e7afd7b8ee34
remote:
remote: Follow the progress of your build on Treeherder:
remote: https://treeherder.mozilla.org/#/jobs?repo=try&revision=fb71cc216b0aa23c4926c6aa3815e7afd7b8ee34
remote: recorded changegroup in replication log in 0.067s
Attachment #8945753 -
Flags: review?(masayuki)
Updated•8 years ago
|
Priority: -- → P2
Comment on attachment 8945753 [details] [diff] [review]
event_target_is_chrome_opt.diff
Looks fine to me.
However, this depends on this explanation:
> /**
> * Returns the "node document" of this node.
> *
> * https://dom.spec.whatwg.org/#concept-node-document
> *
> * Note that in the case that this node is a document node this method
> * will return |this|. That is different to the Node.ownerDocument DOM
> * attribute (implemented by nsINode::GetOwnerDocument) which is specified to
> * be null in that case:
> *
> * https://dom.spec.whatwg.org/#dom-node-ownerdocument
> *
> * For all other cases OwnerDoc and GetOwnerDocument behave identically.
> */
> nsIDocument *OwnerDoc() const
> {
> return mNodeInfo->GetDocument();
> }
https://searchfox.org/mozilla-central/rev/11d0ff9f36465ce19b0c43d1ecc3025791eeb808/dom/base/nsINode.h#530-531
Although I don't like the method name...
Attachment #8945753 -
Flags: review?(masayuki) → review+
Assignee | ||
Comment 3•8 years ago
|
||
Yes, it depends on OwnerDoc() behaving consistently with all the nodes.
I've never liked .ownerDocument behavior in DOM spec.
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/df9df2ef6538
Optimize IsEventTargetChrome, r=masayuki
![]() |
||
Comment 5•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox60:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in
before you can comment on or make changes to this bug.
Description
•