Blink aborts computing styles on descendants of display:none
nodes. If the inside of the iframe has , you make remove recalc style, no layout, no painting.
still does all that work because it's another document and the display:none
effect does not transcend into the other document.
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
http://jsbin.com/zibaraju/1/edit | |
<div></div> | |
<script> | |
var div = document.querySelector('div'); | |
setInterval(function() { | |
var t0 = performance.now(); | |
navigator.getBattery().then(function() { |
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
javascript:document.body.style.webkitFilter='grayscale(0.5) blur(3px)';return false; |
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
// Know how fast your HTML Imports are. | |
// crbug.com/505279 - doesn't show sub-import resources. | |
var imports = document.querySelectorAll('link[rel="import"]'); | |
[].forEach.call(imports, function(link) { | |
var entries = performance.getEntriesByName(link.href); | |
console.info('=== HTML Imports perf ==='); | |
entries.forEach(function(e) { | |
console.log(e.name, 'took', e.duration, 'ms'); | |
}); | |
}); |
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
// Save this in a bookmarklet and click it on a page: | |
javascript:(function(){function d(a,c){document.body.style.webkitClipPath="circle("+a+"px, "+c+"px, "+b+"px)"}var b=90;window.addEventListener("mousemove",function(a){d(a.pageX,a.pageY)});window.addEventListener("mousewheel",function(a){if(a.shiftKey){a.preventDefault();var c=a.wheelDeltaY;b+=-c;b=0<c?Math.max(90,b):Math.min(b,window.innerHeight/2);d(a.pageX,a.pageY)}})})(); | |
// Or paste this in the console and mouse over the page. | |
// SHIFT+mousewheel scroll makes the circle bigger/smaller. | |
(function() { | |
var radius = 90; // px |
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
'use strict'; | |
customElements.define('x-hello', class extends HTMLElement { | |
static get observedAttributes() { | |
return ['name']; | |
} | |
constructor() { | |
super(); | |
} | |
attributeChangedCallback(attrName, oldVal, newVal) { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0"> | |
<title>How to use the Custom Elements v1 + Shadow DOM v1 polyfills</title> | |
<style> | |
body { | |
font-family: sans-serif; |
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
/** | |
* @author ebidel@ (Eric Bidelman) | |
* License Apache-2.0 | |
*/ | |
/** | |
* Convenience method finding all the DOM child nodes of a parent, | |
* includibg those within shadow roots. By default, all children | |
* under `<body>` will be returned. The parent node can be overridden | |
* by passing the `selector` param. |
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
/** | |
* Convenience for dynamically loading an HTML Import. | |
* | |
* This method creates a new `<link rel="import">` element with | |
* the provided URL and appends it to the document to start loading. By default, | |
* it loads async to not blocking rendering. | |
* | |
* @param {string} href The URL to load. | |
* @param {boolean} opt_async True if import should be async. Default: true. | |
* @return {Promise(HTMLLinkElement, Error)} A promise that resolves with the |
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
<html> | |
<head> | |
<title>Polymer example</title> | |
<link href='https://fonts.googleapis.com/css?family=Playfair+Display' rel='stylesheet' type='text/css'> | |
<script> | |
// Enable native SD if available and lazy register. | |
window.Polymer = window.Polymer || { | |
dom: 'shadow', | |
lazyRegister: 'max', | |
useNativeCSSProperties: true |
OlderNewer