Hi all,
I'm curious if there are any plans to add support for the HTML 4.0
"lang" attribute to WebCore in the near future.
According to:
http://www.w3.org/TR/REC-html40/struct/dirlang.html
the 'lang' attribute of any element is supposed to act as a rendering
hint to help the user agent choose the correct glyphs for the local
language.
For example, Chinese, Korean, and Japanese glyphs have unified values
in Unicode ("Han unification") but often need to use different fonts
for the same code points to display acceptably to the user.
The HTML 'lang' attribute serves as a way to let the author of an HTML
page change which set of glyphs are used in particular sections of
their document, so a single document can display (for example) both
Chinese and Japanese characters acceptably.
WebCore doesn't seem to do anything with the 'lang' attribute
currently (although a casual glance through the khtml/ directory of
the WebCore-125 source shows it can be retrieved programatically).
Instead, it seems to use the locale of the user to globally choose
the glyphs to use throughout all documents (which is the best
behavior if 'lang' is not supported, of course).
A good test of this attribute is available in the Wikipedia article on
Han unification, which uses the 'lang' attribute to hint to the user
agent to switch glyphs to the Chinese, Korean, and Japanese versions
as needed. (The example is at the bottom of this page.)
http://en.wikipedia.org/wiki/Han_unification
Mozilla Firefox 1.0RC (and, I believe, IE 6.0) both support the 'lang'
attribute on the Wikipedia link above and radically change the
display of the characters, but Safari displays them all with the
glyph set closest to the International locale preference of the user.
1) Firefox 1.0RC on OS X 10.3.5:
http://www.foxden.org/~ben/han/firefox.png
2) Safari 1.2.3 on OS X 10.3.5, English selected as locale (seems to
be using Japanese glyphs):
http://www.foxden.org/~ben/han/safari_en.png
3) Safari 1.2.3 on OS X 10.3.5, Simplified Chinese selected as locale
(uses simplified Chinese glyphs):
http://www.foxden.org/~ben/han/safari_zh_CN.png
If this work is upcoming, great! If not, can I help?
Ben
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webcore-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webcore-dev/email@hidden
This email sent to email@hidden