[MathML] Should support conditional compilation
https://bugs.webkit.org/show_bug.cgi?id=204958

Reviewed by Ross Kirsling.

No new tests. No change in behavior.

Add missing checks for ENABLE_MATHML in the idl and cpp files.

* bindings/js/JSElementCustom.cpp:
(WebCore::createNewElementWrapper):
* bindings/js/JSNodeCustom.cpp:
(WebCore::createWrapperInline):
* mathml/MathMLElement.idl:
* mathml/MathMLMathElement.idl:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@253227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index cc99f0d..897d896 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2019-12-06  Don Olmstead  <don.olmstead@sony.com>
+
+        [MathML] Should support conditional compilation
+        https://bugs.webkit.org/show_bug.cgi?id=204958
+
+        Reviewed by Ross Kirsling.
+
+        No new tests. No change in behavior.
+
+        Add missing checks for ENABLE_MATHML in the idl and cpp files.
+
+        * bindings/js/JSElementCustom.cpp:
+        (WebCore::createNewElementWrapper):
+        * bindings/js/JSNodeCustom.cpp:
+        (WebCore::createWrapperInline):
+        * mathml/MathMLElement.idl:
+        * mathml/MathMLMathElement.idl:
+
 2019-12-06  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: add compiler UNLIKELY hints when checking if developer extras are enabled
diff --git a/Source/WebCore/bindings/js/JSElementCustom.cpp b/Source/WebCore/bindings/js/JSElementCustom.cpp
index 10f9974..c07d1eb 100644
--- a/Source/WebCore/bindings/js/JSElementCustom.cpp
+++ b/Source/WebCore/bindings/js/JSElementCustom.cpp
@@ -55,8 +55,10 @@
         return createJSHTMLWrapper(globalObject, static_reference_cast<HTMLElement>(WTFMove(element)));
     if (is<SVGElement>(element))
         return createJSSVGWrapper(globalObject, static_reference_cast<SVGElement>(WTFMove(element)));
+#if ENABLE(MATHML)
     if (is<MathMLElement>(element))
         return createJSMathMLWrapper(globalObject, static_reference_cast<MathMLElement>(WTFMove(element)));
+#endif
     return createWrapper<Element>(globalObject, WTFMove(element));
 }
 
diff --git a/Source/WebCore/bindings/js/JSNodeCustom.cpp b/Source/WebCore/bindings/js/JSNodeCustom.cpp
index d3ddfac..687df0d 100644
--- a/Source/WebCore/bindings/js/JSNodeCustom.cpp
+++ b/Source/WebCore/bindings/js/JSNodeCustom.cpp
@@ -152,8 +152,10 @@
                 wrapper = createJSHTMLWrapper(globalObject, static_reference_cast<HTMLElement>(WTFMove(node)));
             else if (is<SVGElement>(node))
                 wrapper = createJSSVGWrapper(globalObject, static_reference_cast<SVGElement>(WTFMove(node)));
+#if ENABLE(MATHML)
             else if (is<MathMLElement>(node))
                 wrapper = createJSMathMLWrapper(globalObject, static_reference_cast<MathMLElement>(WTFMove(node)));
+#endif
             else
                 wrapper = createWrapper<Element>(globalObject, WTFMove(node));
             break;
diff --git a/Source/WebCore/mathml/MathMLElement.idl b/Source/WebCore/mathml/MathMLElement.idl
index e9ad8e4..3d45fd2 100644
--- a/Source/WebCore/mathml/MathMLElement.idl
+++ b/Source/WebCore/mathml/MathMLElement.idl
@@ -24,6 +24,7 @@
  */
 
 [
+    Conditional=MATHML,
     JSGenerateToNativeObject,
 ] interface MathMLElement : Element { };
 
diff --git a/Source/WebCore/mathml/MathMLMathElement.idl b/Source/WebCore/mathml/MathMLMathElement.idl
index 9c25fb2..866409b 100644
--- a/Source/WebCore/mathml/MathMLMathElement.idl
+++ b/Source/WebCore/mathml/MathMLMathElement.idl
@@ -23,4 +23,6 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-interface MathMLMathElement : MathMLElement { };
+[
+    Conditional=MATHML
+] interface MathMLMathElement : MathMLElement { };