[svg] rect with invalid stroke value
Hi, SVG gurus, I have a question regarding LayoutTests/svg/custom/invalid-fill-hex.svg . It contains: <rect width="100" height="100" fill="#ff" stroke="#0"/> From the comment there I understand that the rect should be filled with black. But how about the stroke? I guess black stroke should be rendered, because #0 is also invalid. Is it true? The current test data (expected output) doesn't contain the stroke. I'm asking this https://bugs.webkit.org/show_bug.cgi?id=24742 fixes hex color parsing and as a result, the stroke above starts to be rendered with black. I'd like to find out whether the above test (or test data) is wrong or I am making a mistake. I think we should either: Rewrite <rect width="100" height="100" fill="#ff" stroke="#0"/> to <rect width="100" height="100" fill="#ff"> or rebaseline the test data. Which do you prefer (assuming the test needs to be changed?) Yuzo
Fill defaults to black, stroke to none. Whether invalid values are ignored or treated as black I don't remember. In general the SVG spec is useless in this regard. http://www.w3.org/TR/SVG/painting.html#FillProperties http://www.w3.org/TR/SVG/painting.html#StrokeProperties -eric On Mon, Jun 14, 2010 at 4:00 AM, Yuzo Fujishima <yuzo@google.com> wrote:
Hi, SVG gurus, I have a question regarding LayoutTests/svg/custom/invalid-fill-hex.svg . It contains: <rect width="100" height="100" fill="#ff" stroke="#0"/> From the comment there I understand that the rect should be filled with black. But how about the stroke? I guess black stroke should be rendered, because #0 is also invalid. Is it true? The current test data (expected output) doesn't contain the stroke. I'm asking this https://bugs.webkit.org/show_bug.cgi?id=24742 fixes hex color parsing and as a result, the stroke above starts to be rendered with black. I'd like to find out whether the above test (or test data) is wrong or I am making a mistake. I think we should either: Rewrite <rect width="100" height="100" fill="#ff" stroke="#0"/> to <rect width="100" height="100" fill="#ff"> or rebaseline the test data. Which do you prefer (assuming the test needs to be changed?) Yuzo
_______________________________________________ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Eric Seidel:
Fill defaults to black, stroke to none. Whether invalid values are ignored or treated as black I don't remember.
Neither! SVG 1.1 defines a “render up until the error” behaviour (which most implementations don’t follow): http://dev.w3.org/SVG/profiles/1.1F2/publish/implnote.html#ErrorProcessing This is not going to change in time for SVG 1.1 Second Edition.
In general the SVG spec is useless in this regard.
http://www.w3.org/TR/SVG/painting.html#FillProperties http://www.w3.org/TR/SVG/painting.html#StrokeProperties
I recommend following what SVG Tiny 1.2 says on this, which is that attributes with unsupported values are ignored: http://www.w3.org/TR/SVGTiny12/implnote.html#UnsupportedProps This is the behaviour that most implementations use, and is what will be kept for SVG 2.0. -- Cameron McCormack ≝ http://mcc.id.au/
Cameron McCormack:
I recommend following what SVG Tiny 1.2 says on this, which is that attributes with unsupported values are ignored:
http://www.w3.org/TR/SVGTiny12/implnote.html#UnsupportedProps
The consequence of ignoring the attribute being that the stroke value is inherited from its parent. -- Cameron McCormack ≝ http://mcc.id.au/
Am 14.06.2010 um 20:49 schrieb Eric Seidel:
Fill defaults to black, stroke to none. Whether invalid values are ignored or treated as black I don't remember. In general the SVG spec is useless in this regard.
http://www.w3.org/TR/SVG/painting.html#FillProperties http://www.w3.org/TR/SVG/painting.html#StrokeProperties
That's not correct. WebKit choose 'black' as default for fill _and_ stroke. We had 'none' for years, until compatibility bugs were raised, as Opera uses black as default stroke, if there is any error. Of course stroke="black" is only used when stroke is specified at all and invalid, or if you're referencing a paint server that can not be found. <rect stroke="url(#invalid)"> will result in a black stroke. Whether this behaviour is correct or not - I am not sure about that, just wanted to show what we're doing right now. Relevant code lives in RenderSVGResource.cpp, see "RenderSVGResource::strokePaintingResource". Cheers, Niko
Nikolas Zimmermann:
We had 'none' for years, until compatibility bugs were raised, as Opera uses black as default stroke, if there is any error.
Doesn’t seem to be the case any more, at least for Opera 10.53: http://livedom.validator.nu/?%3C!DOCTYPE%20html%3E%0D%0A%3Csvg%20width%3D'100'%20height%3D'100'%3E%3Ccircle%20cx%3D'50'%20cy%3D'50'%20r%3D'30'%20fill%3D'yellow'%20stroke%3D'xxx'%20stroke-width%3D'4'%2F%3E%3C%2Fsvg%3E Note the stroke="xxx". Firefox nightlies behave the same. -- Cameron McCormack ≝ http://mcc.id.au/
Am 15.06.2010 um 08:28 schrieb Cameron McCormack:
Nikolas Zimmermann:
We had 'none' for years, until compatibility bugs were raised, as Opera uses black as default stroke, if there is any error.
Doesn’t seem to be the case any more, at least for Opera 10.53:
Note the stroke="xxx". Firefox nightlies behave the same.
That would be good news, I've been against the switch all time, we should reiterate that specific behaviour. Turning off that default stroke behaviour and seeing which layout tests break, and whether we now consider this a progression :-) I'll have a look at it this week. Cheers, Niko
Nikolas, Thank you for your response. I'll hold off committing https://bugs.webkit.org/show_bug.cgi?id=24742 until you make a decision. Please let me know when you make one. Yuzo On Tue, Jun 15, 2010 at 3:42 PM, Nikolas Zimmermann < zimmermann@physik.rwth-aachen.de> wrote:
Am 15.06.2010 um 08:28 schrieb Cameron McCormack:
Nikolas Zimmermann:
We had 'none' for years, until compatibility bugs were raised, as Opera uses black as default stroke, if there is any error.
Doesn’t seem to be the case any more, at least for Opera 10.53:
Note the stroke="xxx". Firefox nightlies behave the same.
That would be good news, I've been against the switch all time, we should reiterate that specific behaviour. Turning off that default stroke behaviour and seeing which layout tests break, and whether we now consider this a progression :-) I'll have a look at it this week.
Cheers, Niko
_______________________________________________ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Hi, Any update on this? Is it OK to remove 'stroke="#0"' from: LayoutTests/svg/custom/invalid-fill-hex.svg <rect width="100" height="100" fill="#ff" stroke="#0"/> ? If there are no objections, I'll upload a patch to remove it for review. Yuzo On Tue, Jun 15, 2010 at 5:52 PM, Yuzo Fujishima <yuzo@google.com> wrote:
Nikolas,
Thank you for your response. I'll hold off committing https://bugs.webkit.org/show_bug.cgi?id=24742 until you make a decision. Please let me know when you make one.
Yuzo
On Tue, Jun 15, 2010 at 3:42 PM, Nikolas Zimmermann < zimmermann@physik.rwth-aachen.de> wrote:
Am 15.06.2010 um 08:28 schrieb Cameron McCormack:
Nikolas Zimmermann:
We had 'none' for years, until compatibility bugs were raised, as Opera uses black as default stroke, if there is any error.
Doesn’t seem to be the case any more, at least for Opera 10.53:
Note the stroke="xxx". Firefox nightlies behave the same.
That would be good news, I've been against the switch all time, we should reiterate that specific behaviour. Turning off that default stroke behaviour and seeing which layout tests break, and whether we now consider this a progression :-) I'll have a look at it this week.
Cheers, Niko
_______________________________________________ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Hi Yuzo, the issue should be fixed in WebCore/rendering/RenderSVGPaintServer. Removing this check in the test doesn't help to fix the bug :-) Dirk Am Montag, den 28.06.2010, 11:05 +0900 schrieb Yuzo Fujishima:
Hi,
Any update on this?
Is it OK to remove 'stroke="#0"' from: LayoutTests/svg/custom/invalid-fill-hex.svg <rect width="100" height="100" fill="#ff" stroke="#0"/> ?
If there are no objections, I'll upload a patch to remove it for review.
Yuzo
On Tue, Jun 15, 2010 at 5:52 PM, Yuzo Fujishima <yuzo@google.com> wrote: Nikolas,
Thank you for your response. I'll hold off committing https://bugs.webkit.org/show_bug.cgi?id=24742 until you make a decision. Please let me know when you make one.
Yuzo
On Tue, Jun 15, 2010 at 3:42 PM, Nikolas Zimmermann <zimmermann@physik.rwth-aachen.de> wrote:
Am 15.06.2010 um 08:28 schrieb Cameron McCormack:
Nikolas Zimmermann: We had 'none' for years, until compatibility bugs were raised, as Opera uses black as default stroke, if there is any error.
Doesn’t seem to be the case any more, at least for Opera 10.53:
http://livedom.validator.nu/?%3C!DOCTYPE% 20html%3E%0D%0A%3Csvg%20width%3D'100'%20height %3D'100'%3E%3Ccircle%20cx%3D'50'%20cy%3D'50'% 20r%3D'30'%20fill%3D'yellow'%20stroke%3D'xxx'% 20stroke-width%3D'4'%2F%3E%3C%2Fsvg%3E
Note the stroke="xxx". Firefox nightlies behave the same.
That would be good news, I've been against the switch all time, we should reiterate that specific behaviour. Turning off that default stroke behaviour and seeing which layout tests break, and whether we now consider this a progression :-) I'll have a look at it this week.
Cheers, Niko
_______________________________________________ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
_______________________________________________ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Any updates? If I don't see any objections within 24 hours, preferably with the commitment to fix the SVG bug :), I'll modify the test and commit the patch for https://bugs.webkit.org/show_bug.cgi?id=24742 My rationale: - No actions observed for more than 2 months - Modifying the test doesn't harm the test's intention, as indicated by the name of the tests. - Not fixing a bug because of another bug no one is actively working on doesn't make sense to me. Yuzo On Mon, Jun 28, 2010 at 2:54 PM, Dirk Schulze <vbs85@gmx.de> wrote:
Hi Yuzo,
the issue should be fixed in WebCore/rendering/RenderSVGPaintServer. Removing this check in the test doesn't help to fix the bug :-)
Dirk
Am Montag, den 28.06.2010, 11:05 +0900 schrieb Yuzo Fujishima:
Hi,
Any update on this?
Is it OK to remove 'stroke="#0"' from: LayoutTests/svg/custom/invalid-fill-hex.svg <rect width="100" height="100" fill="#ff" stroke="#0"/> ?
If there are no objections, I'll upload a patch to remove it for review.
Yuzo
On Tue, Jun 15, 2010 at 5:52 PM, Yuzo Fujishima <yuzo@google.com> wrote: Nikolas,
Thank you for your response. I'll hold off committing https://bugs.webkit.org/show_bug.cgi?id=24742 until you make a decision. Please let me know when you make one.
Yuzo
On Tue, Jun 15, 2010 at 3:42 PM, Nikolas Zimmermann <zimmermann@physik.rwth-aachen.de> wrote:
Am 15.06.2010 um 08:28 schrieb Cameron McCormack:
Nikolas Zimmermann: We had 'none' for years, until compatibility bugs were raised, as Opera uses black as default stroke, if there is any error.
Doesn’t seem to be the case any more, at least for Opera 10.53:
http://livedom.validator.nu/?%3C!DOCTYPE% 20html%3E%0D%0A%3Csvg%20width%3D'100'%20height %3D'100'%3E%3Ccircle%20cx%3D'50'%20cy%3D'50'% 20r%3D'30'%20fill%3D'yellow'%20stroke%3D'xxx'% 20stroke-width%3D'4'%2F%3E%3C%2Fsvg%3E
Note the stroke="xxx". Firefox nightlies behave the same.
That would be good news, I've been against the switch all time, we should reiterate that specific behaviour. Turning off that default stroke behaviour and seeing which layout tests break, and whether we now consider this a progression :-) I'll have a look at it this week.
Cheers, Niko
_______________________________________________ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
_______________________________________________ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
participants (5)
-
Cameron McCormack
-
Dirk Schulze
-
Eric Seidel
-
Nikolas Zimmermann
-
Yuzo Fujishima