Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/seven-coats-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@lynx-js/web-core-server": patch
"@lynx-js/web-core": patch
"@lynx-js/web-explorer": patch
---

feat: builtinTagTransformMap add `'input': 'x-input'`
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ const builtinTagTransformMap = {
'image': 'x-image',
'list': 'x-list',
'svg': 'x-svg',
'input': 'x-input',
};

// @ts-expect-error
Expand Down
1 change: 1 addition & 0 deletions packages/web-platform/web-core/src/apis/LynxView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ export class LynxView extends HTMLElement {
'image': 'x-image',
'list': 'x-list',
'svg': 'x-svg',
'input': 'x-input',
...this.overrideLynxTagToHTMLTagMap,
};
if (!this.shadowRoot) {
Expand Down
10 changes: 10 additions & 0 deletions packages/web-platform/web-tests/tests/react.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
ReturnType<typeof expect<Page>>['toHaveScreenshot']
>[0],
) => {
await expect(page).toHaveScreenshot([

Check failure on line 26 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (3/4) / check

[chromium] › tests/react.spec.ts:4861:5 › reactlynx3 tests › flex layout › basic-flex-row-container-main-axis-justify-content-start-end-with-direction-rtl

9) [chromium] › tests/react.spec.ts:4861:5 › reactlynx3 tests › flex layout › basic-flex-row-container-main-axis-justify-content-start-end-with-direction-rtl Error: expect(page).toHaveScreenshot(expected) failed 100800 pixels (ratio 0.36 of all image pixels) are different. Snapshot: basic-flex-row-container-main-axis-justify-content-start-end-with-direction-rtl/index/index.png Call log: - Expect "toHaveScreenshot(basic-flex-row-container-main-axis-justify-content-start-end-with-direction-rtl/index/index.png)" with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - waiting for fonts to load... - fonts loaded - 100800 pixels (ratio 0.36 of all image pixels) are different. - waiting 100ms before taking screenshot - taking page screenshot - waiting for fonts to load... - fonts loaded - captured a stable screenshot - 100800 pixels (ratio 0.36 of all image pixels) are different. 24 | >[0], 25 | ) => { > 26 | await expect(page).toHaveScreenshot([ | ^ 27 | `${caseName}`, 28 | `${subcaseName}`, 29 | `${label}.png`, at diffScreenShot (/__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:26:22) at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4865:15

Check failure on line 26 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (3/4) / check

[chromium] › tests/react.spec.ts:4857:5 › reactlynx3 tests › flex layout › basic-flex-column-align-items

8) [chromium] › tests/react.spec.ts:4857:5 › reactlynx3 tests › flex layout › basic-flex-column-align-items Error: expect(page).toHaveScreenshot(expected) failed 52500 pixels (ratio 0.19 of all image pixels) are different. Snapshot: basic-flex-column-align-items/index/index.png Call log: - Expect "toHaveScreenshot(basic-flex-column-align-items/index/index.png)" with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - waiting for fonts to load... - fonts loaded - 52500 pixels (ratio 0.19 of all image pixels) are different. - waiting 100ms before taking screenshot - taking page screenshot - waiting for fonts to load... - fonts loaded - captured a stable screenshot - 52500 pixels (ratio 0.19 of all image pixels) are different. 24 | >[0], 25 | ) => { > 26 | await expect(page).toHaveScreenshot([ | ^ 27 | `${caseName}`, 28 | `${subcaseName}`, 29 | `${label}.png`, at diffScreenShot (/__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:26:22) at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4859:13

Check failure on line 26 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (3/4) / check

[chromium] › tests/react.spec.ts:4818:5 › reactlynx3 tests › flex layout › basic-flex-item-not-shrink-to-zero

7) [chromium] › tests/react.spec.ts:4818:5 › reactlynx3 tests › flex layout › basic-flex-item-not-shrink-to-zero Error: expect(page).toHaveScreenshot(expected) failed 9100 pixels (ratio 0.04 of all image pixels) are different. Snapshot: basic-flex-item-not-shrink-to-zero/index/index.png Call log: - Expect "toHaveScreenshot(basic-flex-item-not-shrink-to-zero/index/index.png)" with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - waiting for fonts to load... - fonts loaded - 9100 pixels (ratio 0.04 of all image pixels) are different. - waiting 100ms before taking screenshot - taking page screenshot - waiting for fonts to load... - fonts loaded - captured a stable screenshot - 9100 pixels (ratio 0.04 of all image pixels) are different. 24 | >[0], 25 | ) => { > 26 | await expect(page).toHaveScreenshot([ | ^ 27 | `${caseName}`, 28 | `${subcaseName}`, 29 | `${label}.png`, at diffScreenShot (/__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:26:22) at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4820:13

Check failure on line 26 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (3/4) / check

[chromium] › tests/react.spec.ts:4792:5 › reactlynx3 tests › linear layout › basic-linear-column-container-main-axis-justify-content-start-end-with-direction-rtl

6) [chromium] › tests/react.spec.ts:4792:5 › reactlynx3 tests › linear layout › basic-linear-column-container-main-axis-justify-content-start-end-with-direction-rtl Error: expect(page).toHaveScreenshot(expected) failed 100800 pixels (ratio 0.36 of all image pixels) are different. Snapshot: basic-linear-column-container-main-axis-justify-content-start-end-with-direction-rtl/index/index.png Call log: - Expect "toHaveScreenshot(basic-linear-column-container-main-axis-justify-content-start-end-with-direction-rtl/index/index.png)" with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - waiting for fonts to load... - fonts loaded - 100800 pixels (ratio 0.36 of all image pixels) are different. - waiting 100ms before taking screenshot - taking page screenshot - waiting for fonts to load... - fonts loaded - captured a stable screenshot - 100800 pixels (ratio 0.36 of all image pixels) are different. 24 | >[0], 25 | ) => { > 26 | await expect(page).toHaveScreenshot([ | ^ 27 | `${caseName}`, 28 | `${subcaseName}`, 29 | `${label}.png`, at diffScreenShot (/__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:26:22) at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4796:15

Check failure on line 26 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (3/4) / check

[chromium] › tests/react.spec.ts:4760:5 › reactlynx3 tests › linear layout › basic-linear-row-container-items-layout-gravity

5) [chromium] › tests/react.spec.ts:4760:5 › reactlynx3 tests › linear layout › basic-linear-row-container-items-layout-gravity Error: expect(page).toHaveScreenshot(expected) failed 24000 pixels (ratio 0.09 of all image pixels) are different. Snapshot: basic-linear-row-container-items-layout-gravity/index/index.png Call log: - Expect "toHaveScreenshot(basic-linear-row-container-items-layout-gravity/index/index.png)" with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - waiting for fonts to load... - fonts loaded - 24000 pixels (ratio 0.09 of all image pixels) are different. - waiting 100ms before taking screenshot - taking page screenshot - waiting for fonts to load... - fonts loaded - captured a stable screenshot - 24000 pixels (ratio 0.09 of all image pixels) are different. 24 | >[0], 25 | ) => { > 26 | await expect(page).toHaveScreenshot([ | ^ 27 | `${caseName}`, 28 | `${subcaseName}`, 29 | `${label}.png`, at diffScreenShot (/__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:26:22) at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4764:13

Check failure on line 26 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (3/4) / check

[chromium] › tests/react.spec.ts:4733:5 › reactlynx3 tests › linear layout › basic-linear-row-cross-gravity

4) [chromium] › tests/react.spec.ts:4733:5 › reactlynx3 tests › linear layout › basic-linear-row-cross-gravity Error: expect(page).toHaveScreenshot(expected) failed 52500 pixels (ratio 0.19 of all image pixels) are different. Snapshot: basic-linear-row-cross-gravity/index/index.png Call log: - Expect "toHaveScreenshot(basic-linear-row-cross-gravity/index/index.png)" with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - waiting for fonts to load... - fonts loaded - 52500 pixels (ratio 0.19 of all image pixels) are different. - waiting 100ms before taking screenshot - taking page screenshot - waiting for fonts to load... - fonts loaded - captured a stable screenshot - 52500 pixels (ratio 0.19 of all image pixels) are different. 24 | >[0], 25 | ) => { > 26 | await expect(page).toHaveScreenshot([ | ^ 27 | `${caseName}`, 28 | `${subcaseName}`, 29 | `${label}.png`, at diffScreenShot (/__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:26:22) at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4735:13

Check failure on line 26 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (3/4) / check

[chromium] › tests/react.spec.ts:4729:5 › reactlynx3 tests › linear layout › basic-linear-graverty-space-between

3) [chromium] › tests/react.spec.ts:4729:5 › reactlynx3 tests › linear layout › basic-linear-graverty-space-between Error: expect(page).toHaveScreenshot(expected) failed 15000 pixels (ratio 0.06 of all image pixels) are different. Snapshot: basic-linear-graverty-space-between/index/index.png Call log: - Expect "toHaveScreenshot(basic-linear-graverty-space-between/index/index.png)" with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - waiting for fonts to load... - fonts loaded - 15000 pixels (ratio 0.06 of all image pixels) are different. - waiting 100ms before taking screenshot - taking page screenshot - waiting for fonts to load... - fonts loaded - captured a stable screenshot - 15000 pixels (ratio 0.06 of all image pixels) are different. 24 | >[0], 25 | ) => { > 26 | await expect(page).toHaveScreenshot([ | ^ 27 | `${caseName}`, 28 | `${subcaseName}`, 29 | `${label}.png`, at diffScreenShot (/__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:26:22) at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4731:13

Check failure on line 26 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (3/4) / check

[chromium] › tests/react.spec.ts:4720:5 › reactlynx3 tests › linear layout › basic-linear-column-container-main-axis-graverty-center

2) [chromium] › tests/react.spec.ts:4720:5 › reactlynx3 tests › linear layout › basic-linear-column-container-main-axis-graverty-center Error: expect(page).toHaveScreenshot(expected) failed 67500 pixels (ratio 0.24 of all image pixels) are different. Snapshot: basic-linear-column-container-main-axis-graverty-center/index/index.png Call log: - Expect "toHaveScreenshot(basic-linear-column-container-main-axis-graverty-center/index/index.png)" with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - waiting for fonts to load... - fonts loaded - 67500 pixels (ratio 0.24 of all image pixels) are different. - waiting 100ms before taking screenshot - taking page screenshot - waiting for fonts to load... - fonts loaded - captured a stable screenshot - 67500 pixels (ratio 0.24 of all image pixels) are different. 24 | >[0], 25 | ) => { > 26 | await expect(page).toHaveScreenshot([ | ^ 27 | `${caseName}`, 28 | `${subcaseName}`, 29 | `${label}.png`, at diffScreenShot (/__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:26:22) at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4726:15

Check failure on line 26 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (1/4) / check

[webkit] › tests/react.spec.ts:2049:7 › reactlynx3 tests › elements › text › basic-element-text-nest-text

11) [webkit] › tests/react.spec.ts:2049:7 › reactlynx3 tests › elements › text › basic-element-text-nest-text Error: expect(page).toHaveScreenshot(expected) failed 937 pixels (ratio 0.01 of all image pixels) are different. Snapshot: text/nest-text/index.png Call log: - Expect "toHaveScreenshot(text/nest-text/index.png)" with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - waiting for fonts to load... - fonts loaded - 937 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - taking page screenshot - waiting for fonts to load... - fonts loaded - captured a stable screenshot - 937 pixels (ratio 0.01 of all image pixels) are different. 24 | >[0], 25 | ) => { > 26 | await expect(page).toHaveScreenshot([ | ^ 27 | `${caseName}`, 28 | `${subcaseName}`, 29 | `${label}.png`, at diffScreenShot (/__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:26:22) at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:2052:15
`${caseName}`,
`${subcaseName}`,
`${label}.png`,
Expand Down Expand Up @@ -105,7 +105,7 @@
)
.filter(i => i.getAttribute('lynx-tag') === 'page').length
),
).toBe(1);

Check failure on line 108 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (1/4) / check

[webkit] › tests/react.spec.ts:93:5 › reactlynx3 tests › basic › basic-reload-page-only-one

3) [webkit] › tests/react.spec.ts:93:5 › reactlynx3 tests › basic › basic-reload-page-only-one ─── Error: expect(received).toBe(expected) // Object.is equality Expected: 1 Received: 0 106 | .filter(i => i.getAttribute('lynx-tag') === 'page').length 107 | ), > 108 | ).toBe(1); | ^ 109 | }); 110 | test('basic-bindtap', async ({ page }, { title }) => { 111 | await goto(page, title); at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:108:9

Check failure on line 108 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright ALL_ON_UI-CSR (1/4) / check

[webkit] › tests/react.spec.ts:93:5 › reactlynx3 tests › basic › basic-reload-page-only-one

4) [webkit] › tests/react.spec.ts:93:5 › reactlynx3 tests › basic › basic-reload-page-only-one ─── Error: expect(received).toBe(expected) // Object.is equality Expected: 1 Received: 0 106 | .filter(i => i.getAttribute('lynx-tag') === 'page').length 107 | ), > 108 | ).toBe(1); | ^ 109 | }); 110 | test('basic-bindtap', async ({ page }, { title }) => { 111 | await goto(page, title); at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:108:9

Check failure on line 108 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (2/4) / check

[chromium] › tests/react.spec.ts:93:5 › reactlynx3 tests › basic › basic-reload-page-only-one

3) [chromium] › tests/react.spec.ts:93:5 › reactlynx3 tests › basic › basic-reload-page-only-one ─ Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toBe(expected) // Object.is equality Expected: 1 Received: 0 106 | .filter(i => i.getAttribute('lynx-tag') === 'page').length 107 | ), > 108 | ).toBe(1); | ^ 109 | }); 110 | test('basic-bindtap', async ({ page }, { title }) => { 111 | await goto(page, title); at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:108:9

Check failure on line 108 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (2/4) / check

[chromium] › tests/react.spec.ts:93:5 › reactlynx3 tests › basic › basic-reload-page-only-one

3) [chromium] › tests/react.spec.ts:93:5 › reactlynx3 tests › basic › basic-reload-page-only-one ─ Error: expect(received).toBe(expected) // Object.is equality Expected: 1 Received: 0 106 | .filter(i => i.getAttribute('lynx-tag') === 'page').length 107 | ), > 108 | ).toBe(1); | ^ 109 | }); 110 | test('basic-bindtap', async ({ page }, { title }) => { 111 | await goto(page, title); at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:108:9
});
test('basic-bindtap', async ({ page }, { title }) => {
await goto(page, title);
Expand Down Expand Up @@ -376,7 +376,7 @@
xDistance: 10,
yDistance: 0,
});
expect(page.locator('#target1'), 'has touches').toHaveCSS(

Check failure on line 379 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (2/4) / check

[chromium] › tests/react.spec.ts:366:5 › reactlynx3 tests › basic › basic-mts-bindtouchstart

4) [chromium] › tests/react.spec.ts:366:5 › reactlynx3 tests › basic › basic-mts-bindtouchstart ── Error: has touches expect(locator).toHaveCSS(expected) failed Locator: locator('#target1') Expected: "rgb(0, 128, 0)" Received: "rgb(255, 192, 203)" Call log: - has touches with timeout 5000ms - waiting for locator('#target1') 2 × locator resolved to <x-view l-uid="3" id="target1" lynx-tag="view" l-p-comp-uid="1"></x-view> - unexpected value "rgb(255, 192, 203)" 377 | yDistance: 0, 378 | }); > 379 | expect(page.locator('#target1'), 'has touches').toHaveCSS( | ^ 380 | 'background-color', 381 | 'rgb(0, 128, 0)', 382 | ); // green at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:379:57
'background-color',
'rgb(0, 128, 0)',
); // green
Expand Down Expand Up @@ -942,7 +942,7 @@
test('api-get-path-info', async ({ page }, { title }) => {
await goto(page, title);
await wait(500);
expect(await page.locator('#result').getAttribute('style')).toContain(

Check failure on line 945 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (1/4) / check

[webkit] › tests/react.spec.ts:942:5 › reactlynx3 tests › apis › api-get-path-info

4) [webkit] › tests/react.spec.ts:942:5 › reactlynx3 tests › apis › api-get-path-info ──────────── Error: expect(received).toContain(expected) // indexOf Expected substring: "green" Received string: "width:400px;height:200px;background:pink;word-break:break-all;" 943 | await goto(page, title); 944 | await wait(500); > 945 | expect(await page.locator('#result').getAttribute('style')).toContain( | ^ 946 | 'green', 947 | ); 948 | }); at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:945:67
'green',
);
});
Expand Down Expand Up @@ -1040,7 +1040,7 @@
// @ts-expect-error
return Object.keys(globalThis.timing);
});
expect(timingKeys).toContain('create_lynx_start');

