Skip to content
Browse files

2006-12-26 Eric Seidel <eric@webkit.org>

        Reviewed by olliej.

        ASSERT while loading SVG map
        http://bugs.webkit.org/show_bug.cgi?id=11987

        * ksvg2/css/SVGCSSParser.cpp: remove a few .impl() calls previously missed.
        (WebCore::CSSParser::parseSVGValue):
        (WebCore::CSSParser::parseSVGPaint):
        (WebCore::CSSParser::parseSVGColor):
        * ksvg2/misc/KCanvasRenderingStyle.cpp: handle invalid colors
        (WebCore::KSVGPainterFactory::fillPaintServer):
        (WebCore::KSVGPainterFactory::strokePaintServer):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@18429 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information...
1 parent ec398c4 commit 2ceb602f75666d9793b129709a3032cd7d7428d9 eseidel committed Dec 27, 2006
View
54 LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2006-12-26 Eric Seidel <eric@webkit.org>
+
+ Reviewed by olliej.
+
+ ASSERT while loading SVG map
+ http://bugs.webkit.org/show_bug.cgi?id=11987
+
+ * svg/custom/invalid-fill-hex-expected.checksum: Added.
+ * svg/custom/invalid-fill-hex-expected.png: Added.
+ * svg/custom/invalid-fill-hex-expected.txt: Added.
+ * svg/custom/invalid-fill-hex.svg: Added.
+
2006-12-27 Nikolas Zimmermann <zimmermann@kde.org>
Reviewed by Oliver.
@@ -4117,7 +4129,7 @@ text-clip was an incorrect test, rather than an incorrect result
* editing/pasteboard/emacs-cntl-y-001.html:
-2006-09-27 Eric Seidel <eric@eseidel.com>
+2006-09-27 Eric Seidel <eric@webkit.org>
Reviewed by mitz.
@@ -4146,7 +4158,7 @@ text-clip was an incorrect test, rather than an incorrect result
* svg/custom/viewport-update2-expected.txt: Added.
* svg/custom/viewport-update2.svg: Added.
-2006-09-27 Eric Seidel <eric@eseidel.com>
+2006-09-27 Eric Seidel <eric@webkit.org>
Reviewed by darin.
@@ -4185,7 +4197,7 @@ text-clip was an incorrect test, rather than an incorrect result
* editing/pasteboard/emacs-cntl-y-001-expected.txt: Added.
* editing/pasteboard/emacs-cntl-y-001.html: Added.
-2006-09-26 Eric Seidel <eric@eseidel.com>
+2006-09-26 Eric Seidel <eric@webkit.org>
Reviewed by Tim H.
@@ -4197,7 +4209,7 @@ text-clip was an incorrect test, rather than an incorrect result
* svg/hixie/viewbox/003-expected.txt: Added.
* svg/hixie/viewbox/003.xml: Added.
-2006-09-26 Eric Seidel <eric@eseidel.com>
+2006-09-26 Eric Seidel <eric@webkit.org>
Reviewed by Tim H.
@@ -4209,7 +4221,7 @@ text-clip was an incorrect test, rather than an incorrect result
* svg/custom/createelement-expected.txt: Added.
* svg/custom/createelement.svg: Added.
-2006-09-26 Eric Seidel <eric@eseidel.com>
+2006-09-26 Eric Seidel <eric@webkit.org>
Reviewed by Tim H.
@@ -4228,7 +4240,7 @@ text-clip was an incorrect test, rather than an incorrect result
* editing/execCommand/indent-empty-root-expected.txt: Added.
* editing/execCommand/indent-empty-root.html: Added.
-2006-09-24 Eric Seidel <eric@eseidel.com>
+2006-09-24 Eric Seidel <eric@webkit.org>
Reviewed by mjs.
@@ -4266,7 +4278,7 @@ text-clip was an incorrect test, rather than an incorrect result
* svg/custom/viewport-clip-expected.txt: Added.
* svg/custom/viewport-clip.svg: Added.
-2006-09-24 Eric Seidel <eric@eseidel.com>
+2006-09-24 Eric Seidel <eric@webkit.org>
Reviewed by beth.
@@ -4278,7 +4290,7 @@ text-clip was an incorrect test, rather than an incorrect result
* svg/custom/invalid-fill-expected.txt: Added.
* svg/custom/invalid-fill.svg: Added.
-2006-09-24 Eric Seidel <eric@eseidel.com>
+2006-09-24 Eric Seidel <eric@webkit.org>
Reviewed by hyatt.
@@ -4414,7 +4426,7 @@ text-clip was an incorrect test, rather than an incorrect result
* fast/forms/file-input-direction-expected.txt: Added.
* fast/forms/file-input-direction.html: Added.
-2006-09-20 Eric Seidel <eric@eseidel.com>
+2006-09-20 Eric Seidel <eric@webkit.org>
Reviewed by hyatt.
@@ -4429,7 +4441,7 @@ text-clip was an incorrect test, rather than an incorrect result
* svg/W3C-SVG-1.1/painting-marker-02-f-expected.png:
* svg/W3C-SVG-1.1/painting-marker-02-f-expected.txt:
-2006-09-19 Eric Seidel <eric@eseidel.com>
+2006-09-19 Eric Seidel <eric@webkit.org>
Reviewed by adele.
@@ -4461,7 +4473,7 @@ text-clip was an incorrect test, rather than an incorrect result
* svg/custom/non-opaque-filters-expected.txt:
* svg/custom/text-filter-expected.txt:
-2006-09-19 Eric Seidel <eric@eseidel.com>
+2006-09-19 Eric Seidel <eric@webkit.org>
Reviewed by adele.
@@ -4511,13 +4523,13 @@ text-clip was an incorrect test, rather than an incorrect result
* fast/forms/input-appearance-height-expected.txt:
* fast/forms/input-value-expected.txt:
-2006-09-17 Eric Seidel <eric@eseidel.com>
+2006-09-17 Eric Seidel <eric@webkit.org>
Reviewed by hyatt.
* fast/js/window-properties.html: make work in Firefox (hangs IE)
-2006-09-17 Eric Seidel <eric@eseidel.com>
+2006-09-17 Eric Seidel <eric@webkit.org>
Add a textual dump of the window object property tree.
@@ -5542,7 +5554,7 @@ text-clip was an incorrect test, rather than an incorrect result
* svg/W3C-SVG-1.1/struct-dom-06-b-expected.txt:
-2006-08-26 Eric Seidel <eric@eseidel.com>
+2006-08-26 Eric Seidel <eric@webkit.org>
Reviewed by hyatt.
@@ -6182,7 +6194,7 @@ text-clip was an incorrect test, rather than an incorrect result
* fast/forms/onselect-selectall-expected.txt: Added.
* fast/forms/onselect-selectall.html: Added.
-2006-08-14 Eric Seidel <eric@eseidel.com>
+2006-08-14 Eric Seidel <eric@webkit.org>
Reviewed by mjs.
@@ -6259,7 +6271,7 @@ text-clip was an incorrect test, rather than an incorrect result
* svg/custom/text-filter-expected.txt:
* svg/custom/tref-update-expected.txt:
-2006-08-14 Eric Seidel <eric@eseidel.com>
+2006-08-14 Eric Seidel <eric@webkit.org>
Reviewed by darin and mjs.
@@ -6327,7 +6339,7 @@ text-clip was an incorrect test, rather than an incorrect result
* tables/mozilla/bugs/bug24200-expected.txt: Ditto.
* tables/mozilla/bugs/bug4527-expected.txt: Ditto.
-2006-08-11 Eric Seidel <eric@eseidel.com>
+2006-08-11 Eric Seidel <eric@webkit.org>
Reviewed by andersca.
@@ -6693,7 +6705,7 @@ text-clip was an incorrect test, rather than an incorrect result
* svg/W3C-SVG-1.1/struct-dom-06-b-expected.png:
* svg/W3C-SVG-1.1/struct-dom-06-b-expected.txt:
-2006-07-27 Eric Seidel <eric@eseidel.com>
+2006-07-27 Eric Seidel <eric@webkit.org>
Reviewed by darin.
@@ -6793,7 +6805,7 @@ text-clip was an incorrect test, rather than an incorrect result
* fast/encoding/denormalised-voiced-japanese-chars-expected.txt: Added.
* fast/encoding/denormalised-voiced-japanese-chars.html: Added.
-2006-07-27 Eric Seidel <eric@eseidel.com>
+2006-07-27 Eric Seidel <eric@webkit.org>
Reviewed by ap.
@@ -6831,7 +6843,7 @@ text-clip was an incorrect test, rather than an incorrect result
* svg/custom/invalid-viewbox2-expected.txt: Added.
* svg/custom/invalid-viewbox2.svg: Added.
-2006-07-27 Eric Seidel <eric@eseidel.com>
+2006-07-27 Eric Seidel <eric@webkit.org>
Reviewed by ap.
@@ -10859,7 +10871,7 @@ text-clip was an incorrect test, rather than an incorrect result
* tables/mozilla_expected_failures/bugs/bug32205-1-expected.txt:
* tables/mozilla_expected_failures/bugs/bug65372-expected.txt:
-2006-05-25 Eric Seidel <eric@eseidel.com>
+2006-05-25 Eric Seidel <eric@webkit.org>
Reviewed by andersca.
View
1 LayoutTests/svg/custom/invalid-fill-hex-expected.checksum
@@ -0,0 +1 @@
+990395834523505015e0a73e1769f835
View
BIN LayoutTests/svg/custom/invalid-fill-hex-expected.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
20 LayoutTests/svg/custom/invalid-fill-hex-expected.txt
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+ RenderSVGContainer {svg} at (-0.50,-0.50) size 677.50x194.50
+ RenderSVGContainer {g} at (-0.50,-0.50) size 677.50x194.50
+ RenderPath {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"]
+ RenderPath {rect} at (-0.50,-0.50) size 101x101 [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00L100.00,0.00L100.00,100.00L0.00,100.00"]
+ RenderSVGContainer {g} at (10,116) size 667x78
+ RenderSVGText {text} at (10,130) size 800x18
+ RenderSVGInlineText {#text} at (0,-14) size 223x18
+ text run at (0,-14) width 223: "The above rect should be BLACK."
+ RenderSVGText {text} at (10,150) size 800x18
+ RenderSVGInlineText {#text} at (0,-14) size 667x18
+ text run at (0,-14) width 667: "SVG 1.1 FULL says there should be a \"highly perceivable error\" message when an invalid fill url is used."
+ RenderSVGText {text} at (10,170) size 800x18
+ RenderSVGInlineText {#text} at (0,-14) size 468x18
+ text run at (0,-14) width 468: "Browsers don't display such an error, instead use some sort of fill-fallback."
+ RenderSVGText {text} at (10,190) size 800x18
+ RenderSVGInlineText {#text} at (0,-14) size 546x18
+ text run at (0,-14) width 471: "Opera falls back to 'black' (default), Firefox to 'none', and Safari to 'black'. "
+ text run at (471,-14) width 75: "Bug 11017."
View
13 LayoutTests/svg/custom/invalid-fill-hex.svg
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg">
+ <g fill="orange">
+ <rect width="100" height="100" fill="red"/>
+ <rect width="100" height="100" fill="#0" stroke="#0"/>
+ <g fill="black">
+ <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 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>
View
6 PageLoadTests/ChangeLog
@@ -1,5 +1,11 @@
2006-12-26 Eric Seidel <eric@webkit.org>
+ Reviewed by olliej.
+
+ * svg/svg.pltsuite: re-enable word-iso.svg after fixing http://bugs.webkit.org/show_bug.cgi?id=11987
+
+2006-12-26 Eric Seidel <eric@webkit.org>
+
Reviewed by bradee-oh.
Add new PageLoadTests directory (this one)
View
2 PageLoadTests/svg/svg.pltsuite
@@ -15,5 +15,5 @@ file:///WEBKIT_PATH/PageLoadTests/svg/files/francobollo_gnome_ezechi_02.svg
file:///WEBKIT_PATH/PageLoadTests/svg/files/gearflowers.svg
file:///WEBKIT_PATH/PageLoadTests/svg/files/hereGear4.svg
file:///WEBKIT_PATH/PageLoadTests/svg/files/mtsthelens.svg
-file:///WEBKIT_PATH/PageLoadTests/svg/files/world-iso.svg-disabled
+file:///WEBKIT_PATH/PageLoadTests/svg/files/world-iso.svg
file:///WEBKIT_PATH/PageLoadTests/svg/files/worldcup.svg
View
15 WebCore/ChangeLog
@@ -1,5 +1,20 @@
2006-12-26 Eric Seidel <eric@webkit.org>
+ Reviewed by olliej.
+
+ ASSERT while loading SVG map
+ http://bugs.webkit.org/show_bug.cgi?id=11987
+
+ * ksvg2/css/SVGCSSParser.cpp: remove a few .impl() calls previously missed.
+ (WebCore::CSSParser::parseSVGValue):
+ (WebCore::CSSParser::parseSVGPaint):
+ (WebCore::CSSParser::parseSVGColor):
+ * ksvg2/misc/KCanvasRenderingStyle.cpp: handle invalid colors
+ (WebCore::KSVGPainterFactory::fillPaintServer):
+ (WebCore::KSVGPainterFactory::strokePaintServer):
+
+2006-12-26 Eric Seidel <eric@webkit.org>
+
Reviewed by ggaren.
No test cases changed.
View
21 WebCore/ksvg2/css/SVGCSSParser.cpp
@@ -216,7 +216,7 @@ bool CSSParser::parseSVGValue(int propId, bool important)
else if (id == SVGCSS_VAL_CURRENTCOLOR)
parsedValue = new SVGPaint(SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR);
else if (value->unit == CSSPrimitiveValue::CSS_URI)
- parsedValue = new SVGPaint(SVGPaint::SVG_PAINTTYPE_URI, domString(value->string).impl());
+ parsedValue = new SVGPaint(SVGPaint::SVG_PAINTTYPE_URI, domString(value->string));
else
parsedValue = parseSVGPaint();
@@ -228,7 +228,7 @@ bool CSSParser::parseSVGValue(int propId, bool important)
case CSS_PROP_COLOR: // <color> | inherit
if ((id >= CSS_VAL_AQUA && id <= CSS_VAL_WINDOWTEXT) ||
(id >= SVGCSS_VAL_ALICEBLUE && id <= SVGCSS_VAL_YELLOWGREEN))
- parsedValue = new SVGColor(domString(value->string).impl());
+ parsedValue = new SVGColor(domString(value->string));
else
parsedValue = parseSVGColor();
@@ -241,7 +241,7 @@ bool CSSParser::parseSVGValue(int propId, bool important)
case SVGCSS_PROP_LIGHTING_COLOR:
if ((id >= CSS_VAL_AQUA && id <= CSS_VAL_WINDOWTEXT) ||
(id >= SVGCSS_VAL_ALICEBLUE && id <= SVGCSS_VAL_YELLOWGREEN))
- parsedValue = new SVGColor(domString(value->string).impl());
+ parsedValue = new SVGColor(domString(value->string));
else if (id == SVGCSS_VAL_CURRENTCOLOR)
parsedValue = new SVGColor(SVGColor::SVG_COLORTYPE_CURRENTCOLOR);
else // TODO : svgcolor (iccColor)
@@ -384,7 +384,7 @@ CSSValue* CSSParser::parseSVGPaint()
g = max(0, min(255, g));
b = max(0, min(255, b));
- return new SVGPaint(SVGPaint::SVG_PAINTTYPE_RGBCOLOR, String(), String::format("rgb(%d, %d, %d)", r, g, b).impl());
+ return new SVGPaint(SVGPaint::SVG_PAINTTYPE_RGBCOLOR, String(), String::format("rgb(%d, %d, %d)", r, g, b));
}
else
return 0;
@@ -396,12 +396,11 @@ CSSValue* CSSParser::parseSVGColor()
{
Value* value = valueList->current();
if (!strict && value->unit == CSSPrimitiveValue::CSS_NUMBER && value->fValue >= 0. && value->fValue < 1000000.)
- return new SVGColor(String::format("%06d", (int)(value->fValue+.5)).impl());
- else if (value->unit == CSSPrimitiveValue::CSS_RGBCOLOR) {
- String str = "#" + domString(value->string);
- return new SVGColor(str.impl());
- } else if (value->unit == CSSPrimitiveValue::CSS_IDENT || (!strict && value->unit == CSSPrimitiveValue::CSS_DIMENSION))
- return new SVGColor(domString(value->string).impl());
+ return new SVGColor(String::format("%06d", (int)(value->fValue+.5)));
+ else if (value->unit == CSSPrimitiveValue::CSS_RGBCOLOR)
+ return new SVGColor("#" + domString(value->string));
+ else if (value->unit == CSSPrimitiveValue::CSS_IDENT || (!strict && value->unit == CSSPrimitiveValue::CSS_DIMENSION))
+ return new SVGColor(domString(value->string));
else if (value->unit == Value::Function && value->function->args != 0 && domString(value->function->name).lower() == "rgb(") {
ValueList* args = value->function->args;
Value* v = args->current();
@@ -426,7 +425,7 @@ CSSValue* CSSParser::parseSVGColor()
g = max(0, min(255, g));
b = max(0, min(255, b));
- return new SVGColor(String::format("rgb(%d, %d, %d)", r, g, b).impl());
+ return new SVGColor(String::format("rgb(%d, %d, %d)", r, g, b));
}
else
return 0;
View
16 WebCore/ksvg2/misc/KCanvasRenderingStyle.cpp
@@ -59,18 +59,21 @@ SVGPaintServer* KSVGPainterFactory::fillPaintServer(const RenderStyle* style, co
fillPaintServer = getPaintServerById(item->document(), AtomicString(fill->uri().substring(1)));
if (fillPaintServer && item->isRenderPath())
fillPaintServer->addClient(static_cast<const RenderPath*>(item));
- if (!fillPaintServer) {
- // default value (black), see bug 11017
- fillPaintServer = sharedSolidPaintServer();
- static_cast<SVGPaintServerSolid*>(fillPaintServer)->setColor(Color::black);
- }
} else {
fillPaintServer = sharedSolidPaintServer();
SVGPaintServerSolid* fillPaintServerSolid = static_cast<SVGPaintServerSolid*>(fillPaintServer);
if (fill->paintType() == SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR)
fillPaintServerSolid->setColor(style->color());
else
fillPaintServerSolid->setColor(fill->color());
+ // FIXME: Ideally invalid colors would never get set on the RenderStyle and this could turn into an ASSERT
+ if (!fillPaintServerSolid->color().isValid())
+ fillPaintServer = 0;
+ }
+ if (!fillPaintServer) {
+ // default value (black), see bug 11017
+ fillPaintServer = sharedSolidPaintServer();
+ static_cast<SVGPaintServerSolid*>(fillPaintServer)->setColor(Color::black);
}
return fillPaintServer;
}
@@ -94,6 +97,9 @@ SVGPaintServer* KSVGPainterFactory::strokePaintServer(const RenderStyle* style,
strokePaintServerSolid->setColor(style->color());
else
strokePaintServerSolid->setColor(stroke->color());
+ // FIXME: Ideally invalid colors would never get set on the RenderStyle and this could turn into an ASSERT
+ if (!strokePaintServerSolid->color().isValid())
+ strokePaintServer = 0;
}
return strokePaintServer;

0 comments on commit 2ceb602

Please sign in to comment.
Something went wrong with that request. Please try again.