Changeset 76744 in webkit


Ignore:
Timestamp:
Jan 26, 2011 5:45:56 PM (13 years ago)
Author:
tkent@chromium.org
Message:

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.
Location:
trunk/Source/WebKit/chromium
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/chromium/ChangeLog

    r76743 r76744  
     12011-01-26  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        [Chromium] WebFrame::forms() should not return empty WebFormElements
     6        https://bugs.webkit.org/show_bug.cgi?id=53204
     7
     8        * src/WebFrameImpl.cpp:
     9        (WebKit::WebFrameImpl::forms):
     10         - Should iterate by forms->length(), not the number of HTMLElements.
     11         - Do not increment the index for "temp" if a node is not an HTMLElement.
     12
    1132011-01-26  Dan Bernstein  <mitz@apple.com>
    214
  • trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp

    r76406 r76744  
    686686
    687687    WebVector<WebFormElement> temp(formCount);
    688     for (size_t i = 0; i < formCount; ++i) {
    689         Node* node = forms->item(i);
     688    unsigned i = 0;
     689    for (size_t sourceIndex = 0; i < forms->length(); ++sourceIndex) {
     690        Node* node = forms->item(sourceIndex);
    690691        // Strange but true, sometimes item can be 0.
    691692        if (node && node->isHTMLElement())
    692             temp[i] = static_cast<HTMLFormElement*>(node);
    693     }
     693            temp[i++] = static_cast<HTMLFormElement*>(node);
     694    }
     695    ASSERT(i == formCount);
    694696    results.swap(temp);
    695697}
Note: See TracChangeset for help on using the changeset viewer.