Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLInputElement.cpp

Issue 1537313002: Fix a crash by search event handler for <input type=search incremental>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2564
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
8 * Copyright (C) 2010 Google Inc. All rights reserved. 8 * Copyright (C) 2010 Google Inc. All rights reserved.
9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
10 * Copyright (C) 2012 Samsung Electronics. All rights reserved. 10 * Copyright (C) 2012 Samsung Electronics. All rights reserved.
(...skipping 20 matching lines...) Expand all
31 31
32 #include "bindings/core/v8/ExceptionMessages.h" 32 #include "bindings/core/v8/ExceptionMessages.h"
33 #include "bindings/core/v8/ExceptionState.h" 33 #include "bindings/core/v8/ExceptionState.h"
34 #include "bindings/core/v8/ScriptEventListener.h" 34 #include "bindings/core/v8/ScriptEventListener.h"
35 #include "bindings/core/v8/V8DOMActivityLogger.h" 35 #include "bindings/core/v8/V8DOMActivityLogger.h"
36 #include "core/CSSPropertyNames.h" 36 #include "core/CSSPropertyNames.h"
37 #include "core/HTMLNames.h" 37 #include "core/HTMLNames.h"
38 #include "core/InputTypeNames.h" 38 #include "core/InputTypeNames.h"
39 #include "core/dom/AXObjectCache.h" 39 #include "core/dom/AXObjectCache.h"
40 #include "core/dom/Document.h" 40 #include "core/dom/Document.h"
41 #include "core/dom/ExecutionContextTask.h"
41 #include "core/dom/IdTargetObserver.h" 42 #include "core/dom/IdTargetObserver.h"
42 #include "core/dom/shadow/InsertionPoint.h" 43 #include "core/dom/shadow/InsertionPoint.h"
43 #include "core/dom/shadow/ShadowRoot.h" 44 #include "core/dom/shadow/ShadowRoot.h"
44 #include "core/editing/FrameSelection.h" 45 #include "core/editing/FrameSelection.h"
45 #include "core/editing/spellcheck/SpellChecker.h" 46 #include "core/editing/spellcheck/SpellChecker.h"
46 #include "core/events/BeforeTextInsertedEvent.h" 47 #include "core/events/BeforeTextInsertedEvent.h"
47 #include "core/events/KeyboardEvent.h" 48 #include "core/events/KeyboardEvent.h"
48 #include "core/events/MouseEvent.h" 49 #include "core/events/MouseEvent.h"
49 #include "core/events/ScopedEventQueue.h" 50 #include "core/events/ScopedEventQueue.h"
50 #include "core/events/TouchEvent.h" 51 #include "core/events/TouchEvent.h"
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 1245
1245 if (evt->isKeyboardEvent() && evt->type() == EventTypeNames::keyup) { 1246 if (evt->isKeyboardEvent() && evt->type() == EventTypeNames::keyup) {
1246 m_inputTypeView->handleKeyupEvent(toKeyboardEvent(evt)); 1247 m_inputTypeView->handleKeyupEvent(toKeyboardEvent(evt));
1247 if (evt->defaultHandled()) 1248 if (evt->defaultHandled())
1248 return; 1249 return;
1249 } 1250 }
1250 1251
1251 if (m_inputTypeView->shouldSubmitImplicitly(evt)) { 1252 if (m_inputTypeView->shouldSubmitImplicitly(evt)) {
1252 // FIXME: Remove type check. 1253 // FIXME: Remove type check.
1253 if (type() == InputTypeNames::search) 1254 if (type() == InputTypeNames::search)
1254 onSearch(); 1255 document().postTask(BLINK_FROM_HERE, createSameThreadTask(&HTMLInput Element::onSearch, PassRefPtrWillBeRawPtr<HTMLInputElement>(this)));
1255 // Form submission finishes editing, just as loss of focus does. 1256 // Form submission finishes editing, just as loss of focus does.
1256 // If there was a change, send the event now. 1257 // If there was a change, send the event now.
1257 if (wasChangedSinceLastFormControlChangeEvent()) 1258 if (wasChangedSinceLastFormControlChangeEvent())
1258 dispatchFormControlChangeEvent(); 1259 dispatchFormControlChangeEvent();
1259 1260
1260 RefPtrWillBeRawPtr<HTMLFormElement> formForSubmission = m_inputTypeView- >formForSubmission(); 1261 RefPtrWillBeRawPtr<HTMLFormElement> formForSubmission = m_inputTypeView- >formForSubmission();
1261 // Form may never have been present, or may have been destroyed by code responding to the change event. 1262 // Form may never have been present, or may have been destroyed by code responding to the change event.
1262 if (formForSubmission) 1263 if (formForSubmission)
1263 formForSubmission->submitImplicitly(evt, canTriggerImplicitSubmissio n()); 1264 formForSubmission->submitImplicitly(evt, canTriggerImplicitSubmissio n());
1264 1265
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
1952 void HTMLInputElement::ensurePrimaryContent() 1953 void HTMLInputElement::ensurePrimaryContent()
1953 { 1954 {
1954 m_inputTypeView->ensurePrimaryContent(); 1955 m_inputTypeView->ensurePrimaryContent();
1955 } 1956 }
1956 1957
1957 bool HTMLInputElement::hasFallbackContent() const 1958 bool HTMLInputElement::hasFallbackContent() const
1958 { 1959 {
1959 return m_inputTypeView->hasFallbackContent(); 1960 return m_inputTypeView->hasFallbackContent();
1960 } 1961 }
1961 } // namespace 1962 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698