Re: transform as a presentation attribute

On 26/06/2014 7:48 PM, Juergen Roethig wrote:
> Hello again,
>
> Am 26.06.2014 10:53, schrieb Dirk Schulze:
>>
>> On Jun 26, 2014, at 9:39 AM, Juergen Roethig
>> <roethig@dhbw-karlsruhe.de> wrote:
>>
>>> Am 24.06.2014 23:44, schrieb Tab Atkins Jr.:
>>>> [...]
>>>>
>>>> <!DOCTYPE html>
>>>> <svg viewBox="0 0 10 10" width=100 height=100 style="border: thin
>>>> solid;">
>>>>   <rect x=1 y=1 width=2   height=2   fill=blue ></rect>
>>>>   <rect x=1 y=5 width=2px height=2px fill=green></rect>
>>>> </svg>
>>>>
>>>> [...]
>>>
>>> Just a question: Is this really the way we should code SVG in the
>>> future, or even in the present? As in the past, it looked somewhat
>>> different (DOCTYPE, attributes, ...) ... especially the <!DOCTYPE
>>> html> concernes me somehow.
>>
>> This effectively makes the SVG file an HTML file and Tab used it to
>> paste a complete and applicable example that works out of the box
>> without defining namespaces and so on. Inline SVG is definitely
>> important for the future and present. It is still up to you how you
>> want to create your SVG file… the context is very important as well.
>
> But nevertheless, for this original HTML5-based inline SVG code, there
> is still an issue which is unclear to me: May you write an HTML5 file
> (with its "<!DOCTYPE html>") and have _no_ root tag "_<html>_" _but_
> _another_ _one_ ("<svg>" in that case)? Well, I am not quite sure about
> those down-watered grammar rules in HTML5, but does HTML5 allow a
> DOCTYPE where the first argument (the "html") does no longer give the
> name of the root tag?

Yes but this is not just in the realm of HTML5 but HTML in general. If 
you insert the below code into an text editor and save it with either a 
.htm or .html extension, it will still render as inline SVG in HTML. If 
you validate it, it will return as HTML 4.01 Transitional
with 3 Errors and 4 warnings. Most browsers will see it as text/html.

<svg viewBox="0 0 10 10" width=100 height=100 style="border: thin solid;">
   <rect x=1 y=1 width=2   height=2   fill=blue ></rect>
   <rect x=1 y=5 width=2px height=2px fill=green></rect>
</svg>

> Sorry for the repetition of the question on that list, but I am afraid
> that on any HTML5 list, they might get shocked about my antique and
> restricting opinions. And since this might offer the ability to forget
> about all those restricting grammar issues of current SVG, it will give
> us (the "SVG experts") finally the freedom to code our applications
> without all those burdening restrictions when just coding our SVG as an
> implicit HTML5 by just replacing the DOCTYPE and nothing else, if the
> answer to the above question is "yes" ... and if the answer is "no", we
> should probably make it a proposal ;-)

If you tested the above code, you will see that you don't need a 
doctype. There is no true yes or no to your question since a browser 
will wrap the inline SVG with a <body> and <html> element (not seen in 
the source code) regardless of if it is an invalid document structure.

Your questions don't seem to be relating to SVG but rather HTML. Please 
note that this is a mailing list for the specifications of SVG. If you 
want to discuss HTML which is what you are largely discussing, then use 
this mailing list instead.

http://lists.w3.org/Archives/Public/public-html/


-- 
Alan Gresley
http://css-3d.org/
http://css-class.com/

Received on Thursday, 26 June 2014 11:32:57 UTC