Cross-Origin Resource Sharing

Cross-Origin Resource Sharing, or CORS, defines a way to enable client-side cross-origin requests. So, if this API is used on http://siteA.org then a resource on http://siteB.org could opt in to this( e.g. by specifying Access-Control-Allow-Origin: http://siteA.org as a response header).

The problem it aims to solve is that AJAX calls that use XMLHttpRequest to do cross-domain requests (e.g. Site A wants to access a script on Site B) are forbidden by web browsers (see Same-origin policy: http://en.wikipedia.org/wiki/Same-origin_policy).

Note: WebSockets are not subject to the same-origin policy.

CORS is a W3 Recommendation released on 16th January 2014. See http://www.w3.org/TR/access-control/

Alternatives to CORS are:

  • setting the document.domain property
  • Cross-document messaging – e.g. calling the postMessage() method on a Window object
  • JSONP

http://en.wikipedia.org/wiki/Same-origin_policy#Relaxing_the_same-origin_policy

 

Browser support for CORS:

  • >= Firefox 3.5
  • >= Safari 4
  • >= Chrome 3
  • >= IE10 (IE8+ has partial support). i.e. IE9 in Compatibility View would not support CORS
  • >= Opera 12

CSS2: Visual formatting model – 1. Introduction

1. Introduction

The visual formatting model is how user agents (usually browsers) process the document tree (e.g. HTML) for visual media (e.g. your computer screen).

Each element (e.g. an H1 or div) generates boxes (see the earlier post on the “box model”).

The layout depends on:

  • box size and type (e.g. div or span)
  • positioning scheme (e.g. normal flow, float, absolute positioning)
  • relationship between elements in the document tree
  • external information (e.g. viewport (e.g. window), image size)

The model does NOT specify all aspects of formatting. E.g. it doesn’t specify a letter-spacing algorithm.

1.1 Viewport

The position of an element’s box are calculated relative to a rectangle called the containing block. This can be the window or viewing area on screen (called the “viewport”).

1.2 Containing blocks

Box positions and sizes are calculated using the edges of a rectangular box called a containing block (usually the viewport) and is anchored at the canvas origin.

See other posts for more on the Visual formatting model. E.g.

Controlling box generation; 

Positioning shemes; 

Normal flow; 

Floats; 

Absolute positioning; 

Relationships between ‘display’, ‘position’, and ‘float’; 

Comparison of normal flow, floats and absolute positioning; 

Layered presentation; 

Text direction

Plenty more here:

http://www.w3.org/TR/CSS2/visuren.html

Automatic Post Tagger

Not quite as awesome as an automatic post categoriser but still pretty handy:

http://wordpress.org/extend/plugins/automatic-post-tagger/