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

Side by Side Diff: third_party/WebKit/Source/core/dom/RangeTest.cpp

Issue 2792953002: Fix unexpected erasing textQuad (Closed)
Patch Set: comment added. Created 3 years, 8 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/layout/LayoutText.cpp » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/Range.h" 5 #include "core/dom/Range.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "bindings/core/v8/V8BindingForTesting.h" 8 #include "bindings/core/v8/V8BindingForTesting.h"
9 #include "core/dom/Element.h" 9 #include "core/dom/Element.h"
10 #include "core/dom/NodeList.h" 10 #include "core/dom/NodeList.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 } 232 }
233 233
234 // Regression test for crbug.com/698123 234 // Regression test for crbug.com/698123
235 TEST_F(RangeTest, ExpandNotCrash) { 235 TEST_F(RangeTest, ExpandNotCrash) {
236 Range* range = Range::create(document()); 236 Range* range = Range::create(document());
237 Node* div = HTMLDivElement::create(document()); 237 Node* div = HTMLDivElement::create(document());
238 range->setStart(div, 0, ASSERT_NO_EXCEPTION); 238 range->setStart(div, 0, ASSERT_NO_EXCEPTION);
239 range->expand("", ASSERT_NO_EXCEPTION); 239 range->expand("", ASSERT_NO_EXCEPTION);
240 } 240 }
241 241
242 TEST_F(RangeTest, MultipleTextQuads) {
243 setBodyContent("<div><p id='one'>one</p><p id='two'>two</p></div>");
244 Position start(document().getElementById("one")->firstChild(), 0);
245 Position end(document().getElementById("two")->firstChild(), 3);
246 Range* range = Range::create(document(), start, end);
247 Vector<FloatQuad> quads;
248 range->textQuads(quads);
249 EXPECT_EQ(2u, quads.size());
250 }
251
242 } // namespace blink 252 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698