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

Add Long Animation Frame (LoAF) attribution data #8

Merged
merged 24 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b262ba9
begin working on loaf attribution format
ethangardner Nov 27, 2024
69b2a49
update tests for loaf attribution
ethangardner Nov 27, 2024
a9549aa
add more props to loaf attribution
ethangardner Nov 28, 2024
b747c20
fix linting issue
ethangardner Nov 28, 2024
0765283
code formatting
ethangardner Nov 28, 2024
097522f
begin working on loaf attribution format
ethangardner Nov 27, 2024
6628d1f
update tests for loaf attribution
ethangardner Nov 27, 2024
583d28f
add more props to loaf attribution
ethangardner Nov 28, 2024
2ef0920
fix linting issue
ethangardner Nov 28, 2024
c79f286
code formatting
ethangardner Nov 28, 2024
0926eee
fix conflict
ethangardner Nov 29, 2024
58762e1
begin working on loaf attribution format
ethangardner Nov 27, 2024
203dfdb
update tests for loaf attribution
ethangardner Nov 27, 2024
d78ff03
add more props to loaf attribution
ethangardner Nov 28, 2024
650a71a
fix linting issue
ethangardner Nov 28, 2024
3cc4a93
code formatting
ethangardner Nov 28, 2024
83424af
remove prepare script. install was hanging
ethangardner Dec 2, 2024
83ea92b
Merge branch 'feature/loaf-attribution' of https://github.com/GSA-TTS…
ethangardner Dec 3, 2024
ef7ab26
correct typing issues
ethangardner Dec 3, 2024
4b4f4c7
unflatten project directories and move tests.
ethangardner Dec 3, 2024
5c80df1
add test for send to analytics
ethangardner Dec 3, 2024
c362575
write send to analytics tests with gas4 spy
ethangardner Dec 3, 2024
f15b612
avoid aftereach in test.
ethangardner Dec 3, 2024
147e425
add loaf attribution data
ethangardner Dec 3, 2024
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
31 changes: 29 additions & 2 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,30 @@
below.
-->
<script type="module" src="../dist/dap-performance-addon.js"></script>
<script type="module">
const button = document.querySelector('#thrash-layout');
button.addEventListener('click', () => {
const elem = document.querySelector('#thrash-element-1');
// eslint-disable-next-line no-plusplus
for (let i = 0; i < 1000; i++) {
// Read height (this forces layout recalculation)
const height = elem.offsetHeight;
// Write width (this marks layout as dirty)
elem.style.width = `${height + 1}px`;
}
elem.removeAttribute('style');
});

button.addEventListener('click', () => {
const elem = document.querySelector('#thrash-element-2');
// eslint-disable-next-line no-plusplus
for (let i = 0; i < 1000; i++) {
const height = elem.offsetHeight;
elem.style.width = `${height + 1}px`;
}
elem.removeAttribute('style');
});
</script>
</head>
<body>
<main>
Expand All @@ -33,7 +57,10 @@
<h1>
Demo page
</h1>
<div class="article-container">
<p>
<button id="thrash-layout">This button will cause layout thrashing</button>
</p>
<div class="article-container" id="thrash-element-1">
<article>
<img src="https://picsum.photos/640/360"
srcset="https://picsum.photos/1024/576 1024w, https://picsum.photos/960/540 960w, https://picsum.photos/640/360 640w, https://picsum.photos/480/270 480w"
Expand All @@ -44,7 +71,7 @@ <h1>
shift down considerably after the image is loaded.
</p>
</article>
<div class="sidebar">
<div class="sidebar" id="thrash-element-2">
<div class="related-articles">
<h2>
Related Articles
Expand Down
Loading
Loading