Skip to content

Latest commit

 

History

History
52 lines (44 loc) · 6.38 KB

html.md

File metadata and controls

52 lines (44 loc) · 6.38 KB
Content-Security-Policy: default-src *; script-src assets-cdn.github.com www.google-analytics.com collector-cdn.github.com; object-src assets-cdn.github.com; style-src 'self' 'unsafe-inline' 'unsafe-eval' assets-cdn.github.com; img-src 'self' data: assets-cdn.github.com identicons.github.com www.google-analytics.com collector.githubapp.com *.githubusercontent.com *.gravatar.com *.wp.com; media-src 'none'; frame-src 'self' render.githubusercontent.com gist.github.com www.youtube.com player.vimeo.com checkout.paypal.com; font-src assets-cdn.github.com; connect-src 'self' ghconduit.com:25035 live.github.com uploads.github.com s3.amazonaws.com
  • In Chrome, <img> tags with no src have a grey border that does not go away with any amount of CSS.
  • HTML5 allows closing tags to be omitted where the semantics are obvious, for example, li in ul, or option in optgroup. Then again, your colleagues will kill you, so it is not a usable part of the spec.
  • However, custom tags can never be self-closing in HTML5.
  • disabled prevents focus on the element, whereas readonly lets you focus on it, but not edit it. readonly elements also get submitted.
  • You can change an <input>'s placeholder style using pseudoselectors ::-webkit-input-placeholder, :-moz-placeholder, ::-moz-placeholder, :-ms-input-placeholder, if the field's appearance: textfield. With that said, these styles are platform-dependent (as you may expect with prefixed styles), and currently the placeholder cannot be inspected.
  • Well, you cannot specify offline file wildcards.
  • Saving too much in localStorage gives you a DOM Exception 22: QuotaExceededError.
  • In <head>, when you expect a script to have access to nothing: document.head is actually available.
  • "Use of the Application Cache is deprecated on insecure origins", which is great. AppCache sucks blue balls, anyway.
  • An empty href points to the same document.
  • "Properties" are likely something where prop in node is true. "Attributes" are likely what you write directly in HTML. So if an input element has value="foo", but user types in bar, then that element has attribute foo, but value bar.

60fps = limiting each frame to 16ms.

  • USE PAGESPEED to analyse your render tree.
  • Three stages of rendering: Layout (calculating geometry of where everything ought to be), Paint (filling in the page), and Compositing (picking a layer to minimise repaints).
  • Use the will-change: wat CSS directive to let the browser know what will be changed

Eliminating expensive animations

Expensive animations include:

  • Scrolling
  • Transition based on variables