Skip to content

Commit

Permalink
Remove Quirk shouldDisableContentChangeObserver() for YouTube.com
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=264234
rdar://117975999

Reviewed by Tim Horton.

This removes the Quirk which had been set for YouTube in the context
of the iPad Pro, where people could not click on thumbnails on
search and results page.
https://bugs.webkit.org/show_bug.cgi?id=249740
it was then later extended to cover the full domain of YouTube.
https://bugs.webkit.org/show_bug.cgi?id=263789
YouTube team fixed the issue on their side. It removes the need for
this specific Quirk.

We probably want to take another look at
Quirks::shouldDisableContentChangeObserverTouchEventAdjustment()
and if it is still needed, but to minimize the effect of this fix,
it will be handled in another PR if necessary.

* Source/WebCore/page/Quirks.cpp:
(WebCore::Quirks::shouldDisableContentChangeObserver const): Deleted.
* Source/WebCore/page/Quirks.h:
* Source/WebCore/page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::isContentChangeObserverEnabled):
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completeSyntheticClick):

Canonical link: https://commits.webkit.org/270256@main
  • Loading branch information
karlcow committed Nov 6, 2023
1 parent 46c79e6 commit 995ab8e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
10 changes: 0 additions & 10 deletions Source/WebCore/page/Quirks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,6 @@ bool Quirks::hasBrokenEncryptedMediaAPISupportQuirk() const
#endif
}

// youtube.com https://bugs.webkit.org/show_bug.cgi?id=263789
// and https://bugs.webkit.org/show_bug.cgi?id=249740
bool Quirks::shouldDisableContentChangeObserver() const
{
if (!needsQuirks())
return false;

return isDomain("youtube.com"_s);
}

// youtube.com https://bugs.webkit.org/show_bug.cgi?id=200609
bool Quirks::shouldDisableContentChangeObserverTouchEventAdjustment() const
{
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/page/Quirks.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class Quirks {
bool shouldExposeShowModalDialog() const;
bool shouldNavigatorPluginsBeEmpty() const;

WEBCORE_EXPORT bool shouldDisableContentChangeObserver() const;
WEBCORE_EXPORT bool shouldDispatchSyntheticMouseEventsWhenModifyingSelection() const;
WEBCORE_EXPORT bool shouldSuppressAutocorrectionAndAutocapitalizationInHiddenEditableAreas() const;
WEBCORE_EXPORT bool isTouchBarUpdateSupressedForHiddenContentEditable() const;
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/page/ios/ContentChangeObserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static bool isHiddenBehindFullscreenElement(const Node& descendantCandidate)

bool ContentChangeObserver::isContentChangeObserverEnabled()
{
return m_document.settings().contentChangeObserverEnabled() && !m_document.quirks().shouldDisableContentChangeObserver();
return m_document.settings().contentChangeObserverEnabled();
}

bool ContentChangeObserver::isVisuallyHidden(const Node& node)
Expand Down
4 changes: 2 additions & 2 deletions Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ static void dispatchSyntheticMouseMove(LocalFrame& mainFrame, const WebCore::Flo
auto& respondingDocument = nodeRespondingToClick.document();
m_hasHandledSyntheticClick = true;

if (!respondingDocument.settings().contentChangeObserverEnabled() || respondingDocument.quirks().shouldDisableContentChangeObserver()) {
if (!respondingDocument.settings().contentChangeObserverEnabled()) {
completeSyntheticClick(nodeRespondingToClick, location, modifiers, WebCore::SyntheticClickType::OneFingerTap, pointerId);
return;
}
Expand Down Expand Up @@ -915,7 +915,7 @@ static void dispatchSyntheticMouseMove(LocalFrame& mainFrame, const WebCore::Flo
RefPtr newFocusedFrame = CheckedRef(m_page->focusController())->focusedLocalFrame();
RefPtr<Element> newFocusedElement = newFocusedFrame ? newFocusedFrame->document()->focusedElement() : nullptr;

if (nodeRespondingToClick.document().settings().contentChangeObserverEnabled() && !nodeRespondingToClick.document().quirks().shouldDisableContentChangeObserver()) {
if (nodeRespondingToClick.document().settings().contentChangeObserverEnabled()) {
auto& document = nodeRespondingToClick.document();
// Dispatch mouseOut to dismiss tooltip content when tapping on the control bar buttons (cc, settings).
if (document.quirks().needsYouTubeMouseOutQuirk()) {
Expand Down

0 comments on commit 995ab8e

Please sign in to comment.