[webkit-qt] blur distance/border support in box-shadow attribute

chunrong lai chunronglai at gmail.com
Mon Sep 13 03:23:09 PDT 2010


 Hmm. According to the discussions in
https://bugs.webkit.org/show_bug.cgi?id=23291 the feature is just
unimplemented:

*- Comment #3 From Carol Szabo 2009-08-10 14:43:19 PST --The patch causes
shadows to appear in QtWebKit when the -webkit-box-shadow style is used, but
the blur parameter is ignored. All shadows are totally sharp.*

See below code in webcore/platform/graphics/qt/GraphicsContextQt.cpp:

*static inline void drawBorderlessRectShadow(...)
{
    IntSize shadowSize;
    int shadowBlur;
    Color shadowColor;
    if (context->getShadow(shadowSize, shadowBlur, shadowColor)) {
        FloatRect shadowRect(rect);
        shadowRect.move(shadowSize.width(), shadowSize.height());
        p->fillRect(shadowRect, QColor(shadowColor)); //shadowBlur is
ignored
    }
}*
**
*void GraphicsContext::setPlatformShadow(const IntSize& size, int, const
Color&, ColorSpace)
{
    // Qt doesn't support shadows natively, they are drawn manually in the
draw* functions*
*    if (m_common->state.shadowsIgnoreTransforms) {*
*        ......
    }
}*
**
*void GraphicsContext::clearPlatformShadow()
{
    // Qt doesn't support shadows natively, they are drawn manually in the
draw functions
}*

 Thus I need to think about whether to accept its current form? Can I know
how to draw the shadowBlur manually?

On Mon, Sep 13, 2010 at 4:55 PM, chunrong lai <chunronglai at gmail.com> wrote:

> hi, colleagues:
> I see that section 6.2 of "The 'box-shadow' property" in
> http://www.w3.org/TR/css3-background/#the-box-shadow says the third length
> as a blur distance is defined. When I tested
> http://webkit.org/blog/86/box-shadow/ I saw it is not supported. As the
> same time Chromium just has not problem to display the blue distance/border
> of the box shadow as the attachment (figures scaled to match to 40KB limit).
>
> I am not sure if it is related with
> https://bugs.webkit.org/show_bug.cgi?id=23291 whose status is "resolved
> fixed". I also tried to enable more QPainter::SmoothPixmapTransform in
> GraphicsContext::setImageInterpolationQuality() at
> WebCore/platform/graphics/qt/GraphicsContextQt.cpp but it seems not work.
> :-)
> Suggestions?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20100913/e0f055f5/attachment.html>


More information about the webkit-qt mailing list