Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: trunk/Source/core/css/resolver/StyleBuilderCustom.cpp

Issue 195823006: Revert 169264 "Add plumbing for font-stretch" (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 break; 288 break;
289 case CSSValueLighter: 289 case CSSValueLighter:
290 state.fontBuilder().setWeight(state.parentStyle()->fontDescription().wei ght()); 290 state.fontBuilder().setWeight(state.parentStyle()->fontDescription().wei ght());
291 state.fontBuilder().setWeightLighter(); 291 state.fontBuilder().setWeightLighter();
292 break; 292 break;
293 default: 293 default:
294 state.fontBuilder().setWeight(*primitiveValue); 294 state.fontBuilder().setWeight(*primitiveValue);
295 } 295 }
296 } 296 }
297 297
298
299 void StyleBuilderFunctions::applyInitialCSSPropertyFontStretch(StyleResolverStat e& state)
300 {
301 state.fontBuilder().setStretch(FontStretchNormal);
302 }
303
304 void StyleBuilderFunctions::applyInheritCSSPropertyFontStretch(StyleResolverStat e& state)
305 {
306 state.fontBuilder().setStretch(state.parentFontDescription().stretch());
307 }
308
309 void StyleBuilderFunctions::applyValueCSSPropertyFontStretch(StyleResolverState& state, CSSValue* value)
310 {
311 if (!value->isPrimitiveValue())
312 return;
313 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
314 switch (primitiveValue->getValueID()) {
315 case CSSValueInvalid:
316 ASSERT_NOT_REACHED();
317 break;
318 case CSSValueUltraCondensed:
319 state.fontBuilder().setStretch(FontStretchUltraCondensed);
320 break;
321 case CSSValueExtraCondensed:
322 state.fontBuilder().setStretch(FontStretchExtraCondensed);
323 break;
324 case CSSValueCondensed:
325 state.fontBuilder().setStretch(FontStretchCondensed);
326 break;
327 case CSSValueSemiCondensed:
328 state.fontBuilder().setStretch(FontStretchSemiCondensed);
329 break;
330 case CSSValueNormal:
331 state.fontBuilder().setStretch(FontStretchNormal);
332 break;
333 case CSSValueSemiExpanded:
334 state.fontBuilder().setStretch(FontStretchSemiExpanded);
335 break;
336 case CSSValueExpanded:
337 state.fontBuilder().setStretch(FontStretchExpanded);
338 break;
339 case CSSValueExtraExpanded:
340 state.fontBuilder().setStretch(FontStretchExtraExpanded);
341 break;
342 case CSSValueUltraExpanded:
343 state.fontBuilder().setStretch(FontStretchUltraExpanded);
344 break;
345 default:
346 return;
347 }
348 }
349
350 void StyleBuilderFunctions::applyValueCSSPropertyLineHeight(StyleResolverState& state, CSSValue* value) 298 void StyleBuilderFunctions::applyValueCSSPropertyLineHeight(StyleResolverState& state, CSSValue* value)
351 { 299 {
352 if (!value->isPrimitiveValue()) 300 if (!value->isPrimitiveValue())
353 return; 301 return;
354 302
355 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 303 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
356 Length lineHeight; 304 Length lineHeight;
357 305
358 if (primitiveValue->getValueID() == CSSValueNormal) { 306 if (primitiveValue->getValueID() == CSSValueNormal) {
359 lineHeight = RenderStyle::initialLineHeight(); 307 lineHeight = RenderStyle::initialLineHeight();
(...skipping 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after
1555 case CSSPropertyWebkitLogicalHeight: 1503 case CSSPropertyWebkitLogicalHeight:
1556 case CSSPropertyWebkitMinLogicalWidth: 1504 case CSSPropertyWebkitMinLogicalWidth:
1557 case CSSPropertyWebkitMinLogicalHeight: 1505 case CSSPropertyWebkitMinLogicalHeight:
1558 case CSSPropertyWebkitMaxLogicalWidth: 1506 case CSSPropertyWebkitMaxLogicalWidth:
1559 case CSSPropertyWebkitMaxLogicalHeight: 1507 case CSSPropertyWebkitMaxLogicalHeight:
1560 { 1508 {
1561 CSSPropertyID newId = CSSProperty::resolveDirectionAwareProperty(id, sta te.style()->direction(), state.style()->writingMode()); 1509 CSSPropertyID newId = CSSProperty::resolveDirectionAwareProperty(id, sta te.style()->direction(), state.style()->writingMode());
1562 ASSERT(newId != id); 1510 ASSERT(newId != id);
1563 return applyProperty(newId, state, value); 1511 return applyProperty(newId, state, value);
1564 } 1512 }
1513 case CSSPropertyFontStretch:
1565 case CSSPropertyPage: 1514 case CSSPropertyPage:
1566 case CSSPropertyTextLineThroughColor: 1515 case CSSPropertyTextLineThroughColor:
1567 case CSSPropertyTextLineThroughMode: 1516 case CSSPropertyTextLineThroughMode:
1568 case CSSPropertyTextLineThroughStyle: 1517 case CSSPropertyTextLineThroughStyle:
1569 case CSSPropertyTextLineThroughWidth: 1518 case CSSPropertyTextLineThroughWidth:
1570 case CSSPropertyTextOverlineColor: 1519 case CSSPropertyTextOverlineColor:
1571 case CSSPropertyTextOverlineMode: 1520 case CSSPropertyTextOverlineMode:
1572 case CSSPropertyTextOverlineStyle: 1521 case CSSPropertyTextOverlineStyle:
1573 case CSSPropertyTextOverlineWidth: 1522 case CSSPropertyTextOverlineWidth:
1574 case CSSPropertyTextUnderlineColor: 1523 case CSSPropertyTextUnderlineColor:
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
1848 case CSSPropertyColor: 1797 case CSSPropertyColor:
1849 case CSSPropertyCounterIncrement: 1798 case CSSPropertyCounterIncrement:
1850 case CSSPropertyCounterReset: 1799 case CSSPropertyCounterReset:
1851 case CSSPropertyCursor: 1800 case CSSPropertyCursor:
1852 case CSSPropertyDirection: 1801 case CSSPropertyDirection:
1853 case CSSPropertyDisplay: 1802 case CSSPropertyDisplay:
1854 case CSSPropertyEmptyCells: 1803 case CSSPropertyEmptyCells:
1855 case CSSPropertyFloat: 1804 case CSSPropertyFloat:
1856 case CSSPropertyFontKerning: 1805 case CSSPropertyFontKerning:
1857 case CSSPropertyFontSize: 1806 case CSSPropertyFontSize:
1858 case CSSPropertyFontStretch:
1859 case CSSPropertyFontStyle: 1807 case CSSPropertyFontStyle:
1860 case CSSPropertyFontVariant: 1808 case CSSPropertyFontVariant:
1861 case CSSPropertyFontVariantLigatures: 1809 case CSSPropertyFontVariantLigatures:
1862 case CSSPropertyFontWeight: 1810 case CSSPropertyFontWeight:
1863 case CSSPropertyHeight: 1811 case CSSPropertyHeight:
1864 case CSSPropertyImageRendering: 1812 case CSSPropertyImageRendering:
1865 case CSSPropertyIsolation: 1813 case CSSPropertyIsolation:
1866 case CSSPropertyLeft: 1814 case CSSPropertyLeft:
1867 case CSSPropertyLetterSpacing: 1815 case CSSPropertyLetterSpacing:
1868 case CSSPropertyLineHeight: 1816 case CSSPropertyLineHeight:
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
2229 break; 2177 break;
2230 } 2178 }
2231 case CSSPropertyEnableBackground: 2179 case CSSPropertyEnableBackground:
2232 // Silently ignoring this property for now 2180 // Silently ignoring this property for now
2233 // http://bugs.webkit.org/show_bug.cgi?id=6022 2181 // http://bugs.webkit.org/show_bug.cgi?id=6022
2234 break; 2182 break;
2235 } 2183 }
2236 } 2184 }
2237 2185
2238 } // namespace WebCore 2186 } // namespace WebCore
OLDNEW
« no previous file with comments | « trunk/Source/core/css/resolver/FontBuilder.cpp ('k') | trunk/Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698