Changeset 103608 in webkit
- Timestamp:
- Dec 22, 2011 11:29:32 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r103607 r103608 1 2011-12-22 Matt Falkenhagen <falken@chromium.org> 2 3 Map 'lang' and xml:lang attributes to '-webkit-locale' CSS property for use with font fallback and text-transform 4 https://bugs.webkit.org/show_bug.cgi?id=67586 5 6 Original patch by Jungshik Shin <jshin@chromium.org> 7 8 Reviewed by Darin Adler. 9 10 * fast/text/lang-mapped-to-webkit-locale-expected.txt: Added. 11 * fast/text/lang-mapped-to-webkit-locale.xhtml: Added. 12 * fast/text/xml-lang-ignored-in-html-expected.txt: Added. 13 * fast/text/xml-lang-ignored-in-html.html: Added. 14 1 15 2011-12-22 Ilya Tikhonovsky <loislo@chromium.org> 2 16 -
trunk/Source/WebCore/ChangeLog
r103605 r103608 1 2011-12-22 Matt Falkenhagen <falken@chromium.org> 2 3 Map 'lang' and xml:lang attributes to '-webkit-locale' CSS property for use with font fallback and text-transform 4 https://bugs.webkit.org/show_bug.cgi?id=67586 5 6 Original patch by Jungshik Shin <jshin@chromium.org> 7 8 Reviewed by Darin Adler. 9 10 Tests: fast/text/lang-mapped-to-webkit-locale.xhtml 11 fast/text/xml-lang-ignored-in-html.html 12 13 * html/HTMLElement.cpp: 14 (WebCore::HTMLElement::mapLanguageAttributeToLocale): 15 (WebCore::HTMLElement::parseMappedAttribute): Map 'lang' and 'xml:lang' to -webkit-locale. 16 * html/HTMLElement.h: 17 1 18 2011-12-22 Ryosuke Niwa <rniwa@webkit.org> 2 19 -
trunk/Source/WebCore/html/HTMLElement.cpp
r103373 r103608 27 27 28 28 #include "Attribute.h" 29 #include "CSSParser.h" 29 30 #include "CSSPropertyNames.h" 30 31 #include "CSSValueKeywords.h" … … 49 50 #include "Text.h" 50 51 #include "TextIterator.h" 52 #include "XMLNames.h" 51 53 #include "markup.h" 52 54 #include <wtf/StdLibExtras.h> … … 169 171 } 170 172 173 void HTMLElement::mapLanguageAttributeToLocale(Attribute* attribute) 174 { 175 ASSERT(attribute && (attribute->name() == langAttr || attribute->name().matches(XMLNames::langAttr))); 176 const AtomicString& value = attribute->value(); 177 if (!value.isEmpty()) { 178 // Have to quote so the locale id is treated as a string instead of as a CSS keyword. 179 addCSSProperty(attribute, CSSPropertyWebkitLocale, quoteCSSString(value)); 180 } else { 181 // The empty string means the language is explicitly unknown. 182 addCSSProperty(attribute, CSSPropertyWebkitLocale, CSSValueAuto); 183 } 184 setNeedsStyleRecalc(); 185 } 186 171 187 void HTMLElement::parseMappedAttribute(Attribute* attr) 172 188 { … … 193 209 setTabIndexExplicitly(max(static_cast<int>(std::numeric_limits<short>::min()), min(tabindex, static_cast<int>(std::numeric_limits<short>::max())))); 194 210 } 211 } else if (attr->name().matches(XMLNames::langAttr)) { 212 mapLanguageAttributeToLocale(attr); 195 213 } else if (attr->name() == langAttr) { 196 // FIXME: Implement 214 // xml:lang has a higher priority than lang. 215 if (!fastHasAttribute(XMLNames::langAttr)) 216 mapLanguageAttributeToLocale(attr); 197 217 } else if (attr->name() == dirAttr) { 198 218 bool dirIsAuto = equalIgnoringCase(attr->value(), "auto"); -
trunk/Source/WebCore/html/HTMLElement.h
r101144 r103608 108 108 virtual String nodeName() const; 109 109 110 void mapLanguageAttributeToLocale(Attribute*); 111 110 112 void setContentEditable(Attribute*); 111 113
Note: See TracChangeset
for help on using the changeset viewer.