A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.

To request an account, ask an autoconfirmed user on Chat (such as one of these permanent autoconfirmed members).


From WHATWG Wiki
Revision as of 17:59, 5 June 2013 by GPHemsley (talk | contribs) (Identify contexts and how to use them.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Context types

Context Definition Type Hint Scriptable? Used in HTML? Used in CSS? Sniffing Algorithm
browsing HTML Yes Yes No? MIME type sniffing algorithm
image No Yes Yes rules for sniffing images specifically
audio/video No Yes No? rules for sniffing audio and video specifically
style @type or "text/css" No Yes Yes?
script @type or "text/javascript" Yes? Yes No?
font format() No No Yes rules for sniffing fonts specifically
text track "text/vtt" No Yes No
cache manifest "text/cache-manifest" No Yes No

How to use a context

  1. Identify context.
  2. Determine whether to fetch resource based on type hint, if any.
  3. Set no-sniff flag on resource, if necessary.
  4. Fetch resource.
  5. Handle resource.
  6. Sniff resource.
  7. Process and display resource or prompt to download resource, as appropriate.