Check failure on line 1043 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright ALL_ON_UI-CSR (1/4) / check

[webkit] › tests/react.spec.ts:1029:5 › reactlynx3 tests › apis › api-lynx-performance

5) [webkit] › tests/react.spec.ts:1029:5 › reactlynx3 tests › apis › api-lynx-performance ──────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toContain(expected) // indexOf Expected value: "create_lynx_start" Received array: ["load_core_start", "load_core_end", "hydrateParseSnapshotStart", "hydrateParseSnapshotEnd", "diffVdomStart", "diffVdomEnd", "packChangesStart", "packChangesEnd", "dispatch_start", "layout_start", …] 1041 | return Object.keys(globalThis.timing); 1042 | }); > 1043 | expect(timingKeys).toContain('create_lynx_start'); | ^ 1044 | expect(timingKeys).toContain('dispatch_start'); 1045 | expect(timingKeys).toContain('layout_start'); 1046 | expect(timingKeys).toContain('layout_end'); at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:1043:26

Check failure on line 1043 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright ALL_ON_UI-CSR (1/4) / check

[webkit] › tests/react.spec.ts:1029:5 › reactlynx3 tests › apis › api-lynx-performance

5) [webkit] › tests/react.spec.ts:1029:5 › reactlynx3 tests › apis › api-lynx-performance ──────── Error: expect(received).toContain(expected) // indexOf Expected value: "create_lynx_start" Received array: ["load_core_start", "load_core_end", "hydrateParseSnapshotStart", "hydrateParseSnapshotEnd", "diffVdomStart", "diffVdomEnd", "packChangesStart", "packChangesEnd", "dispatch_start", "layout_start", …] 1041 | return Object.keys(globalThis.timing); 1042 | }); > 1043 | expect(timingKeys).toContain('create_lynx_start'); | ^ 1044 | expect(timingKeys).toContain('dispatch_start'); 1045 | expect(timingKeys).toContain('layout_start'); 1046 | expect(timingKeys).toContain('layout_end'); at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:1043:26
expect(timingKeys).toContain('dispatch_start');
expect(timingKeys).toContain('layout_start');
expect(timingKeys).toContain('layout_end');
Expand Down Expand Up @@ -1230,7 +1230,7 @@
});
await goto(page, 'api-error');
await wait(500);
expect(offset).toBe(true);

