Title: [205202] trunk
Revision
205202
Author
[email protected]
Date
2016-08-30 15:29:42 -0700 (Tue, 30 Aug 2016)

Log Message

Introduce a MathMLUnknownElement class
https://bugs.webkit.org/show_bug.cgi?id=161298

Patch by Frederic Wang <[email protected]> on 2016-08-30
Reviewed by Darin Adler.

Source/WebCore:

For consistency with SVG and HTML, we make MathML elements use a
fallback MathMLUnknownElement class. Like SVG, we ensure that unknown
MathML elements do not create any renderer.

Test: mathml/mathml-unknown.xhtml

* mathml/MathMLUnknownElement.h: Added. This is a simple class for
unknown MathML elements, preventing the creation of renderers.
* mathml/mathtags.in: Map fallbackInterfaceName to MathMLUnknownElement.

LayoutTests:

We add a test to check that non-standard or content MathML elements
are handled by MathMLUnknownElement and so do not create renderers.

* mathml/mathml-unknown-expected.txt: Added.
* mathml/mathml-unknown.xhtml: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (205201 => 205202)


--- trunk/LayoutTests/ChangeLog	2016-08-30 22:28:20 UTC (rev 205201)
+++ trunk/LayoutTests/ChangeLog	2016-08-30 22:29:42 UTC (rev 205202)
@@ -1,3 +1,16 @@
+2016-08-30  Frederic Wang  <[email protected]>
+
+        Introduce a MathMLUnknownElement class
+        https://bugs.webkit.org/show_bug.cgi?id=161298
+
+        Reviewed by Darin Adler.
+
+        We add a test to check that non-standard or content MathML elements
+        are handled by MathMLUnknownElement and so do not create renderers.
+
+        * mathml/mathml-unknown-expected.txt: Added.
+        * mathml/mathml-unknown.xhtml: Added.
+
 2016-08-30  Chris Dumez  <[email protected]>
 
         [[Delete]] should throw for cross-origin Window / Location objects

Added: trunk/LayoutTests/mathml/mathml-unknown-expected.txt (0 => 205202)


--- trunk/LayoutTests/mathml/mathml-unknown-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/mathml/mathml-unknown-expected.txt	2016-08-30 22:29:42 UTC (rev 205202)
@@ -0,0 +1,5 @@
+This test passes if the unknown MathML elements do not create any renderer.
+
+Content MathML element: 
+
+Non-standard MathML element:

Added: trunk/LayoutTests/mathml/mathml-unknown.xhtml (0 => 205202)


--- trunk/LayoutTests/mathml/mathml-unknown.xhtml	                        (rev 0)
+++ trunk/LayoutTests/mathml/mathml-unknown.xhtml	2016-08-30 22:29:42 UTC (rev 205202)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC
+    "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
+    "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Unknown MathML elements</title>
+  <script>
+    if (window.testRunner)
+      testRunner.dumpAsText();
+  </script>
+</head>
+<body>
+  <p>This test passes if the unknown MathML elements do not create any renderer.</p>
+  <p>Content MathML element: <math xmlns="http://www.w3.org/1998/Math/MathML"><csymbol><mtext>FAIL</mtext></csymbol></math></p>
+  <p>Non-standard MathML element: <non-standard xmlns="http://www.w3.org/1998/Math/MathML"><mtext>FAIL</mtext></non-standard></p>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (205201 => 205202)


--- trunk/Source/WebCore/ChangeLog	2016-08-30 22:28:20 UTC (rev 205201)
+++ trunk/Source/WebCore/ChangeLog	2016-08-30 22:29:42 UTC (rev 205202)
@@ -1,3 +1,20 @@
+2016-08-30  Frederic Wang  <[email protected]>
+
+        Introduce a MathMLUnknownElement class
+        https://bugs.webkit.org/show_bug.cgi?id=161298
+
+        Reviewed by Darin Adler.
+
+        For consistency with SVG and HTML, we make MathML elements use a
+        fallback MathMLUnknownElement class. Like SVG, we ensure that unknown
+        MathML elements do not create any renderer.
+
+        Test: mathml/mathml-unknown.xhtml
+
+        * mathml/MathMLUnknownElement.h: Added. This is a simple class for
+        unknown MathML elements, preventing the creation of renderers.
+        * mathml/mathtags.in: Map fallbackInterfaceName to MathMLUnknownElement.
+
 2016-08-30  Chris Dumez  <[email protected]>
 
         [[Delete]] should throw for cross-origin Window / Location objects

Added: trunk/Source/WebCore/mathml/MathMLUnknownElement.h (0 => 205202)


--- trunk/Source/WebCore/mathml/MathMLUnknownElement.h	                        (rev 0)
+++ trunk/Source/WebCore/mathml/MathMLUnknownElement.h	2016-08-30 22:29:42 UTC (rev 205202)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2016 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MathMLUnknownElement_h
+#define MathMLUnknownElement_h
+
+#include "MathMLElement.h"
+
+namespace WebCore {
+
+class MathMLUnknownElement final : public MathMLElement {
+public:
+    static Ref<MathMLUnknownElement> create(const QualifiedName& tagName, Document& document)
+    {
+        return adoptRef(*new MathMLUnknownElement(tagName, document));
+    }
+
+private:
+    MathMLUnknownElement(const QualifiedName& tagName, Document& document)
+        : MathMLElement(tagName, document)
+    {
+    }
+
+    bool rendererIsNeeded(const RenderStyle&) final { return false; }
+};
+
+} // namespace WebCore
+
+#endif // MathMLUnknownElement_h

Modified: trunk/Source/WebCore/mathml/mathtags.in (205201 => 205202)


--- trunk/Source/WebCore/mathml/mathtags.in	2016-08-30 22:28:20 UTC (rev 205201)
+++ trunk/Source/WebCore/mathml/mathtags.in	2016-08-30 22:29:42 UTC (rev 205202)
@@ -1,7 +1,7 @@
 namespace="MathML"
 namespaceURI="http://www.w3.org/1998/Math/MathML"
 guardFactoryWith="ENABLE(MATHML)"
-fallbackInterfaceName="MathMLElement"
+fallbackInterfaceName="MathMLUnknownElement"
 
 annotation interfaceName=MathMLAnnotationElement
 annotation-xml interfaceName=MathMLAnnotationElement
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to