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

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: Created 7 years, 5 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 2336 matching lines...) Expand 10 before | Expand all | Expand 10 after
2347 case CSSValueJustify: 2347 case CSSValueJustify:
2348 return TextAlignLastJustify; 2348 return TextAlignLastJustify;
2349 default: 2349 default:
2350 break; 2350 break;
2351 } 2351 }
2352 2352
2353 ASSERT_NOT_REACHED(); 2353 ASSERT_NOT_REACHED();
2354 return TextAlignLastAuto; 2354 return TextAlignLastAuto;
2355 } 2355 }
2356 2356
2357 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextJustify e)
2358 : CSSValue(PrimitiveClass)
2359 {
2360 m_primitiveUnitType = CSS_VALUE_ID;
2361 switch (e) {
2362 case TextJustifyAuto:
2363 m_value.valueID = CSSValueAuto;
2364 break;
2365 case TextJustifyNone:
2366 m_value.valueID = CSSValueNone;
2367 break;
2368 case TextJustifyInterWord:
2369 m_value.valueID = CSSValueInterWord;
2370 break;
2371 case TextJustifyDistribute:
2372 m_value.valueID = CSSValueDistribute;
2373 break;
2374 }
2375 }
2376
2377 template<> inline CSSPrimitiveValue::operator TextJustify() const
2378 {
2379 switch (m_value.valueID) {
2380 case CSSValueAuto:
2381 return TextJustifyAuto;
2382 case CSSValueNone:
2383 return TextJustifyNone;
2384 case CSSValueInterWord:
2385 return TextJustifyInterWord;
2386 case CSSValueDistribute:
2387 return TextJustifyDistribute;
2388 default:
2389 break;
2390 }
2391
2392 ASSERT_NOT_REACHED();
2393 return TextJustifyAuto;
2394 }
2395
2357 template<> inline CSSPrimitiveValue::operator TextDecoration() const 2396 template<> inline CSSPrimitiveValue::operator TextDecoration() const
2358 { 2397 {
2359 switch (m_value.valueID) { 2398 switch (m_value.valueID) {
2360 case CSSValueNone: 2399 case CSSValueNone:
2361 return TextDecorationNone; 2400 return TextDecorationNone;
2362 case CSSValueUnderline: 2401 case CSSValueUnderline:
2363 return TextDecorationUnderline; 2402 return TextDecorationUnderline;
2364 case CSSValueOverline: 2403 case CSSValueOverline:
2365 return TextDecorationOverline; 2404 return TextDecorationOverline;
2366 case CSSValueLineThrough: 2405 case CSSValueLineThrough:
(...skipping 2312 matching lines...) Expand 10 before | Expand all | Expand 10 after
4679 break; 4718 break;
4680 } 4719 }
4681 4720
4682 ASSERT_NOT_REACHED(); 4721 ASSERT_NOT_REACHED();
4683 return TouchActionNone; 4722 return TouchActionNone;
4684 } 4723 }
4685 4724
4686 } 4725 }
4687 4726
4688 #endif 4727 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698