mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-08 20:28:42 +02:00
Added a flags variable inside Node to represent boolean flags, with is_in_doc being the first of them. It is updated whenever a node is appended or removed from a parent. This patch is for: https://github.com/mozilla/servo/issues/1030 Source-Repo: https://github.com/servo/servo Source-Revision: 44a8b0987c0bc0b136cfb4c75bc35a4a0de34465 --HG-- rename : servo/src/components/gfx/macros.rs => servo/src/components/script/macros.rs
22 lines
669 B
Rust
22 lines
669 B
Rust
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#[macro_escape];
|
|
|
|
macro_rules! bitfield(
|
|
($bitfieldname:ident, $getter:ident, $setter:ident, $value:expr) => (
|
|
impl $bitfieldname {
|
|
#[inline]
|
|
pub fn $getter(self) -> bool {
|
|
(*self & $value) != 0
|
|
}
|
|
|
|
#[inline]
|
|
pub fn $setter(&mut self, value: bool) {
|
|
*self = $bitfieldname((**self & !$value) | (if value { $value } else { 0 }))
|
|
}
|
|
}
|
|
)
|
|
)
|
|
|