Changeset 175197 in webkit
- Timestamp:
- Oct 24, 2014, 7:37:41 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/css3/infinite-word-spacing-expected.txt (added)
-
LayoutTests/css3/infinite-word-spacing.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/CSSPrimitiveValue.cpp (modified) (2 diffs)
-
Source/WebCore/css/CSSPrimitiveValue.h (modified) (2 diffs)
-
Source/WebCore/css/DeprecatedStyleBuilder.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r175194 r175197 1 2014-10-24 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 Clamp wordSpacing percentage value. 4 https://bugs.webkit.org/show_bug.cgi?id=129350. 5 6 Reviewed by Zalan Bujtas. 7 8 Make sure that setting the CSS style wordSpacing property to very huge percentage 9 value and blending this value with other values for animating key frames does 10 not assert or crash. The expectation is to have this huge value to be clamped to 11 the pre-defined min/max values for the CSS length type. So when blending the clamped 12 value with other wordSpacing values, the result can't be NaN. This should be very 13 similar to the case when it is set to a huge <length> value. 14 15 * css3/infinite-word-spacing-expected.txt: Added. 16 * css3/infinite-word-spacing.html: Added. 17 1 18 2014-10-24 Alexey Proskuryakov <ap@apple.com> 2 19 -
trunk/Source/WebCore/ChangeLog
r175186 r175197 1 2014-10-24 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 Clamp wordSpacing percentage value. 4 https://bugs.webkit.org/show_bug.cgi?id=129350. 5 6 Reviewed by Zalan Bujtas. 7 8 When the CSS wordSpacing property is percentage, its value has to be within the 9 pre-defined min/max values for the CSS length type. This is done the same way 10 the wordSpacing of type <length> is handled. 11 12 Tests: css3/infinite-word-spacing.html. 13 14 Move the definitions of minValueForCssLength and maxValueForCssLength from the 15 .cpp file to the .h file. 16 * css/CSSPrimitiveValue.cpp: 17 * css/CSSPrimitiveValue.h: 18 19 Clamp the wordSpacing value to minValueForCssLength and maxValueForCssLength when 20 its type is percentage. 21 * css/DeprecatedStyleBuilder.cpp: 22 (WebCore::ApplyPropertyWordSpacing::applyValue): 23 1 24 2014-10-24 Chris Dumez <cdumez@apple.com> 2 25 -
trunk/Source/WebCore/css/CSSPrimitiveValue.cpp
r175177 r175197 34 34 #include "ExceptionCode.h" 35 35 #include "Font.h" 36 #include "LayoutUnit.h"37 36 #include "Node.h" 38 37 #include "Pair.h" … … 59 58 60 59 namespace WebCore { 61 62 // Max/min values for CSS, needs to slightly smaller/larger than the true max/min values to allow for rounding without overflowing.63 // Subtract two (rather than one) to allow for values to be converted to float and back without exceeding the LayoutUnit::max.64 const int maxValueForCssLength = intMaxForLayoutUnit - 2;65 const int minValueForCssLength = intMinForLayoutUnit + 2;66 60 67 61 static inline bool isValidCSSUnitTypeForDoubleConversion(CSSPrimitiveValue::UnitTypes unitType) -
trunk/Source/WebCore/css/CSSPrimitiveValue.h
r174300 r175197 27 27 #include "CSSValueKeywords.h" 28 28 #include "Color.h" 29 #include "LayoutUnit.h" 29 30 #include <wtf/Forward.h> 30 31 #include <wtf/MathExtras.h> … … 50 51 struct Length; 51 52 struct LengthSize; 53 54 // Max/min values for CSS, needs to slightly smaller/larger than the true max/min values to allow for rounding without overflowing. 55 // Subtract two (rather than one) to allow for values to be converted to float and back without exceeding the LayoutUnit::max. 56 const int maxValueForCssLength = intMaxForLayoutUnit - 2; 57 const int minValueForCssLength = intMinForLayoutUnit + 2; 52 58 53 59 // Dimension calculations are imprecise, often resulting in values of e.g. -
trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp
r175169 r175197 1497 1497 wordSpacing = primitiveValue.computeLength<Length>(csstoLengthConversionDataWithTextZoomFactor(*styleResolver)); 1498 1498 } else if (primitiveValue.isPercentage()) 1499 wordSpacing = Length( primitiveValue.getDoubleValue(), Percent);1499 wordSpacing = Length(clampTo<float>(primitiveValue.getDoubleValue(), minValueForCssLength, maxValueForCssLength), Percent); 1500 1500 else if (primitiveValue.isNumber()) 1501 1501 wordSpacing = Length(primitiveValue.getDoubleValue(), Fixed);
Note:
See TracChangeset
for help on using the changeset viewer.