W3C home > Mailing lists > Public > www-svg@w3.org > August 2000

Re: Expected Synchronization behavior?

From: Jon Ferraiolo <jferraio@Adobe.COM>
Date: Fri, 11 Aug 2000 11:37:41 -0700
Message-Id: <200008111834.LAA03062@mail-345.corp.Adobe.COM>
To: bbrodie@savagesoftware.com (Blaine Brodie)
Cc: www-svg@w3.org
Blaine,
It is my understanding that if you do a setAttribute(xxx, yyy), then either
xxx gets the value yyy or an exception is raised. If yyy is a bad value,
then either it raises an immediate exception, or (in the case of SVG), the
document becomes "in error", as described in
(http://www.w3.org/TR/SVG/implnote.html#ErrorProcessing). A document that
is "in error" should be rendered up to the element containing the error, at
which point rendering stops. For example, in the example below, everything
before the circle should draw, but not the circle. This behavior is meant
to help users and developers quickly find and fix problems. Adobe has
implemented this little bit of trickiness to a reasonable level in the
current release of the Adobe SVG Viewer.

The spec says nothing about what server-side SVG DOM implementations should
do with errors. It seems to me that different usage scenarios would call
for different approaches to error handling. In some cases, a server-side
application might want to be extraordinarily forgiving since there not be a
feedback loop to the source information and there may be no viable option
other than to process in the best manner possible. In other cases, a
server-side application might want to be extraordinarily ruthless and abort
unless every aspect of the source information is 100% correct. In other
words, I would propose that server-side SVG DOM implementations can deal
with errors however they see fit. But that's just my opinion. I could be
wrong.

Jon Ferraiolo
SVG Editor
Adobe Systems Incorporated

At 10:12 AM 8/11/00 -0700, Blaine Brodie wrote:
>What is the expected synchronization behavior between presentation
>attributes and their corresponding CSSValues when the attribute is set
>with an invalid value?  For example, assume I have a circle element named
>'circleElement' and I set its 'opacity' attribute with an invalid value.
>
>circleElement.setAttribute("opacity", "1.0");
>CSSPrimitiveValue opacity =
>(CSSPrimitiveValue)circleElement.getPresentationAttribute("opacity");
>circleElement.setAttribute("opacity", "bad value"); //does 'opacity' get
>detacted from the syncronization process here ??
>opacity.setFloatValue(CSSPrimitiveValue.CSS_NUMBER, 0.5);
>circleElement.getAttribute("opacity"); //does this return "bad value" or
>"0.5" ?
>
>Thanks for the clarification.
>---
>Blaine Brodie
> 
Received on Friday, 11 August 2000 14:36:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 5 November 2012 23:52:48 GMT