|
|
Created:
6 years, 10 months ago by rwlbuis Modified:
6 years, 10 months ago CC:
blink-reviews, dglazkov+blink, sof, eae+blinkwatch, adamk+blink_chromium.org Base URL:
https://chromium.googlesource.com/chromium/blink.git@master Visibility:
Public. |
DescriptionRemove Element.nodeNamePreservingCase
There is no need for this method, we can just use tagQName.
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=166250
Patch Set 1 #
Total comments: 1
Patch Set 2 : Remove macro #
Total comments: 1
Patch Set 3 : Use tagQName #Patch Set 4 : Rebase against ToT #
Total comments: 1
Patch Set 5 : Add static helper #
Messages
Total messages: 32 (0 generated)
This way avoids some code duplication.
https://codereview.chromium.org/147593008/diff/1/Source/core/editing/MarkupAc... File Source/core/editing/MarkupAccumulator.cpp (right): https://codereview.chromium.org/147593008/diff/1/Source/core/editing/MarkupAc... Source/core/editing/MarkupAccumulator.cpp:45: #define nodeNamePreservingCase(a) Element::nodeName(a) I don't like macros. Why not update the call sites instead?
On 2014/01/29 19:02:22, Chris Dumez wrote: > https://codereview.chromium.org/147593008/diff/1/Source/core/editing/MarkupAc... > File Source/core/editing/MarkupAccumulator.cpp (right): > > https://codereview.chromium.org/147593008/diff/1/Source/core/editing/MarkupAc... > Source/core/editing/MarkupAccumulator.cpp:45: #define nodeNamePreservingCase(a) > Element::nodeName(a) > I don't like macros. Why not update the call sites instead? I thought some people might not like the direct syntax, but I guess we do that in other places already (although I think it is rare). Will make a new patch.
On 2014/01/29 19:28:54, rwlbuis wrote: > On 2014/01/29 19:02:22, Chris Dumez wrote: > > > https://codereview.chromium.org/147593008/diff/1/Source/core/editing/MarkupAc... > > File Source/core/editing/MarkupAccumulator.cpp (right): > > > > > https://codereview.chromium.org/147593008/diff/1/Source/core/editing/MarkupAc... > > Source/core/editing/MarkupAccumulator.cpp:45: #define > nodeNamePreservingCase(a) > > Element::nodeName(a) > > I don't like macros. Why not update the call sites instead? > > I thought some people might not like the direct syntax, but I guess we do that > in other places already (although I think it is rare). Will make a new patch. When you update your patches, don't forget to write a comment and hit publish+mail again or reviewers aren't notified you did anything.
Don't forget to update your CL description. It still mentions adding a macro. https://codereview.chromium.org/147593008/diff/20001/Source/core/editing/Mark... File Source/core/editing/MarkupAccumulator.cpp (right): https://codereview.chromium.org/147593008/diff/20001/Source/core/editing/Mark... Source/core/editing/MarkupAccumulator.cpp:396: result.append(element->Element::nodeName()); I don't really like this syntax. This makes the code less readable than before. How about result.append(element->tagQName().toString()) ?
On 2014/01/30 01:24:08, Chris Dumez wrote: > On 2014/01/29 19:28:54, rwlbuis wrote: > > On 2014/01/29 19:02:22, Chris Dumez wrote: > > > > > > https://codereview.chromium.org/147593008/diff/1/Source/core/editing/MarkupAc... > > > File Source/core/editing/MarkupAccumulator.cpp (right): > > > > > > > > > https://codereview.chromium.org/147593008/diff/1/Source/core/editing/MarkupAc... > > > Source/core/editing/MarkupAccumulator.cpp:45: #define > > nodeNamePreservingCase(a) > > > Element::nodeName(a) > > > I don't like macros. Why not update the call sites instead? > > > > I thought some people might not like the direct syntax, but I guess we do that > > in other places already (although I think it is rare). Will make a new patch. > > When you update your patches, don't forget to write a comment and hit > publish+mail again or reviewers aren't notified you did anything. Oops, sorry!
On 2014/01/30 01:29:33, Chris Dumez wrote: > Don't forget to update your CL description. It still mentions adding a macro. Good point, will fix! > https://codereview.chromium.org/147593008/diff/20001/Source/core/editing/Mark... > File Source/core/editing/MarkupAccumulator.cpp (right): > > https://codereview.chromium.org/147593008/diff/20001/Source/core/editing/Mark... > Source/core/editing/MarkupAccumulator.cpp:396: > result.append(element->Element::nodeName()); > I don't really like this syntax. This makes the code less readable than before. > > How about result.append(element->tagQName().toString()) ? That does look better, I'll make a new patch tomorrow when I am back in the office. Thanks!
The new patch now uses tagQName.
On 2014/01/30 20:14:49, rwlbuis wrote: > The new patch now uses tagQName. lgtm
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rob.buis@samsung.com/147593008/60001
Retried try job too often on linux_blink for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_blin...
CQ bit was unchecked on CL. Ignoring.
CQ bit was unchecked on CL. Ignoring.
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rob.buis@samsung.com/147593008/60001
Retried try job too often on linux_blink for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_blin...
CQ bit was unchecked on CL. Ignoring.
CQ bit was unchecked on CL. Ignoring.
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rob.buis@samsung.com/147593008/60001
Retried try job too often on linux_blink for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_blin...
CQ bit was unchecked on CL. Ignoring.
CQ bit was unchecked on CL. Ignoring.
https://codereview.chromium.org/147593008/diff/60001/Source/core/editing/Mark... File Source/core/editing/MarkupAccumulator.cpp (left): https://codereview.chromium.org/147593008/diff/60001/Source/core/editing/Mark... Source/core/editing/MarkupAccumulator.cpp:396: result.append(element.nodeNamePreservingCase()); I see, we can't use nodeName() because it doesn't preserve case? I think that the previous code as clearer. Its not at all clear when reading this why we go through tagName to get this.
Or we could just add a static String nodeNamePreservingCase(Element*) to MarkupAccumulator?
I was confused by the fact that Element::nodeName() and Element::nodeNamePreservingCase() have the same implementation. It makes it look like nodeNamePreservingCase() is not needed. However, Element::nodeName() is virtual and overridden in HTMLElement and its implementation does not preserve the case. As a consequence, I think the Element::nodeNamePreservingCase() method has some use. Maybe we could just update Element::nodeName() to call nodeNamePreservingCase() and avoid duplicating the method body.
On 2014/01/31 05:41:50, eseidel wrote: > Or we could just add a static String nodeNamePreservingCase(Element*) to > MarkupAccumulator? I like this suggestion, will make a new patch set.
New patch set is ready and turning up first green results.
lgtm :shrug:. This CL doesn't really seem to do much.
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rob.buis@samsung.com/147593008/100001
Message was sent while issue was closed.
Change committed as 166250
Message was sent while issue was closed.
CQ bit was unchecked on CL. Ignoring.
Message was sent while issue was closed.
CQ bit was unchecked on CL. Ignoring.
Message was sent while issue was closed.
CQ bit was unchecked on CL. Ignoring. |