Changeset 58378 in webkit
- Timestamp:
- Apr 27, 2010 10:21:33 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r58375 r58378 1 2010-04-27 Daniel Cheng <dcheng@chromium.org> 2 3 Reviewed by Jian Li. 4 5 [Chromium] Filter out URLs with a file scheme from text/uri-list when dragging. 6 https://bugs.webkit.org/show_bug.cgi?id=38227 7 8 Unfortunately, the simple fix of not populating the drag data with file URLs doesn't work 9 since the default drop handling uses the drag data URL to navigate to dropped files/URLs. 10 For now, we hack around the problem in the Chromium platform, but the proper long term 11 solution is to change DragController::performDrag to check dragData::asFilenames(). 12 13 No new tests. 14 15 * platform/chromium/ClipboardChromium.cpp: 16 (WebCore::ClipboardChromium::getData): 17 (WebCore::ClipboardChromium::types): 18 1 19 2010-04-27 Simon Fraser <simon.fraser@apple.com> 2 20 -
trunk/WebCore/platform/chromium/ClipboardChromium.cpp
r58276 r58378 163 163 return String(); 164 164 165 // Hack for URLs. file URLs are used internally for drop's default action, but we don't want 166 // to expose them to the page, so we filter them out here. 165 167 case ClipboardDataTypeURIList: 166 168 { … … 168 170 for (size_t i = 0; i < m_dataObject->uriList.size(); ++i) { 169 171 const String& uri = m_dataObject->uriList[i]; 172 if (protocolIs(uri, "file")) 173 continue; 170 174 ASSERT(!uri.isEmpty()); 171 175 if (!text.isEmpty()) … … 181 185 // In case of a previous setData('text/uri-list'), setData() has already 182 186 // prepared the 'url' member, so we can just retrieve it here. 183 if (!m_dataObject->url.isEmpty() ) {187 if (!m_dataObject->url.isEmpty() && !m_dataObject->url.isLocalFile()) { 184 188 success = true; 185 189 return m_dataObject->url.string(); … … 317 321 results.add("Files"); 318 322 319 if (m_dataObject->url.isValid()) { 323 // Hack for URLs. file URLs are used internally for drop's default action, but we don't want 324 // to expose them to the page, so we filter them out here. 325 if (m_dataObject->url.isValid() && !m_dataObject->url.isLocalFile()) { 320 326 ASSERT(!m_dataObject->uriList.isEmpty()); 321 327 results.add("URL"); … … 323 329 324 330 if (!m_dataObject->uriList.isEmpty()) { 325 // Note that even if the URI list is not empty, it may not actually 326 // contain a valid URL, so we can't return "URL" here. 327 results.add("text/uri-list"); 331 // Verify that the URI list contains at least one non-file URL. 332 for (Vector<String>::const_iterator it = m_dataObject->uriList.begin(); 333 it != m_dataObject->uriList.end(); ++it) { 334 if (!protocolIs(*it, "file")) { 335 // Note that even if the URI list is not empty, it may not actually 336 // contain a valid URL, so we can't return "URL" here. 337 results.add("text/uri-list"); 338 break; 339 } 340 } 328 341 } 329 342
Note: See TracChangeset
for help on using the changeset viewer.