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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSBasicShapeValues.cpp

Issue 1603193002: Move two shape related properties into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: V5 Created 4 years, 11 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) 2011 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 side = toCSSPrimitiveValue(toCSSValuePair(*offset).first()).getValueID() ; 81 side = toCSSPrimitiveValue(toCSSValuePair(*offset).first()).getValueID() ;
82 amount = &toCSSPrimitiveValue(toCSSValuePair(*offset).second()); 82 amount = &toCSSPrimitiveValue(toCSSValuePair(*offset).second());
83 } else { 83 } else {
84 amount = toCSSPrimitiveValue(offset.get()); 84 amount = toCSSPrimitiveValue(offset.get());
85 } 85 }
86 86
87 if (side == CSSValueCenter) { 87 if (side == CSSValueCenter) {
88 side = defaultSide; 88 side = defaultSide;
89 amount = cssValuePool().createValue(50, CSSPrimitiveValue::UnitType::Per centage); 89 amount = cssValuePool().createValue(50, CSSPrimitiveValue::UnitType::Per centage);
90 } else if ((side == CSSValueRight || side == CSSValueBottom) 90 } else if ((side == CSSValueRight || side == CSSValueBottom)
91 && amount->isPercentage()) { 91 && amount && amount->isPercentage()) {
Timothy Loh 2016/01/27 00:44:03 What changed to make us need this?
rwlbuis 2016/01/27 20:02:39 parseFillPosition has a special ResolveValuesAsPer
92 side = defaultSide; 92 side = defaultSide;
93 amount = cssValuePool().createValue(100 - amount->getFloatValue(), CSSPr imitiveValue::UnitType::Percentage); 93 amount = cssValuePool().createValue(100 - amount->getFloatValue(), CSSPr imitiveValue::UnitType::Percentage);
94 } else if (amount->isLength() && !amount->getFloatValue()) { 94 } else if (!amount || (amount->isLength() && !amount->getFloatValue())) {
95 if (side == CSSValueRight || side == CSSValueBottom) 95 if (side == CSSValueRight || side == CSSValueBottom)
96 amount = cssValuePool().createValue(100, CSSPrimitiveValue::UnitType ::Percentage); 96 amount = cssValuePool().createValue(100, CSSPrimitiveValue::UnitType ::Percentage);
97 else 97 else
98 amount = cssValuePool().createValue(0, CSSPrimitiveValue::UnitType:: Percentage); 98 amount = cssValuePool().createValue(0, CSSPrimitiveValue::UnitType:: Percentage);
99 side = defaultSide; 99 side = defaultSide;
100 } 100 }
101 101
102 return CSSValuePair::create(cssValuePool().createIdentifierValue(side), amou nt.release(), CSSValuePair::KeepIdenticalValues); 102 return CSSValuePair::create(cssValuePool().createIdentifierValue(side), amou nt.release(), CSSValuePair::KeepIdenticalValues);
103 } 103 }
104 104
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 visitor->trace(m_left); 398 visitor->trace(m_left);
399 visitor->trace(m_topLeftRadius); 399 visitor->trace(m_topLeftRadius);
400 visitor->trace(m_topRightRadius); 400 visitor->trace(m_topRightRadius);
401 visitor->trace(m_bottomRightRadius); 401 visitor->trace(m_bottomRightRadius);
402 visitor->trace(m_bottomLeftRadius); 402 visitor->trace(m_bottomLeftRadius);
403 CSSValue::traceAfterDispatch(visitor); 403 CSSValue::traceAfterDispatch(visitor);
404 } 404 }
405 405
406 } // namespace blink 406 } // namespace blink
407 407
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698