From 91701dd9279cabc31deb623eaf7cb6ab96ac658a Mon Sep 17 00:00:00 2001 From: alflennik Date: Wed, 21 Dec 2022 13:05:25 -0800 Subject: [PATCH 01/13] Add embed support for aria-at iframes --- content/patterns/button/examples/button.html | 12 ++++++++++++ content/shared/js/app.js | 15 +++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/content/patterns/button/examples/button.html b/content/patterns/button/examples/button.html index 51ccbb6277..5f32f4e313 100644 --- a/content/patterns/button/examples/button.html +++ b/content/patterns/button/examples/button.html @@ -195,6 +195,18 @@

HTML Source Code

sourceCode.make(); + + +
+

Support Levels

+ +
diff --git a/content/shared/js/app.js b/content/shared/js/app.js index 65e55ea2f0..6b9db7274c 100644 --- a/content/shared/js/app.js +++ b/content/shared/js/app.js @@ -12,6 +12,10 @@ // Rewrite links so they point to the proper spec document window.addEventListener('DOMContentLoaded', resolveSpecLinks, false); + // Support levels iframes should not show scrollbars, so a message with the + // correct height will be posted from the iframe. + window.addEventListener('message', fixIframeHeight); + async function addExampleUsageWarning() { // Determine we are on an example page if (!document.location.href.match(/examples\/[^/]+\.html/)) return; @@ -43,4 +47,15 @@ const fixSpecLink = specLinks({ specStatus: 'ED' }); document.querySelectorAll('a[href]').forEach(fixSpecLink); } + + function fixIframeHeight(event) { + const data = event.data; + if (!data.iframe || !data.height || isNaN(data.height)) { + return; + } + const iframe = document.querySelector(`.${data.iframe}`); + if (!iframe) return; + const magicNumberAdjustment = 5; + iframe.style.height = `${data.height + magicNumberAdjustment}px`; + } })(); From 906272650145d666561c2c899ee735aa37e3a50b Mon Sep 17 00:00:00 2001 From: alflennik Date: Wed, 21 Dec 2022 13:10:17 -0800 Subject: [PATCH 02/13] Add iframes to spelling list --- cspell.json | 1 + 1 file changed, 1 insertion(+) diff --git a/cspell.json b/cspell.json index 36a32fb03d..838ff6deed 100644 --- a/cspell.json +++ b/cspell.json @@ -105,6 +105,7 @@ "Hoyt", "IDREF", "IDREFS", + "iframes", "imgs", "Iskandar", "issie", From 63cf2b6575b9458eb5681b9c568e0ffdb2bb125d Mon Sep 17 00:00:00 2001 From: Howard Edwards Date: Thu, 22 Dec 2022 15:59:57 -0500 Subject: [PATCH 03/13] Update embed link --- content/patterns/button/examples/button.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/patterns/button/examples/button.html b/content/patterns/button/examples/button.html index 5f32f4e313..79624e634e 100644 --- a/content/patterns/button/examples/button.html +++ b/content/patterns/button/examples/button.html @@ -201,7 +201,7 @@

HTML Source Code

Support Levels

+ + diff --git a/content/shared/js/app.js b/content/shared/js/app.js index 6b9db7274c..4ad16d7bd8 100644 --- a/content/shared/js/app.js +++ b/content/shared/js/app.js @@ -55,7 +55,7 @@ } const iframe = document.querySelector(`.${data.iframe}`); if (!iframe) return; - const magicNumberAdjustment = 5; + const magicNumberAdjustment = 35; iframe.style.height = `${data.height + magicNumberAdjustment}px`; } })(); From a35e8e0e64ffdba86055590f0e8fdf16cc707fbc Mon Sep 17 00:00:00 2001 From: Howard Edwards Date: Wed, 11 Jan 2023 14:40:56 -0500 Subject: [PATCH 07/13] Force title to be 'Command Button' instead of 'Command Button Example' --- content/patterns/button/examples/button.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/patterns/button/examples/button.html b/content/patterns/button/examples/button.html index 8349c1a900..1688a5c669 100644 --- a/content/patterns/button/examples/button.html +++ b/content/patterns/button/examples/button.html @@ -200,7 +200,7 @@

HTML Source Code

Assistive Technology Support

+

Toggle Button

@@ -211,7 +211,7 @@

Toggle Button

From a74962f1f829537c93de996b5d9b0ba2660cd95a Mon Sep 17 00:00:00 2001 From: alflennik Date: Mon, 13 Mar 2023 14:23:28 -0400 Subject: [PATCH 12/13] Remove unneeded iframe magic number adjustment --- content/shared/js/app.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/content/shared/js/app.js b/content/shared/js/app.js index 4ad16d7bd8..7612696db6 100644 --- a/content/shared/js/app.js +++ b/content/shared/js/app.js @@ -55,7 +55,6 @@ } const iframe = document.querySelector(`.${data.iframe}`); if (!iframe) return; - const magicNumberAdjustment = 35; - iframe.style.height = `${data.height + magicNumberAdjustment}px`; + iframe.style.height = data.height + 'px'; } })(); From 6dbb0cb09d793cbf85e6d6ce0a1b39b855e9fdeb Mon Sep 17 00:00:00 2001 From: alflennik Date: Mon, 27 Mar 2023 17:37:27 -0400 Subject: [PATCH 13/13] Update support tables embeds to use production aria-at --- content/patterns/button/examples/button.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/patterns/button/examples/button.html b/content/patterns/button/examples/button.html index 7f192c5ca1..c0c4870720 100644 --- a/content/patterns/button/examples/button.html +++ b/content/patterns/button/examples/button.html @@ -201,7 +201,7 @@

Assistive Technology Support

Command Button