Bug 145046

Summary: Use modern for-loops in WebCore/xml.
Product: WebKit Reporter: Hunseop Jeong <hs85.jeong>
Component: WebCore Misc.Assignee: Hunseop Jeong <hs85.jeong>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, cdumez, commit-queue, darin, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews101 for mac-mavericks
none
Archive of layout-test-results from ews104 for mac-mavericks-wk2
none
Patch
none
Patch none

Description Hunseop Jeong 2015-05-15 02:40:23 PDT
Use the modern loops in WebCore/xml.
Comment 1 Hunseop Jeong 2015-05-15 02:51:34 PDT
Created attachment 253187 [details]
Patch
Comment 2 Build Bot 2015-05-15 03:39:56 PDT
Comment on attachment 253187 [details]
Patch

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

New failing tests:
fast/xpath/position.html
fast/xpath/xpath-functional-test.html
fast/xpath/attr-namespace.html
fast/xpath/py-dom-xpath/axes.html
fast/xpath/4XPath/Core/test_step.html
fast/xpath/text-nodes.html
fast/xpath/py-dom-xpath/predicates.html
fast/xpath/ancestor-axis.html
fast/xpath/py-dom-xpath/nodetests.html
fast/xpath/preceding-axis.xhtml
fast/xpath/document-order.html
fast/xpath/py-dom-xpath/paths.html
fast/xpath/union-context-node.xhtml
Comment 3 Build Bot 2015-05-15 03:40:00 PDT
Created attachment 253188 [details]
Archive of layout-test-results from ews101 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 4 Build Bot 2015-05-15 03:48:09 PDT
Comment on attachment 253187 [details]
Patch

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

New failing tests:
fast/xpath/position.html
fast/xpath/xpath-functional-test.html
fast/xpath/attr-namespace.html
fast/xpath/py-dom-xpath/axes.html
fast/xpath/4XPath/Core/test_step.html
fast/xpath/text-nodes.html
fast/xpath/py-dom-xpath/predicates.html
fast/xpath/ancestor-axis.html
fast/xpath/py-dom-xpath/nodetests.html
fast/xpath/preceding-axis.xhtml
fast/xpath/document-order.html
fast/xpath/py-dom-xpath/paths.html
fast/xpath/union-context-node.xhtml
Comment 5 Build Bot 2015-05-15 03:48:12 PDT
Created attachment 253189 [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-05-15 04:15:58 PDT
Created attachment 253190 [details]
Patch
Comment 7 Chris Dumez 2015-05-15 09:43:45 PDT
Comment on attachment 253190 [details]
Patch

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

r=me with comments.

> Source/WebCore/xml/XMLHttpRequest.cpp:408
> +    for (auto& value : methods) {

value -> method
auto& -> auto*

> Source/WebCore/xml/XPathExpressionNode.cpp:53
> +    for (auto& expression : m_subexpressions) {

expression -> subexpression

> Source/WebCore/xml/XSLStyleSheetLibxslt.cpp:87
> +        child->setParentStyleSheet(0);

0 -> nullptr

> Source/WebCore/xml/XSLStyleSheetLibxslt.cpp:119
>      m_stylesheetDoc = 0;

nullptr

> Source/WebCore/xml/XSLTProcessorLibxslt.cpp:234
>      parameterArray[index] = 0;

nullptr
Comment 8 Hunseop Jeong 2015-05-17 21:05:55 PDT
(In reply to comment #7)
> Comment on attachment 253190 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=253190&action=review
> 
> r=me with comments.
Thanks for the review.
> 
> > Source/WebCore/xml/XMLHttpRequest.cpp:408
> > +    for (auto& value : methods) {
> 
> value -> method
I hope to changed 'value' to 'method' but 'XMLHttpRequest::uppercaseKnownHTTPMethod(const String& method)' already used the 'method'.
So I used the 'value' instead of the 'method'.
If there is the good name, recommend.
> auto& -> auto*
Changed.
> 
> > Source/WebCore/xml/XPathExpressionNode.cpp:53
> > +    for (auto& expression : m_subexpressions) {
> 
> expression -> subexpression
ditto.
> 
> > Source/WebCore/xml/XSLStyleSheetLibxslt.cpp:87
> > +        child->setParentStyleSheet(0);
> 
> 0 -> nullptr
Could I fix it with the other ones in other bug?
> 
> > Source/WebCore/xml/XSLStyleSheetLibxslt.cpp:119
> >      m_stylesheetDoc = 0;
> 
> nullptr
ditto.
> 
> > Source/WebCore/xml/XSLTProcessorLibxslt.cpp:234
> >      parameterArray[index] = 0;
> 
> nullptr
ditto.
Comment 9 Hunseop Jeong 2015-05-17 21:08:40 PDT
Created attachment 253301 [details]
Patch
Comment 10 Hunseop Jeong 2015-05-19 07:11:37 PDT
(In reply to comment #8)
> (In reply to comment #7)
> > Comment on attachment 253190 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=253190&action=review
> > 
> > r=me with comments.
> Thanks for the review.
> > 
> > > Source/WebCore/xml/XMLHttpRequest.cpp:408
> > > +    for (auto& value : methods) {
> > 
> > value -> method
> I hope to changed 'value' to 'method' but
> 'XMLHttpRequest::uppercaseKnownHTTPMethod(const String& method)' already
> used the 'method'.
> So I used the 'value' instead of the 'method'.
> If there is the good name, recommend.
> > auto& -> auto*
> Changed.
> > 
> > > Source/WebCore/xml/XPathExpressionNode.cpp:53
> > > +    for (auto& expression : m_subexpressions) {
> > 
> > expression -> subexpression
> ditto.
> > 
> > > Source/WebCore/xml/XSLStyleSheetLibxslt.cpp:87
> > > +        child->setParentStyleSheet(0);
> > 
> > 0 -> nullptr
> Could I fix it with the other ones in other bug?
I replaced 0 with nullptr in https://bugs.webkit.org/show_bug.cgi?id=145165.
> > 
> > > Source/WebCore/xml/XSLStyleSheetLibxslt.cpp:119
> > >      m_stylesheetDoc = 0;
> > 
> > nullptr
> ditto.
> > 
> > > Source/WebCore/xml/XSLTProcessorLibxslt.cpp:234
> > >      parameterArray[index] = 0;
> > 
> > nullptr
> ditto.
Comment 11 Darin Adler 2015-05-19 09:15:21 PDT
Comment on attachment 253301 [details]
Patch

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

> Source/WebCore/xml/XMLHttpRequest.cpp:408
> +    for (auto* value : methods) {

Note you could also write this:

    for (auto* value : { "DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT" }) {
Comment 12 WebKit Commit Bot 2015-05-19 09:29:46 PDT
Comment on attachment 253301 [details]
Patch

Clearing flags on attachment: 253301

Committed r184566: <http://trac.webkit.org/changeset/184566>
Comment 13 WebKit Commit Bot 2015-05-19 09:29:50 PDT
All reviewed patches have been landed.  Closing bug.