Changeset 212819 in webkit
- Timestamp:
- Feb 22, 2017, 1:50:42 AM (10 years ago)
- Location:
- branches/safari-603.1.30.0-branch/Source/WebCore
- Files:
-
- 6 edited
-
ChangeLog (modified) (1 diff)
-
dom/MouseEvent.cpp (modified) (2 diffs)
-
dom/MouseEvent.h (modified) (1 diff)
-
dom/MouseEvent.idl (modified) (1 diff)
-
platform/RuntimeApplicationChecks.h (modified) (1 diff)
-
platform/RuntimeApplicationChecks.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-603.1.30.0-branch/Source/WebCore/ChangeLog
r212740 r212819 1 2017-02-22 Matthew Hanson <matthew_hanson@apple.com> 2 3 Merge r212773. rdar://problem/30640217 4 5 2017-02-21 Chris Dumez <cdumez@apple.com> 6 7 REGRESSION (203941): iAd Producer: Clicking buttons in Preview does not work 8 https://bugs.webkit.org/show_bug.cgi?id=168677 9 <rdar://problem/30640101> 10 11 Reviewed by Ryosuke Niwa. 12 13 Add quirk to initMouseEvent to unbreak iAd Producer. 14 15 * dom/MouseEvent.cpp: 16 (WebCore::MouseEvent::initMouseEventQuirk): 17 * dom/MouseEvent.h: 18 * dom/MouseEvent.idl: 19 * platform/RuntimeApplicationChecks.h: 20 * platform/RuntimeApplicationChecks.mm: 21 (WebCore::MacApplication::isIADProducer): 22 1 23 2017-02-21 Matthew Hanson <matthew_hanson@apple.com> 2 24 -
branches/safari-603.1.30.0-branch/Source/WebCore/dom/MouseEvent.cpp
r209895 r212819 29 29 #include "FrameView.h" 30 30 #include "HTMLIFrameElement.h" 31 #include "JSDOMConvert.h" 32 #include "JSEventTarget.h" 33 #include "JSEventTargetCustom.h" 31 34 #include "PlatformMouseEvent.h" 35 #include "RuntimeApplicationChecks.h" 32 36 #include <wtf/CurrentTime.h> 33 37 34 38 namespace WebCore { 39 40 using namespace JSC; 35 41 36 42 Ref<MouseEvent> MouseEvent::create(const AtomicString& type, const MouseEventInit& initializer, IsTrusted isTrusted) … … 169 175 // FIXME: m_isSimulated is not set to false here. 170 176 // FIXME: m_dataTransfer is not set to 0 here. 177 } 178 179 // FIXME: We need this quirk because iAd Producer is calling this function with a relatedTarget that is not an EventTarget (rdar://problem/30640101). 180 // We should remove this quirk when possible. 181 void MouseEvent::initMouseEventQuirk(ExecState& state, ScriptExecutionContext& scriptExecutionContext, const AtomicString& type, bool canBubble, bool cancelable, DOMWindow* view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, JSValue relatedTargetValue) 182 { 183 EventTarget* relatedTarget = nullptr; 184 #if PLATFORM(MAC) 185 if (MacApplication::isIAdProducer()) { 186 // jsEventTargetCast() does not throw and will silently convert bad input to nullptr. 187 auto jsRelatedTarget = jsEventTargetCast(relatedTargetValue); 188 if (!jsRelatedTarget && !relatedTargetValue.isUndefinedOrNull()) 189 scriptExecutionContext.addConsoleMessage(MessageSource::JS, MessageLevel::Warning, ASCIILiteral("Calling initMouseEvent() with a relatedTarget that is not an EventTarget is deprecated.")); 190 relatedTarget = jsRelatedTarget ? &jsRelatedTarget->wrapped() : nullptr; 191 } else { 192 #else 193 UNUSED_PARAM(scriptExecutionContext); 194 #endif 195 // This is what the bindings generator would have produced. 196 auto throwScope = DECLARE_THROW_SCOPE(state.vm()); 197 relatedTarget = convert<IDLNullable<IDLInterface<EventTarget>>>(state, relatedTargetValue, [](ExecState& state, ThrowScope& scope) { 198 throwArgumentTypeError(state, scope, 14, "relatedTarget", "MouseEvent", "initMouseEvent", "EventTarget"); 199 }); 200 RETURN_IF_EXCEPTION(throwScope, void()); 201 #if PLATFORM(MAC) 202 } 203 #endif 204 initMouseEvent(type, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget); 171 205 } 172 206 -
branches/safari-603.1.30.0-branch/Source/WebCore/dom/MouseEvent.h
r207041 r212819 70 70 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, 71 71 unsigned short button, PassRefPtr<EventTarget> relatedTarget); 72 72 void initMouseEventQuirk(JSC::ExecState&, ScriptExecutionContext&, const AtomicString& type, bool canBubble, bool cancelable, DOMWindow*, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, JSC::JSValue relatedTarget); 73 73 // WinIE uses 1,4,2 for left/middle/right but not for click (just for mousedown/up, maybe others), 74 74 // but we will match the standard DOM. -
branches/safari-603.1.30.0-branch/Source/WebCore/dom/MouseEvent.idl
r207041 r212819 40 40 41 41 // FIXME: Using "undefined" as default parameter value is wrong. 42 void initMouseEvent(optional DOMString type = "undefined", optional boolean canBubble = false, optional boolean cancelable = false, 42 // FIXME: relatedTarget should be of type EventTarget? but we need to use any to support a quirk for iAd Producer (rdar://problem/30640101). 43 [CallWith=ScriptState&ScriptExecutionContext, ImplementedAs=initMouseEventQuirk] void initMouseEvent(optional DOMString type = "undefined", optional boolean canBubble = false, optional boolean cancelable = false, 43 44 optional DOMWindow? view = null, optional long detail = 0, 44 45 optional long screenX = 0, optional long screenY = 0, optional long clientX = 0, optional long clientY = 0, 45 46 optional boolean ctrlKey = false, optional boolean altKey = false, optional boolean shiftKey = false, optional boolean metaKey = false, 46 optional unsigned short button = 0, optional EventTarget?relatedTarget = null);47 optional unsigned short button = 0, optional any relatedTarget = null); 47 48 48 49 readonly attribute long offsetX; -
branches/safari-603.1.30.0-branch/Source/WebCore/platform/RuntimeApplicationChecks.h
r210332 r212819 54 54 WEBCORE_EXPORT bool isHRBlock(); 55 55 WEBCORE_EXPORT bool isAppStore(); 56 WEBCORE_EXPORT bool isIAdProducer(); 56 57 57 58 } // MacApplication -
branches/safari-603.1.30.0-branch/Source/WebCore/platform/RuntimeApplicationChecks.mm
r210332 r212819 149 149 } 150 150 151 bool MacApplication::isIAdProducer() 152 { 153 static bool isIAdProducer = applicationBundleIsEqualTo("com.apple.iAdProducer"); 154 return isIAdProducer; 155 } 156 151 157 bool MacApplication::isSolidStateNetworksDownloader() 152 158 {
Note:
See TracChangeset
for help on using the changeset viewer.