Changeset 276205 in webkit
- Timestamp:
- Apr 17, 2021, 1:16:22 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
css/CSSPrimitiveValue.cpp (modified) (1 diff)
-
style/StyleBuilderConverter.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r276204 r276205 1 2021-04-17 Basuke Suzuki <basuke.suzuki@sony.com> 2 3 [clang 11] Remove warning when converting WebCore::maxValueForCssLength from int to float 4 https://bugs.webkit.org/show_bug.cgi?id=224714 5 6 Reviewed by Chris Dumez. 7 8 On clang 11, the conversion from const int WebCore::maxValueForCssLength (= 33554429) to 9 float generates conversion warning: 10 > warning: implicit conversion from 'const int' to 'float' changes value from 33554429 to 33554428 11 12 Changing the target type from float to double works for this. Length constructor accept double 13 so that there's no drawback with this change. 14 15 No test because it's compiler behavior. 16 17 * style/StyleBuilderConverter.h: 18 (WebCore::Style::BuilderConverter::convertWordSpacing): 19 1 20 2021-04-17 Sam Weinig <weinig@apple.com> 2 21 -
trunk/Source/WebCore/css/CSSPrimitiveValue.cpp
r276002 r276205 543 543 template<> Length CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData) const 544 544 { 545 return Length(clampTo< float>(computeLengthDouble(conversionData), minValueForCssLength, maxValueForCssLength), LengthType::Fixed);545 return Length(clampTo<double>(computeLengthDouble(conversionData), minValueForCssLength, maxValueForCssLength), LengthType::Fixed); 546 546 } 547 547 -
trunk/Source/WebCore/style/StyleBuilderConverter.h
r275273 r276205 1213 1213 wordSpacing = primitiveValue.computeLength<Length>(csstoLengthConversionDataWithTextZoomFactor(builderState)); 1214 1214 else if (primitiveValue.isPercentage()) 1215 wordSpacing = Length(clampTo< float>(primitiveValue.doubleValue(), minValueForCssLength, maxValueForCssLength), LengthType::Percent);1215 wordSpacing = Length(clampTo<double>(primitiveValue.doubleValue(), minValueForCssLength, maxValueForCssLength), LengthType::Percent); 1216 1216 else if (primitiveValue.isNumber()) 1217 1217 wordSpacing = Length(primitiveValue.doubleValue(), LengthType::Fixed);
Note:
See TracChangeset
for help on using the changeset viewer.