Changeset 260435 in webkit


Ignore:
Timestamp:
Apr 21, 2020 10:14:08 AM (4 years ago)
Author:
Chris Dumez
Message:

REGRESSION (r256808): “A problem repeatedly occurred” when attempting to load https://bungalow.com/listings/bay-area
https://bugs.webkit.org/show_bug.cgi?id=210801
<rdar://problem/61658940>

Reviewed by Antti Koivisto.

Even though the page uses the 'async' attribute on the mapbox-gl.js script, deferring the execution of this
script gets the page into a bad state, causing it to use a lot of CPU & memory until the process crashes.
Since we don't have any other evidence of breakage from r256808 yet and since r256808 was a massive PLT
progression, I am opting to add a quirk to disable the async script optimization on bungalow.com for now.

  • dom/Document.cpp:

(WebCore::Document::shouldDeferAsynchronousScriptsUntilParsingFinishes const):

  • page/Quirks.cpp:

(WebCore::Quirks::shouldBypassAsyncScriptDeferring const):

  • page/Quirks.h:
  • platform/RegistrableDomain.h:

(WebCore::RegistrableDomain::operator== const):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r260432 r260435  
     12020-04-21  Chris Dumez  <cdumez@apple.com>
     2
     3        REGRESSION (r256808): “A problem repeatedly occurred” when attempting to load https://bungalow.com/listings/bay-area
     4        https://bugs.webkit.org/show_bug.cgi?id=210801
     5        <rdar://problem/61658940>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Even though the page uses the 'async' attribute on the mapbox-gl.js script, deferring the execution of this
     10        script gets the page into a bad state, causing it to use a lot of CPU & memory until the process crashes.
     11        Since we don't have any other evidence of breakage from r256808 yet and since r256808 was a massive PLT
     12        progression, I am opting to add a quirk to disable the async script optimization on bungalow.com for now.
     13
     14        * dom/Document.cpp:
     15        (WebCore::Document::shouldDeferAsynchronousScriptsUntilParsingFinishes const):
     16        * page/Quirks.cpp:
     17        (WebCore::Quirks::shouldBypassAsyncScriptDeferring const):
     18        * page/Quirks.h:
     19        * platform/RegistrableDomain.h:
     20        (WebCore::RegistrableDomain::operator== const):
     21
    1222020-04-16  Sergio Villar Senin  <svillar@igalia.com>
    223
  • trunk/Source/WebCore/dom/Document.cpp

    r260142 r260435  
    55585558        return false;
    55595559
     5560    if (quirks().shouldBypassAsyncScriptDeferring())
     5561        return false;
     5562
    55605563    return parsing() && !(view() && view()->hasEverPainted());
    55615564}
  • trunk/Source/WebCore/page/Quirks.cpp

    r260114 r260435  
    679679}
    680680
     681bool Quirks::shouldBypassAsyncScriptDeferring() const
     682{
     683    if (!needsQuirks())
     684        return false;
     685
     686    if (!m_shouldBypassAsyncScriptDeferring) {
     687        auto domain = RegistrableDomain { m_document->topDocument().url() };
     688        // Deferring 'mapbox-gl.js' script on bungalow.com causes the script to get in a bad state (rdar://problem/61658940).
     689        m_shouldBypassAsyncScriptDeferring = (domain == "bungalow.com");
     690    }
     691    return *m_shouldBypassAsyncScriptDeferring;
     692}
     693
    681694bool Quirks::shouldMakeEventListenerPassive(const EventTarget& eventTarget, const AtomString& eventType, const EventListener& eventListener)
    682695{
  • trunk/Source/WebCore/page/Quirks.h

    r260114 r260435  
    8989
    9090    bool shouldBypassBackForwardCache() const;
     91    bool shouldBypassAsyncScriptDeferring() const;
    9192
    9293    static bool shouldMakeEventListenerPassive(const EventTarget&, const AtomString& eventType, const EventListener&);
     
    122123#endif
    123124    mutable Optional<bool> m_needsCanPlayAfterSeekedQuirk;
     125    mutable Optional<bool> m_shouldBypassAsyncScriptDeferring;
    124126};
    125127
  • trunk/Source/WebCore/platform/RegistrableDomain.h

    r256583 r260435  
    5555    bool operator!=(const RegistrableDomain& other) const { return m_registrableDomain != other.m_registrableDomain; }
    5656    bool operator==(const RegistrableDomain& other) const { return m_registrableDomain == other.m_registrableDomain; }
     57    bool operator==(const char* other) const { return m_registrableDomain == other; }
    5758
    5859    bool matches(const URL& url) const
Note: See TracChangeset for help on using the changeset viewer.