Skip to content

Commit

Permalink
Remove shouldDisableContentChangeObserverTouchEventAdjustment on Yout…
Browse files Browse the repository at this point in the history
…ube.com

https://bugs.webkit.org/show_bug.cgi?id=255275
rdar://107484040

Reviewed by Tim Horton.

After disabling the Site Specific Quirks on iOS, and testing the touch
on Autoplay feature everything is working the same in both scenarios.
The quirk is not necessary anymore. This also removes
allowContentChangeObserverQuirk associated to this quirk.

It was enabled on https://webkit.org/b/200609
This is also a followup on https://webkit.org/b/264234

* Source/WebCore/page/Quirks.cpp:
(WebCore::Quirks::shouldDisableContentChangeObserverTouchEventAdjustment const): Deleted.
* Source/WebCore/page/Quirks.h:
* Source/WebCore/page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::touchEventDidStart):
* Source/WebCore/loader/DocumentLoader.h:
(WebCore::DocumentLoader::setAllowContentChangeObserverQuirk): Deleted.
(WebCore::DocumentLoader::allowContentChangeObserverQuirk const): Deleted.
* Source/WebKit/Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* Source/WebKit/Shared/WebsitePoliciesData.h:
* Source/WebKit/Shared/WebsitePoliciesData.serialization.in:
* Source/WebKit/UIProcess/API/APIWebsitePolicies.h:
* Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):

Canonical link: https://commits.webkit.org/278481@main
  • Loading branch information
karlcow committed May 7, 2024
1 parent ba6e612 commit de000c7
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 27 deletions.
4 changes: 0 additions & 4 deletions Source/WebCore/loader/DocumentLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,6 @@ class DocumentLoader

WEBCORE_EXPORT void applyPoliciesToSettings();

void setAllowContentChangeObserverQuirk(bool allow) { m_allowContentChangeObserverQuirk = allow; }
bool allowContentChangeObserverQuirk() const { return m_allowContentChangeObserverQuirk; }

void setAdvancedPrivacyProtections(OptionSet<AdvancedPrivacyProtections> policy) { m_advancedPrivacyProtections = policy; }
OptionSet<AdvancedPrivacyProtections> advancedPrivacyProtections() const { return m_advancedPrivacyProtections; }

Expand Down Expand Up @@ -733,7 +730,6 @@ class DocumentLoader
ColorSchemePreference m_colorSchemePreference { ColorSchemePreference::NoPreference };
ShouldOpenExternalURLsPolicy m_shouldOpenExternalURLsPolicy { ShouldOpenExternalURLsPolicy::ShouldNotAllow };

bool m_allowContentChangeObserverQuirk { false };
bool m_idempotentModeAutosizingOnlyHonorsPercentages { false };

bool m_isRequestFromClientOrUserInput { false };
Expand Down
14 changes: 0 additions & 14 deletions Source/WebCore/page/Quirks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,20 +221,6 @@ bool Quirks::hasBrokenEncryptedMediaAPISupportQuirk() const
#endif
}

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

auto& topDocument = m_document->topDocument();
auto* topDocumentLoader = topDocument.loader();
if (!topDocumentLoader || !topDocumentLoader->allowContentChangeObserverQuirk())
return false;

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

