回答編集履歴
1
ミスがあったため修正。
test
CHANGED
@@ -1 +1,27 @@
|
|
1
1
|
「DOM操作は遅い」はレンダリングコストのことを言っているのでは。DOMへのアクセス自体が遅くなる主因ではないので、「属性値を取得するだけ」は「DOM操作」ではあると思いますが「遅い」とは関係ないと思います。
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
---
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
**追記:**
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
下記属性値についてはリフローが発生するので「遅い」に関係する可能性がありました。maisumakunさん指摘ありがとうございます!
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
> 0. offsetTop、offsetLeft、offsetWidth、offsetHeight
|
18
|
+
|
19
|
+
> 0. scrollTop、scrollLeft、scrollWidth、scrollHeight
|
20
|
+
|
21
|
+
> 0. clientTop、clientLeft、clientWidth、clientHeight
|
22
|
+
|
23
|
+
> 0. getComputedStyle()、あるいは IE の currentStyle
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
※ think49さんの提示された[リンク(http://tokkono.cute.coocan.jp/blog/slow/index.php/web-technology/reflow-and-repaint-in-browser/)](http://tokkono.cute.coocan.jp/blog/slow/index.php/web-technology/reflow-and-repaint-in-browser/)より引用
|