Bug 124368

Summary: [CSS Shapes] Add BoxShape and FloatRoundingRect classes
Product: WebKit Reporter: Hans Muller <giles_joplin>
Component: CSSAssignee: Hans Muller <giles_joplin>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, esprehn+autocc, glenn, gyuyoung.kim, kondapallykalyan, rakuco
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 124416    
Bug Blocks: 124173, 124605, 124606    
Attachments:
Description Flags
Path
none
Patch
none
Patch
none
Patch
none
Patch
dino: review+
Patch none

Description Hans Muller 2013-11-14 09:33:57 PST
Currently the internal FloatRoundedRect class (see RectangleShape.h) supports two corner radii, which was sufficient for earlier version of the CSS Shapes spec. The current spec (http://dev.w3.org/csswg/css-shapes/) requires elliptical corners, two radii per corner.
Comment 1 Hans Muller 2013-11-19 14:23:06 PST
A BoxShape class would represent margin-box, border-box, padding-box, and content-box values, see http://dev.w3.org/csswg/css-shapes/#typedef-box.  

A float analog of RoundedRect is needed to represent a BoxShape's shape-margin and shape-padding bounds. A FloatRoundedRect is a rounded rectangle with four elliptical corners, each with its own pair of radii.
Comment 2 Hans Muller 2013-11-19 15:24:58 PST
Created attachment 217342 [details]
Path

Added the BoxShape class. It's now used to represent shape-outside box values: [margin/border/padding/content]-box. BoxShape depends on a new FloatRoundedRect class, which is a float analog of the existing (int) RoundedRect class.
Comment 3 WebKit Commit Bot 2013-11-19 15:26:54 PST
Attachment 217342 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/CMakeLists.txt', u'Source/WebCore/ChangeLog', u'Source/WebCore/GNUmakefile.list.am', u'Source/WebCore/WebCore.vcxproj/WebCore.vcxproj', u'Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters', u'Source/WebCore/WebCore.xcodeproj/project.pbxproj', u'Source/WebCore/platform/graphics/FloatRoundedRect.cpp', u'Source/WebCore/platform/graphics/FloatRoundedRect.h', u'Source/WebCore/rendering/shapes/BoxShape.cpp', u'Source/WebCore/rendering/shapes/BoxShape.h', u'Source/WebCore/rendering/shapes/Shape.cpp']" exit_code: 1
Source/WebCore/platform/graphics/FloatRoundedRect.h:42:  Missing space inside { }.  [whitespace/braces] [5]
Total errors found: 1 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Hans Muller 2013-11-19 15:51:25 PST
Created attachment 217348 [details]
Patch

Fixed a styleO.
Comment 5 Hans Muller 2013-11-19 16:31:13 PST
Created attachment 217358 [details]
Patch

Resync'd.
Comment 6 Hans Muller 2013-11-19 16:52:13 PST
Created attachment 217360 [details]
Patch

Remove diff for the leading mystery characters in the header for /Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Comment 7 Hans Muller 2013-11-20 09:59:08 PST
Created attachment 217451 [details]
Patch

Updated the ChangeLog entry:

Added the BoxShape class. It's now used to represent shape-outside box values: [margin/border/padding/content]-box. BoxShape depends on a new FloatRoundedRect class, which is a float analog of the existing (int) RoundedRect class. The FloatRoundedRect class contains the same basic methods and accessors as BorderRect and adds a set of four methods, for example topLeftCorner(), that return a FloatRect that represents the bounds of one elliptical corner. I also added a method, xInterceptsAtY() that returns two X coordinates of the intersection between a horizontal line and the rounded rectangle.
Comment 8 Dean Jackson 2013-11-20 12:45:09 PST
Comment on attachment 217451 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=217451&action=review

> Source/WebCore/platform/graphics/FloatRoundedRect.cpp:4
> +/*
> + * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved.
> + * Copyright (C) 2010 Google Inc. All rights reserved.
> + * Copyright (C) 2013 Xidorn Quan (quanxunzhen@gmail.com)

This doesn't match the .h

> Source/WebCore/platform/graphics/FloatRoundedRect.cpp:106
> +    if (y < rect().y()  || y >=  rect().maxY())

Double space before ||

> Source/WebCore/platform/graphics/FloatRoundedRect.h:2
> +/*
> + * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.

2013
Comment 9 Hans Muller 2013-11-20 13:27:55 PST
Created attachment 217473 [details]
Patch

Made the requested changes.
Comment 10 WebKit Commit Bot 2013-11-20 14:19:32 PST
Comment on attachment 217473 [details]
Patch

Clearing flags on attachment: 217473

Committed r159583: <http://trac.webkit.org/changeset/159583>
Comment 11 WebKit Commit Bot 2013-11-20 14:19:34 PST
All reviewed patches have been landed.  Closing bug.