Changeset 248080 in webkit


Ignore:
Timestamp:
Jul 31, 2019 4:01:43 PM (5 years ago)
Author:
Alan Bujtas
Message:

[ContentChangeObserver] twitch.tv video controls do not always respond to taps in fullscreen
https://bugs.webkit.org/show_bug.cgi?id=200309
<rdar://problem/52964977>

Reviewed by Simon Fraser.

Source/WebCore:

Do not consider an element visible if it is not a descendant of the active fullscreen element.

This patch fixes the cases when the user taps on a button in fullscreen mode while the non-fullscreen content is being mutated and
the ContentChangeObserver mistakenly registers it as a valid, actionable change and as a result we don't fire the click event (stay at hover).

Test: fast/events/touch/ios/content-observation/non-visible-content-change-in-fullscreen-mode.html

  • page/ios/ContentChangeObserver.cpp:

(WebCore::fullscreenElement):
(WebCore::ContentChangeObserver::isVisuallyHidden):

LayoutTests:

  • fast/events/touch/ios/content-observation/non-visible-content-change-in-fullscreen-mode-expected.txt: Added.
  • fast/events/touch/ios/content-observation/non-visible-content-change-in-fullscreen-mode.html: Added.
  • platform/ios/TestExpectations: Fullscreen API is not yet enabled on iOS.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r248078 r248080  
     12019-07-31  Zalan Bujtas  <zalan@apple.com>
     2
     3        [ContentChangeObserver] twitch.tv video controls do not always respond to taps in fullscreen
     4        https://bugs.webkit.org/show_bug.cgi?id=200309
     5        <rdar://problem/52964977>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * fast/events/touch/ios/content-observation/non-visible-content-change-in-fullscreen-mode-expected.txt: Added.
     10        * fast/events/touch/ios/content-observation/non-visible-content-change-in-fullscreen-mode.html: Added.
     11        * platform/ios/TestExpectations: Fullscreen API is not yet enabled on iOS.
     12
    1132019-07-31  Saam Barati  <sbarati@apple.com>
    214
  • trunk/LayoutTests/platform/ios/TestExpectations

    r247919 r248080  
    3838http/tests/fullscreen
    3939compositing/no-compositing-when-fulll-screen-is-present.html
     40webkit.org/b/200308 fast/events/touch/ios/content-observation/non-visible-content-change-in-fullscreen-mode.html [ Skip ]
    4041
    4142# WebGPU is not enabled on iOS Simulator.
  • trunk/Source/WebCore/ChangeLog

    r248079 r248080  
     12019-07-31  Zalan Bujtas  <zalan@apple.com>
     2
     3        [ContentChangeObserver] twitch.tv video controls do not always respond to taps in fullscreen
     4        https://bugs.webkit.org/show_bug.cgi?id=200309
     5        <rdar://problem/52964977>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Do not consider an element visible if it is not a descendant of the active fullscreen element.
     10
     11        This patch fixes the cases when the user taps on a button in fullscreen mode while the non-fullscreen content is being mutated and
     12        the ContentChangeObserver mistakenly registers it as a valid, actionable change and as a result we don't fire the click event (stay at hover).
     13
     14        Test: fast/events/touch/ios/content-observation/non-visible-content-change-in-fullscreen-mode.html
     15
     16        * page/ios/ContentChangeObserver.cpp:
     17        (WebCore::fullscreenElement):
     18        (WebCore::ContentChangeObserver::isVisuallyHidden):
     19
    1202019-07-31  Saam Barati  <sbarati@apple.com>
    221
  • trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp

    r247926 r248080  
    3131#include "DOMTimer.h"
    3232#include "Document.h"
     33#include "FullscreenManager.h"
    3334#include "HTMLIFrameElement.h"
    3435#include "HTMLImageElement.h"
     
    4344static const Seconds maximumDelayForTimers { 400_ms };
    4445static const Seconds maximumDelayForTransitions { 300_ms };
     46
     47#if ENABLE(FULLSCREEN_API)
     48static bool isHiddenBehindFullscreenElement(const Node& descendantCandidate)
     49{
     50    // Fullscreen status is propagated on the ancestor document chain all the way to the top document.
     51    auto& document = descendantCandidate.document();
     52    auto* topMostFullScreenElement = document.topDocument().fullscreenManager().fullscreenElement();
     53    if (!topMostFullScreenElement)
     54        return false;
     55
     56    // If the document where the node lives does not have an active fullscreen element, it is a sibling/nephew document -> not a descendant.
     57    auto* fullscreenElement = document.fullscreenManager().fullscreenElement();
     58    if (!fullscreenElement)
     59        return true;
     60    return !descendantCandidate.isDescendantOf(*fullscreenElement);
     61}
     62#endif
    4563
    4664bool ContentChangeObserver::isVisuallyHidden(const Node& node)
     
    89107            return true;
    90108    }
     109
     110#if ENABLE(FULLSCREEN_API)
     111    if (isHiddenBehindFullscreenElement(node))
     112        return true;
     113#endif
    91114    return false;
    92115}
Note: See TracChangeset for help on using the changeset viewer.