Changeset 175925 in webkit
- Timestamp:
- Nov 11, 2014, 7:50:48 AM (12 years ago)
- Location:
- releases/WebKitGTK/webkit-2.6
- 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
-
releases/WebKitGTK/webkit-2.6/LayoutTests/ChangeLog
r175922 r175925 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-29 Zalan Bujtas <zalan@apple.com> 2 19 -
releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog
r175924 r175925 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 Zalan Bujtas <zalan@apple.com> 2 25 -
releases/WebKitGTK/webkit-2.6/Source/WebCore/css/CSSPrimitiveValue.cpp
r175924 r175925 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) -
releases/WebKitGTK/webkit-2.6/Source/WebCore/css/CSSPrimitiveValue.h
r173570 r175925 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. -
releases/WebKitGTK/webkit-2.6/Source/WebCore/css/DeprecatedStyleBuilder.cpp
r175901 r175925 1558 1558 wordSpacing = primitiveValue->computeLength<Length>(csstoLengthConversionDataWithTextZoomFactor(*styleResolver)); 1559 1559 } else if (primitiveValue->isPercentage()) 1560 wordSpacing = Length( primitiveValue->getDoubleValue(), Percent);1560 wordSpacing = Length(clampTo<float>(primitiveValue->getDoubleValue(), minValueForCssLength, maxValueForCssLength), Percent); 1561 1561 else if (primitiveValue->isNumber()) 1562 1562 wordSpacing = Length(primitiveValue->getDoubleValue(), Fixed);
Note:
See TracChangeset
for help on using the changeset viewer.