Skip to content

Commit 0c54c99

Browse files
authored
Merge branch 'main' into frame-line-number-in-tooltip-stack
2 parents 6c72678 + 1e00344 commit 0c54c99

File tree

7 files changed

+32
-15
lines changed

7 files changed

+32
-15
lines changed

res/_headers

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
# Protection for versions that do not support CSP yet.
88
X-XSS-Protection: 1; mode=block
99

10-
# Do not allow being embedded in a frame.
11-
X-Frame-Options: SAMEORIGIN
12-
1310
# Do not give the referrer for external navigations.
1411
Referrer-Policy: same-origin
1512

@@ -25,7 +22,7 @@
2522
# 7. `frame-ancestors` is the same purpose as `X-Frame-Options` above.
2623
# 8. `form-action`prevents forms, we don't need this.`
2724
# 9. `frame-src` allows the embedding of YouTube videos in the docs.
28-
Content-Security-Policy: default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src http: https: data:; object-src 'none'; connect-src *; frame-ancestors 'self'; form-action 'none'; frame-src www.youtube-nocookie.com
25+
Content-Security-Policy: default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src http: https: data:; object-src 'none'; connect-src *; form-action 'none'; frame-src www.youtube-nocookie.com
2926

3027
# Set the correct MIME type for WebAssembly modules.
3128
/*.wasm

server.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ const serverConfig = {
4747
// /!\ Don't forget to keep it sync-ed with the headers here /!\
4848
'X-Content-Type-Options': 'nosniff',
4949
'X-XSS-Protection': '1; mode=block',
50-
'X-Frame-Options': 'SAMEORIGIN',
5150
'Referrer-Policy': 'same-origin',
5251
'Content-Security-Policy': oneLine`
5352
default-src 'self';
@@ -59,7 +58,6 @@ const serverConfig = {
5958
img-src http: https: data:;
6059
object-src 'none';
6160
connect-src *;
62-
frame-ancestors 'self';
6361
form-action 'none'
6462
`,
6563
},

src/components/app/ProfileViewer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ class ProfileViewerImpl extends PureComponent<Props> {
105105
}
106106
}
107107
>
108+
<div id="screenshot-hover"></div>
108109
<div className="profileViewerTopBar">
109110
{hasZipFile ? (
110111
<button

src/components/shared/ButtonWithPanel/ArrowPanel.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
.arrowPanelAnchor {
66
position: absolute;
7-
z-index: 10;
7+
z-index: 5;
88
top: 75%;
99
left: 50%;
1010
}

src/components/timeline/TrackScreenshots.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ const MAXIMUM_HOVER_SIZE = 350;
231231
const MAXIMUM_HOVER_SIZE_WHEN_SELECTING_RANGE = 100;
232232

233233
class HoverPreview extends PureComponent<HoverPreviewProps> {
234-
_overlayElement = ensureExists(
235-
document.querySelector('#root-overlay'),
236-
'Expected to find a root overlay element.'
234+
_screenshotHoverElement = ensureExists(
235+
document.querySelector('#screenshot-hover'),
236+
'Expected to find a screenshot hover element.'
237237
);
238238

239239
render() {
@@ -304,7 +304,7 @@ class HoverPreview extends PureComponent<HoverPreviewProps> {
304304
}}
305305
/>
306306
</div>,
307-
this._overlayElement
307+
this._screenshotHoverElement
308308
);
309309
}
310310
}

src/test/components/TrackScreenshots.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ import { mockRaf } from '../fixtures/mocks/request-animation-frame';
3131
import { storeWithProfile } from '../fixtures/stores';
3232
import {
3333
getMouseEvent,
34-
addRootOverlayElement,
35-
removeRootOverlayElement,
34+
addScreenshotHoverlement,
35+
removeScreenshotHoverElement,
3636
fireFullClick,
3737
} from '../fixtures/utils';
3838
import { getScreenshotTrackProfile } from '../fixtures/profiles/processed-profile';
@@ -63,8 +63,8 @@ describe('timeline/TrackScreenshots', function () {
6363
autoMockElementSize(INITIAL_ELEMENT_SIZE);
6464
autoMockIntersectionObserver();
6565

66-
beforeEach(addRootOverlayElement);
67-
afterEach(removeRootOverlayElement);
66+
beforeEach(addScreenshotHoverlement);
67+
afterEach(removeScreenshotHoverElement);
6868

6969
it('matches the component snapshot', () => {
7070
const { container, unmount } = setup();

src/test/fixtures/utils.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,27 @@ export function removeRootOverlayElement() {
365365
);
366366
}
367367

368+
export function addScreenshotHoverlement() {
369+
const div = document.createElement('div');
370+
div.id = 'screenshot-hover';
371+
ensureExists(
372+
document.body,
373+
'Expected the document.body to exist.'
374+
).appendChild(div);
375+
}
376+
377+
export function removeScreenshotHoverElement() {
378+
ensureExists(
379+
document.body,
380+
'Expected the document.body to exist.'
381+
).removeChild(
382+
ensureExists(
383+
document.querySelector('#screenshot-hover'),
384+
'Expected to find a screenshot hover element to clean up.'
385+
)
386+
);
387+
}
388+
368389
/**
369390
* You can't change <select>s by just clicking them using react-testing-library. This
370391
* utility makes it so that selects can be changed by the text that is in them.

0 commit comments

Comments
 (0)