+2007-01-16 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack
+
+ Remove everything but the new public API from
+ the include path.
+
+ * WebKit.pri:
+
2007-01-11 George Staikos <staikos@kde.org>
Fix the Qt build
+2007-01-16 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack
+
+ Cleaned up the way we create native widgets. They are
+ now not created in WebCore anymore, but in the new
+ Qt API to WebKit.
+
+ Fix a compile issue in the ResourceHandleManager.
+
+ * WebCore.pro:
+ * platform/ScrollView.h:
+ * platform/Widget.h:
+ (WebCore::ResourceHandleManager::cancel):
+ * platform/qt/ScrollViewCanvasQt.cpp:
+ (WebCore::ScrollViewCanvasQt::ScrollViewCanvasQt):
+ (WebCore::ScrollViewCanvasQt::paintEvent):
+ (WebCore::ScrollViewCanvasQt::mouseMoveEvent):
+ (WebCore::ScrollViewCanvasQt::mousePressEvent):
+ (WebCore::ScrollViewCanvasQt::mouseReleaseEvent):
+ (WebCore::ScrollViewCanvasQt::handleKeyEvent):
+ * platform/qt/ScrollViewCanvasQt.h:
+ * platform/qt/ScrollViewQt.cpp:
+ (WebCore::ScrollView::ScrollView):
+ (WebCore::ScrollView::setScrollArea):
+ (WebCore::ScrollView::addChild):
+ * platform/qt/WidgetQt.cpp:
+ * platform/network/qt/ResourceHandleManagerQt.cpp:
+
2007-01-16 Lars Knoll <lars@trolltech.com>
Reviewed by Zack
$$PWD/ksvg2 $$PWD/ksvg2/css $$PWD/ksvg2/svg $$PWD/ksvg2/misc $$PWD/ksvg2/events \
$$PWD/platform/image-decoders \
$$PWD/../WebKitQt/WebCoreSupport \
+ $$PWD/../WebKitQt/Api \
$$PWD/WebCore+SVG
QT += network
!mac:CONFIG += link_pkgconfig
MANUALMOC += \
$$PWD/platform/qt/SharedTimerQt.h \
$$PWD/platform/qt/ScrollViewCanvasQt.h \
- $$PWD/platform/network/qt/ResourceHandleManagerQt.h
+ $$PWD/platform/network/qt/ResourceHandleManagerQt.h \
+ $$PWD/../WebKitQt/Api/qwebpage.h \
+ $$PWD/../WebKitQt/Api/qwebframe.h
LUT_FILES += \
bindings/js/kjs_window.cpp \
../WebKitQt/WebCoreSupport/FrameLoaderClientQt.cpp \
../WebKitQt/WebCoreSupport/EditorClientQt.cpp \
../WebKitQt/WebCoreSupport/ChromeClientQt.cpp \
- ../WebKitQt/WebCoreSupport/ContextMenuClientQt.cpp
+ ../WebKitQt/WebCoreSupport/ContextMenuClientQt.cpp \
+ ../WebKitQt/Api/qwebpage.cpp \
+ ../WebKitQt/Api/qwebframe.cpp
contains(DEFINES, XPATH_SUPPORT=1) {
FEATURE_DEFINES_JAVASCRIPT += XPATH_SUPPORT
ScrollView();
~ScrollView();
- virtual void setParentWidget(QWidget*);
+ void setScrollArea(QScrollArea*);
private:
QScrollArea* m_area;
#endif
#if PLATFORM(QT)
- QWidget* parentWidget() const;
- virtual void setParentWidget(QWidget*);
-
QWidget* qwidget();
void setQWidget(QWidget*);
#endif
DEBUG() << "ResourceHandleManager::cancel" << resource->url().path();
+ RequestQt* request = pendingRequests[resource];
+ if (!request)
+ return;
request->cancelled = true;
String protocol = request->hostInfo.protocol;
#include <QPainter>
#include <QPaintEvent>
#include <QMouseEvent>
+#include <qdebug.h>
//this output ms that it takes WebKit to render in each paint event
namespace WebCore {
-ScrollViewCanvasQt::ScrollViewCanvasQt(ScrollView* frameView, QWidget* parent)
- : QWidget(parent),
- m_scrollView(frameView),
- m_frameView(0)
+ScrollViewCanvasQt::ScrollViewCanvasQt(FrameView* frameView, QWidget* parent)
+ : QWidget(0),
+ m_frameView(frameView)
{
setMouseTracking(true);
setFocusPolicy(Qt::StrongFocus);
-}
-
-bool ScrollViewCanvasQt::updateFrameView()
-{
- m_frameView = static_cast<FrameView*>(m_scrollView);
- if (!m_frameView || !m_frameView->frame())
- return false;
- return true;
+ resize(500, 500);
}
void ScrollViewCanvasQt::paintEvent(QPaintEvent* ev)
{
- if (!m_frameView) {
- if (!updateFrameView() ||
- !m_frameView->frame()->renderer())
- return;
- }
+ if (!m_frameView || !m_frameView->frame()->renderer())
+ return;
#ifdef QWEBKIT_TIME_RENDERING
QTime time;
void ScrollViewCanvasQt::mouseMoveEvent(QMouseEvent* ev)
{
- if (!m_frameView) {
- if (!updateFrameView())
- return;
- }
+ if (!m_frameView)
+ return;
m_frameView->handleMouseMoveEvent(PlatformMouseEvent(ev, 0));
}
void ScrollViewCanvasQt::mousePressEvent(QMouseEvent* ev)
{
- if (!m_frameView) {
- if (!updateFrameView() || !m_frameView->frame()->eventHandler())
- return;
- }
+ if (!m_frameView || !m_frameView->frame()->eventHandler())
+ return;
m_frameView->frame()->eventHandler()->handleMousePressEvent(PlatformMouseEvent(ev, 1));
}
void ScrollViewCanvasQt::mouseReleaseEvent(QMouseEvent* ev)
{
- if (!m_frameView) {
- if (!updateFrameView())
- return;
- }
+ if (!m_frameView)
+ return;
m_frameView->handleMouseReleaseEvent(PlatformMouseEvent(ev, 0));
}
{
PlatformKeyboardEvent kevent(ev, isKeyUp);
- if (!m_frameView) {
- if (!updateFrameView())
- return;
- }
+ if (!m_frameView)
+ return;
+
FrameQt* frame = static_cast<FrameQt*>(m_frameView->frame());
if (!frame)
return;
{
Q_OBJECT
public:
- ScrollViewCanvasQt(ScrollView*, QWidget* parent = 0);
+ ScrollViewCanvasQt(FrameView*, QWidget* parent = 0);
protected:
virtual void paintEvent(QPaintEvent*);
private:
void handleKeyEvent(QKeyEvent*, bool isKeyUp);
- bool updateFrameView();
- ScrollView* m_scrollView;
FrameView* m_frameView;
};
#include "config.h"
#include "ScrollView.h"
+#include "FrameView.h"
#include "FloatRect.h"
#include "IntPoint.h"
namespace WebCore {
ScrollView::ScrollView()
- : m_area(new QScrollArea(0))
+ : m_area(0)
{
- ScrollViewCanvasQt* canvas = new ScrollViewCanvasQt(this, m_area);
-
- setQWidget(m_area);
- m_area->setWidget(canvas);
}
ScrollView::~ScrollView()
{
}
-void ScrollView::setParentWidget(QWidget* parent)
+void ScrollView::setScrollArea(QScrollArea* area)
{
- Widget::setParentWidget(parent);
+ m_area = area;
+ if (isFrameView()) {
+ ScrollViewCanvasQt* canvas = new ScrollViewCanvasQt(static_cast<FrameView*>(this), m_area);
+ m_area->setWidget(canvas);
+ }
+ Widget::setQWidget(area);
}
void ScrollView::updateContents(const IntRect& updateRect, bool now)
void ScrollView::addChild(Widget* child)
{
- Q_ASSERT(child != 0);
- Q_ASSERT(m_area && m_area->widget());
+ notImplemented();
+// Q_ASSERT(child != 0);
+// Q_ASSERT(m_area && m_area->widget());
- child->setParentWidget(m_area->widget());
+// child->setParentWidget(m_area->widget());
}
void ScrollView::removeChild(Widget*)
return data->m_widget;
}
-void Widget::setParentWidget(QWidget* parent)
-{
- data->m_parent = parent;
-}
-
-QWidget* Widget::parentWidget() const
-{
- return data->m_parent;
-}
-
void Widget::setFrameGeometry(const IntRect& r)
{
if (!data->m_widget)
# Include file to make it easy to include WebKit into Qt projects
-INCLUDEPATH += $$PWD/JavaScriptCore \
- $$PWD/WebCore \
- $$PWD/WebCore/platform \
- $$PWD/WebCore/platform/qt \
- $$PWD/WebCore/platform/network \
- $$PWD/WebCore/platform/graphics \
- $$PWD/WebCore/editing \
- $$PWD/WebCore/page \
- $$PWD/WebCore/page/qt \
- $$PWD/WebCore/dom \
- $$PWD/WebCore/html \
- $$PWD/WebCore/history \
- $$PWD/WebCore/rendering \
- $$PWD/WebCore/loader \
- $$PWD/WebCore/loader/qt \
- $$PWD/WebCore/css \
- $$PWD/WebCore/bridge \
- $$PWD/WebKitQt/WebCoreSupport
+INCLUDEPATH += $$PWD/WebKitQt/Api
DEFINES += BUILDING_QT__=1
--- /dev/null
+/*
+ Copyright (C) 2007 Trolltech ASA
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+ This class provides all functionality needed for loading images, style sheets and html
+ pages from the web. It has a memory cache for these objects.
+*/
+#include "qwebframe.h"
+#include "qwebpage.h"
+#include "qwebpage_p.h"
+#include "qwebframe_p.h"
+
+#include <qdebug.h>
+
+#include "FrameLoaderClientQt.h"
+#include "FrameQtClient.h"
+#include "FrameQt.h"
+#include "FrameView.h"
+
+#include "markup.h"
+#include "RenderTreeAsText.h"
+#include "Element.h"
+#include "Document.h"
+
+#include "bindings/runtime.h"
+#include "bindings/runtime_root.h"
+#include "ExecState.h"
+#include "object.h"
+
+
+using namespace WebCore;
+
+QWebFrame::QWebFrame(QWebPage *parent)
+ : QScrollArea(parent)
+ , d(new QWebFramePrivate)
+{
+ d->frameLoaderClient = new FrameLoaderClientQt();
+ d->frame = new FrameQt(parent->d->page, 0, new FrameQtClient(), d->frameLoaderClient);
+ d->frameLoaderClient->setFrame(this, d->frame);
+
+ d->frameView = new FrameView(d->frame);
+ d->frameView->setScrollArea(this);
+ d->frame->setView(d->frameView);
+}
+
+
+QWebFrame::QWebFrame(QWebFrame *parent)
+ : QScrollArea(parent)
+ , d(new QWebFramePrivate)
+{
+// d->frameLoaderClient = new FrameLoaderClientQt();
+// d->frame = new FrameQt(page, 0, new FrameQtClient(), frameLoaderClient);
+// d->frameLoaderClient->setFrame(d->frame);
+
+// d->frameView = new FrameView(d->frame);
+// d->frameView->setScrollArea(this);
+// d->frame->setView(d->frameView);
+}
+
+QWebFrame::~QWebFrame()
+{
+ delete d->frame;
+}
+
+void QWebFrame::addToJSWindowObject(const QByteArray &name, QObject *object)
+{
+ KJS::Bindings::RootObject *root = d->frame->bindingRootObject();
+ KJS::ExecState *exec = root->interpreter()->globalExec();
+ KJS::JSObject *rootObject = root->interpreter()->globalObject();
+ KJS::JSObject *window = rootObject->get(exec, KJS::Identifier("window"))->getObject();
+ if (!window) {
+ qDebug() << "Warning: couldn't get window object";
+ return;
+ }
+
+ KJS::JSObject *testController =
+ KJS::Bindings::Instance::createRuntimeObject(KJS::Bindings::Instance::QtLanguage,
+ object, root);
+
+ window->put(exec, KJS::Identifier(name.constData()), testController);
+}
+
+
+QString QWebFrame::markup() const
+{
+ return createMarkup(d->frame->document());
+}
+
+QString QWebFrame::innerText() const
+{
+ Element *documentElement = d->frame->document()->documentElement();
+ return documentElement->innerText();
+}
+
+QString QWebFrame::renderTreeDump() const
+{
+ return externalRepresentation(d->frame->renderer());
+}
+
+
+#include "qwebframe.moc"
--- /dev/null
+/*
+ Copyright (C) 2007 Trolltech ASA
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+ This class provides all functionality needed for loading images, style sheets and html
+ pages from the web. It has a memory cache for these objects.
+*/
+
+#ifndef QWEBFRAME_H
+#define QWEBFRAME_H
+
+#include <qscrollarea.h>
+
+class QWebFramePrivate;
+class QWebPage;
+
+namespace WebCore {
+ class FrameLoaderClientQt;
+}
+
+class QWebFrame : public QScrollArea
+{
+ Q_OBJECT
+public:
+ QWebFrame(QWebPage *parent);
+ QWebFrame(QWebFrame *parent);
+ ~QWebFrame();
+
+ void addToJSWindowObject(const QByteArray &name, QObject *object);
+ QString markup() const;
+ QString innerText() const;
+ QString renderTreeDump() const;
+
+signals:
+ void cleared();
+ void loadDone();
+
+private:
+ friend class QWebPage;
+ friend class WebCore::FrameLoaderClientQt;
+ QWebFramePrivate *d;
+};
+
+
+
+#endif
--- /dev/null
+/*
+ Copyright (C) 2007 Trolltech ASA
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+ This class provides all functionality needed for loading images, style sheets and html
+ pages from the web. It has a memory cache for these objects.
+*/
+#ifndef QWEBFRAME_P_H
+#define QWEBFRAME_P_H
+
+#include "qwebframe.h"
+#include "qwebpage_p.h"
+
+namespace WebCore
+{
+ class FrameLoaderClientQt;
+ class FrameQt;
+ class FrameView;
+}
+
+class QWebFramePrivate
+{
+public:
+ QWebFramePrivate()
+ : frameLoaderClient(0)
+ , frame(0)
+ , frameView(0)
+ {}
+ WebCore::FrameLoaderClientQt *frameLoaderClient;
+ WebCore::FrameQt *frame;
+ WebCore::FrameView *frameView;
+};
+
+
+#endif
--- /dev/null
+/*
+ Copyright (C) 2007 Trolltech ASA
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+ This class provides all functionality needed for loading images, style sheets and html
+ pages from the web. It has a memory cache for these objects.
+*/
+
+#include "qwebpage.h"
+#include "qwebframe.h"
+#include "qwebpage_p.h"
+#include "qwebframe_p.h"
+
+#include <qurl.h>
+
+#include "FrameQt.h"
+#include "ChromeClientQt.h"
+#include "ContextMenuClientQt.h"
+#include "EditorClientQt.h"
+#include "Page.h"
+#include "FrameLoader.h"
+#include "KURL.h"
+#include "qboxlayout.h"
+
+using namespace WebCore;
+
+QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
+ : q(qq)
+{
+ chromeClient = new ChromeClientQt(q);
+ contextMenuClient = new ContextMenuClientQt();
+ editorClient = new EditorClientQt();
+ page = new Page(chromeClient, contextMenuClient, editorClient);
+
+ mainFrame = 0;
+}
+
+QWebPagePrivate::~QWebPagePrivate()
+{
+ delete page;
+}
+
+void QWebPagePrivate::createMainFrame()
+{
+ if (!mainFrame) {
+ mainFrame = q->createFrame(0);
+ layout->addWidget(mainFrame);
+ }
+}
+
+
+QWebPage::QWebPage(QWidget *parent)
+ : QWidget(parent)
+ , d(new QWebPagePrivate(this))
+{
+ d->layout = new QVBoxLayout(this);
+ d->layout->setMargin(0);
+ d->layout->setSpacing(0);
+}
+
+QWebPage::~QWebPage()
+{
+ delete d;
+}
+
+QWebFrame *QWebPage::createFrame(QWebFrame *parentFrame)
+{
+ if (parentFrame)
+ return new QWebFrame(parentFrame);
+ return new QWebFrame(this);
+}
+
+void QWebPage::open(const QUrl &url)
+{
+ d->createMainFrame();
+
+ d->mainFrame->d->frame->loader()->load(KURL(url.toString()));
+}
+
+QWebFrame *QWebPage::mainFrame() const
+{
+ d->createMainFrame();
+ return d->mainFrame;
+}
+
+
+QSize QWebPage::sizeHint() const
+{
+ return QSize(800, 600);
+}
+
+#include "qwebpage.moc"
+
--- /dev/null
+/*
+ Copyright (C) 2007 Trolltech ASA
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+ This class provides all functionality needed for loading images, style sheets and html
+ pages from the web. It has a memory cache for these objects.
+*/
+
+#ifndef QWEBPAGE_H
+#define QWEBPAGE_H
+
+#include <qwidget.h>
+class QWebFrame;
+class QUrl;
+
+class QWebPagePrivate;
+
+class QWebPage : public QWidget
+{
+ Q_OBJECT
+public:
+ QWebPage(QWidget *parent);
+ ~QWebPage();
+
+ virtual QWebFrame *createFrame(QWebFrame *parentFrame);
+ //virtual QWebPage *createPage(...);
+
+ void open(const QUrl &url);
+
+
+ QWebFrame *mainFrame() const;
+
+ QSize sizeHint() const;
+
+
+private:
+ friend class QWebFrame;
+ QWebPagePrivate *d;
+};
+
+
+
+#endif
--- /dev/null
+/*
+ Copyright (C) 2007 Trolltech ASA
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+ This class provides all functionality needed for loading images, style sheets and html
+ pages from the web. It has a memory cache for these objects.
+*/
+#ifndef QWEBPAGE_P_H
+#define QWEBPAGE_P_H
+
+#include "qwebpage.h"
+#include "qwebframe.h"
+
+namespace WebCore
+{
+ class ChromeClientQt;
+ class ContextMenuClientQt;
+ class EditorClientQt;
+ class Page;
+}
+
+class QVBoxLayout;
+
+class QWebPagePrivate
+{
+public:
+ QWebPagePrivate(QWebPage *);
+ ~QWebPagePrivate();
+ void createMainFrame();
+
+ WebCore::ChromeClientQt *chromeClient;
+ WebCore::ContextMenuClientQt *contextMenuClient;
+ WebCore::EditorClientQt *editorClient;
+ WebCore::Page *page;
+
+ QWebFrame *mainFrame;
+ QVBoxLayout *layout;
+
+ QWebPage *q;
+};
+
+#endif
+2007-01-16 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack
+
+ Added the start of a public API to the Qt build
+ of WebKit. Currently we have QWebPage and QWebFrame
+ with a few small methods.
+
+ Converted the QtLauncher to use the new public API.
+
+ * Api/qwebframe.cpp: Added.
+ (QWebFrame::QWebFrame):
+ (QWebFrame::~QWebFrame):
+ (QWebFrame::addToJSWindowObject):
+ (QWebFrame::markup):
+ (QWebFrame::innerText):
+ (QWebFrame::renderTreeDump):
+ * Api/qwebframe.h: Added.
+ * Api/qwebframe_p.h: Added.
+ (QWebFramePrivate::QWebFramePrivate):
+ * Api/qwebpage.cpp: Added.
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPagePrivate::~QWebPagePrivate):
+ (QWebPagePrivate::createMainFrame):
+ (QWebPage::QWebPage):
+ (QWebPage::~QWebPage):
+ (QWebPage::createFrame):
+ (QWebPage::open):
+ (QWebPage::mainFrame):
+ (QWebPage::sizeHint):
+ * Api/qwebpage.h: Added.
+ * Api/qwebpage_p.h: Added.
+ * QtLauncher/main.cpp:
+ (main):
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::ChromeClientQt):
+ (WebCore::ChromeClientQt::setWindowRect):
+ (WebCore::ChromeClientQt::windowRect):
+ (WebCore::ChromeClientQt::pageRect):
+ (WebCore::ChromeClientQt::focus):
+ (WebCore::ChromeClientQt::unfocus):
+ (WebCore::ChromeClientQt::canTakeFocus):
+ (WebCore::ChromeClientQt::takeFocus):
+ (WebCore::ChromeClientQt::createWindow):
+ (WebCore::ChromeClientQt::createModalDialog):
+ (WebCore::ChromeClientQt::show):
+ (WebCore::ChromeClientQt::addMessageToConsole):
+ (WebCore::ChromeClientQt::chromeDestroyed):
+ (WebCore::ChromeClientQt::canRunBeforeUnloadConfirmPanel):
+ (WebCore::ChromeClientQt::runBeforeUnloadConfirmPanel):
+ (WebCore::ChromeClientQt::closeWindowSoon):
+ * WebCoreSupport/ChromeClientQt.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::setFrame):
+ (WebCore::FrameLoaderClientQt::detachFrameLoader):
+ (WebCore::FrameLoaderClientQt::dispatchDidHandleOnloadEvents):
+ (WebCore::FrameLoaderClientQt::partClearedInBegin):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
2007-01-15 Anders Carlsson <acarlsson@apple.com>
Fix build.
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <wtf/Platform.h>
-
#include <QApplication>
-#include <QWidget>
-#if PLATFORM(KDE)
-#include <kapplication.h>
-#include <kcmdlineargs.h>
-#include <kdebug.h>
-#endif
-
-#include <Document.h>
-#include <FrameView.h>
-#include <ChromeClientQt.h>
-#include <ContextMenuClientQt.h>
-#include <EditorClientQt.h>
-#include <KURL.h>
-
-#include <FrameQt.h>
-#include <FrameLoaderClientQt.h>
-#include <page/Page.h>
+#include <qwebpage.h>
#include <QVBoxLayout>
#include <QDir>
-
-using namespace WebCore;
-
-#if PLATFORM(KDE)
-static KCmdLineOptions options[] =
-{
- { "+file", "File to load", 0 },
- KCmdLineLastOption
-};
-#endif
-
+#include <QUrl>
+
int main(int argc, char **argv)
{
QString url = QString("%1/%2").arg(QDir::homePath()).arg(QLatin1String("index.html"));
-#if PLATFORM(KDE)
- KCmdLineArgs::init(argc, argv, "testunity", "testunity",
- "unity testcase app", "0.1");
- KCmdLineArgs::addCmdLineOptions(options);
- KApplication app;
- KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
-
- if (args->count() != 0)
- url = args->arg(0);
-#else
QApplication app(argc, argv);
const QStringList args = app.arguments();
if (args.count() > 1)
url = args.at(1);
-#endif
QWidget topLevel;
QBoxLayout *l = new QVBoxLayout(&topLevel);
-
- // Initialize WebCore in Qt platform mode...
- Page* page = new Page(new ChromeClientQt(), new ContextMenuClientQt(),
- new EditorClientQt());
- FrameLoaderClientQt *frameLoaderClient = new FrameLoaderClientQt();
- FrameQt* frame = new FrameQt(page, 0, new FrameQtClient(), frameLoaderClient);
- frameLoaderClient->setFrame(frame);
-
- FrameView* frameView = new FrameView(frame);
- frame->setView(frameView);
- frameView->setParentWidget(&topLevel);
- l->addWidget(frame->view()->qwidget());
- l->activate();
- frame->view()->qwidget()->show();
+ QWebPage *page = new QWebPage(&topLevel);
+ l->addWidget(page);
topLevel.show();
- QtFrame(frame)->client()->openURL(KURL(url.toLatin1()));
+ page->open(url);
app.exec();
- delete frame;
return 0;
}
#include "FrameView.h"
#include "FrameLoadRequest.h"
-#include <QWidget>
+#include "qwebpage.h"
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
namespace WebCore
{
-static QWidget* rootWindowForFrame(const Frame* frame)
-{
- FrameView* frameView = (frame ? frame->view() : 0);
- if (!frameView)
- return 0;
-
- return frameView->qwidget();
-}
-ChromeClientQt::ChromeClientQt()
+ChromeClientQt::ChromeClientQt(QWebPage* webPage)
+ : m_webPage(webPage)
{
}
Shared<ChromeClientQt>::deref();
}
-void ChromeClientQt::setWindowRect(const FloatRect&)
+void ChromeClientQt::setWindowRect(const FloatRect& rect)
{
- notImplemented();
-#if 0
- QWidget* widget = rootWindowForFrame(mainFrame());
- if (widget)
- widget->setGeometry(QRect(qRound(r.x()), qRound(r.y()),
- qRound(r.width()), qRound(r.height())));
-#endif
+ if (!m_webPage)
+ return;
+// m_webPage->emit setWindowRect(QRect(qRound(r.x()), qRound(r.y()),
+// qRound(r.width()), qRound(r.height())));
}
FloatRect ChromeClientQt::windowRect()
{
-#if 0
- QWidget* widget = rootWindowForFrame(mainFrame());
- if (!widget)
+ if (!m_webPage)
return FloatRect();
- return IntRect(widget->geometry());
-#endif
- notImplemented();
- return IntRect(0, 0, 100, 100);
+ return IntRect(m_webPage->topLevelWidget()->geometry());
}
FloatRect ChromeClientQt::pageRect()
{
- notImplemented();
- return FloatRect(0, 0, 100, 100);
+ if (!m_webPage)
+ return FloatRect();
+ return FloatRect(QRectF(m_webPage->rect()));
}
void ChromeClientQt::focus()
{
- notImplemented();
+ if (!m_webPage)
+ return;
+ m_webPage->setFocus();
}
void ChromeClientQt::unfocus()
{
- notImplemented();
+ if (!m_webPage)
+ return;
+ m_webPage->clearFocus();
}
bool ChromeClientQt::canTakeFocus(FocusDirection)
{
- notImplemented();
- return true;
+ if (!m_webPage)
+ return false;
+ return m_webPage->focusPolicy() != Qt::NoFocus;
}
void ChromeClientQt::takeFocus(FocusDirection)
{
- notImplemented();
+ if (!m_webPage)
+ return;
+ m_webPage->clearFocus();
}
-Page* ChromeClientQt::createWindow(const FrameLoadRequest&)
+Page* ChromeClientQt::createWindow(const FrameLoadRequest& request)
{
+ //QWebPage *newPage = m_webPage->createWindow(...);
notImplemented();
return 0;
}
Page* ChromeClientQt::createModalDialog(const FrameLoadRequest&)
{
+ notImplemented();
return 0;
}
void ChromeClientQt::show()
{
- notImplemented();
+ if (!m_webPage)
+ return;
+ m_webPage->topLevelWidget()->show();
}
void ChromeClientQt::addMessageToConsole(const String& message, unsigned int lineNumber,
const String& sourceID)
{
+ notImplemented();
}
void ChromeClientQt::chromeDestroyed()
{
+ notImplemented();
}
bool ChromeClientQt::canRunBeforeUnloadConfirmPanel()
{
+ notImplemented();
}
bool ChromeClientQt::runBeforeUnloadConfirmPanel(const String& message, Frame* frame)
{
+ notImplemented();
}
void ChromeClientQt::closeWindowSoon()
{
+ notImplemented();
}
}
#include "FloatRect.h"
#include "Shared.h"
+class QWebPage;
+
namespace WebCore {
class FloatRect;
class ChromeClientQt : public ChromeClient,
public Shared<ChromeClientQt> {
public:
- ChromeClientQt();
+ ChromeClientQt(QWebPage* webPage);
virtual ~ChromeClientQt();
virtual void chromeDestroyed();
virtual bool runBeforeUnloadConfirmPanel(const String& message, Frame* frame);
virtual void closeWindowSoon();
+
+ QWebPage* m_webPage;
};
}
#include "DocumentLoader.h"
#include "ResourceResponse.h"
#include "qdebug.h"
+#include "qwebframe.h"
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d (%s)\n", __FILE__, __LINE__, __FUNCTION__); } while(0)
{
}
-void FrameLoaderClientQt::setFrame(FrameQt *frame)
+void FrameLoaderClientQt::setFrame(QWebFrame *webFrame, FrameQt *frame)
{
+ m_webFrame = webFrame;
m_frame = frame;
}
void FrameLoaderClientQt::detachFrameLoader()
{
+ m_webFrame = 0;
m_frame = 0;
}
void FrameLoaderClientQt::dispatchDidHandleOnloadEvents()
{
- //notImplemented();
+ emit m_webFrame->loadDone();
}
void FrameLoaderClientQt::partClearedInBegin()
{
- notImplemented();
+ emit m_webFrame->cleared();
}
void FrameLoaderClientQt::setDocumentViewFromPageCache(WebCore::PageCache*)
#include "FrameLoader.h"
#include "Shared.h"
#include "ResourceResponse.h"
+class QWebFrame;
namespace WebCore {
public:
FrameLoaderClientQt();
~FrameLoaderClientQt();
- void setFrame(FrameQt *frame);
+ void setFrame(QWebFrame *webFrame, FrameQt *frame);
virtual void detachFrameLoader();
virtual void ref();
private:
Frame *m_frame;
+ QWebFrame *m_webFrame;
ResourceResponse m_response;
bool m_firstData;
};
+2007-01-16 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Zack
+
+ Use the new public API for the Qt build, and don't rely on
+ WebKit internals anymore.
+
+ * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ (WebCore::DumpRenderTree::~DumpRenderTree):
+ (WebCore::DumpRenderTree::open):
+ (WebCore::DumpRenderTree::readStdin):
+ (WebCore::DumpRenderTree::initJSObjects):
+ (WebCore::DumpRenderTree::dump):
+ * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.h:
+ * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.pro:
+ * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTreeClient.cpp: Removed.
+ * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTreeClient.h: Removed.
+ * DumpRenderTree/DumpRenderTree.qtproj/jsobjects.cpp:
+ (LayoutTestController::notifyDone):
+ (LayoutTestController::timerEvent):
+ * DumpRenderTree/DumpRenderTree.qtproj/main.cpp:
+ (main):
+ * DumpRenderTree/DumpRenderTree.qtproj/tests-skipped.txt:
+
2007-01-15 Justin Garcia <justin.garcia@apple.com>
Reviewed by mjs
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "config.h"
#include "DumpRenderTree.h"
-#include "DumpRenderTreeClient.h"
#include "jsobjects.h"
-#include "Page.h"
-#include "markup.h"
-#include "Document.h"
-#include "FrameView.h"
-#include "KURL.h"
-#include "FrameLoader.h"
-#include "RenderTreeAsText.h"
-#include "ChromeClientQt.h"
-#include "ContextMenuClientQt.h"
-#include "EditorClientQt.h"
-#include "FrameLoaderClientQt.h"
-#include "CString.h"
-
-#include "bindings/runtime.h"
-#include "bindings/runtime_root.h"
-#include "ExecState.h"
-#include "object.h"
-
-#include "Document.h"
-#include "Element.h"
-
#include <QDir>
#include <QFile>
#include <QTimer>
#include <QBoxLayout>
#include <QScrollArea>
#include <QApplication>
+#include <QUrl>
+
+#include <qwebpage.h>
+#include <qwebframe.h>
#include <unistd.h>
#include <qdebug.h>
const unsigned int maxViewHeight = 600;
DumpRenderTree::DumpRenderTree()
- : m_frame(0)
- , m_client(new DumpRenderTreeClient(this))
- , m_stdin(0)
+ : m_stdin(0)
, m_notifier()
, m_loading(false)
{
- // Initialize WebCore in Qt platform mode...
- Page* page = new Page(new ChromeClientQt(), new ContextMenuClientQt(), new EditorClientQt());
- m_frame = new FrameQt(page, 0, new FrameQtClient(), m_client);
- m_client->setFrame(m_frame);
-
- FrameView* view = new FrameView(m_frame);
- view->setScrollbarsMode(ScrollbarAlwaysOff);
-
- m_frame->setView(view);
- view->setParentWidget(0 /* no toplevel widget */);
+ page = new QWebPage(0);
+ frame = page->mainFrame();
+ frame->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ frame->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+
m_controller = new LayoutTestController();
QObject::connect(m_controller, SIGNAL(done()), this, SLOT(dump()), Qt::QueuedConnection);
QObject::connect(this, SIGNAL(quit()), qApp, SLOT(quit()), Qt::QueuedConnection);
+ QObject::connect(frame, SIGNAL(cleared()), this, SLOT(initJSObjects()));
+ QObject::connect(frame, SIGNAL(loadDone()), this, SLOT(maybeDump()));
-
- // Reverse calculations in QAbstractScrollArea::maximumViewportSize()
- QScrollArea* area = qobject_cast<QScrollArea*>(m_frame->view()->qwidget());
-
- unsigned int viewWidth = maxViewWidth + 2 * area->frameWidth();
- unsigned int viewHeight = maxViewHeight + 2 * area->frameWidth();
-
- area->resize(viewWidth, viewHeight);
+ page->resize(800, 800);
// Read file containing to be skipped tests...
readSkipFile();
DumpRenderTree::~DumpRenderTree()
{
- delete m_frame;
+ delete page;
delete m_stdin;
delete m_notifier;
}
}
-void DumpRenderTree::open(const KURL& url)
+void DumpRenderTree::open(const QUrl& url)
{
resetJSObjects();
- Q_ASSERT(url.isLocalFile());
// Ignore skipped tests
if (m_skipped.indexOf(url.path()) != -1) {
return;
}
- m_frame->client()->openURL(url);
+ page->open(url);
}
void DumpRenderTree::readStdin(int /* socket */)
if (line.endsWith('\n'))
line.truncate(line.size()-1);
if (!line.isEmpty())
- open(KURL(line));
+ open(QUrl(QString(line)));
}
void DumpRenderTree::readSkipFile()
void DumpRenderTree::initJSObjects()
{
- KJS::Bindings::RootObject *root = m_frame->bindingRootObject();
- KJS::ExecState *exec = root->interpreter()->globalExec();
- KJS::JSObject *rootObject = root->interpreter()->globalObject();
- KJS::JSObject *window = rootObject->get(exec, KJS::Identifier("window"))->getObject();
- if (!window) {
- qDebug() << "Warning: couldn't get window object";
- return;
- }
-
- KJS::JSObject *testController =
- KJS::Bindings::Instance::createRuntimeObject(KJS::Bindings::Instance::QtLanguage,
- m_controller, root);
-
- window->put(exec, KJS::Identifier("layoutTestController"), testController);
-
+ frame->addToJSWindowObject("layoutTestController", m_controller);
}
void DumpRenderTree::dump()
//qDebug() << ">>>>>>>>>>>>>>>>>>>>>> Dumping" << m_frame->loader()->URL().url();
if (!m_notifier) {
// Dump markup in single file mode...
- DeprecatedString markup = createMarkup(m_frame->document());
- fprintf(stdout, "Source:\n\n%s\n", markup.ascii());
+ QString markup = frame->markup();
+ fprintf(stdout, "Source:\n\n%s\n", markup.toUtf8().constData());
}
// Dump render text...
- String renderDump;
+ QString renderDump;
if (m_controller->shouldDumpAsText()) {
- Element *documentElement = m_frame->document()->documentElement();
- renderDump = documentElement->innerText();
+ renderDump = frame->innerText();
renderDump.append("\n");
} else {
- renderDump = externalRepresentation(m_frame->renderer());
+ renderDump = frame->renderTreeDump();
}
if (renderDump.isEmpty()) {
printf("ERROR: nil result from %s", m_controller->shouldDumpAsText() ? "[documentElement innerText]" : "[frame renderTreeAsExternalRepresentation]");
} else {
- fprintf(stdout, "%s#EOF\n", renderDump.utf8().data());
+ fprintf(stdout, "%s#EOF\n", renderDump.toUtf8().constData());
}
fflush(stdout);
dump();
}
-FrameQt* DumpRenderTree::frame() const
-{
- return m_frame;
-}
-
}
#include <QObject>
#include <QTextStream>
#include <QSocketNotifier>
+class QUrl;
class QFile;
+class QWebPage;
+class QWebFrame;
-#include "DumpRenderTreeClient.h"
class LayoutTestController;
namespace WebCore {
void open();
// Initialize in single-file mode.
- void open(const KURL& url);
+ void open(const QUrl& url);
- void initJSObjects();
void resetJSObjects();
public Q_SLOTS:
+ void initJSObjects();
void readStdin(int);
void maybeDump();
void dump();
Q_SIGNALS:
void quit();
-private:
- friend class DumpRenderTreeClient;
-
- FrameQt* frame() const;
private:
void readSkipFile();
-
- FrameQt* m_frame;
- DumpRenderTreeClient* m_client;
+
+ QWebPage *page;
+ QWebFrame *frame;
+
LayoutTestController *m_controller;
QFile *m_stdin;
QT = core gui
-HEADERS = DumpRenderTreeClient.h DumpRenderTree.h jsobjects.h
-SOURCES = DumpRenderTreeClient.cpp DumpRenderTree.cpp main.cpp jsobjects.cpp
+HEADERS = DumpRenderTree.h jsobjects.h
+SOURCES = DumpRenderTree.cpp main.cpp jsobjects.cpp
unix:!mac {
SOURCES += fontoverload.cpp
+++ /dev/null
-/*
- * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "DumpRenderTreeClient.h"
-
-#include "DumpRenderTree.h"
-
-#include <QDebug>
-
-namespace WebCore {
-
-DumpRenderTreeClient::DumpRenderTreeClient(DumpRenderTree *d)
- : FrameLoaderClientQt(), dumper(d)
-{
-}
-
-DumpRenderTreeClient::~DumpRenderTreeClient()
-{
-}
-
-void DumpRenderTreeClient::partClearedInBegin()
-{
- dumper->initJSObjects();
-}
-
-void DumpRenderTreeClient::dispatchDidHandleOnloadEvents()
-{
- dumper->maybeDump();
-}
-
-}
-
-// vim: ts=4 sw=4 et
+++ /dev/null
-/*
- * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef DumpRenderTreeClient_H
-#define DumpRenderTreeClient_H
-
-#include "FrameLoaderClientQt.h"
-
-namespace WebCore {
-class DumpRenderTree;
-
-class DumpRenderTreeClient : public FrameLoaderClientQt
-{
-public:
- DumpRenderTreeClient(DumpRenderTree *d);
- virtual ~DumpRenderTreeClient();
-
- virtual void partClearedInBegin();
- void dispatchDidHandleOnloadEvents();
-
-private:
- DumpRenderTree *dumper;
-};
-
-}
-
-#endif
-
-// vim: ts=4 sw=4 et
void LayoutTestController::notifyDone()
{
- //qDebug() << ">>>>notifyDone"; emit done();
+ //qDebug() << ">>>>notifyDone";
+ killTimer(timeoutTimer);
+ timeoutTimer = 0;
+ emit done();
}
void LayoutTestController::dumpEditingCallbacks()
void LayoutTestController::timerEvent(QTimerEvent *)
{
qDebug() << ">>>>>>>>>>>>> timeout";
- killTimer(timeoutTimer);
- timeoutTimer = 0;
notifyDone();
}
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "config.h"
#include "DumpRenderTree.h"
-#include "KURL.h"
+#include "qurl.h"
+#include "qdir.h"
#include <qstringlist.h>
+#include <qapplication.h>
-using namespace WebCore;
-
-#if PLATFORM(KDE)
-#include <kapplication.h>
-#include <kcmdlineargs.h>
-static KCmdLineOptions options[] =
-{
- { "+file", "File to load", 0 },
- KCmdLineLastOption
-};
-#else
-#include <qapplication.h>
-#endif
int main(int argc, char* argv[])
{
-#if PLATFORM(KDE)
- KCmdLineArgs::init(argc, argv, "DumpRenderTree", "DumpRenderTree", "testing application", "0.1");
- KCmdLineArgs::addCmdLineOptions(options);
-
- KApplication app;
- KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
-
- WebCore::DumpRenderTree dumper;
-
- if (args->count() == 1 && args->arg(0) == QString::fromAscii("-"))
- dumper.open();
- else if (args->count() == 1)
- dumper.open(KURL(args->arg(0)));
-
- return app.exec();
-#else
QApplication app(argc, argv);
- const QStringList args = app.arguments();
+ QStringList args = app.arguments();
WebCore::DumpRenderTree dumper;
if (args.count() == 2 && args[1] == QLatin1String("-"))
dumper.open();
- else if (args.count() == 2)
- dumper.open(KURL(args[1]));
-
+ else if (args.count() == 2) {
+ if (!args[1].startsWith("/")
+ && !args[1].startsWith("file:")) {
+ QString path = QDir::currentPath();
+ if (!path.endsWith('/'))
+ path.append('/');
+ args[1].prepend(path);
+ }
+ dumper.open(QUrl(args[1]));
+ }
return app.exec();
-
-#endif
}
# These tests hang forever
editing/selection/extend-by-word-002.html
+# tests that currently crash
+fast/borders/border-radius-huge-assert.html
+
# As kcanvas is in the process of being killed,
# we didn't even start implementing filtrs / masks
# on Qt/Linux. Disabling the crashing tests for now.