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

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

Issue 2678683002: Delay instantiating InputDeviceCapabilities until accessed. (Closed)
Patch Set: rebased Created 3 years, 10 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 return false; 364 return false;
365 } 365 }
366 366
367 bool HTMLFormControlElement::shouldHaveFocusAppearance() const { 367 bool HTMLFormControlElement::shouldHaveFocusAppearance() const {
368 return !m_wasFocusedByMouse || shouldShowFocusRingOnMouseFocus(); 368 return !m_wasFocusedByMouse || shouldShowFocusRingOnMouseFocus();
369 } 369 }
370 370
371 void HTMLFormControlElement::dispatchFocusEvent( 371 void HTMLFormControlElement::dispatchFocusEvent(
372 Element* oldFocusedElement, 372 Element* oldFocusedElement,
373 WebFocusType type, 373 WebFocusType type,
374 InputDeviceCapabilities* sourceCapabilities) { 374 const InputDeviceCapabilitiesValue& sourceCapabilities) {
375 if (type != WebFocusTypePage) 375 if (type != WebFocusTypePage)
376 m_wasFocusedByMouse = type == WebFocusTypeMouse; 376 m_wasFocusedByMouse = type == WebFocusTypeMouse;
377 // ContainerNode::handleStyleChangeOnFocusStateChange() will inform 377 // ContainerNode::handleStyleChangeOnFocusStateChange() will inform
378 // LayoutTheme about the focus state change. 378 // LayoutTheme about the focus state change.
379 HTMLElement::dispatchFocusEvent(oldFocusedElement, type, sourceCapabilities); 379 HTMLElement::dispatchFocusEvent(oldFocusedElement, type, sourceCapabilities);
380 } 380 }
381 381
382 void HTMLFormControlElement::willCallDefaultEventHandler(const Event& event) { 382 void HTMLFormControlElement::willCallDefaultEventHandler(const Event& event) {
383 if (!m_wasFocusedByMouse) 383 if (!m_wasFocusedByMouse)
384 return; 384 return;
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 } 595 }
596 596
597 void HTMLFormControlElement::setCustomValidity(const String& error) { 597 void HTMLFormControlElement::setCustomValidity(const String& error) {
598 ListedElement::setCustomValidity(error); 598 ListedElement::setCustomValidity(error);
599 setNeedsValidityCheck(); 599 setNeedsValidityCheck();
600 } 600 }
601 601
602 void HTMLFormControlElement::dispatchBlurEvent( 602 void HTMLFormControlElement::dispatchBlurEvent(
603 Element* newFocusedElement, 603 Element* newFocusedElement,
604 WebFocusType type, 604 WebFocusType type,
605 InputDeviceCapabilities* sourceCapabilities) { 605 const InputDeviceCapabilitiesValue& sourceCapabilities) {
606 if (type != WebFocusTypePage) 606 if (type != WebFocusTypePage)
607 m_wasFocusedByMouse = false; 607 m_wasFocusedByMouse = false;
608 HTMLElement::dispatchBlurEvent(newFocusedElement, type, sourceCapabilities); 608 HTMLElement::dispatchBlurEvent(newFocusedElement, type, sourceCapabilities);
609 hideVisibleValidationMessage(); 609 hideVisibleValidationMessage();
610 } 610 }
611 611
612 bool HTMLFormControlElement::isSuccessfulSubmitButton() const { 612 bool HTMLFormControlElement::isSuccessfulSubmitButton() const {
613 return canBeSuccessfulSubmitButton() && !isDisabledFormControl(); 613 return canBeSuccessfulSubmitButton() && !isDisabledFormControl();
614 } 614 }
615 615
(...skipping 18 matching lines...) Expand all
634 const Element& source) { 634 const Element& source) {
635 HTMLElement::copyNonAttributePropertiesFromElement(source); 635 HTMLElement::copyNonAttributePropertiesFromElement(source);
636 setNeedsValidityCheck(); 636 setNeedsValidityCheck();
637 } 637 }
638 638
639 void HTMLFormControlElement::associateWith(HTMLFormElement* form) { 639 void HTMLFormControlElement::associateWith(HTMLFormElement* form) {
640 associateByParser(form); 640 associateByParser(form);
641 }; 641 };
642 642
643 } // namespace blink 643 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLFormControlElement.h ('k') | third_party/WebKit/Source/core/html/HTMLInputElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698