⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 246205 in webkit


Ignore:
Timestamp:
Jun 7, 2019, 10:11:01 AM (7 years ago)
Author:
graouts@webkit.org
Message:

Limit simulated mouse events on Google Maps to entering Street View
https://bugs.webkit.org/show_bug.cgi?id=198657
<rdar://problem/51345064>

Reviewed by Brent Fulgham.

  • page/Quirks.cpp:

(WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
(WebCore::Quirks::shouldDispatchSimulatedMouseEventsOnTarget const):

  • page/Quirks.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r246200 r246205  
     12019-06-07  Antoine Quint  <graouts@apple.com>
     2
     3        Limit simulated mouse events on Google Maps to entering Street View
     4        https://bugs.webkit.org/show_bug.cgi?id=198657
     5        <rdar://problem/51345064>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        * page/Quirks.cpp:
     10        (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
     11        (WebCore::Quirks::shouldDispatchSimulatedMouseEventsOnTarget const):
     12        * page/Quirks.h:
     13
    1142019-06-07  Joonghun Park  <jh718.park@samsung.com>
    215
  • trunk/Source/WebCore/page/Quirks.cpp

    r246118 r246205  
    283283}
    284284
     285#if PLATFORM(IOS_FAMILY)
    285286bool Quirks::shouldDispatchSimulatedMouseEvents() const
    286287{
    287 #if PLATFORM(IOS_FAMILY)
    288288    if (!needsQuirks())
    289289        return false;
     
    318318    if (equalLettersIgnoringASCIICase(host, "naver.com") || host.endsWithIgnoringASCIICase(".naver.com"))
    319319        return true;
    320 #endif
    321     return false;
    322 }
     320    return false;
     321}
     322
     323bool Quirks::shouldDispatchSimulatedMouseEventsOnTarget(EventTarget* target) const
     324{
     325    if (!needsQuirks() || !shouldDispatchSimulatedMouseEvents())
     326        return false;
     327
     328    // On Google Maps, we want to limit simulated mouse events to dragging the little man that allows entering into Street View.
     329    auto& url = m_document->topDocument().url();
     330    auto host = url.host();
     331    if (equalLettersIgnoringASCIICase(host, "www.google.com") && url.path().startsWithIgnoringASCIICase("/maps/"))
     332        return is<Element>(target) && downcast<Element>(target)->getAttribute("class") == "widget-expand-button-pegman-icon";
     333    return true;
     334}
     335#endif
    323336
    324337bool Quirks::shouldDisablePointerEventsQuirk() const
  • trunk/Source/WebCore/page/Quirks.h

    r245301 r246205  
    5050    bool hasBrokenEncryptedMediaAPISupportQuirk() const;
    5151    bool hasWebSQLSupportQuirk() const;
     52#if PLATFORM(IOS_FAMILY)
    5253    bool shouldDispatchSimulatedMouseEvents() const;
     54    bool shouldDispatchSimulatedMouseEventsOnTarget(EventTarget*) const;
     55#endif
    5356    bool shouldDisablePointerEventsQuirk() const;
    5457    bool needsInputModeNoneImplicitly(const HTMLElement&) const;
Note: See TracChangeset for help on using the changeset viewer.