Changeset 163958 in webkit
- Timestamp:
- Feb 12, 2014 6:58:40 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r163955 r163958 1 2014-02-12 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> 2 3 Update the HTML Media Capture implementation. 4 https://bugs.webkit.org/show_bug.cgi?id=118465 5 6 Reviewed by Darin Adler. 7 8 Make the implementation in WebKit compatible with the 2013-05-09 9 version of the spec, which makes the "capture" attribute a boolean 10 instead of an enum. 11 12 * fast/forms/file/file-input-capture-expected.txt: 13 * fast/forms/file/file-input-capture.html: 14 1 15 2014-02-12 Mihai Tica <mitica@adobe.com> 2 16 -
trunk/LayoutTests/fast/forms/file/file-input-capture-expected.txt
r116592 r163958 5 5 6 6 PASS 'capture' in input is true 7 PASS input.capture is '' 8 PASS input.capture is 'filesystem' 9 PASS input.capture is 'camera' 10 PASS input.capture is 'camcorder' 11 PASS input.capture is 'microphone' 12 PASS input.capture is 'filesystem' 13 PASS input.capture is 'camcorder' 14 PASS input.getAttribute('capture') is 'CamCorder' 7 PASS input.capture is false 8 PASS input.hasAttribute('capture') is false 9 PASS input.capture is false 10 PASS input.hasAttribute('capture') is false 11 PASS input.capture is true 12 PASS input.hasAttribute('capture') is true 13 PASS input.capture is false 14 PASS input.hasAttribute('capture') is false 15 PASS input.capture is true 16 PASS input.hasAttribute('capture') is true 17 PASS input.capture is false 18 PASS input.hasAttribute('capture') is false 19 PASS input.capture is true 20 PASS input.hasAttribute('capture') is true 15 21 PASS successfullyParsed is true 16 22 -
trunk/LayoutTests/fast/forms/file/file-input-capture.html
r155268 r163958 8 8 9 9 shouldBeTrue("'capture' in input"); 10 shouldBe("input.capture", "''"); 10 shouldBe("input.capture", "false"); 11 shouldBe("input.hasAttribute('capture')", "false"); 11 12 12 13 input.setAttribute("type", "file"); 13 14 14 shouldBe("input.capture", "'filesystem'"); 15 shouldBe("input.capture", "false"); 16 shouldBe("input.hasAttribute('capture')", "false"); 15 17 16 input.setAttribute("capture", "CaMerA"); 17 shouldBe("input.capture", "'camera'"); 18 input.setAttribute("capture", true); 19 shouldBe("input.capture", "true"); 20 shouldBe("input.hasAttribute('capture')", "true"); 18 21 19 input.setAttribute("capture", "camcorder"); 20 shouldBe("input.capture", "'camcorder'"); 22 input.removeAttribute("capture"); 23 shouldBe("input.capture", "false"); 24 shouldBe("input.hasAttribute('capture')", "false"); 21 25 22 input.setAttribute("capture", "MiCroPhonE"); 23 shouldBe("input.capture", "'microphone'"); 26 input.setAttribute("capture", "'x'"); 27 shouldBe("input.capture", "true"); 28 shouldBe("input.hasAttribute('capture')", "true"); 24 29 25 input.setAttribute("capture", "xyzzy"); 26 shouldBe("input.capture", "'filesystem'"); 30 input.capture = false; 31 shouldBe("input.capture", "false"); 32 shouldBe("input.hasAttribute('capture')", "false"); 27 33 28 input.capture = "CamCorder"; 29 shouldBe("input.capture", "'camcorder'"); 30 shouldBe("input.getAttribute('capture')", "'CamCorder'"); 31 34 input.capture = true; 35 shouldBe("input.capture", "true"); 36 shouldBe("input.hasAttribute('capture')", "true"); 32 37 </script> 33 38 <script src="../../../resources/js-test-post.js"></script> -
trunk/Source/WebCore/ChangeLog
r163957 r163958 1 2014-02-12 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> 2 3 Update the HTML Media Capture implementation. 4 https://bugs.webkit.org/show_bug.cgi?id=118465 5 6 Reviewed by Darin Adler. 7 8 Make the implementation in WebKit compatible with the 2013-05-09 9 version of the spec, which makes the "capture" attribute a boolean 10 instead of an enum. 11 12 Covered by fast/forms/file/file-input-capture.html. 13 14 * html/FileInputType.cpp: 15 (WebCore::FileInputType::handleDOMActivateEvent): 16 * html/HTMLInputElement.cpp: 17 (WebCore::HTMLInputElement::capture): Renamed to shouldUseMediaCapture(). 18 (WebCore::HTMLInputElement::shouldUseMediaCapture): Return a bool. 19 * html/HTMLInputElement.h: 20 * html/HTMLInputElement.idl: Turn the `capture' attribute into a 21 reflective boolean instead of a DOMString. 22 * platform/FileChooser.h: 23 1 24 2014-02-12 Radu Stavila <stavila@adobe.com> 2 25 -
trunk/Source/WebCore/html/FileInputType.cpp
r163724 r163958 194 194 settings.selectedFiles = m_fileList->paths(); 195 195 #if ENABLE(MEDIA_CAPTURE) 196 settings.capture = input. capture();196 settings.capture = input.shouldUseMediaCapture(); 197 197 #endif 198 198 -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r163724 r163958 1799 1799 1800 1800 #if ENABLE(MEDIA_CAPTURE) 1801 String HTMLInputElement::capture() const 1802 { 1803 if (!isFileUpload()) 1804 return String(); 1805 1806 String capture = fastGetAttribute(captureAttr).lower(); 1807 if (capture == "camera" 1808 || capture == "camcorder" 1809 || capture == "microphone" 1810 || capture == "filesystem") 1811 return capture; 1812 1813 return "filesystem"; 1814 } 1815 1816 void HTMLInputElement::setCapture(const String& value) 1817 { 1818 setAttribute(captureAttr, value); 1819 } 1820 1801 bool HTMLInputElement::shouldUseMediaCapture() const 1802 { 1803 return isFileUpload() && fastHasAttribute(captureAttr); 1804 } 1821 1805 #endif 1822 1806 -
trunk/Source/WebCore/html/HTMLInputElement.h
r162158 r163958 299 299 300 300 #if ENABLE(MEDIA_CAPTURE) 301 String capture() const; 302 void setCapture(const String& value); 301 bool shouldUseMediaCapture() const; 303 302 #endif 304 303 -
trunk/Source/WebCore/html/HTMLInputElement.idl
r163483 r163958 127 127 128 128 // See http://www.w3.org/TR/html-media-capture/ 129 [Conditional=MEDIA_CAPTURE ] attribute DOMStringcapture;129 [Conditional=MEDIA_CAPTURE, Reflect] attribute boolean capture; 130 130 }; -
trunk/Source/WebCore/platform/FileChooser.h
r163483 r163958 57 57 Vector<String> selectedFiles; 58 58 #if ENABLE(MEDIA_CAPTURE) 59 Stringcapture;59 bool capture; 60 60 #endif 61 61 -
trunk/Source/WebKit/efl/ChangeLog
r163761 r163958 1 2014-02-12 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> 2 3 Update the HTML Media Capture implementation. 4 https://bugs.webkit.org/show_bug.cgi?id=118465 5 6 Reviewed by Darin Adler. 7 8 Make the implementation in WebKit compatible with the 2013-05-09 9 version of the spec, which makes the "capture" attribute a boolean 10 instead of an enum. 11 12 * ewk/ewk_file_chooser.cpp: 13 (ewk_file_chooser_capture_get): Return an Eina_Bool now. 14 * ewk/ewk_file_chooser.h: Get rid of Ewk_File_Chooser_Capture_Type. 15 1 16 2014-02-09 Ryuan Choi <ryuan.choi@samsung.com> 2 17 -
trunk/Source/WebKit/efl/ewk/ewk_file_chooser.cpp
r163483 r163958 77 77 } 78 78 79 E wk_File_Chooser_Capture_Typeewk_file_chooser_capture_get(const Ewk_File_Chooser* chooser)79 Eina_Bool ewk_file_chooser_capture_get(const Ewk_File_Chooser* chooser) 80 80 { 81 81 #if ENABLE(MEDIA_CAPTURE) 82 EINA_SAFETY_ON_NULL_RETURN_VAL(chooser, EWK_FILE_CHOOSER_CAPTURE_TYPE_INVALID); 83 84 String capture = chooser->fileChooser->settings().capture; 85 86 if (capture == "camera") 87 return EWK_FILE_CHOOSER_CAPTURE_TYPE_CAMERA; 88 89 if (capture == "camcorder") 90 return EWK_FILE_CHOOSER_CAPTURE_TYPE_CAMCORDER; 91 92 if (capture == "microphone") 93 return EWK_FILE_CHOOSER_CAPTURE_TYPE_MICROPHONE; 94 95 return EWK_FILE_CHOOSER_CAPTURE_TYPE_FILESYSTEM; 82 EINA_SAFETY_ON_NULL_RETURN_VAL(chooser, false); 83 return chooser->fileChooser->settings().capture; 96 84 #else 97 85 UNUSED_PARAM(chooser); 98 return EWK_FILE_CHOOSER_CAPTURE_TYPE_INVALID;86 return false; 99 87 #endif 100 88 } -
trunk/Source/WebKit/efl/ewk/ewk_file_chooser.h
r123597 r163958 42 42 43 43 typedef struct _Ewk_File_Chooser Ewk_File_Chooser; 44 45 /**46 * \enum _Ewk_File_Chooser_Capture_Type47 * @brief Types of capture attribute of file chooser to support the HTML media capture.48 */49 enum _Ewk_File_Chooser_Capture_Type {50 EWK_FILE_CHOOSER_CAPTURE_TYPE_INVALID,51 EWK_FILE_CHOOSER_CAPTURE_TYPE_FILESYSTEM,52 EWK_FILE_CHOOSER_CAPTURE_TYPE_CAMERA,53 EWK_FILE_CHOOSER_CAPTURE_TYPE_CAMCORDER,54 EWK_FILE_CHOOSER_CAPTURE_TYPE_MICROPHONE55 };56 typedef enum _Ewk_File_Chooser_Capture_Type Ewk_File_Chooser_Capture_Type;57 44 58 45 /** … … 115 102 116 103 /** 117 * Returns the capture attribute of the file chooser to support HTML media capture.104 * Returns whether the device's media capture capabilities should be used in the file chooser. 118 105 * 119 106 * @see http://www.w3.org/TR/html-media-capture/ for the semantics of the capture attribute. … … 121 108 * @param f file chooser object. 122 109 * 123 * @return @c Ewk_File_Chooser_Capture_Type on supporting HTML media capture or 124 * @c EWK_FILE_CHOOSER_CAPTURE_TYPE_INVALID on failure. 110 * @return @c EINA_TRUE if the device's capabilities should be used, @c EINA_FALSE otherwise. 125 111 */ 126 EAPI E wk_File_Chooser_Capture_Typeewk_file_chooser_capture_get(const Ewk_File_Chooser *f);112 EAPI Eina_Bool ewk_file_chooser_capture_get(const Ewk_File_Chooser *f); 127 113 128 114 #ifdef __cplusplus -
trunk/Source/WebKit2/ChangeLog
r163956 r163958 1 2014-02-12 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> 2 3 Update the HTML Media Capture implementation. 4 https://bugs.webkit.org/show_bug.cgi?id=118465 5 6 Reviewed by Darin Adler. 7 8 Make the implementation in WebKit compatible with the 2013-05-09 9 version of the spec, which makes the "capture" attribute a boolean 10 instead of an enum. 11 12 * Shared/WebOpenPanelParameters.cpp: 13 (WebKit::WebOpenPanelParameters::capture): Return a bool. 14 * Shared/WebOpenPanelParameters.h: Ditto. 15 * UIProcess/API/C/WKOpenPanelParameters.cpp: 16 (WKOpenPanelParametersCopyCapture): Deprecate, the implementation is 17 incompatible with the current version of the spec. 18 (WKOpenPanelParametersGetCaptureEnabled): Add and return a bool. 19 * UIProcess/API/C/WKOpenPanelParameters.h: 20 1 21 2014-02-12 Alberto Garcia <berto@igalia.com> 2 22 -
trunk/Source/WebKit2/Shared/WebOpenPanelParameters.cpp
r160608 r163958 56 56 57 57 #if ENABLE(MEDIA_CAPTURE) 58 StringWebOpenPanelParameters::capture() const58 bool WebOpenPanelParameters::capture() const 59 59 { 60 60 return m_settings.capture; -
trunk/Source/WebKit2/Shared/WebOpenPanelParameters.h
r160384 r163958 48 48 PassRefPtr<API::Array> selectedFileNames() const; 49 49 #if ENABLE(MEDIA_CAPTURE) 50 Stringcapture() const;50 bool capture() const; 51 51 #endif 52 52 -
trunk/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp
r159333 r163958 49 49 } 50 50 51 // Deprecated. 51 52 WKStringRef WKOpenPanelParametersCopyCapture(WKOpenPanelParametersRef parametersRef) 52 53 { 54 return 0; 55 } 56 57 bool WKOpenPanelParametersGetCaptureEnabled(WKOpenPanelParametersRef parametersRef) 58 { 53 59 #if ENABLE(MEDIA_CAPTURE) 54 return to CopiedAPI(toImpl(parametersRef)->capture());60 return toImpl(parametersRef)->capture(); 55 61 #else 56 62 UNUSED_PARAM(parametersRef); 57 return 0;63 return false; 58 64 #endif 59 65 } -
trunk/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h
r148005 r163958 44 44 WK_EXPORT WKArrayRef WKOpenPanelParametersCopyAcceptedMIMETypes(WKOpenPanelParametersRef parameters); 45 45 46 /* DEPRECATED - Please use WKOpenPanelParametersGetCaptureEnabled() instead. */ 46 47 WK_EXPORT WKStringRef WKOpenPanelParametersCopyCapture(WKOpenPanelParametersRef parameters); 48 49 WK_EXPORT bool WKOpenPanelParametersGetCaptureEnabled(WKOpenPanelParametersRef parametersRef); 47 50 48 51 WK_EXPORT WKArrayRef WKOpenPanelParametersCopySelectedFileNames(WKOpenPanelParametersRef parametersRef);
Note: See TracChangeset
for help on using the changeset viewer.