Changeset 144974 in webkit
- Timestamp:
- Mar 6, 2013 1:25:35 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r144965 r144974 1 2013-03-06 Victor Costan <costan@gmail.com> 2 3 Cleanup in multipart FormData tests. 4 https://bugs.webkit.org/show_bug.cgi?id=111603 5 6 Reviewed by Alexey Proskuryakov. 7 8 * http/tests/local/formdata/resources/send-form-data-common.js: 9 (sendFormData): JavaScript style cleanup. 10 (testSendingFormData): JavaScript style, bugfix in checking if 11 eventSender.beginDragWithFiles needs to be called. 12 * http/tests/local/formdata/send-form-data-with-filename-expected.txt: Better test description. 13 * http/tests/local/formdata/send-form-data-with-filename.html: Better test description. 14 1 15 2013-03-06 Ryosuke Niwa <rniwa@webkit.org> 2 16 -
trunk/LayoutTests/http/tests/local/formdata/resources/send-form-data-common.js
r120165 r144974 29 29 var formData = new FormData(); 30 30 for (var i = 0; i < formDataList.length; i++) { 31 if (formDataList[i] ['filename'] != undefined)32 formData.append(formDataList[i] ['name'], formDataList[i]['value'], formDataList[i]['filename']);31 if (formDataList[i].filename !== undefined) 32 formData.append(formDataList[i].name, formDataList[i].value, formDataList[i].filename); 33 33 else 34 formData.append(formDataList[i] ['name'], formDataList[i]['value']);34 formData.append(formDataList[i].name, formDataList[i].value); 35 35 } 36 36 … … 50 50 var filesToDrag = []; 51 51 for (var i = 0; i < dataList.length; i++) { 52 if (dataList[i] ['type']== 'file')53 filesToDrag.push(dataList[i] ['value']);52 if (dataList[i].type === 'file') 53 filesToDrag.push(dataList[i].value); 54 54 } 55 55 56 if (filesToDrag ) {56 if (filesToDrag.length !== 0) { 57 57 eventSender.beginDragWithFiles(filesToDrag); 58 58 moveMouseToCenterOfElement(fileInput); … … 64 64 var fileSliced = false; 65 65 for (var i = 0; i < dataList.length; i++) { 66 if (dataList[i]['type'] == 'file') { 67 var fileName = getFileName(dataList[i]['value']); 66 var field = {name: dataList[i].name}; 67 if (dataList[i].type === 'file') { 68 var fileName = getFileName(dataList[i].value); 68 69 for (var j = 0; j < files.length; j++) { 69 70 if (fileName == files[j].name) { 70 71 var file = files[j]; 71 if ( dataList[i]['start'] && dataList[i]['length']) {72 if ('start' in dataList[i] && 'length' in dataList[i]) { 72 73 fileSliced = true; 73 file = file.slice(dataList[i] ['start'], dataList[i]['start'] + dataList[i]['length']);74 file = file.slice(dataList[i].start, dataList[i].start + dataList[i].length); 74 75 } 75 f ormDataList.push({'name': dataList[i]['name'], 'value': file, 'filename': dataList[i]['filename']});76 field.value = file; 76 77 break; 77 78 } 78 79 } 79 } else {80 formDataList.push({'name': dataList[i]['name'], 'value': dataList[i]['value']});81 80 } 81 else 82 field.value = dataList[i].value; 83 if (dataList[i]['filename']) 84 field.filename = dataList[i].filename; 85 86 formDataList.push(field); 82 87 } 83 88 -
trunk/LayoutTests/http/tests/local/formdata/send-form-data-with-filename-expected.txt
r144677 r144974 1 Test for sending FormData via XMLHttpRequest.1 Test that filename passed to FormData.append() takes precedence over filename in File. 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -
trunk/LayoutTests/http/tests/local/formdata/send-form-data-with-filename.html
r144677 r144974 9 9 <script src="resources/send-form-data-common.js"></script> 10 10 <script> 11 description("Test for sending FormData via XMLHttpRequest.");11 description("Test that filename passed to FormData.append() takes precedence over filename in File."); 12 12 13 13 function runTest() -
trunk/Source/WebCore/ChangeLog
r144972 r144974 1 2013-03-06 Victor Costan <costan@gmail.com> 2 3 Cleanup in multipart FormData sending code. 4 https://bugs.webkit.org/show_bug.cgi?id=111603 5 6 Reviewed by Alexey Proskuryakov. 7 8 No new tests. This is cleanup. 9 10 * platform/network/FormDataBuilder.cpp: 11 (WebCore::appendQuotedString): use proper types (e.g, size_t instead of 12 unsigned long) 13 1 14 2013-03-06 Tony Gentilcore <tonyg@chromium.org> 2 15 -
trunk/Source/WebCore/platform/network/FormDataBuilder.cpp
r98896 r144974 60 60 // FIXME: Is it correct to use percent escaping here? Other browsers do not encode these characters yet, 61 61 // so we should test popular servers to find out if there is an encoding form they can handle. 62 unsignedlength = string.length();63 for ( unsignedi = 0; i < length; ++i) {64 unsignedchar c = string.data()[i];62 size_t length = string.length(); 63 for (size_t i = 0; i < length; ++i) { 64 char c = string.data()[i]; 65 65 66 66 switch (c) {
Note: See TracChangeset
for help on using the changeset viewer.