Changeset 116592 in webkit


Ignore:
Timestamp:
May 9, 2012 6:21:14 PM (12 years ago)
Author:
abarth@webkit.org
Message:

Implement HTML Media Capture
https://bugs.webkit.org/show_bug.cgi?id=85958

Reviewed by Eric Seidel.

Source/WebCore:

This patch begins the implementation of
http://www.w3.org/TR/html-media-capture/ by adding the capture
attribute to HTMLInputElement.

Test: fast/forms/file/file-input-capture.html

  • html/FileInputType.cpp:

(WebCore::FileInputType::handleDOMActivateEvent):

  • html/HTMLAttributeNames.in:
  • html/HTMLInputElement.cpp:

(WebCore):
(WebCore::HTMLInputElement::capture):
(WebCore::HTMLInputElement::setCapture):

  • html/HTMLInputElement.h:

(HTMLInputElement):

  • html/HTMLInputElement.idl:
  • platform/FileChooser.h:

(FileChooserSettings):

Source/WebKit/chromium:

  • features.gypi:
  • public/WebFileChooserParams.h:

(WebFileChooserParams):

  • src/ChromeClientImpl.cpp:

(WebKit::ChromeClientImpl::runOpenPanel):

LayoutTests:

  • fast/forms/file/file-input-capture-expected.txt: Added.
  • fast/forms/file/file-input-capture.html: Added.
    • Test that the capture attribute works properly.
  • platform/chromium/test_expectations.txt:
  • platform/efl/Skipped:
  • platform/gtk/test_expectations.txt:
  • platform/mac/Skipped:
  • platform/qt/Skipped:
  • platform/win/Skipped:
    • Skip the test on all platforms. The feature is enabled only on Android, which isn't yet able to run LayoutTests upstream.
