From 679540a418b2f801a2b91fcac49ec66c8203441d Mon Sep 17 00:00:00 2001 From: Brian Kardell Date: Sat, 27 Apr 2019 16:20:52 -0400 Subject: [PATCH 01/16] add a very simple test ported from moz tests just to try to get through it --- .../css-styling/dynamic-dir-1-ref.html | 81 ++++++++++++++ .../relations/css-styling/dynamic-dir-1.html | 101 ++++++++++++++++++ 2 files changed, 182 insertions(+) create mode 100644 mathml/relations/css-styling/dynamic-dir-1-ref.html create mode 100644 mathml/relations/css-styling/dynamic-dir-1.html diff --git a/mathml/relations/css-styling/dynamic-dir-1-ref.html b/mathml/relations/css-styling/dynamic-dir-1-ref.html new file mode 100644 index 00000000000000..c258501f297f37 --- /dev/null +++ b/mathml/relations/css-styling/dynamic-dir-1-ref.html @@ -0,0 +1,81 @@ + + + + + Test dynamically changing dir attribute + + + +

+ math: + + a + b + c + + + a + b + c + + + a + b + c + +

+ +

+ mstyle: + + + a + b + c + + + + + a + b + c + + + + + a + b + c + + +

+ +

+ mrow: + + + a + b + c + + + + + a + b + c + + + + + a + b + c + + +

+ + + + + \ No newline at end of file diff --git a/mathml/relations/css-styling/dynamic-dir-1.html b/mathml/relations/css-styling/dynamic-dir-1.html new file mode 100644 index 00000000000000..4f43b712080ea1 --- /dev/null +++ b/mathml/relations/css-styling/dynamic-dir-1.html @@ -0,0 +1,101 @@ + + + + + Test dynamically changing dir attribute + + + + + + +

+ math: + + a + b + c + + + a + b + c + + + a + b + c + +

+ +

+ mstyle: + + + a + b + c + + + + + a + b + c + + + + + a + b + c + + +

+ +

+ mrow: + + + a + b + c + + + + + a + b + c + + + + + a + b + c + + +

