Commit 9c1a0334 authored by eseidel's avatar eseidel
Browse files

2006-09-27 Eric Seidel <eric@eseidel.com>

        Reviewed by darin.

        Change our invalid-fill error behavior to match Opera (and soon Firefox)
        http://bugzilla.opendarwin.org/show_bug.cgi?id=11017

        * ksvg2/misc/KCanvasRenderingStyle.cpp:
        (WebCore::KSVGPainterFactory::isFilled):
        (WebCore::KSVGPainterFactory::fillPaintServer):
        (WebCore::KSVGPainterFactory::isStroked):
        (WebCore::KSVGPainterFactory::strokePaintServer):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@16599 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 52c4fbcc
2006-09-27 Eric Seidel <eric@eseidel.com>
Reviewed by darin.
Updated test (and results) for new invalid fill behavior.
http://bugzilla.opendarwin.org/show_bug.cgi?id=11017
* svg/custom/invalid-fill-expected.checksum:
* svg/custom/invalid-fill-expected.png:
* svg/custom/invalid-fill-expected.txt:
* svg/custom/invalid-fill.svg:
2006-09-26 Justin Garcia <justin.garcia@apple.com>
 
Reviewed by john
75b9edcc5ab52f142a4d753fe5e036ed
\ No newline at end of file
990395834523505015e0a73e1769f835
\ No newline at end of file
......@@ -2,9 +2,12 @@ layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
KCanvasContainer {svg} at (0,0) size 100x100
KCanvasContainer {g} at (0,0) size 100x100
KCanvasItem {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00L100.00,0.00L100.00,100.00L0.00,100.00"]
KCanvasItem {rect} at (0,0) size 100x100 [data="M0.00,0.00L100.00,0.00L100.00,100.00L0.00,100.00"]
KCanvasItem {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00L100.00,0.00L100.00,100.00L0.00,100.00"]
KCanvasItem {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00L100.00,0.00L100.00,100.00L0.00,100.00"]
KCanvasContainer {g} at (0,0) size 0x0
RenderSVGText {text} at (0,0) size 800x18
RenderText {#text} at (0,0) size 223x18
text run at (0,0) width 223: "The above rect should be BLACK."
RenderSVGText {text} at (0,0) size 800x18
RenderText {#text} at (0,0) size 667x18
text run at (0,0) width 667: "SVG 1.1 FULL says there should be a \"highly perceivable error\" message when an invalid fill url is used."
......@@ -12,6 +15,6 @@ layer at (0,0) size 800x600
RenderText {#text} at (0,0) size 468x18
text run at (0,0) width 468: "Browsers don't display such an error, instead use some sort of fill-fallback."
RenderSVGText {text} at (0,0) size 800x18
RenderText {#text} at (0,0) size 636x18
text run at (0,0) width 561: "Opera falls back to 'black' (default), Firefox to 'none', and Safari to 'none' (as of writing). "
text run at (561,0) width 75: "Bug 11017."
RenderText {#text} at (0,0) size 546x18
text run at (0,0) width 471: "Opera falls back to 'black' (default), Firefox to 'none', and Safari to 'black'. "
text run at (471,0) width 75: "Bug 11017."
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg">
<g fill="red">
<rect width="100" height="100" fill="green"/>
<g fill="orange">
<rect width="100" height="100" fill="red"/>
<rect width="100" height="100" fill="url(#notthere)"/>
<g fill="black">
<text x="10" y="130">SVG 1.1 FULL says there should be a "highly perceivable error" message when an invalid fill url is used.</text>
<text x="10" y="150">Browsers don't display such an error, instead use some sort of fill-fallback.</text>
<text x="10" y="170">Opera falls back to 'black' (default), Firefox to 'none', and Safari to 'none' (as of writing). Bug 11017.</text>
<text x="10" y="130">The above rect should be BLACK.</text>
<text x="10" y="150">SVG 1.1 FULL says there should be a "highly perceivable error" message when an invalid fill url is used.</text>
<text x="10" y="170">Browsers don't display such an error, instead use some sort of fill-fallback.</text>
<text x="10" y="190">Opera falls back to 'black' (default), Firefox to 'none', and Safari to 'black'. Bug 11017.</text>
</g>
</g>
</svg>
2006-09-27 Eric Seidel <eric@eseidel.com>
Reviewed by darin.
Change our invalid-fill error behavior to match Opera (and soon Firefox)
http://bugzilla.opendarwin.org/show_bug.cgi?id=11017
* ksvg2/misc/KCanvasRenderingStyle.cpp:
(WebCore::KSVGPainterFactory::isFilled):
(WebCore::KSVGPainterFactory::fillPaintServer):
(WebCore::KSVGPainterFactory::isStroked):
(WebCore::KSVGPainterFactory::strokePaintServer):
2006-09-27 Brady Eidson <beidson@apple.com>
 
Build fix
......@@ -8938,7 +8938,6 @@
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
knownRegions = (
English,
......@@ -8953,7 +8952,6 @@
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
projectRoot = "";
shouldCheckCompatibility = 1;
targets = (
93F198A508245E59001E9ABC /* WebCore */,
DD041FBE09D9DDBE0010AF2A /* Derived Sources */,
......@@ -51,63 +51,63 @@ static KRenderingPaintServerSolid* sharedSolidPaintServer()
return _sharedSolidPaintServer;
}
bool KSVGPainterFactory::isFilled(const RenderStyle *style)
bool KSVGPainterFactory::isFilled(const RenderStyle* style)
{
SVGPaint *fill = style->svgStyle()->fillPaint();
SVGPaint* fill = style->svgStyle()->fillPaint();
if (fill && fill->paintType() == SVGPaint::SVG_PAINTTYPE_NONE)
return false;
return true;
}
KRenderingPaintServer *KSVGPainterFactory::fillPaintServer(const RenderStyle* style, const RenderObject* item)
KRenderingPaintServer* KSVGPainterFactory::fillPaintServer(const RenderStyle* style, const RenderObject* item)
{
if (!isFilled(style))
return 0;
SVGPaint *fill = style->svgStyle()->fillPaint();
SVGPaint* fill = style->svgStyle()->fillPaint();
KRenderingPaintServer *fillPaintServer;
if (!fill) {
// initial value (black)
fillPaintServer = sharedSolidPaintServer();
static_cast<KRenderingPaintServerSolid *>(fillPaintServer)->setColor(Color::black);
} else if (fill->paintType() == SVGPaint::SVG_PAINTTYPE_URI) {
String id(fill->uri());
fillPaintServer = getPaintServerById(item->document(), AtomicString(id.substring(1)));
KRenderingPaintServer* fillPaintServer = 0;
if (fill && fill->paintType() == SVGPaint::SVG_PAINTTYPE_URI) {
fillPaintServer = getPaintServerById(item->document(), AtomicString(fill->uri().substring(1)));
if (item && fillPaintServer && item->isRenderPath())
fillPaintServer->addClient(static_cast<const RenderPath*>(item));
} else {
} else if (fill) {
fillPaintServer = sharedSolidPaintServer();
KRenderingPaintServerSolid *fillPaintServerSolid = static_cast<KRenderingPaintServerSolid *>(fillPaintServer);
KRenderingPaintServerSolid* fillPaintServerSolid = static_cast<KRenderingPaintServerSolid*>(fillPaintServer);
if (fill->paintType() == SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR)
fillPaintServerSolid->setColor(style->color());
else
fillPaintServerSolid->setColor(fill->color());
}
if (!fillPaintServer) {
// default value (black), see bug 11017
fillPaintServer = sharedSolidPaintServer();
static_cast<KRenderingPaintServerSolid *>(fillPaintServer)->setColor(Color::black);
}
return fillPaintServer;
}
bool KSVGPainterFactory::isStroked(const RenderStyle *style)
bool KSVGPainterFactory::isStroked(const RenderStyle* style)
{
SVGPaint *stroke = style->svgStyle()->strokePaint();
SVGPaint* stroke = style->svgStyle()->strokePaint();
if (!stroke || stroke->paintType() == SVGPaint::SVG_PAINTTYPE_NONE)
return false;
return true;
}
KRenderingPaintServer *KSVGPainterFactory::strokePaintServer(const RenderStyle* style, const RenderObject* item)
KRenderingPaintServer* KSVGPainterFactory::strokePaintServer(const RenderStyle* style, const RenderObject* item)
{
if (!isStroked(style))
return 0;
SVGPaint *stroke = style->svgStyle()->strokePaint();
SVGPaint* stroke = style->svgStyle()->strokePaint();
KRenderingPaintServer *strokePaintServer;
KRenderingPaintServer* strokePaintServer = 0;
if (stroke && stroke->paintType() == SVGPaint::SVG_PAINTTYPE_URI) {
String id(stroke->uri());
strokePaintServer = getPaintServerById(item->document(), AtomicString(id.substring(1)));
strokePaintServer = getPaintServerById(item->document(), AtomicString(stroke->uri().substring(1)));
if(item && strokePaintServer && item->isRenderPath())
strokePaintServer->addClient(static_cast<const RenderPath*>(item));
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment