Changeset 146723 in webkit


Ignore:
Timestamp:
Mar 23, 2013 6:24:42 PM (11 years ago)
Author:
dcheng@chromium.org
Message:

[Qt] editing/pasteboard/can-read-in-dragstart-event.html and /can-read-in-copy-and-cut-events.html are crashing
https://bugs.webkit.org/show_bug.cgi?id=113126

Reviewed by Ryosuke Niwa.

Source/WebCore:

The ClipboardQt implementation only allows reading or writing, not both. Attempting to read
when the clipboard is only writable will lead to a crash since the corresponding member will
be null. To prevent crashes, change the asserts to early returns. In the long term, the
correct fix is to unify the m_readableData and m_writableData members.

No new tests since no functionality in Qt port should change.

  • platform/qt/ClipboardQt.cpp:

(WebCore::ClipboardQt::getData):
(WebCore::ClipboardQt::types):
(WebCore::ClipboardQt::files):

LayoutTests:

  • platform/qt/TestExpectations:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r146717 r146723  
     12013-03-23  Daniel Cheng  <dcheng@chromium.org>
     2
     3        [Qt] editing/pasteboard/can-read-in-dragstart-event.html and /can-read-in-copy-and-cut-events.html are crashing
     4        https://bugs.webkit.org/show_bug.cgi?id=113126
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * platform/qt/TestExpectations:
     9
    1102013-03-22  Peter Kasting  <pkasting@google.com>
    211
  • trunk/LayoutTests/platform/qt/TestExpectations

    r146713 r146723  
    27142714webkit.org/b/91611 [ Mac Win ] media/media-higher-prio-audio-stream.html [ Skip ]
    27152715
    2716 webkit.org/b/113126 editing/pasteboard/can-read-in-dragstart-event.html [ Crash ]
    2717 webkit.org/b/113126 editing/pasteboard/can-read-in-copy-and-cut-events.html [ Crash ]
     2716webkit.org/b/113126 editing/pasteboard/can-read-in-dragstart-event.html [ Failure ]
     2717webkit.org/b/113126 editing/pasteboard/can-read-in-copy-and-cut-events.html [ Failure ]
  • trunk/Source/WebCore/ChangeLog

    r146721 r146723  
     12013-03-23  Daniel Cheng  <dcheng@chromium.org>
     2
     3        [Qt] editing/pasteboard/can-read-in-dragstart-event.html and /can-read-in-copy-and-cut-events.html are crashing
     4        https://bugs.webkit.org/show_bug.cgi?id=113126
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        The ClipboardQt implementation only allows reading or writing, not both. Attempting to read
     9        when the clipboard is only writable will lead to a crash since the corresponding member will
     10        be null. To prevent crashes, change the asserts to early returns. In the long term, the
     11        correct fix is to unify the m_readableData and m_writableData members.
     12
     13        No new tests since no functionality in Qt port should change.
     14
     15        * platform/qt/ClipboardQt.cpp:
     16        (WebCore::ClipboardQt::getData):
     17        (WebCore::ClipboardQt::types):
     18        (WebCore::ClipboardQt::files):
     19
    1202013-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
    221
  • trunk/Source/WebCore/platform/qt/ClipboardQt.cpp

    r146644 r146723  
    156156        return m_readableData->text();
    157157
    158     ASSERT(m_readableData);
     158    // FIXME: Per the spec, reading the clipboard in dragstart events should also be allowed.
     159    // See https://bugs.webkit.org/show_bug.cgi?id=113126.
     160    if (!m_readableData)
     161        return String();
     162
    159163    QByteArray rawData = m_readableData->data(type);
    160164    QString data = QTextCodec::codecForName("UTF-16")->toUnicode(rawData);
     
    188192        return ListHashSet<String>();
    189193
    190     ASSERT(m_readableData);
     194    // FIXME: Per the spec, reading the clipboard in dragstart events should also be allowed.
     195    // See https://bugs.webkit.org/show_bug.cgi?id=113126.
     196    if (!m_readableData)
     197        return ListHashSet<String>();
     198
    191199    ListHashSet<String> result;
    192200    QStringList formats = m_readableData->formats();
     
    198206PassRefPtr<FileList> ClipboardQt::files() const
    199207{
    200     if (!canReadData() || !m_readableData->hasUrls())
     208    // FIXME: Per the spec, reading the clipboard in dragstart events should also be allowed.
     209    // See https://bugs.webkit.org/show_bug.cgi?id=113126.
     210    if (!canReadData() || !m_readableData || !m_readableData->hasUrls())
    201211        return FileList::create();
    202212
Note: See TracChangeset for help on using the changeset viewer.