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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |