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

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

Issue 14070021: Rename 'UseCounter::observe' to 'UseCounter::count'. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaseline. Created 7 years, 8 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 | Annotate | Revision Log
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 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 // Search field and slider attributes all just cause updateFromElement t o be called through style recalcing. 662 // Search field and slider attributes all just cause updateFromElement t o be called through style recalcing.
663 setAttributeEventListener(eventNames().searchEvent, createAttributeEvent Listener(this, name, value)); 663 setAttributeEventListener(eventNames().searchEvent, createAttributeEvent Listener(this, name, value));
664 } else if (name == resultsAttr) { 664 } else if (name == resultsAttr) {
665 int oldResults = m_maxResults; 665 int oldResults = m_maxResults;
666 m_maxResults = !value.isNull() ? std::min(value.toInt(), maxSavedResults ) : -1; 666 m_maxResults = !value.isNull() ? std::min(value.toInt(), maxSavedResults ) : -1;
667 // FIXME: Detaching just for maxResults change is not ideal. We should figure out the right 667 // FIXME: Detaching just for maxResults change is not ideal. We should figure out the right
668 // time to relayout for this change. 668 // time to relayout for this change.
669 if (m_maxResults != oldResults && (m_maxResults <= 0 || oldResults <= 0) ) 669 if (m_maxResults != oldResults && (m_maxResults <= 0 || oldResults <= 0) )
670 reattachIfAttached(); 670 reattachIfAttached();
671 setNeedsStyleRecalc(); 671 setNeedsStyleRecalc();
672 UseCounter::observe(document(), UseCounter::ResultsAttribute); 672 UseCounter::count(document(), UseCounter::ResultsAttribute);
673 } else if (name == autosaveAttr) { 673 } else if (name == autosaveAttr) {
674 setNeedsStyleRecalc(); 674 setNeedsStyleRecalc();
675 UseCounter::observe(document(), UseCounter::AutoSaveAttribute); 675 UseCounter::count(document(), UseCounter::AutoSaveAttribute);
676 } else if (name == incrementalAttr) { 676 } else if (name == incrementalAttr) {
677 setNeedsStyleRecalc(); 677 setNeedsStyleRecalc();
678 UseCounter::observe(document(), UseCounter::IncrementalAttribute); 678 UseCounter::count(document(), UseCounter::IncrementalAttribute);
679 } else if (name == minAttr) { 679 } else if (name == minAttr) {
680 m_inputType->minOrMaxAttributeChanged(); 680 m_inputType->minOrMaxAttributeChanged();
681 setNeedsValidityCheck(); 681 setNeedsValidityCheck();
682 UseCounter::observe(document(), UseCounter::MinAttribute); 682 UseCounter::count(document(), UseCounter::MinAttribute);
683 } else if (name == maxAttr) { 683 } else if (name == maxAttr) {
684 m_inputType->minOrMaxAttributeChanged(); 684 m_inputType->minOrMaxAttributeChanged();
685 setNeedsValidityCheck(); 685 setNeedsValidityCheck();
686 UseCounter::observe(document(), UseCounter::MaxAttribute); 686 UseCounter::count(document(), UseCounter::MaxAttribute);
687 } else if (name == multipleAttr) { 687 } else if (name == multipleAttr) {
688 m_inputType->multipleAttributeChanged(); 688 m_inputType->multipleAttributeChanged();
689 setNeedsValidityCheck(); 689 setNeedsValidityCheck();
690 } else if (name == stepAttr) { 690 } else if (name == stepAttr) {
691 m_inputType->stepAttributeChanged(); 691 m_inputType->stepAttributeChanged();
692 setNeedsValidityCheck(); 692 setNeedsValidityCheck();
693 UseCounter::observe(document(), UseCounter::StepAttribute); 693 UseCounter::count(document(), UseCounter::StepAttribute);
694 } else if (name == patternAttr) { 694 } else if (name == patternAttr) {
695 setNeedsValidityCheck(); 695 setNeedsValidityCheck();
696 UseCounter::observe(document(), UseCounter::PatternAttribute); 696 UseCounter::count(document(), UseCounter::PatternAttribute);
697 } else if (name == precisionAttr) { 697 } else if (name == precisionAttr) {
698 setNeedsValidityCheck(); 698 setNeedsValidityCheck();
699 UseCounter::observe(document(), UseCounter::PrecisionAttribute); 699 UseCounter::count(document(), UseCounter::PrecisionAttribute);
700 } else if (name == disabledAttr) { 700 } else if (name == disabledAttr) {
701 HTMLTextFormControlElement::parseAttribute(name, value); 701 HTMLTextFormControlElement::parseAttribute(name, value);
702 m_inputType->disabledAttributeChanged(); 702 m_inputType->disabledAttributeChanged();
703 } else if (name == readonlyAttr) { 703 } else if (name == readonlyAttr) {
704 HTMLTextFormControlElement::parseAttribute(name, value); 704 HTMLTextFormControlElement::parseAttribute(name, value);
705 m_inputType->readonlyAttributeChanged(); 705 m_inputType->readonlyAttributeChanged();
706 } 706 }
707 #if ENABLE(DATALIST_ELEMENT) 707 #if ENABLE(DATALIST_ELEMENT)
708 else if (name == listAttr) { 708 else if (name == listAttr) {
709 m_hasNonEmptyList = !value.isEmpty(); 709 m_hasNonEmptyList = !value.isEmpty();
710 if (m_hasNonEmptyList) { 710 if (m_hasNonEmptyList) {
711 resetListAttributeTargetObserver(); 711 resetListAttributeTargetObserver();
712 listAttributeTargetChanged(); 712 listAttributeTargetChanged();
713 } 713 }
714 UseCounter::observe(document(), UseCounter::ListAttribute); 714 UseCounter::count(document(), UseCounter::ListAttribute);
715 } 715 }
716 #endif 716 #endif
717 #if ENABLE(INPUT_SPEECH) 717 #if ENABLE(INPUT_SPEECH)
718 else if (name == webkitspeechAttr) { 718 else if (name == webkitspeechAttr) {
719 if (renderer()) { 719 if (renderer()) {
720 // This renderer and its children have quite different layouts and s tyles depending on 720 // This renderer and its children have quite different layouts and s tyles depending on
721 // whether the speech button is visible or not. So we reset the whol e thing and recreate 721 // whether the speech button is visible or not. So we reset the whol e thing and recreate
722 // to get the right styles and layout. 722 // to get the right styles and layout.
723 detach(); 723 detach();
724 m_inputType->destroyShadowSubtree(); 724 m_inputType->destroyShadowSubtree();
725 m_inputType->createShadowSubtree(); 725 m_inputType->createShadowSubtree();
726 if (!attached()) 726 if (!attached())
727 attach(); 727 attach();
728 } else { 728 } else {
729 m_inputType->destroyShadowSubtree(); 729 m_inputType->destroyShadowSubtree();
730 m_inputType->createShadowSubtree(); 730 m_inputType->createShadowSubtree();
731 } 731 }
732 setFormControlValueMatchesRenderer(false); 732 setFormControlValueMatchesRenderer(false);
733 setNeedsStyleRecalc(); 733 setNeedsStyleRecalc();
734 UseCounter::observe(document(), UseCounter::PrefixedSpeechAttribute); 734 UseCounter::count(document(), UseCounter::PrefixedSpeechAttribute);
735 } else if (name == onwebkitspeechchangeAttr) 735 } else if (name == onwebkitspeechchangeAttr)
736 setAttributeEventListener(eventNames().webkitspeechchangeEvent, createAt tributeEventListener(this, name, value)); 736 setAttributeEventListener(eventNames().webkitspeechchangeEvent, createAt tributeEventListener(this, name, value));
737 #endif 737 #endif
738 else if (name == webkitdirectoryAttr) { 738 else if (name == webkitdirectoryAttr) {
739 HTMLTextFormControlElement::parseAttribute(name, value); 739 HTMLTextFormControlElement::parseAttribute(name, value);
740 UseCounter::observe(document(), UseCounter::PrefixedDirectoryAttribute); 740 UseCounter::count(document(), UseCounter::PrefixedDirectoryAttribute);
741 } 741 }
742 else 742 else
743 HTMLTextFormControlElement::parseAttribute(name, value); 743 HTMLTextFormControlElement::parseAttribute(name, value);
744 m_inputType->attributeChanged(); 744 m_inputType->attributeChanged();
745 } 745 }
746 746
747 void HTMLInputElement::finishParsingChildren() 747 void HTMLInputElement::finishParsingChildren()
748 { 748 {
749 m_parsingInProgress = false; 749 m_parsingInProgress = false;
750 HTMLTextFormControlElement::finishParsingChildren(); 750 HTMLTextFormControlElement::finishParsingChildren();
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1894 } 1894 }
1895 1895
1896 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) 1896 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
1897 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() 1897 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer()
1898 { 1898 {
1899 return m_inputType->customStyleForRenderer(document()->styleResolver()->styl eForElement(this)); 1899 return m_inputType->customStyleForRenderer(document()->styleResolver()->styl eForElement(this));
1900 } 1900 }
1901 #endif 1901 #endif
1902 1902
1903 } // namespace 1903 } // namespace
OLDNEW
« no previous file with comments | « Source/core/html/HTMLFormControlElement.cpp ('k') | Source/core/html/HTMLTextFormControlElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698