diff options
author | ch.dumez@samsung.com <ch.dumez@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-03 23:40:23 +0000 |
---|---|---|
committer | ch.dumez@samsung.com <ch.dumez@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-03 23:40:23 +0000 |
commit | c0b58a87ff6773ab53c23ebbe0c8dc4eec03049d (patch) | |
tree | 98ee338cdb52bc24b199367941683feedfecfacb /components | |
parent | df41e253e6918cd035c36936761734f2ac694466 (diff) | |
download | chromium_src-c0b58a87ff6773ab53c23ebbe0c8dc4eec03049d.zip chromium_src-c0b58a87ff6773ab53c23ebbe0c8dc4eec03049d.tar.gz chromium_src-c0b58a87ff6773ab53c23ebbe0c8dc4eec03049d.tar.bz2 |
Update WebNode::getElementsByTagName() callers to use a WebNodeCollection
Update WebNode::getElementsByTagName() callers to use a WebNodeCollection
instead of a WebNodeList. The WebNode::getElementsByTagName() public API was
updated in Blink r166263 to return a WebNodeCollection instead of a
WebNodeList.
Callers need to be updated so that we can get rid of the current workaround
allowing a WebNodeList to be implicitly converted into a WebNodeCollection.
BUG=235008
Review URL: https://codereview.chromium.org/152133004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248613 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components')
-rw-r--r-- | components/autofill/content/renderer/form_autofill_util.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/components/autofill/content/renderer/form_autofill_util.cc b/components/autofill/content/renderer/form_autofill_util.cc index 5d1f379..e0ed222 100644 --- a/components/autofill/content/renderer/form_autofill_util.cc +++ b/components/autofill/content/renderer/form_autofill_util.cc @@ -28,6 +28,7 @@ #include "third_party/WebKit/public/web/WebInputElement.h" #include "third_party/WebKit/public/web/WebLabelElement.h" #include "third_party/WebKit/public/web/WebNode.h" +#include "third_party/WebKit/public/web/WebNodeCollection.h" #include "third_party/WebKit/public/web/WebNodeList.h" #include "third_party/WebKit/public/web/WebOptionElement.h" #include "third_party/WebKit/public/web/WebSelectElement.h" @@ -42,6 +43,7 @@ using blink::WebFrame; using blink::WebInputElement; using blink::WebLabelElement; using blink::WebNode; +using blink::WebNodeCollection; using blink::WebNodeList; using blink::WebOptionElement; using blink::WebSelectElement; @@ -905,9 +907,11 @@ bool WebFormElementToFormData( // element's name as a key into the <name, FormFieldData> map to find the // previously created FormFieldData and set the FormFieldData's label to the // label.firstChild().nodeValue() of the label element. - WebNodeList labels = form_element.getElementsByTagName(kLabel); - for (unsigned i = 0; i < labels.length(); ++i) { - WebLabelElement label = labels.item(i).to<WebLabelElement>(); + WebNodeCollection labels = form_element.getElementsByTagName(kLabel); + DCHECK(!labels.isNull()); + for (WebNode item = labels.firstItem(); !item.isNull(); + item = labels.nextItem()) { + WebLabelElement label = item.to<WebLabelElement>(); WebFormControlElement field_element = label.correspondingControl().to<WebFormControlElement>(); |