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

Side by Side Diff: Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.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: Updated to latest master and updated test 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 382
383 // If a field element has focus, set focus back to the <input> itself before 383 // If a field element has focus, set focus back to the <input> itself before
384 // deleting the field. This prevents unnecessary focusout/blur events. 384 // deleting the field. This prevents unnecessary focusout/blur events.
385 if (containsFocusedShadowElement()) 385 if (containsFocusedShadowElement())
386 element().focus(); 386 element().focus();
387 387
388 BaseDateAndTimeInputType::destroyShadowSubtree(); 388 BaseDateAndTimeInputType::destroyShadowSubtree();
389 m_isDestroyingShadowSubtree = false; 389 m_isDestroyingShadowSubtree = false;
390 } 390 }
391 391
392 void BaseMultipleFieldsDateAndTimeInputType::handleFocusEvent(Element* oldFocuse dElement, FocusType type) 392 void BaseMultipleFieldsDateAndTimeInputType::handleFocusInEvent(Element* oldFocu sedElement, FocusType type)
393 { 393 {
394 DateTimeEditElement* edit = dateTimeEditElement(); 394 DateTimeEditElement* edit = dateTimeEditElement();
395 if (!edit || m_isDestroyingShadowSubtree) 395 if (!edit || m_isDestroyingShadowSubtree)
396 return; 396 return;
397 if (type == FocusTypeBackward) { 397 if (type == FocusTypeBackward) {
398 if (element().document().page()) 398 if (element().document().page())
399 element().document().page()->focusController().advanceFocus(type); 399 element().document().page()->focusController().advanceFocus(type);
400 } else if (type == FocusTypeNone || type == FocusTypeMouse || type == FocusT ypePage) { 400 } else if (type == FocusTypeNone || type == FocusTypeMouse || type == FocusT ypePage) {
401 edit->focusByOwner(oldFocusedElement); 401 edit->focusByOwner(oldFocusedElement);
402 } else { 402 } else {
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 AXObject* BaseMultipleFieldsDateAndTimeInputType::popupRootAXObject() 628 AXObject* BaseMultipleFieldsDateAndTimeInputType::popupRootAXObject()
629 { 629 {
630 if (PickerIndicatorElement* picker = pickerIndicatorElement()) 630 if (PickerIndicatorElement* picker = pickerIndicatorElement())
631 return picker->popupRootAXObject(); 631 return picker->popupRootAXObject();
632 return 0; 632 return 0;
633 } 633 }
634 634
635 } // namespace blink 635 } // namespace blink
636 636
637 #endif 637 #endif
OLDNEW
« no previous file with comments | « Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h ('k') | Source/core/html/forms/InputTypeView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698