Check failure on line 1233 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (1/4) / check

[webkit] › tests/react.spec.ts:1207:5 › reactlynx3 tests › apis › api-error-detail

5) [webkit] › tests/react.spec.ts:1207:5 › reactlynx3 tests › apis › api-error-detail ──────────── Error: expect(received).toBe(expected) // Object.is equality Expected: true Received: false 1231 | await goto(page, 'api-error'); 1232 | await wait(500); > 1233 | expect(offset).toBe(true); | ^ 1234 | }); 1235 | test('api-error-mts', async ({ page }, { title }) => { 1236 | test.skip(isSSR, 'No need to test this on SSR'); at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:1233:22
});
test('api-error-mts', async ({ page }, { title }) => {
test.skip(isSSR, 'No need to test this on SSR');
Expand All @@ -1253,7 +1253,7 @@
});
await goto(page, 'api-error');
await wait(500);
expect(fileName).toBe(true);

Check failure on line 1256 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (1/4) / check

[webkit] › tests/react.spec.ts:1235:5 › reactlynx3 tests › apis › api-error-mts

6) [webkit] › tests/react.spec.ts:1235:5 › reactlynx3 tests › apis › api-error-mts ─────────────── Error: expect(received).toBe(expected) // Object.is equality Expected: true Received: false 1254 | await goto(page, 'api-error'); 1255 | await wait(500); > 1256 | expect(fileName).toBe(true); | ^ 1257 | }); 1258 | test('api-error-bts', async ({ page }, { title }) => { 1259 | let fileName = false; at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:1256:24
});
test('api-error-bts', async ({ page }, { title }) => {
let fileName = false;
Expand All @@ -1276,7 +1276,7 @@
});
await goto(page, 'api-error');
await wait(500);
expect(fileName).toBe(true);

