Bug 164622 - [SVG] Start moving special casing of SVG out of the bindings - SVGPreserveAspectRatio
Summary: [SVG] Start moving special casing of SVG out of the bindings - SVGPreserveAsp...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords:
Depends on:
Blocks: 164704
  Show dependency treegraph
 
Reported: 2016-11-10 15:34 PST by Sam Weinig
Modified: 2016-11-13 18:49 PST (History)
1 user (show)

See Also:


Attachments
Patch (86.53 KB, patch)
2016-11-10 16:01 PST, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch (87.12 KB, patch)
2016-11-10 20:02 PST, Sam Weinig
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2016-11-10 15:34:05 PST
[SVG] Start moving special casing of SVG out of the bindings - SVGPreserveAspectRatio
Comment 1 Sam Weinig 2016-11-10 16:01:58 PST
Created attachment 294431 [details]
Patch
Comment 2 WebKit Commit Bot 2016-11-10 16:03:55 PST
Attachment 294431 [details] did not pass style-queue:


ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.cpp:119:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:35:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:36:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:37:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:38:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:39:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:40:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:41:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:42:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:43:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:44:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:45:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:49:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:50:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:51:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
Total errors found: 15 in 25 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Sam Weinig 2016-11-10 20:02:53 PST
Created attachment 294464 [details]
Patch
Comment 4 WebKit Commit Bot 2016-11-10 20:04:48 PST
Attachment 294464 [details] did not pass style-queue:


ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.cpp:119:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:35:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:36:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:37:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:38:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:39:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:40:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:41:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:42:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:43:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:44:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:45:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:49:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:50:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/svg/SVGPreserveAspectRatioValue.h:51:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
Total errors found: 15 in 26 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Darin Adler 2016-11-10 21:05:37 PST
Comment on attachment 294464 [details]
Patch

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

Some comments on moved code.

> Source/WebCore/svg/SVGPreserveAspectRatioValue.cpp:188
> +    case SVGPreserveAspectRatio::SVG_MEETORSLICE_UNKNOWN:

No need to repeat the class name here since this is inside a member function of that class. Same for all the other cases below.

> Source/WebCore/svg/SVGPreserveAspectRatioValue.cpp:273
> +AffineTransform SVGPreserveAspectRatio::getCTM(float logicalX, float logicalY, float logicalWidth, float logicalHeight, float physicalWidth, float physicalHeight) const

Strange that this passes all the arguments as separate floats rather than FloatSize and FloatRect.

> Source/WebCore/svg/SVGPreserveAspectRatioValue.cpp:291
> +    double extendedLogicalX = logicalX;
> +    double extendedLogicalY = logicalY;
> +    double extendedLogicalWidth = logicalWidth;
> +    double extendedLogicalHeight = logicalHeight;
> +    double extendedPhysicalWidth = physicalWidth;
> +    double extendedPhysicalHeight = physicalHeight;
> +    double logicalRatio = extendedLogicalWidth / extendedLogicalHeight;
> +    double physicalRatio = extendedPhysicalWidth / extendedPhysicalHeight;

A bit peculiar to mix float and double like this.

> Source/WebCore/svg/SVGPreserveAspectRatioValue.cpp:330
> +        alignType = "none";

ASCIILiteral?
Comment 6 WebKit Commit Bot 2016-11-10 22:32:50 PST
Comment on attachment 294464 [details]
Patch

Clearing flags on attachment: 294464

Committed r208581: <http://trac.webkit.org/changeset/208581>
Comment 7 WebKit Commit Bot 2016-11-10 22:32:55 PST
All reviewed patches have been landed.  Closing bug.