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

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

Issue 1529373002: Fix a crash by search event handler for <input type=search incremental>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 19 matching lines...) Expand all
30 #include "core/html/HTMLInputElement.h" 30 #include "core/html/HTMLInputElement.h"
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 "core/CSSPropertyNames.h" 35 #include "core/CSSPropertyNames.h"
36 #include "core/HTMLNames.h" 36 #include "core/HTMLNames.h"
37 #include "core/InputTypeNames.h" 37 #include "core/InputTypeNames.h"
38 #include "core/dom/AXObjectCache.h" 38 #include "core/dom/AXObjectCache.h"
39 #include "core/dom/Document.h" 39 #include "core/dom/Document.h"
40 #include "core/dom/ExecutionContextTask.h"
40 #include "core/dom/IdTargetObserver.h" 41 #include "core/dom/IdTargetObserver.h"
41 #include "core/dom/shadow/InsertionPoint.h" 42 #include "core/dom/shadow/InsertionPoint.h"
42 #include "core/dom/shadow/ShadowRoot.h" 43 #include "core/dom/shadow/ShadowRoot.h"
43 #include "core/editing/FrameSelection.h" 44 #include "core/editing/FrameSelection.h"
44 #include "core/editing/spellcheck/SpellChecker.h" 45 #include "core/editing/spellcheck/SpellChecker.h"
45 #include "core/events/BeforeTextInsertedEvent.h" 46 #include "core/events/BeforeTextInsertedEvent.h"
46 #include "core/events/KeyboardEvent.h" 47 #include "core/events/KeyboardEvent.h"
47 #include "core/events/MouseEvent.h" 48 #include "core/events/MouseEvent.h"
48 #include "core/events/ScopedEventQueue.h" 49 #include "core/events/ScopedEventQueue.h"
49 #include "core/events/TouchEvent.h" 50 #include "core/events/TouchEvent.h"
(...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 1229
1229 if (evt->isKeyboardEvent() && evt->type() == EventTypeNames::keyup) { 1230 if (evt->isKeyboardEvent() && evt->type() == EventTypeNames::keyup) {
1230 m_inputTypeView->handleKeyupEvent(toKeyboardEvent(evt)); 1231 m_inputTypeView->handleKeyupEvent(toKeyboardEvent(evt));
1231 if (evt->defaultHandled()) 1232 if (evt->defaultHandled())
1232 return; 1233 return;
1233 } 1234 }
1234 1235
1235 if (m_inputTypeView->shouldSubmitImplicitly(evt)) { 1236 if (m_inputTypeView->shouldSubmitImplicitly(evt)) {
1236 // FIXME: Remove type check. 1237 // FIXME: Remove type check.
1237 if (type() == InputTypeNames::search) 1238 if (type() == InputTypeNames::search)
1238 onSearch(); 1239 document().postTask(BLINK_FROM_HERE, createSameThreadTask(&HTMLInput Element::onSearch, PassRefPtrWillBeRawPtr<HTMLInputElement>(this)));
1239 // Form submission finishes editing, just as loss of focus does. 1240 // Form submission finishes editing, just as loss of focus does.
1240 // If there was a change, send the event now. 1241 // If there was a change, send the event now.
1241 if (wasChangedSinceLastFormControlChangeEvent()) 1242 if (wasChangedSinceLastFormControlChangeEvent())
1242 dispatchFormControlChangeEvent(); 1243 dispatchFormControlChangeEvent();
1243 1244
1244 RefPtrWillBeRawPtr<HTMLFormElement> formForSubmission = m_inputTypeView- >formForSubmission(); 1245 RefPtrWillBeRawPtr<HTMLFormElement> formForSubmission = m_inputTypeView- >formForSubmission();
1245 // Form may never have been present, or may have been destroyed by code responding to the change event. 1246 // Form may never have been present, or may have been destroyed by code responding to the change event.
1246 if (formForSubmission) 1247 if (formForSubmission)
1247 formForSubmission->submitImplicitly(evt, canTriggerImplicitSubmissio n()); 1248 formForSubmission->submitImplicitly(evt, canTriggerImplicitSubmissio n());
1248 1249
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
1925 void HTMLInputElement::ensurePrimaryContent() 1926 void HTMLInputElement::ensurePrimaryContent()
1926 { 1927 {
1927 m_inputTypeView->ensurePrimaryContent(); 1928 m_inputTypeView->ensurePrimaryContent();
1928 } 1929 }
1929 1930
1930 bool HTMLInputElement::hasFallbackContent() const 1931 bool HTMLInputElement::hasFallbackContent() const
1931 { 1932 {
1932 return m_inputTypeView->hasFallbackContent(); 1933 return m_inputTypeView->hasFallbackContent();
1933 } 1934 }
1934 } // namespace 1935 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698