Rename NATIVE_TYPE_ERR to TypeError
https://bugs.webkit.org/show_bug.cgi?id=102114

Reviewed by Kentaro Hara.

Defines names (mostly) matching WebIDL exception types for use by dom (etc) code.
V8 binding code had colliding enum members, which required prefixing.

No new tests - just internal renames.

* Modules/indexeddb/IDBCursor.cpp: s/NATIVE_TYPE_ERR/TypeError/g
(WebCore::IDBCursor::advance):
(WebCore::IDBCursor::stringToDirection):
(WebCore::IDBCursor::directionToString):
* Modules/indexeddb/IDBDatabase.cpp: Ditto.
(WebCore::IDBDatabase::setVersion):
* Modules/indexeddb/IDBFactory.cpp: Ditto.
(WebCore::IDBFactory::open):
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/indexeddb/IDBObjectStore.cpp: Ditto.
(WebCore::IDBObjectStore::createIndex):
* Modules/indexeddb/IDBTransaction.cpp: Ditto.
(WebCore::IDBTransaction::stringToMode):
(WebCore::IDBTransaction::modeToString):
* bindings/js/JSDOMBinding.cpp: Ditto.
(WebCore::setDOMException):
* bindings/v8/DateExtension.cpp: Prefix ErrorType enum/members w/ V8/v8.
(WebCore::DateExtension::OnSleepDetected):
* bindings/v8/NPV8Object.cpp: Ditto.
(_NPN_SetException):
* bindings/v8/V8Binding.cpp: Ditto.
(WebCore::throwError):
(WebCore::handleMaxRecursionDepthExceeded):
* bindings/v8/V8Binding.h: Ditto.
(WebCore):
* bindings/v8/V8NPObject.cpp: Ditto.
(WebCore::npObjectInvokeImpl):
(WebCore::npObjectGetProperty):
(WebCore::npObjectSetProperty):
(WebCore::npObjectPropertyEnumerator):
* bindings/v8/V8ThrowException.cpp: Rename ALL the errors!
(WebCore::V8ThrowException::setDOMException):
(WebCore::V8ThrowException::throwError):
(WebCore::V8ThrowException::throwTypeError):
(WebCore::V8ThrowException::throwNotEnoughArgumentsError):
* bindings/v8/V8ThrowException.h:
(V8ThrowException):
* bindings/v8/WorkerContextExecutionProxy.cpp: Prefixing (continued)
(WebCore::WorkerContextExecutionProxy::evaluate):
* bindings/v8/custom/V8ArrayBufferCustom.cpp: Ditto.
(WebCore::V8ArrayBuffer::constructorCallback):
* bindings/v8/custom/V8ArrayBufferViewCustom.h: Ditto.
(WebCore::constructWebGLArrayWithArrayBufferArgument):
(WebCore::constructWebGLArray):
(WebCore::setWebGLArrayHelper):
* bindings/v8/custom/V8AudioContextCustom.cpp: Ditto.
(WebCore::V8AudioContext::constructorCallback):
* bindings/v8/custom/V8BlobCustom.cpp: Ditto.
(WebCore::V8Blob::constructorCallback):
* bindings/v8/custom/V8ClipboardCustom.cpp: Ditto.
(WebCore::V8Clipboard::clearDataCallback):
(WebCore::V8Clipboard::setDragImageCallback):
* bindings/v8/custom/V8DOMFormDataCustom.cpp: Ditto.
(WebCore::V8DOMFormData::appendCallback):
* bindings/v8/custom/V8SQLResultSetRowListCustom.cpp: Ditto.
(WebCore::V8SQLResultSetRowList::itemCallback):
* dom/ExceptionCode.h: Add WebIDL exception types.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134646 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PDFPlugin should support downloading PDFs
https://bugs.webkit.org/show_bug.cgi?id=102152
<rdar://problem/12555313>

Reviewed by Alexey Proskuryakov.

Clicking on the "Download PDF" HUD button should download the current
PDF to the Downloads folder.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::savePDFToFileInDownloadsFolder): Added. Save the
PDF data to disk, in the Downloads folder. This will only save files with
the .pdf extension, and of MIME type "application/pdf".
* UIProcess/WebPageProxy.h:
(WebPageProxy): Add savePDFToFileInDownloadsFolder.
* UIProcess/WebPageProxy.messages.in: Add savePDFToFileInDownloadsFolder.
* WebProcess/Plugins/PDF/PDFPlugin.h:
(PDFPlugin): Add saveToPDF().
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(-[WKPDFLayerControllerDelegate saveToPDF]): Forward saveToPDF delegate callback to PDFPlugin.
(WebKit::PDFPlugin::saveToPDF): Hand WebPageProxy the raw data for the
current PDF, which it will save to the Downloads folder. We receive
the suggested filename during loading.
* WebProcess/Plugins/PDF/SimplePDFPlugin.h:
(WebKit::SimplePDFPlugin::suggestedFilename): Expose a getter for suggestedFilename.
* WebProcess/Plugins/PDF/SimplePDFPlugin.mm:
(WebKit::SimplePDFPlugin::pluginInfo): Add a missing space after an operator.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update DOMException name: InvalidStateError
https://bugs.webkit.org/show_bug.cgi?id=102241

Reviewed by Ojan Vafai.

Source/WebCore:

Patch 11 of 25 to update DOMException name to match the spec and Firefox.

Updated existing tests.

* dom/DOMCoreException.cpp:

LayoutTests:

Updated tests and expectations.

* fast/dom/HTMLDialogElement/dialog-open-expected.txt:
* fast/dom/HTMLDialogElement/dialog-open.html:
* fast/dom/HTMLDialogElement/dialog-show-modal-expected.txt:
* fast/dom/HTMLDialogElement/dialog-show-modal.html:
* fast/dom/Range/range-intersectsNode-exception-expected.txt:
* fast/dom/Range/range-intersectsNode-exception.html:
* fast/dom/Range/range-intersectsNode-expected.txt:
* fast/dom/Range/resources/intersectsNode.js:
* fast/dom/Selection/collapseToX-empty-selection-expected.txt:
* fast/dom/Selection/script-tests/collapseToX-empty-selection.js:
* fast/events/message-port-clone-expected.txt:
* fast/events/message-port-multi-expected.txt:
* fast/files/read-file-async-expected.txt:
* fast/files/workers/worker-read-file-async-expected.txt:
* fast/forms/color/color-setrangetext-expected.txt:
* fast/forms/date/date-setrangetext-expected.txt:
* fast/forms/date/date-stepup-stepdown-expected.txt:
* fast/forms/date/date-stepup-stepdown.html:
* fast/forms/datetime/datetime-setrangetext-expected.txt:
* fast/forms/datetime/datetime-stepup-stepdown-expected.txt:
* fast/forms/datetime/datetime-stepup-stepdown.html:
* fast/forms/datetimelocal/datetimelocal-setrangetext-expected.txt:
* fast/forms/datetimelocal/datetimelocal-stepup-stepdown-expected.txt:
* fast/forms/datetimelocal/datetimelocal-stepup-stepdown.html:
* fast/forms/file/file-setrangetext-expected.txt:
* fast/forms/file/input-file-value-expected.txt:
* fast/forms/hidden/hidden-setrangetext-expected.txt:
* fast/forms/image/image-setrangetext-expected.txt:
* fast/forms/input-stepup-stepdown-expected.txt:
* fast/forms/input-stepup-stepdown.html:
* fast/forms/input-valueasnumber-unsupported-expected.txt:
* fast/forms/input-valueasnumber-unsupported.html:
* fast/forms/month/input-valueasdate-expected.txt:
* fast/forms/month/input-valueasdate.html:
* fast/forms/month/month-setrangetext-expected.txt:
* fast/forms/month/month-stepup-stepdown-expected.txt:
* fast/forms/month/month-stepup-stepdown.html:
* fast/forms/number/number-setrangetext-expected.txt:
* fast/forms/number/number-stepup-stepdown-expected.txt:
* fast/forms/number/number-stepup-stepdown-from-renderer.html:
* fast/forms/number/number-stepup-stepdown.html:
* fast/forms/number/number-valueasnumber-expected.txt:
* fast/forms/number/number-valueasnumber.html:
* fast/forms/range/range-setrangetext-expected.txt:
* fast/forms/range/range-stepup-stepdown-expected.txt:
* fast/forms/range/range-stepup-stepdown-from-renderer.html:
* fast/forms/range/range-stepup-stepdown.html:
* fast/forms/setrangetext-expected.txt:
* fast/forms/time-multiple-fields/time-multiple-fields-stepup-stepdown-from-renderer.html:
* fast/forms/time/time-setrangetext-expected.txt:
* fast/forms/time/time-stepup-stepdown-expected.txt:
* fast/forms/time/time-stepup-stepdown.html:
* fast/forms/week/week-setrangetext-expected.txt:
* fast/forms/week/week-stepup-stepdown-expected.txt:
* fast/forms/week/week-stepup-stepdown.html:
* fast/js/dfg-custom-getter-throw-expected.txt:
* fast/js/dfg-custom-getter-throw-inlined-expected.txt:
* fast/js/script-tests/dfg-custom-getter-throw-inlined.js:
* fast/js/script-tests/dfg-custom-getter-throw.js:
* fast/mediastream/MediaStreamTrackList-expected.txt:
* fast/notifications/notifications-document-close-crash-expected.txt:
* fast/speech/scripted/start-exception-expected.txt:
* fast/speech/scripted/start-exception.html:
* fast/workers/worker-context-multi-port-expected.txt:
* fast/workers/worker-multi-port-expected.txt:
* fast/xmlhttprequest/xmlhttprequest-responseXML-xml-text-responsetype-expected.txt:
* fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer-expected.txt:
* fast/xmlhttprequest/xmlhttprequest-responsetype-document-expected.txt:
* fast/xmlhttprequest/xmlhttprequest-responsetype-set-at-headers-received-expected.txt:
* fast/xmlhttprequest/xmlhttprequest-responsetype-text-expected.txt:
* fast/xpath/detached-subtree-invalidate-iterator-expected.txt:
* http/tests/media/media-source/video-media-source-add-and-remove-buffers-expected.txt:
* http/tests/media/media-source/video-media-source-duration-changed-expected.txt:
* http/tests/media/media-source/video-media-source-objects-expected.txt:
* http/tests/xmlhttprequest/exceptions-expected.txt:
* http/tests/xmlhttprequest/zero-length-response-expected.txt:
* platform/chromium-mac/fast/notifications/notifications-document-close-crash-expected.txt:
* platform/qt/editing/pasteboard/data-transfer-items-expected.txt:
* platform/qt/fast/notifications/notifications-document-close-crash-expected.txt:
* storage/websql/open-database-set-empty-version-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134648 268f45cc-cd09-0410-ab3c-d52691b4dbfc