Changeset 56098 in webkit


Ignore:
Timestamp:
Mar 16, 2010 6:53:37 PM (14 years ago)
Author:
jhawkins@chromium.org
Message:

2010-03-16 James Hawkins <jhawkins@chromium.org>

Reviewed by David Levin.

[Chromium] Size the WebVector of forms after determining how many
forms are valid and will be returned.

https://bugs.webkit.org/show_bug.cgi?id=36204

No new tests, as this is only triggered by Chromium's use of the
WebFormElement API.

  • src/WebFrameImpl.cpp: (WebKit::WebFrameImpl::forms):
Location:
trunk/WebKit/chromium
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/chromium/ChangeLog

    r56084 r56098  
     12010-03-16  James Hawkins  <jhawkins@chromium.org>
     2
     3        Reviewed by David Levin.
     4
     5        [Chromium] Size the WebVector of forms after determining how many
     6        forms are valid and will be returned.
     7
     8        https://bugs.webkit.org/show_bug.cgi?id=36204
     9
     10        No new tests, as this is only triggered by Chromium's use of the
     11        WebFormElement API.
     12
     13        * src/WebFrameImpl.cpp:
     14        (WebKit::WebFrameImpl::forms):
     15
    1162010-03-16  Kenneth Russell  <kbr@google.com>
    217
  • trunk/WebKit/chromium/src/WebFrameImpl.cpp

    r55814 r56098  
    658658
    659659    RefPtr<HTMLCollection> forms = m_frame->document()->forms();
    660     size_t formCount = forms->length();
     660    size_t formCount = 0;
     661    for (size_t i = 0; i < forms->length(); ++i) {
     662        Node* node = forms->item(i);
     663        if (node && node->isHTMLElement())
     664            ++formCount;
     665    }
    661666
    662667    WebVector<WebFormElement> temp(formCount);
Note: See TracChangeset for help on using the changeset viewer.