[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:18:56 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit e94e43ffddc6ea85b7e7db6b0d7f3fda925f23e5
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jan 8 20:17:14 2003 +0000

            Reviewed by Dave.
    
    	- fixed 96/72 dpi snafu; no need to do something different for AppKit,
              because it always uses pixel sizes, not font size
    
            * khtml/css/css_valueimpl.cpp:
            * khtml/css/css_valueimpl.h:
            * khtml/css/cssstyleselector.cpp:
            * kwq/KWQPaintDeviceMetrics.mm:
    	Rolled out change from 2002-12-05
    
    	- a cut at implementing heretofore unimplemented QTextStream classes
    
            * kwq/KWQTextStream.h:
            * kwq/KWQTextStream.mm:
    	First cut implementation.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3277 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 5597da0..4ed189e 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,22 @@
+2003-01-08  Darin Adler  <darin at apple.com>
+
+        Reviewed by Dave.
+
+	- fixed 96/72 dpi snafu; no need to do something different for AppKit,
+          because it always uses pixel sizes, not font size
+
+        * khtml/css/css_valueimpl.cpp:
+        * khtml/css/css_valueimpl.h:
+        * khtml/css/cssstyleselector.cpp:
+        * kwq/KWQPaintDeviceMetrics.mm:
+	Rolled out change from 2002-12-05
+
+	- a cut at implementing heretofore unimplemented QTextStream classes
+
+        * kwq/KWQTextStream.h:
+        * kwq/KWQTextStream.mm:
+	First cut implementation.
+
 === Safari-49 ===
 
 2003-01-05  Maciej Stachowiak  <mjs at apple.com>
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 5597da0..4ed189e 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,22 @@
+2003-01-08  Darin Adler  <darin at apple.com>
+
+        Reviewed by Dave.
+
+	- fixed 96/72 dpi snafu; no need to do something different for AppKit,
+          because it always uses pixel sizes, not font size
+
+        * khtml/css/css_valueimpl.cpp:
+        * khtml/css/css_valueimpl.h:
+        * khtml/css/cssstyleselector.cpp:
+        * kwq/KWQPaintDeviceMetrics.mm:
+	Rolled out change from 2002-12-05
+
+	- a cut at implementing heretofore unimplemented QTextStream classes
+
+        * kwq/KWQTextStream.h:
+        * kwq/KWQTextStream.mm:
+	First cut implementation.
+
 === Safari-49 ===
 
 2003-01-05  Maciej Stachowiak  <mjs at apple.com>
diff --git a/WebCore/khtml/css/css_valueimpl.cpp b/WebCore/khtml/css/css_valueimpl.cpp
index 1c3c7c8..ea0485b 100644
--- a/WebCore/khtml/css/css_valueimpl.cpp
+++ b/WebCore/khtml/css/css_valueimpl.cpp
@@ -388,107 +388,57 @@ int CSSPrimitiveValueImpl::computeLength( khtml::RenderStyle *style, QPaintDevic
     return ( int ) computeLengthFloat( style, devMetrics );
 }
 
-float CSSPrimitiveValueImpl::computeLengthFloat( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics)
+float CSSPrimitiveValueImpl::computeLengthFloat( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics )
 {
     unsigned short type = primitiveType();
 
     float dpiY = 72.; // fallback
     if ( devMetrics )
         dpiY = devMetrics->logicalDpiY();
-    if ( !khtml::printpainter && dpiY < 72 )
-        dpiY = 72.;
+    if ( !khtml::printpainter && dpiY < 96 )
+        dpiY = 96.;
 
     float factor = 1.;
     switch(type)
     {
-        case CSSPrimitiveValue::CSS_EMS:
-            factor = style->font().pixelSize();
-            break;
-        case CSSPrimitiveValue::CSS_EXS:
-        {
-            QFontMetrics fm = style->fontMetrics();
+    case CSSPrimitiveValue::CSS_EMS:
+       	factor = style->font().pixelSize();
+		break;
+    case CSSPrimitiveValue::CSS_EXS:
+	{
+        QFontMetrics fm = style->fontMetrics();
 #if APPLE_CHANGES
-            factor = fm.xHeight();
+        factor = fm.xHeight();
 #else
-            QRect b = fm.boundingRect('x');
-            factor = b.height();
+        QRect b = fm.boundingRect('x');
+        factor = b.height();
 #endif
-            break;
-        }
-        case CSSPrimitiveValue::CSS_PX:
-            break;
-        case CSSPrimitiveValue::CSS_CM:
-            factor = dpiY/2.54; //72dpi/(2.54 cm/in)
-            break;
-        case CSSPrimitiveValue::CSS_MM:
-            factor = dpiY/25.4;
-            break;
-        case CSSPrimitiveValue::CSS_IN:
+        break;
+	}
+    case CSSPrimitiveValue::CSS_PX:
+        break;
+    case CSSPrimitiveValue::CSS_CM:
+	factor = dpiY/2.54; //72dpi/(2.54 cm/in)
+        break;
+    case CSSPrimitiveValue::CSS_MM:
+	factor = dpiY/25.4;
+        break;
+    case CSSPrimitiveValue::CSS_IN:
             factor = dpiY;
-            break;
-        case CSSPrimitiveValue::CSS_PT:
+        break;
+    case CSSPrimitiveValue::CSS_PT:
             factor = dpiY/72.;
-            break;
-        case CSSPrimitiveValue::CSS_PC:
+        break;
+    case CSSPrimitiveValue::CSS_PC:
         // 1 pc == 12 pt
             factor = dpiY*12./72.;
-            break;
-        default:
-            return -1;
+        break;
+    default:
+        return -1;
     }
     return getFloatValue(type)*factor;
 }
 
-#ifdef APPLE_CHANGES
-// Compute point equivalent size for each unit type.  OS X fonts are all specified in 
-// device independent point size, so don't apply DPI corrections.
-float CSSPrimitiveValueImpl::computePointFloat( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics)
-{
-    unsigned short type = primitiveType();
-
-    float dpiY = 72.; // fallback
-    if ( devMetrics )
-        dpiY = devMetrics->logicalDpiY();
-    if ( !khtml::printpainter && dpiY < 72 )
-        dpiY = 72.;
-
-    float factor = 1.;
-    switch(type)
-    {
-        case CSSPrimitiveValue::CSS_EMS:
-            factor = style->font().pixelSize();
-            break;
-        case CSSPrimitiveValue::CSS_EXS:
-        {
-            QFontMetrics fm = style->fontMetrics();
-            factor = fm.xHeight();
-            break;
-        }
-        case CSSPrimitiveValue::CSS_PX:
-            factor = 72./dpiY;
-            break;
-        case CSSPrimitiveValue::CSS_CM:
-            factor = 72./2.54; //(2.54 cm/in)
-            break;
-        case CSSPrimitiveValue::CSS_MM:
-            factor = 72./25.4; //(25.4 cm/in)
-            break;
-        case CSSPrimitiveValue::CSS_IN:
-            factor = 72.;
-            break;
-        case CSSPrimitiveValue::CSS_PT:
-            break;
-        case CSSPrimitiveValue::CSS_PC:
-        // 1 pc == 12 pt
-            factor = 12.;
-            break;
-        default:
-            return -1;
-    }
-    return getFloatValue(type)*factor;
-}
-#endif
-
 void CSSPrimitiveValueImpl::setFloatValue( unsigned short unitType, float floatValue, int &exceptioncode )
 {
     exceptioncode = 0;
diff --git a/WebCore/khtml/css/css_valueimpl.h b/WebCore/khtml/css/css_valueimpl.h
index 7bbb6d6..bf79081 100644
--- a/WebCore/khtml/css/css_valueimpl.h
+++ b/WebCore/khtml/css/css_valueimpl.h
@@ -175,9 +175,7 @@ public:
     int computeLength( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics );
 
     float computeLengthFloat( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics );
-#ifdef APPLE_CHANGES
-    float computePointFloat( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics);
-#endif
+
 
     // use with care!!!
     void setPrimitiveType(unsigned short type) { m_type = type; }
diff --git a/WebCore/khtml/css/cssstyleselector.cpp b/WebCore/khtml/css/cssstyleselector.cpp
index f4d9ba4..d234808 100644
--- a/WebCore/khtml/css/cssstyleselector.cpp
+++ b/WebCore/khtml/css/cssstyleselector.cpp
@@ -2360,17 +2360,10 @@ void CSSStyleSelector::applyRule( DOM::CSSProperty *prop )
         } else {
             int type = primitiveValue->primitiveType();
             if(type > CSSPrimitiveValue::CSS_PERCENTAGE && type < CSSPrimitiveValue::CSS_DEG) {
-#if !APPLE_CHANGES
                 size = primitiveValue->computeLengthFloat(parentStyle, paintDeviceMetrics);
-#else
-                // OS X will always provide device independent font size, so we don't want to adjust
-                // the device independent sizes.
-                size = primitiveValue->computePointFloat(parentStyle, paintDeviceMetrics);
-#endif
                 if (!khtml::printpainter && element && element->getDocument()->view())
                     size *= element->getDocument()->view()->part()->zoomFactor() / 100.0;
-            } 
-            else if(type == CSSPrimitiveValue::CSS_PERCENTAGE)
+            } else if(type == CSSPrimitiveValue::CSS_PERCENTAGE)
                 size = (primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_PERCENTAGE)
                         * parentStyle->font().pixelSize()) / 100;
             else
