Related #2514
- This removes needless `&mut self`s from some DOM type method simply.
- This doesn't include some DOM Types which have basis method called from other types (e.g. `Element`). We still have to need to open their changes.
- This does not include to remove an implicit `deref_mut()`.
Source-Repo: https://github.com/servo/servo
Source-Revision: d7cac61d9cc8e4e9f4ef73aeac21075cc46c62b4
The performance of using == should now equal that of match, so many
identity methods can be simplified to a single line.
Fixes#1596.
Source-Repo: https://github.com/servo/servo
Source-Revision: 78a768ae5c39e1a2f2a666fc574a0332bf1ca28e
As described in #1764, this strategy uses the following properties:
* DOM members are `JS<T>` types. These cannot be used with being explicitly rooted, but they are required for compiler-derived trace hooks.
* Methods that take DOM type arguments receive `&[mut] JSRef<T>`. These are rooted value references that are cloneable but cannot escape.
* Methods that return DOM values use `Unrooted<T>`. These are values that may or may not be rooted elsewhere, but callers must root them in order to interact with them in any way. One unsoundness hole exists - `Unrooted` values must be rooted ASAP, or there exists the danger that JSAPI calls could be made that could cause the underlying JS value to be GCed.
* All methods are implemented on `JSRef<T>`, enforcing the requirement that all DOM values are rooted for the duration of a method call (with a few exceptions for layout-related code, which cannot root values and therefore interacts with `JS<T>` and `&T` values - this is safe under the assumption that layout code interacts with DOM nodes that are in the tree, therefore rooted, and does not run concurrently with content code)
Source-Repo: https://github.com/servo/servo
Source-Revision: 731e66ff132e41cdc49bc5324c0e15be19c46ec2
- Fix#2128
- Take over from #2220
I didn't change `InterfaceTypes.rs` to `type.rs` because `type` is very common name which might be troublesome.
Source-Repo: https://github.com/servo/servo
Source-Revision: b36b779d24c6f7425f630c18495dae4c6edec137
r? @metajack
Note that all pending submodule PRs must be landed before this should be given r+.
Source-Repo: https://github.com/servo/servo
Source-Revision: 493aa2cdf30fb2ff5886c714030a20d714764b67
This changeset gets rid of the `FooView` phantom type in favor of a more brute force approach that just whitelists methods that layout is allowed to call. The set is surprisingly small now that layout isn't going to the DOM for much.
If this approach turns out not to scale, we can do something fancier, but I'd rather just have it be safe and secure first and then refactor later for programmer happiness.
r? @kmcallister
Source-Repo: https://github.com/servo/servo
Source-Revision: 824c7ac613ebb80bb432ff6425c5e25c642b6afb
This will fix#1201.
This maybe the work in progress.
@jdm:
* Should we pass `DOMString` directly to `dom::utils::null_str_as_...`?
* Do you have any good idea to update the comment in `CodegenRust.py`?
Source-Repo: https://github.com/servo/servo
Source-Revision: 7f13566d57b90468b0ab2a58fd2e4ba387510e4b