OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 void HTMLFormElement::requestAutocomplete() | 440 void HTMLFormElement::requestAutocomplete() |
441 { | 441 { |
442 if (!document().frame() || !shouldAutocomplete() || !UserGestureIndicator::p
rocessingUserGesture()) | 442 if (!document().frame() || !shouldAutocomplete() || !UserGestureIndicator::p
rocessingUserGesture()) |
443 finishRequestAutocomplete(AutocompleteResultErrorDisabled); | 443 finishRequestAutocomplete(AutocompleteResultErrorDisabled); |
444 else | 444 else |
445 document().frame()->loader().client()->didRequestAutocomplete(this); | 445 document().frame()->loader().client()->didRequestAutocomplete(this); |
446 } | 446 } |
447 | 447 |
448 void HTMLFormElement::finishRequestAutocomplete(AutocompleteResult result) | 448 void HTMLFormElement::finishRequestAutocomplete(AutocompleteResult result) |
449 { | 449 { |
450 RefPtr<Event> event; | 450 RefPtrWillBeRawPtr<Event> event; |
451 if (result == AutocompleteResultSuccess) | 451 if (result == AutocompleteResultSuccess) |
452 event = Event::create(EventTypeNames::autocomplete); | 452 event = Event::create(EventTypeNames::autocomplete); |
453 else if (result == AutocompleteResultErrorDisabled) | 453 else if (result == AutocompleteResultErrorDisabled) |
454 event = AutocompleteErrorEvent::create("disabled"); | 454 event = AutocompleteErrorEvent::create("disabled"); |
455 else if (result == AutocompleteResultErrorCancel) | 455 else if (result == AutocompleteResultErrorCancel) |
456 event = AutocompleteErrorEvent::create("cancel"); | 456 event = AutocompleteErrorEvent::create("cancel"); |
457 else if (result == AutocompleteResultErrorInvalid) | 457 else if (result == AutocompleteResultErrorInvalid) |
458 event = AutocompleteErrorEvent::create("invalid"); | 458 event = AutocompleteErrorEvent::create("invalid"); |
459 | 459 |
460 event->setTarget(this); | 460 event->setTarget(this); |
461 m_pendingAutocompleteEvents.append(event.release()); | 461 m_pendingAutocompleteEvents.append(event.release()); |
462 | 462 |
463 // Dispatch events later as this API is meant to work asynchronously in all
situations and implementations. | 463 // Dispatch events later as this API is meant to work asynchronously in all
situations and implementations. |
464 if (!m_requestAutocompleteTimer.isActive()) | 464 if (!m_requestAutocompleteTimer.isActive()) |
465 m_requestAutocompleteTimer.startOneShot(0, FROM_HERE); | 465 m_requestAutocompleteTimer.startOneShot(0, FROM_HERE); |
466 } | 466 } |
467 | 467 |
468 void HTMLFormElement::requestAutocompleteTimerFired(Timer<HTMLFormElement>*) | 468 void HTMLFormElement::requestAutocompleteTimerFired(Timer<HTMLFormElement>*) |
469 { | 469 { |
470 Vector<RefPtr<Event> > pendingEvents; | 470 WillBeHeapVector<RefPtrWillBeMember<Event> > pendingEvents; |
471 m_pendingAutocompleteEvents.swap(pendingEvents); | 471 m_pendingAutocompleteEvents.swap(pendingEvents); |
472 for (size_t i = 0; i < pendingEvents.size(); ++i) | 472 for (size_t i = 0; i < pendingEvents.size(); ++i) |
473 dispatchEvent(pendingEvents[i].release()); | 473 dispatchEvent(pendingEvents[i].release()); |
474 } | 474 } |
475 | 475 |
476 void HTMLFormElement::parseAttribute(const QualifiedName& name, const AtomicStri
ng& value) | 476 void HTMLFormElement::parseAttribute(const QualifiedName& name, const AtomicStri
ng& value) |
477 { | 477 { |
478 if (name == actionAttr) | 478 if (name == actionAttr) |
479 m_attributes.parseAction(value); | 479 m_attributes.parseAction(value); |
480 else if (name == targetAttr) | 480 else if (name == targetAttr) |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 } | 787 } |
788 | 788 |
789 void HTMLFormElement::setDemoted(bool demoted) | 789 void HTMLFormElement::setDemoted(bool demoted) |
790 { | 790 { |
791 if (demoted) | 791 if (demoted) |
792 UseCounter::count(document(), UseCounter::DemotedFormElement); | 792 UseCounter::count(document(), UseCounter::DemotedFormElement); |
793 m_wasDemoted = demoted; | 793 m_wasDemoted = demoted; |
794 } | 794 } |
795 | 795 |
796 } // namespace | 796 } // namespace |
OLD | NEW |