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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/NodeListsNodeData.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/dom/Element.h" 5 #include "core/dom/Element.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include "core/dom/ClientRect.h" 8 #include "core/dom/ClientRect.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/editing/EditingTestBase.h" 10 #include "core/editing/EditingTestBase.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 document.View()->UpdateAllLifecyclePhases(); 232 document.View()->UpdateAllLifecyclePhases();
233 EXPECT_EQ(DocumentLifecycle::kPaintClean, document.Lifecycle().GetState()); 233 EXPECT_EQ(DocumentLifecycle::kPaintClean, document.Lifecycle().GetState());
234 234
235 EXPECT_FALSE(outer_sticky->StyleRef().SubtreeIsSticky()); 235 EXPECT_FALSE(outer_sticky->StyleRef().SubtreeIsSticky());
236 EXPECT_FALSE(child->StyleRef().SubtreeIsSticky()); 236 EXPECT_FALSE(child->StyleRef().SubtreeIsSticky());
237 EXPECT_FALSE(grandchild->StyleRef().SubtreeIsSticky()); 237 EXPECT_FALSE(grandchild->StyleRef().SubtreeIsSticky());
238 EXPECT_TRUE(inner_sticky->StyleRef().SubtreeIsSticky()); 238 EXPECT_TRUE(inner_sticky->StyleRef().SubtreeIsSticky());
239 EXPECT_TRUE(great_grandchild->StyleRef().SubtreeIsSticky()); 239 EXPECT_TRUE(great_grandchild->StyleRef().SubtreeIsSticky());
240 } 240 }
241 241
242 TEST_F(ElementTest, GetElementsByClassNameCrash) {
243 // Test for a crash in NodeListsNodeData::AddCache().
244 ASSERT_TRUE(GetDocument().InQuirksMode());
245 GetDocument().body()->getElementsByClassName("ABC DEF");
246 GetDocument().body()->getElementsByClassName("ABC DEF");
247 // The test passes if no crash happens.
248 }
249
242 } // namespace blink 250 } // namespace blink
OLDNEW
« 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