[whatwg] Spellchecking proposal #2

Anne van Kesteren fora at annevankesteren.nl
Sat Jun 24 05:36:03 PDT 2006


Quoting Matthew Raymond <mattraymond at earthlink.net>:
> mail at jorgenhorstink.nl wrote:
>>> On Sat, 24 Jun 2006 12:27:33 +0700, Lachlan Hunt
>>> <lachlan.hunt at lachy.id.au> wrote:
>>>>> Once again, a CSS/XBL based approach would be ere.
>>>>
>>>> I do not understand what you mean by a CSS/XBL approach in this
>>>> context.
>>>
>>> Moving the spellchecking control out of HTML into CSS or XBL binding.
>>
>> +1

So I'm not sure about using CSS or XBL, but I do see a need coming  
back where you can simple do:

   foo { spellcheck:on; content:html-snippet }

... or something like that and have it globally declared for _every_  
page that uses the property sheet instead of on every single element.

Of course, the question is when doing such a thing: "Where do you stop?"


>> I've read this discussion, but [I] do not understand exactly
>> why this should be denoted in markup.
>
>    One could argue that |spellcheck| is behavioral, in which case it
> should actually be in JavaScript and/or DOM. CSS is presentation only,
> and XBL is for binding to additional CSS, HTML and Javascript, not for
> providing semantics, behavior or presentation directly.

Following that argument you really need something like the above. You  
don't want to have to declare for every element _through scripting_  
whether or not spellcheck is on. Doing that you probably get all this  
`window.onload = foo;` workarounds with some function that sets all  
the relevant default properties. Except that doesn't work, as  
sometimes you start typing before the document has completely loaded  
(or the DOM is complete) etc.


>> [I] do not understand why it is needed anyway.
>> [Is] the lang attribute not sufficient?

The problem with doing that is that authors would set lang="" to a  
certain value not because the content is in that language, but because  
the UA decides spellchecking upon it. That's just wrong.



>    Personally, I find the idea of spell checking with |contenteditable|
> a bit scary. It strikes me as clashing with the styling of the page.
> You'd actually have a case for a :misspelled pseudo-class if this came
> into being.

Well, pseudo-element ;-)


>> [Why] not let the browser vendors determine what
>> suites their needs on this issue.
>
>    Actually, since interoperability isn't necessarily an issue here, you
> may be on to something. Perhaps we shouldn't bother to specify how to
> deal with spell checking beyond unavoidable interactions.

Care to elaborate? As in, what would be the impact on the proposal?


-- 
Anne van Kesteren
<http://annevankesteren.nl/>




More information about the whatwg mailing list