Check failure on line 1279 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (2/4) / check

[chromium] › tests/react.spec.ts:1258:5 › reactlynx3 tests › apis › api-error-bts

5) [chromium] › tests/react.spec.ts:1258:5 › reactlynx3 tests › apis › api-error-bts ───────────── Error: expect(received).toBe(expected) // Object.is equality Expected: true Received: false 1277 | await goto(page, 'api-error'); 1278 | await wait(500); > 1279 | expect(fileName).toBe(true); | ^ 1280 | }); 1281 | test('api-set-release', async ({ page }, { title }) => { 1282 | test.skip(isSSR, 'No need to test this on SSR'); at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:1279:24
});
test('api-set-release', async ({ page }, { title }) => {
test.skip(isSSR, 'No need to test this on SSR');
Expand Down Expand Up @@ -1373,7 +1373,7 @@
await goto(page, 'api-setSharedData', 'api-getSharedData');
await wait(100);
await page.locator('#lynxview2').locator('#target').click();
await expect(page.locator('#lynxview2').locator('#target')).toHaveCSS(

Check failure on line 1376 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (2/4) / check

[chromium] › tests/react.spec.ts:1372:5 › reactlynx3 tests › apis › api-shared-context

6) [chromium] › tests/react.spec.ts:1372:5 › reactlynx3 tests › apis › api-shared-context ──────── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator).toHaveCSS(expected) failed Locator: locator('#lynxview2').locator('#target') Expected: "rgb(0, 128, 0)" Received: "rgba(0, 0, 0, 0)" Timeout: 5000ms Call log: - Expect "toHaveCSS" with timeout 5000ms - waiting for locator('#lynxview2').locator('#target') 9 × locator resolved to <x-view l-uid="2" id="target" lynx-tag="view" l-p-comp-uid="1"></x-view> - unexpected value "rgba(0, 0, 0, 0)" 1374 | await wait(100); 1375 | await page.locator('#lynxview2').locator('#target').click(); > 1376 | await expect(page.locator('#lynxview2').locator('#target')).toHaveCSS( | ^ 1377 | 'background-color', 1378 | 'rgb(0, 128, 0)', 1379 | ); // green at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:1376:67

Check failure on line 1376 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (2/4) / check

[chromium] › tests/react.spec.ts:1372:5 › reactlynx3 tests › apis › api-shared-context

6) [chromium] › tests/react.spec.ts:1372:5 › reactlynx3 tests › apis › api-shared-context ──────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator).toHaveCSS(expected) failed Locator: locator('#lynxview2').locator('#target') Expected: "rgb(0, 128, 0)" Received: "rgba(0, 0, 0, 0)" Timeout: 5000ms Call log: - Expect "toHaveCSS" with timeout 5000ms - waiting for locator('#lynxview2').locator('#target') 3 × locator resolved to <x-view l-uid="2" id="target" lynx-tag="view" l-p-comp-uid="1"></x-view> - unexpected value "rgb(255, 165, 0)" 6 × locator resolved to <x-view l-uid="2" id="target" lynx-tag="view" l-p-comp-uid="1"></x-view> - unexpected value "rgba(0, 0, 0, 0)" 1374 | await wait(100); 1375 | await page.locator('#lynxview2').locator('#target').click(); > 1376 | await expect(page.locator('#lynxview2').locator('#target')).toHaveCSS( | ^ 1377 | 'background-color', 1378 | 'rgb(0, 128, 0)', 1379 | ); // green at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:1376:67

