Source/WebCore/ChangeLog

 12011-06-21 Jongseok Yang <js45.yang@samsung.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 Add capture attribute for HTML Media Capture
 6 https://bugs.webkit.org/show_bug.cgi?id=63062
 7
 8 It's the first patch for the feature.
 9 - add capture attribute
 10 - add functions to get the attribute from FileChooser
 11
 12 To support HTML Media Capture, each port should check the attribute and execute
 13 the application or the interface.
 14 It should be implemented within "ChromeClient::runOpenPanel()" for each port.
 15
 16 No new tests.
 17 It uses MEDIA_CAPTURE feature define, which is turned off.
 18 It does not include the implementation for each port
 19
 20 * html/HTMLAttributeNames.in:
 21 * html/HTMLInputElement.cpp
 22 (WebCore::HTMLInputElement::capture)
 23 * html/HTMLInputElement.idl
 24 * html/HTMLInputElement.h
 25 * rendering/RenderFileUploadControl.cpp
 26 (WebCore::RenderFileUploadControl::captureDevice)
 27 * rendering/RenderFileUploadControl.h
 28 * platform/FileChooser.h
 29 (WebCore::FileChooserClient::captureDevice)
 30 (WebCore::FileChooser::captureDevice): The function would be used within the function
 31 "ChromeClient::runOpenPanel()" for each port.
 32
1332011-06-17 Pavel Podivilov <podivilov@chromium.org>
234
335 Reviewed by Pavel Feldman.
89346

Source/WebCore/html/HTMLAttributeNames.in

@@bgcolor
5858bgproperties
5959border
6060bordercolor
 61capture
6162cellpadding
6263cellspacing
6364char
89339

Source/WebCore/html/HTMLInputElement.cpp

@@String HTMLInputElement::accept() const
12321232 return fastGetAttribute(acceptAttr);
12331233}
12341234
 1235#if ENABLE(MEDIA_CAPTURE)
 1236String HTMLInputElement::capture() const
 1237{
 1238 return fastGetAttribute(captureAttr);
 1239}
 1240#endif
 1241
12351242String HTMLInputElement::alt() const
12361243{
12371244 return fastGetAttribute(altAttr);
89339

Source/WebCore/html/HTMLInputElement.h

@@public:
193193 void setDefaultName(const AtomicString&);
194194
195195 String accept() const;
 196#if ENABLE(MEDIA_CAPTURE)
 197 String capture() const;
 198#endif
196199 String alt() const;
197200
198201 void setSize(unsigned);
89339

Source/WebCore/html/HTMLInputElement.idl

@@module html {
3333 attribute [Reflect] DOMString formTarget;
3434 readonly attribute ValidityState validity;
3535 attribute [Reflect] DOMString accept;
 36#if defined(MEDIA_CAPTURE) && MEDIA_CAPTURE
 37 attribute [Reflect] DOMString capture;
 38#endif
3639 attribute [Reflect] DOMString accessKey;
3740 attribute [Reflect] DOMString align;
3841 attribute [Reflect] DOMString alt;
89339

Source/WebCore/platform/FileChooser.h

@@public:
4545 virtual bool allowsDirectoryUpload() = 0;
4646#endif
4747 virtual String acceptTypes() = 0;
 48#if ENABLE(MEDIA_CAPTURE)
 49 virtual String captureDevice() = 0;
 50#endif
4851 virtual ~FileChooserClient();
4952};
5053

@@public:
6972#endif
7073 // Acceptable MIME types. It's an 'accept' attribute value of the corresponding INPUT element.
7174 String acceptTypes() const { return m_client ? m_client->acceptTypes() : String(); }
 75#if ENABLE(MEDIA_CAPTURE)
 76 // The source for the file picker interface. It's a 'capture' attribute value of the corrsponding INPUT element.
 77 String captureDevice() const { return m_client ? m_client->captureDevice() : String(); }
 78#endif
7279
7380private:
7481 FileChooser(FileChooserClient*, const Vector<String>& initialFilenames);
89339

Source/WebCore/rendering/RenderFileUploadControl.cpp

@@String RenderFileUploadControl::acceptTy
127127 return static_cast<HTMLInputElement*>(node())->accept();
128128}
129129
 130#if ENABLE(MEDIA_CAPTURE)
 131String RenderFileUploadControl::captureDevice()
 132{
 133 return static_cast<HTMLInputElement*>(node())->capture();
 134}
 135#endif
 136
130137void RenderFileUploadControl::updateRendering(PassRefPtr<Icon> icon)
131138{
132139 if (m_icon == icon)
89339

Source/WebCore/rendering/RenderFileUploadControl.h

@@private:
6565 virtual void receiveDropForDirectoryUpload(const Vector<String>&);
6666#endif
6767 virtual String acceptTypes();
 68#if ENABLE(MEDIA_CAPTURE)
 69 virtual String captureDevice();
 70#endif
6871
6972 // FileIconLoaderClient functions.
7073 virtual void updateRendering(PassRefPtr<Icon>);
89339