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

Side by Side Diff: third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp

Issue 2325553002: Restore a collapsed leading space of text used for line break (Closed)
Patch Set: Use plainText() Created 4 years, 3 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 | « third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, Google Inc. All rights reserved. 2 * Copyright (c) 2013, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 517
518 ShadowRoot* shadowRoot = document().getElementById("host")->openShadowRoot() ; 518 ShadowRoot* shadowRoot = document().getElementById("host")->openShadowRoot() ;
519 Node* bInShadowTree = shadowRoot->getElementById("end"); 519 Node* bInShadowTree = shadowRoot->getElementById("end");
520 520
521 Position start(&document(), 0); 521 Position start(&document(), 0);
522 Position end(bInShadowTree, 0); 522 Position end(bInShadowTree, 0);
523 TextIterator iter(start, end); 523 TextIterator iter(start, end);
524 EXPECT_TRUE(iter.atEnd()); 524 EXPECT_TRUE(iter.atEnd());
525 } 525 }
526 526
527 TEST_F(TextIteratorTest, PreserveLeadingSpace)
528 {
529 setBodyContent("<div style='width: 2em;'><b><i>foo</i></b> bar</div>");
530 Element* div = document().querySelector("div");
531 Position start(div->firstChild()->firstChild()->firstChild(), 0);
532 Position end(div->lastChild(), 4);
533 EXPECT_EQ("foo bar", plainText(EphemeralRange(start, end), TextIteratorEmits ImageAltText));
534 }
535
527 } // namespace blink 536 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698