[Webkit-unassigned] [Bug 44803] Decompose computing an element's computed language

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 1 04:33:30 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=44803





--- Comment #11 from Ilya Sherman <isherman at chromium.org>  2010-09-01 04:33:30 PST ---
(In reply to comment #9)
> Updated API style per Darin's suggestions
> 
> 
> (In reply to comment #7)
> > > for the API at least, i recommend spelling out Language.
> > 
> > I think that it should be spelled out in internal function names, too.
> 
> I'm fuzzy on the style expectations for WebKit -- if it is labelled as "lang" elsewhere in the codebase, is it more important to be consistent with that or to gradually transition toward the spelled out version?  All of the instances I have seen elsewhere in the codebase label it just as "lang", though this might just be a biased sample on my part.
> 

Per conversation on IRC, "language" makes sense here but not elsewhere because we are not referring to the tag name or to the CSS property.  Patch updated correspondingly.

> > I'm not sure how much benefit an API function provides over querying an element style.
> 
> AFAICT, there is no way to query an element's style to ask for its language -- only to query whether the language is some predetermined string.  For chromium i18n, we need some API -- though not necessarily this one -- to directly query an element's language.  It also makes some sense for this API to be exported via the DOM rather than CSS, as language codes are part of the HTML specification :)

Alexey suggested that the value of the "lang" attribute can be accessed by JS via "document.defaultView.getComputedStyle(document.body, null).getPropertyValue("lang")"; and so we should be able to do something similar.  However, when I investigated this I found that |getComputedStyle| in JS does not include the "lang" attribute.  That seems like a bug which we should fix.

My sense is that this patch is a good first step in that direction, but perhaps the function should live elsewhere.  Thoughts?  Suggestions?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list