This file contains 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 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 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 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 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 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 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 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); | |
} | |
} | |
} |
This file contains 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
exporting patch: | |
# HG changeset patch | |
# User Patrick Brosset <pbrosset@mozilla.com> | |
# Date 1540390759 -7200 | |
# Wed Oct 24 16:19:19 2018 +0200 | |
# Node ID 28252579eb8db33d857061e4db42a15e04a87e45 | |
# Parent 079c7a062b23950449e9ce1ef809ff43026cc259 | |
WIP pref to disable anoncontent highlighters | |
diff --git a/devtools/client/preferences/devtools-client.js b/devtools/client/preferences/devtools-client.js |
This file contains 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
exporting patch: | |
# HG changeset patch | |
# User Patrick Brosset <pbrosset@mozilla.com> | |
# Date 1540391188 -7200 | |
# Wed Oct 24 16:26:28 2018 +0200 | |
# Node ID f65095a765a557f6f3c039bb7209dbce37657f68 | |
# Parent 079c7a062b23950449e9ce1ef809ff43026cc259 | |
WIP investigating why inspector 'fixes' layout | |
diff --git a/devtools/server/actors/inspector/walker.js b/devtools/server/actors/inspector/walker.js |