Hey guys
When the current (default) Java locale is Turkish, all HTML elements containing the letter "i" are not parsed correctly and the resulting objects are created are instances of the generic HTMLElementImpl class. For example, the <div> element is not an instance of HTMLDivElement, but an instance of HTMLElementImpl.
This is because of the famous Turkish issue, outlines in this blog
http://mattryall.net/blog/2009/02/the-infamous-turkish-locale-bug
The problem is in the ElementFactory.createElement() method, where the current element's name is converted to upper case using the default locale. In case the locale is Turkish, the element name is converted incorrectly, no matching building is found and the element is created as an instance of HTMLElementImpl.
String normalName = name.toUpperCase();
The fix is simple - use the String.toUpperCase(Locale.ENGLISH) and the tag name will be converted correctly.
String normalName = name.toUpperCase(Locale.ENGLISH);
There are a few more places in the code, where a similar problematic conversions are performed. They have to be fixed as well.
I can contribute a fix along with a test, if you'd accept it.
Attached is a simple test illustrates the problem.
Cheers
Mladen
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"