[prev in list] [next in list] [prev in thread] [next in thread]
List: kfm-devel
Subject: Re: Win32 Port of Safari
From: Alan Gutierrez <ajglist () izzy ! net>
Date: 2003-01-10 12:05:21
[Download RAW message or body]
On Don, 09 Jan 2003, Alan Gutierrez wrote:
>> build. Some were made to hush warnings, which I can turn of in VC++ if we
>> don't care about them.
>> 256c256
>> < virtual void paintObject( QPainter */*p*/, int /*x*/, int /*y*/,
>> ---
>
>>> > virtual void paintObject( QPainter * /*p*/, int /*x*/, int /*y*/,
is this a warning or a compile fix ?
So it looks pretty good so far. Most of the fixes you made are in the Safari
specific part. I will have a try on integrating the others.
Dirk Mueller wrote:
> On Don, 09 Jan 2003, Alan Gutierrez wrote:
>
>
>>build. Some were made to hush warnings, which I can turn of in VC++ if we
>>don't care about them.
>
>
>>256c256
>>< virtual void paintObject( QPainter */*p*/, int /*x*/, int /*y*/,
>>---
>>
>>> virtual void paintObject( QPainter * /*p*/, int /*x*/, int /*y*/,
>
>
> is this a warning or a compile fix ?
c:\codearea\khtml_win32\webcore\khtml\rendering\render_object.h(256) :
warning C4138: '*/' found outside of comment
> So it looks pretty good so far. Most of the fixes you made are in the Safari
> specific part. I will have a try on integrating the others.
I'll send diffs for kjs later today. The regex library compiled directly.
> BTW, please use unified diffs (diff -u). Thanks.
Attached. Interested to hear what others have to say.
Alan Gutierrez
["khtml.diff" (text/plain)]
diff -r -u /home/alan/build/WebCore/khtml/css/cssstyleselector.cpp \
khtml/css/cssstyleselector.cpp
--- /home/alan/build/WebCore/khtml/css/cssstyleselector.cpp Fri Dec 20 19:41:38 2002
+++ khtml/css/cssstyleselector.cpp Thu Jan 9 19:39:32 2003
@@ -250,7 +250,7 @@
#endif
fontSizes.clear();
- const float factor = 1.2;
+ const float factor = 1.2F;
float scale = 1.0 / (factor*factor*factor);
float mediumFontSize;
float minFontSize;
diff -r -u /home/alan/build/WebCore/khtml/dom/dom_node.h khtml/dom/dom_node.h
--- /home/alan/build/WebCore/khtml/dom/dom_node.h Sat Oct 26 18:09:59 2002
+++ khtml/dom/dom_node.h Thu Jan 9 19:39:31 2003
@@ -948,7 +948,11 @@
* A DOMTimeStamp represents a number of milliseconds.
*
*/
+#if defined (WIN32_NATIVE)
+typedef int64_t DOMTimeStamp;
+#else
typedef unsigned long long DOMTimeStamp;
+#endif
}; //namespace
diff -r -u /home/alan/build/WebCore/khtml/ecma/kjs_window.cpp \
khtml/ecma/kjs_window.cpp
--- /home/alan/build/WebCore/khtml/ecma/kjs_window.cpp Sun Jan 5 23:31:13 2003
+++ khtml/ecma/kjs_window.cpp Thu Jan 9 19:39:32 2003
@@ -1087,9 +1087,9 @@
#else
{
policy = 0;
- LOG(PopupBlocking, "Allowed JavaScript window open of %s", \
args[0].toString(exec).qstring().ascii()); + LOG1(PopupBlocking, "Allowed JavaScript \
window open of %s", args[0].toString(exec).qstring().ascii()); } else {
- LOG(PopupBlocking, "Blocked JavaScript window open of %s", \
args[0].toString(exec).qstring().ascii()); + LOG1(PopupBlocking, "Blocked JavaScript \
window open of %s", args[0].toString(exec).qstring().ascii()); }
#endif
}
diff -r -u /home/alan/build/WebCore/khtml/khtml_part.h khtml/khtml_part.h
--- /home/alan/build/WebCore/khtml/khtml_part.h Thu Jan 2 17:02:12 2003
+++ khtml/khtml_part.h Thu Jan 9 19:39:24 2003
@@ -1055,7 +1055,13 @@
DOM::EventListener *createHTMLEventListener( QString code );
DOM::HTMLDocumentImpl *docImpl() const;
+#if defined(WIN32_NATIVE)
+protected:
+#endif
DOM::DocumentImpl *xmlDocImpl() const;
+#if defined(WIN32_NATIVE)
+private:
+#endif
khtml::ChildFrame *frame( const QObject *obj );
khtml::ChildFrame *recursiveFrameRequest( const KURL &url, const KParts::URLArgs \
&args, bool callParent = true );
diff -r -u /home/alan/build/WebCore/khtml/rendering/render_arena.h \
khtml/rendering/render_arena.h
--- /home/alan/build/WebCore/khtml/rendering/render_arena.h Wed Dec 18 01:51:38 2002
+++ khtml/rendering/render_arena.h Thu Jan 9 19:39:32 2003
@@ -35,7 +35,7 @@
#ifndef RENDERARENA_H
#define RENDERARENA_H
-#include "arena.h"
+#include "misc/arena.h"
static const size_t gMaxRecycledSize = 400;
#define ROUNDUP(x,y) ((((x)+((y)-1))/(y))*(y))
diff -r -u /home/alan/build/WebCore/khtml/rendering/render_object.h \
khtml/rendering/render_object.h
--- /home/alan/build/WebCore/khtml/rendering/render_object.h Fri Dec 20 16:36:55 2002
+++ khtml/rendering/render_object.h Thu Jan 9 19:39:32 2003
@@ -253,7 +253,7 @@
virtual void paint(QPainter *p, int x, int y, int w, int h, int tx, int ty,
int paintPhase);
- virtual void paintObject( QPainter */*p*/, int /*x*/, int /*y*/,
+ virtual void paintObject( QPainter * /*p*/, int /*x*/, int /*y*/,
int /*w*/, int /*h*/, int /*tx*/, int /*ty*/,
int paintPhase /*paintPhase*/) {}
void paintBorder(QPainter *p, int _tx, int _ty, int w, int h, const RenderStyle* \
style, bool begin=true, bool end=true);
diff -r -u /home/alan/build/WebCore/khtml/rendering/render_style.h \
khtml/rendering/render_style.h
--- /home/alan/build/WebCore/khtml/rendering/render_style.h Tue Dec 17 01:09:46 2002
+++ khtml/rendering/render_style.h Thu Jan 9 19:39:32 2003
@@ -629,7 +629,7 @@
RenderStyle* getPseudoStyle(PseudoId pi);
RenderStyle* addPseudoStyle(PseudoId pi);
- bool hasPseudoStyle() const { return pseudoStyle; }
+ bool hasPseudoStyle() const { return pseudoStyle != NULL; } // AJG
void removePseudoStyle(PseudoId pi);
bool hasHover() const { return noninherited_flags._hasHover; }
diff -r -u /home/alan/build/WebCore/khtml/xml/dom2_traversalimpl.cpp \
khtml/xml/dom2_traversalimpl.cpp
--- /home/alan/build/WebCore/khtml/xml/dom2_traversalimpl.cpp Tue Jul 23 10:56:41 \
2002
+++ khtml/xml/dom2_traversalimpl.cpp Thu Jan 9 19:39:32 2003
@@ -252,7 +252,7 @@
short NodeIteratorImpl::isAccepted(NodeImpl *n)
{
// if XML is implemented we have to check expandEntityRerefences in this function
- if( ( ( 1 << n->nodeType()-1) & m_whatToShow) != 0 )
+ if( ( ( 1 << (n->nodeType()-1)) & m_whatToShow) != 0 ) // AJG
{
if(!m_filter.isNull())
return m_filter.acceptNode(n);
@@ -526,7 +526,7 @@
short TreeWalkerImpl::isAccepted(Node n)
{
// if XML is implemented we have to check expandEntityRerefences in this \
function
- if( ( ( 1 << n.nodeType()-1 ) & m_whatToShow) != 0 )
+ if( ( ( 1 << (n.nodeType()-1) ) & m_whatToShow) != 0 )
{
if(m_filter)
return m_filter->acceptNode(n);
diff -r -u /home/alan/build/WebCore/khtml/xml/dom2_viewsimpl.cpp \
khtml/xml/dom2_viewsimpl.cpp
--- /home/alan/build/WebCore/khtml/xml/dom2_viewsimpl.cpp Sat Jul 20 23:42:01 2002
+++ khtml/xml/dom2_viewsimpl.cpp Thu Jan 9 19:39:32 2003
@@ -33,7 +33,7 @@
{
}
-CSSStyleDeclarationImpl *AbstractViewImpl::getComputedStyle(ElementImpl */*elt*/, \
DOMStringImpl */*pseudoElt*/) +CSSStyleDeclarationImpl \
*AbstractViewImpl::getComputedStyle(ElementImpl * /*elt*/, DOMStringImpl * \
/*pseudoElt*/) {
return 0; // ###
}
diff -r -u /home/alan/build/WebCore/khtml/xml/dom_docimpl.cpp \
khtml/xml/dom_docimpl.cpp
--- /home/alan/build/WebCore/khtml/xml/dom_docimpl.cpp Sun Jan 5 23:31:13 2003
+++ khtml/xml/dom_docimpl.cpp Thu Jan 9 19:39:32 2003
@@ -45,7 +45,7 @@
#include "rendering/render_root.h"
#include "rendering/render_replaced.h"
-#include "render_arena.h"
+#include "rendering/render_arena.h"
#include "khtmlview.h"
#include "khtml_part.h"
@@ -188,7 +188,7 @@
return doc;
}
-CSSStyleSheetImpl *DOMImplementationImpl::createCSSStyleSheet(DOMStringImpl \
*/*title*/, DOMStringImpl *media, +CSSStyleSheetImpl \
*DOMImplementationImpl::createCSSStyleSheet(DOMStringImpl * /*title*/, DOMStringImpl \
*media,
int \
&/*exceptioncode*/) {
// ### TODO : title should be set, and media could have wrong syntax, in which \
case we should @@ -2065,7 +2065,7 @@
}
}
-CSSStyleDeclarationImpl *DocumentImpl::getOverrideStyle(ElementImpl */*elt*/, \
DOMStringImpl */*pseudoElt*/) +CSSStyleDeclarationImpl \
*DocumentImpl::getOverrideStyle(ElementImpl * /*elt*/, DOMStringImpl * /*pseudoElt*/) \
{ return 0; // ###
}
diff -r -u /home/alan/build/WebCore/khtml/xml/dom_docimpl.h khtml/xml/dom_docimpl.h
--- /home/alan/build/WebCore/khtml/xml/dom_docimpl.h Tue Dec 17 01:09:46 2002
+++ khtml/xml/dom_docimpl.h Thu Jan 9 19:39:32 2003
@@ -352,7 +352,7 @@
DOMCHARACTERDATAMODIFIED_LISTENER = 0x40
};
- bool hasListenerType(ListenerType listenerType) const { return (m_listenerTypes \
& listenerType); } + bool hasListenerType(ListenerType listenerType) const { \
return (m_listenerTypes & listenerType) == listenerType; } // AJG: \
TODO!
void addListenerType(ListenerType listenerType) { m_listenerTypes = \
m_listenerTypes | listenerType; }
CSSStyleDeclarationImpl *getOverrideStyle(ElementImpl *elt, DOMStringImpl \
*pseudoElt);
diff -r -u /home/alan/build/WebCore/khtml/xml/dom_elementimpl.cpp \
khtml/xml/dom_elementimpl.cpp
--- /home/alan/build/WebCore/khtml/xml/dom_elementimpl.cpp Sat Oct 12 11:49:33 2002
+++ khtml/xml/dom_elementimpl.cpp Thu Jan 9 19:39:32 2003
@@ -554,7 +554,8 @@
}
-AttrImpl *NamedAttrMapImpl::getNamedItem ( NodeImpl::Id id ) const
+// AttrImpl *NamedAttrMapImpl::getNamedItem ( NodeImpl::Id id ) const AJG
+NodeImpl *NamedAttrMapImpl::getNamedItem ( NodeImpl::Id id ) const
{
AttributeImpl* a = getAttributeItem(id);
if (!a) return 0;
@@ -634,7 +635,8 @@
return r;
}
-AttrImpl *NamedAttrMapImpl::item ( unsigned long index ) const
+// AttrImpl *NamedAttrMapImpl::item ( unsigned long index ) const
+NodeImpl *NamedAttrMapImpl::item ( unsigned long index ) const
{
if (index >= len)
return 0;
@@ -702,12 +704,13 @@
// first initialize attrs vector, then call parseAttribute on it
// this allows parseAttribute to use getAttribute
- for (uint i = 0; i < len; i++) {
+ uint i;
+ for (i = 0; i < len; i++) {
attrs[i] = new AttributeImpl(other.attrs[i]->id(), other.attrs[i]->val());
attrs[i]->ref();
}
- for(uint i = 0; i < len; i++)
+ for(i = 0; i < len; i++)
element->parseAttribute(attrs[i]);
return *this;
diff -r -u /home/alan/build/WebCore/khtml/xml/dom_elementimpl.h \
khtml/xml/dom_elementimpl.h
--- /home/alan/build/WebCore/khtml/xml/dom_elementimpl.h Tue Dec 17 01:09:46 2002
+++ khtml/xml/dom_elementimpl.h Thu Jan 9 19:39:32 2003
@@ -194,7 +194,7 @@
virtual void attach();
virtual void recalcStyle( StyleChange = NoChange );
- virtual void mouseEventHandler( MouseEvent */*ev*/, bool /*inside*/ ) {};
+ virtual void mouseEventHandler( MouseEvent * /*ev*/, bool /*inside*/ ) {};
virtual bool isSelectable() const;
virtual bool childAllowed( NodeImpl *newChild );
virtual bool childTypeAllowed( unsigned short type );
@@ -264,11 +264,13 @@
NamedAttrMapImpl &operator =(const NamedAttrMapImpl &other);
// DOM methods & attributes for NamedNodeMap
- virtual AttrImpl *getNamedItem ( NodeImpl::Id id ) const;
+ // virtual AttrImpl *getNamedItem ( NodeImpl::Id id ) const; AJG
+ virtual NodeImpl *getNamedItem ( NodeImpl::Id id ) const;
virtual Node removeNamedItem ( NodeImpl::Id id, int &exceptioncode );
virtual Node setNamedItem ( NodeImpl* arg, int &exceptioncode );
- virtual AttrImpl *item ( unsigned long index ) const;
+ // virtual AttrImpl *item ( unsigned long index ); // AJG const;
+ virtual NodeImpl *item ( unsigned long index ) const;
virtual unsigned long length( ) const;
// Other methods (not part of DOM)
diff -r -u /home/alan/build/WebCore/khtml/xml/dom_nodeimpl.cpp \
khtml/xml/dom_nodeimpl.cpp
--- /home/alan/build/WebCore/khtml/xml/dom_nodeimpl.cpp Tue Dec 17 01:09:46 2002
+++ khtml/xml/dom_nodeimpl.cpp Thu Jan 9 19:39:32 2003
@@ -655,9 +655,9 @@
default:
break;
}
- bool ctrlKey = (_mouse->state() & Qt::ControlButton);
- bool altKey = (_mouse->state() & Qt::AltButton);
- bool shiftKey = (_mouse->state() & Qt::ShiftButton);
+ bool ctrlKey = (_mouse->state() & Qt::ControlButton) == Qt::ControlButton;
+ bool altKey = (_mouse->state() & Qt::AltButton) == Qt::AltButton;
+ bool shiftKey = (_mouse->state() & Qt::ShiftButton) == Qt::ShiftButton;
bool metaKey = false; // ### qt support?
EventImpl *evt = new \
MouseEventImpl(evtId,true,cancelable,getDocument()->defaultView(), @@ -904,7 +904,7 \
@@
*stream << " tabIndex=" << m_tabIndex;
if (m_regdListeners)
*stream << " #regdListeners=" << m_regdListeners->count(); // ### more detail
- *stream << endl;
+ *stream << endl; // AJG VC++ got confused and call kdbgstream version of endl
NodeImpl *child = firstChild();
while( child != 0 )
@@ -1781,7 +1781,7 @@
return n;
}
-bool ChildNodeListImpl::nodeMatches( NodeImpl */*testNode*/ ) const
+bool ChildNodeListImpl::nodeMatches( NodeImpl * /*testNode*/ ) const
{
return true;
}
diff -r -u /home/alan/build/WebCore/khtml/xml/dom_stringimpl.cpp \
khtml/xml/dom_stringimpl.cpp
--- /home/alan/build/WebCore/khtml/xml/dom_stringimpl.cpp Tue Dec 17 01:09:46 2002
+++ khtml/xml/dom_stringimpl.cpp Thu Jan 9 19:39:32 2003
@@ -197,7 +197,7 @@
khtml::Length* DOMStringImpl::toLengthArray(int& len) const
{
-#if !APPLE_CHANGES
+#if !APPLE_CHANGES || WIN32_NATIVE
QString str(s, l);
#endif /* APPLE_CHANGES not defined */
int pos = 0;
@@ -207,7 +207,7 @@
// to fix lists like "1,2px 3 ,4"
// make sure not to break percentage or relative widths
// ### what about "auto" ?
-#if APPLE_CHANGES
+#if APPLE_CHANGES && !WIN32_NATIVE
// This alternate version works around a limitation in our QString \
implementation. QChar spacified[l];
QChar space(' ');
diff -r -u /home/alan/build/WebCore/khtml/xml/dom_textimpl.cpp \
khtml/xml/dom_textimpl.cpp
--- /home/alan/build/WebCore/khtml/xml/dom_textimpl.cpp Tue Dec 17 01:09:46 2002
+++ khtml/xml/dom_textimpl.cpp Thu Jan 9 19:39:32 2003
@@ -369,27 +369,35 @@
khtml::RenderStyle* _style = par->style();
bool onlyWS = containsOnlyWhitespace();
if (onlyWS) {
- if (par->isTable() || par->isTableRow() || par->isTableSection())
- return CharacterDataImpl::attach();
+ if (par->isTable() || par->isTableRow() || par->isTableSection()) {
+ CharacterDataImpl::attach();
+ return;
+ }
if (par->isInline() && _style->whiteSpace() != PRE) {
// <span><div/> <div/></span>
RenderObject* prevRender = previousRenderer();
- if (prevRender && prevRender->isFlow() && !prevRender->isInline())
- return CharacterDataImpl::attach();
+ if (prevRender && prevRender->isFlow() && !prevRender->isInline()) {
+ CharacterDataImpl::attach();
+ return;
+ }
}
else if (!par->isInline() && _style->whiteSpace() != PRE) {
RenderObject* prevRender = previousRenderer();
if (par->isFlow() && !par->childrenInline() &&
- (!prevRender || !prevRender->isInline()))
- return CharacterDataImpl::attach();
+ (!prevRender || !prevRender->isInline())) {
+ CharacterDataImpl::attach();
+ return;
+ }
RenderObject* nextRender = nextRenderer();
if ((!par->firstChild() ||
- nextRender == par->firstChild()))
+ nextRender == par->firstChild())) {
// Whitespace at the start of a block just goes away. Don't \
even // make a render object for this text.
- return CharacterDataImpl::attach();
+ CharacterDataImpl::attach();
+ return;
+ }
}
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic