Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(825)

Unified Diff: Source/core/html/HTMLInputElement.cpp

Issue 18332015: HTML Media Capture: Update implementation, part 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@update-media-capture-implementation-part1
Patch Set: Rebase Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLInputElement.h ('k') | Source/core/html/HTMLInputElement.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLInputElement.cpp
diff --git a/Source/core/html/HTMLInputElement.cpp b/Source/core/html/HTMLInputElement.cpp
index c4952be77fee45ee510c43f5006a4d2cd40a05e7..04bc9fff1b14ed4a1a5592744bce14c50084d036 100644
--- a/Source/core/html/HTMLInputElement.cpp
+++ b/Source/core/html/HTMLInputElement.cpp
@@ -1739,26 +1739,22 @@ bool HTMLInputElement::shouldAppearIndeterminate() const
}
#if ENABLE(MEDIA_CAPTURE)
-String HTMLInputElement::capture() const
+bool HTMLInputElement::capture() const
{
- if (!isFileUpload())
- return String();
-
- String capture = fastGetAttribute(captureAttr).lower();
- if (capture == "camera"
- || capture == "camcorder"
- || capture == "microphone"
- || capture == "filesystem")
- return capture;
+ if (!isFileUpload() || !fastHasAttribute(captureAttr))
+ return false;
- return "filesystem";
-}
+ // As per crbug.com/240252, emit a deprecation warning when the "capture"
+ // attribute is used as an enum. The spec has been updated and "capture" is
+ // supposed to be used as a boolean.
+ bool hasDeprecatedUsage = !fastGetAttribute(captureAttr).isNull();
+ if (hasDeprecatedUsage)
+ UseCounter::countDeprecation(document(), UseCounter::CaptureAttributeAsEnum);
+ else
+ UseCounter::count(document(), UseCounter::CaptureAttributeAsEnum);
-void HTMLInputElement::setCapture(const String& value)
-{
- setAttribute(captureAttr, value);
+ return true;
}
-
#endif
bool HTMLInputElement::isInRequiredRadioButtonGroup()
« no previous file with comments | « Source/core/html/HTMLInputElement.h ('k') | Source/core/html/HTMLInputElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698