diff --git a/WebCore/kwq/KWQPaintDeviceMetrics.mm b/WebCore/kwq/KWQPaintDeviceMetrics.mm
index 0e41b48..c486ff2 100644
--- a/WebCore/kwq/KWQPaintDeviceMetrics.mm
+++ b/WebCore/kwq/KWQPaintDeviceMetrics.mm
@@ -33,7 +33,7 @@ QPaintDeviceMetrics::QPaintDeviceMetrics(const QPaintDevice *)
 
 int QPaintDeviceMetrics::logicalDpiY() const 
 {
-    return 72;
+    return 96;
 }
 
 int QPaintDeviceMetrics::depth() const
diff --git a/WebCore/kwq/KWQTextStream.h b/WebCore/kwq/KWQTextStream.h
index 20362f3..9e29db8 100644
--- a/WebCore/kwq/KWQTextStream.h
+++ b/WebCore/kwq/KWQTextStream.h
@@ -26,6 +26,7 @@
 #ifndef QTEXTSTREAM_H_
 #define QTEXTSTREAM_H_
 
+#include "KWQIODevice.h"
 #include "KWQString.h"
 
 class QTextStream;
@@ -36,41 +37,41 @@ QTextStream &endl(QTextStream& stream);
 
 class QTextStream {
 public:
-    QTextStream();
-    QTextStream(QByteArray, int);
-    QTextStream(QString *, int);
-    virtual ~QTextStream();       
+    QTextStream(const QByteArray &);
+    QTextStream(QString *, int mode = IO_WriteOnly);
 
-     QTextStream &operator<<(char);
-     QTextStream &operator<<(const char *);
-     QTextStream &operator<<(const QCString &);
-     QTextStream &operator<<(const QString &);
-     QTextStream &operator<<(const QTextStreamManipulator &);
-     QTextStream &operator<<(const void *);
+    QTextStream &operator<<(char);
+    QTextStream &operator<<(const char *);
+    QTextStream &operator<<(const QCString &);
+    QTextStream &operator<<(const QString &);
+    QTextStream &operator<<(const QTextStreamManipulator &);
+    QTextStream &operator<<(void *);
 
 private:
     QTextStream(const QTextStream &);
     QTextStream &operator=(const QTextStream &);
 
+    bool _hasByteArray;
+    QByteArray _byteArray;
+    QString *_string;
 };
 
