summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-10 03:06:47 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-10 03:06:47 (GMT)
commitf74029e286e97067ac39086955481bf979af69dc (patch)
treeba6b9706b47624cb4dcd51a3fb4236ce4dddd5b3 /src/3rdparty/webkit/WebCore
parent4a5e8e026bed24d451e2d36f490f42a17ed74b47 (diff)
parentec0f388dfb14712a144d534296b33df7e6a2df7f (diff)
downloadQt-f74029e286e97067ac39086955481bf979af69dc.zip
Qt-f74029e286e97067ac39086955481bf979af69dc.tar.gz
Qt-f74029e286e97067ac39086955481bf979af69dc.tar.bz2
Merge branch 'qt-master-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-master-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration: (104 commits) Documentation: clarified RVCT support for Symbian Update Symbian OS def files for 4.6.2 Remove the installer from the Qt sources. Don't remove all dependencies when patching the pkg. Fixes qabstractslider autotest Workaround for abld toolchain issue with s60main Add a recursive rule for running the auto-tests. Do not run the tests automatically during install. Enabling runfast mode when vfpv2 used. Fixing a test case to be runnable on Symbian device. [CRASH] audioinput and audiooutput examples crash when no devices are Fixed casual crash in initializeDb (Symbian) Fixes scrolling horizontally with a mouse wheel over sliders. don't use QKeySequence::mnemonic() after all Fixed qt_x11_wait_for_window_manager Revert change 34f1758 on non-Synbian platforms Fixed QGifHandler::loopCount(). Doc: Clarified ownership of custom buttons added to a QDialogButtonBox. Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( da5d96a26e80162027bc95ce7e5725fe4b277ff7 ) don't use stylesheet for just making labels bold ...
Diffstat (limited to 'src/3rdparty/webkit/WebCore')
-rw-r--r--src/3rdparty/webkit/WebCore/ChangeLog38
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp29
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h10
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.cpp22
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.h8
5 files changed, 80 insertions, 27 deletions
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index 18d119a..1f6f290 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -2,6 +2,44 @@
Reviewed by Kenneth Rohde Christiansen.
+ [Qt] In the StyledPainter determine the style from the Render and Scrollbar theme instead of from the paint device
+ https://bugs.webkit.org/show_bug.cgi?id=34054
+
+ Getting the style from the painter's paint device is a hack that breaks when
+ the paint device's style is different than the style that is used when
+ calculating the metries earlier when there is no painter available.
+
+ This change moves us closer to always using the same style.
+
+ * platform/qt/RenderThemeQt.cpp:
+ (WebCore::StylePainter::StylePainter):
+ (WebCore::StylePainter::init):
+ (WebCore::RenderThemeQt::paintButton):
+ (WebCore::RenderThemeQt::paintTextField):
+ (WebCore::RenderThemeQt::paintMenuList):
+ (WebCore::RenderThemeQt::paintMenuListButton):
+ (WebCore::RenderThemeQt::paintSliderTrack):
+ (WebCore::RenderThemeQt::paintMediaMuteButton):
+ (WebCore::RenderThemeQt::paintMediaPlayButton):
+ (WebCore::RenderThemeQt::paintMediaSliderTrack):
+ (WebCore::RenderThemeQt::paintMediaSliderThumb):
+ * platform/qt/RenderThemeQt.h:
+ * platform/qt/ScrollbarThemeQt.cpp:
+ (WebCore::ScrollbarThemeQt::paint):
+ (WebCore::ScrollbarThemeQt::hitTest):
+ (WebCore::ScrollbarThemeQt::shouldCenterOnThumb):
+ (WebCore::ScrollbarThemeQt::scrollbarThickness):
+ (WebCore::ScrollbarThemeQt::thumbLength):
+ (WebCore::ScrollbarThemeQt::trackPosition):
+ (WebCore::ScrollbarThemeQt::trackLength):
+ (WebCore::ScrollbarThemeQt::paintScrollCorner):
+ (WebCore::ScrollbarThemeQt::style):
+ * platform/qt/ScrollbarThemeQt.h:
+
+2010-01-25 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
[Qt] Use the fallback style on Maemo 5
https://bugs.webkit.org/show_bug.cgi?id=34376
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp
index 6a1eee8..37a6408 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp
@@ -44,6 +44,7 @@
#include "Page.h"
#include "RenderBox.h"
#include "RenderTheme.h"
+#include "ScrollbarThemeQt.h"
#include "UserAgentStyleSheets.h"
#include "QWebPageClient.h"
#include "qwebpage.h"
@@ -66,17 +67,17 @@ namespace WebCore {
using namespace HTMLNames;
-StylePainter::StylePainter(const RenderObject::PaintInfo& paintInfo)
+StylePainter::StylePainter(RenderThemeQt* theme, const RenderObject::PaintInfo& paintInfo)
{
- init(paintInfo.context ? paintInfo.context : 0);
+ init(paintInfo.context ? paintInfo.context : 0, theme->qStyle());
}
-StylePainter::StylePainter(GraphicsContext* context)
+StylePainter::StylePainter(ScrollbarThemeQt* theme, GraphicsContext* context)
{
- init(context);
+ init(context, theme->style());
}
-void StylePainter::init(GraphicsContext* context)
+void StylePainter::init(GraphicsContext* context, QStyle* themeStyle)
{
painter = static_cast<QPainter*>(context->platformContext());
widget = 0;
@@ -85,7 +86,7 @@ void StylePainter::init(GraphicsContext* context)
dev = painter->device();
if (dev && dev->devType() == QInternal::Widget)
widget = static_cast<QWidget*>(dev);
- style = (widget ? widget->style() : QApplication::style());
+ style = themeStyle;
if (painter) {
// the styles often assume being called with a pristine painter where no brush is set,
@@ -464,7 +465,7 @@ void RenderThemeQt::setButtonPadding(RenderStyle* style) const
bool RenderThemeQt::paintButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
{
- StylePainter p(i);
+ StylePainter p(this, i);
if (!p.isValid())
return true;
@@ -497,7 +498,7 @@ void RenderThemeQt::adjustTextFieldStyle(CSSStyleSelector*, RenderStyle* style,
bool RenderThemeQt::paintTextField(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
{
- StylePainter p(i);
+ StylePainter p(this, i);
if (!p.isValid())
return true;
@@ -566,7 +567,7 @@ void RenderThemeQt::setPopupPadding(RenderStyle* style) const
bool RenderThemeQt::paintMenuList(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
{
- StylePainter p(i);
+ StylePainter p(this, i);
if (!p.isValid())
return true;
@@ -606,7 +607,7 @@ void RenderThemeQt::adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle* st
bool RenderThemeQt::paintMenuListButton(RenderObject* o, const RenderObject::PaintInfo& i,
const IntRect& r)
{
- StylePainter p(i);
+ StylePainter p(this, i);
if (!p.isValid())
return true;
@@ -837,7 +838,7 @@ bool RenderThemeQt::paintMediaMuteButton(RenderObject* o, const RenderObject::Pa
if (!mediaElement)
return false;
- StylePainter p(paintInfo);
+ StylePainter p(this, paintInfo);
if (!p.isValid())
return true;
@@ -866,7 +867,7 @@ bool RenderThemeQt::paintMediaPlayButton(RenderObject* o, const RenderObject::Pa
if (!mediaElement)
return false;
- StylePainter p(paintInfo);
+ StylePainter p(this, paintInfo);
if (!p.isValid())
return true;
@@ -905,7 +906,7 @@ bool RenderThemeQt::paintMediaSliderTrack(RenderObject* o, const RenderObject::P
if (!mediaElement)
return false;
- StylePainter p(paintInfo);
+ StylePainter p(this, paintInfo);
if (!p.isValid())
return true;
@@ -932,7 +933,7 @@ bool RenderThemeQt::paintMediaSliderThumb(RenderObject* o, const RenderObject::P
if (!mediaElement)
return false;
- StylePainter p(paintInfo);
+ StylePainter p(this, paintInfo);
if (!p.isValid())
return true;
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h
index 19337ac..13fb42f 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h
+++ b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h
@@ -35,6 +35,7 @@ namespace WebCore {
class RenderStyle;
class HTMLMediaElement;
+class ScrollbarThemeQt;
class RenderThemeQt : public RenderTheme {
private:
@@ -75,6 +76,8 @@ public:
virtual String extraMediaControlsStyleSheet();
#endif
+ QStyle* qStyle() const;
+
protected:
virtual bool paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r);
virtual void setCheckboxSize(RenderStyle*) const;
@@ -137,7 +140,6 @@ private:
void setButtonPadding(RenderStyle*) const;
void setPopupPadding(RenderStyle*) const;
- QStyle* qStyle() const;
QStyle* fallbackStyle() const;
Page* m_page;
@@ -152,8 +154,8 @@ private:
class StylePainter {
public:
- explicit StylePainter(const RenderObject::PaintInfo& paintInfo);
- explicit StylePainter(GraphicsContext* context);
+ explicit StylePainter(RenderThemeQt*, const RenderObject::PaintInfo&);
+ explicit StylePainter(ScrollbarThemeQt*, GraphicsContext*);
~StylePainter();
bool isValid() const { return painter && style; }
@@ -170,7 +172,7 @@ public:
{ style->drawComplexControl(cc, &opt, painter, widget); }
private:
- void init(GraphicsContext* context);
+ void init(GraphicsContext* context, QStyle*);
QBrush oldBrush;
bool oldAntialiasing;
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.cpp
index 561e55f..c0692ca 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.cpp
@@ -140,7 +140,7 @@ bool ScrollbarThemeQt::paint(Scrollbar* scrollbar, GraphicsContext* graphicsCont
return false;
}
- StylePainter p(graphicsContext);
+ StylePainter p(this, graphicsContext);
if (!p.isValid())
return true;
@@ -172,14 +172,14 @@ ScrollbarPart ScrollbarThemeQt::hitTest(Scrollbar* scrollbar, const PlatformMous
QStyleOptionSlider* opt = styleOptionSlider(scrollbar);
const QPoint pos = scrollbar->convertFromContainingWindow(evt.pos());
opt->rect.moveTo(QPoint(0, 0));
- QStyle::SubControl sc = QApplication::style()->hitTestComplexControl(QStyle::CC_ScrollBar, opt, pos, 0);
+ QStyle::SubControl sc = style()->hitTestComplexControl(QStyle::CC_ScrollBar, opt, pos, 0);
return scrollbarPart(sc);
}
bool ScrollbarThemeQt::shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent& evt)
{
// Middle click centers slider thumb (if supported)
- return QApplication::style()->styleHint(QStyle::SH_ScrollBar_MiddleClickAbsolutePosition) && evt.button() == MiddleButton;
+ return style()->styleHint(QStyle::SH_ScrollBar_MiddleClickAbsolutePosition) && evt.button() == MiddleButton;
}
void ScrollbarThemeQt::invalidatePart(Scrollbar* scrollbar, ScrollbarPart)
@@ -190,13 +190,12 @@ void ScrollbarThemeQt::invalidatePart(Scrollbar* scrollbar, ScrollbarPart)
int ScrollbarThemeQt::scrollbarThickness(ScrollbarControlSize controlSize)
{
- QStyle* s = QApplication::style();
QStyleOptionSlider o;
o.orientation = Qt::Vertical;
o.state &= ~QStyle::State_Horizontal;
if (controlSize != RegularScrollbar)
o.state |= QStyle::State_Mini;
- return s->pixelMetric(QStyle::PM_ScrollBarExtent, &o, 0);
+ return style()->pixelMetric(QStyle::PM_ScrollBarExtent, &o, 0);
}
int ScrollbarThemeQt::thumbPosition(Scrollbar* scrollbar)
@@ -209,21 +208,21 @@ int ScrollbarThemeQt::thumbPosition(Scrollbar* scrollbar)
int ScrollbarThemeQt::thumbLength(Scrollbar* scrollbar)
{
QStyleOptionSlider* opt = styleOptionSlider(scrollbar);
- IntRect thumb = QApplication::style()->subControlRect(QStyle::CC_ScrollBar, opt, QStyle::SC_ScrollBarSlider, 0);
+ IntRect thumb = style()->subControlRect(QStyle::CC_ScrollBar, opt, QStyle::SC_ScrollBarSlider, 0);
return scrollbar->orientation() == HorizontalScrollbar ? thumb.width() : thumb.height();
}
int ScrollbarThemeQt::trackPosition(Scrollbar* scrollbar)
{
QStyleOptionSlider* opt = styleOptionSlider(scrollbar);
- IntRect track = QApplication::style()->subControlRect(QStyle::CC_ScrollBar, opt, QStyle::SC_ScrollBarGroove, 0);
+ IntRect track = style()->subControlRect(QStyle::CC_ScrollBar, opt, QStyle::SC_ScrollBarGroove, 0);
return scrollbar->orientation() == HorizontalScrollbar ? track.x() - scrollbar->x() : track.y() - scrollbar->y();
}
int ScrollbarThemeQt::trackLength(Scrollbar* scrollbar)
{
QStyleOptionSlider* opt = styleOptionSlider(scrollbar);
- IntRect track = QApplication::style()->subControlRect(QStyle::CC_ScrollBar, opt, QStyle::SC_ScrollBarGroove, 0);
+ IntRect track = style()->subControlRect(QStyle::CC_ScrollBar, opt, QStyle::SC_ScrollBarGroove, 0);
return scrollbar->orientation() == HorizontalScrollbar ? track.width() : track.height();
}
@@ -237,7 +236,7 @@ void ScrollbarThemeQt::paintScrollCorner(ScrollView* scrollView, GraphicsContext
#if QT_VERSION < 0x040500
context->fillRect(rect, QApplication::palette().color(QPalette::Normal, QPalette::Window));
#else
- StylePainter p(context);
+ StylePainter p(this, context);
if (!p.isValid())
return;
@@ -247,5 +246,10 @@ void ScrollbarThemeQt::paintScrollCorner(ScrollView* scrollView, GraphicsContext
#endif
}
+QStyle* ScrollbarThemeQt::style() const
+{
+ return QApplication::style();
+}
+
}
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.h b/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.h
index 6ca44ea..cf4882d 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.h
+++ b/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.h
@@ -28,6 +28,12 @@
#include "ScrollbarTheme.h"
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_NAMESPACE
+class QStyle;
+QT_END_NAMESPACE
+
namespace WebCore {
class ScrollbarThemeQt : public ScrollbarTheme {
@@ -49,6 +55,8 @@ public:
virtual int trackLength(Scrollbar*);
virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);
+
+ QStyle* style() const;
};
}