This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.tooltips-wrapper { | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get the first segment's start point. | |
const points = [segments[0].start]; | |
// And append the end point of each segment, one by one, after that. | |
for (const segment of segments) { | |
if (!segment) { | |
continue; | |
} | |
points.push(segment.end); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Our list of all segments. Each one being an object like | |
// {start: {x, y}, end: {x, y}} | |
const allSegments = [...]; | |
// Start at the first segment. | |
const orderedSegments = [allSegments[0]]; | |
while (true) { | |
// The previous segment. | |
const previous = orderedSegments[orderedSegments.length - 1]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get the coordinates of the element. | |
const rect = element.getBoundingClientRect(); | |
// Apply any offset that might be configured for it. | |
for (const {direction, size} of offsets) { | |
if (direction === Direction.Top) { | |
rect.y -= size; | |
rect.height += size; | |
} | |
if (direction === Direction.Right) { | |
rect.width += size; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function querySelectorShadow(selector: string): Element|null { | |
let found: Element|null = null; | |
const search = (root: Element|ShadowRoot) => { | |
const iter = document.createTreeWalker( | |
root, | |
NodeFilter.SHOW_ELEMENT, | |
); | |
do { | |
const currentNode = iter.currentNode as HTMLElement; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// The ID of the area we're highlighting | |
"elements-panel": { | |
// Some information for the displayed content | |
"tooltip": { | |
"title": "...", | |
"description": "...", | |
}, | |
// The list of DOM elements to wrap | |
"selectors": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {writeFile} = require('fs'); | |
const CDP = require('chrome-remote-interface'); | |
const WIDTH = 892; | |
const HEIGHT = 689; | |
const URL = 'https://google.com'; | |
let client; | |
async function getClient() { | |
if (!client) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
column-gap: 0.375rem | |
column-gap: 1rem | |
column-gap: 2rem | |
column-gap: 2vw | |
column-gap: 35px | |
column-gap: 5rem | |
column-gap:.625rem | |
column-gap:1.875rem | |
column-gap:10px | |
column-gap:10px |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Any copyright is dedicated to the Public Domain. | |
http://creativecommons.org/publicdomain/zero/1.0/ */ | |
"use strict"; | |
// Verify the content page can be zoomed in within RDM. | |
// We do not verify here that the fullZoom level applied to the page before RDM starts is | |
// carried over to the content page after RDM is open. This bug hasn't been fixed. | |
// See bug 1529166. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function findRulesMatching(el) { | |
const rules = []; | |
for (const { cssRules } of document.styleSheets) { | |
for (const rule of cssRules) { | |
if (el.matches(rule.selectorText)) { | |
rules.push(rule); | |
} | |
} | |
} |