Skip to content

Instantly share code, notes, and snippets.

View progers's full-sized avatar

Philip Rogers progers

View GitHub Profile
@progers
progers / gist:998452a15180ae369fee338bb39363fd
Created August 5, 2022 12:56
Git bisect script for running a new test that has been stashed
bisect-stash-build-run.sh
----------8<----------
#!/bin/bash
git stash apply || exit 125
# build the test
# for a chromium/blink unittest, this is:
# ( echo n | gclient sync ) || exit 125
# autoninja -C out/Debug blink_unittests || exit 125
# run the test
<!DOCTYPE HTML>
<div id='diva' style="width: 300px; height: 200px; border: 0px solid rgb(0, 0, 0); background: green;">hello world</div>
<script>
function minimizeStyleAttribute(element) {
var originalStyleAttr = element.getAttribute('style');
var originalComputedStyle = getComputedStyle(element, null);
// Save off the original CSSComputedStyle values in a map because the object is 'live' and
// modifying the style attribute will change it.
var originalComputedStyleMap = {};