Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2015 Google Inc. All rights reserved. | 3 * Copyright (C) 2015 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1006 | 1006 |
| 1007 } | 1007 } |
| 1008 | 1008 |
| 1009 result.append(')'); | 1009 result.append(')'); |
| 1010 return result.toString(); | 1010 return result.toString(); |
| 1011 } | 1011 } |
| 1012 | 1012 |
| 1013 float CSSRadialGradientValue::resolveRadius(CSSPrimitiveValue* radius, const CSS ToLengthConversionData& conversionData, float* widthOrHeight) | 1013 float CSSRadialGradientValue::resolveRadius(CSSPrimitiveValue* radius, const CSS ToLengthConversionData& conversionData, float* widthOrHeight) |
| 1014 { | 1014 { |
| 1015 float result = 0; | 1015 float result = 0; |
| 1016 if (radius->isNumber()) // Can the radius be a percentage? | 1016 if (radius->isNumber()) // Can the radius be a percentage? |
|
dstockwell
2016/08/19 02:33:43
What's up with this comment?
sashab
2016/08/24 06:46:06
From https://chromium.googlesource.com/chromium/sr
| |
| 1017 result = radius->getFloatValue() * conversionData.zoom(); | 1017 result = radius->getFloatValue() * conversionData.zoom(); |
| 1018 else if (widthOrHeight && radius->isPercentage()) | 1018 else if (widthOrHeight && radius->isPercentage()) |
| 1019 result = *widthOrHeight * radius->getFloatValue() / 100; | 1019 result = *widthOrHeight * radius->getFloatValue() / 100; |
| 1020 else | 1020 else |
| 1021 result = radius->computeLength<float>(conversionData); | 1021 result = radius->computeLength<float>(conversionData); |
| 1022 | 1022 |
| 1023 return std::max(result, 0.0f); | 1023 return clampTo<float>(std::max(result, 0.0f)); |
| 1024 } | 1024 } |
| 1025 | 1025 |
| 1026 namespace { | 1026 namespace { |
| 1027 | 1027 |
| 1028 enum EndShapeType { | 1028 enum EndShapeType { |
| 1029 CircleEndShape, | 1029 CircleEndShape, |
| 1030 EllipseEndShape | 1030 EllipseEndShape |
| 1031 }; | 1031 }; |
| 1032 | 1032 |
| 1033 // Compute the radius to the closest/farthest side (depending on the compare fun ctor). | 1033 // Compute the radius to the closest/farthest side (depending on the compare fun ctor). |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1227 visitor->trace(m_firstRadius); | 1227 visitor->trace(m_firstRadius); |
| 1228 visitor->trace(m_secondRadius); | 1228 visitor->trace(m_secondRadius); |
| 1229 visitor->trace(m_shape); | 1229 visitor->trace(m_shape); |
| 1230 visitor->trace(m_sizingBehavior); | 1230 visitor->trace(m_sizingBehavior); |
| 1231 visitor->trace(m_endHorizontalSize); | 1231 visitor->trace(m_endHorizontalSize); |
| 1232 visitor->trace(m_endVerticalSize); | 1232 visitor->trace(m_endVerticalSize); |
| 1233 CSSGradientValue::traceAfterDispatch(visitor); | 1233 CSSGradientValue::traceAfterDispatch(visitor); |
| 1234 } | 1234 } |
| 1235 | 1235 |
| 1236 } // namespace blink | 1236 } // namespace blink |
| OLD | NEW |