-class QTextIStream : public QTextStream {
+class QTextOStream : public QTextStream {
 public:
-
-    QTextIStream(QString *);
-
-    QString readLine();
-
+    QTextOStream(QString *s) : QTextStream(s) { }
+    QTextOStream(const QByteArray &ba) : QTextStream(ba) { }
 };
 
-class QTextOStream : public QTextStream {
+class QTextIStream {
 public:
-
-    QTextOStream(QString *);
-    QTextOStream(QByteArray);
-
+    QTextIStream(QString *s) : _string(s), _position(0) { }
     QString readLine();
 
-};
+private:
+    QTextIStream(const QTextIStream &);
+    QTextIStream &operator=(const QTextIStream &);
 
+    QString *_string;
+    int _position;
+};
 #endif
diff --git a/WebCore/kwq/KWQTextStream.mm b/WebCore/kwq/KWQTextStream.mm
index c3c5566..7d38a86 100644
--- a/WebCore/kwq/KWQTextStream.mm
+++ b/WebCore/kwq/KWQTextStream.mm
@@ -27,82 +27,83 @@
 
 #import "KWQTextStream.h"
 
-QTextStream::QTextStream()
+QTextStream::QTextStream(const QByteArray &ba)
+    : _hasByteArray(true), _byteArray(ba), _string(0)
 {
 }
 
-QTextStream::QTextStream(QByteArray, int)
-{
-    ERROR("not yet implemented");
-}
-
-QTextStream::QTextStream(QString *, int)
-{
-    ERROR("not yet implemented");
-}
-
-QTextStream::~QTextStream()
+QTextStream::QTextStream(QString *s, int mode)
+    : _hasByteArray(false), _string(s)
 {
+    ASSERT(mode == IO_WriteOnly);
 }
 
-QTextStream &QTextStream::operator<<(char)
+QTextStream &QTextStream::operator<<(char c)
 {
+    if (_hasByteArray) {
+        uint oldSize = _byteArray.size();
+        _byteArray.resize(oldSize + 1);
+        _byteArray[oldSize] = c;
+    }
+    if (_string) {
+        _string->append(QChar(c));
+    }
     return *this;
 }
 
-QTextStream &QTextStream::operator<<(const char *)
+QTextStream &QTextStream::operator<<(const char *s)
 {
+    if (_hasByteArray) {
+        uint length = strlen(s);
+        uint oldSize = _byteArray.size();
+        _byteArray.resize(oldSize + length);
+        memcpy(_byteArray.data() + oldSize, s, length);
+    }
+    if (_string) {
+        _string->append(s);
+    }
     return *this;
 }
 
-QTextStream &QTextStream::operator<<(const QCString &)
+QTextStream &QTextStream::operator<<(const QCString &qcs)
 {
-    return *this;
+    const char *s = qcs;
+    return *this << s;
 }
 
-QTextStream &QTextStream::operator<<(const QString &)
+QTextStream &QTextStream::operator<<(const QString &s)
 {
+    if (_hasByteArray) {
+        uint length = s.length();
+        uint oldSize = _byteArray.size();
+        _byteArray.resize(oldSize + length);
+        memcpy(_byteArray.data() + oldSize, s.latin1(), length);
+    }
+    if (_string) {
+        _string->append(s);
+    }
     return *this;
 }
 
-QTextIStream::QTextIStream(QString *)
-{
-    ERROR("not yet implemented");
-}
-
-QString QTextIStream::readLine()
+QTextStream &QTextStream::operator<<(void *p)
 {
-    ERROR("not yet implemented");
-    return QString();
+    char buffer[10];
+    sprintf(buffer, "%p", p);
+    return *this << buffer;
 }
 
-QTextOStream::QTextOStream(QString *)
+QTextStream &QTextStream::operator<<(const QTextStreamManipulator &m) 
 {
-    ERROR("not yet implemented");
+    return m(*this);
 }
 
-QTextOStream::QTextOStream(QByteArray)
+QTextStream &endl(QTextStream& stream)
 {
-    ERROR("not yet implemented");
+    return stream << '\n';
 }
 
-QString QTextOStream::readLine()
+QString QTextIStream::readLine()
 {
     ERROR("not yet implemented");
     return QString();
 }
-
-QTextStream &QTextStream::operator<<(QTextStream &(*const &)(QTextStream &)) 
-{
-    return *this;
-}
-
-QTextStream &QTextStream::operator<<(void const *)
-{
-    return *this;
-}
-
-QTextStream &endl(QTextStream& stream)
-{
-    return stream;
-}

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list