Skip to content

Instantly share code, notes, and snippets.

@gwwar
gwwar / safari-flickering-text.html
Created July 4, 2021 14:18
Safari Flickering Text
<!doctype html>
<html class="wp-toolbar interface-interface-skeleton__html-container" lang="en-US"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="author" content="gwwar">
<title>Flickering Text in Safari</title>
<style>
/* general */
html,
body {
height: 100%;
@gwwar
gwwar / safari_simplified_background_color_scroll.html
Created June 30, 2021 15:38
Safari Background Color Flashing When Repainting Very Quickly (scrolling via scrollwheel) and Compositing Layer Is Too Large
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Background Color Base Case</title>
<meta name="description" content="Scroll Flashing Base Case">
<meta name="author" content="gwwar">
<style>
p {
margin: 0;
@gwwar
gwwar / scrolling-basecase.html
Last active June 18, 2021 18:01
Safari Background Color Flashing When Compositing Layer Is Too Large
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Scroll Flashing Base Case</title>
<meta name="description" content="Scroll Flashing Base Case">
<meta name="author" content="gwwar">
<style>
body {
@gwwar
gwwar / StackingContext.js
Last active July 15, 2016 09:30
Given a node, returns the closest stacking context.
function getClosestStackingContext( node ) {
if( ! node || node.nodeName === 'HTML' ) {
console.log( node, 'has stacking context, reason: root' );
return document.documentElement;
}
const computedStyle = getComputedStyle( node );
if ( computedStyle.position === 'fixed' ) {
console.log( node, 'has stacking context, reason: position: fixed' );
return node;
} else if ( computedStyle.zIndex !== 'auto' && computedStyle.position !== 'static' ) {
@gwwar
gwwar / Git Cheatsheet
Last active July 3, 2017 23:27
Git Cheatsheet
# create a remote branch
git branch branchname
git checkout branchname
git push -u origin branchname
#add a tag
git tag -a tagname -m "your tag message"
git push origin tagname
# deleting a tag
@gwwar
gwwar / KoreSampl.js
Created March 23, 2012 03:05
A simple helper that returns a list of elements at a given point using elementFromPoint
/**
* @author Kerry Liu
* WTFPL
**/
;(function(){
//test for ie: turn on conditional comments
var jscript/*@cc_on=@_jscript_version@*/;
var styleProp = (jscript) ? "display" : "pointerEvents";
var KoreSampl = function() {};