Commit d5ce6095 authored by mjs's avatar mjs

Reviewed by Darin.

        - make win32 DumpRenderTree run without crashing
        http://bugzilla.opendarwin.org/show_bug.cgi?id=7511

        * WebCore.vcproj/WebCore/WebCore.vcproj:
        * bridge/win/BrowserExtensionWin.h: Added.
        * bridge/win/FrameWin.cpp:
        (WebCore::FrameWin::FrameWin): Initialize browser
        extension and settings.
        * dom/DocumentImpl.cpp:
        (WebCore::DocumentImpl::attach): Don't create renderers 
        for now.
        * dom/EventNames.cpp:
        (WebCore::EventNames::init): use placement new even when
        not avoiding static constructors.
        * khtml/html/htmlnames.cpp:
        (WebCore::HTMLNames::init): ditto
        * dom/QualifiedName.cpp:
        (WebCore::QualifiedName::init): ditto
        * dom/QualifiedName.h:
        (WebCore::QualifiedName::QualifiedName): Added default
        constructor but only in ifdef.
        * page/Frame.h:
        * platform/AtomicString.cpp:
        (WebCore::AtomicString::init): use placement new even when
        not avoiding static constructors
        * platform/StaticConstructors.h: don't initialize when
        not avoiding static constructors, just default construct
        and let initialization happen normally
        * platform/win/TemporaryLinkStubs.cpp: Stub out some more things
        (Cursor::~Cursor):
        (QFont::~QFont):
        (QFontMetrics::~QFontMetrics):
        (WebCore::FrameWin::restoreDocumentState):
        (WebCore::FrameWin::partClearedInBegin):
        (WebCore::FrameWin::createEmptyDocument):
        (WebCore::BrowserExtensionWin::getHistoryLength):
        (WebCore::BrowserExtensionWin::canRunModal):
        (WebCore::BrowserExtensionWin::openURLNotify):
        (WebCore::BrowserExtensionWin::canRunModalNow):
        (WebCore::BrowserExtensionWin::runModal):
        (WebCore::BrowserExtensionWin::goBackOrForward):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@13057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent eaa4b2b4
