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
5 changes: 5 additions & 0 deletions .changeset/little-beans-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lynx-js/web-elements": patch
---

Inherit padding styles for x-input elements.
1 change: 1 addition & 0 deletions .github/lynx-stack.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ applyTo: "packages/web-platform/web-elements/**/*"
When updating web element APIs, add targeted Playwright tests in packages/web-platform/web-elements/tests/web-elements.spec.ts and keep changes minimal.
Ensure Playwright browsers are installed (pnpm exec playwright install --with-deps <browser>) before running web-elements tests.
For x-input type="number" in web-elements, keep inner input type as text, set inputmode="decimal", and filter number input internally without setting input-filter explicitly.
Add new web-elements UI fixtures under packages/web-platform/web-elements/tests/fixtures and commit matching snapshots in packages/web-platform/web-elements/tests/web-elements.spec.ts-snapshots.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ x-input::part(input), x-input::part(form) {
background-color: inherit;
z-index: inherit;
margin: inherit;
padding: inherit;
color: inherit;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!DOCTYPE html>
<!-- Copyright 2024 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. -->
<html>
<head>
<meta charset="utf-8">
<title>web playground</title>
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="default" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no" name="format-detection">
<meta content="portrait" name="screen-orientation">
<meta
content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"
name="viewport"
>
<meta content="portrait" name="x5-orientation" />

<link
href="/main.css"
rel="stylesheet"
/>
</head>

<body>
<script src="/main.js" defer></script>
<x-view class="page">
<x-view
style="height: 36px; border-radius: 6px; border: 0.5px solid; padding: 0 12px; overflow: visible"
>
<x-input
style="height: 40px; z-index: -1"
confirm-type="done"
value="hello"
></x-input>
</x-view>
<x-view
style="height: 36px; border-radius: 6px; border: 0.5px solid; padding: 0 12px; overflow: visible"
>
<x-input
style="height: 40px; padding: 0 12px; z-index: -1"
confirm-type="done"
value="hello"
></x-input>
</x-view>
</x-view>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
ReturnType<typeof expect<Page>>['toHaveScreenshot']
>[0],
) => {
await expect(page).toHaveScreenshot([`${caseName}`, `${subcaseName}.png`], {

Check failure on line 21 in packages/web-platform/web-elements/tests/web-elements.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright Web Elements Test (1/2) / check

[webkit] › tests/web-elements.spec.ts:2455:5 › web-elements test suite › x-list › list-type-change

2) [webkit] › tests/web-elements.spec.ts:2455:5 › web-elements test suite › x-list › list-type-change Error: expect(page).toHaveScreenshot(expected) failed 195000 pixels (ratio 0.76 of all image pixels) are different. Snapshot: x-list/list-type-change/single.png Call log: - Expect "toHaveScreenshot(x-list/list-type-change/single.png)" with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - waiting for fonts to load... - fonts loaded - 195000 pixels (ratio 0.76 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 - 195000 pixels (ratio 0.76 of all image pixels) are different. 19 | >[0], 20 | ) => { > 21 | await expect(page).toHaveScreenshot([`${caseName}`, `${subcaseName}.png`], { | ^ 22 | maxDiffPixelRatio: 0, 23 | fullPage: true, 24 | animations: 'allow', at diffScreenShot (/__w/lynx-stack/lynx-stack/packages/web-platform/web-elements/tests/web-elements.spec.ts:21:22) at /__w/lynx-stack/lynx-stack/packages/web-platform/web-elements/tests/web-elements.spec.ts:2465:13
maxDiffPixelRatio: 0,
fullPage: true,
animations: 'allow',
Expand Down Expand Up @@ -2953,6 +2953,14 @@
await diffScreenShot(page, title, 'initial');
},
);
test(
'style-inherit-padding',
async ({ page }, { titlePath }) => {
const title = getTitle(titlePath);
await gotoWebComponentPage(page, title);
await diffScreenShot(page, title, 'initial');
},
);
test(
'style-inherit-color',
async ({ page }, { titlePath }) => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading