Changeset 269846 in webkit


Ignore:
Timestamp:
Nov 16, 2020 3:28:40 AM (3 years ago)
Author:
Devin Rousso
Message:

[iPad] nhl.com cannot select new video to play while video is playing with desktop UA
https://bugs.webkit.org/show_bug.cgi?id=218868
<rdar://problem/67823088>

Reviewed by Antoine Quint.

The desktop "version" of this site uses custom media controls that don't work well on iOS
because they rely on mouse events (which is why it was quirked in r255592). The mobile
"version" uses the default/native media controls, so there is no issue.

Currently, when tapping on another video with a desktop UA, the site uses its touch event
handlers for mouse events. These handlers call Event.prototype.preventDefault if the event
is not a touch event, meaning that "click" is not fired. This prevents new videos from
being played.

Rather than limit the quirk based on some DOM state (which is fragile if the site changes),
just have the entire site default to a mobile UA.

Source/WebCore:

  • page/Quirks.cpp:

(WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):

Source/WebKit:

  • UIProcess/ios/WebPageProxyIOS.mm:

(WebKit::desktopClassBrowsingRecommendedForRequest):

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r269841 r269846  
     12020-11-16  Devin Rousso  <drousso@apple.com>
     2
     3        [iPad] nhl.com cannot select new video to play while video is playing with desktop UA
     4        https://bugs.webkit.org/show_bug.cgi?id=218868
     5        <rdar://problem/67823088>
     6
     7        Reviewed by Antoine Quint.
     8
     9        The desktop "version" of this site uses custom media controls that don't work well on iOS
     10        because they rely on mouse events (which is why it was quirked in r255592). The mobile
     11        "version" uses the default/native media controls, so there is no issue.
     12
     13        Currently, when tapping on another video with a desktop UA, the site uses its touch event
     14        handlers for mouse events. These handlers call `Event.prototype.preventDefault` if the event
     15        is not a touch event, meaning that `"click"` is not fired. This prevents new videos from
     16        being played.
     17
     18        Rather than limit the quirk based on some DOM state (which is fragile if the site changes),
     19        just have the entire site default to a mobile UA.
     20
     21        * page/Quirks.cpp:
     22        (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
     23
    1242020-11-16  Zan Dobersek  <zdobersek@igalia.com>
    225
  • trunk/Source/WebCore/page/Quirks.cpp

    r269807 r269846  
    377377        if (host == "naver.com")
    378378            return true;
    379         if (host == "nhl.com" || (host.endsWith(".nhl.com") && !host.startsWith("account.")))
    380             return true;
    381379        if (host == "nba.com" || host.endsWith(".nba.com"))
    382380            return true;
  • trunk/Source/WebKit/ChangeLog

    r269842 r269846  
     12020-11-16  Devin Rousso  <drousso@apple.com>
     2
     3        [iPad] nhl.com cannot select new video to play while video is playing with desktop UA
     4        https://bugs.webkit.org/show_bug.cgi?id=218868
     5        <rdar://problem/67823088>
     6
     7        Reviewed by Antoine Quint.
     8
     9        The desktop "version" of this site uses custom media controls that don't work well on iOS
     10        because they rely on mouse events (which is why it was quirked in r255592). The mobile
     11        "version" uses the default/native media controls, so there is no issue.
     12
     13        Currently, when tapping on another video with a desktop UA, the site uses its touch event
     14        handlers for mouse events. These handlers call `Event.prototype.preventDefault` if the event
     15        is not a touch event, meaning that `"click"` is not fired. This prevents new videos from
     16        being played.
     17
     18        Rather than limit the quirk based on some DOM state (which is fragile if the site changes),
     19        just have the entire site default to a mobile UA.
     20
     21        * UIProcess/ios/WebPageProxyIOS.mm:
     22        (WebKit::desktopClassBrowsingRecommendedForRequest):
     23
    1242020-11-16  Zan Dobersek  <zdobersek@igalia.com>
    225
  • trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm

    r268635 r269846  
    14191419    }
    14201420
     1421    if (equalLettersIgnoringASCIICase(host, "nhl.com") || host.endsWithIgnoringASCIICase(".nhl.com"))
     1422        return RecommendDesktopClassBrowsingForRequest::No;
     1423
    14211424    // FIXME: Remove this quirk when <rdar://problem/59480381> is complete.
    14221425    if (equalLettersIgnoringASCIICase(host, "fidelity.com") || host.endsWithIgnoringASCIICase(".fidelity.com"))
Note: See TracChangeset for help on using the changeset viewer.