summaryrefslogtreecommitdiff
path: root/chromium/third_party/WebKit/Source/SpecMapping.md
blob: ac54be9e661d7c29e138c8dc7473e6df9c13b0fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Mapping of spec concepts to code

Blink is Chromium's implementation of the open web platform. This document
attempts to map terms and concepts found in the specification of the open web
platform to classes and files found in Blink's source tree.

[TOC]

## HTML

Concepts found in the [HTML spec](https://html.spec.whatwg.org/).

### [browsing context](https://html.spec.whatwg.org/#browsing-context)

A browsing context corresponds to the
[Frame](https://cs.chromium.org/src/third_party/WebKit/Source/core/frame/Frame.h)
interface where the main implementation is
[LocalFrame](https://cs.chromium.org/src/third_party/WebKit/Source/core/frame/LocalFrame.h).

### [origins](https://html.spec.whatwg.org/multipage/browsers.html#concept-origin)

An origin corresponds to the
[SecurityOrigin](https://cs.chromium.org/src/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.h)
class. You can test for
[same-origin](https://html.spec.whatwg.org/multipage/browsers.html#same-origin)
using `SecurityOrigin::canAccess` and for [same-origin
domain](https://html.spec.whatwg.org/multipage/browsers.html#same-origin-domain)
using `SecurityOrigin::isSameSchemeHostPort`.

The [Suborigins spec](https://w3c.github.io/webappsec-suborigins/) extends
HTML's definition of origins. To check for same-origin and same-origin domain
use `SecurityOrigin::canAccessCheckSuborigins` and
`SecurityOrigin::isSameSchemeHostPortAndSuborigin`.

### [Window object](https://html.spec.whatwg.org/#window)

A Window object corresponds to the
[DOMWindow](https://cs.chromium.org/src/third_party/WebKit/Source/core/frame/DOMWindow.h)
interface where the main implementation is
[LocalDOMWindow](https://cs.chromium.org/src/third_party/WebKit/Source/core/frame/LocalDOMWindow.h).

### [WindowProxy](https://html.spec.whatwg.org/#windowproxy)

The WindowProxy is part of the bindings implemented by a class of the [same
name](https://cs.chromium.org/Source/bindings/core/v8/WindowProxy.h).

### [canvas](https://html.spec.whatwg.org/multipage/scripting.html#the-canvas-element)

An HTML element into which drawing can be performed imperatively via
JavaScript. Multiple
[context types](https://html.spec.whatwg.org/multipage/scripting.html#dom-canvas-getcontext)
are supported for different use cases.

The main element's sources are in
[HTMLCanvasElement](https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/html/HTMLCanvasElement.h). Contexts
are implemented via modules. The top-level module is
[HTMLCanvasElementModule](https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.h).

The
[2D canvas context](https://html.spec.whatwg.org/multipage/scripting.html#canvasrenderingcontext2d)
is implemented in
[modules/canvas2d](https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/canvas2d/).

The
[WebGL 1.0](https://www.khronos.org/registry/webgl/specs/latest/1.0/)
and
[WebGL 2.0](https://www.khronos.org/registry/webgl/specs/latest/2.0/)
contexts ([Github repo](https://github.com/KhronosGroup/WebGL)) are
implemented in [modules/webgl](https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/webgl/).