Check failure on line 1376 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (2/4) / check

[chromium] › tests/react.spec.ts:1372:5 › reactlynx3 tests › apis › api-shared-context

6) [chromium] › tests/react.spec.ts:1372:5 › reactlynx3 tests › apis › api-shared-context ──────── Error: expect(locator).toHaveCSS(expected) failed Locator: locator('#lynxview2').locator('#target') Expected: "rgb(0, 128, 0)" Received: "rgba(0, 0, 0, 0)" Timeout: 5000ms Call log: - Expect "toHaveCSS" with timeout 5000ms - waiting for locator('#lynxview2').locator('#target') 9 × locator resolved to <x-view l-uid="2" id="target" lynx-tag="view" l-p-comp-uid="1"></x-view> - unexpected value "rgba(0, 0, 0, 0)" 1374 | await wait(100); 1375 | await page.locator('#lynxview2').locator('#target').click(); > 1376 | await expect(page.locator('#lynxview2').locator('#target')).toHaveCSS( | ^ 1377 | 'background-color', 1378 | 'rgb(0, 128, 0)', 1379 | ); // green at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:1376:67
'background-color',
'rgb(0, 128, 0)',
); // green
Expand All @@ -1398,7 +1398,7 @@
document.body.querySelector('lynx-view')?.remove()
);
await wait(100);
expect(page.workers().length).toBeLessThanOrEqual(0);

Check failure on line 1401 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (1/4) / check

[webkit] › tests/react.spec.ts:1388:5 › reactlynx3 tests › apis › api-shared-context-worker-count-release

7) [webkit] › tests/react.spec.ts:1388:5 › reactlynx3 tests › apis › api-shared-context-worker-count-release Error: expect(received).toBeLessThanOrEqual(expected) Expected: <= 0 Received: 2 1399 | ); 1400 | await wait(100); > 1401 | expect(page.workers().length).toBeLessThanOrEqual(0); | ^ 1402 | }); 1403 | 1404 | test.describe('api-exposure', () => { at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:1401:37

Check failure on line 1401 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (2/4) / check

[chromium] › tests/react.spec.ts:1388:5 › reactlynx3 tests › apis › api-shared-context-worker-count-release

7) [chromium] › tests/react.spec.ts:1388:5 › reactlynx3 tests › apis › api-shared-context-worker-count-release Error: expect(received).toBeLessThanOrEqual(expected) Expected: <= 0 Received: 2 1399 | ); 1400 | await wait(100); > 1401 | expect(page.workers().length).toBeLessThanOrEqual(0); | ^ 1402 | }); 1403 | 1404 | test.describe('api-exposure', () => { at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:1401:37
});

test.describe('api-exposure', () => {
Expand Down Expand Up @@ -1754,8 +1754,8 @@
});
await goto(page, title);
await wait(200);
!isSSR && expect(mts).toBe(true);

