Changeset 206916 in webkit


Ignore:
Timestamp:
Oct 7, 2016 9:41:48 AM (8 years ago)
Author:
Alan Bujtas
Message:

https://vuldb.com/?cvssv3.2012 takes long time to load.
https://bugs.webkit.org/show_bug.cgi?id=162994
<rdar://problem/28593746>

Reviewed by Darin Adler.

Source/WebCore:

Stop visiting cousins when we hit the style sharing search threshold.

In addition to mistakenly ignoring the threshold at SharingResolver::findSibling(), we
continued on searching for cousin elements.

Test: fast/selectors/slow-style-sharing-with-long-cousin-list.html

  • style/StyleSharingResolver.cpp:

(WebCore::Style::SharingResolver::resolve):
(WebCore::Style::SharingResolver::findSibling):
(WebCore::Style::SharingResolver::locateCousinList):

LayoutTests:

It takes ~100 seconds to run this test case without the fix (300ms with the fix).
Surely it will timeout if it gets regressed.

  • fast/selectors/slow-style-sharing-with-long-cousin-list-expected.txt: Added.
  • fast/selectors/slow-style-sharing-with-long-cousin-list.html: Added.
  • platform/mac/TestExpectations: Skip perf test in debug.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r206914 r206916  
     12016-10-07  Zalan Bujtas  <zalan@apple.com>
     2
     3        https://vuldb.com/?cvssv3.2012 takes long time to load.
     4        https://bugs.webkit.org/show_bug.cgi?id=162994
     5        <rdar://problem/28593746>
     6
     7        Reviewed by Darin Adler.
     8
     9        It takes ~100 seconds to run this test case without the fix (300ms with the fix).
     10        Surely it will timeout if it gets regressed.
     11
     12        * fast/selectors/slow-style-sharing-with-long-cousin-list-expected.txt: Added.
     13        * fast/selectors/slow-style-sharing-with-long-cousin-list.html: Added.
     14        * platform/mac/TestExpectations: Skip perf test in debug.
     15
    1162016-10-07  Ryan Haddad  <ryanhaddad@apple.com>
    217
  • trunk/LayoutTests/platform/mac/TestExpectations

    r206868 r206916  
    14681468fast/text/variations/order.html [ Crash ]
    14691469animations/font-variation-settings-order.html [ Crash ]
     1470
     1471[ Debug ] fast/selectors/slow-style-sharing-with-long-cousin-list.html [ Skip ]
  • trunk/Source/WebCore/ChangeLog

    r206912 r206916  
     12016-10-07  Zalan Bujtas  <zalan@apple.com>
     2
     3        https://vuldb.com/?cvssv3.2012 takes long time to load.
     4        https://bugs.webkit.org/show_bug.cgi?id=162994
     5        <rdar://problem/28593746>
     6
     7        Reviewed by Darin Adler.
     8
     9        Stop visiting cousins when we hit the style sharing search threshold.
     10
     11        In addition to mistakenly ignoring the threshold at SharingResolver::findSibling(), we
     12        continued on searching for cousin elements.
     13
     14        Test: fast/selectors/slow-style-sharing-with-long-cousin-list.html
     15
     16        * style/StyleSharingResolver.cpp:
     17        (WebCore::Style::SharingResolver::resolve):
     18        (WebCore::Style::SharingResolver::findSibling):
     19        (WebCore::Style::SharingResolver::locateCousinList):
     20
    1212016-10-07  Romain Bellessort  <romain.bellessort@crf.canon.fr>
    222
  • trunk/Source/WebCore/style/StyleSharingResolver.cpp

    r204220 r206916  
    116116        if (shareElement)
    117117            break;
     118        if (count >= cStyleSearchThreshold)
     119            break;
    118120        cousinList = locateCousinList(cousinList->parentElement());
    119121    }
     
    145147        if (canShareStyleWithElement(context, downcast<StyledElement>(*node)))
    146148            break;
    147         if (count++ == cStyleSearchThreshold)
     149        if (count++ >= cStyleSearchThreshold)
    148150            return nullptr;
    149151    }
     
    153155Node* SharingResolver::locateCousinList(const Element* parent) const
    154156{
    155     const unsigned maximumSearchCount = 10;
    156     for (unsigned count = 0; count < maximumSearchCount; ++count) {
     157    for (unsigned count = 0; count < cStyleSearchThreshold; ++count) {
    157158        auto* elementSharingParentStyle = m_elementsSharingStyle.get(parent);
    158159        if (!elementSharingParentStyle)
Note: See TracChangeset for help on using the changeset viewer.