Bug 145912 - Use modern for-loops in WebCore/rendering - 2
Summary: Use modern for-loops in WebCore/rendering - 2
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Hunseop Jeong
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-12 03:19 PDT by Hunseop Jeong
Modified: 2015-06-15 19:57 PDT (History)
2 users (show)

See Also:


Attachments
Patch (70.37 KB, patch)
2015-06-12 03:47 PDT, Hunseop Jeong
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews103 for mac-mavericks (854.97 KB, application/zip)
2015-06-12 04:21 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews104 for mac-mavericks-wk2 (891.96 KB, application/zip)
2015-06-12 04:25 PDT, Build Bot
no flags Details
Patch (3.80 MB, patch)
2015-06-12 07:56 PDT, Hunseop Jeong
no flags Details | Formatted Diff | Diff
Patch (69.83 KB, patch)
2015-06-12 09:38 PDT, Hunseop Jeong
no flags Details | Formatted Diff | Diff
Patch (69.89 KB, patch)
2015-06-15 19:25 PDT, Hunseop Jeong
no flags Details | Formatted Diff | Diff
Patch (69.90 KB, patch)
2015-06-15 19:57 PDT, Hunseop Jeong
hs85.jeong: commit-queue?
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hunseop Jeong 2015-06-12 03:19:42 PDT
Use modern for-loops in WebCore/rendering - 2 of 2.
Comment 1 Hunseop Jeong 2015-06-12 03:47:08 PDT
Created attachment 254788 [details]
Patch
Comment 2 Build Bot 2015-06-12 04:21:42 PDT
Comment on attachment 254788 [details]
Patch

Attachment 254788 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/5854356633026560

New failing tests:
svg/W3C-SVG-1.1/struct-group-03-t.svg
svg/transforms/svg-css-transforms.xhtml
svg/W3C-SVG-1.1/painting-stroke-04-t.svg
transforms/svg-vs-css.xhtml
svg/custom/invalid-dasharray.svg
Comment 3 Build Bot 2015-06-12 04:21:45 PDT
Created attachment 254790 [details]
Archive of layout-test-results from ews103 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 4 Build Bot 2015-06-12 04:25:10 PDT
Comment on attachment 254788 [details]
Patch

Attachment 254788 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/6255143653736448

New failing tests:
svg/W3C-SVG-1.1/struct-group-03-t.svg
svg/transforms/svg-css-transforms.xhtml
svg/W3C-SVG-1.1/painting-stroke-04-t.svg
transforms/svg-vs-css.xhtml
svg/custom/invalid-dasharray.svg
Comment 5 Build Bot 2015-06-12 04:25:12 PDT
Created attachment 254791 [details]
Archive of layout-test-results from ews104 for mac-mavericks-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-mavericks-wk2  Platform: Mac OS X 10.9.5
Comment 6 Hunseop Jeong 2015-06-12 07:56:34 PDT
Created attachment 254800 [details]
Patch
Comment 7 Hunseop Jeong 2015-06-12 09:38:06 PDT
Created attachment 254806 [details]
Patch
Comment 8 Darin Adler 2015-06-12 09:53:15 PDT
Comment on attachment 254806 [details]
Patch

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

Simon Fraser did ask us to slow down on these.

> Source/WebCore/rendering/RenderObject.cpp:1085
> +        rects.append(SelectionRect(quad.enclosingBoundingBox(), isHorizontalWritingMode(), view().pageNumberForBlockProgressionOffset(quad.enclosingBoundingBox().x())));

It’s inefficient to call enclosingBoundingBox twice here on each quad. This should be rewritten to use a local variable.

> Source/WebCore/rendering/RenderQuote.cpp:70
> +    for (auto quoteCharacter : distinctQuoteCharacters) {

This is *wrong*. It needs to be auto& or this function won’t work.

> Source/WebCore/rendering/style/KeyframeList.cpp:103
> +        for (auto& currKeyframe : m_keyframes) {

Should just be keyframe, not currKeyframe.

> Source/WebCore/rendering/svg/RenderSVGPath.cpp:117
> +            FloatPoint radiusVector(point.x() - location.x(), point.y() -  location.y());

This should be:

    FloatPoint radiusVector = point - location;

> Source/WebCore/rendering/svg/RenderSVGText.cpp:188
>      SVGTextLayoutAttributes* attributes = 0;

nullptr
Comment 9 Hunseop Jeong 2015-06-15 19:25:47 PDT
Created attachment 254924 [details]
Patch
Comment 10 Hunseop Jeong 2015-06-15 19:55:44 PDT
(In reply to comment #8)
> Comment on attachment 254806 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=254806&action=review
> 
> Simon Fraser did ask us to slow down on these.
Then, Do I wait to upload these patches?

> 
> > Source/WebCore/rendering/RenderObject.cpp:1085
> > +        rects.append(SelectionRect(quad.enclosingBoundingBox(), isHorizontalWritingMode(), view().pageNumberForBlockProgressionOffset(quad.enclosingBoundingBox().x())));
> 
> It’s inefficient to call enclosingBoundingBox twice here on each quad. This
> should be rewritten to use a local variable.
> 
I made the local variable to remove the inefficient call.

> > Source/WebCore/rendering/RenderQuote.cpp:70
> > +    for (auto quoteCharacter : distinctQuoteCharacters) {
> 
> This is *wrong*. It needs to be auto& or this function won’t work.
> 
I Changed it to use the auto&.

> > Source/WebCore/rendering/style/KeyframeList.cpp:103
> > +        for (auto& currKeyframe : m_keyframes) {
> 
> Should just be keyframe, not currKeyframe.
>
This function already use the 'keyframe' for the parameter of function.
So I used the 'currKeyframe' to avoid the confusion.

> > Source/WebCore/rendering/svg/RenderSVGPath.cpp:117
> > +            FloatPoint radiusVector(point.x() - location.x(), point.y() -  location.y());
> 
> This should be:
> 
>     FloatPoint radiusVector = point - location;
> 
'point - location' return the FloatSize.
So I changed it to "FloatPoint radiusVector(point - location);"

> > Source/WebCore/rendering/svg/RenderSVGText.cpp:188
> >      SVGTextLayoutAttributes* attributes = 0;
> 
> nullptr
Done.
Comment 11 Hunseop Jeong 2015-06-15 19:57:57 PDT
Created attachment 254926 [details]
Patch