Changeset 214433 in webkit
- Timestamp:
- Mar 27, 2017 3:09:14 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r214429 r214433 1 2017-03-27 Myles C. Maxfield <mmaxfield@apple.com> 2 3 Test variation font ranges in the CSS Font Loading API 4 https://bugs.webkit.org/show_bug.cgi?id=170022 5 6 Reviewed by Dean Jackson. 7 8 * fast/text/variations/font-loading-api-parse-ranges-expected.txt: Added. 9 * fast/text/variations/font-loading-api-parse-ranges.html: Added. 10 1 11 2017-03-27 Ryan Haddad <ryanhaddad@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r214430 r214433 1 2017-03-27 Myles C. Maxfield <mmaxfield@apple.com> 2 3 Test variation font ranges in the CSS Font Loading API 4 https://bugs.webkit.org/show_bug.cgi?id=170022 5 6 Reviewed by Dean Jackson. 7 8 Test: fast/text/variations/font-loading-api-parse-ranges.html 9 10 Don't use keywords when reporting font variation range values. 11 12 * css/CSSComputedStyleDeclaration.cpp: 13 (WebCore::ComputedStyleExtractor::fontNonKeywordWeightFromStyleValue): 14 (WebCore::ComputedStyleExtractor::fontWeightFromStyleValue): 15 (WebCore::ComputedStyleExtractor::fontNonKeywordStretchFromStyleValue): 16 (WebCore::ComputedStyleExtractor::fontStretchFromStyleValue): 17 (WebCore::ComputedStyleExtractor::fontNonKeywordStyleFromStyleValue): 18 (WebCore::ComputedStyleExtractor::fontStyleFromStyleValue): 19 * css/CSSComputedStyleDeclaration.h: 20 * css/FontFace.cpp: 21 (WebCore::FontFace::style): 22 (WebCore::FontFace::weight): 23 (WebCore::FontFace::stretch): 24 1 25 2017-03-27 Anders Carlsson <andersca@apple.com> 2 26 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r214419 r214433 1918 1918 } 1919 1919 1920 Ref<CSSPrimitiveValue> ComputedStyleExtractor::fontNonKeywordWeightFromStyleValue(FontSelectionValue weight) 1921 { 1922 return CSSValuePool::singleton().createValue(static_cast<float>(weight), CSSPrimitiveValue::CSS_NUMBER); 1923 } 1924 1920 1925 Ref<CSSPrimitiveValue> ComputedStyleExtractor::fontWeightFromStyleValue(FontSelectionValue weight) 1921 1926 { 1922 1927 if (auto value = fontWeightKeyword(weight)) 1923 1928 return CSSValuePool::singleton().createIdentifierValue(value.value()); 1924 return CSSValuePool::singleton().createValue(static_cast<float>(weight), CSSPrimitiveValue::CSS_NUMBER);1929 return fontNonKeywordWeightFromStyleValue(weight); 1925 1930 } 1926 1931 … … 1928 1933 { 1929 1934 return ComputedStyleExtractor::fontWeightFromStyleValue(style.fontDescription().weight()); 1935 } 1936 1937 Ref<CSSPrimitiveValue> ComputedStyleExtractor::fontNonKeywordStretchFromStyleValue(FontSelectionValue stretch) 1938 { 1939 return CSSValuePool::singleton().createValue(static_cast<float>(stretch), CSSPrimitiveValue::CSS_PERCENTAGE); 1930 1940 } 1931 1941 … … 1934 1944 if (auto keyword = fontStretchKeyword(stretch)) 1935 1945 return CSSValuePool::singleton().createIdentifierValue(keyword.value()); 1936 return CSSValuePool::singleton().createValue(static_cast<float>(stretch), CSSPrimitiveValue::CSS_PERCENTAGE);1946 return fontNonKeywordStretchFromStyleValue(stretch); 1937 1947 } 1938 1948 … … 1940 1950 { 1941 1951 return ComputedStyleExtractor::fontStretchFromStyleValue(style.fontDescription().stretch()); 1952 } 1953 1954 Ref<CSSFontStyleValue> ComputedStyleExtractor::fontNonKeywordStyleFromStyleValue(FontSelectionValue italic) 1955 { 1956 return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueOblique), CSSValuePool::singleton().createValue(static_cast<float>(italic), CSSPrimitiveValue::CSS_DEG)); 1942 1957 } 1943 1958 … … 1946 1961 if (auto keyword = fontStyleKeyword(italic)) 1947 1962 return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(keyword.value())); 1948 return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueOblique), CSSValuePool::singleton().createValue(static_cast<float>(italic), CSSPrimitiveValue::CSS_DEG));1963 return fontNonKeywordStyleFromStyleValue(italic); 1949 1964 } 1950 1965 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h
r214419 r214433 67 67 static Ref<CSSValue> valueForFilter(const RenderStyle&, const FilterOperations&, AdjustPixelValuesForComputedStyle = AdjustPixelValues); 68 68 69 static Ref<CSSPrimitiveValue> fontNonKeywordWeightFromStyleValue(FontSelectionValue); 69 70 static Ref<CSSPrimitiveValue> fontWeightFromStyleValue(FontSelectionValue); 71 static Ref<CSSPrimitiveValue> fontNonKeywordStretchFromStyleValue(FontSelectionValue); 70 72 static Ref<CSSPrimitiveValue> fontStretchFromStyleValue(FontSelectionValue); 73 static Ref<CSSFontStyleValue> fontNonKeywordStyleFromStyleValue(FontSelectionValue); 71 74 static Ref<CSSFontStyleValue> fontStyleFromStyleValue(FontSelectionValue); 72 75 -
trunk/Source/WebCore/css/FontFace.cpp
r214419 r214433 295 295 return minimum->cssText(); 296 296 297 ASSERT(minimum->fontStyleValue->valueID() == CSSValueOblique); 298 ASSERT(maximum->fontStyleValue->valueID() == CSSValueOblique); 297 auto minimumNonKeyword = ComputedStyleExtractor::fontNonKeywordStyleFromStyleValue(style.minimum); 298 auto maximumNonKeyword = ComputedStyleExtractor::fontNonKeywordStyleFromStyleValue(style.maximum); 299 300 ASSERT(minimumNonKeyword->fontStyleValue->valueID() == CSSValueOblique); 301 ASSERT(maximumNonKeyword->fontStyleValue->valueID() == CSSValueOblique); 299 302 300 303 StringBuilder builder; 301 builder.append(minimum ->fontStyleValue->cssText());304 builder.append(minimumNonKeyword->fontStyleValue->cssText()); 302 305 builder.append(' '); 303 306 if (minimum->obliqueValue.get() == maximum->obliqueValue.get()) 304 builder.append(minimum ->obliqueValue->cssText());307 builder.append(minimumNonKeyword->obliqueValue->cssText()); 305 308 else { 306 builder.append(minimum->obliqueValue->cssText()); 307 builder.append(maximum->obliqueValue->cssText()); 309 builder.append(minimumNonKeyword->obliqueValue->cssText()); 310 builder.append(' '); 311 builder.append(maximumNonKeyword->obliqueValue->cssText()); 308 312 } 309 313 return builder.toString(); … … 321 325 return minimum->cssText(); 322 326 327 auto minimumNonKeyword = ComputedStyleExtractor::fontNonKeywordWeightFromStyleValue(weight.minimum); 328 auto maximumNonKeyword = ComputedStyleExtractor::fontNonKeywordWeightFromStyleValue(weight.maximum); 329 323 330 StringBuilder builder; 324 builder.append(minimum ->cssText());331 builder.append(minimumNonKeyword->cssText()); 325 332 builder.append(' '); 326 builder.append(maximum ->cssText());333 builder.append(maximumNonKeyword->cssText()); 327 334 return builder.toString(); 328 335 } … … 339 346 return minimum->cssText(); 340 347 348 auto minimumNonKeyword = ComputedStyleExtractor::fontNonKeywordStretchFromStyleValue(stretch.minimum); 349 auto maximumNonKeyword = ComputedStyleExtractor::fontNonKeywordStretchFromStyleValue(stretch.maximum); 350 341 351 StringBuilder builder; 342 builder.append(minimum ->cssText());352 builder.append(minimumNonKeyword->cssText()); 343 353 builder.append(' '); 344 builder.append(maximum ->cssText());354 builder.append(maximumNonKeyword->cssText()); 345 355 return builder.toString(); 346 356 }
Note: See TracChangeset
for help on using the changeset viewer.