diff --git a/content/base/public/nsContentCID.h b/content/base/public/nsContentCID.h index 3ffab2f92c5..46d679b7831 100644 --- a/content/base/public/nsContentCID.h +++ b/content/base/public/nsContentCID.h @@ -53,12 +53,10 @@ 0xa6cf90f5, 0x15b3, 0x11d2, \ {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}} -#ifdef MOZ_MEDIA #define NS_HTMLAUDIOELEMENT_CID \ { /* 1d40026b-4c44-4f6f-b158-26bb5e9c65e9 */ \ 0x1d40026b, 0x4c44, 0x4f6f, \ {0xb1, 0x58, 0x26, 0xbb, 0x5e, 0x9c, 0x65, 0xe9}} -#endif #define NS_NAMESPACEMANAGER_CID \ { /* d9783472-8fe9-11d2-9d3c-0060088f9ff7 */ \ @@ -151,15 +149,11 @@ 0xb7f44954, 0x11d1, 0x11b2, \ {0x8c, 0x2e, 0xc2, 0xfe, 0xab, 0x41, 0x86, 0xbc}} -#ifdef MOZ_MEDIA - // {d899a152-9412-46b2-b651-2e71c5c2f05f} #define NS_VIDEODOCUMENT_CID \ { 0xd899a152, 0x9412, 0x46b2, \ { 0xb6, 0x51, 0x2e, 0x71, 0xc5, 0xc2, 0xf0, 0x5f } } -#endif - #define NS_EVENTLISTENERSERVICE_CID \ { /* baa34652-f1f1-4185-b224-244ee82a413a */ \ 0xbaa34652, 0xf1f1, 0x4185, \ diff --git a/content/base/public/nsIDocument.h b/content/base/public/nsIDocument.h index a3e938ec71d..ab2d66c09ee 100644 --- a/content/base/public/nsIDocument.h +++ b/content/base/public/nsIDocument.h @@ -2490,10 +2490,8 @@ NS_NewSVGDocument(nsIDocument** aInstancePtrResult); nsresult NS_NewImageDocument(nsIDocument** aInstancePtrResult); -#ifdef MOZ_MEDIA nsresult NS_NewVideoDocument(nsIDocument** aInstancePtrResult); -#endif already_AddRefed NS_NewDocumentFragment(nsNodeInfoManager* aNodeInfoManager, diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp index a9c0f4b0d36..19f7700be71 100644 --- a/content/base/src/nsContentUtils.cpp +++ b/content/base/src/nsContentUtils.cpp @@ -30,6 +30,7 @@ #include "mozilla/DebugOnly.h" #include "mozilla/dom/DocumentFragment.h" #include "mozilla/dom/Element.h" +#include "mozilla/dom/HTMLMediaElement.h" #include "mozilla/dom/HTMLTemplateElement.h" #include "mozilla/dom/TextDecoderBase.h" #include "mozilla/Likely.h" @@ -168,9 +169,6 @@ #ifdef IBMBIDI #include "nsIBidiKeyboard.h" #endif -#ifdef MOZ_MEDIA -#include "mozilla/dom/HTMLMediaElement.h" -#endif extern "C" int MOZ_XMLTranslateEntity(const char* ptr, const char* end, const char** next, PRUnichar* result); @@ -1268,9 +1266,7 @@ nsContentUtils::IsHTMLVoid(nsIAtom* aLocalName) (aLocalName == nsGkAtoms::link) || (aLocalName == nsGkAtoms::meta) || (aLocalName == nsGkAtoms::param) || -#ifdef MOZ_MEDIA (aLocalName == nsGkAtoms::source) || -#endif (aLocalName == nsGkAtoms::track) || (aLocalName == nsGkAtoms::wbr); } @@ -6453,7 +6449,6 @@ nsContentUtils::FindInternalContentViewer(const char* aType, return docFactory.forget(); } -#ifdef MOZ_MEDIA if (DecoderTraits::IsSupportedInVideoDocument(nsDependentCString(aType))) { docFactory = do_GetService("@mozilla.org/content/document-loader-factory;1"); if (docFactory && aLoaderType) { @@ -6461,7 +6456,6 @@ nsContentUtils::FindInternalContentViewer(const char* aType, } return docFactory.forget(); } -#endif // MOZ_MEDIA return nullptr; } diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 648c1596274..43e9e8ee263 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -148,9 +148,7 @@ #include "nsObjectLoadingContent.h" #include "nsHtml5TreeOpExecutor.h" #include "nsIDOMElementReplaceEvent.h" -#ifdef MOZ_MEDIA #include "mozilla/dom/HTMLMediaElement.h" -#endif // MOZ_MEDIA #ifdef MOZ_WEBRTC #include "IPeerConnection.h" #endif // MOZ_WEBRTC @@ -4060,13 +4058,11 @@ nsDocument::SetScopeObject(nsIGlobalObject* aGlobal) static void NotifyActivityChanged(nsIContent *aContent, void *aUnused) { -#ifdef MOZ_MEDIA nsCOMPtr domMediaElem(do_QueryInterface(aContent)); if (domMediaElem) { HTMLMediaElement* mediaElem = static_cast(aContent); mediaElem->NotifyOwnerDocumentActivityChanged(); } -#endif nsCOMPtr objectLoadingContent(do_QueryInterface(aContent)); if (objectLoadingContent) { nsObjectLoadingContent* olc = static_cast(objectLoadingContent.get()); @@ -9016,13 +9012,11 @@ nsDocument::AddImage(imgIRequest* aImage) static void NotifyAudioAvailableListener(nsIContent *aContent, void *aUnused) { -#ifdef MOZ_MEDIA nsCOMPtr domMediaElem(do_QueryInterface(aContent)); if (domMediaElem) { HTMLMediaElement* mediaElem = static_cast(aContent); mediaElem->NotifyAudioAvailableListener(); } -#endif } void diff --git a/content/base/src/nsNodeUtils.cpp b/content/base/src/nsNodeUtils.cpp index b472c8438c0..d7b73b06c7e 100644 --- a/content/base/src/nsNodeUtils.cpp +++ b/content/base/src/nsNodeUtils.cpp @@ -24,9 +24,7 @@ #endif #include "nsBindingManager.h" #include "nsGenericHTMLElement.h" -#ifdef MOZ_MEDIA #include "mozilla/dom/HTMLMediaElement.h" -#endif // MOZ_MEDIA #include "nsWrapperCacheInlines.h" #include "nsObjectLoadingContent.h" #include "nsDOMMutationObserver.h" @@ -491,11 +489,9 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep, if (elm->MayHavePaintEventListener()) { window->SetHasPaintEventListeners(); } -#ifdef MOZ_MEDIA if (elm->MayHaveAudioAvailableEventListener()) { window->SetHasAudioAvailableEventListeners(); } -#endif if (elm->MayHaveTouchEventListener()) { window->SetHasTouchEventListeners(); } @@ -507,13 +503,11 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep, } if (wasRegistered && oldDoc != newDoc) { -#ifdef MOZ_MEDIA nsCOMPtr domMediaElem(do_QueryInterface(aNode)); if (domMediaElem) { HTMLMediaElement* mediaElem = static_cast(aNode); mediaElem->NotifyOwnerDocumentActivityChanged(); } -#endif nsCOMPtr objectLoadingContent(do_QueryInterface(aNode)); if (objectLoadingContent) { nsObjectLoadingContent* olc = static_cast(objectLoadingContent.get()); diff --git a/content/base/src/nsTreeSanitizer.cpp b/content/base/src/nsTreeSanitizer.cpp index 78f3af8b442..c1722f8fc03 100644 --- a/content/base/src/nsTreeSanitizer.cpp +++ b/content/base/src/nsTreeSanitizer.cpp @@ -36,9 +36,7 @@ nsIAtom** const kElementsHTML[] = { &nsGkAtoms::area, &nsGkAtoms::article, &nsGkAtoms::aside, -#ifdef MOZ_MEDIA &nsGkAtoms::audio, -#endif &nsGkAtoms::b, &nsGkAtoms::bdi, &nsGkAtoms::bdo, @@ -116,9 +114,7 @@ nsIAtom** const kElementsHTML[] = { &nsGkAtoms::section, &nsGkAtoms::select, &nsGkAtoms::small, -#ifdef MOZ_MEDIA &nsGkAtoms::source, -#endif &nsGkAtoms::span, &nsGkAtoms::strike, &nsGkAtoms::strong, @@ -136,16 +132,12 @@ nsIAtom** const kElementsHTML[] = { &nsGkAtoms::time, // title checked specially &nsGkAtoms::tr, -#ifdef MOZ_MEDIA &nsGkAtoms::track, -#endif &nsGkAtoms::tt, &nsGkAtoms::u, &nsGkAtoms::ul, &nsGkAtoms::var, -#ifdef MOZ_MEDIA &nsGkAtoms::video, -#endif &nsGkAtoms::wbr, nullptr }; @@ -159,9 +151,7 @@ nsIAtom** const kAttributesHTML[] = { &nsGkAtoms::alt, &nsGkAtoms::autocomplete, &nsGkAtoms::autofocus, -#ifdef MOZ_MEDIA &nsGkAtoms::autoplay, -#endif &nsGkAtoms::axis, &nsGkAtoms::_char, &nsGkAtoms::charoff, @@ -174,9 +164,7 @@ nsIAtom** const kAttributesHTML[] = { &nsGkAtoms::content, &nsGkAtoms::contenteditable, &nsGkAtoms::contextmenu, -#ifdef MOZ_MEDIA &nsGkAtoms::controls, -#endif &nsGkAtoms::coords, &nsGkAtoms::datetime, &nsGkAtoms::dir, @@ -205,9 +193,7 @@ nsIAtom** const kAttributesHTML[] = { &nsGkAtoms::lang, &nsGkAtoms::list, &nsGkAtoms::longdesc, -#ifdef MOZ_MEDIA &nsGkAtoms::loop, -#endif &nsGkAtoms::low, &nsGkAtoms::max, &nsGkAtoms::maxlength, @@ -216,9 +202,7 @@ nsIAtom** const kAttributesHTML[] = { &nsGkAtoms::min, &nsGkAtoms::mozdonotsend, &nsGkAtoms::multiple, -#ifdef MOZ_MEDIA &nsGkAtoms::muted, -#endif &nsGkAtoms::name, &nsGkAtoms::nohref, &nsGkAtoms::novalidate, @@ -227,13 +211,9 @@ nsIAtom** const kAttributesHTML[] = { &nsGkAtoms::optimum, &nsGkAtoms::pattern, &nsGkAtoms::placeholder, -#ifdef MOZ_MEDIA &nsGkAtoms::playbackrate, -#endif -#ifdef MOZ_MEDIA &nsGkAtoms::poster, &nsGkAtoms::preload, -#endif &nsGkAtoms::prompt, &nsGkAtoms::pubdate, &nsGkAtoms::radiogroup, @@ -1051,14 +1031,10 @@ nsTreeSanitizer::MustPrune(int32_t aNamespace, nsGkAtoms::datalist == aLocal)) { return true; } - if (mDropMedia && (nsGkAtoms::img == aLocal -#ifdef MOZ_MEDIA - || + if (mDropMedia && (nsGkAtoms::img == aLocal || nsGkAtoms::video == aLocal || nsGkAtoms::audio == aLocal || - nsGkAtoms::source == aLocal -#endif - )) { + nsGkAtoms::source == aLocal)) { return true; } if (nsGkAtoms::meta == aLocal && @@ -1298,7 +1274,6 @@ nsTreeSanitizer::SanitizeAttributes(mozilla::dom::Element* aElement, i = ac; // i will be decremented immediately thanks to the for loop } -#ifdef MOZ_MEDIA // If we've got HTML audio or video, add the controls attribute, because // otherwise the content is unplayable with scripts removed. if (aElement->IsHTML(nsGkAtoms::video) || @@ -1308,7 +1283,6 @@ nsTreeSanitizer::SanitizeAttributes(mozilla::dom::Element* aElement, EmptyString(), false); } -#endif } bool diff --git a/content/base/src/nsXHTMLContentSerializer.cpp b/content/base/src/nsXHTMLContentSerializer.cpp index e51fdfd8d4c..5f707251b49 100644 --- a/content/base/src/nsXHTMLContentSerializer.cpp +++ b/content/base/src/nsXHTMLContentSerializer.cpp @@ -705,14 +705,12 @@ nsXHTMLContentSerializer::IsShorthandAttr(const nsIAtom* aAttrName, return true; } -#ifdef MOZ_MEDIA // autoplay and controls if ((aElementName == nsGkAtoms::video || aElementName == nsGkAtoms::audio) && (aAttrName == nsGkAtoms::autoplay || aAttrName == nsGkAtoms::muted || aAttrName == nsGkAtoms::controls)) { return true; } -#endif return false; } diff --git a/content/events/src/nsEventListenerManager.cpp b/content/events/src/nsEventListenerManager.cpp index c06b3189f5f..fb265c7099f 100644 --- a/content/events/src/nsEventListenerManager.cpp +++ b/content/events/src/nsEventListenerManager.cpp @@ -262,14 +262,12 @@ nsEventListenerManager::AddEventListenerInternal( if (window) { window->SetHasPaintEventListeners(); } -#ifdef MOZ_MEDIA } else if (aType == NS_MOZAUDIOAVAILABLE) { mMayHaveAudioAvailableEventListener = true; nsPIDOMWindow* window = GetInnerWindowForTarget(); if (window) { window->SetHasAudioAvailableEventListeners(); } -#endif // MOZ_MEDIA } else if (aType >= NS_MUTATION_START && aType <= NS_MUTATION_END) { // For mutation listeners, we need to update the global bit on the DOM window. // Otherwise we won't actually fire the mutation event. diff --git a/content/html/content/src/Makefile.in b/content/html/content/src/Makefile.in index a63b0f7bd8f..42f35735c0a 100644 --- a/content/html/content/src/Makefile.in +++ b/content/html/content/src/Makefile.in @@ -63,6 +63,7 @@ EXPORTS_mozilla/dom = \ HTMLSharedElement.h \ HTMLSharedListElement.h \ HTMLSharedObjectElement.h \ + HTMLSourceElement.h \ HTMLSpanElement.h \ HTMLStyleElement.h \ HTMLTableCaptionElement.h \ @@ -76,6 +77,7 @@ EXPORTS_mozilla/dom = \ HTMLTimeElement.h \ HTMLTitleElement.h \ HTMLUnknownElement.h \ + MediaError.h \ TimeRanges.h \ UndoManager.h \ ValidityState.h \ @@ -92,6 +94,7 @@ CPPSRCS = \ HTMLElement.cpp \ HTMLAnchorElement.cpp \ HTMLAreaElement.cpp \ + HTMLAudioElement.cpp \ HTMLBRElement.cpp \ HTMLBodyElement.cpp \ HTMLButtonElement.cpp \ @@ -114,6 +117,7 @@ CPPSRCS = \ HTMLLegendElement.cpp \ HTMLLinkElement.cpp \ HTMLMapElement.cpp \ + HTMLMediaElement.cpp \ HTMLMenuElement.cpp \ HTMLMenuItemElement.cpp \ HTMLMetaElement.cpp \ @@ -132,6 +136,7 @@ CPPSRCS = \ HTMLSelectElement.cpp \ HTMLSharedElement.cpp \ HTMLSharedListElement.cpp \ + HTMLSourceElement.cpp \ HTMLSpanElement.cpp \ HTMLStyleElement.cpp \ HTMLTableElement.cpp \ @@ -144,7 +149,10 @@ CPPSRCS = \ HTMLTextAreaElement.cpp \ HTMLTimeElement.cpp \ HTMLTitleElement.cpp \ + HTMLVideoElement.cpp \ HTMLUnknownElement.cpp \ + MediaError.cpp \ + TimeRanges.cpp \ ValidityState.cpp \ nsIConstraintValidation.cpp \ nsRadioVisitor.cpp \ @@ -152,22 +160,6 @@ CPPSRCS = \ UndoManager.cpp \ $(NULL) -ifdef MOZ_MEDIA -EXPORTS_mozilla/dom += \ - HTMLSourceElement.h \ - MediaError.h \ - $(NULL) - -CPPSRCS += \ - HTMLAudioElement.cpp \ - HTMLMediaElement.cpp \ - MediaError.cpp \ - HTMLSourceElement.cpp \ - TimeRanges.cpp \ - HTMLVideoElement.cpp \ - $(NULL) -endif - # we don't want the shared lib, but we want to force the creation of a static lib. FORCE_STATIC_LIB = 1 diff --git a/content/html/content/src/nsGenericHTMLElement.h b/content/html/content/src/nsGenericHTMLElement.h index 8353d3388fb..22f13cdbed2 100644 --- a/content/html/content/src/nsGenericHTMLElement.h +++ b/content/html/content/src/nsGenericHTMLElement.h @@ -1912,9 +1912,7 @@ NS_DECLARE_NS_NEW_HTML_ELEMENT(SharedObject) NS_DECLARE_NS_NEW_HTML_ELEMENT(Anchor) NS_DECLARE_NS_NEW_HTML_ELEMENT(Area) -#if defined(MOZ_MEDIA) NS_DECLARE_NS_NEW_HTML_ELEMENT(Audio) -#endif NS_DECLARE_NS_NEW_HTML_ELEMENT(BR) NS_DECLARE_NS_NEW_HTML_ELEMENT(Body) NS_DECLARE_NS_NEW_HTML_ELEMENT(Button) @@ -1953,9 +1951,7 @@ NS_DECLARE_NS_NEW_HTML_ELEMENT(Pre) NS_DECLARE_NS_NEW_HTML_ELEMENT(Progress) NS_DECLARE_NS_NEW_HTML_ELEMENT(Script) NS_DECLARE_NS_NEW_HTML_ELEMENT(Select) -#if defined(MOZ_MEDIA) NS_DECLARE_NS_NEW_HTML_ELEMENT(Source) -#endif NS_DECLARE_NS_NEW_HTML_ELEMENT(Span) NS_DECLARE_NS_NEW_HTML_ELEMENT(Style) NS_DECLARE_NS_NEW_HTML_ELEMENT(TableCaption) @@ -1972,9 +1968,7 @@ NS_DECLARE_NS_NEW_HTML_ELEMENT(Thead) NS_DECLARE_NS_NEW_HTML_ELEMENT(Time) NS_DECLARE_NS_NEW_HTML_ELEMENT(Title) NS_DECLARE_NS_NEW_HTML_ELEMENT(Unknown) -#if defined(MOZ_MEDIA) NS_DECLARE_NS_NEW_HTML_ELEMENT(Video) -#endif inline nsISupports* ToSupports(nsGenericHTMLElement* aHTMLElement) diff --git a/content/html/content/test/Makefile.in b/content/html/content/test/Makefile.in index 90f333937cd..93f41574a33 100644 --- a/content/html/content/test/Makefile.in +++ b/content/html/content/test/Makefile.in @@ -345,6 +345,7 @@ MOCHITEST_FILES = \ test_meta_attributes_reflection.html \ test_mod_attributes_reflection.html \ test_mozaudiochannel.html \ + test_mozLoadFrom.html \ test_style_attributes_reflection.html \ test_bug629801.html \ test_bug839371.html \ @@ -352,12 +353,6 @@ MOCHITEST_FILES = \ test_formData.html \ $(NULL) -ifdef MOZ_MEDIA -MOCHITEST_FILES += \ - test_mozLoadFrom.html \ - $(NULL) -endif - MOCHITEST_BROWSER_FILES = \ browser_bug649778.js \ file_bug649778.html \ diff --git a/content/html/document/src/Makefile.in b/content/html/document/src/Makefile.in index 099e8f3b1fb..b9556cc7dee 100644 --- a/content/html/document/src/Makefile.in +++ b/content/html/document/src/Makefile.in @@ -20,12 +20,9 @@ CPPSRCS = \ ImageDocument.cpp \ MediaDocument.cpp \ PluginDocument.cpp \ + VideoDocument.cpp \ $(NULL) -ifdef MOZ_MEDIA -CPPSRCS += VideoDocument.cpp -endif - EXPORTS = \ nsIHTMLDocument.h \ $(NULL) diff --git a/content/html/document/src/nsHTMLContentSink.cpp b/content/html/document/src/nsHTMLContentSink.cpp index 6e50f42f058..0e16fc7147f 100644 --- a/content/html/document/src/nsHTMLContentSink.cpp +++ b/content/html/document/src/nsHTMLContentSink.cpp @@ -680,10 +680,8 @@ SinkContext::OpenContainer(const nsIParserNode& aNode) break; case eHTMLTag_button: -#ifdef MOZ_MEDIA case eHTMLTag_audio: case eHTMLTag_video: -#endif content->DoneCreatingElement(); break; @@ -792,10 +790,8 @@ SinkContext::CloseContainer(const nsHTMLTag aTag) MOZ_NOT_REACHED("Must not use HTMLContentSink for forms."); break; -#ifdef MOZ_MEDIA case eHTMLTag_video: case eHTMLTag_audio: -#endif case eHTMLTag_select: case eHTMLTag_textarea: case eHTMLTag_object: diff --git a/content/moz.build b/content/moz.build index 153b09d012f..a96e8000b2d 100644 --- a/content/moz.build +++ b/content/moz.build @@ -10,6 +10,7 @@ PARALLEL_DIRS += [ 'events', 'html', 'mathml/content/src', + 'media', 'smil', 'svg', 'xml', @@ -18,9 +19,6 @@ PARALLEL_DIRS += [ 'xslt', ] -if CONFIG['MOZ_MEDIA']: - PARALLEL_DIRS += ['media'] - TEST_TOOL_DIRS += ['test'] MODULE = 'content' diff --git a/content/xml/document/src/nsXMLContentSink.cpp b/content/xml/document/src/nsXMLContentSink.cpp index 7d782dfa723..fd10496daa6 100644 --- a/content/xml/document/src/nsXMLContentSink.cpp +++ b/content/xml/document/src/nsXMLContentSink.cpp @@ -525,10 +525,8 @@ nsXMLContentSink::CloseElement(nsIContent* aContent) if ((nodeInfo->NamespaceID() == kNameSpaceID_XHTML && (nodeInfo->NameAtom() == nsGkAtoms::select || nodeInfo->NameAtom() == nsGkAtoms::textarea || -#ifdef MOZ_MEDIA nodeInfo->NameAtom() == nsGkAtoms::video || nodeInfo->NameAtom() == nsGkAtoms::audio || -#endif nodeInfo->NameAtom() == nsGkAtoms::object || nodeInfo->NameAtom() == nsGkAtoms::applet)) || nodeInfo->NameAtom() == nsGkAtoms::title @@ -1028,13 +1026,9 @@ nsXMLContentSink::HandleStartElement(const PRUnichar *aName, if (nodeInfo->NamespaceID() == kNameSpaceID_XHTML) { if (nodeInfo->NameAtom() == nsGkAtoms::input || nodeInfo->NameAtom() == nsGkAtoms::button || - nodeInfo->NameAtom() == nsGkAtoms::menuitem -#ifdef MOZ_MEDIA - || + nodeInfo->NameAtom() == nsGkAtoms::menuitem || nodeInfo->NameAtom() == nsGkAtoms::audio || - nodeInfo->NameAtom() == nsGkAtoms::video -#endif - ) { + nodeInfo->NameAtom() == nsGkAtoms::video) { content->DoneCreatingElement(); } else if (nodeInfo->NameAtom() == nsGkAtoms::head && !mCurrentHead) { mCurrentHead = content; diff --git a/content/xslt/src/xslt/txMozillaXMLOutput.cpp b/content/xslt/src/xslt/txMozillaXMLOutput.cpp index 3d737e748e4..4ea7d8df454 100644 --- a/content/xslt/src/xslt/txMozillaXMLOutput.cpp +++ b/content/xslt/src/xslt/txMozillaXMLOutput.cpp @@ -309,13 +309,9 @@ txMozillaXMLOutput::endElement() } else if (ns == kNameSpaceID_XHTML && (localName == nsGkAtoms::input || localName == nsGkAtoms::button || - localName == nsGkAtoms::menuitem -#ifdef MOZ_MEDIA - || + localName == nsGkAtoms::menuitem || localName == nsGkAtoms::audio || - localName == nsGkAtoms::video -#endif - )) { + localName == nsGkAtoms::video)) { element->DoneCreatingElement(); } }