-
Notifications
You must be signed in to change notification settings - Fork 49.8k
[DevTools] Use Popover API for TraceUpdates highlighting #32614
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
Changes from 1 commit
ecb403f
a83589c
9215664
f7eb1c6
938ad0e
9c21b1e
6893d25
862826b
c950b0d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Use manual popover mode to prevent closing with ESC key - Hide popover automatically when all trace updates expire - Remove focus styles and focus-related behaviors
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,11 +43,23 @@ function drawNative(nodeToData: Map<HostInstance, Data>, agent: Agent) { | |
| } | ||
|
|
||
| function drawWeb(nodeToData: Map<HostInstance, Data>) { | ||
| // if there are no nodes to draw, detach from top layer | ||
| if (nodeToData.size === 0) { | ||
| if (canvas !== null) { | ||
| try { | ||
| if (canvas.matches(':popover-open')) { | ||
| canvas.hidePopover(); | ||
yongsk0066 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| } catch (e) {} | ||
| } | ||
| return; | ||
| } | ||
|
|
||
| if (canvas === null) { | ||
| initialize(); | ||
| } else { | ||
| try { | ||
|
||
| if (canvas.hasAttribute('popover') && !canvas.matches(':popover-open')) { | ||
| if (!canvas.matches(':popover-open')) { | ||
| canvas.showPopover(); | ||
| } | ||
| } catch (e) {} | ||
|
|
@@ -197,11 +209,7 @@ function destroyNative(agent: Agent) { | |
|
|
||
| function destroyWeb() { | ||
| if (canvas !== null) { | ||
| try { | ||
| if (canvas.hasAttribute('popover')) { | ||
| canvas.hidePopover(); | ||
| } | ||
| } catch (e) {} | ||
| canvas.hidePopover(); | ||
yongsk0066 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| if (canvas.parentNode != null) { | ||
| canvas.parentNode.removeChild(canvas); | ||
|
|
@@ -216,7 +224,8 @@ export function destroy(agent: Agent): void { | |
|
|
||
| function initialize(): void { | ||
| canvas = window.document.createElement('canvas'); | ||
| canvas.setAttribute('popover', 'auto'); | ||
| canvas.setAttribute('popover', 'manual'); | ||
|
|
||
| canvas.style.cssText = ` | ||
| xx-background-color: red; | ||
| xx-opacity: 0.5; | ||
|
|
@@ -226,8 +235,10 @@ function initialize(): void { | |
| position: fixed; | ||
| right: 0; | ||
| top: 0; | ||
| z-index: 1000000000; | ||
| background-color: transparent; | ||
| outline: none !important; | ||
| box-shadow: none !important; | ||
| border: none !important; | ||
| `; | ||
|
|
||
| const root = window.document.documentElement; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.