diff options
Diffstat (limited to 'Source/WebCore/html')
-rw-r--r-- | Source/WebCore/html/HTMLAttributeNames.in | 1 | ||||
-rw-r--r-- | Source/WebCore/html/HTMLElement.cpp | 5 | ||||
-rw-r--r-- | Source/WebCore/html/HTMLInputElement.cpp | 20 | ||||
-rw-r--r-- | Source/WebCore/html/HTMLInputElement.h | 4 | ||||
-rw-r--r-- | Source/WebCore/html/HTMLInputElement.idl | 3 | ||||
-rw-r--r-- | Source/WebCore/html/HTMLMediaElement.cpp | 19 | ||||
-rw-r--r-- | Source/WebCore/html/HTMLMediaElement.h | 2 | ||||
-rw-r--r-- | Source/WebCore/html/shadow/TextControlInnerElements.h | 5 |
8 files changed, 45 insertions, 14 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/HTMLElement.cpp b/Source/WebCore/html/HTMLElement.cpp index b2b57a2..82e33d1 100644 --- a/Source/WebCore/html/HTMLElement.cpp +++ b/Source/WebCore/html/HTMLElement.cpp @@ -682,11 +682,6 @@ void HTMLElement::setContentEditable(Attribute* attr) attr->decl()->removeProperty(CSSPropertyWordWrap, false); attr->decl()->removeProperty(CSSPropertyWebkitNbspMode, false); attr->decl()->removeProperty(CSSPropertyWebkitLineBreak, false); - } else if (equalIgnoringCase(enabled, "inherit")) { - addCSSProperty(attr, CSSPropertyWebkitUserModify, CSSValueInherit); - attr->decl()->removeProperty(CSSPropertyWordWrap, false); - attr->decl()->removeProperty(CSSPropertyWebkitNbspMode, false); - attr->decl()->removeProperty(CSSPropertyWebkitLineBreak, false); } else if (equalIgnoringCase(enabled, "plaintext-only")) { addCSSProperty(attr, CSSPropertyWebkitUserModify, CSSValueReadWritePlaintextOnly); addCSSProperty(attr, CSSPropertyWordWrap, CSSValueBreakWord); 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 }; } diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp index 5cd2ddd..46e8a12 100644 --- a/Source/WebCore/html/HTMLMediaElement.cpp +++ b/Source/WebCore/html/HTMLMediaElement.cpp @@ -238,7 +238,9 @@ void HTMLMediaElement::attributeChanged(Attribute* attr, bool preserveDecls) #if !ENABLE(PLUGIN_PROXY_FOR_VIDEO) if (controls()) { if (!hasMediaControls()) { - ensureMediaControls(); + if (!createMediaControls()) + return; + mediaControls()->reset(); } mediaControls()->show(); @@ -2739,13 +2741,18 @@ bool HTMLMediaElement::hasMediaControls() return node && node->isMediaControls(); } -void HTMLMediaElement::ensureMediaControls() +bool HTMLMediaElement::createMediaControls() { if (hasMediaControls()) - return; + return true; ExceptionCode ec; - ensureShadowRoot()->appendChild(MediaControls::create(this), ec); + RefPtr<MediaControls> controls = MediaControls::create(this); + if (!controls) + return false; + + ensureShadowRoot()->appendChild(controls, ec); + return true; } void* HTMLMediaElement::preDispatchEventHandler(Event* event) @@ -2753,7 +2760,9 @@ void* HTMLMediaElement::preDispatchEventHandler(Event* event) if (event && event->type() == eventNames().webkitfullscreenchangeEvent) { if (controls()) { if (!hasMediaControls()) { - ensureMediaControls(); + if (!createMediaControls()) + return 0; + mediaControls()->reset(); } mediaControls()->show(); diff --git a/Source/WebCore/html/HTMLMediaElement.h b/Source/WebCore/html/HTMLMediaElement.h index 2144ea1..0b11861 100644 --- a/Source/WebCore/html/HTMLMediaElement.h +++ b/Source/WebCore/html/HTMLMediaElement.h @@ -325,7 +325,7 @@ private: void refreshCachedTime() const; bool hasMediaControls(); - void ensureMediaControls(); + bool createMediaControls(); virtual void* preDispatchEventHandler(Event*); diff --git a/Source/WebCore/html/shadow/TextControlInnerElements.h b/Source/WebCore/html/shadow/TextControlInnerElements.h index 2340970..886fbf8 100644 --- a/Source/WebCore/html/shadow/TextControlInnerElements.h +++ b/Source/WebCore/html/shadow/TextControlInnerElements.h @@ -101,9 +101,8 @@ private: virtual void detach(); virtual bool isSpinButtonElement() const { return true; } - // FIXME: shadowAncestorNode() should be const. - virtual bool isEnabledFormControl() const { return static_cast<Element*>(const_cast<SpinButtonElement*>(this)->shadowAncestorNode())->isEnabledFormControl(); } - virtual bool isReadOnlyFormControl() const { return static_cast<Element*>(const_cast<SpinButtonElement*>(this)->shadowAncestorNode())->isReadOnlyFormControl(); } + virtual bool isEnabledFormControl() const { return static_cast<Element*>(shadowAncestorNode())->isEnabledFormControl(); } + virtual bool isReadOnlyFormControl() const { return static_cast<Element*>(shadowAncestorNode())->isReadOnlyFormControl(); } virtual void defaultEventHandler(Event*); void startRepeatingTimer(); void stopRepeatingTimer(); |