third_party/blink/renderer/core/dom - chromium/src - Git at Google

submited by
Style Pass
2024-05-09 09:00:14

Basically, this directory should contain only files related to the DOM Standard. However, for historical reasons, the renderer/core/dom directory has been used as if it were a misc directory. As a result, unfortunately, this directory contains a lot of files which are not directly related to DOM.

Please don‘t add unrelated files to this directory any more. We are trying to organize the files so that developers wouldn’t get confused by seeing this directory.

The classification in the spreadsheet might be wrong. Please update the spreadsheet, and move files if you can, if you know more appropriate places for each file.

However, traversing a tree in this way might be error-prone. Instead, you can use NodeTraversal and ElementTraversal. They provide C++11 range-based for loops such as:

e.g. Given the root A, this traverses A, B, C, D, E, and F in this order.There are several other useful range-based for loops for each purpose. The cost of using range-based for loops is zero because everything can be inlined.

Leave a Comment