Skip to content

Commit

Permalink
fix: add overflow clip support
Browse files Browse the repository at this point in the history
  • Loading branch information
temper357 committed Nov 4, 2021
1 parent a26c1c8 commit 153e0f2
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 0 deletions.
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.
43 changes: 43 additions & 0 deletions integration_tests/specs/css/css-overflow/overflow-clip.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
describe('clip', () => {
fit('should works with basic', async () => {
let image;
let container = createElement('div', {
style: {
width: '80px',
height: '80px',
borderRadius: '10px',
overflow: "clip",
}
}, [
(image = createElement('img', {
src: 'assets/100x100-green.png',
}))
]);

document.body.appendChild(container);

await snapshot(0.1);
});

fit('should works with children of appear event', async () => {
let image;
let container = createElement('div', {
style: {
width: '80px',
height: '80px',
borderRadius: '10px',
overflow: "clip",
}
}, [
(image = createElement('img', {
src: 'assets/100x100-green.png',
}))
]);

image.addEventListener('appear', function onAppear() {});

document.body.appendChild(container);

await snapshot(0.1);
});
});
43 changes: 43 additions & 0 deletions integration_tests/specs/css/css-overflow/overflow-hidden.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
describe('hidden', () => {
fit('should works with basic', async () => {
let image;
let container = createElement('div', {
style: {
width: '80px',
height: '80px',
borderRadius: '10px',
overflow: "hidden",
}
}, [
(image = createElement('img', {
src: 'assets/100x100-green.png',
}))
]);

document.body.appendChild(container);

await snapshot(0.1);
});

fit('should works with children of appear event', async () => {
let image;
let container = createElement('div', {
style: {
width: '80px',
height: '80px',
borderRadius: '10px',
overflow: "hidden",
}
}, [
(image = createElement('img', {
src: 'assets/100x100-green.png',
}))
]);

image.addEventListener('appear', function onAppear() {});

document.body.appendChild(container);

await snapshot(0.1);
});
});
2 changes: 2 additions & 0 deletions kraken/lib/src/css/overflow.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ CSSOverflowType _getOverflowType(String definition) {
return CSSOverflowType.scroll;
case AUTO:
return CSSOverflowType.auto;
case CLIP:
return CSSOverflowType.clip;
case VISIBLE:
default:
return CSSOverflowType.visible;
Expand Down
3 changes: 3 additions & 0 deletions kraken/lib/src/css/values/keywords.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ const String AUTO = 'auto';
const String VISIBLE = 'visible';
const String HIDDEN = 'hidden';

// Overflow
const String CLIP = 'clip';

// Border
const String SOLID = 'solid';
const String THIN = 'thin'; // A thin border.
Expand Down

0 comments on commit 153e0f2

Please sign in to comment.