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

Side by Side Diff: Source/core/css/CSSPrimitiveValueMappings.h

Issue 17155007: [CSS3] Parsing the property, text-justify. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@parsingTextJustify
Patch Set: Patch for landing Created 7 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>. 2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>.
3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> 5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 2402 matching lines...) Expand 10 before | Expand all | Expand 10 after
2413 case CSSValueJustify: 2413 case CSSValueJustify:
2414 return TextAlignLastJustify; 2414 return TextAlignLastJustify;
2415 default: 2415 default:
2416 break; 2416 break;
2417 } 2417 }
2418 2418
2419 ASSERT_NOT_REACHED(); 2419 ASSERT_NOT_REACHED();
2420 return TextAlignLastAuto; 2420 return TextAlignLastAuto;
2421 } 2421 }
2422 2422
2423 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextJustify e)
2424 : CSSValue(PrimitiveClass)
2425 {
2426 m_primitiveUnitType = CSS_VALUE_ID;
2427 switch (e) {
2428 case TextJustifyAuto:
2429 m_value.valueID = CSSValueAuto;
2430 break;
2431 case TextJustifyNone:
2432 m_value.valueID = CSSValueNone;
2433 break;
2434 case TextJustifyInterWord:
2435 m_value.valueID = CSSValueInterWord;
2436 break;
2437 case TextJustifyDistribute:
2438 m_value.valueID = CSSValueDistribute;
2439 break;
2440 }
2441 }
2442
2443 template<> inline CSSPrimitiveValue::operator TextJustify() const
2444 {
2445 switch (m_value.valueID) {
2446 case CSSValueAuto:
2447 return TextJustifyAuto;
2448 case CSSValueNone:
2449 return TextJustifyNone;
2450 case CSSValueInterWord:
2451 return TextJustifyInterWord;
2452 case CSSValueDistribute:
2453 return TextJustifyDistribute;
2454 default:
2455 break;
2456 }
2457
2458 ASSERT_NOT_REACHED();
2459 return TextJustifyAuto;
2460 }
2461
2423 template<> inline CSSPrimitiveValue::operator TextDecoration() const 2462 template<> inline CSSPrimitiveValue::operator TextDecoration() const
2424 { 2463 {
2425 ASSERT(isValueID()); 2464 ASSERT(isValueID());
2426 switch (m_value.valueID) { 2465 switch (m_value.valueID) {
2427 case CSSValueNone: 2466 case CSSValueNone:
2428 return TextDecorationNone; 2467 return TextDecorationNone;
2429 case CSSValueUnderline: 2468 case CSSValueUnderline:
2430 return TextDecorationUnderline; 2469 return TextDecorationUnderline;
2431 case CSSValueOverline: 2470 case CSSValueOverline:
2432 return TextDecorationOverline; 2471 return TextDecorationOverline;
(...skipping 2445 matching lines...) Expand 10 before | Expand all | Expand 10 after
4878 break; 4917 break;
4879 } 4918 }
4880 4919
4881 ASSERT_NOT_REACHED(); 4920 ASSERT_NOT_REACHED();
4882 return IsolationAuto; 4921 return IsolationAuto;
4883 } 4922 }
4884 4923
4885 } 4924 }
4886 4925
4887 #endif 4926 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698