Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-09-18 Thread L. David Baron
On Wednesday 2013-05-01 01:01 -0700, Elliott Sprehn wrote: On Wed, Apr 24, 2013 at 9:22 AM, Peter Occil pocci...@gmail.com wrote: I have no objection to the name baseLang rather than language as the name of the DOM attribute. But if there isn't more interest or you decide not to add this

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-09-18 Thread Anne van Kesteren
On Wed, Sep 18, 2013 at 11:10 AM, L. David Baron dba...@dbaron.org wrote: In Gecko it's also implemented through CSS inheritance, but it's not exposed to Web content as a CSS property. (Internally it's '-x-lang', but that name isn't exposed.) We use the language for: * font selection *

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-09-16 Thread Ian Hickson
On Fri, 2 Aug 2013, Jukka K. Korpela wrote: 2013-08-02 2:43, Ryosuke Niwa wrote: Are you saying that for HTML contenteditable-based editors that want to support drag-and-drop editing, they need to be able to annotate the outgoing HTML fragment with the effective language so that

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-09-16 Thread Ian Hickson
On Thu, 1 Aug 2013, Ryosuke Niwa wrote: Are you saying that for HTML contenteditable-based editors that want to support drag-and-drop editing, they need to be able to annotate the outgoing HTML fragment with the effective language so that when it's embedded somewhere, the right fonts

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-09-16 Thread Peter Occil
Apparently, the use cases I mentioned before have not been discussed yet: - Localization of form controls in languages where browser support is lacking, such as some minor languages. - Localization of HTML elements, especially date formatting of span and div elements in the page's default

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-09-16 Thread Ian Hickson
On Mon, 16 Sep 2013, Peter Occil wrote: - Localization of form controls in languages where browser support is lacking, such as some minor languages. - Localization of HTML elements, especially date formatting of span and div elements in the page's default language [...] You said these

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-08-12 Thread Ryosuke Niwa
On Aug 8, 2013, at 7:29 AM, Jukka K. Korpela jkorp...@cs.tut.fi wrote: 2013-08-08 2:57, Ryosuke Niwa wrote: On Aug 2, 2013, at 6:10 AM, Jukka K. Korpela jkorp...@cs.tut.fi wrote: [...] But regarding the effect of language markup on fonts, the effect is limited to situations where the

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-08-08 Thread Jukka K. Korpela
2013-08-08 2:57, Ryosuke Niwa wrote: On Aug 2, 2013, at 6:10 AM, Jukka K. Korpela jkorp...@cs.tut.fi wrote: [...] But regarding the effect of language markup on fonts, the effect is limited to situations where the font is not specified in a style sheet. This is a rather uncommon scenario

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-08-07 Thread Ryosuke Niwa
On Aug 2, 2013, at 6:10 AM, Jukka K. Korpela jkorp...@cs.tut.fi wrote: 2013-08-02 2:43, Ryosuke Niwa wrote: Are you saying that for HTML contenteditable-based editors that want to support drag-and-drop editing, they need to be able to annotate the outgoing HTML fragment with the effective

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-08-02 Thread Jukka K. Korpela
2013-08-02 2:43, Ryosuke Niwa wrote: Are you saying that for HTML contenteditable-based editors that want to support drag-and-drop editing, they need to be able to annotate the outgoing HTML fragment with the effective language so that when it's embedded somewhere, the right fonts get used?

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-07-24 Thread Ryosuke Niwa
On Jul 16, 2013, at 11:25 AM, Ian Hickson i...@hixie.ch wrote: On Tue, 16 Jul 2013, Takayoshi Kochi ($B2OFb(B $BN4?N(B) wrote: IIUC WebKit uses internally node's language to determine which font to use to render text, e.g for Han unification

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-07-16 Thread Ian Hickson
On Tue, 16 Jul 2013, Takayoshi Kochi (河内 隆仁) wrote: IIUC WebKit uses internally node's language to determine which font to use to render text, e.g for Han unification (https://en.wikipedia.org/wiki/Han_unification) WebKit has to choose a proper glyph depending on its lang attribute for the

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-07-15 Thread 河内 隆仁
IIUC WebKit uses internally node's language to determine which font to use to render text, e.g for Han unification (https://en.wikipedia.org/wiki/Han_unification) WebKit has to choose a proper glyph depending on its lang attribute for the same Unicode codepoint. Matt (falken@) knows more about

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-07-15 Thread Matt Falkenhagen
(resending from correct address) On Tue, Jul 16, 2013 at 10:18 AM, Takayoshi Kochi (河内 隆仁) ko...@google.com wrote: IIUC WebKit uses internally node's language to determine which font to use to render text, e.g for Han unification (https://en.wikipedia.org/wiki/Han_unification) WebKit has to

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-07-13 Thread Ian Hickson
On Fri, 12 Jul 2013, Peter Occil wrote: Well, my true hope is that such a DOM attribute like language will be specified in the HTML or DOM spec. Especially since it's not currently possible to get the language of a node through JavaScript methods alone. What's the use case for having this

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-07-13 Thread Peter Occil
There are several use cases: - Localization of form controls in languages where browser support is lacking, such as some minor languages. - Localization of HTML elements, especially date formatting of span and div elements in the page's default language, see especially [1]. When it comes to

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-07-12 Thread Ian Hickson
On Wed, 24 Apr 2013, Peter Occil wrote: Well in my case, I have written an HTML parser in Java and C# [1][2], which parses HTML documents and returns an object that implements a subset of the DOM, so far. As far as possible, I included only methods and attributes that were specified in

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-07-12 Thread Peter Occil
Well, my true hope is that such a DOM attribute like language will be specified in the HTML or DOM spec. Especially since it's not currently possible to get the language of a node through JavaScript methods alone. See [1] and its replies. --Peter [1]:

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-05-01 Thread Elliott Sprehn
On Wed, Apr 24, 2013 at 9:22 AM, Peter Occil pocci...@gmail.com wrote: I have no objection to the name baseLang rather than language as the name of the DOM attribute. But if there isn't more interest or you decide not to add this DOM attribute, I encourage you to at least: fwiw WebKit

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-05-01 Thread Elliott Sprehn
On Wed, May 1, 2013 at 1:49 AM, Robert O'Callahan rob...@ocallahan.orgwrote: On Wed, May 1, 2013 at 8:01 PM, Elliott Sprehn espr...@chromium.orgwrote: fwiw WebKit (and Blink) implement this through CSS inheritance since you need to know the lang for all kinds of things and walking up the DOM

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-05-01 Thread Anne van Kesteren
On Wed, May 1, 2013 at 9:01 AM, Elliott Sprehn espr...@chromium.org wrote: fwiw WebKit (and Blink) implement this through CSS inheritance since you need to know the lang for all kinds of things and walking up the DOM repeatedly would be expensive. -webkit-locale is inherited by default and

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-04-24 Thread Anne van Kesteren
On Wed, Apr 24, 2013 at 6:49 AM, Peter Occil pocci...@gmail.com wrote: While a language attribute on Node may also be useful to HTML+RDFa processors in JavaScript, I have no plans to implement such a processor in JavaScript, though. There's https://www.w3.org/Bugs/Public/show_bug.cgi?id=16489

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-04-24 Thread Peter Occil
I have no objection to the name baseLang rather than language as the name of the DOM attribute. But if there isn't more interest or you decide not to add this DOM attribute, I encourage you to at least: * define a DOM attribute to get the value of the document's Content-Language header

[whatwg] HTML: A DOM attribute that returns the language of a node

2013-04-23 Thread Peter Occil
I believe there should be a DOM attribute that returns the language of a node, as defined in section 3.2.3.3 The lang and xml:lang attributes. While there is a lang DOM attribute, it's inadequate because it's only affected by the element's lang content attribute. Also, I don't see a way to

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

2013-04-23 Thread Kang-Hao (Kenny) Lu
(13/04/23 16:44), Peter Occil wrote: I believe there should be a DOM attribute that returns the language of a node, as defined in section 3.2.3.3 The lang and xml:lang attributes. What's your use case? If you want to style a particular language then there's the CSS :lang() pseudo-class. Use