Changeset 89050 in webkit


Ignore:
Timestamp:
Jun 16, 2011 11:23:36 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-06-16 Chang Shu <cshu@webkit.org>

Reviewed by Sam Weinig.

[Qt] [WK2] Qt WebKit2 needs undo/redo support
https://bugs.webkit.org/show_bug.cgi?id=62637

Unskip passed tests.

  • platform/qt-wk2/Skipped:

2011-06-16 Chang Shu <cshu@webkit.org>

Reviewed by Sam Weinig.

[Qt] [WK2] Qt WebKit2 needs undo/redo support
https://bugs.webkit.org/show_bug.cgi?id=62637

Implement undo/redo support for document.execCommand().

  • UIProcess/API/qt/qwkpage.cpp: (QWKPagePrivate::QWKPagePrivate): (QWKPagePrivate::~QWKPagePrivate): (QWKPagePrivate::registerEditCommand): (QWKPagePrivate::clearAllEditCommands): (QWKPagePrivate::canUndoRedo): (QWKPagePrivate::executeUndoRedo):
  • UIProcess/API/qt/qwkpage_p.h:
  • UIProcess/qt/WebUndoCommandQt.cpp: Added. (WebUndoCommandQt::WebUndoCommandQt): (WebUndoCommandQt::~WebUndoCommandQt): (WebUndoCommandQt::redo): (WebUndoCommandQt::undo):
  • UIProcess/qt/WebUndoCommandQt.h: Added. (WebUndoCommandQt::inUndoRedo):
  • WebKit2.pro:
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r89049 r89050  
     12011-06-16  Chang Shu  <cshu@webkit.org>
     2
     3        Reviewed by Sam Weinig.
     4
     5        [Qt] [WK2] Qt WebKit2 needs undo/redo support
     6        https://bugs.webkit.org/show_bug.cgi?id=62637
     7
     8        Unskip passed tests.
     9
     10        * platform/qt-wk2/Skipped:
     11
    1122011-06-16  Vsevolod Vlasov  <vsevik@chromium.org>
    213
  • trunk/LayoutTests/platform/qt-wk2/Skipped

    r89022 r89050  
    200200editing/selection/word-granularity.html
    201201editing/spelling/context-menu-suggestions.html
    202 editing/undo/undo-deleteWord.html
    203 editing/undo/undo-smart-delete-reversed-selection.html
    204 editing/undo/undo-smart-delete-word.html
    205202fast/blockflow/horizontal-bt-replaced-selection.html
    206203fast/blockflow/japanese-lr-selection.html
     
    12981295editing/style/typing-style-003.html
    12991296editing/text-iterator/thai-cursor-movement.html
    1300 editing/undo/replace-by-span-then-remove.html
    13011297editing/deleting/5168598.html
    13021298editing/deleting/delete-line-011.html
     
    17491745fast/dom/Window/window-resize-and-move-arguments.html
    17501746fast/dom/Window/window-resize.html
    1751 
    1752 # WebKit2 needs undo/redo support
    1753 editing/undo/remove-css-property-and-remove-style.html
    1754 editing/deleting/delete-and-undo.html
    1755 editing/execCommand/convert-style-elements-to-spans.html
    1756 editing/inserting/redo.html
    1757 editing/undo/4063751.html
    1758 editing/undo/5378473.html
    1759 editing/undo/redo-split-text-node.html
    1760 editing/undo/redo-split-text-with-removal.html
    1761 editing/undo/redo-style.html
    1762 editing/undo/redo-typing-001.html
    1763 editing/undo/undo-combined-delete-boundary.html
    1764 editing/undo/undo-combined-delete.html
    1765 editing/undo/undo-delete-boundary.html
    1766 editing/undo/undo-delete.html
    1767 editing/undo/undo-forward-delete-boundary.html
    1768 editing/undo/undo-forward-delete.html
    1769 editing/undo/undo-iframe-location-change.html
    1770 editing/undo/undo-indent.html
    1771 editing/undo/undo-misspellings.html
    1772 editing/undo/undo-typing-001.html
    17731747
    17741748# WebKit2 needs to define a default charset (Settings::defaultTextEncodingName)
     
    29692943tables/mozilla_expected_failures/dom/insertTbodyExpand1.html
    29702944tables/mozilla_expected_failures/dom/insertTbodyRebuild1.html
     2945editing/deleting/delete-and-undo.html
    29712946
    29722947# [Qt][WK2]http/tests/loading/preload-append-scan.php fails
     
    30182993# fail after http://trac.webkit.org/changeset/87067
    30192994fast/forms/textfield-overflow.html
    3020 
    3021 # new test inroduced in r87204, but fail
    3022 editing/undo/undo-after-setting-value.html
    30232995
    30242996# unskipped by r88152, but fail on Qt-WK2 platform
  • trunk/Source/WebKit2/ChangeLog

    r89045 r89050  
     12011-06-16  Chang Shu  <cshu@webkit.org>
     2
     3        Reviewed by Sam Weinig.
     4
     5        [Qt] [WK2] Qt WebKit2 needs undo/redo support
     6        https://bugs.webkit.org/show_bug.cgi?id=62637
     7
     8        Implement undo/redo support for document.execCommand().
     9
     10        * UIProcess/API/qt/qwkpage.cpp:
     11        (QWKPagePrivate::QWKPagePrivate):
     12        (QWKPagePrivate::~QWKPagePrivate):
     13        (QWKPagePrivate::registerEditCommand):
     14        (QWKPagePrivate::clearAllEditCommands):
     15        (QWKPagePrivate::canUndoRedo):
     16        (QWKPagePrivate::executeUndoRedo):
     17        * UIProcess/API/qt/qwkpage_p.h:
     18        * UIProcess/qt/WebUndoCommandQt.cpp: Added.
     19        (WebUndoCommandQt::WebUndoCommandQt):
     20        (WebUndoCommandQt::~WebUndoCommandQt):
     21        (WebUndoCommandQt::redo):
     22        (WebUndoCommandQt::undo):
     23        * UIProcess/qt/WebUndoCommandQt.h: Added.
     24        (WebUndoCommandQt::inUndoRedo):
     25        * WebKit2.pro:
     26
    1272011-06-16  Anders Carlsson  <andersca@apple.com>
    228
  • trunk/Source/WebKit2/UIProcess/API/qt/qwkpage.cpp

    r88880 r89050  
    4242#include "WebContext.h"
    4343#include "WebContextMenuProxyQt.h"
     44#include "WebEditCommandProxy.h"
    4445#include "WebEventFactoryQt.h"
    4546#include "WebPopupMenuProxyQt.h"
     47#include "WebUndoCommandQt.h"
    4648#include "WKStringQt.h"
    4749#include "WKURLQt.h"
     
    5254#include <QStyle>
    5355#include <QTouchEvent>
     56#include <QUndoStack>
    5457#include <QtDebug>
    5558#include <WebCore/Cursor.h>
     
    97100    , backingStoreType(QGraphicsWKView::Simple)
    98101    , isConnectedToEngine(true)
     102#ifndef QT_NO_UNDOSTACK
     103    , undoStack(adoptPtr(new QUndoStack(qq)))
     104#endif
    99105{
    100106    memset(actions, 0, sizeof(actions));
     
    207213}
    208214
    209 void QWKPagePrivate::registerEditCommand(PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo)
    210 {
     215void QWKPagePrivate::registerEditCommand(PassRefPtr<WebEditCommandProxy> command, WebPageProxy::UndoOrRedo undoOrRedo)
     216{
     217#ifndef QT_NO_UNDOSTACK
     218    if (undoOrRedo == WebPageProxy::Undo) {
     219        const WebUndoCommandQt* webUndoCommand = static_cast<const WebUndoCommandQt*>(undoStack->command(undoStack->index()));
     220        if (webUndoCommand && webUndoCommand->inUndoRedo())
     221            return;
     222        undoStack->push(new WebUndoCommandQt(command));
     223    }
     224#endif
    211225}
    212226
    213227void QWKPagePrivate::clearAllEditCommands()
    214228{
    215 }
    216 
    217 bool QWKPagePrivate::canUndoRedo(WebPageProxy::UndoOrRedo)
    218 {
     229#ifndef QT_NO_UNDOSTACK
     230    undoStack->clear();
     231#endif
     232}
     233
     234bool QWKPagePrivate::canUndoRedo(WebPageProxy::UndoOrRedo undoOrRedo)
     235{
     236#ifdef QT_NO_UNDOSTACK
    219237    return false;
    220 }
    221 
    222 void QWKPagePrivate::executeUndoRedo(WebPageProxy::UndoOrRedo)
    223 {
     238#else
     239    if (undoOrRedo == WebPageProxy::Undo)
     240        return undoStack->canUndo();
     241    return undoStack->canRedo();
     242#endif
     243}
     244
     245void QWKPagePrivate::executeUndoRedo(WebPageProxy::UndoOrRedo undoOrRedo)
     246{
     247#ifndef QT_NO_UNDOSTACK
     248    if (undoOrRedo == WebPageProxy::Undo)
     249        undoStack->undo();
     250    else
     251        undoStack->redo();
     252#endif
    224253}
    225254
  • trunk/Source/WebKit2/UIProcess/API/qt/qwkpage_p.h

    r88880 r89050  
    3535
    3636class QGraphicsWKView;
     37class QUndoStack;
    3738class QWKPreferences;
    3839
     
    139140
    140141    bool isConnectedToEngine;
     142
     143#ifndef QT_NO_UNDOSTACK
     144    OwnPtr<QUndoStack> undoStack;
     145#endif
    141146};
    142147
  • trunk/Source/WebKit2/WebKit2.pro

    r88960 r89050  
    233233    UIProcess/WebResourceLoadClient.h \
    234234    UIProcess/WebUIClient.h \
     235    UIProcess/qt/WebUndoCommandQt.h \
    235236    UIProcess/qt/WebContextMenuProxyQt.h \
    236237    UIProcess/qt/WebPopupMenuProxyQt.h \
     
    392393    UIProcess/DrawingAreaProxy.cpp \
    393394    UIProcess/DrawingAreaProxyImpl.cpp \
     395    UIProcess/qt/WebUndoCommandQt.cpp \
    394396    UIProcess/FindIndicator.cpp \
    395397    UIProcess/GeolocationPermissionRequestManagerProxy.cpp \
Note: See TracChangeset for help on using the changeset viewer.