Location:
trunk
Files:
2 added
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r116584 r116592  
     12012-05-09  Adam Barth  <abarth@webkit.org>
     2
     3        Implement HTML Media Capture
     4        https://bugs.webkit.org/show_bug.cgi?id=85958
     5
     6        Reviewed by Eric Seidel.
     7
     8        * fast/forms/file/file-input-capture-expected.txt: Added.
     9        * fast/forms/file/file-input-capture.html: Added.
     10            - Test that the capture attribute works properly.
     11        * platform/chromium/test_expectations.txt:
     12        * platform/efl/Skipped:
     13        * platform/gtk/test_expectations.txt:
     14        * platform/mac/Skipped:
     15        * platform/qt/Skipped:
     16        * platform/win/Skipped:
     17            - Skip the test on all platforms. The feature is enabled only on
     18              Android, which isn't yet able to run LayoutTests upstream.
     19
    1202012-05-09  Tony Gentilcore  <tonyg@chromium.org>
    221
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r116571 r116592  
    39303930BUGWK85951 WIN DEBUG : fast/css/hover-update.html = TEXT PASS
    39313931
     3932// Requires ENABLE(MEDIA_CAPTURE)
     3933BUGWK85958 : fast/forms/file/file-input-capture.html = TEXT
     3934
    39323935BUGWK85952 MAC WIN : http/tests/media/media-source/webm/video-media-source-play.html = PASS TIMEOUT
    39333936BUGWK85952 WIN : http/tests/media/media-source/webm/video-media-source-seek.html = PASS TIMEOUT
  • trunk/LayoutTests/platform/efl/Skipped

    r116571 r116592  
    19421942media/media-can-play-flac-audio.html
    19431943
     1944# Requires ENABLE(MEDIA_CAPTURE)
     1945fast/forms/file/file-input-capture.html
     1946
    19441947# The inner <input> should now grow to take the full cell's height.
    19451948fast/table/colspanMinWidth-vertical.html
  • trunk/LayoutTests/platform/gtk/test_expectations.txt

    r116571 r116592  
    13291329BUGWK84778 : ietestcenter/css3/multicolumn/column-width-negative-001.htm = IMAGE
    13301330
     1331// Requires ENABLE(MEDIA_CAPTURE)
     1332BUGWK85958 : fast/forms/file/file-input-capture.html = TEXT
     1333
    13311334// Generate results for your platform(s)
    13321335BUGWK85567 : fast/images/png-suite/test.html = IMAGE
  • trunk/LayoutTests/platform/mac/Skipped

    r116563 r116592  
    816816media/audio-repaint.html
    817817
     818# Requires ENABLE(MEDIA_CAPTURE)
     819fast/forms/file/file-input-capture.html
     820
    818821# https://bugs.webkit.org/show_bug.cgi?id=85522
    819822http/tests/security/sandboxed-iframe-modify-self.html
  • trunk/LayoutTests/platform/qt/Skipped

    r116563 r116592  
    25292529http/tests/inspector/network/network-initiator.html
    25302530
     2531# Requires ENABLE(MEDIA_CAPTURE)
     2532fast/forms/file/file-input-capture.html
     2533
    25312534# [Qt] ietestcenter/css3/flexbox tests fail on 32 bit
    25322535# https://bugs.webkit.org/show_bug.cgi?id=85596
  • trunk/LayoutTests/platform/win/Skipped

    r116563 r116592  
    17191719fast/table/colspanMinWidth-vertical.html
    17201720
     1721# Requires ENABLE(MEDIA_CAPTURE)
     1722fast/forms/file/file-input-capture.html
     1723
    17211724# This should only be a layer change.
    17221725# http://webkit.org/b/82129
  • trunk/Source/WebCore/ChangeLog

    r116591 r116592  
     12012-05-09  Adam Barth  <abarth@webkit.org>
     2
     3        Implement HTML Media Capture
     4        https://bugs.webkit.org/show_bug.cgi?id=85958
     5
     6        Reviewed by Eric Seidel.
     7
     8        This patch begins the implementation of
     9        http://www.w3.org/TR/html-media-capture/ by adding the capture
     10        attribute to HTMLInputElement.
     11
     12        Test: fast/forms/file/file-input-capture.html
     13
     14        * html/FileInputType.cpp:
     15        (WebCore::FileInputType::handleDOMActivateEvent):
     16        * html/HTMLAttributeNames.in:
     17        * html/HTMLInputElement.cpp:
     18        (WebCore):
     19        (WebCore::HTMLInputElement::capture):
     20        (WebCore::HTMLInputElement::setCapture):
     21        * html/HTMLInputElement.h:
     22        (HTMLInputElement):
     23        * html/HTMLInputElement.idl:
     24        * platform/FileChooser.h:
     25        (FileChooserSettings):
     26
    1272012-05-09  Charles Wei  <charles.wei@torchmobile.com.cn>
    228
  • trunk/Source/WebCore/html/FileInputType.cpp

    r116277 r116592  
    189189        settings.acceptMIMETypes = input->acceptMIMETypes();
    190190        settings.selectedFiles = m_fileList->paths();
     191#if ENABLE(MEDIA_CAPTURE)
     192        settings.capture = input->capture();
     193#endif
    191194        chrome->runOpenPanel(input->document()->frame(), newFileChooser(settings));
    192195    }
  • trunk/Source/WebCore/html/HTMLAttributeNames.in

    r116384 r116592  
    5959border
    6060bordercolor
     61capture
    6162cellpadding
    6263cellspacing
  • trunk/Source/WebCore/html/HTMLInputElement.cpp

    r116499 r116592  
    18381838}
    18391839
     1840#if ENABLE(MEDIA_CAPTURE)
     1841String HTMLInputElement::capture() const
     1842{
     1843    if (!isFileUpload())
     1844        return String();
     1845
     1846    String capture = fastGetAttribute(captureAttr).lower();
     1847    if (capture == "camera"
     1848        || capture == "camcorder"
     1849        || capture == "microphone"
     1850        || capture == "filesystem")
     1851        return capture;
     1852
     1853    return "filesystem";
     1854}
     1855
     1856void HTMLInputElement::setCapture(const String& value)
     1857{
     1858    setAttribute(captureAttr, value);
     1859}
     1860
     1861#endif
     1862
    18401863bool HTMLInputElement::isInRequiredRadioButtonGroup() const
    18411864{
  • trunk/Source/WebCore/html/HTMLInputElement.h

    r116499 r116592  
    242242    String defaultToolTip() const;
    243243
     244#if ENABLE(MEDIA_CAPTURE)
     245    String capture() const;
     246    void setCapture(const String& value);
     247#endif
     248
    244249    static const int maximumLength;
    245250
  • trunk/Source/WebCore/html/HTMLInputElement.idl

    r116389 r116592  
    116116#endif
    117117
     118        // See http://www.w3.org/TR/html-media-capture/
     119        attribute [Conditional=MEDIA_CAPTURE] DOMString capture;
    118120    };
    119121}
  • trunk/Source/WebCore/platform/FileChooser.h

    r110557 r116592  
    5757    Vector<String> acceptMIMETypes;
    5858    Vector<String> selectedFiles;
     59#if ENABLE(MEDIA_CAPTURE)
     60    String capture;
     61#endif
    5962};
    6063
  • trunk/Source/WebKit/chromium/ChangeLog

    r116587 r116592  
     12012-05-09  Adam Barth  <abarth@webkit.org>
     2
     3        Implement HTML Media Capture
     4        https://bugs.webkit.org/show_bug.cgi?id=85958
     5
     6        Reviewed by Eric Seidel.
     7
     8        * features.gypi:
     9        * public/WebFileChooserParams.h:
     10        (WebFileChooserParams):
     11        * src/ChromeClientImpl.cpp:
     12        (WebKit::ChromeClientImpl::runOpenPanel):
     13
    1142012-05-09  Dana Jansens  <danakj@chromium.org>
    215
  • trunk/Source/WebKit/chromium/features.gypi

    r116474 r116592  
    7272      'ENABLE_LINK_PREFETCH=1',
    7373      'ENABLE_LINK_PRERENDER=1',
     74      'ENABLE_MEDIA_CAPTURE=0',
    7475      'ENABLE_MEDIA_SOURCE=1',
    7576      'ENABLE_MEDIA_STATISTICS=1',
     
    140141        'feature_defines': [
    141142          'ENABLE_CALENDAR_PICKER=0',
     143          'ENABLE_MEDIA_CAPTURE=1',
    142144          'ENABLE_PAGE_POPUP=0',
    143145          'ENABLE_WEB_AUDIO=0',
  • trunk/Source/WebKit/chromium/public/WebFileChooserParams.h

    r101122 r116592  
    6363    // before opening a file chooser dialog.
    6464    WebVector<WebString> selectedFiles;
     65    // See http://www.w3.org/TR/html-media-capture/ for the semantics of the
     66    // capture attribute. This string will either be empty (meaning the feature
     67    // is disabled) or one of the following values:
     68    //  - filesystem (default)
     69    //  - camera
     70    //  - camcorder
     71    //  - microphone
     72    WebString capture;
    6573
    6674    WebFileChooserParams()
  • trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp

    r115702 r116592  
    739739    if (params.selectedFiles.size() > 0)
    740740        params.initialValue = params.selectedFiles[0];
     741#if ENABLE(MEDIA_CAPTURE)
     742    params.capture = fileChooser->settings().capture;
     743#else
     744    params.capture = WebString();
     745#endif
    741746    WebFileChooserCompletionImpl* chooserCompletion =
    742747        new WebFileChooserCompletionImpl(fileChooser);
Note: See TracChangeset for help on using the changeset viewer.