You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 2-ui/1-document/01-browser-environment/article.md
+5-7
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,11 @@
2
2
3
3
The JavaScript language was initially created for web browsers. Since then it has evolved and become a language with many uses and platforms.
4
4
5
-
A platform may be a browser, or a web-server or another *host*, even a coffee machine. Each of them provides platform-specific functionality. The JavaScript specification calls that a *host environment*.
5
+
A platform may be a browser, or a web-server or another *host*, even a "smart" coffee machine, if it can run JavaScript. Each of them provides platform-specific functionality. The JavaScript specification calls that a *host environment*.
6
6
7
7
A host environment provides own objects and functions additional to the language core. Web browsers give a means to control web pages. Node.js provides server-side features, and so on.
8
8
9
-
Here's a bird's-eye view of what we have when JavaScript runs in a web-browser:
9
+
Here's a bird's-eye view of what we have when JavaScript runs in a webbrowser:
Here we used `document.body.style`, but there's much, much more. Properties and methods are described in the specification:
53
-
54
-
-**DOM Living Standard** at <https://dom.spec.whatwg.org>
52
+
Here we used `document.body.style`, but there's much, much more. Properties and methods are described in the specification: **DOM Living Standard** at <https://dom.spec.whatwg.org>.
55
53
56
54
```smart header="DOM is not only for browsers"
57
55
The DOM specification explains the structure of a document and provides objects to manipulate it. There are non-browser instruments that use DOM too.
@@ -60,9 +58,9 @@ For instance, server-side scripts that download HTML pages and process them can
60
58
```
61
59
62
60
```smart header="CSSOM for styling"
63
-
CSS rules and stylesheets are structured in a different way than HTML. There's a separate specification, [CSS Object Model (CSSOM)](https://www.w3.org/TR/cssom-1/), that explains how they are represented as objects, and how to read and write them.
61
+
There's also a separate specification, [CSS Object Model (CSSOM)](https://www.w3.org/TR/cssom-1/) for CSS rules and stylesheets, that explains how they are represented as objects, and how to read and write them.
64
62
65
-
CSSOM is used together with DOM when we modify style rules for the document. In practice though, CSSOM is rarely required, because usually CSS rules are static. We rarely need to add/remove CSS rules from JavaScript, but that's also possible.
63
+
CSSOM is used together with DOM when we modify style rules for the document. In practice though, CSSOM is rarely required, because we rarely need to modify CSS rules from JavaScript (usually we just add/remove CSS classes, not modify their CSS rules), but that's also possible.
0 commit comments