Diff
Modified: trunk/LayoutTests/ChangeLog (202961 => 202962)
--- trunk/LayoutTests/ChangeLog 2016-07-08 05:51:20 UTC (rev 202961)
+++ trunk/LayoutTests/ChangeLog 2016-07-08 06:16:32 UTC (rev 202962)
@@ -1,5 +1,35 @@
2016-07-07 Frederic Wang <[email protected]>
+ Bug 155792 - Basic implementation of mpadded
+ https://bugs.webkit.org/show_bug.cgi?id=155792
+
+ Reviewed by Brent Fulgham.
+
+ We import mpadded tests from Mozilla test suite.
+ We also add some tests for dynamic changes of mpadded attributes and to verify
+ that the mpadded element behaves as if it had an inferred <mrow>.
+ Finally, we check that fallback properly for negative and pseudo-unit values that
+ we do not support yet.
+
+ * mathml/presentation/inferred-mrow-baseline.html: Check baseline for mpadded.
+ * mathml/presentation/inferred-mrow-baseline-expected.txt: Ditto.
+ * mathml/presentation/inferred-mrow-stretchy.html: Check stretching of operators for mpadded.
+ * mathml/presentation/inferred-mrow-stretchy-expected.txt: Ditto.
+ * mathml/presentation/mpadded-dynamic.html: Added. Verify dynamic change of mpadded attributes.
+ * mathml/presentation/mpadded-dynamic-expected.html: Added. Ditto.
+ * mathml/presentation/mpadded-unsupported-values.html: Added. Check negative and pseudo-unit values.
+ * mathml/presentation/mpadded-unsupported-values-expected.html: Added.
+ * mathml/presentation/mpadded-1-2-expected.html: Added.
+ * mathml/presentation/mpadded-1-2.html: Added.
+ * mathml/presentation/mpadded-1-expected.html: Added.
+ * mathml/presentation/mpadded-1.html: Added.
+ * mathml/presentation/mpadded-2-expected.html: Added.
+ * mathml/presentation/mpadded-2.html: Added.
+ * mathml/presentation/mpadded-3-expected.html: Added.
+ * mathml/presentation/mpadded-3.html: Added.
+
+2016-07-07 Frederic Wang <[email protected]>
+
Implement an internal style property for displaystyle.
https://bugs.webkit.org/show_bug.cgi?id=133845
Modified: trunk/LayoutTests/mathml/presentation/inferred-mrow-baseline-expected.txt (202961 => 202962)
--- trunk/LayoutTests/mathml/presentation/inferred-mrow-baseline-expected.txt 2016-07-08 05:51:20 UTC (rev 202961)
+++ trunk/LayoutTests/mathml/presentation/inferred-mrow-baseline-expected.txt 2016-07-08 06:16:32 UTC (rev 202962)
@@ -6,6 +6,7 @@
+
PASS baseline alignment inside Mrow
@@ -15,4 +16,5 @@
PASS baseline alignment inside Phantom
PASS baseline alignment inside Math
PASS baseline alignment inside Menclose
+PASS baseline alignment inside Mpadded
Modified: trunk/LayoutTests/mathml/presentation/inferred-mrow-baseline.html (202961 => 202962)
--- trunk/LayoutTests/mathml/presentation/inferred-mrow-baseline.html 2016-07-08 05:51:20 UTC (rev 202961)
+++ trunk/LayoutTests/mathml/presentation/inferred-mrow-baseline.html 2016-07-08 06:16:32 UTC (rev 202962)
@@ -8,7 +8,7 @@
setup({ "explicit_done": true });
function run()
{
- var tags = ["Mrow", "Sqrt", "Style", "Error", "Phantom", "Math", "Menclose"];
+ var tags = ["Mrow", "Sqrt", "Style", "Error", "Phantom", "Math", "Menclose", "Mpadded"];
for (var i in tags) {
var tag = tags[i];
var x = document.getElementById("above" + tag).getBoundingClientRect();
@@ -39,6 +39,8 @@
<math><mspace id="aboveMath" width="10px" height="30px" mathbackground="red"></mspace><mspace id="belowMath" width="10px" depth="30px" mathbackground="blue"></mspace></math>
<math><menclose notation="box"><mspace id="aboveMenclose" width="10px" height="30px" mathbackground="red"></mspace><mspace id="belowMenclose" width="10px" depth="30px" mathbackground="blue"></mspace></menclose></math>
+
+ <math><mpadded notation="box"><mspace id="aboveMpadded" width="10px" height="30px" mathbackground="red"></mspace><mspace id="belowMpadded" width="10px" depth="30px" mathbackground="blue"></mspace></mpadded></math>
</p>
</body>
Modified: trunk/LayoutTests/mathml/presentation/inferred-mrow-stretchy-expected.txt (202961 => 202962)
--- trunk/LayoutTests/mathml/presentation/inferred-mrow-stretchy-expected.txt 2016-07-08 05:51:20 UTC (rev 202961)
+++ trunk/LayoutTests/mathml/presentation/inferred-mrow-stretchy-expected.txt 2016-07-08 06:16:32 UTC (rev 202962)
@@ -12,6 +12,8 @@
|
|
+
+|
PASS operator stretching inside Mrow
@@ -21,4 +23,5 @@
PASS operator stretching inside Phantom
PASS operator stretching inside Math
PASS operator stretching inside Menclose
+PASS operator stretching inside Mpadded
Modified: trunk/LayoutTests/mathml/presentation/inferred-mrow-stretchy.html (202961 => 202962)
--- trunk/LayoutTests/mathml/presentation/inferred-mrow-stretchy.html 2016-07-08 05:51:20 UTC (rev 202961)
+++ trunk/LayoutTests/mathml/presentation/inferred-mrow-stretchy.html 2016-07-08 06:16:32 UTC (rev 202962)
@@ -8,7 +8,7 @@
setup({ "explicit_done": true });
function run()
{
- var tags = ["Mrow", "Sqrt", "Style", "Error", "Phantom", "Math", "Menclose"];
+ var tags = ["Mrow", "Sqrt", "Style", "Error", "Phantom", "Math", "Menclose", "Mpadded"];
for (var i in tags) {
var tag = tags[i];
var mo = document.getElementById("mo" + tag);
@@ -32,6 +32,7 @@
<math><mphantom><mo style="visibilty: visible;" id="moPhantom">|</mo><mspace width="1px" height="30px" depth="30px" mathbackground="red"></mspace></mphantom></math>
<math><mo id="moMath">|</mo><mspace width="1px" height="30px" depth="30px" mathbackground="red"></mspace></math>
<math><menclose notation="box"><mo id="moMenclose">|</mo><mspace width="1px" height="30px" depth="30px" mathbackground="red"></mspace></menclose></math>
+ <math><mpadded notation="box"><mo id="moMpadded">|</mo><mspace width="1px" height="30px" depth="30px" mathbackground="red"></mspace></mpadded></math>
</p>
</body>
Added: trunk/LayoutTests/mathml/presentation/mpadded-1-2-expected.html (0 => 202962)
--- trunk/LayoutTests/mathml/presentation/mpadded-1-2-expected.html (rev 0)
+++ trunk/LayoutTests/mathml/presentation/mpadded-1-2-expected.html 2016-07-08 06:16:32 UTC (rev 202962)
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ <style type="text/css">
+ div#bigsquare {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: blue;
+ }
+
+ div#smallsquare {
+ position:absolute;
+ width: 20px;
+ height: 20px;
+ left: 20px;
+ top: 60px;
+ background: red;
+ }
+ /*left = lspace = 20px;
+ top = heightBig - voffset - heightSmall;
+ = 50 + 20 - 10
+ = 60px */
+ </style>
+ </head>
+ <body>
+ <div id="bigsquare">
+ <div id="smallsquare">
+ </div>
+ </div>
+ </body>
+<html>
Property changes on: trunk/LayoutTests/mathml/presentation/mpadded-1-2-expected.html
___________________________________________________________________
Added: svn:eol-style
+LF
\ No newline at end of property
Added: svn:mime-type
+text/html
\ No newline at end of property
Added: trunk/LayoutTests/mathml/presentation/mpadded-1-2.html (0 => 202962)
--- trunk/LayoutTests/mathml/presentation/mpadded-1-2.html (rev 0)
+++ trunk/LayoutTests/mathml/presentation/mpadded-1-2.html 2016-07-08 06:16:32 UTC (rev 202962)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math style="padding: 0;">
+ <mpadded mathbackground="blue" width="100px" height="50px" depth="50px"
+ lspace="20px" voffset="-20px">
+ <mpadded mathbackground="red" width="20px" height="10px"
+ depth="10px">
+ </mpadded>
+ </mpadded>
+ </math>
+ </body>
+</html>
Property changes on: trunk/LayoutTests/mathml/presentation/mpadded-1-2.html
___________________________________________________________________
Added: svn:eol-style
+LF
\ No newline at end of property
Added: svn:mime-type
+text/html
\ No newline at end of property
Added: trunk/LayoutTests/mathml/presentation/mpadded-1-expected.html (0 => 202962)
--- trunk/LayoutTests/mathml/presentation/mpadded-1-expected.html (rev 0)
+++ trunk/LayoutTests/mathml/presentation/mpadded-1-expected.html 2016-07-08 06:16:32 UTC (rev 202962)
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ <style type="text/css">
+ div#bigsquare {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: blue;
+ }
+
+ div#smallsquare {
+ position:absolute;
+ width: 20px;
+ height: 20px;
+ left: 20px;
+ top: 10px;
+ background: red;
+ }
+ /*left = lspace = 20px;
+ top = heightBig - voffset - heightSmall;
+ = 50 - 30 - 10
+ = 10px */
+ </style>
+ </head>
+ <body>
+ <div id="bigsquare">
+ <div id="smallsquare">
+ </div>
+ </div>
+ </body>
+<html>
Property changes on: trunk/LayoutTests/mathml/presentation/mpadded-1-expected.html
___________________________________________________________________
Added: svn:eol-style
+LF
\ No newline at end of property
Added: svn:mime-type
+text/html
\ No newline at end of property
Added: trunk/LayoutTests/mathml/presentation/mpadded-1.html (0 => 202962)
--- trunk/LayoutTests/mathml/presentation/mpadded-1.html (rev 0)
+++ trunk/LayoutTests/mathml/presentation/mpadded-1.html 2016-07-08 06:16:32 UTC (rev 202962)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math style="padding: 0;">
+ <mpadded mathbackground="blue" width="100px" height="50px" depth="50px"
+ lspace="20px" voffset="30px">
+ <mpadded mathbackground="red" width="20px" height="10px"
+ depth="10px">
+ </mpadded>
+ </mpadded>
+ </math>
+ </body>
+</html>
Property changes on: trunk/LayoutTests/mathml/presentation/mpadded-1.html
___________________________________________________________________
Added: svn:eol-style
+LF
\ No newline at end of property
Added: svn:mime-type
+text/html
\ No newline at end of property
Added: trunk/LayoutTests/mathml/presentation/mpadded-2-expected.html (0 => 202962)
--- trunk/LayoutTests/mathml/presentation/mpadded-2-expected.html (rev 0)
+++ trunk/LayoutTests/mathml/presentation/mpadded-2-expected.html 2016-07-08 06:16:32 UTC (rev 202962)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ <style type="text/css">
+ div#square1 {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: blue;
+ }
+
+ div#square2 {
+ position:absolute;
+ width: 20px;
+ height: 20px;
+ left: 10px;
+ top: 55px;
+ background: red;
+ }
+ /* left = lspace = 10;
+ top = heightBig - heightSmall - voffset;
+ top = 50 - 10 + 15 = 55px */
+ </style>
+ </head>
+ <body>
+ <div id="square1">
+ <div id="square2">
+ </div>
+ </div>
+ </body>
+<html>
Property changes on: trunk/LayoutTests/mathml/presentation/mpadded-2-expected.html
___________________________________________________________________
Added: svn:eol-style
+LF
\ No newline at end of property
Added: svn:mime-type
+text/html
\ No newline at end of property
Added: trunk/LayoutTests/mathml/presentation/mpadded-2.html (0 => 202962)
--- trunk/LayoutTests/mathml/presentation/mpadded-2.html (rev 0)
+++ trunk/LayoutTests/mathml/presentation/mpadded-2.html 2016-07-08 06:16:32 UTC (rev 202962)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math style="padding: 0;">
+ <mpadded mathbackground="blue" width="100px" height="50px" depth="50px"
+ lspace="10px" voffset="-15px">
+ <mpadded mathbackground="red" width="20px" height="10px"
+ depth="10px">
+ </mpadded>
+ </mpadded>
+ </math>
+ </body>
+</html>
Property changes on: trunk/LayoutTests/mathml/presentation/mpadded-2.html
___________________________________________________________________
Added: svn:eol-style
+LF
\ No newline at end of property
Added: svn:mime-type
+text/html
\ No newline at end of property
Added: trunk/LayoutTests/mathml/presentation/mpadded-3-expected.html (0 => 202962)
--- trunk/LayoutTests/mathml/presentation/mpadded-3-expected.html (rev 0)
+++ trunk/LayoutTests/mathml/presentation/mpadded-3-expected.html 2016-07-08 06:16:32 UTC (rev 202962)
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded height depth</title>
+ <style type="text/css">
+ div#bigsquare1 {
+ position: absolute;
+ width: 100px;
+ height: 50px;
+ background: blue;
+ }
+
+ div#smallsquare1 {
+ position:absolute;
+ width: 20px;
+ height: 20px;
+ left: 0px;
+ top: 30px;
+ background: red;
+ }
+ /* left = lspace = 0;
+ top = heightBig - heightSmall - voffset;
+ = 50 - 10 - 10*/
+ </style>
+ </head>
+ <body>
+ <div id="bigsquare1">
+ <div id="smallsquare1">
+ </div>
+ </div>
+
+ <div id="bigsquare2">
+ <div id="smallsquare2">
+ </div>
+ </div>
+ </body>
+<html>
Property changes on: trunk/LayoutTests/mathml/presentation/mpadded-3-expected.html
___________________________________________________________________
Added: svn:eol-style
+LF
\ No newline at end of property
Added: svn:mime-type
+text/html
\ No newline at end of property
Added: trunk/LayoutTests/mathml/presentation/mpadded-3.html (0 => 202962)
--- trunk/LayoutTests/mathml/presentation/mpadded-3.html (rev 0)
+++ trunk/LayoutTests/mathml/presentation/mpadded-3.html 2016-07-08 06:16:32 UTC (rev 202962)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded height depth</title>
+ </head>
+ <body>
+ <math style="padding: 0;">
+ <mpadded mathbackground="blue" width="100px" height="50px" depth="0px"
+ lspace="0px" voffset="10px">
+ <mpadded mathbackground="red" width="20px" height="10px"
+ depth="10px">
+ </mpadded>
+ </mpadded>
+ </math>
+ </body>
+</html>
Property changes on: trunk/LayoutTests/mathml/presentation/mpadded-3.html
___________________________________________________________________
Added: svn:eol-style
+LF
\ No newline at end of property
Added: svn:mime-type
+text/html
\ No newline at end of property
Added: trunk/LayoutTests/mathml/presentation/mpadded-4-expected.html (0 => 202962)
--- trunk/LayoutTests/mathml/presentation/mpadded-4-expected.html (rev 0)
+++ trunk/LayoutTests/mathml/presentation/mpadded-4-expected.html 2016-07-08 06:16:32 UTC (rev 202962)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math style="padding: 0;">
+ <mpadded mathbackground="blue" width="100px" height="3height" depth="3depth"
+ lspace="0" voffset="10px">
+ <mpadded mathbackground="red" width="20px" height="10px"
+ depth="10px">
+ </mpadded>
+ </mpadded>
+ </math>
+ </body>
+</html>
Property changes on: trunk/LayoutTests/mathml/presentation/mpadded-4-expected.html
___________________________________________________________________
Added: svn:eol-style
+LF
\ No newline at end of property
Added: svn:mime-type
+text/html
\ No newline at end of property
Added: trunk/LayoutTests/mathml/presentation/mpadded-4.html (0 => 202962)
--- trunk/LayoutTests/mathml/presentation/mpadded-4.html (rev 0)
+++ trunk/LayoutTests/mathml/presentation/mpadded-4.html 2016-07-08 06:16:32 UTC (rev 202962)
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math style="padding: 0;">
+ <!-- if lspace is used as a pseudounit, the lspace value is 0 -->
+ <mpadded mathbackground="blue" width="100px" height="3height" depth="3depth"
+ lspace="3lspace" voffset="10px">
+ <mpadded mathbackground="red" width="20px" height="10px"
+ depth="10px">
+ </mpadded>
+ </mpadded>
+ </math>
+ </body>
+</html>
Property changes on: trunk/LayoutTests/mathml/presentation/mpadded-4.html
___________________________________________________________________
Added: svn:eol-style
+LF
\ No newline at end of property
Added: svn:mime-type
+text/html
\ No newline at end of property
Added: trunk/LayoutTests/mathml/presentation/mpadded-dynamic-expected.html (0 => 202962)
--- trunk/LayoutTests/mathml/presentation/mpadded-dynamic-expected.html (rev 0)
+++ trunk/LayoutTests/mathml/presentation/mpadded-dynamic-expected.html 2016-07-08 06:16:32 UTC (rev 202962)
@@ -0,0 +1,16 @@
+<!doctype html>
+<html class="reftest-wait">
+ <head>
+ <title>mpadded dynamic</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+ <math>
+ <mpadded id="mpadded" mathbackground="blue"
+ width="80px" depth="50px" height="30px"
+ lspace="60px" voffset="20px">
+ <mspace width="10px" height="5px" depth="5px" mathbackground="red"/>
+ </mpadded>
+ </math>
+ </body>
+</html>
Property changes on: trunk/LayoutTests/mathml/presentation/mpadded-dynamic-expected.html
___________________________________________________________________
Added: svn:eol-style
+LF
\ No newline at end of property
Added: svn:mime-type
+text/html
\ No newline at end of property
Added: trunk/LayoutTests/mathml/presentation/mpadded-dynamic.html (0 => 202962)
--- trunk/LayoutTests/mathml/presentation/mpadded-dynamic.html (rev 0)
+++ trunk/LayoutTests/mathml/presentation/mpadded-dynamic.html 2016-07-08 06:16:32 UTC (rev 202962)
@@ -0,0 +1,28 @@
+<!doctype html>
+<html class="reftest-wait">
+ <head>
+ <title>mpadded dynamic</title>
+ <meta charset="utf-8"/>
+ <script type="text/_javascript_">
+ function doTest() {
+ var mpadded = document.getElementById("mpadded");
+ mpadded.setAttribute("width", "80px");
+ mpadded.setAttribute("height", "30px");
+ mpadded.setAttribute("depth", "50px");
+ mpadded.setAttribute("lspace", "60px");
+ mpadded.setAttribute("voffset", "20px");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("load", doTest, false);
+ </script>
+ </head>
+ <body>
+ <math>
+ <mpadded id="mpadded" mathbackground="blue"
+ width="40px" depth="30px" height="20px"
+ lspace="5px" voffset="-15px">
+ <mspace width="10px" height="5px" depth="5px" mathbackground="red"/>
+ </mpadded>
+ </math>
+ </body>
+</html>
Property changes on: trunk/LayoutTests/mathml/presentation/mpadded-dynamic.html
___________________________________________________________________
Added: svn:eol-style
+LF
\ No newline at end of property
Added: svn:mime-type
+text/html
\ No newline at end of property
Added: trunk/LayoutTests/mathml/presentation/mpadded-unsupported-values-expected.html (0 => 202962)
--- trunk/LayoutTests/mathml/presentation/mpadded-unsupported-values-expected.html (rev 0)
+++ trunk/LayoutTests/mathml/presentation/mpadded-unsupported-values-expected.html 2016-07-08 06:16:32 UTC (rev 202962)
@@ -0,0 +1,39 @@
+<!doctype html>
+<html>
+ <head>
+ <title>mpadded unsupported values</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+
+ <math>
+ <mpadded mathbackground="red">
+ <mspace width="0px" height="25px" depth="25px"/>
+ </mpadded>
+ <mpadded height="0px" mathbackground="green">
+ <mspace width="50px" height="25px" depth="25px"/>
+ </mpadded>
+ <mpadded depth="0px" mathbackground="blue">
+ <mspace width="50px" height="25px" depth="25px"/>
+ </mpadded>
+ <mpadded lspace="0px" mathbackground="magenta">
+ <mspace width="50px" height="25px" depth="25px"/>
+ </mpadded>
+ </math>
+ <hr/>
+
+ <!-- We ignore pseudo-units for now. -->
+ <math>
+ <mpadded mathbackground="red">
+ <mspace width="50px" height="25px" depth="25px"/>
+ </mpadded>
+ <mpadded mathbackground="green">
+ <mspace width="50px" height="25px" depth="25px"/>
+ </mpadded>
+ <mpadded mathbackground="blue">
+ <mspace width="50px" height="25px" depth="25px"/>
+ </mpadded>
+ </math>
+
+ </body>
+</html>
Property changes on: trunk/LayoutTests/mathml/presentation/mpadded-unsupported-values-expected.html
___________________________________________________________________
Added: svn:eol-style
+LF
\ No newline at end of property
Added: svn:mime-type
+text/html
\ No newline at end of property
Added: trunk/LayoutTests/mathml/presentation/mpadded-unsupported-values.html (0 => 202962)
--- trunk/LayoutTests/mathml/presentation/mpadded-unsupported-values.html (rev 0)
+++ trunk/LayoutTests/mathml/presentation/mpadded-unsupported-values.html 2016-07-08 06:16:32 UTC (rev 202962)
@@ -0,0 +1,42 @@
+<!doctype html>
+<html>
+ <head>
+ <title>mpadded unsupported values</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+
+ <!-- This verifies that the values that we do not support do not cause any problem. -->
+
+ <!-- If width/height/depth/lspace are negative, we set them to zero. -->
+ <math>
+ <mpadded width="-20px" mathbackground="red">
+ <mspace width="50px" height="25px" depth="25px"/>
+ </mpadded>
+ <mpadded height="-20px" mathbackground="green">
+ <mspace width="50px" height="25px" depth="25px"/>
+ </mpadded>
+ <mpadded depth="-20px" mathbackground="blue">
+ <mspace width="50px" height="25px" depth="25px"/>
+ </mpadded>
+ <mpadded lspace="-20px" mathbackground="magenta">
+ <mspace width="50px" height="25px" depth="25px"/>
+ </mpadded>
+ </math>
+ <hr/>
+
+ <!-- We ignore pseudo-units values. -->
+ <math>
+ <mpadded width="3width" mathbackground="red">
+ <mspace width="50px" height="25px" depth="25px"/>
+ </mpadded>
+ <mpadded height="3depth" mathbackground="green">
+ <mspace width="50px" height="25px" depth="25px"/>
+ </mpadded>
+ <mpadded depth="3height" mathbackground="blue">
+ <mspace width="50px" height="25px" depth="25px"/>
+ </mpadded>
+ </math>
+
+ </body>
+</html>
Property changes on: trunk/LayoutTests/mathml/presentation/mpadded-unsupported-values.html
___________________________________________________________________
Added: svn:eol-style
+LF
\ No newline at end of property
Added: svn:mime-type
+text/html
\ No newline at end of property
Modified: trunk/Source/WebCore/CMakeLists.txt (202961 => 202962)
--- trunk/Source/WebCore/CMakeLists.txt 2016-07-08 05:51:20 UTC (rev 202961)
+++ trunk/Source/WebCore/CMakeLists.txt 2016-07-08 06:16:32 UTC (rev 202962)
@@ -2532,6 +2532,7 @@
rendering/mathml/RenderMathMLMath.cpp
rendering/mathml/RenderMathMLMenclose.cpp
rendering/mathml/RenderMathMLOperator.cpp
+ rendering/mathml/RenderMathMLPadded.cpp
rendering/mathml/RenderMathMLRoot.cpp
rendering/mathml/RenderMathMLRow.cpp
rendering/mathml/RenderMathMLScripts.cpp
Modified: trunk/Source/WebCore/ChangeLog (202961 => 202962)
--- trunk/Source/WebCore/ChangeLog 2016-07-08 05:51:20 UTC (rev 202961)
+++ trunk/Source/WebCore/ChangeLog 2016-07-08 06:16:32 UTC (rev 202962)
@@ -1,5 +1,42 @@
2016-07-07 Frederic Wang <[email protected]>
+ Bug 155792 - Basic implementation of mpadded
+ https://bugs.webkit.org/show_bug.cgi?id=155792
+
+ Reviewed by Brent Fulgham.
+
+ We implement a basic support for the mpadded element.
+ We support most of the attribute values except pseudo-units or negative values.
+
+ Tests: mathml/presentation/mpadded-1-2.html
+ mathml/presentation/mpadded-1.html
+ mathml/presentation/mpadded-2.html
+ mathml/presentation/mpadded-3.html
+ mathml/presentation/mpadded-unsupported-values.html
+ mathml/presentation/mpadded-dynamic.html
+
+ * CMakeLists.txt: Add RenderMathMLPadded to the build system.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+ * mathml/MathMLInlineContainerElement.cpp:
+ (WebCore::MathMLInlineContainerElement::createElementRenderer): Create the renderer
+ for mpadded.
+ * mathml/mathattrs.in: Add voffset attribute.
+ * mathml/mathtags.in: Make mpadded use MathMLInlineContainerElement.
+ * rendering/RenderObject.h:
+ (WebCore::RenderObject::isRenderMathMLPadded): Define isRenderMathMLPadded.
+ * rendering/mathml/RenderMathMLPadded.cpp: Added.
+ We do a simple implementation by overriding the behavior of RenderMathMLRow and forcing
+ relayout after attribute or style change.
+ (WebCore::RenderMathMLPadded::RenderMathMLPadded):
+ (WebCore::RenderMathMLPadded::computePreferredLogicalWidths):
+ (WebCore::RenderMathMLPadded::layoutBlock):
+ (WebCore::RenderMathMLPadded::updateFromElement):
+ (WebCore::RenderMathMLPadded::styleDidChange):
+ (WebCore::RenderMathMLPadded::firstLineBaseline):
+ * rendering/mathml/RenderMathMLPadded.h: Added.
+
+2016-07-07 Frederic Wang <[email protected]>
+
Move MathML-specific code into a separate accessibility class
https://bugs.webkit.org/show_bug.cgi?id=159213
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (202961 => 202962)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-07-08 05:51:20 UTC (rev 202961)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-07-08 06:16:32 UTC (rev 202962)
@@ -2389,6 +2389,7 @@
5B30695D18B3D3450099D5E8 /* WebGLDrawBuffers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5B30695A18B3D3450099D5E8 /* WebGLDrawBuffers.cpp */; };
5B30695E18B3D3450099D5E8 /* WebGLDrawBuffers.h in Headers */ = {isa = PBXBuildFile; fileRef = 5B30695B18B3D3450099D5E8 /* WebGLDrawBuffers.h */; };
5B7A208D2E12979B4AE19DE6 /* RenderMathMLSpace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBFCB0EBFF5CD77EBEB35395 /* RenderMathMLSpace.cpp */; };
+ 5B7A208D2E12979B4AE19E6F /* RenderMathMLPadded.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBFCB0EBFF5CD77EBEB3595F /* RenderMathMLPadded.cpp */; };
5C4304B0191AC908000E2BC0 /* EXTShaderTextureLOD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C4304AD191AC908000E2BC0 /* EXTShaderTextureLOD.cpp */; };
5C4304B1191AC908000E2BC0 /* EXTShaderTextureLOD.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4304AE191AC908000E2BC0 /* EXTShaderTextureLOD.h */; };
5C4304B5191AEF46000E2BC0 /* JSEXTShaderTextureLOD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C4304B3191AEF46000E2BC0 /* JSEXTShaderTextureLOD.cpp */; };
@@ -9036,6 +9037,7 @@
3314ACE910892086000F0E56 /* JSExceptionBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSExceptionBase.cpp; sourceTree = "<group>"; };
3314ACEA10892086000F0E56 /* JSExceptionBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSExceptionBase.h; sourceTree = "<group>"; };
331FF67DE197B57393C46AA7 /* RenderMathMLSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLSpace.h; sourceTree = "<group>"; };
+ 331FF67DE197B57393C46A7F /* RenderMathMLPadded.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLPadded.h; sourceTree = "<group>"; };
333F704E0FB49CA2008E12A6 /* Notification.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Notification.idl; sourceTree = "<group>"; };
333F704F0FB49CA2008E12A6 /* Notification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Notification.h; sourceTree = "<group>"; };
33503C9910179A74003B47E1 /* NotificationClient.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = NotificationClient.h; sourceTree = "<group>"; };
@@ -14522,6 +14524,7 @@
DB23C2C90A508D29002489EB /* IndentOutdentCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IndentOutdentCommand.cpp; sourceTree = "<group>"; };
DB23C2CA0A508D29002489EB /* IndentOutdentCommand.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IndentOutdentCommand.h; sourceTree = "<group>"; };
DBFCB0EBFF5CD77EBEB35395 /* RenderMathMLSpace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLSpace.cpp; sourceTree = "<group>"; };
+ DBFCB0EBFF5CD77EBEB3595F /* RenderMathMLPadded.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLPadded.cpp; sourceTree = "<group>"; };
DD05FE0B0B8BA3C6009ACDFE /* WebCoreObjCExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCoreObjCExtras.h; sourceTree = "<group>"; };
DD763BB10992C2C900740B8E /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = /usr/lib/libxml2.dylib; sourceTree = "<absolute>"; };
DE49B2FF165F2FC60010338D /* MediaControlElementTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaControlElementTypes.cpp; sourceTree = "<group>"; };
@@ -17146,6 +17149,8 @@
439046D412DA25E800AF80A2 /* RenderMathMLScripts.h */,
DBFCB0EBFF5CD77EBEB35395 /* RenderMathMLSpace.cpp */,
331FF67DE197B57393C46AA7 /* RenderMathMLSpace.h */,
+ DBFCB0EBFF5CD77EBEB3595F /* RenderMathMLPadded.cpp */,
+ 331FF67DE197B57393C46A7F /* RenderMathMLPadded.h */,
439046D712DA25E800AF80A9 /* RenderMathMLToken.cpp */,
439046D812DA25E800AF80A9 /* RenderMathMLToken.h */,
439046D512DA25E800AF80A2 /* RenderMathMLUnderOver.cpp */,
@@ -31625,6 +31630,7 @@
439046E312DA25E800AF80A2 /* RenderMathMLRow.cpp in Sources */,
439046E712DA25E800AF80A2 /* RenderMathMLScripts.cpp in Sources */,
5B7A208D2E12979B4AE19DE6 /* RenderMathMLSpace.cpp in Sources */,
+ 5B7A208D2E12979B4AE19E6F /* RenderMathMLPadded.cpp in Sources */,
439046EB12DA25E800AF80A9 /* RenderMathMLToken.cpp in Sources */,
439046E912DA25E800AF80A2 /* RenderMathMLUnderOver.cpp in Sources */,
E4C279580CF9741900E97B98 /* RenderMedia.cpp in Sources */,
Modified: trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp (202961 => 202962)
--- trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp 2016-07-08 05:51:20 UTC (rev 202961)
+++ trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp 2016-07-08 06:16:32 UTC (rev 202962)
@@ -35,6 +35,7 @@
#include "RenderMathMLFenced.h"
#include "RenderMathMLFraction.h"
#include "RenderMathMLMenclose.h"
+#include "RenderMathMLPadded.h"
#include "RenderMathMLRoot.h"
#include "RenderMathMLRow.h"
#include "RenderMathMLScripts.h"
@@ -79,6 +80,8 @@
return createRenderer<RenderMathMLFenced>(*this, WTFMove(style));
if (hasTagName(mtableTag))
return createRenderer<RenderMathMLTable>(*this, WTFMove(style));
+ if (hasTagName(mpaddedTag))
+ return createRenderer<RenderMathMLPadded>(*this, WTFMove(style));
return createRenderer<RenderMathMLBlock>(*this, WTFMove(style));
}
Modified: trunk/Source/WebCore/mathml/mathattrs.in (202961 => 202962)
--- trunk/Source/WebCore/mathml/mathattrs.in 2016-07-08 05:51:20 UTC (rev 202961)
+++ trunk/Source/WebCore/mathml/mathattrs.in 2016-07-08 06:16:32 UTC (rev 202962)
@@ -47,4 +47,5 @@
symmetric
subscriptshift
superscriptshift
+voffset
width
Modified: trunk/Source/WebCore/mathml/mathtags.in (202961 => 202962)
--- trunk/Source/WebCore/mathml/mathtags.in 2016-07-08 05:51:20 UTC (rev 202961)
+++ trunk/Source/WebCore/mathml/mathtags.in 2016-07-08 06:16:32 UTC (rev 202962)
@@ -11,6 +11,7 @@
mfenced interfaceName=MathMLInlineContainerElement
msubsup interfaceName=MathMLInlineContainerElement
merror interfaceName=MathMLInlineContainerElement
+mpadded interfaceName=MathMLInlineContainerElement
mphantom interfaceName=MathMLInlineContainerElement
mrow interfaceName=MathMLInlineContainerElement
mstyle interfaceName=MathMLInlineContainerElement
@@ -41,7 +42,6 @@
mglyph interfaceName=MathMLElement
mlabeledtr interfaceName=MathMLElement
mlongdiv interfaceName=MathMLElement
-mpadded interfaceName=MathMLElement
mscarries interfaceName=MathMLElement
mscarry interfaceName=MathMLElement
msgroup interfaceName=MathMLElement
Modified: trunk/Source/WebCore/rendering/RenderObject.h (202961 => 202962)
--- trunk/Source/WebCore/rendering/RenderObject.h 2016-07-08 05:51:20 UTC (rev 202961)
+++ trunk/Source/WebCore/rendering/RenderObject.h 2016-07-08 06:16:32 UTC (rev 202962)
@@ -342,6 +342,7 @@
virtual bool isRenderMathMLMenclose() const { return false; }
virtual bool isRenderMathMLFenced() const { return false; }
virtual bool isRenderMathMLFraction() const { return false; }
+ virtual bool isRenderMathMLPadded() const { return false; }
virtual bool isRenderMathMLRoot() const { return false; }
virtual bool isRenderMathMLSpace() const { return false; }
virtual bool isRenderMathMLSquareRoot() const { return false; }
Added: trunk/Source/WebCore/rendering/mathml/RenderMathMLPadded.cpp (0 => 202962)
--- trunk/Source/WebCore/rendering/mathml/RenderMathMLPadded.cpp (rev 0)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLPadded.cpp 2016-07-08 06:16:32 UTC (rev 202962)
@@ -0,0 +1,128 @@
+/*
+ * 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 THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 THE COPYRIGHT
+ * OWNER 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.
+ */
+
+#include "config.h"
+#include "RenderMathMLPadded.h"
+
+#if ENABLE(MATHML)
+
+#include "MathMLNames.h"
+#include <cmath>
+
+namespace WebCore {
+
+using namespace MathMLNames;
+
+RenderMathMLPadded::RenderMathMLPadded(Element& element, RenderStyle&& style)
+ : RenderMathMLRow(element, WTFMove(style))
+{
+}
+
+void RenderMathMLPadded::computePreferredLogicalWidths()
+{
+ ASSERT(preferredLogicalWidthsDirty());
+
+ // Determine the intrinsic width of the content.
+ RenderMathMLRow::computePreferredLogicalWidths();
+
+ // Only the width attribute should modify the width.
+ // We parse it using the preferred width of the content as its default value.
+ LayoutUnit width = m_maxPreferredLogicalWidth;
+ parseMathMLLength(element()->fastGetAttribute(MathMLNames::widthAttr), width, &style(), false);
+
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = width;
+
+ setPreferredLogicalWidthsDirty(false);
+}
+
+void RenderMathMLPadded::layoutBlock(bool relayoutChildren, LayoutUnit)
+{
+ ASSERT(needsLayout());
+
+ if (!relayoutChildren && simplifiedLayout())
+ return;
+
+ // We first layout our children as a normal <mrow> element.
+ LayoutUnit contentAscent, contentDescent, contentWidth;
+ contentAscent = contentDescent = 0;
+ RenderMathMLRow::computeLineVerticalStretch(contentAscent, contentDescent);
+ RenderMathMLRow::layoutRowItems(contentAscent, contentDescent);
+ contentWidth = logicalWidth();
+
+ // We parse the mpadded attributes using the content metrics as the default value.
+ // FIXME: We should also accept pseudo-units and (some) negative values.
+ // See https://bugs.webkit.org/show_bug.cgi?id=85730
+ LayoutUnit width = contentWidth;
+ LayoutUnit ascent = contentAscent;
+ LayoutUnit descent = contentDescent;
+ LayoutUnit lspace = 0;
+ LayoutUnit voffset = 0;
+ parseMathMLLength(element()->fastGetAttribute(MathMLNames::widthAttr), width, &style());
+ parseMathMLLength(element()->fastGetAttribute(MathMLNames::heightAttr), ascent, &style());
+ parseMathMLLength(element()->fastGetAttribute(MathMLNames::depthAttr), descent, &style());
+ parseMathMLLength(element()->fastGetAttribute(MathMLNames::lspaceAttr), lspace, &style());
+ parseMathMLLength(element()->fastGetAttribute(MathMLNames::voffsetAttr), voffset, &style());
+ if (width < 0)
+ width = 0;
+ if (ascent < 0)
+ ascent = 0;
+ if (descent < 0)
+ descent = 0;
+ if (lspace < 0)
+ lspace = 0;
+
+ // Align children on the new baseline and shift them by (lspace, -voffset)
+ LayoutPoint contentLocation(lspace, ascent - contentAscent - voffset);
+ for (auto* child = firstChildBox(); child; child = child->nextSiblingBox())
+ child->setLocation(child->location() + contentLocation);
+
+ // Set the final metrics.
+ setLogicalWidth(width);
+ m_ascent = ascent;
+ setLogicalHeight(ascent + descent);
+
+ clearNeedsLayout();
+}
+
+void RenderMathMLPadded::updateFromElement()
+{
+ RenderMathMLRow::updateFromElement();
+ setNeedsLayoutAndPrefWidthsRecalc();
+}
+
+void RenderMathMLPadded::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
+{
+ RenderMathMLRow::styleDidChange(diff, oldStyle);
+ setNeedsLayoutAndPrefWidthsRecalc();
+}
+
+Optional<int> RenderMathMLPadded::firstLineBaseline() const
+{
+ return Optional<int>(std::lround(static_cast<float>(m_ascent)));
+}
+
+}
+
+#endif
Property changes on: trunk/Source/WebCore/rendering/mathml/RenderMathMLPadded.cpp
___________________________________________________________________
Added: svn:eol-style
+LF
\ No newline at end of property
Added: trunk/Source/WebCore/rendering/mathml/RenderMathMLPadded.h (0 => 202962)
--- trunk/Source/WebCore/rendering/mathml/RenderMathMLPadded.h (rev 0)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLPadded.h 2016-07-08 06:16:32 UTC (rev 202962)
@@ -0,0 +1,59 @@
+/*
+ * 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 THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 THE COPYRIGHT
+ * OWNER 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 RenderMathMLPadded_h
+#define RenderMathMLPadded_h
+#pragma once
+
+#if ENABLE(MATHML)
+
+#include "RenderMathMLRow.h"
+
+namespace WebCore {
+
+class RenderMathMLPadded final : public RenderMathMLRow {
+public:
+ RenderMathMLPadded(Element&, RenderStyle&&);
+
+private:
+ const char* renderName() const final { return "RenderMathMLPadded"; }
+ bool isRenderMathMLPadded() const final { return true; }
+
+ void computePreferredLogicalWidths() final;
+ void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) final;
+ Optional<int> firstLineBaseline() const final;
+
+ void updateFromElement() final;
+ void styleDidChange(StyleDifference, const RenderStyle* oldStyle) final;
+
+ LayoutUnit m_ascent;
+};
+
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderMathMLPadded, isRenderMathMLPadded())
+
+#endif // ENABLE(MATHML)
+#endif // RenderMathMLPadded_h
Property changes on: trunk/Source/WebCore/rendering/mathml/RenderMathMLPadded.h
___________________________________________________________________
Added: svn:eol-style
+LF
\ No newline at end of property