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

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

Issue 2104893005: UseCounter: Count usage of textarea[maxlength] and textarea[minlength] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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, 2008, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv ed.
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 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 23 matching lines...) Expand all
34 #include "core/dom/StyleChangeReason.h" 34 #include "core/dom/StyleChangeReason.h"
35 #include "core/dom/Text.h" 35 #include "core/dom/Text.h"
36 #include "core/dom/shadow/ShadowRoot.h" 36 #include "core/dom/shadow/ShadowRoot.h"
37 #include "core/editing/FrameSelection.h" 37 #include "core/editing/FrameSelection.h"
38 #include "core/editing/iterators/TextIterator.h" 38 #include "core/editing/iterators/TextIterator.h"
39 #include "core/editing/spellcheck/SpellChecker.h" 39 #include "core/editing/spellcheck/SpellChecker.h"
40 #include "core/events/BeforeTextInsertedEvent.h" 40 #include "core/events/BeforeTextInsertedEvent.h"
41 #include "core/events/Event.h" 41 #include "core/events/Event.h"
42 #include "core/frame/FrameHost.h" 42 #include "core/frame/FrameHost.h"
43 #include "core/frame/LocalFrame.h" 43 #include "core/frame/LocalFrame.h"
44 #include "core/frame/UseCounter.h"
44 #include "core/html/FormData.h" 45 #include "core/html/FormData.h"
45 #include "core/html/forms/FormController.h" 46 #include "core/html/forms/FormController.h"
46 #include "core/html/parser/HTMLParserIdioms.h" 47 #include "core/html/parser/HTMLParserIdioms.h"
47 #include "core/html/shadow/ShadowElementNames.h" 48 #include "core/html/shadow/ShadowElementNames.h"
48 #include "core/html/shadow/TextControlInnerElements.h" 49 #include "core/html/shadow/TextControlInnerElements.h"
49 #include "core/layout/LayoutTextControlMultiLine.h" 50 #include "core/layout/LayoutTextControlMultiLine.h"
50 #include "core/page/ChromeClient.h" 51 #include "core/page/ChromeClient.h"
51 #include "platform/text/PlatformLocale.h" 52 #include "platform/text/PlatformLocale.h"
52 #include "wtf/StdLibExtras.h" 53 #include "wtf/StdLibExtras.h"
53 #include "wtf/text/StringBuilder.h" 54 #include "wtf/text/StringBuilder.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 else 186 else
186 wrap = SoftWrap; 187 wrap = SoftWrap;
187 if (wrap != m_wrap) { 188 if (wrap != m_wrap) {
188 m_wrap = wrap; 189 m_wrap = wrap;
189 if (LayoutObject* layoutObject = this->layoutObject()) 190 if (LayoutObject* layoutObject = this->layoutObject())
190 layoutObject->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInval idation(LayoutInvalidationReason::AttributeChanged); 191 layoutObject->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInval idation(LayoutInvalidationReason::AttributeChanged);
191 } 192 }
192 } else if (name == accesskeyAttr) { 193 } else if (name == accesskeyAttr) {
193 // ignore for the moment 194 // ignore for the moment
194 } else if (name == maxlengthAttr) { 195 } else if (name == maxlengthAttr) {
196 UseCounter::count(document(), UseCounter::TextAreaMaxLength);
195 setNeedsValidityCheck(); 197 setNeedsValidityCheck();
196 } else if (name == minlengthAttr) { 198 } else if (name == minlengthAttr) {
199 UseCounter::count(document(), UseCounter::TextAreaMinLength);
197 setNeedsValidityCheck(); 200 setNeedsValidityCheck();
198 } else { 201 } else {
199 HTMLTextFormControlElement::parseAttribute(name, oldValue, value); 202 HTMLTextFormControlElement::parseAttribute(name, oldValue, value);
200 } 203 }
201 } 204 }
202 205
203 LayoutObject* HTMLTextAreaElement::createLayoutObject(const ComputedStyle&) 206 LayoutObject* HTMLTextAreaElement::createLayoutObject(const ComputedStyle&)
204 { 207 {
205 return new LayoutTextControlMultiLine(this); 208 return new LayoutTextControlMultiLine(this);
206 } 209 }
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 673
671 void HTMLTextAreaElement::copyNonAttributePropertiesFromElement(const Element& s ource) 674 void HTMLTextAreaElement::copyNonAttributePropertiesFromElement(const Element& s ource)
672 { 675 {
673 const HTMLTextAreaElement& sourceElement = static_cast<const HTMLTextAreaEle ment&>(source); 676 const HTMLTextAreaElement& sourceElement = static_cast<const HTMLTextAreaEle ment&>(source);
674 setValueCommon(sourceElement.value(), DispatchNoEvent, SetSeletion); 677 setValueCommon(sourceElement.value(), DispatchNoEvent, SetSeletion);
675 m_isDirty = sourceElement.m_isDirty; 678 m_isDirty = sourceElement.m_isDirty;
676 HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(source); 679 HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(source);
677 } 680 }
678 681
679 } // namespace blink 682 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698