Archive for the ‘markup’ Category

Namespace syntax in HTML

Monday, October 9th, 2006
  1. We need namespaces in HTML.
  2. We need a syntax for declaring those namespaces in HTML.
  3. A very good, fitting syntax has already been invented for use in XML, and is understood by a significant number of authors.
  4. That syntax has been corrupted through misuse by many pages. Is it worth trying to save, or do we need a new one (or is one of the premises wrong)?

Do NOT attach “target” through script!

Friday, July 28th, 2006

Using target in (X)HTML Strict. If you need to use the target attribute, either stick with Transitional DOCTYPEs, or add the target attributes dynamically using semantic scripting, e.g. based on semantic class names.

(from http://tantek.com/log/2006/07.html#d27t1218)

NO NO NO NO NO! Your page is just as invalid if you add target in with script as if you put it in your markup.

If you absolutely must open a new window, make it a normal <a href=""> and use window.open() and cancel the default action for the link. But if you weren’t providing any size or chrome info (which are impossible with target anyway), then you don’t have any reason to be opening a window in the first place. Just don’t do it.

HTML is not an “Application Language”

Tuesday, June 13th, 2006

Part of the reason is of course that HTML was originally a document language and is slowly evolving in being both that and an application language.

I’ve said it before and I’ll say it again: It shouldn’t be. HTML is fundamentally a language for displaying information. Accepting input should not be a part of HTML because a) It’s out of scope, and b) it’s useful in places that HTML isn’t. Manipulating information is also out of scope (and thankfully has never been mushed in). An application requires bits from all three: Accepting, manipulating, and displaying (it also benefits from a fourth: styling).

Content-Type/namespace mismatch

Thursday, March 23rd, 2006

What happens if you serve an SVG document (SVG namespace, only SVG elements) as application/xhtml+xml? What should happen?

(“Happen” of course meaning semantically.)

I suggest calling it “WVG”

Monday, March 13th, 2006

Maybe once I’ve finished HTML5, I can work on a new SVG to go with it.

Oh please please please yes

I need to stop lurking

Tuesday, February 14th, 2006

