| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 | 498 |
| 499 // This doesn't (and shouldn't) select text node characters. | 499 // This doesn't (and shouldn't) select text node characters. |
| 500 setBaseAndExtent(n, 0, n, n->countChildren(), exceptionState); | 500 setBaseAndExtent(n, 0, n, n->countChildren(), exceptionState); |
| 501 } | 501 } |
| 502 | 502 |
| 503 String DOMSelection::toString() | 503 String DOMSelection::toString() |
| 504 { | 504 { |
| 505 if (!m_frame) | 505 if (!m_frame) |
| 506 return String(); | 506 return String(); |
| 507 | 507 |
| 508 return plainText(m_frame->selection().selection().toNormalizedRange().get())
; | 508 Position start, end; |
| 509 if (m_frame->selection().selection().toNormalizedPositions(start, end)) |
| 510 return plainText(start, end); |
| 511 return emptyString(); |
| 509 } | 512 } |
| 510 | 513 |
| 511 Node* DOMSelection::shadowAdjustedNode(const Position& position) const | 514 Node* DOMSelection::shadowAdjustedNode(const Position& position) const |
| 512 { | 515 { |
| 513 if (position.isNull()) | 516 if (position.isNull()) |
| 514 return 0; | 517 return 0; |
| 515 | 518 |
| 516 Node* containerNode = position.containerNode(); | 519 Node* containerNode = position.containerNode(); |
| 517 Node* adjustedNode = m_treeScope->ancestorInThisScope(containerNode); | 520 Node* adjustedNode = m_treeScope->ancestorInThisScope(containerNode); |
| 518 | 521 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa
geSource, ErrorMessageLevel, message)); | 560 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa
geSource, ErrorMessageLevel, message)); |
| 558 } | 561 } |
| 559 | 562 |
| 560 void DOMSelection::trace(Visitor* visitor) | 563 void DOMSelection::trace(Visitor* visitor) |
| 561 { | 564 { |
| 562 visitor->trace(m_treeScope); | 565 visitor->trace(m_treeScope); |
| 563 DOMWindowProperty::trace(visitor); | 566 DOMWindowProperty::trace(visitor); |
| 564 } | 567 } |
| 565 | 568 |
| 566 } // namespace blink | 569 } // namespace blink |
| OLD | NEW |