Changeset 247621 in webkit
- Timestamp:
- Jul 18, 2019 2:56:36 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r247620 r247621 1 2019-07-18 Antoine Quint <graouts@apple.com> 2 3 Ensure Quirks::shouldDispatchSimulatedMouseEvents() works for all Google Maps and Amazon domains 4 https://bugs.webkit.org/show_bug.cgi?id=199904 5 <rdar://problem/53250104> 6 7 Reviewed by Dean Jackson. 8 9 Use topPrivatelyControlledDomain() to determine whether the URL is a Google or Amazon domain so as to apply 10 Google Maps and Amazon quirks to all the various domain names used. 11 12 * page/Quirks.cpp: 13 (WebCore::Quirks::isAmazon const): 14 (WebCore::Quirks::isGoogleMaps const): 15 (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const): 16 (WebCore::Quirks::simulatedMouseEventTypeForTarget const): 17 * page/Quirks.h: 18 1 19 2019-07-18 Per Arne Vollan <pvollan@apple.com> 2 20 -
trunk/Source/WebCore/page/Quirks.cpp
r247572 r247621 231 231 bool Quirks::isAmazon() const 232 232 { 233 return topPrivatelyControlledDomain(m_document->topDocument().url().host().toString()).startsWith("amazon."); 234 } 235 236 bool Quirks::isGoogleMaps() const 237 { 238 auto& url = m_document->topDocument().url(); 239 return topPrivatelyControlledDomain(url.host().toString()).startsWith("google.") && url.path().startsWithIgnoringASCIICase("/maps/"); 240 } 241 242 bool Quirks::shouldDispatchSimulatedMouseEvents() const 243 { 244 if (RuntimeEnabledFeatures::sharedFeatures().mouseEventsSimulationEnabled()) 245 return true; 246 247 if (!needsQuirks()) 248 return false; 249 250 auto* loader = m_document->loader(); 251 if (!loader || loader->simulatedMouseEventsDispatchPolicy() != SimulatedMouseEventsDispatchPolicy::Allow) 252 return false; 253 254 if (isAmazon()) 255 return true; 256 if (isGoogleMaps()) 257 return true; 258 233 259 auto& url = m_document->topDocument().url(); 234 260 auto host = url.host(); 235 return equalLettersIgnoringASCIICase(host, "amazon.com") || host.endsWithIgnoringASCIICase(".amazon.com");236 }237 238 bool Quirks::shouldDispatchSimulatedMouseEvents() const239 {240 if (RuntimeEnabledFeatures::sharedFeatures().mouseEventsSimulationEnabled())241 return true;242 243 if (!needsQuirks())244 return false;245 246 auto* loader = m_document->loader();247 if (!loader || loader->simulatedMouseEventsDispatchPolicy() != SimulatedMouseEventsDispatchPolicy::Allow)248 return false;249 250 if (isAmazon())251 return true;252 253 auto& url = m_document->topDocument().url();254 auto host = url.host();255 261 256 262 if (equalLettersIgnoringASCIICase(host, "wix.com") || host.endsWithIgnoringASCIICase(".wix.com")) … … 267 273 return true; 268 274 if (equalLettersIgnoringASCIICase(host, "flipkart.com") || host.endsWithIgnoringASCIICase(".flipkart.com")) 269 return true;270 if (equalLettersIgnoringASCIICase(host, "www.google.com") && url.path().startsWithIgnoringASCIICase("/maps/"))271 275 return true; 272 276 if (equalLettersIgnoringASCIICase(host, "trailers.apple.com")) … … 304 308 305 309 // On Google Maps, we want to limit simulated mouse events to dragging the little man that allows entering into Street View. 306 auto& url = m_document->topDocument().url(); 307 auto host = url.host(); 308 if (equalLettersIgnoringASCIICase(host, "www.google.com") && url.path().startsWithIgnoringASCIICase("/maps/")) { 310 if (isGoogleMaps()) { 309 311 if (is<Element>(target) && downcast<Element>(target)->getAttribute("class") == "widget-expand-button-pegman-icon") 310 312 return Event::IsCancelable::Yes; … … 312 314 } 313 315 316 auto host = m_document->topDocument().url().host(); 314 317 if (equalLettersIgnoringASCIICase(host, "desmos.com") || host.endsWithIgnoringASCIICase(".desmos.com")) 315 318 return Event::IsCancelable::No; -
trunk/Source/WebCore/page/Quirks.h
r247568 r247621 74 74 #if ENABLE(TOUCH_EVENTS) 75 75 bool isAmazon() const; 76 bool isGoogleMaps() const; 76 77 #endif 77 78
Note: See TracChangeset
for help on using the changeset viewer.