diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2009-03-27 17:51:20 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-03-27 17:51:41 (GMT) |
commit | ec24cf81e231974fde2bb4903a00e63abce6465b (patch) | |
tree | 07b131c0e75207f264cb40f3d43e5c748aedd5b4 | |
parent | 0ebf7aad380ad09475f3d19264f031d0f2ec2d55 (diff) | |
download | Qt-ec24cf81e231974fde2bb4903a00e63abce6465b.zip Qt-ec24cf81e231974fde2bb4903a00e63abce6465b.tar.gz Qt-ec24cf81e231974fde2bb4903a00e63abce6465b.tar.bz2 |
Updated WebKit from /home/shausman/src/webkit/trunk to origin/qtwebkit-4.5 ( 1beae2b64b5b1e9b97e82dc94de18ebac1c19efc )
Changes in WebKit since the last update:
++ b/WebCore/ChangeLog
2009-03-27 Zack Rusin <zack@kde.org>
Reviewed by Simon Hausmann.
https://bugs.webkit.org/show_bug.cgi?id=24280
Fix propagation of fill rules when rendering paths in the Qt build.
* platform/graphics/qt/GraphicsContextQt.cpp:
(WebCore::toQtFillRule):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
2009-03-27 Zack Rusin <zack@kde.org>
Reviewed by Tor Arne Vestbø.
https://bugs.webkit.org/show_bug.cgi?id=24275
Fix text field theming in the Qt build with the KDE 4 Oxygen
style by adjusting the size vertically and horizontally to
set padding on the element equal to the width of the style painted border.
* platform/qt/RenderThemeQt.cpp:
(WebCore::RenderThemeQt::RenderThemeQt):
(WebCore::RenderThemeQt::computeSizeBasedOnStyle):
(WebCore::RenderThemeQt::adjustTextFieldStyle):
(WebCore::RenderThemeQt::paintTextField):
* platform/qt/RenderThemeQt.h:
-rw-r--r-- | src/3rdparty/webkit/VERSION | 2 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebCore/ChangeLog | 30 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp | 14 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp | 26 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h | 3 |
5 files changed, 67 insertions, 8 deletions
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index da530c8..96840d0 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -8,4 +8,4 @@ The commit imported was from the and has the sha1 checksum - 0b6fc217c2b853827926313c09bb3c32f66ffe43 + 1beae2b64b5b1e9b97e82dc94de18ebac1c19efc diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index 3b20751..e8850f3 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,33 @@ +2009-03-27 Zack Rusin <zack@kde.org> + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=24280 + + Fix propagation of fill rules when rendering paths in the Qt build. + + * platform/graphics/qt/GraphicsContextQt.cpp: + (WebCore::toQtFillRule): + (WebCore::GraphicsContext::fillPath): + (WebCore::GraphicsContext::strokePath): + +2009-03-27 Zack Rusin <zack@kde.org> + + Reviewed by Tor Arne Vestbø. + + https://bugs.webkit.org/show_bug.cgi?id=24275 + + Fix text field theming in the Qt build with the KDE 4 Oxygen + style by adjusting the size vertically and horizontally to + set padding on the element equal to the width of the style painted border. + + * platform/qt/RenderThemeQt.cpp: + (WebCore::RenderThemeQt::RenderThemeQt): + (WebCore::RenderThemeQt::computeSizeBasedOnStyle): + (WebCore::RenderThemeQt::adjustTextFieldStyle): + (WebCore::RenderThemeQt::paintTextField): + * platform/qt/RenderThemeQt.h: + 2009-02-06 Dirk Schulze <krit@webkit.org> Reviewed by Simon Hausmann. diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp index 1830566..936c1ea 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp @@ -168,6 +168,18 @@ static inline QGradient applySpreadMethod(QGradient gradient, GradientSpreadMeth return gradient; } +static inline Qt::FillRule toQtFillRule(WindRule rule) +{ + switch(rule) { + case RULE_EVENODD: + return Qt::OddEvenFill; + case RULE_NONZERO: + return Qt::WindingFill; + } + qDebug("Qt: unrecognized wind rule!"); + return Qt::OddEvenFill; +} + struct TransparencyLayer { TransparencyLayer(const QPainter* p, const QRect &rect) @@ -541,6 +553,7 @@ void GraphicsContext::fillPath() QPainter *p = m_data->p(); QPainterPath path = m_data->currentPath; + path.setFillRule(toQtFillRule(fillRule())); switch (m_common->state.fillColorSpace) { case SolidColorSpace: @@ -569,6 +582,7 @@ void GraphicsContext::strokePath() QPainter *p = m_data->p(); QPen pen = p->pen(); QPainterPath path = m_data->currentPath; + path.setFillRule(toQtFillRule(fillRule())); switch (m_common->state.strokeColorSpace) { case SolidColorSpace: diff --git a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp index cc9d314..a9da76b 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp @@ -41,6 +41,7 @@ #include <QWidget> #include <QPainter> #include <QPushButton> +#include <QLineEdit> #include <QStyleFactory> #include <QStyleOptionButton> #include <QStyleOptionFrameV2> @@ -123,6 +124,12 @@ RenderThemeQt::RenderThemeQt() #endif m_fallbackStyle = 0; + + // this will need to be regenerated when the style changes + QLineEdit lineEdit; + QStyleOptionFrameV2 opt; + m_frameLineWidth = QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth, + &opt, &lineEdit); } RenderThemeQt::~RenderThemeQt() @@ -268,7 +275,7 @@ int RenderThemeQt::minimumMenuListSize(RenderStyle*) const return 7 * fm.width(QLatin1Char('x')); } -static void computeSizeBasedOnStyle(RenderStyle* renderStyle) +void RenderThemeQt::computeSizeBasedOnStyle(RenderStyle* renderStyle) const { // If the width and height are both specified, then we have nothing to do. if (!renderStyle->width().isIntrinsicOrAuto() && !renderStyle->height().isAuto()) @@ -335,13 +342,15 @@ static void computeSizeBasedOnStyle(RenderStyle* renderStyle) int h = qMax(fm.lineSpacing(), 14) + 2*verticalMargin; int w = fm.width(QLatin1Char('x')) * 17 + 2*horizontalMargin; QStyleOptionFrameV2 opt; - opt.lineWidth = applicationStyle->pixelMetric(QStyle::PM_DefaultFrameWidth, - &opt, 0); + opt.lineWidth = m_frameLineWidth; QSize sz = applicationStyle->sizeFromContents(QStyle::CT_LineEdit, - &opt, - QSize(w, h).expandedTo(QApplication::globalStrut()), - 0); + &opt, + QSize(w, h).expandedTo(QApplication::globalStrut()), + 0); size.setHeight(sz.height()); + + renderStyle->setPaddingLeft(Length(opt.lineWidth, Fixed)); + renderStyle->setPaddingRight(Length(opt.lineWidth, Fixed)); break; } default: @@ -482,6 +491,9 @@ void RenderThemeQt::adjustTextFieldStyle(CSSStyleSelector*, RenderStyle* style, { style->setBackgroundColor(Color::transparent); style->setColor(QApplication::palette().text().color()); + style->resetBorder(); + style->resetPadding(); + computeSizeBasedOnStyle(style); } bool RenderThemeQt::paintTextField(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) @@ -495,7 +507,7 @@ bool RenderThemeQt::paintTextField(RenderObject* o, const RenderObject::PaintInf panel.initFrom(p.widget); panel.rect = r; - panel.lineWidth = p.style->pixelMetric(QStyle::PM_DefaultFrameWidth, &panel, p.widget); + panel.lineWidth = m_frameLineWidth; panel.state |= QStyle::State_Sunken; panel.features = QStyleOptionFrameV2::None; diff --git a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h index b4a5064..5c78a72 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h +++ b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h @@ -128,6 +128,7 @@ private: void paintMediaBackground(QPainter* painter, const IntRect& r) const; QColor getMediaControlForegroundColor(RenderObject* o = 0) const; #endif + void computeSizeBasedOnStyle(RenderStyle* renderStyle) const; private: bool supportsFocus(ControlPart) const; @@ -144,6 +145,8 @@ private: QStyle* m_fallbackStyle; QStyle* fallbackStyle(); + + int m_frameLineWidth; }; class StylePainter |