summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/html
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/html')
-rw-r--r--Source/WebCore/html/HTMLAttributeNames.in1
-rw-r--r--Source/WebCore/html/HTMLInputElement.cpp20
-rw-r--r--Source/WebCore/html/HTMLInputElement.h4
-rw-r--r--Source/WebCore/html/HTMLInputElement.idl3
4 files changed, 28 insertions, 0 deletions
diff --git a/Source/WebCore/html/HTMLAttributeNames.in b/Source/WebCore/html/HTMLAttributeNames.in
index 5e0fe7b..578f717 100644
--- a/Source/WebCore/html/HTMLAttributeNames.in
+++ b/Source/WebCore/html/HTMLAttributeNames.in
@@ -58,6 +58,7 @@ bgcolor
bgproperties
border
bordercolor
+capture
cellpadding
cellspacing
char
diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp
index 2b262e4..36cdf51 100644
--- a/Source/WebCore/html/HTMLInputElement.cpp
+++ b/Source/WebCore/html/HTMLInputElement.cpp
@@ -1588,4 +1588,24 @@ void HTMLInputElement::handleBeforeTextInsertedEvent(Event* event)
InputElement::handleBeforeTextInsertedEvent(m_data, this, this, event);
}
+#if PLATFORM(ANDROID) && ENABLE(MEDIA_CAPTURE)
+String HTMLInputElement::capture() const
+{
+ if (!isFileUpload()) {
+ // capture has no meaning on anything other than file pickers.
+ return String();
+ }
+
+ String capture = fastGetAttribute(captureAttr).lower();
+ if (capture == "camera"
+ || capture == "camcorder"
+ || capture == "microphone"
+ || capture == "filesystem")
+ return capture;
+ // According to the HTML Media Capture specification, the invalid and
+ // missing default value is filesystem.
+ return "filesystem";
+}
+#endif
+
} // namespace
diff --git a/Source/WebCore/html/HTMLInputElement.h b/Source/WebCore/html/HTMLInputElement.h
index 2a98b13..58d86ac 100644
--- a/Source/WebCore/html/HTMLInputElement.h
+++ b/Source/WebCore/html/HTMLInputElement.h
@@ -200,6 +200,10 @@ public:
void updateCheckedRadioButtons();
bool lastChangeWasUserEdit() const;
+
+#if PLATFORM(ANDROID) && ENABLE(MEDIA_CAPTURE)
+ String capture() const;
+#endif
protected:
HTMLInputElement(const QualifiedName&, Document*, HTMLFormElement*, bool createdByParser);
diff --git a/Source/WebCore/html/HTMLInputElement.idl b/Source/WebCore/html/HTMLInputElement.idl
index f346e10..e1937e4 100644
--- a/Source/WebCore/html/HTMLInputElement.idl
+++ b/Source/WebCore/html/HTMLInputElement.idl
@@ -107,6 +107,9 @@ module html {
attribute [Reflect, EnabledAtRuntime] boolean webkitGrammar;
attribute [DontEnum] EventListener onwebkitspeechchange;
#endif
+#if defined(WTF_PLATFORM_ANDROID) && defined(ENABLE_MEDIA_CAPTURE) && ENABLE_MEDIA_CAPTURE
+ attribute [Reflect] DOMString capture;
+#endif
};
}