Check failure on line 1757 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (1/4) / check

[webkit] › tests/react.spec.ts:1742:5 › reactlynx3 tests › apis › api-global-disallowed-vars

8) [webkit] › tests/react.spec.ts:1742:5 › reactlynx3 tests › apis › api-global-disallowed-vars ── Error: expect(received).toBe(expected) // Object.is equality Expected: true Received: false 1755 | await goto(page, title); 1756 | await wait(200); > 1757 | !isSSR && expect(mts).toBe(true); | ^ 1758 | expect(bts).toBe(true); 1759 | }, 1760 | ); at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:1757:31
expect(bts).toBe(true);

Check failure on line 1758 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright ALL_ON_UI-CSR (2/4) / check

[chromium] › tests/react.spec.ts:1742:5 › reactlynx3 tests › apis › api-global-disallowed-vars

7) [chromium] › tests/react.spec.ts:1742:5 › reactlynx3 tests › apis › api-global-disallowed-vars Error: expect(received).toBe(expected) // Object.is equality Expected: true Received: false 1756 | await wait(200); 1757 | !isSSR && expect(mts).toBe(true); > 1758 | expect(bts).toBe(true); | ^ 1759 | }, 1760 | ); 1761 | test( at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:1758:21
},
);
test(
Expand All @@ -1773,7 +1773,7 @@
});
await goto(page, title);
await wait(200);
!isSSR && expect(mts).toBe(true);

