Changeset 249090 in webkit
- Timestamp:
- Aug 24, 2019 2:42:42 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r249089 r249090 1 2019-08-24 Simon Fraser <simon.fraser@apple.com> 2 3 Page crashes under CGPathAddUnevenCornersRoundedRect 4 https://bugs.webkit.org/show_bug.cgi?id=201117 5 6 Reviewed by Dean Jackson. 7 8 * fast/borders/renderable-uneven-rounded-rects-expected.txt: Added. 9 * fast/borders/renderable-uneven-rounded-rects.html: Added. 10 1 11 2019-08-24 Devin Rousso <drousso@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r249088 r249090 1 2019-08-24 Simon Fraser <simon.fraser@apple.com> 2 3 Page crashes under CGPathAddUnevenCornersRoundedRect 4 https://bugs.webkit.org/show_bug.cgi?id=201117 5 6 Reviewed by Dean Jackson. 7 8 Fix crash on https://onehtmlpagechallenge.com/entries/pure-css-still-life-water-lemon.html 9 We were passing CG radius values where the sum of two radii was greater than the height or 10 width, caused by rounding when converting from floats to doubles. 11 12 Test: fast/borders/renderable-uneven-rounded-rects.html 13 14 * platform/graphics/cg/PathCG.cpp: 15 (WebCore::Path::platformAddPathForRoundedRect): 16 1 17 2019-08-23 Simon Fraser <simon.fraser@apple.com> 2 18 -
trunk/Source/WebCore/platform/graphics/cg/PathCG.cpp
r238501 r249090 308 308 CGFloat rectWidth = CGRectGetWidth(rectToDraw); 309 309 CGFloat rectHeight = CGRectGetHeight(rectToDraw); 310 if ( rectWidth < 2 * radiusWidth)310 if (2 * radiusWidth > rectWidth) 311 311 radiusWidth = rectWidth / 2 - std::numeric_limits<CGFloat>::epsilon(); 312 if ( rectHeight < 2 * radiusHeight)312 if (2 * radiusHeight > rectHeight) 313 313 radiusHeight = rectHeight / 2 - std::numeric_limits<CGFloat>::epsilon(); 314 314 CGPathAddRoundedRect(ensurePlatformPath(), nullptr, rectToDraw, radiusWidth, radiusHeight); … … 318 318 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000) 319 319 CGRect rectToDraw = rect; 320 321 enum Corners { 322 BottomLeft, 323 BottomRight, 324 TopRight, 325 TopLeft 326 }; 320 327 CGSize corners[4] = { bottomLeftRadius, bottomRightRadius, topRightRadius, topLeftRadius }; 328 329 CGFloat rectWidth = CGRectGetWidth(rectToDraw); 330 CGFloat rectHeight = CGRectGetHeight(rectToDraw); 331 332 // Clamp the radii after conversion to CGFloats. 333 corners[TopRight].width = std::min(corners[TopRight].width, rectWidth - corners[TopLeft].width); 334 corners[BottomRight].width = std::min(corners[BottomRight].width, rectWidth - corners[BottomLeft].width); 335 corners[BottomLeft].height = std::min(corners[BottomLeft].height, rectHeight - corners[TopLeft].height); 336 corners[BottomRight].height = std::min(corners[BottomRight].height, rectHeight - corners[TopRight].height); 337 321 338 CGPathAddUnevenCornersRoundedRect(ensurePlatformPath(), nullptr, rectToDraw, corners); 322 339 return;
Note: See TracChangeset
for help on using the changeset viewer.