Closed Bug 1433413 Opened 8 years ago Closed 8 years ago

Optimize IsEventTargetChrome

Categories

(Core :: DOM: Events, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: smaug, Assigned: smaug)

References

Details

Attachments

(1 file)

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.
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)
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+
Yes, it depends on OwnerDoc() behaving consistently with all the nodes. I've never liked .ownerDocument behavior in DOM spec.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: