Changeset 227480 in webkit


Ignore:
Timestamp:
Jan 24, 2018 1:01:00 AM (6 years ago)
Author:
Wenson Hsieh
Message:

Unreviewed, try to fix the Windows build after r227479.

Tweak some Windows WebKitLegacy code to use updated HTMLFormElement methods.

  • WebFrame.cpp:

(WebFrame::elementWithName):
(WebFrame::controlsInForm):

Location:
trunk/Source/WebKitLegacy/win
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKitLegacy/win/ChangeLog

    r227209 r227480  
     12018-01-24  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Unreviewed, try to fix the Windows build after r227479.
     4
     5        Tweak some Windows WebKitLegacy code to use updated HTMLFormElement methods.
     6
     7        * WebFrame.cpp:
     8        (WebFrame::elementWithName):
     9        (WebFrame::controlsInForm):
     10
    1112018-01-19  Per Arne Vollan  <pvollan@apple.com>
    212
  • trunk/Source/WebKitLegacy/win/WebFrame.cpp

    r224150 r227480  
    10891089    HTMLFormElement* formElement = formElementFromDOMElement(form);
    10901090    if (formElement) {
    1091         const Vector<FormAssociatedElement*>& elements = formElement->associatedElements();
    10921091        AtomicString targetName((UChar*)name, SysStringLen(name));
    1093         for (unsigned int i = 0; i < elements.size(); i++) {
    1094             if (!is<HTMLFormControlElement>(*elements[i]))
     1092        for (auto& element : formElement->copyAssociatedElementsVector()) {
     1093            if (!is<HTMLFormControlElement>(element.get()))
    10951094                continue;
    1096             HTMLFormControlElement& elt = downcast<HTMLFormControlElement>(*elements[i]);
    1097             // Skip option elements, other duds
     1095            auto& elt = downcast<HTMLFormControlElement>(element.get());
     1096            // Skip option elements, other duds.
    10981097            if (elt.name() == targetName) {
    10991098                *element = DOMElement::createInstance(&elt);
     
    12681267        return E_FAIL;
    12691268
     1269    auto elements = formElement->copyAssociatedElementsVector();
    12701270    int inCount = *cControls;
    1271     int count = (int) formElement->associatedElements().size();
     1271    int count = (int) elements.size();
    12721272    *cControls = count;
    12731273    if (!controls)
     
    12771277
    12781278    *cControls = 0;
    1279     const Vector<FormAssociatedElement*>& elements = formElement->associatedElements();
    1280     for (int i = 0; i < count; i++) {
    1281         if (elements.at(i)->isEnumeratable()) { // Skip option elements, other duds
    1282             controls[*cControls] = DOMElement::createInstance(&elements.at(i)->asHTMLElement());
     1279    for (auto& element : elements) {
     1280        if (element->isEnumeratable()) {
     1281            // Skip option elements, other duds.
     1282            controls[*cControls] = DOMElement::createInstance(&element->asHTMLElement());
    12831283            (*cControls)++;
    12841284        }
Note: See TracChangeset for help on using the changeset viewer.