Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Issue 179333004: Add template parameter to ElementTraversal to iterate over Elements of a specific type (Closed)

Created:
6 years, 9 months ago by Inactive
Modified:
6 years, 9 months ago
Reviewers:
esprehn, eseidel
CC:
blink-reviews, sof, eae+blinkwatch, dglazkov+blink, adamk+blink_chromium.org, rwlbuis, adamk
Visibility:
Public.

Description

Add template parameter to ElementTraversal to iterate over Elements of a specific type Add template parameter to ElementTraversal to iterate over Elements of a specific type. The resulting code looks like: HTMLTableRowElement* row = Traversal<HTMLTableRowElement>::firstWithin(table); This avoids having to traverse generic Elements and then explicitly check their tag name to make sure it is a specific Element subclass. This CL only updates one file to use this functionality. The rest of the code will be ported in a follow-up patch to reduce patch size. This patch is based on the following WebKit revision by <antti@apple.com>;: http://trac.webkit.org/changeset/154481 R=esprehn@chromium.org, eseidel BUG=346733 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=168689

Patch Set 1 #

Patch Set 2 : Bug fix #

Total comments: 3

Patch Set 3 : Rebase #

Patch Set 4 : Fix failures and port more code to the new API #

Unified diffs Side-by-side diffs Delta from patch set Stats (+278 lines, -281 lines) Patch
M Source/build/scripts/templates/ElementTypeHelpers.h.tmpl View 1 chunk +0 lines, -22 lines 0 comments Download
M Source/core/core.gypi View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 5 chunks +17 lines, -29 lines 0 comments Download
M Source/core/dom/Element.h View 1 2 3 1 chunk +23 lines, -0 lines 0 comments Download
M Source/core/dom/ElementTraversal.h View 1 2 3 4 chunks +193 lines, -64 lines 0 comments Download
M Source/core/dom/NodeIterator.h View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/dom/NodeIterator.cpp View 1 chunk +1 line, -1 line 0 comments Download
A + Source/core/dom/NodeIteratorBase.h View 1 chunk +25 lines, -25 lines 0 comments Download
A + Source/core/dom/NodeIteratorBase.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
D Source/core/dom/Traversal.h View 1 chunk +0 lines, -58 lines 0 comments Download
D Source/core/dom/Traversal.cpp View 1 chunk +0 lines, -51 lines 0 comments Download
M Source/core/dom/TreeWalker.h View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/dom/TreeWalker.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLTableRowsCollection.cpp View 1 2 3 4 chunks +9 lines, -21 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
Inactive
6 years, 9 months ago (2014-02-25 19:00:25 UTC) #1
esprehn
How does the general form of Traversal<Element>::firstWithin() work? Is there an isElement() method?
6 years, 9 months ago (2014-02-25 19:08:30 UTC) #2
Inactive
On 2014/02/25 19:08:30, esprehn wrote: > How does the general form of Traversal<Element>::firstWithin() work? Is ...
6 years, 9 months ago (2014-02-25 19:20:39 UTC) #3
Inactive
6 years, 9 months ago (2014-02-26 18:33:40 UTC) #4
esprehn
https://codereview.chromium.org/179333004/diff/20001/Source/core/dom/ElementTraversal.h File Source/core/dom/ElementTraversal.h (right): https://codereview.chromium.org/179333004/diff/20001/Source/core/dom/ElementTraversal.h#newcode105 Source/core/dom/ElementTraversal.h:105: template <class ElementType> Why stack two template<> decls instead ...
6 years, 9 months ago (2014-02-26 20:17:48 UTC) #5
esprehn
lgtm
6 years, 9 months ago (2014-02-26 20:17:53 UTC) #6
Inactive
https://codereview.chromium.org/179333004/diff/20001/Source/core/dom/ElementTraversal.h File Source/core/dom/ElementTraversal.h (right): https://codereview.chromium.org/179333004/diff/20001/Source/core/dom/ElementTraversal.h#newcode105 Source/core/dom/ElementTraversal.h:105: template <class ElementType> On 2014/02/26 20:17:49, esprehn wrote: > ...
6 years, 9 months ago (2014-02-26 20:24:20 UTC) #7
Inactive
https://codereview.chromium.org/179333004/diff/20001/Source/core/dom/ElementTraversal.h File Source/core/dom/ElementTraversal.h (right): https://codereview.chromium.org/179333004/diff/20001/Source/core/dom/ElementTraversal.h#newcode105 Source/core/dom/ElementTraversal.h:105: template <class ElementType> On 2014/02/26 20:17:49, esprehn wrote: > ...
6 years, 9 months ago (2014-02-26 20:29:13 UTC) #8
Inactive
The CQ bit was checked by ch.dumez@samsung.com
6 years, 9 months ago (2014-02-26 20:29:22 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/179333004/40001
6 years, 9 months ago (2014-02-26 20:29:37 UTC) #10
Inactive
Committed patchset #3 manually as r167945 (presubmit successful).
6 years, 9 months ago (2014-02-27 00:27:19 UTC) #11
Inactive
A revert of this CL has been created in https://codereview.chromium.org/182583002/ by ch.dumez@samsung.com. The reason for ...
6 years, 9 months ago (2014-02-27 02:04:13 UTC) #12
Inactive
I have fixed the patch. The issue was that the implementation of firstWithin() was not ...
6 years, 9 months ago (2014-02-27 20:28:54 UTC) #13
Inactive
6 years, 9 months ago (2014-03-03 14:00:58 UTC) #14
Inactive
Esprehn, could you please take another look when you get a chance? Thanks.
6 years, 9 months ago (2014-03-04 14:57:03 UTC) #15
esprehn
lgtm, thanks!
6 years, 9 months ago (2014-03-06 19:31:53 UTC) #16
Inactive
The CQ bit was checked by ch.dumez@samsung.com
6 years, 9 months ago (2014-03-06 21:27:08 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/179333004/60001
6 years, 9 months ago (2014-03-06 21:27:29 UTC) #18
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-06 21:27:55 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink, win_blink_rel
6 years, 9 months ago (2014-03-06 21:27:55 UTC) #20
Inactive
The CQ bit was checked by ch.dumez@samsung.com
6 years, 9 months ago (2014-03-06 22:05:40 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/179333004/60001
6 years, 9 months ago (2014-03-06 22:06:32 UTC) #22
commit-bot: I haz the power
6 years, 9 months ago (2014-03-07 00:29:29 UTC) #23
Message was sent while issue was closed.
Change committed as 168689

Powered by Google App Engine
This is Rietveld 408576698