I really must start posting on www-html more, instead of just reading. As far as I can tell, the HTML WG hasn’t released a good spec since HTML 4. (And that I only count “good” as it was an obvious improvement over HTML 3.2; everything since then has been stagnant or worse in terms of good design.

Also, I need to post to the WHATWG list more, too. While it’s making definite improvements with HTML 5, it still doesn’t separate documents from application UI. That makes it “relatively good” as HTML 4 was, and non-relatively probably the best spec of its type there ever has been, but still not good enough.

(This post prompted by something Anne said.)

Localized content vs. localized presentation of content

Sunday, February 5th, 2006

Which is better: localized content, or localized presentation of content?

For example, which is better:

  • Serving

    <span class='date'>February 2rd at 8:30 PM EST</span>

    to me, and equivelant things to other users, or

  • Serving

    <style>.date{binding:datelocalizer.xbl;}</style>
    <span class='date'>2006-02-03T01:30Z</span>

    to all users

Documents

Friday, February 3rd, 2006

What is the semantic difference between the following:

  • <html xmlns='http://www.w3.org/1999/xhtml'>
    <head>
      <title></title>
    </head>
    <body>
      <p>This is a paragraph.</p>
      <object>
        <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'>
          <circle cx='1' cy='1' r='1' fill='lime'/>
        </svg>
      </object>
    </body>
    </html>
  • <html xmlns='http://www.w3.org/1999/xhtml'>
    <head>
      <title></title>
    </head>
    <body>
      <p>This is a paragraph.</p>
      <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'>
        <circle cx='1' cy='1' r='1' fill='lime'/>
      </svg>
    </body>
    </html>
  • <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'>
      <foreignObject>
        <p xmlns='http://www.w3.org/1999/xhtml'>This is a paragraph.</p>
      </foreignObject>
      <circle cx='1' cy='1' r='1' fill='lime'/>
    </svg>
  • <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'>
        <p xmlns='http://www.w3.org/1999/xhtml'>This is a paragraph.</p>
      <circle cx='1' cy='1' r='1' fill='lime'/>
    </svg>

(Feel free to correct my SVG, but that’s not what the question is about.)

div

Wednesday, February 1st, 2006

div, in current markup languages, has two uses:

  • Page structure, for grouping and separating parts of the page (e.g. separating the document from the template)
  • Document structure, for grouping and separating parts of the document when there is no more specific element

The end.

Copy-pasted RDF

Thursday, November 24th, 2005

What percent of RDF on the web is copy-pasted?

Just curious.

(Markup) changes I would make

Monday, October 31st, 2005

This is a list of markup changes I would make to languages on the web, if I were all-powerful and able to push them through, and backwards compatibility weren’t an issue:

  • Specs would be written so their content models ignored elements from other namespaces. For example, when html 4 says <!ELEMENT UL - - (LI)+ -- unordered list -->, I can do <ul><foo:bar><li>blah</li></foo:bar></ul> and all is good and well and valid.
  • Forms would be a separate namespace from documents. See my previous post.
  • Navigation/branding/other template-type things would be their own namespace. See again my previous post.
  • ins and del would have their own namespace.
  • New namespaces would be easy to generate, and it would be easy to make machines (partially) understand them, without needing those machines to be updated at all. See my post on this topic.

More to come… this post was mostly inspired by the ins/del thing.

Reading back over the first item… is that really what I want? And just say if authors do something like <html:em><grammar:paragraph>text text</grammar:paragraph></html:em> it’s their problem? Or do I really just want some way to say “this element doesn’t affect content models”?

Document/Presentation/Application

Wednesday, October 12th, 2005

Blah, this is my third time writing my post, and I’m not really feeling writerly right now, so I’m just going to say what I need to quickly and get it over with.

Basically, the “Markup / Style / Behavior” split that everyone always talks about is wrong. The split really should be Document / Presentation / Application. Presentation is split into Styling—CSS—and for lack of a better word Branding—templates, a spec for which is yet to be developed. Application is split into UI—Forms—and (again for lack of a better word) Programming—client-side or server-side, or one as a fallback for the other.

Because of this I’m not really happy with any of the specs currently out there or currently being developed, with the one exception of CSS, which fits nicely into Presentation: Styling. I first started noticing this with WF2, which, although it’s one of the closest to being good, extremely bugged me by having the template attributes apply to all HTML elements, instead of just fieldsets like I said it should. I haven’t read the WA1 spec enough to comment well on it, but from passively reading the mailing list I get the vague impression that it fails to stay in one category in a bunch of ways. I haven’t read any of XFORMS, but from what I’ve heard of it it sounds like it has not only that problem but plenty of others.

Actually the first sentence of that last paragraph is wrong. XML is okay, since it doesn’t give any of the categories, it just standardizes markup. The Document, Style: Branding, and Application: UI categories will all be markup based, and having a standard markup is good. Javascript I’m only just becoming familiar with, but it seems like a good fit for Application: Programming (client-side). That’s not saying those don’t have other problems, just that as far as I can tell they’re not fundamentally flawed in the way I’m discussing.

Going to end this before I start rambling, since like I said I really don’t feel like writing, so much so that I’m not even going to proofread. So.

Reasoning for paragraph 2 left as an excersize for the reader. (Basically, this whole post is telling you what to think, you have to figure out why to think that.)

I’m currently getting more blog spam than email spam, so if you post a comment please also email dolphinling@delphiforums.com as it’s less likely to get lost that way.

Work

Saturday, September 10th, 2005

work n.

Anything that you do that you would prefer to have already done.

(“Have” being a verb, not “have already done” being the past perfect of “do”.)

P.S.: What’s the proper way to mark this entry up?

Sandboxing javascript for user comments

Sunday, July 10th, 2005

It would be nice to be able to sandbox user comments so that they could include more than just plain markup. For styles this is trivial: provide a [this-comment] selector, and cut out any selector that doesn’t start with it (would fail IFF a future version of css introduced a parent selector, but even then could be easily fixed). For scripts, I’d assume it’s quite a bit less trivial. It would be really nice for us web geeks, though.

I even wish I could offer a bounty on this. It would really be worth it, I think, if it were done correctly. Unfortunately I’m too young for most things financial—credit card, paypal, etc. Oh well. Hopefully someone will find it an interesting challenge.

Clean Source vs. Clean DOM

Thursday, June 30th, 2005

You know what bugs me? When people talk about keeping the source clean and then go and do something like this. (No offense to the author, as it was just the first example I found and because obviously a clean source is important.)

The point is, it’s not about the source, it’s about the DOM. When I point my obscure-yet-relevant-standards-conformant tool at your page—be it lynx (bad example, so make that lynx-made-perfect), a screenreader, or even just my Firefox-with-a-userContent.css-file—it should work. And to do that you need a clean DOM the whole way through: start with a clean DOM (clean source), and then when you do your styling and your scripting, keep it clean.

Getting rid of img alt=”

Tuesday, June 28th, 2005

Interesting. So Firefox (1.0) displays <img src='...'>text</img> when sent as application/xhtml+xml as just an image, as you would expect. There’s no yellow screen of death, because it’s valid XML, if not valid XHTML. Unfortunately it doesn’t work quite perfectly, because if the image is not available nothing is displayed. It would be interesting to see how Opera and Safari/KHTML render this.

The validator, though, is a different story. It gives these error messages:

  1. Line 1, column 280: required attribute "alt" not specified

    ...google.com/images/firefox/google.gif'>text</img></div></body></html>

  2. Line 1, column 281: end tag for "img" omitted, but OMITTAG NO was specified

    ...oogle.com/images/firefox/google.gif'>text</img></div></body></html>

  3. Line 1, column 222: start tag was here

    ...'text/css'></style></head><body><div><img src='http://www.google.com/images/f

  4. Line 1, column 290: end tag for element "img" which is not open

    .../images/firefox/google.gif'>text</img></div></body></html>

Wouldn’t a simple “This element cannot contain content” suffice for three out of the four?

Yay Fitt’s Law!

Wednesday, June 15th, 2005

Yay Fitt’s Law!

I don’t know why I didn’t do this before, but I just moved the new terminal window button (easily my most used little launcher thingy) into the very corner of the screen. It’s so much nicer to hit now, even if Gnome is stupid and doesn’t count clicks on the edge 1px (though it does on the bottom 1px). For some reason, I’m even finding the Applications menu (which was in the corner, and I rarely ever use) easier to hit, too (I’ve had to click it a few times to get the screenshot, launch gFTP, etc.).

Coolness.

Not accidentally filed in markup.

Making generic XML work

Tuesday, May 31st, 2005

So I just read Anne’s Why generic XML on the web is a bad idea, and got an idea. Suppose there were a way, probably using RDF or something, map certain elements in it to well-accepted elements in another namespace?

It would work as follows

  1. I have a document, which, for whatever reason, can’t be appropriately expressed in any well-accepted XML language (XHTML, MathML, ChemML, OpenDocument, whatever).
  2. I give this document appropriate semantics and create a namespace for those semantics, and a description of them at that namespace.
  3. Somewhere in the namespace’s URI I include a bit of information (again, probably using RDF or something else I don’t understand) that says, for example, <angry> is a subset of <xhtml:em> where xhtml is in the standard XHTML namespace.
  4. A search engine comes along and sees your document. While it can’t fully understand your document, and there may even be parts of it it can’t understand at all, it can still understand bits and pieces of it, and can do whatever it does appropriately.

Whadya think?

Need help on a markup problem

Tuesday, May 31st, 2005

On one of my pages there is an image. I need help deciding how it should be marked up—or rather, where it should be in the source. <img> isn’t valid in the body directly, so I have a few choices:

  • Contain it in the previous paragraph (how it is currently)
  • Leave it outside the paragraph, which is invalid, but more semantically correct (I think?)
  • Put a <div>, which would be valid and semantically correct but redundant (or would it be? does having the div there mean the existance of something that shouldn’t be there?)
  • Use <object> instead, which would be semantically correct and valid, but I’d have to look up the syntax for

So which should I chose?

Edit: Eep, forgot to close my <a> tag… actually, forgot to even give it content. Fixed now.

Why I love the web developer toolbar

Tuesday, May 31st, 2005

I absolutely love the Web Developer Toolbar. One reason, that I ran into today, is that if I need to find out if a particular piece of (x)html is valid I only need to type data:text/html,<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head><title></title></head><body><p>sometext</p><img src='http://www.google.com/intl/en/images/logo.gif'/><p>moretext</p></body></html> and with two clicks of the mouse I can send it to the w3c validator. (The validator doesn’t have a form upload, so otherwise I’d have to write it, save it, and go through the upload steps on the site.) And since I have said data: url template bookmarked, it’s a total of 3 clicks and writing a minimal testcase for what I want to know–much easier than reading through the specs.

Note that the w3c validator does have bugs, so this shouldn’t be used for anything complicated or esoteric. Just the basics.