+ + + + + \ No newline at end of file From b86db61103221bd8f15f7c97053bbf48c528d665 Mon Sep 17 00:00:00 2001 From: brian kardell Date: Mon, 22 Jul 2019 10:14:12 -0400 Subject: [PATCH 02/16] Add global events support test --- .../math-global-event-handlers.tentative.html | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 mathml/relations/html5-tree/math-global-event-handlers.tentative.html diff --git a/mathml/relations/html5-tree/math-global-event-handlers.tentative.html b/mathml/relations/html5-tree/math-global-event-handlers.tentative.html new file mode 100644 index 00000000000000..b8175ecc3774db --- /dev/null +++ b/mathml/relations/html5-tree/math-global-event-handlers.tentative.html @@ -0,0 +1,66 @@ + +MathMLElement GlobalEventHandlers + + + + + + + + + From 6cb2866afdf81fdd83cca87e9124fdee1640f893 Mon Sep 17 00:00:00 2001 From: brian kardell Date: Mon, 22 Jul 2019 11:10:27 -0400 Subject: [PATCH 03/16] add tentative tests for HTMLOrForeignElement --- ...-foreign-element-interfaces.tentative.html | 149 ++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html diff --git a/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html b/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html new file mode 100644 index 00000000000000..c8d74f947f02ea --- /dev/null +++ b/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html @@ -0,0 +1,149 @@ + + + + + MathML 'HTMLOrForeignElement` Mixin Tests + + + + + + + + + This tests the presence and functionality of features of `HTMLOrForeignElement` (currently `HTMLOrSVGElement`) + + E + + + + \ No newline at end of file From bdd232df1314a520c181c11e521d409a547c911c Mon Sep 17 00:00:00 2001 From: brian kardell Date: Mon, 22 Jul 2019 11:24:14 -0400 Subject: [PATCH 04/16] separate tests for HTMLOrForeignElement and ElementCSSInlineStyle interfaces --- .../css-inline-style-interface.tentative.html | 47 +++++++++++++++++++ ...-foreign-element-interfaces.tentative.html | 10 ---- 2 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 mathml/relations/html5-tree/css-inline-style-interface.tentative.html diff --git a/mathml/relations/html5-tree/css-inline-style-interface.tentative.html b/mathml/relations/html5-tree/css-inline-style-interface.tentative.html new file mode 100644 index 00000000000000..6e500b40c348df --- /dev/null +++ b/mathml/relations/html5-tree/css-inline-style-interface.tentative.html @@ -0,0 +1,47 @@ + + + + + MathML 'ElementCSSInlineStyle` Mixin Tests + + + + + + + + + This tests the presence and functionality of features of the `ElementCSSInlineStyle` interface for MathMLElements + + E + + + + \ No newline at end of file diff --git a/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html b/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html index c8d74f947f02ea..28fa48a29c4f0b 100644 --- a/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html +++ b/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html @@ -33,16 +33,6 @@ let el = document.querySelector("mi"); let mathEl = document.querySelector("math"); - - test(function() { - el.style.backgroundColor = "blue"; - assert_equals( - getComputedStyle(el).backgroundColor, - "rgb(0, 0, 255)", - "The style attribute should be present and be functional." - ); - }, "The style attribute be present and be functional."); - // this really belongs in // https://github.com/web-platform-tests/wpt/blob/master/html/dom/elements/global-attributes/dataset.html // it is here tentatively From 1bf7318f0ced13255eabf80926f675bb0b1f4574 Mon Sep 17 00:00:00 2001 From: brian kardell Date: Mon, 22 Jul 2019 11:26:24 -0400 Subject: [PATCH 05/16] correct assert content attributes --- .../html5-tree/css-inline-style-interface.tentative.html | 2 +- .../html-or-foreign-element-interfaces.tentative.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mathml/relations/html5-tree/css-inline-style-interface.tentative.html b/mathml/relations/html5-tree/css-inline-style-interface.tentative.html index 6e500b40c348df..e99241fd069ebf 100644 --- a/mathml/relations/html5-tree/css-inline-style-interface.tentative.html +++ b/mathml/relations/html5-tree/css-inline-style-interface.tentative.html @@ -11,7 +11,7 @@ mi { background-color: red; } } - + diff --git a/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html b/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html index 28fa48a29c4f0b..9702b760d1ad8f 100644 --- a/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html +++ b/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html @@ -12,7 +12,7 @@ :focus { background-color: rgb(0, 255, 0); } } - + From f1ed8a2d01b8452382f2f16990c92c9532b59716 Mon Sep 17 00:00:00 2001 From: brian kardell Date: Mon, 22 Jul 2019 12:57:21 -0400 Subject: [PATCH 06/16] add tentative DocumentAndElementEventHandlers --- .../clipboard-event-handlers.tentative.html | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 mathml/relations/html5-tree/clipboard-event-handlers.tentative.html diff --git a/mathml/relations/html5-tree/clipboard-event-handlers.tentative.html b/mathml/relations/html5-tree/clipboard-event-handlers.tentative.html new file mode 100644 index 00000000000000..5c9d37f1ee1b17 --- /dev/null +++ b/mathml/relations/html5-tree/clipboard-event-handlers.tentative.html @@ -0,0 +1,61 @@ + +DocumentAndElementEventHandlers / clipboard events for MathML + + + + + + + + + +
+ + E + + From 99e359902f68ad4406f5466809cfb7967ca1ab11 Mon Sep 17 00:00:00 2001 From: brian kardell Date: Thu, 1 Aug 2019 10:03:11 -0400 Subject: [PATCH 07/16] address fred's comments/nits --- ...t-handler-all-global-events.tentative.html | 87 +++++++++++++++++++ .../clipboard-event-handlers.tentative.html | 6 +- .../css-inline-style-interface.tentative.html | 21 ++--- ...-foreign-element-interfaces.tentative.html | 49 +++-------- 4 files changed, 110 insertions(+), 53 deletions(-) create mode 100644 html/webappapis/scripting/events/event-handler-all-global-events.tentative.html diff --git a/html/webappapis/scripting/events/event-handler-all-global-events.tentative.html b/html/webappapis/scripting/events/event-handler-all-global-events.tentative.html new file mode 100644 index 00000000000000..ae32880555ca6e --- /dev/null +++ b/html/webappapis/scripting/events/event-handler-all-global-events.tentative.html @@ -0,0 +1,87 @@ + +GlobalEventHandlers + + + + + + + + + diff --git a/mathml/relations/html5-tree/clipboard-event-handlers.tentative.html b/mathml/relations/html5-tree/clipboard-event-handlers.tentative.html index 5c9d37f1ee1b17..e3262ba6a913d7 100644 --- a/mathml/relations/html5-tree/clipboard-event-handlers.tentative.html +++ b/mathml/relations/html5-tree/clipboard-event-handlers.tentative.html @@ -17,17 +17,15 @@
+ onpaste="document.pasteHappened = true"> E - - This tests the presence and functionality of features of the `ElementCSSInlineStyle` interface for MathMLElements - + + This tests the presence and functionality of features of the `ElementCSSInlineStyle` interface for MathMLElements + E \ No newline at end of file diff --git a/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html b/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html index 9702b760d1ad8f..3f3ac2a0be8f2f 100644 --- a/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html +++ b/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html @@ -21,9 +21,7 @@ This tests the presence and functionality of features of `HTMLOrForeignElement` (currently `HTMLOrSVGElement`) + > E @@ -58,12 +56,12 @@ assert_equals( el.dataset.one, "x", - '.one should be "x" after setting the data-x attribute' + '.one should be "x" after setting the data-one attribute' ); assert_equals( el.dataset.two, "y", - '.one should be "y" after setting the data-y attribute' + '.one should be "y" after setting the data-two attribute' ); el.dataset.one = "o"; @@ -82,25 +80,9 @@ ); }, "MathML elements should have a tabIndex property"); - - // this will be resolved after the focus test completes - // in order to then observe blur - let focusCompleted - let focusFailed - let focusCompletedPromise = new Promise((resolve, reject) => { - focusCompleted = resolve - focusFailed = reject - }) - - promise_test(function() { function focus() { - try { - mathEl.focus(); - } catch (e) { - focusFailed() - return Promise.reject() - } + mathEl.focus(); return Promise.resolve(); } @@ -108,12 +90,11 @@ assert_equals( getComputedStyle(mathEl).backgroundColor, "rgb(0, 255, 0)", - "MathML elements with tabindex=-1 should be programatically focusable and apply :focus" + "MathML elements with tabindex=-1 should be programmatically focusable and apply :focus" ) - focusCompleted() }) - }, "MathML elements with tabindex=-1 should have a .focus() method, and support :focus styling"); + }, "MathML elements should work with focus predictably"); promise_test(function() { @@ -122,16 +103,14 @@ return Promise.resolve(); } - return focusCompletedPromise.finally(() => { - blur().then(() => { - assert_equals( - getComputedStyle(mathEl).backgroundColor, - "rgba(0, 0, 0, 0)", - "MathML elements with tabindex=-1 be programatically blur() able" - ) - }); - }) - }, "MathML elements with tabindex=-1 should have a .blur() method that is fired and updates the display"); + return blur().then(() => { + assert_equals( + getComputedStyle(mathEl).backgroundColor, + "rgba(0, 0, 0, 0)", + "MathML elements with tabindex=-1 be programmatically blur() able" + ) + }); + }, "MathML elements should work with blur predictably"); From c51e6f42255f04ffac8fd02ac40fef8687a92ac9 Mon Sep 17 00:00:00 2001 From: brian kardell Date: Thu, 1 Aug 2019 11:28:07 -0400 Subject: [PATCH 08/16] loop and check .style for each element --- .../css-inline-style-interface.tentative.html | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/mathml/relations/html5-tree/css-inline-style-interface.tentative.html b/mathml/relations/html5-tree/css-inline-style-interface.tentative.html index e51751e195ec0c..3537cb82808598 100644 --- a/mathml/relations/html5-tree/css-inline-style-interface.tentative.html +++ b/mathml/relations/html5-tree/css-inline-style-interface.tentative.html @@ -8,10 +8,11 @@ href="https://mathml-refresh.github.io/mathml-core/#dom-and-javascript" /> + @@ -24,17 +25,22 @@ \ No newline at end of file From 669a6c70996fc2a052ac6634b66f20aa73966187 Mon Sep 17 00:00:00 2001 From: brian kardell Date: Thu, 1 Aug 2019 11:33:03 -0400 Subject: [PATCH 09/16] fix typos --- .../html5-tree/css-inline-style-interface.tentative.html | 5 ++--- .../html-or-foreign-element-interfaces.tentative.html | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/mathml/relations/html5-tree/css-inline-style-interface.tentative.html b/mathml/relations/html5-tree/css-inline-style-interface.tentative.html index 3537cb82808598..9e3b7c9f5dc2ae 100644 --- a/mathml/relations/html5-tree/css-inline-style-interface.tentative.html +++ b/mathml/relations/html5-tree/css-inline-style-interface.tentative.html @@ -8,8 +8,7 @@ href="https://mathml-refresh.github.io/mathml-core/#dom-and-javascript" /> @@ -29,7 +28,7 @@ Object.keys(MathMLFragments).forEach((elName) => { mathEl.innerHTML = MathMLFragments[elName] - mathEl.style.backgroundColor = "blue" + mathEl.style.backgroundColor = "green" mathEl.style.display = "block" test(function() { let el = mathEl.firstElementChild diff --git a/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html b/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html index 3f3ac2a0be8f2f..a61f54e782a34a 100644 --- a/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html +++ b/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html @@ -10,7 +10,6 @@ From 0d37523d5769a0ef15a6e8ff55b49c8e3dc0d087 Mon Sep 17 00:00:00 2001 From: brian kardell Date: Thu, 1 Aug 2019 12:14:51 -0400 Subject: [PATCH 10/16] remove accidental commit --- ...t-handler-all-global-events.tentative.html | 87 ------------------- 1 file changed, 87 deletions(-) delete mode 100644 html/webappapis/scripting/events/event-handler-all-global-events.tentative.html diff --git a/html/webappapis/scripting/events/event-handler-all-global-events.tentative.html b/html/webappapis/scripting/events/event-handler-all-global-events.tentative.html deleted file mode 100644 index ae32880555ca6e..00000000000000 --- a/html/webappapis/scripting/events/event-handler-all-global-events.tentative.html +++ /dev/null @@ -1,87 +0,0 @@ - -GlobalEventHandlers - - - - - - - - - From 178a8ee72f51318cc60fbe48e1421e0cdf6cd768 Mon Sep 17 00:00:00 2001 From: brian kardell Date: Thu, 1 Aug 2019 13:55:27 -0400 Subject: [PATCH 11/16] various tweaks based on review comments --- .../css-inline-style-interface.tentative.html | 23 ++++++++++++++----- ...-foreign-element-interfaces.tentative.html | 3 +-- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/mathml/relations/html5-tree/css-inline-style-interface.tentative.html b/mathml/relations/html5-tree/css-inline-style-interface.tentative.html index 9e3b7c9f5dc2ae..017d64e094dbdb 100644 --- a/mathml/relations/html5-tree/css-inline-style-interface.tentative.html +++ b/mathml/relations/html5-tree/css-inline-style-interface.tentative.html @@ -18,21 +18,32 @@ This tests the presence and functionality of features of the `ElementCSSInlineStyle` interface for MathMLElements - - E - + + \ No newline at end of file From 9df3982991d0e7323c94c4cd91e26a7b902cfa32 Mon Sep 17 00:00:00 2001 From: Brian Kardell Date: Sat, 3 Aug 2019 14:04:22 -0400 Subject: [PATCH 13/16] run autoformat to fix lint errors, I hope --- .../clipboard-event-handlers.tentative.html | 109 +++++++++++------- .../css-inline-style-interface.tentative.html | 62 +++++----- ...-foreign-element-interfaces.tentative.html | 46 ++++---- 3 files changed, 121 insertions(+), 96 deletions(-) diff --git a/mathml/relations/html5-tree/clipboard-event-handlers.tentative.html b/mathml/relations/html5-tree/clipboard-event-handlers.tentative.html index e3262ba6a913d7..d293b1500c77dd 100644 --- a/mathml/relations/html5-tree/clipboard-event-handlers.tentative.html +++ b/mathml/relations/html5-tree/clipboard-event-handlers.tentative.html @@ -1,59 +1,84 @@ DocumentAndElementEventHandlers / clipboard events for MathML - - - - - + + + + + -
+
- E - + oncopy="document.copyHappened = true" + oncut="document.cutHappened = true" + onpaste="document.pasteHappened = true" +> + E + diff --git a/mathml/relations/html5-tree/css-inline-style-interface.tentative.html b/mathml/relations/html5-tree/css-inline-style-interface.tentative.html index 91dd3819e08938..708926413f2aff 100644 --- a/mathml/relations/html5-tree/css-inline-style-interface.tentative.html +++ b/mathml/relations/html5-tree/css-inline-style-interface.tentative.html @@ -8,48 +8,50 @@ href="https://mathml-refresh.github.io/mathml-core/#dom-and-javascript" /> - + - - This tests the presence and functionality of features of the `ElementCSSInlineStyle` interface for MathMLElements + This tests the presence and functionality of features of the + `ElementCSSInlineStyle` interface for MathMLElements + }, `The element style property should be present and be functional.`); + + Object.keys(MathMLFragments).forEach(elName => { + mathEl.innerHTML = MathMLFragments[elName]; + + test(function() { + let el = FragmentHelper.element(mathEl); + el.style.backgroundColor = "blue"; + + assert_equals( + getComputedStyle(el).backgroundColor, + "rgb(0, 0, 255)", + "The applied background should be blue." + ); + }, `The ${elName}'s style property should be present and be functional.`); + }); + - \ No newline at end of file + diff --git a/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html b/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html index efbc72a364ff5b..1fcaf6c40167a5 100644 --- a/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html +++ b/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html @@ -8,29 +8,35 @@ href="https://mathml-refresh.github.io/mathml-core/#dom-and-javascript" /> - + - - This tests the presence and functionality of features of `HTMLOrForeignElement` (currently `HTMLOrSVGElement`) - + This tests the presence and functionality of features of + `HTMLOrForeignElement` (currently `HTMLOrSVGElement`) + E - \ No newline at end of file + From ad58457e9fbc5f481ff2a8e4cbccdce21b7341c6 Mon Sep 17 00:00:00 2001 From: Brian Kardell Date: Mon, 3 Feb 2020 13:58:24 -0500 Subject: [PATCH 14/16] add corresponding mathml nonce hiding tests in pursuit of https://github.com/whatwg/html/pull/5248#issuecomment-580879380 --- ...ript-nonces-hidden-meta.tentative.sub.html | 116 +++++++++++++++++ .../mathmlscript-nonces-hidden.tentative.html | 117 ++++++++++++++++++ ...cript-nonces-hidden.tentative.html.headers | 1 + 3 files changed, 234 insertions(+) create mode 100644 content-security-policy/nonce-hiding/mathmlscript-nonces-hidden-meta.tentative.sub.html create mode 100644 content-security-policy/nonce-hiding/mathmlscript-nonces-hidden.tentative.html create mode 100644 content-security-policy/nonce-hiding/mathmlscript-nonces-hidden.tentative.html.headers diff --git a/content-security-policy/nonce-hiding/mathmlscript-nonces-hidden-meta.tentative.sub.html b/content-security-policy/nonce-hiding/mathmlscript-nonces-hidden-meta.tentative.sub.html new file mode 100644 index 00000000000000..bd1c33760d0835 --- /dev/null +++ b/content-security-policy/nonce-hiding/mathmlscript-nonces-hidden-meta.tentative.sub.html @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + diff --git a/content-security-policy/nonce-hiding/mathmlscript-nonces-hidden.tentative.html b/content-security-policy/nonce-hiding/mathmlscript-nonces-hidden.tentative.html new file mode 100644 index 00000000000000..221aaa477f6098 --- /dev/null +++ b/content-security-policy/nonce-hiding/mathmlscript-nonces-hidden.tentative.html @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/content-security-policy/nonce-hiding/mathmlscript-nonces-hidden.tentative.html.headers b/content-security-policy/nonce-hiding/mathmlscript-nonces-hidden.tentative.html.headers new file mode 100644 index 00000000000000..ad8d0b54f31d6d --- /dev/null +++ b/content-security-policy/nonce-hiding/mathmlscript-nonces-hidden.tentative.html.headers @@ -0,0 +1 @@ +Content-Security-Policy: script-src 'nonce-abc'; img-src 'none' From 958f35b62f53601201e03ade50fea9bca54b0243 Mon Sep 17 00:00:00 2001 From: Brian Kardell Date: Fri, 7 Feb 2020 09:00:04 -0500 Subject: [PATCH 15/16] remove console.log --- mathml/relations/html5-tree/autofocus.html | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 mathml/relations/html5-tree/autofocus.html diff --git a/mathml/relations/html5-tree/autofocus.html b/mathml/relations/html5-tree/autofocus.html new file mode 100644 index 00000000000000..9b2056992ae194 --- /dev/null +++ b/mathml/relations/html5-tree/autofocus.html @@ -0,0 +1,24 @@ + + + + + +

The box should be blue

+ + + + + + + + + + \ No newline at end of file From 1351228cd0faa8752495cc9989abef480336d2ec Mon Sep 17 00:00:00 2001 From: Brian Kardell Date: Thu, 12 Mar 2020 16:04:13 -0400 Subject: [PATCH 16/16] add tentative default tabindex tests --- mathml/relations/html5-tree/tabindex-001.html | 75 +++++++++++++------ 1 file changed, 53 insertions(+), 22 deletions(-) diff --git a/mathml/relations/html5-tree/tabindex-001.html b/mathml/relations/html5-tree/tabindex-001.html index 8f853688141658..7276ba9acb7561 100644 --- a/mathml/relations/html5-tree/tabindex-001.html +++ b/mathml/relations/html5-tree/tabindex-001.html @@ -6,38 +6,69 @@ +
- -