Title: [206916] trunk
- Revision
- 206916
- Author
- [email protected]
- Date
- 2016-10-07 09:41:48 -0700 (Fri, 07 Oct 2016)
Log 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.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (206915 => 206916)
--- trunk/LayoutTests/ChangeLog 2016-10-07 16:39:21 UTC (rev 206915)
+++ trunk/LayoutTests/ChangeLog 2016-10-07 16:41:48 UTC (rev 206916)
@@ -1,3 +1,18 @@
+2016-10-07 Zalan Bujtas <[email protected]>
+
+ 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.
+
+ 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.
+
2016-10-07 Ryan Haddad <[email protected]>
Marking contentextensions tests as flaky on mac-wk2.
Added: trunk/LayoutTests/fast/selectors/slow-style-sharing-with-long-cousin-list-expected.txt (0 => 206916)
--- trunk/LayoutTests/fast/selectors/slow-style-sharing-with-long-cousin-list-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/selectors/slow-style-sharing-with-long-cousin-list-expected.txt 2016-10-07 16:41:48 UTC (rev 206916)
@@ -0,0 +1 @@
+PASSED.
Added: trunk/LayoutTests/fast/selectors/slow-style-sharing-with-long-cousin-list.html (0 => 206916)
--- trunk/LayoutTests/fast/selectors/slow-style-sharing-with-long-cousin-list.html (rev 0)
+++ trunk/LayoutTests/fast/selectors/slow-style-sharing-with-long-cousin-list.html 2016-10-07 16:41:48 UTC (rev 206916)
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This test will timeout if we regress style sharing with long cousin list.</title>
+<style>
+td:nth-child(2) {
+ color: transparent;
+}
+</style>
+</head>
+<body>
+<div id=container></div>
+</body>
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+var table = document.createElement("table");
+for (var i = 0; i < 30000; ++i) {
+ var row = document.createElement("tr");
+ row.appendChild(document.createElement("td"));
+ row.appendChild(document.createElement("td"));
+ table.appendChild(row);
+}
+document.body.appendChild(table);
+document.body.offsetHeight;
+document.body.innerText = "PASSED.";
+</script>
+</html>
\ No newline at end of file
Modified: trunk/LayoutTests/platform/mac/TestExpectations (206915 => 206916)
--- trunk/LayoutTests/platform/mac/TestExpectations 2016-10-07 16:39:21 UTC (rev 206915)
+++ trunk/LayoutTests/platform/mac/TestExpectations 2016-10-07 16:41:48 UTC (rev 206916)
@@ -1467,3 +1467,5 @@
# rdar://problem/28586837
fast/text/variations/order.html [ Crash ]
animations/font-variation-settings-order.html [ Crash ]
+
+[ Debug ] fast/selectors/slow-style-sharing-with-long-cousin-list.html [ Skip ]
Modified: trunk/Source/WebCore/ChangeLog (206915 => 206916)
--- trunk/Source/WebCore/ChangeLog 2016-10-07 16:39:21 UTC (rev 206915)
+++ trunk/Source/WebCore/ChangeLog 2016-10-07 16:41:48 UTC (rev 206916)
@@ -1,3 +1,23 @@
+2016-10-07 Zalan Bujtas <[email protected]>
+
+ 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.
+
+ 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):
+
2016-10-07 Romain Bellessort <[email protected]>
[Readable Streams API] Implement generic reader functions
Modified: trunk/Source/WebCore/style/StyleSharingResolver.cpp (206915 => 206916)
--- trunk/Source/WebCore/style/StyleSharingResolver.cpp 2016-10-07 16:39:21 UTC (rev 206915)
+++ trunk/Source/WebCore/style/StyleSharingResolver.cpp 2016-10-07 16:41:48 UTC (rev 206916)
@@ -115,6 +115,8 @@
shareElement = findSibling(context, cousinList, count);
if (shareElement)
break;
+ if (count >= cStyleSearchThreshold)
+ break;
cousinList = locateCousinList(cousinList->parentElement());
}
@@ -144,7 +146,7 @@
continue;
if (canShareStyleWithElement(context, downcast<StyledElement>(*node)))
break;
- if (count++ == cStyleSearchThreshold)
+ if (count++ >= cStyleSearchThreshold)
return nullptr;
}
return downcast<StyledElement>(node);
@@ -152,8 +154,7 @@
Node* SharingResolver::locateCousinList(const Element* parent) const
{
- const unsigned maximumSearchCount = 10;
- for (unsigned count = 0; count < maximumSearchCount; ++count) {
+ for (unsigned count = 0; count < cStyleSearchThreshold; ++count) {
auto* elementSharingParentStyle = m_elementsSharingStyle.get(parent);
if (!elementSharingParentStyle)
return nullptr;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes