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

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

Issue 267713006: node.cloneNode() should clone the value of file upload elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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, 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 891 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 } 902 }
903 903
904 void HTMLInputElement::copyNonAttributePropertiesFromElement(const Element& sour ce) 904 void HTMLInputElement::copyNonAttributePropertiesFromElement(const Element& sour ce)
905 { 905 {
906 const HTMLInputElement& sourceElement = static_cast<const HTMLInputElement&> (source); 906 const HTMLInputElement& sourceElement = static_cast<const HTMLInputElement&> (source);
907 907
908 m_valueIfDirty = sourceElement.m_valueIfDirty; 908 m_valueIfDirty = sourceElement.m_valueIfDirty;
909 setChecked(sourceElement.m_isChecked); 909 setChecked(sourceElement.m_isChecked);
910 m_reflectsCheckedAttribute = sourceElement.m_reflectsCheckedAttribute; 910 m_reflectsCheckedAttribute = sourceElement.m_reflectsCheckedAttribute;
911 m_isIndeterminate = sourceElement.m_isIndeterminate; 911 m_isIndeterminate = sourceElement.m_isIndeterminate;
912 if (isFileUpload())
913 setFiles(sourceElement.files());
Inactive 2014/05/06 13:33:58 Isn't it a problem that we are not actually clonin
gnana 2014/05/07 12:39:46 yes. I have modified to clone filelist. Done.
912 914
913 HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(source); 915 HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(source);
914 916
915 m_needsToUpdateViewValue = true; 917 m_needsToUpdateViewValue = true;
916 m_inputTypeView->updateView(); 918 m_inputTypeView->updateView();
917 } 919 }
918 920
919 String HTMLInputElement::value() const 921 String HTMLInputElement::value() const
920 { 922 {
921 String value; 923 String value;
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 exceptionState.throwDOMException(IndexSizeError, "The value provided is 0, which is an invalid size."); 1314 exceptionState.throwDOMException(IndexSizeError, "The value provided is 0, which is an invalid size.");
1313 else 1315 else
1314 setSize(size); 1316 setSize(size);
1315 } 1317 }
1316 1318
1317 KURL HTMLInputElement::src() const 1319 KURL HTMLInputElement::src() const
1318 { 1320 {
1319 return document().completeURL(fastGetAttribute(srcAttr)); 1321 return document().completeURL(fastGetAttribute(srcAttr));
1320 } 1322 }
1321 1323
1322 FileList* HTMLInputElement::files() 1324 FileList* HTMLInputElement::files() const
1323 { 1325 {
1324 return m_inputType->files(); 1326 return m_inputType->files();
1325 } 1327 }
1326 1328
1327 void HTMLInputElement::setFiles(PassRefPtrWillBeRawPtr<FileList> files) 1329 void HTMLInputElement::setFiles(PassRefPtrWillBeRawPtr<FileList> files)
1328 { 1330 {
1329 m_inputType->setFiles(files); 1331 m_inputType->setFiles(files);
1330 } 1332 }
1331 1333
1332 bool HTMLInputElement::receiveDroppedFiles(const DragData* dragData) 1334 bool HTMLInputElement::receiveDroppedFiles(const DragData* dragData)
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
1876 } 1878 }
1877 1879
1878 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) 1880 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
1879 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() 1881 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer()
1880 { 1882 {
1881 return m_inputTypeView->customStyleForRenderer(originalStyleForRenderer()); 1883 return m_inputTypeView->customStyleForRenderer(originalStyleForRenderer());
1882 } 1884 }
1883 #endif 1885 #endif
1884 1886
1885 } // namespace 1887 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698