Check failure on line 1776 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (1/4) / check

[webkit] › tests/react.spec.ts:1761:5 › reactlynx3 tests › apis › api-globalThis

9) [webkit] › tests/react.spec.ts:1761:5 › reactlynx3 tests › apis › api-globalThis ────────────── Error: expect(received).toBe(expected) // Object.is equality Expected: true Received: false 1774 | await goto(page, title); 1775 | await wait(200); > 1776 | !isSSR && expect(mts).toBe(true); | ^ 1777 | expect(bts).toBe(true); 1778 | }, 1779 | ); at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:1776:31
expect(bts).toBe(true);
},
);
Expand Down Expand Up @@ -1988,7 +1988,7 @@
await expect(await target.getAttribute('style')).toContain('green');
await target.click();
await wait(100);
await expect(await target.getAttribute('style')).toContain('pink');

Check failure on line 1991 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (1/4) / check

[webkit] › tests/react.spec.ts:1981:5 › reactlynx3 tests › configs › config-mode-dev-with-all-in-one

10) [webkit] › tests/react.spec.ts:1981:5 › reactlynx3 tests › configs › config-mode-dev-with-all-in-one Error: expect(received).toContain(expected) // indexOf Expected substring: "pink" Received string: "height:100px;width:100px;background:green;" 1989 | await target.click(); 1990 | await wait(100); > 1991 | await expect(await target.getAttribute('style')).toContain('pink'); | ^ 1992 | }); 1993 | 1994 | test( at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:1991:56
});

test(
Expand Down Expand Up @@ -3003,6 +3003,16 @@
const result = await page.locator('.result').first().innerText();
expect(result).toBe('foobar-6-6');
});
// input/bindinput test-case start for <input>
test('basic-element-input-bindinput', async ({ page }, { title }) => {
await goto(page, title);
await page.locator('input').press('Enter');
await wait(200);
await page.locator('input').fill('foobar');
await wait(200);
const result = await page.locator('.result').first().innerText();
expect(result).toBe('foobar-6-6');
});
// input/bindinput test-case end
test(
'basic-element-x-input-getValue',
Expand Down Expand Up @@ -4425,7 +4435,7 @@
textareaDom?.setSelectionRange(2, 5);
});
const result = await page.locator('.result').first().innerText();
expect(result).toBe('2-5');

Check failure on line 4438 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright ALL_ON_UI-CSR (1/4) / check

[webkit] › tests/react.spec.ts:4424:7 › reactlynx3 tests › elements › x-textarea › basic-element-x-textarea-bindselection

6) [webkit] › tests/react.spec.ts:4424:7 › reactlynx3 tests › elements › x-textarea › basic-element-x-textarea-bindselection Error: expect(received).toBe(expected) // Object.is equality Expected: "2-5" Received: "" 4436 | }); 4437 | const result = await page.locator('.result').first().innerText(); > 4438 | expect(result).toBe('2-5'); | ^ 4439 | }, 4440 | ); 4441 | at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4438:26
},
);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright 2023 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.
import { root, useState } from '@lynx-js/react';

function App() {
const value = 'bindinput';
const [result, setResult] = useState();

const onInput = ({ detail }) => {
if (typeof detail !== 'object') {
throw new Error(
`detail type not match. expect object, got ${typeof detail}`,
);
}

const { value, cursor, textLength, selectionStart, selectionEnd } = detail;

if (value.length !== textLength) {
throw new Error(
`input length not match. expect ${textLength}, got ${value.length}`,
);
}

setResult(`${value}-${selectionStart}-${selectionStart}`);
};

return (
<view>
<input
bindinput={onInput}
value={value}
style='border: 1px solid;width: 300px;height:40px'
/>
<view class='result'>
<text>{result}</text>
</view>
</view>
);
}

root.render(<App></App>);
Loading