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

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

Issue 11571072: Revert 138189 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 8 years 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
« no previous file with comments | « Source/WebCore/dom/Document.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 // Need to remove form association while this is still an HTMLInputElement 157 // Need to remove form association while this is still an HTMLInputElement
158 // so that virtual functions are called correctly. 158 // so that virtual functions are called correctly.
159 setForm(0); 159 setForm(0);
160 // setForm(0) may register this to a document-level radio button group. 160 // setForm(0) may register this to a document-level radio button group.
161 // We should unregister it to avoid accessing a deleted object. 161 // We should unregister it to avoid accessing a deleted object.
162 if (isRadioButton()) 162 if (isRadioButton())
163 document()->formController()->checkedRadioButtons().removeButton(this); 163 document()->formController()->checkedRadioButtons().removeButton(this);
164 #if ENABLE(TOUCH_EVENTS) 164 #if ENABLE(TOUCH_EVENTS)
165 if (m_hasTouchEventHandler) 165 if (m_hasTouchEventHandler)
166 document()->didRemoveEventTargetNode(this); 166 document()->didRemoveTouchEventHandler(this);
167 #endif 167 #endif
168 } 168 }
169 169
170 const AtomicString& HTMLInputElement::name() const 170 const AtomicString& HTMLInputElement::name() const
171 { 171 {
172 return m_name.isNull() ? emptyAtom : m_name; 172 return m_name.isNull() ? emptyAtom : m_name;
173 } 173 }
174 174
175 Vector<FileChooserFileInfo> HTMLInputElement::filesFromFileInputFormControlState (const FormControlState& state) 175 Vector<FileChooserFileInfo> HTMLInputElement::filesFromFileInputFormControlState (const FormControlState& state)
176 { 176 {
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 bool neededSuspensionCallback = needsSuspensionCallback(); 481 bool neededSuspensionCallback = needsSuspensionCallback();
482 bool didRespectHeightAndWidth = m_inputType->shouldRespectHeightAndWidthAttr ibutes(); 482 bool didRespectHeightAndWidth = m_inputType->shouldRespectHeightAndWidthAttr ibutes();
483 483
484 m_inputType->destroyShadowSubtree(); 484 m_inputType->destroyShadowSubtree();
485 m_inputType = newType.release(); 485 m_inputType = newType.release();
486 m_inputType->createShadowSubtree(); 486 m_inputType->createShadowSubtree();
487 487
488 #if ENABLE(TOUCH_EVENTS) 488 #if ENABLE(TOUCH_EVENTS)
489 bool hasTouchEventHandler = m_inputType->hasTouchEventHandler(); 489 bool hasTouchEventHandler = m_inputType->hasTouchEventHandler();
490 if (hasTouchEventHandler != m_hasTouchEventHandler) { 490 if (hasTouchEventHandler != m_hasTouchEventHandler) {
491 if (hasTouchEventHandler) 491 if (hasTouchEventHandler)
492 document()->didAddTouchEventHandler(this); 492 document()->didAddTouchEventHandler(this);
493 else 493 else
494 document()->didRemoveTouchEventHandler(this); 494 document()->didRemoveTouchEventHandler(this);
495 m_hasTouchEventHandler = hasTouchEventHandler; 495 m_hasTouchEventHandler = hasTouchEventHandler;
496 } 496 }
497 #endif 497 #endif
498 498
499 setNeedsWillValidateCheck(); 499 setNeedsWillValidateCheck();
500 500
501 bool willStoreValue = m_inputType->storesValueSeparateFromAttribute(); 501 bool willStoreValue = m_inputType->storesValueSeparateFromAttribute();
502 502
503 if (didStoreValue && !willStoreValue && hasDirtyValue()) { 503 if (didStoreValue && !willStoreValue && hasDirtyValue()) {
504 setAttribute(valueAttr, m_valueIfDirty); 504 setAttribute(valueAttr, m_valueIfDirty);
505 m_valueIfDirty = String(); 505 m_valueIfDirty = String();
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after
1492 void HTMLInputElement::didMoveToNewDocument(Document* oldDocument) 1492 void HTMLInputElement::didMoveToNewDocument(Document* oldDocument)
1493 { 1493 {
1494 m_inputType->willMoveToNewOwnerDocument(); 1494 m_inputType->willMoveToNewOwnerDocument();
1495 bool needsSuspensionCallback = this->needsSuspensionCallback(); 1495 bool needsSuspensionCallback = this->needsSuspensionCallback();
1496 if (oldDocument) { 1496 if (oldDocument) {
1497 // Always unregister for cache callbacks when leaving a document, even i f we would otherwise like to be registered 1497 // Always unregister for cache callbacks when leaving a document, even i f we would otherwise like to be registered
1498 if (needsSuspensionCallback) 1498 if (needsSuspensionCallback)
1499 oldDocument->unregisterForPageCacheSuspensionCallbacks(this); 1499 oldDocument->unregisterForPageCacheSuspensionCallbacks(this);
1500 if (isRadioButton()) 1500 if (isRadioButton())
1501 oldDocument->formController()->checkedRadioButtons().removeButton(th is); 1501 oldDocument->formController()->checkedRadioButtons().removeButton(th is);
1502 #if ENABLE(TOUCH_EVENTS)
1503 if (m_hasTouchEventHandler)
1504 oldDocument->didRemoveEventTargetNode(this);
1505 #endif
1506 } 1502 }
1507 1503
1508 if (needsSuspensionCallback) 1504 if (needsSuspensionCallback)
1509 document()->registerForPageCacheSuspensionCallbacks(this); 1505 document()->registerForPageCacheSuspensionCallbacks(this);
1510 1506
1511 #if ENABLE(TOUCH_EVENTS)
1512 if (m_hasTouchEventHandler)
1513 document()->didAddTouchEventHandler(this);
1514 #endif
1515
1516 HTMLTextFormControlElement::didMoveToNewDocument(oldDocument); 1507 HTMLTextFormControlElement::didMoveToNewDocument(oldDocument);
1517 } 1508 }
1518 1509
1519 void HTMLInputElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) cons t 1510 void HTMLInputElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) cons t
1520 { 1511 {
1521 HTMLTextFormControlElement::addSubresourceAttributeURLs(urls); 1512 HTMLTextFormControlElement::addSubresourceAttributeURLs(urls);
1522 1513
1523 addSubresourceURL(urls, src()); 1514 addSubresourceURL(urls, src());
1524 } 1515 }
1525 1516
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
1930 info.addMember(m_name); 1921 info.addMember(m_name);
1931 info.addMember(m_valueIfDirty); 1922 info.addMember(m_valueIfDirty);
1932 info.addMember(m_suggestedValue); 1923 info.addMember(m_suggestedValue);
1933 info.addMember(m_inputType); 1924 info.addMember(m_inputType);
1934 #if ENABLE(DATALIST_ELEMENT) 1925 #if ENABLE(DATALIST_ELEMENT)
1935 info.addMember(m_listAttributeTargetObserver); 1926 info.addMember(m_listAttributeTargetObserver);
1936 #endif 1927 #endif
1937 } 1928 }
1938 1929
1939 } // namespace 1930 } // namespace
OLDNEW
« no previous file with comments | « Source/WebCore/dom/Document.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698