Bug 178886 - Audit init*Event() method to make sure they reset internal data members
Summary: Audit init*Event() method to make sure they reset internal data members
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-26 14:35 PDT by Chris Dumez
Modified: 2017-10-28 17:48 PDT (History)
7 users (show)

See Also:


Attachments
Patch (6.61 KB, patch)
2017-10-26 14:36 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2017-10-26 14:35:29 PDT
Audit init*Event() method to make sure they reset internal data members.
Comment 1 Chris Dumez 2017-10-26 14:36:35 PDT
Created attachment 325055 [details]
Patch
Comment 2 Chris Dumez 2017-10-27 09:50:15 PDT
Comment on attachment 325055 [details]
Patch

r224115
Comment 3 Darin Adler 2017-10-27 11:00:18 PDT
Comment on attachment 325055 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=325055&action=review

> Source/WebCore/dom/MouseRelatedEvent.h:58
> +    void setIsSimulated(bool value) { m_isSimulated = value; }

protected instead?
Comment 4 Darin Adler 2017-10-27 11:00:44 PDT
If there was any effect of these changes, it would be nice to cover the effect in tests. Of course, the effects might be subtle so it might be hard to write tests.
Comment 5 Darin Adler 2017-10-28 17:48:34 PDT
Comment on attachment 325055 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=325055&action=review

> Source/WebCore/dom/Event.cpp:93
> +    m_underlyingEvent = nullptr;

This doesn’t cover everything. A website could call initEvent on, say, a MouseEvent, and we might want it to reset a data member such as MouseEvent::m_dataTransfer. I am not sure what we should do about this.