Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: layout performance #897

Merged
merged 25 commits into from Dec 7, 2021
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b9ab705
feat: cache logical content width/height to avoid recursive computati…
temper357 Nov 19, 2021
a5c4595
Merge branch 'feat-css-style-sheet' of github.com:openkraken/kraken i…
temper357 Nov 19, 2021
67d27e5
fix: content width/height should not be negative
temper357 Nov 19, 2021
c071a7b
Merge branch 'main' of github.com:openkraken/kraken into refactor/con…
temper357 Nov 23, 2021
a328f72
fix: margin should be subtracted when calculating logical width/height
temper357 Nov 23, 2021
3f52aee
feat: move logicalContentWidth/height from renderBoxModel to renderStyle
temper357 Nov 23, 2021
cb2e2a5
fix: get parent constraints if width not exist and display is block
temper357 Nov 23, 2021
40b8e4a
fix: height stretch logic
temper357 Nov 23, 2021
341b3b7
fix: isNotAuto
temper357 Nov 23, 2021
7e1c50e
Merge branch 'main' of github.com:openkraken/kraken into refactor/lay…
temper357 Nov 23, 2021
ba9113e
fix: should ignore renderStyle of display inline when searching for a…
temper357 Nov 23, 2021
ab71038
refactor: unify logical content size to contentBoxLogicalWidth & cont…
temper357 Nov 24, 2021
2ee3b2f
fix: logical content size before layout
temper357 Nov 24, 2021
adcbf2c
fix: percentage width/height resolve
temper357 Nov 24, 2021
83b326d
Merge branch 'main' of github.com:openkraken/kraken into refactor/lay…
temper357 Nov 24, 2021
e937361
fix: lint
temper357 Nov 24, 2021
b567bb7
test: add tests for sliver constraints calculation
temper357 Nov 24, 2021
b3a4735
refactor: move intrinsic width/height/ratio to renderStyle
temper357 Nov 24, 2021
dd36f25
fix: lint
temper357 Nov 24, 2021
0940c41
refactor: content max constraint width calculation logic
temper357 Nov 24, 2021
715f310
Merge branch 'main' into refactor/layout-performance
andycall Nov 25, 2021
7a8ecf9
Merge remote-tracking branch 'origin/main' into refactor/layout-perfo…
andycall Nov 26, 2021
e42332f
Merge branch 'main' of github.com:openkraken/kraken into refactor/lay…
temper357 Dec 2, 2021
c9a540b
Merge branch 'main' of github.com:openkraken/kraken into refactor/lay…
temper357 Dec 2, 2021
6204efc
fix: lint
temper357 Dec 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions integration_tests/specs/css/css-display/sliver.ts
Expand Up @@ -153,6 +153,54 @@ describe('display sliver', () => {
await snapshot();
});

it('should works with height of sliver child changes', async (done) => {
let div;
let div1;
let div2;
div = createElement(
'div',
{
style: {
display: 'sliver',
width: '200px',
height: '200px',
backgroundColor: 'red'
},
}, [
(div1 = createElement('div', {
style: {
positive: 'relative',
width: '200px',
height: '100px',
backgroundColor: 'green'
}
}, [
createText('1')
])),
(div2 = createElement('div', {
style: {
positive: 'relative',
width: '200px',
height: '100px',
backgroundColor: 'yellow'
}
}, [
createText('2')
]))
]
);
BODY.appendChild(div);

await snapshot();

requestAnimationFrame(async () => {
div1.style.height = '50px';
div2.style.height = '50px';
await snapshot();
done();
});
});

it('sliver child is text or comment', async () => {
var comment = document.createComment('HelloWorld');
var text = document.createTextNode('HelloWorld');
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/specs/css/css-sizing/min-height.ts
Expand Up @@ -28,7 +28,7 @@ describe('min-height', () => {
await snapshot();
});

fit("should work with padding exist and height not exist", async () => {
it("should work with padding exist and height not exist", async () => {
let containingBlock = createElement('div', {
style: {
border: '2px solid #000',
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/specs/css/css-sizing/min-width.ts
Expand Up @@ -28,7 +28,7 @@ describe('min-width', () => {
await snapshot();
});

fit("should work with padding exist and width not exist", async () => {
it("should work with padding exist and width not exist", async () => {
let containingBlock = createElement('div', {
style: {
border: '2px solid #000',
Expand Down