| 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 // The URL can also be used as an HTML fragment. | 350 // The URL can also be used as an HTML fragment. |
| 351 m_dataObject->setHTMLAndBaseURL(urlToMarkup(url, title), url); | 351 m_dataObject->setHTMLAndBaseURL(urlToMarkup(url, title), url); |
| 352 } | 352 } |
| 353 | 353 |
| 354 void DataTransfer::writeSelection(const FrameSelection& selection) | 354 void DataTransfer::writeSelection(const FrameSelection& selection) |
| 355 { | 355 { |
| 356 if (!m_dataObject) | 356 if (!m_dataObject) |
| 357 return; | 357 return; |
| 358 | 358 |
| 359 if (!enclosingTextFormControl(selection.start())) { | 359 if (!enclosingTextFormControl(selection.start())) { |
| 360 EphemeralRange selectedRange = selection.selection().toNormalizedEphemer
alRange(); | 360 m_dataObject->setHTMLAndBaseURL(selection.selectedHTMLForClipboard(), se
lection.frame()->document()->url()); |
| 361 ASSERT(selectedRange.isNotNull()); | |
| 362 m_dataObject->setHTMLAndBaseURL(createMarkup(selectedRange.startPosition
(), selectedRange.endPosition(), AnnotateForInterchange, ConvertBlocksToInlines:
:NotConvert, ResolveNonLocalURLs), selectedRange.document().url()); | |
| 363 } | 361 } |
| 364 | 362 |
| 365 String str = selection.selectedTextForClipboard(); | 363 String str = selection.selectedTextForClipboard(); |
| 366 #if OS(WIN) | 364 #if OS(WIN) |
| 367 replaceNewlinesWithWindowsStyleNewlines(str); | 365 replaceNewlinesWithWindowsStyleNewlines(str); |
| 368 #endif | 366 #endif |
| 369 replaceNBSPWithSpace(str); | 367 replaceNBSPWithSpace(str); |
| 370 m_dataObject->setData(mimeTypeTextPlain, str); | 368 m_dataObject->setData(mimeTypeTextPlain, str); |
| 371 } | 369 } |
| 372 | 370 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 | 515 |
| 518 DEFINE_TRACE(DataTransfer) | 516 DEFINE_TRACE(DataTransfer) |
| 519 { | 517 { |
| 520 visitor->trace(m_dataObject); | 518 visitor->trace(m_dataObject); |
| 521 #if ENABLE(OILPAN) | 519 #if ENABLE(OILPAN) |
| 522 visitor->trace(m_dragImageElement); | 520 visitor->trace(m_dragImageElement); |
| 523 #endif | 521 #endif |
| 524 } | 522 } |
| 525 | 523 |
| 526 } // namespace blink | 524 } // namespace blink |
| OLD | NEW |