Commit 04df567e authored by tkent@chromium.org's avatar tkent@chromium.org
Browse files

2011-01-26 Kent Tamura <tkent@chromium.org>

        Reviewed by Dimitri Glazkov.

        [Chromium] WebFrame::forms() should not return empty WebFormElements
        https://bugs.webkit.org/show_bug.cgi?id=53204

        * src/WebFrameImpl.cpp:
        (WebKit::WebFrameImpl::forms):
         - Should iterate by forms->length(), not the number of HTMLElements.
         - Do not increment the index for "temp" if a node is not an HTMLElement.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76744 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 86470c87
2011-01-26 Kent Tamura <tkent@chromium.org>
Reviewed by Dimitri Glazkov.
[Chromium] WebFrame::forms() should not return empty WebFormElements
https://bugs.webkit.org/show_bug.cgi?id=53204
* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::forms):
- Should iterate by forms->length(), not the number of HTMLElements.
- Do not increment the index for "temp" if a node is not an HTMLElement.
2011-01-26 Dan Bernstein <mitz@apple.com>
 
Reviewed by Dave Hyatt.
......@@ -685,12 +685,14 @@ void WebFrameImpl::forms(WebVector<WebFormElement>& results) const
}
WebVector<WebFormElement> temp(formCount);
for (size_t i = 0; i < formCount; ++i) {
Node* node = forms->item(i);
unsigned i = 0;
for (size_t sourceIndex = 0; i < forms->length(); ++sourceIndex) {
Node* node = forms->item(sourceIndex);
// Strange but true, sometimes item can be 0.
if (node && node->isHTMLElement())
temp[i] = static_cast<HTMLFormElement*>(node);
temp[i++] = static_cast<HTMLFormElement*>(node);
}
ASSERT(i == formCount);
results.swap(temp);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment