Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
fix(aria): split id reference lists on ASCII whitespace (#43361)
Yury Semikhatskyb536a63898ee
diff --git a/packages/injected/src/roleUtils.ts b/packages/injected/src/roleUtils.tsindex 649525f049..e8de076f2c 100644--- a/packages/injected/src/roleUtils.ts+++ b/packages/injected/src/roleUtils.ts@@ -447,7 +447,8 @@ function getIdRefs(element: Element, ref: string | null): Element[] {if (!root)return [];try {- const ids = ref.split(' ').filter(id => !!id);+ // ID reference lists are separated by ASCII whitespace, which does not include e.g. .+ const ids = ref.split(/[ \t\n\f\r]+/).filter(id => !!id);const result: Element[] = [];for (const id of ids) {// https://www.w3.org/TR/wai-aria-1.2/#mapping_additional_relations_error_processingdiff --git a/tests/library/role-utils.spec.ts b/tests/library/role-utils.spec.tsindex 2b23cd497f..90899bc977 100644--- a/tests/library/role-utils.spec.ts+++ b/tests/library/role-utils.spec.ts@@ -399,6 +399,7 @@ test('native controls labelled-by', async ({ page }) => {<label id="for-button2">BUTTON2</label><button aria-labelledby="for-button2 button2" id="button2">MORE2</button><label id="for-button3" for="button3">BUTTON3</label><button aria-labelledby="for-button3 button3" id="button3">MORE3</button><label id="for-button4" for="button4">BUTTON4</label><button aria-labelledby="for-button4" id="button4">MORE4</button>+ <label id="for\u00a0button5">BUTTON5</label><button aria-labelledby="for\u00a0button5\n\tbutton5" id="button5">MORE5</button><label id="for-textarea1" for="textarea1">TEXTAREA1</label><textarea aria-labelledby="for-textarea1 textarea1" id="textarea1" placeholder="MORE1">MORE2</textarea>`);@@ -413,6 +414,7 @@ test('native controls labelled-by', async ({ page }) => {expect.soft(await getNameAndRole(page, '#button2')).toEqual({ role: 'button', name: 'BUTTON2 MORE2' });expect.soft(await getNameAndRole(page, '#button3')).toEqual({ role: 'button', name: 'BUTTON3 MORE3' });expect.soft(await getNameAndRole(page, '#button4')).toEqual({ role: 'button', name: 'BUTTON4' });+ expect.soft(await getNameAndRole(page, '#button5')).toEqual({ role: 'button', name: 'BUTTON5 MORE5' });expect.soft(await getNameAndRole(page, '#textarea1')).toEqual({ role: 'textbox', name: 'TEXTAREA1 MORE2' });});