Skip to content
Open
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
6 changes: 6 additions & 0 deletions renderers/web_core/package.json
Comment thread
ava-cassiopeia marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@
"fix": "gts fix"
},
"wireit": {
"test": {
"command": "find dist -name '*.test.js' | xargs node --test --enable-source-maps --test-reporter spec",
"dependencies": [
"build"
]
},
Comment thread
selamw1 marked this conversation as resolved.
"copy-spec": {
"command": "node scripts/copy-spec.js",
"files": [
Expand Down
30 changes: 30 additions & 0 deletions renderers/web_core/src/v0_8/styles/border.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import test from 'node:test';
import assert from 'node:assert';
import { border } from './border.js';

test('Border Styles', async (t) => {
await t.test('border-radius classes should not apply overflow: hidden to avoid text clipping', () => {
// The issue reported clipping of text when using rounded corners because
// .border-br-* generated classes also blindly applied overflow: hidden.

// Check if the generated CSS contains overflow: hidden for border-br classes
const match = border.match(/\.border-br-\w+ \{[^}]*overflow:\s*hidden/);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const match = border.match(/\.border-br-\w+ \{[^}]*overflow:\s*hidden/);
const match = border.match(/\.border-br-\d+ \{[^}]*overflow:\s*hidden/);

It's only numbers, right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we also generate .border-br-50pc in border.ts, so keeping \w+ is necessary to ensure we don't skip testing the percentage-based class.

assert.strictEqual(match, null, 'Found overflow: hidden applied within a border-br-* class');
});
});
2 changes: 1 addition & 1 deletion renderers/web_core/src/v0_8/styles/border.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const border = `
.border-brw-${idx} { border-right-width: ${idx}px; }

.border-ow-${idx} { outline-width: ${idx}px; }
.border-br-${idx} { border-radius: ${idx * grid}px; overflow: hidden;}`;
.border-br-${idx} { border-radius: ${idx * grid}px; }`;
Comment thread
ava-cassiopeia marked this conversation as resolved.
})
.join("\n")}

Expand Down
Loading