2006-02-28 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- make win32 DumpRenderTree run without crashing
http://bugzilla.opendarwin.org/show_bug.cgi?id=7511
* WebCore.vcproj/WebCore/WebCore.vcproj:
* bridge/win/BrowserExtensionWin.h: Added.
* bridge/win/FrameWin.cpp:
(WebCore::FrameWin::FrameWin): Initialize browser
extension and settings.
* dom/DocumentImpl.cpp:
(WebCore::DocumentImpl::attach): Don't create renderers
for now.
* dom/EventNames.cpp:
(WebCore::EventNames::init): use placement new even when
not avoiding static constructors.
* khtml/html/htmlnames.cpp:
(WebCore::HTMLNames::init): ditto
* dom/QualifiedName.cpp:
(WebCore::QualifiedName::init): ditto
* dom/QualifiedName.h:
(WebCore::QualifiedName::QualifiedName): Added default
constructor but only in ifdef.
* page/Frame.h:
* platform/AtomicString.cpp:
(WebCore::AtomicString::init): use placement new even when
not avoiding static constructors
* platform/StaticConstructors.h: don't initialize when
not avoiding static constructors, just default construct
and let initialization happen normally
* platform/win/TemporaryLinkStubs.cpp: Stub out some more things
(Cursor::~Cursor):
(QFont::~QFont):
(QFontMetrics::~QFontMetrics):
(WebCore::FrameWin::restoreDocumentState):
(WebCore::FrameWin::partClearedInBegin):
(WebCore::FrameWin::createEmptyDocument):
(WebCore::BrowserExtensionWin::getHistoryLength):
(WebCore::BrowserExtensionWin::canRunModal):
(WebCore::BrowserExtensionWin::openURLNotify):
(WebCore::BrowserExtensionWin::canRunModalNow):
(WebCore::BrowserExtensionWin::runModal):
(WebCore::BrowserExtensionWin::goBackOrForward):
2006-02-27 Eric Seidel <eseidel@apple.com>
Reviewed by mjs.
......
......@@ -2939,6 +2939,10 @@
<Filter
Name="win"
>
<File
RelativePath="..\..\bridge\win\BrowserExtensionWin.h"
>
</File>
<File
RelativePath="..\..\bridge\win\FrameWin.cpp"
>
......
/*
* Copyright (C) 2005, 2006 Apple Computer, Inc. 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 "BrowserExtension.h"
namespace WebCore {
class Frame;
class WinFrame;
class BrowserExtensionWin : public BrowserExtension {
public:
BrowserExtensionWin(Frame*);
virtual void openURLRequest(const KURL &,
const URLArgs &args = URLArgs());
virtual void openURLNotify();
virtual void createNewWindow(const KURL &url,
const URLArgs &urlArgs = URLArgs());
virtual void createNewWindow(const KURL& url,
const URLArgs& urlArgs,
const WindowArgs& winArgs,
Frame*& part);
virtual void setIconURL(const KURL &url);
virtual void setTypedIconURL(const KURL &url, const QString &type);
virtual int getHistoryLength();
virtual void goBackOrForward(int distance);
virtual bool canRunModal();
virtual bool canRunModalNow();
virtual void runModal();
private:
WinFrame *m_frame;
};
}
......@@ -26,11 +26,20 @@
#include "config.h"
#include "FrameWin.h"
#include "BrowserExtensionWin.h"
#include "DocumentImpl.h"
#include "KWQKHTMLSettings.h"
#include "render_frames.h"
#include "Plugin.h"
#include "FramePrivate.h"
namespace WebCore {
FrameWin::FrameWin(Page* page, RenderPart* renderPart)
: Frame(page, renderPart)
{
d->m_extension = new BrowserExtensionWin(this);
setSettings(new KHTMLSettings());
}
FrameWin::~FrameWin()
......
......@@ -904,7 +904,11 @@ void DocumentImpl::attach()
m_renderArena = new RenderArena();
// Create the rendering tree
#ifndef WIN32
// FIXME: don't build renderers on Windows yet
setRenderer(new (m_renderArena) RenderCanvas(this, m_view));
#endif
recalcStyle(Force);
RenderObject* render = renderer();
......
......@@ -40,15 +40,13 @@ DOM_EVENT_NAMES_FOR_EACH(DEFINE_EVENT_GLOBAL)
void init()
{
#if AVOID_STATIC_CONSTRUCTORS
static bool initialized;
if (!initialized) {
// Use placement new to initialize the globals.
#define INITIALIZE_GLOBAL(name) new (&name##Event) AtomicString(#name);
#define INITIALIZE_GLOBAL(name) new ((void*)&name##Event) AtomicString(#name);
DOM_EVENT_NAMES_FOR_EACH(INITIALIZE_GLOBAL)
initialized = true;
}
#endif
}
} }
......@@ -23,6 +23,8 @@
#if AVOID_STATIC_CONSTRUCTORS
#define KHTML_QNAME_HIDE_GLOBALS 1
#else
#define QNAME_DEFAULT_CONSTRUCTOR
#endif
#include "QualifiedName.h"
......@@ -174,14 +176,12 @@ DEFINE_GLOBAL(QualifiedName, anyName, nullAtom, starAtom, starAtom);
void QualifiedName::init()
{
#if AVOID_STATIC_CONSTRUCTORS
static bool initialized;
if (!initialized) {
// Use placement new to initialize the globals.
new (&anyName) QualifiedName(nullAtom, starAtom, starAtom);
new ((void*)&anyName) QualifiedName(nullAtom, starAtom, starAtom);
initialized = true;
}
#endif
}
}
......@@ -39,6 +39,9 @@ public:
QualifiedName(const AtomicString& prefix, const AtomicString& localName, const AtomicString& namespaceURI);
~QualifiedName();
#ifdef QNAME_DEFAULT_CONSTRUCTOR
QualifiedName() { }
#endif
QualifiedName(const QualifiedName&);
const QualifiedName& operator=(const QualifiedName&);
......
......@@ -24,6 +24,8 @@
#if AVOID_STATIC_CONSTRUCTORS
#define DOM_HTMLNAMES_HIDE_GLOBALS 1
#else
#define QNAME_DEFAULT_CONSTRUCTOR 1
#endif
#include "htmlnames.h"
......@@ -45,16 +47,15 @@ void init()
{
static bool initialized;
if (!initialized) {
#if AVOID_STATIC_CONSTRUCTORS
// Use placement new to initialize the globals.
AtomicString xhtmlNS("http://www.w3.org/1999/xhtml");
// Namespace
new (&xhtmlNamespaceURI) AtomicString(xhtmlNS);
new ((void*)&xhtmlNamespaceURI) AtomicString(xhtmlNS);
// Tags
#define INITIALIZE_TAG_GLOBAL(name) new (&name##Tag) QualifiedName(nullAtom, #name, xhtmlNS);
#define INITIALIZE_TAG_GLOBAL(name) new ((void*)&name##Tag) QualifiedName(nullAtom, #name, xhtmlNS);
DOM_HTMLNAMES_FOR_EACH_TAG(INITIALIZE_TAG_GLOBAL)
// Attributes
......@@ -63,12 +64,8 @@ void init()
DOM_HTMLNAMES_FOR_EACH_ATTR(DEFINE_ATTR_STRING)
accept_charsetAttrString = "accept-charset";
http_equivAttrString = "http-equiv";
#define INITIALIZE_ATTR_GLOBAL(name) new (&name##Attr) QualifiedName(nullAtom, name##AttrString, nullAtom);
#define INITIALIZE_ATTR_GLOBAL(name) new ((void*)&name##Attr) QualifiedName(nullAtom, name##AttrString, nullAtom);
DOM_HTMLNAMES_FOR_EACH_ATTR(INITIALIZE_ATTR_GLOBAL)
#else
const_cast<QualifiedName&>(accept_charsetAttr) = QualifiedName(nullAtom, "accept-charset", nullAtom);
const_cast<QualifiedName&>(http_equivAttr) = QualifiedName(nullAtom, "http-equiv", nullAtom);
#endif
initialized = true;
}
}
......
......@@ -909,6 +909,7 @@ protected:
public:
friend class MacFrame;
friend class FrameWin;
void checkEmitLoadEvent();
bool didOpenURL(const KURL &);
......
......@@ -157,11 +157,8 @@ void AtomicString::remove(StringImpl* r)
stringTable->remove(r);
}
#if AVOID_STATIC_CONSTRUCTORS
DEFINE_GLOBAL(AtomicString, nullAtom)
#else
const AtomicString nullAtom;
#endif
DEFINE_GLOBAL(AtomicString, emptyAtom, "")
DEFINE_GLOBAL(AtomicString, textAtom, "#text")
DEFINE_GLOBAL(AtomicString, commentAtom, "#comment")
......@@ -169,21 +166,19 @@ DEFINE_GLOBAL(AtomicString, starAtom, "*")
void AtomicString::init()
{
#if AVOID_STATIC_CONSTRUCTORS
static bool initialized;
if (!initialized) {
stringTable = new HashSet<StringImpl*>;
// Use placement new to initialize the globals.
new (&nullAtom) AtomicString;
new (&emptyAtom) AtomicString("");
new (&textAtom) AtomicString("#text");
new (&commentAtom) AtomicString("#comment");
new (&starAtom) AtomicString("*");
new ((void*)&nullAtom) AtomicString;
new ((void*)&emptyAtom) AtomicString("");
new ((void*)&textAtom) AtomicString("#text");
new ((void*)&commentAtom) AtomicString("#comment");
new ((void*)&starAtom) AtomicString("*");
initialized = true;
}
#endif
}
}
......@@ -29,7 +29,7 @@
#if !AVOID_STATIC_CONSTRUCTORS
// Define an global in the normal way.
#define DEFINE_GLOBAL(type, name, ...) \
const type name(__VA_ARGS__);
const type name;
#else
// Define an correctly-sized array of pointers to avoid static initialization.
// Use an array of pointers instead of an array of char in case there is some alignment issue.
......
......@@ -34,6 +34,7 @@
#include "PlugInInfoStore.h"
#include "render_theme.h"
#include "FrameWin.h"
#include "BrowserExtensionWin.h"
using namespace WebCore;
......@@ -162,7 +163,7 @@ void QTextEdit::setSelectionRange(int,int) { notImplemented(); }
void QPainter::drawText(int,int,int,int,QChar const*,int,int,int,int,Color const&,QPainter::TextDirection,bool,int,int,bool) { notImplemented(); }
void ScrollView::scrollPointRecursively(int,int) { notImplemented(); }
IntSize QLineEdit::sizeForCharacterWidth(int) const { notImplemented(); return IntSize(); }
Cursor::~Cursor() { notImplemented(); }
Cursor::~Cursor() { }
IntRect QFontMetrics::selectionRectForText(int,int,int,int,int,QChar const*,int,int,int,int,bool,bool,int,int,bool) const { notImplemented(); return IntRect(); }
void ScrollView::suppressScrollBars(bool,bool) { notImplemented(); }
int QFontMetrics::checkSelectionPoint(QChar*,int,int,int,int,int,int,int,int,bool,int,bool,bool,bool) const { notImplemented(); return 0; }
......@@ -310,12 +311,12 @@ unsigned PlugInInfoStore::pluginCount() const { notImplemented(); return 0; }
void WebCore::refreshPlugins(bool) { notImplemented(); }
int WebCore::screenDepth(WebCore::Widget*) { notImplemented(); return 96; }
QFont::QFont() { }
QFont::~QFont() { notImplemented(); }
QFont::~QFont() { }
bool QFont::italic() const { notImplemented(); return false; }
int QFont::weight() const { notImplemented(); return QFont::Normal; }
static QFontMetrics localFontMetrics;
QFontMetrics::QFontMetrics() { }
QFontMetrics::~QFontMetrics() { notImplemented(); }
QFontMetrics::~QFontMetrics() { }
QFontMetrics::QFontMetrics(QFontMetrics const&) { notImplemented(); }
QFontMetrics& QFontMetrics::operator=(QFontMetrics const&) { notImplemented(); return localFontMetrics; }
float QFontMetrics::xHeight() const { notImplemented(); return 0; }
......@@ -345,7 +346,7 @@ Widget* WebCore::FrameView::topLevelWidget() const { notImplemented(); return 0;
class KJS::Bindings::Instance * WebCore::FrameWin::getObjectInstanceForWidget(class WebCore::Widget *) { notImplemented(); return 0; }
class KJS::Bindings::Instance * WebCore::FrameWin::getEmbedInstanceForWidget(class WebCore::Widget *) { notImplemented(); return 0; }
bool WebCore::FrameWin::canRedo(void)const { notImplemented(); return 0; }
void WebCore::FrameWin::restoreDocumentState(void) { notImplemented(); }
void WebCore::FrameWin::restoreDocumentState(void) { }
bool WebCore::FrameWin::canUndo(void)const { notImplemented(); return 0; }
bool WebCore::FrameWin::runJavaScriptPrompt(class WebCore::String const &,class WebCore::String const &,class WebCore::String &) { notImplemented(); return 0; }
void WebCore::FrameWin::recordFormValue(class QString const &,class QString const &,class WebCore::HTMLFormElementImpl *) { notImplemented(); }
......@@ -366,7 +367,7 @@ Widget* WebCore::FrameView::topLevelWidget() const { notImplemented(); return 0;
void WebCore::FrameWin::openURLRequest(class KURL const &,struct WebCore::URLArgs const &) { notImplemented(); }
void WebCore::FrameWin::addMessageToConsole(class WebCore::String const &,unsigned int,class WebCore::String const &) { notImplemented(); }
bool WebCore::FrameWin::passWheelEventToChildWidget(class WebCore::NodeImpl *) { notImplemented(); return 0; }
void WebCore::FrameWin::partClearedInBegin(void) { notImplemented(); }
void WebCore::FrameWin::partClearedInBegin(void) { }
void WebCore::FrameWin::issueUndoCommand(void) { notImplemented(); }
class QString WebCore::FrameWin::mimeTypeForFileName(class QString const &)const { notImplemented(); return QString(); }
void WebCore::FrameWin::clearRecordedFormValues(void) { notImplemented(); }
......@@ -378,7 +379,7 @@ Widget* WebCore::FrameView::topLevelWidget() const { notImplemented(); return 0;
void WebCore::FrameWin::markMisspellings(class WebCore::SelectionController const &) { notImplemented(); }
bool WebCore::FrameWin::menubarVisible(void) { notImplemented(); return 0; }
bool WebCore::FrameWin::personalbarVisible(void) { notImplemented(); return 0; }
void WebCore::FrameWin::createEmptyDocument(void) { notImplemented(); }
void WebCore::FrameWin::createEmptyDocument(void) { }
bool WebCore::FrameWin::lastEventIsMouseUp(void)const { notImplemented(); return 0; }
bool WebCore::FrameWin::statusbarVisible(void) { notImplemented(); return 0; }
bool WebCore::FrameWin::toolbarVisible(void) { notImplemented(); return 0; }
......@@ -395,3 +396,15 @@ Widget* WebCore::FrameView::topLevelWidget() const { notImplemented(); return 0;
class WebCore::Plugin * WebCore::FrameWin::createPlugin(class KURL const &,class QStringList const &,class QStringList const &,class QString const &) { notImplemented(); return 0; }
void WebCore::FrameWin::handledOnloadEvents(void) { notImplemented(); }
WebCore::String WebCore::FrameWin::generateFrameName(void) { notImplemented(); return String(); }
WebCore::BrowserExtensionWin::BrowserExtensionWin(class WebCore::Frame*) { }
void WebCore::BrowserExtensionWin::setTypedIconURL(class KURL const &,class QString const &) { notImplemented(); }
void WebCore::BrowserExtensionWin::openURLRequest(class KURL const &,struct WebCore::URLArgs const &) { notImplemented(); }
int WebCore::BrowserExtensionWin::getHistoryLength(void) { notImplemented(); return 0; }
bool WebCore::BrowserExtensionWin::canRunModal(void) { notImplemented(); return 0; }
void WebCore::BrowserExtensionWin::openURLNotify(void) { notImplemented(); }
void WebCore::BrowserExtensionWin::createNewWindow(class KURL const &,struct WebCore::URLArgs const &,struct WebCore::WindowArgs const &,class WebCore::Frame * &) { notImplemented(); }
bool WebCore::BrowserExtensionWin::canRunModalNow(void) { notImplemented(); return 0; }
void WebCore::BrowserExtensionWin::runModal(void) { notImplemented(); }
void WebCore::BrowserExtensionWin::goBackOrForward(int) { notImplemented(); }
void WebCore::BrowserExtensionWin::setIconURL(class KURL const &) { notImplemented(); }
void WebCore::BrowserExtensionWin::createNewWindow(class KURL const &,struct WebCore::URLArgs const &) { notImplemented(); }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment