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

Side by Side Diff: Source/core/html/HTMLTextFormControlElement.cpp

Issue 541993003: Generate focusin for input type=date/time when selected by tab (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added handleFocusInEvent handler for handling focus event for date/time input type Created 6 years, 3 months 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 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 88 }
89 89
90 void HTMLTextFormControlElement::dispatchBlurEvent(Element* newFocusedElement) 90 void HTMLTextFormControlElement::dispatchBlurEvent(Element* newFocusedElement)
91 { 91 {
92 if (supportsPlaceholder()) 92 if (supportsPlaceholder())
93 updatePlaceholderVisibility(false); 93 updatePlaceholderVisibility(false);
94 handleBlurEvent(); 94 handleBlurEvent();
95 HTMLFormControlElementWithState::dispatchBlurEvent(newFocusedElement); 95 HTMLFormControlElementWithState::dispatchBlurEvent(newFocusedElement);
96 } 96 }
97 97
98 void HTMLTextFormControlElement::dispatchFocusInEvent(const AtomicString& eventT ype, Element* oldFocusedElement, FocusType type)
tkent 2014/09/09 23:00:08 This function should be moved to HTMLInputElement.
Habib Virji 2014/09/10 10:00:47 Done.
99 {
100 if (eventType == EventTypeNames::DOMFocusIn)
101 handleFocusInEvent(oldFocusedElement, type);
tkent 2014/09/09 23:00:07 Move this function to HTMLInputElmenet, and this l
Habib Virji 2014/09/10 10:00:48 Was already part of patch#2.
tkent 2014/09/10 23:47:10 You misunderstood my comment.
Habib Virji 2014/09/11 09:12:22 Done.
102 HTMLFormControlElementWithState::dispatchFocusInEvent(eventType, oldFocusedE lement, type);
103 }
104
98 void HTMLTextFormControlElement::defaultEventHandler(Event* event) 105 void HTMLTextFormControlElement::defaultEventHandler(Event* event)
99 { 106 {
100 if (event->type() == EventTypeNames::webkitEditableContentChanged && rendere r() && renderer()->isTextControl()) { 107 if (event->type() == EventTypeNames::webkitEditableContentChanged && rendere r() && renderer()->isTextControl()) {
101 m_lastChangeWasUserEdit = true; 108 m_lastChangeWasUserEdit = true;
102 subtreeHasChanged(); 109 subtreeHasChanged();
103 return; 110 return;
104 } 111 }
105 112
106 HTMLFormControlElementWithState::defaultEventHandler(event); 113 HTMLFormControlElementWithState::defaultEventHandler(event);
107 } 114 }
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 Text* textNode = toText(node); 965 Text* textNode = toText(node);
959 size_t firstLineBreak = textNode->data().find('\n', isPivotNode ? pi votPosition.offsetInContainerNode() : 0); 966 size_t firstLineBreak = textNode->data().find('\n', isPivotNode ? pi votPosition.offsetInContainerNode() : 0);
960 if (firstLineBreak != kNotFound) 967 if (firstLineBreak != kNotFound)
961 return Position(textNode, firstLineBreak + 1); 968 return Position(textNode, firstLineBreak + 1);
962 } 969 }
963 } 970 }
964 return endOfInnerText(textFormControl); 971 return endOfInnerText(textFormControl);
965 } 972 }
966 973
967 } // namespace Webcore 974 } // namespace Webcore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTextFormControlElement.h ('k') | Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698