Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(893)

Unified Diff: Source/core/events/MouseEvent.cpp

Issue 1285793004: isTrusted is incorrect for events generated by Element.click() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Change bool on SimulatedMouseEvent to the enum class introduced everywhere else Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/events/MouseEvent.h ('k') | Source/core/html/HTMLElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/events/MouseEvent.cpp
diff --git a/Source/core/events/MouseEvent.cpp b/Source/core/events/MouseEvent.cpp
index 9466eb8a49d9b992a4a9c5307610b4e9b31d9082..1d9aa4ab0440ace1e537af636aabb59b48513a46 100644
--- a/Source/core/events/MouseEvent.cpp
+++ b/Source/core/events/MouseEvent.cpp
@@ -217,20 +217,20 @@ DEFINE_TRACE(MouseEvent)
MouseRelatedEvent::trace(visitor);
}
-PassRefPtrWillBeRawPtr<SimulatedMouseEvent> SimulatedMouseEvent::create(const AtomicString& eventType, PassRefPtrWillBeRawPtr<AbstractView> view, PassRefPtrWillBeRawPtr<Event> underlyingEvent)
+PassRefPtrWillBeRawPtr<SimulatedMouseEvent> SimulatedMouseEvent::create(const AtomicString& eventType, PassRefPtrWillBeRawPtr<AbstractView> view, PassRefPtrWillBeRawPtr<Event> underlyingEvent, SimulatedClickCreationScope creationScope)
{
- return adoptRefWillBeNoop(new SimulatedMouseEvent(eventType, view, underlyingEvent));
+ return adoptRefWillBeNoop(new SimulatedMouseEvent(eventType, view, underlyingEvent, creationScope));
}
SimulatedMouseEvent::~SimulatedMouseEvent()
{
}
-SimulatedMouseEvent::SimulatedMouseEvent(const AtomicString& eventType, PassRefPtrWillBeRawPtr<AbstractView> view, PassRefPtrWillBeRawPtr<Event> underlyingEvent)
+SimulatedMouseEvent::SimulatedMouseEvent(const AtomicString& eventType, PassRefPtrWillBeRawPtr<AbstractView> view, PassRefPtrWillBeRawPtr<Event> underlyingEvent, SimulatedClickCreationScope creationScope)
: MouseEvent(eventType, true, true, view, 0, 0, 0, 0, 0, 0, 0, false, false, false, false, 0, 0,
nullptr, nullptr, true, PlatformMouseEvent::RealOrIndistinguishable)
{
- setTrusted(true);
+ setTrusted(creationScope == SimulatedClickCreationScope::FromUserAgent);
if (UIEventWithKeyState* keyStateEvent = findEventWithKeyState(underlyingEvent.get())) {
m_ctrlKey = keyStateEvent->ctrlKey();
m_altKey = keyStateEvent->altKey();
« no previous file with comments | « Source/core/events/MouseEvent.h ('k') | Source/core/html/HTMLElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698