Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Unified Diff: third_party/WebKit/Source/core/dom/ElementTest.cpp

Issue 2903373002: Fix a crash when getElementsByClassName() is called twice with the same argument including capital … (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/NodeListsNodeData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/ElementTest.cpp
diff --git a/third_party/WebKit/Source/core/dom/ElementTest.cpp b/third_party/WebKit/Source/core/dom/ElementTest.cpp
index afffcd8eb1a20b775cf6b275f81c09d22d0854db..66f3b9b78652436628fd40857c70b35478fd00be 100644
--- a/third_party/WebKit/Source/core/dom/ElementTest.cpp
+++ b/third_party/WebKit/Source/core/dom/ElementTest.cpp
@@ -239,4 +239,12 @@ TEST_F(ElementTest, StickySubtreesAreTrackedCorrectly) {
EXPECT_TRUE(great_grandchild->StyleRef().SubtreeIsSticky());
}
+TEST_F(ElementTest, GetElementsByClassNameCrash) {
+ // Test for a crash in NodeListsNodeData::AddCache().
+ ASSERT_TRUE(GetDocument().InQuirksMode());
+ GetDocument().body()->getElementsByClassName("ABC DEF");
+ GetDocument().body()->getElementsByClassName("ABC DEF");
+ // The test passes if no crash happens.
+}
+
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/NodeListsNodeData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698