Skip to content

Commit

Permalink
Cherry-pick 267288@main (2ec1a7e). https://bugs.webkit.org/show_bug.c…
Browse files Browse the repository at this point in the history
…gi?id=260695

    Simplify Quirks for shouldSuppressAutocorrectionAndAutocapitalizationInHiddenEditableAreas
    https://bugs.webkit.org/show_bug.cgi?id=260695
    rdar://49864669

    Reviewed by Wenson Hsieh.

    Refactor a bit the two functions in one function.
    Also add a reference to a bug with steps to reproduce to remove later.

    * Source/WebCore/page/Quirks.cpp:
    (WebCore::Quirks::shouldSuppressAutocorrectionAndAutocapitalizationInHiddenEditableAreas const):
    (WebCore::shouldSuppressAutocorrectionAndAutocapitalizationInHiddenEditableAreasForHost): Deleted.

    Canonical link: https://commits.webkit.org/267288@main
  • Loading branch information
karlcow authored and aperezdc committed Jan 23, 2024
1 parent 54bce49 commit 8a04ee8
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions Source/WebCore/page/Quirks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,19 @@ bool Quirks::isNeverRichlyEditableForTouchBar() const
}

// docs.google.com rdar://49864669
static bool shouldSuppressAutocorrectionAndAutocapitalizationInHiddenEditableAreasForHost(StringView host)
// FIXME https://bugs.webkit.org/show_bug.cgi?id=260698
bool Quirks::shouldSuppressAutocorrectionAndAutocapitalizationInHiddenEditableAreas() const
{

#if PLATFORM(IOS_FAMILY)
return equalLettersIgnoringASCIICase(host, "docs.google.com"_s);
#else
UNUSED_PARAM(host);
return false;
if (!needsQuirks())
return false;

auto host = m_document->topDocument().url().host();
if (equalLettersIgnoringASCIICase(host, "docs.google.com"_s))
return true;
#endif
return false;
}

// weebly.com rdar://48003980
Expand Down Expand Up @@ -348,15 +353,6 @@ bool Quirks::shouldAvoidUsingIOS13ForGmail() const
#endif
}

// rdar://49864669
bool Quirks::shouldSuppressAutocorrectionAndAutocapitalizationInHiddenEditableAreas() const
{
if (!needsQuirks())
return false;

return shouldSuppressAutocorrectionAndAutocapitalizationInHiddenEditableAreasForHost(m_document->topDocument().url().host());
}

#if ENABLE(TOUCH_EVENTS)
bool Quirks::isAmazon() const
{
Expand Down

0 comments on commit 8a04ee8

Please sign in to comment.