// covid.cdc.gov https://bugs.webkit.org/show_bug.cgi?id=223620
bool Quirks::shouldTooltipPreventFromProceedingWithClick(const Element& element) 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 @@ -77,7 +77,6 @@ class Quirks {
#endif
bool shouldDisablePointerEventsQuirk() const;
bool needsDeferKeyDownAndKeyPressTimersUntilNextEditingCommand() const;
bool shouldDisableContentChangeObserverTouchEventAdjustment() const;
bool shouldTooltipPreventFromProceedingWithClick(const Element&) const;
bool shouldHideSearchFieldResultsButton() const;
bool shouldExposeShowModalDialog() 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 @@ -488,7 +488,7 @@ void ContentChangeObserver::elementDidBecomeHidden(const Element& element)
void ContentChangeObserver::touchEventDidStart(PlatformEvent::Type eventType)
{
#if ENABLE(TOUCH_EVENTS)
if (!isContentChangeObserverEnabled() || m_document.quirks().shouldDisableContentChangeObserverTouchEventAdjustment())
if (!isContentChangeObserverEnabled())
return;
if (eventType != PlatformEvent::Type::TouchStart)
return;
Expand Down
1 change: 0 additions & 1 deletion Source/WebKit/Shared/WebsitePoliciesData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ void WebsitePoliciesData::applyToDocumentLoader(WebsitePoliciesData&& websitePol

documentLoader.setModalContainerObservationPolicy(websitePolicies.modalContainerObservationPolicy);
documentLoader.setColorSchemePreference(websitePolicies.colorSchemePreference);
documentLoader.setAllowContentChangeObserverQuirk(websitePolicies.allowContentChangeObserverQuirk);
documentLoader.setAdvancedPrivacyProtections(websitePolicies.advancedPrivacyProtections);
documentLoader.setOriginatorAdvancedPrivacyProtections(websitePolicies.advancedPrivacyProtections);
documentLoader.setIdempotentModeAutosizingOnlyHonorsPercentages(websitePolicies.idempotentModeAutosizingOnlyHonorsPercentages);
Expand Down
1 change: 0 additions & 1 deletion Source/WebKit/Shared/WebsitePoliciesData.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ struct WebsitePoliciesData {
#if ENABLE(DEVICE_ORIENTATION)
WebCore::DeviceOrientationOrMotionPermissionState deviceOrientationAndMotionAccessState { WebCore::DeviceOrientationOrMotionPermissionState::Prompt };
#endif
bool allowContentChangeObserverQuirk { false };
bool idempotentModeAutosizingOnlyHonorsPercentages { false };
bool allowPrivacyProxy { true };
bool allowSiteSpecificQuirksToOverrideContentMode { false };
Expand Down
1 change: 0 additions & 1 deletion Source/WebKit/Shared/WebsitePoliciesData.serialization.in
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ struct WebKit::WebsitePoliciesData {
#if ENABLE(DEVICE_ORIENTATION)
WebCore::DeviceOrientationOrMotionPermissionState deviceOrientationAndMotionAccessState;
#endif
bool allowContentChangeObserverQuirk;
bool idempotentModeAutosizingOnlyHonorsPercentages;
bool allowPrivacyProxy;
bool allowSiteSpecificQuirksToOverrideContentMode;
Expand Down
3 changes: 0 additions & 3 deletions Source/WebKit/UIProcess/API/APIWebsitePolicies.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ class WebsitePolicies final : public API::ObjectImpl<API::Object::Type::WebsiteP
WTF::String applicationNameForDesktopUserAgent() const { return m_data.applicationNameForDesktopUserAgent; }
void setApplicationNameForDesktopUserAgent(const WTF::String& applicationName) { m_data.applicationNameForDesktopUserAgent = applicationName; }

bool allowContentChangeObserverQuirk() const { return m_data.allowContentChangeObserverQuirk; }
void setAllowContentChangeObserverQuirk(bool allow) { m_data.allowContentChangeObserverQuirk = allow; }

WebCore::AllowsContentJavaScript allowsContentJavaScript() const { return m_data.allowsContentJavaScript; }
void setAllowsContentJavaScript(WebCore::AllowsContentJavaScript allows) { m_data.allowsContentJavaScript = allows; }

Expand Down
1 change: 0 additions & 1 deletion Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,6 @@ static RecommendDesktopClassBrowsingForRequest desktopClassBrowsingRecommendedFo
m_preferFasterClickOverDoubleTap = false;

if (!useDesktopBrowsingMode) {
policies.setAllowContentChangeObserverQuirk(true);
policies.setIdempotentModeAutosizingOnlyHonorsPercentages(true);
return WebContentMode::Mobile;
}
Expand Down

0 comments on commit de000c7

Please sign in to comment.