Summary: | Update the HTML Media Capture implementation. | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Raphael Kubo da Costa (:rakuco) <rakuco> | ||||||||
Component: | Platform | Assignee: | Raphael Kubo da Costa (:rakuco) <rakuco> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | andersca, benjamin, eric.carlson, gyuyoung.kim, jer.noble, jonlee, kling, mxie, rniwa, rwlbuis, syoichi | ||||||||
Priority: | P2 | Keywords: | BlinkMergeCandidate | ||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
URL: | http://www.w3.org/TR/html-media-capture/ | ||||||||||
Attachments: |
|
Description
Raphael Kubo da Costa (:rakuco)
2013-07-08 05:17:24 PDT
Created attachment 206232 [details]
Patch
CC'ing people who can take a look at the changes to WebCore/WebKit2 and the ports affected by the change. Since the spec has been changed in an incompatible way, I've changed the API in EFL-WebKit1 accordingly. I'm not sure if I can remove or change existing C API in WK2, so I've just deprecated the existing function there and added another one. The work in Blink/Chromium is being tracked in <https://codereview.chromium.org/15015006>, <https://codereview.chromium.org/14758008> and <https://codereview.chromium.org/18332015>. Ping? Created attachment 223860 [details]
Patch
Comment on attachment 223860 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=223860&action=review > Source/WebCore/html/HTMLInputElement.cpp:1806 > - if (!isFileUpload()) > - return String(); > - > - String capture = fastGetAttribute(captureAttr).lower(); > - if (capture == "camera" > - || capture == "camcorder" > - || capture == "microphone" > - || capture == "filesystem") > - return capture; > - > - return "filesystem"; > -} > + if (!isFileUpload() || !fastHasAttribute(captureAttr)) > + return false; > > -void HTMLInputElement::setCapture(const String& value) > -{ > - setAttribute(captureAttr, value); > + return true; Coding style wise, the the way to write this is: return isFileUpload() && fastHasAttribute(captureAttr); But getting at capture from the DOM API in JavaScript or other bindings will give true, even if isFileUpload() is false. If we keep this function, I suggest we name it differently to make it clear it’s not exactly the same as the DOM API function. > Source/WebCore/html/HTMLInputElement.h:301 > + bool capture() const; As I said above, I think it’s not good to have this HTMLInputElement::capture function that returns something different from what calling capture on an HTMLInputElement from JavaScript would give. It should be named differently. Created attachment 223964 [details]
Patch for landing
Thanks for the suggestion. I've renamed capture() to shouldUseMediaCapture(). Committed r163958: <http://trac.webkit.org/changeset/163958> |