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

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

Issue 2623513005: Introduce Element::AttributeModificationParams (Closed)
Patch Set: Created 3 years, 11 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 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights
6 * reserved. 6 * reserved.
7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
8 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 8 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 CSSValuePre); 140 CSSValuePre);
141 addPropertyToPresentationAttributeStyle(style, CSSPropertyWordWrap, 141 addPropertyToPresentationAttributeStyle(style, CSSPropertyWordWrap,
142 CSSValueNormal); 142 CSSValueNormal);
143 } 143 }
144 } else { 144 } else {
145 TextControlElement::collectStyleForPresentationAttribute(name, value, 145 TextControlElement::collectStyleForPresentationAttribute(name, value,
146 style); 146 style);
147 } 147 }
148 } 148 }
149 149
150 void HTMLTextAreaElement::parseAttribute(const QualifiedName& name, 150 void HTMLTextAreaElement::parseAttribute(
151 const AtomicString& oldValue, 151 const AttributeModificationParams& params) {
152 const AtomicString& value) { 152 const QualifiedName& name = params.name;
153 const AtomicString& value = params.newValue;
153 if (name == rowsAttr) { 154 if (name == rowsAttr) {
154 unsigned rows = 0; 155 unsigned rows = 0;
155 if (value.isEmpty() || !parseHTMLNonNegativeInteger(value, rows) || 156 if (value.isEmpty() || !parseHTMLNonNegativeInteger(value, rows) ||
156 rows <= 0) 157 rows <= 0)
157 rows = defaultRows; 158 rows = defaultRows;
158 if (m_rows != rows) { 159 if (m_rows != rows) {
159 m_rows = rows; 160 m_rows = rows;
160 if (layoutObject()) 161 if (layoutObject())
161 layoutObject() 162 layoutObject()
162 ->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation( 163 ->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(
(...skipping 30 matching lines...) Expand all
193 } 194 }
194 } else if (name == accesskeyAttr) { 195 } else if (name == accesskeyAttr) {
195 // ignore for the moment 196 // ignore for the moment
196 } else if (name == maxlengthAttr) { 197 } else if (name == maxlengthAttr) {
197 UseCounter::count(document(), UseCounter::TextAreaMaxLength); 198 UseCounter::count(document(), UseCounter::TextAreaMaxLength);
198 setNeedsValidityCheck(); 199 setNeedsValidityCheck();
199 } else if (name == minlengthAttr) { 200 } else if (name == minlengthAttr) {
200 UseCounter::count(document(), UseCounter::TextAreaMinLength); 201 UseCounter::count(document(), UseCounter::TextAreaMinLength);
201 setNeedsValidityCheck(); 202 setNeedsValidityCheck();
202 } else { 203 } else {
203 TextControlElement::parseAttribute(name, oldValue, value); 204 TextControlElement::parseAttribute(params);
204 } 205 }
205 } 206 }
206 207
207 LayoutObject* HTMLTextAreaElement::createLayoutObject(const ComputedStyle&) { 208 LayoutObject* HTMLTextAreaElement::createLayoutObject(const ComputedStyle&) {
208 return new LayoutTextControlMultiLine(this); 209 return new LayoutTextControlMultiLine(this);
209 } 210 }
210 211
211 void HTMLTextAreaElement::appendToFormData(FormData& formData) { 212 void HTMLTextAreaElement::appendToFormData(FormData& formData) {
212 if (name().isEmpty()) 213 if (name().isEmpty())
213 return; 214 return;
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 void HTMLTextAreaElement::copyNonAttributePropertiesFromElement( 641 void HTMLTextAreaElement::copyNonAttributePropertiesFromElement(
641 const Element& source) { 642 const Element& source) {
642 const HTMLTextAreaElement& sourceElement = 643 const HTMLTextAreaElement& sourceElement =
643 static_cast<const HTMLTextAreaElement&>(source); 644 static_cast<const HTMLTextAreaElement&>(source);
644 setValueCommon(sourceElement.value(), DispatchNoEvent, SetSeletion); 645 setValueCommon(sourceElement.value(), DispatchNoEvent, SetSeletion);
645 m_isDirty = sourceElement.m_isDirty; 646 m_isDirty = sourceElement.m_isDirty;
646 TextControlElement::copyNonAttributePropertiesFromElement(source); 647 TextControlElement::copyNonAttributePropertiesFromElement(source);
647 } 648 }
648 649
649 } // namespace blink 650 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLTextAreaElement.h ('k') | third_party/WebKit/Source/core/html/HTMLTrackElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698