+2006-01-19 Eric Seidel <eseidel@apple.com>
+
+ Reviewed by darin & anders.
+
+ Fix opacity crasher for <text> and <image>.
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=6668
+ Even though the crash is fixed, opacity still doesn't work.
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=6669
+
+ * svg/custom/text-image-opacity-expected.checksum: Added.
+ * svg/custom/text-image-opacity-expected.png: Added.
+ * svg/custom/text-image-opacity-expected.txt: Added.
+ * svg/custom/text-image-opacity.svg: Added.
+
2006-01-18 Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by Hyatt.
--- /dev/null
+4e3556185f05f4c6dd8abcc854e6f04f
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+ KCanvasContainer {svg} at (0,0) size 0x0
+ RenderSVGText {text} at (0,0) size 785x18
+ RenderText {TEXT} at (0,0) size 29x18
+ text run at (0,0) width 29: "Fail!"
+ RenderSVGText {text} at (0,0) size 785x18
+ RenderText {TEXT} at (0,0) size 379x18
+ text run at (0,0) width 379: "Success! (should be half opacity as should the image below)"
+ RenderImage {image} at (0,0) size 100x100
+ RenderImage {image} at (0,0) size 100x100
+layer at (0,0) size 785x18
+ RenderSVGText {text} at (0,0) size 785x18
+ RenderText {TEXT} at (0,0) size 29x18
+ text run at (0,0) width 29: "Fail!"
+layer at (0,0) size 785x18
+ RenderSVGText {text} at (0,0) size 785x18
+ RenderText {TEXT} at (0,0) size 379x18
+ text run at (0,0) width 379: "Success! (should be half opacity as should the image below)"
+layer at (0,0) size 100x100
+ RenderImage {image} at (0,0) size 100x100
+layer at (0,0) size 100x100
+ RenderImage {image} at (0,0) size 100x100
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <text style="opacity:0.0;" y="25" fill="red" >Fail!</text>
+ <text style="opacity:0.5;" y="50" fill="green">Success! (should be half opacity as should the image below)</text>
+ <image xlink:href="resources/green-checker.png" y="55" height="100" width="100" style="opacity:0.5;"/>
+ <image xlink:href="resources/red-checker.png" y="55" height="100" width="100" style="opacity:0.0;"/>
+</svg>
* loader/loader.cpp: (WebCore::Loader::servePendingRequests): Removed code to add the
cache control string, since that was hardcoded to empty string anyway.
+2006-01-19 Eric Seidel <eseidel@apple.com>
+
+ Reviewed by darin & anders.
+
+ Fix opacity crasher for <text> and <image>.
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=6668
+ Even though the crash is fixed, opacity still doesn't work.
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=6669
+
+ * kcanvas/RenderSVGImage.cpp:
+ (RenderSVGImage::paint):
+ * kcanvas/RenderSVGText.cpp:
+ (RenderSVGText::paint):
+
2006-01-19 Eric Seidel <eseidel@apple.com>
Reviewed by darin.
/*
Copyright (C) 2006 Alexander Kellett <lypanov@kde.org>
+ Copyright (C) 2006 Apple Computer, Inc.
This file is part of the WebKit project
void RenderSVGImage::paint(PaintInfo& paintInfo, int parentX, int parentY)
{
- if (paintInfo.p->paintingDisabled())
- return;
-
if (paintInfo.p->paintingDisabled() || (paintInfo.phase != PaintActionForeground) || style()->visibility() == khtml::HIDDEN)
return;
+
+ KRenderingDevice *renderingDevice = QPainter::renderingDevice();
+ KRenderingDeviceContext *context = renderingDevice->currentContext();
+ bool shouldPopContext = false;
+ if (!context) {
+ // Need to push a device context on the stack if empty.
+ context = paintInfo.p->createRenderingDeviceContext();
+ renderingDevice->pushContext(context);
+ shouldPopContext = true;
+ } else
+ paintInfo.p->save();
- paintInfo.p->save();
-
- KRenderingDeviceContext *context = QPainter::renderingDevice()->currentContext();
context->concatCTM(QMatrix().translate(parentX, parentY));
context->concatCTM(localTransform());
translateForAttributes();
if (filter)
filter->applyFilter(boundingBox);
- paintInfo.p->restore();
+ // restore drawing state
+ if (shouldPopContext) {
+ renderingDevice->popContext();
+ delete context;
+ } else
+ paintInfo.p->restore();
}
void RenderSVGImage::translateForAttributes()
/*
Copyright (C) 2006 Alexander Kellett <lypanov@kde.org>
+ Copyright (C) 2006 Apple Computer, Inc.
- This file is part of the WebKit project
+ This file is part of the WebKit project.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
/*
- * This file is part of the KDE project.
+ * This file is part of the WebKit project.
*
* Copyright (C) 2006 Apple Computer, Inc.
*
if (paintInfo.p->paintingDisabled())
return;
- paintInfo.p->save();
+ KRenderingDevice *renderingDevice = QPainter::renderingDevice();
+ KRenderingDeviceContext *context = renderingDevice->currentContext();
+ bool shouldPopContext = false;
+ if (!context) {
+ // Need to push a device context on the stack if empty.
+ context = paintInfo.p->createRenderingDeviceContext();
+ renderingDevice->pushContext(context);
+ shouldPopContext = true;
+ } else
+ paintInfo.p->save();
- KRenderingDeviceContext *context = QPainter::renderingDevice()->currentContext();
context->concatCTM(localTransform());
context->concatCTM(QMatrix().translate(parentX, parentY));
context->concatCTM(translationForAttributes());
if (filter)
filter->applyFilter(boundingBox);
- paintInfo.p->restore();
+ // restore drawing state
+ if (shouldPopContext) {
+ renderingDevice->popContext();
+ delete context;
+ } else
+ paintInfo.p->restore();
}
bool RenderSVGText::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty, WebCore::HitTestAction hitTestAction)