diff options
author | Paul Olav Tvete <paul.tvete@nokia.com> | 2009-11-19 09:58:03 +0100 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@nokia.com> | 2009-11-19 09:58:03 +0100 |
commit | 879e2ea7d15510ec5f94d6d7a005b157b115f69f (patch) | |
tree | 73aedd0bffe7ab39387229a9417aa50cecbbf0aa /src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumWin.cpp | |
parent | 8fc2eec5b3282665f76f1e0313a03608bf4e7bc1 (diff) | |
parent | 80cd617b05ad3e647c87dc063d40cde0617344ca (diff) |
Merge remote branch 'origin/4.6' into lighthouse
Conflicts:
configure
src/plugins/graphicssystems/graphicssystems.pro
Diffstat (limited to 'src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumWin.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumWin.cpp | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumWin.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumWin.cpp index 20503f33cb..4b38d53e74 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumWin.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumWin.cpp @@ -611,21 +611,11 @@ bool RenderThemeChromiumWin::paintTextFieldInternal(RenderObject* o, const IntRect& r, bool drawEdges) { - // Nasty hack to make us not paint the border on text fields with a - // border-radius. Webkit paints elements with border-radius for us. - // FIXME: Get rid of this if-check once we can properly clip rounded - // borders: http://b/1112604 and http://b/1108635 - // FIXME: make sure we do the right thing if css background-clip is set. - if (o->style()->hasBorderRadius()) - return false; - - const ThemeData& themeData = getThemeData(o); - // Fallback to white if the specified color object is invalid. + // (Note ChromiumBridge::paintTextField duplicates this check). Color backgroundColor(Color::white); - if (o->style()->backgroundColor().isValid()) { + if (o->style()->backgroundColor().isValid()) backgroundColor = o->style()->backgroundColor(); - } // If we have background-image, don't fill the content area to expose the // parent's background. Also, we shouldn't fill the content area if the @@ -634,17 +624,32 @@ bool RenderThemeChromiumWin::paintTextFieldInternal(RenderObject* o, // Note that we should paint the content area white if we have neither the // background color nor background image explicitly specified to keep the // appearance of select element consistent with other browsers. - bool fillContentArea = !o->style()->hasBackgroundImage() && backgroundColor.alpha() != 0; - - WebCore::ThemePainter painter(i.context, r); - ChromiumBridge::paintTextField(painter.context(), - themeData.m_part, - themeData.m_state, - themeData.m_classicState, - painter.drawRect(), - backgroundColor, - fillContentArea, - drawEdges); + bool fillContentArea = !o->style()->hasBackgroundImage() && backgroundColor.alpha(); + + if (o->style()->hasBorderRadius()) { + // If the style has rounded borders, setup the context to clip the + // background (themed or filled) appropriately. + // FIXME: make sure we do the right thing if css background-clip is set. + i.context->save(); + IntSize topLeft, topRight, bottomLeft, bottomRight; + o->style()->getBorderRadiiForRect(r, topLeft, topRight, bottomLeft, bottomRight); + i.context->addRoundedRectClip(r, topLeft, topRight, bottomLeft, bottomRight); + } + { + const ThemeData& themeData = getThemeData(o); + WebCore::ThemePainter painter(i.context, r); + ChromiumBridge::paintTextField(painter.context(), + themeData.m_part, + themeData.m_state, + themeData.m_classicState, + painter.drawRect(), + backgroundColor, + fillContentArea, + drawEdges); + // End of block commits the painter before restoring context. + } + if (o->style()->hasBorderRadius()) + i.context->restore(); return false; } |