OLD | NEW |
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 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 | 526 |
527 TEST_F(TextIteratorTest, PreserveLeadingSpace) | 527 TEST_F(TextIteratorTest, PreserveLeadingSpace) |
528 { | 528 { |
529 setBodyContent("<div style='width: 2em;'><b><i>foo</i></b> bar</div>"); | 529 setBodyContent("<div style='width: 2em;'><b><i>foo</i></b> bar</div>"); |
530 Element* div = document().querySelector("div"); | 530 Element* div = document().querySelector("div"); |
531 Position start(div->firstChild()->firstChild()->firstChild(), 0); | 531 Position start(div->firstChild()->firstChild()->firstChild(), 0); |
532 Position end(div->lastChild(), 4); | 532 Position end(div->lastChild(), 4); |
533 EXPECT_EQ("foo bar", plainText(EphemeralRange(start, end), TextIteratorEmits
ImageAltText)); | 533 EXPECT_EQ("foo bar", plainText(EphemeralRange(start, end), TextIteratorEmits
ImageAltText)); |
534 } | 534 } |
535 | 535 |
| 536 TEST_F(TextIteratorTest, PreserveOnlyLeadingSpace) |
| 537 { |
| 538 setBodyContent("<div style='width: 2em;'><b><i id='foo'>foo </i></b> bar</di
v>"); |
| 539 Element* div = document().querySelector("div"); |
| 540 Position start(document().getElementById("foo")->firstChild(), 0); |
| 541 Position end(div->lastChild(), 4); |
| 542 EXPECT_EQ("foo bar", plainText(EphemeralRange(start, end), TextIteratorEmits
ImageAltText)); |
| 543 } |
| 544 |
536 } // namespace blink | 545 } // namespace blink |
OLD | NEW |