- From: Tab Atkins Jr. <jackalmage@gmail.com>
- Date: Thu, 26 Jun 2014 09:28:18 -0700
- To: Juergen Roethig <roethig@dhbw-karlsruhe.de>
- Cc: www-svg <www-svg@w3.org>
On Thu, Jun 26, 2014 at 2:48 AM, Juergen Roethig <roethig@dhbw-karlsruhe.de> wrote: > 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)? The <svg> is not the root element. The HTML parser auto-inserts <html>, <head>, and <body> elements if they're omitted from your document, and places the <svg> in the <body> (as it's not an allowed-in-head element). > Well, I am not quite sure about those down-watered > grammar rules in HTML5, HTML's parsing is specified completely explicitly <http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html>. You're probably thinking of the old days HTML4 and earlier, when HTML was *supposedly* an SGML language but actually had all sorts of weird exceptions and quirks that weren't written down anywhere. That was fixed nearly 10 years ago. > but does HTML5 allow a DOCTYPE where the first > argument (the "html") does no longer give the name of the root tag? In HTML, the doctype is a legacy sigil, with no meaning <http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html#the-doctype>. Its only purpose is to distinguish between whether the document will be in "quirks mode" or "standards mode", which just has a few CSS-related effects. ~TJ
Received on Thursday, 26 June 2014 16:29:09 UTC