| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 | 315 |
| 316 // The URL can also be used as an HTML fragment. | 316 // The URL can also be used as an HTML fragment. |
| 317 m_dataObject->setHTMLAndBaseURL( | 317 m_dataObject->setHTMLAndBaseURL( |
| 318 createMarkup(node, IncludeNode, ResolveAllURLs), url); | 318 createMarkup(node, IncludeNode, ResolveAllURLs), url); |
| 319 } | 319 } |
| 320 | 320 |
| 321 void DataTransfer::writeSelection(const FrameSelection& selection) { | 321 void DataTransfer::writeSelection(const FrameSelection& selection) { |
| 322 if (!m_dataObject) | 322 if (!m_dataObject) |
| 323 return; | 323 return; |
| 324 | 324 |
| 325 if (!enclosingTextControl(selection.start())) { | 325 if (!enclosingTextControl( |
| 326 selection.computeVisibleSelectionInDOMTreeDeprecated().start())) { |
| 326 m_dataObject->setHTMLAndBaseURL(selection.selectedHTMLForClipboard(), | 327 m_dataObject->setHTMLAndBaseURL(selection.selectedHTMLForClipboard(), |
| 327 selection.frame()->document()->url()); | 328 selection.frame()->document()->url()); |
| 328 } | 329 } |
| 329 | 330 |
| 330 String str = selection.selectedTextForClipboard(); | 331 String str = selection.selectedTextForClipboard(); |
| 331 #if OS(WIN) | 332 #if OS(WIN) |
| 332 replaceNewlinesWithWindowsStyleNewlines(str); | 333 replaceNewlinesWithWindowsStyleNewlines(str); |
| 333 #endif | 334 #endif |
| 334 replaceNBSPWithSpace(str); | 335 replaceNBSPWithSpace(str); |
| 335 m_dataObject->setData(mimeTypeTextPlain, str); | 336 m_dataObject->setData(mimeTypeTextPlain, str); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 } | 477 } |
| 477 } | 478 } |
| 478 | 479 |
| 479 DEFINE_TRACE(DataTransfer) { | 480 DEFINE_TRACE(DataTransfer) { |
| 480 visitor->trace(m_dataObject); | 481 visitor->trace(m_dataObject); |
| 481 visitor->trace(m_dragImage); | 482 visitor->trace(m_dragImage); |
| 482 visitor->trace(m_dragImageElement); | 483 visitor->trace(m_dragImageElement); |
| 483 } | 484 } |
| 484 | 485 |
| 485 } // namespace blink | 486 } // namespace blink |
| OLD | NEW |