mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Remove taffy-specific layout caching (#34589)
Signed-off-by: Nico Burns <nico@nicoburns.com>
This commit is contained in:
parent
2a6986b857
commit
c0703b605d
4 changed files with 4 additions and 14 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -7132,9 +7132,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "taffy"
|
name = "taffy"
|
||||||
version = "0.6.3"
|
version = "0.7.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "136661daffcdfb128afb0d45a8f7e88078739196d64d7ffa47f8513f4a00a6d7"
|
checksum = "bf595259ca079fc86dc249d8ece0b4e822b83035daa0c0491aa4c12b1232b36c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"grid",
|
"grid",
|
||||||
|
|
|
@ -129,7 +129,7 @@ style_malloc_size_of = { package = "malloc_size_of", git = "https://github.com/s
|
||||||
surfman = { git = "https://github.com/servo/surfman", rev = "c8d6b4b65aeab739ee7651602e29c8d58ceee123", features = ["chains"] }
|
surfman = { git = "https://github.com/servo/surfman", rev = "c8d6b4b65aeab739ee7651602e29c8d58ceee123", features = ["chains"] }
|
||||||
syn = { version = "2", default-features = false, features = ["clone-impls", "derive", "parsing"] }
|
syn = { version = "2", default-features = false, features = ["clone-impls", "derive", "parsing"] }
|
||||||
synstructure = "0.13"
|
synstructure = "0.13"
|
||||||
taffy = { version = "0.6.3", default-features = false, features = ["std", "serde", "grid"] }
|
taffy = { version = "0.7", default-features = false, features = ["std", "serde", "grid"] }
|
||||||
thin-vec = "0.2.13"
|
thin-vec = "0.2.13"
|
||||||
tikv-jemalloc-sys = "0.6.0"
|
tikv-jemalloc-sys = "0.6.0"
|
||||||
tikv-jemallocator = "0.6.0"
|
tikv-jemallocator = "0.6.0"
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use app_units::Au;
|
use app_units::Au;
|
||||||
use atomic_refcell::{AtomicRef, AtomicRefCell, AtomicRefMut};
|
use atomic_refcell::{AtomicRef, AtomicRefCell};
|
||||||
use style::properties::ComputedValues;
|
use style::properties::ComputedValues;
|
||||||
use style::values::generics::length::{GenericLengthPercentageOrAuto, LengthPercentageOrAuto};
|
use style::values::generics::length::{GenericLengthPercentageOrAuto, LengthPercentageOrAuto};
|
||||||
use style::values::specified::align::AlignFlags;
|
use style::values::specified::align::AlignFlags;
|
||||||
|
@ -92,7 +92,6 @@ impl taffy::TraversePartialTree for TaffyContainerContext<'_> {
|
||||||
|
|
||||||
impl taffy::LayoutPartialTree for TaffyContainerContext<'_> {
|
impl taffy::LayoutPartialTree for TaffyContainerContext<'_> {
|
||||||
type CoreContainerStyle<'a> = TaffyStyloStyle<&'a ComputedValues> where Self: 'a;
|
type CoreContainerStyle<'a> = TaffyStyloStyle<&'a ComputedValues> where Self: 'a;
|
||||||
type CacheMut<'b> = AtomicRefMut<'b, taffy::Cache> where Self: 'b;
|
|
||||||
|
|
||||||
fn get_core_container_style(&self, _node_id: taffy::NodeId) -> Self::CoreContainerStyle<'_> {
|
fn get_core_container_style(&self, _node_id: taffy::NodeId) -> Self::CoreContainerStyle<'_> {
|
||||||
TaffyStyloStyle(self.style)
|
TaffyStyloStyle(self.style)
|
||||||
|
@ -103,12 +102,6 @@ impl taffy::LayoutPartialTree for TaffyContainerContext<'_> {
|
||||||
(*self.source_child_nodes[id]).borrow_mut().taffy_layout = *layout;
|
(*self.source_child_nodes[id]).borrow_mut().taffy_layout = *layout;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_cache_mut(&mut self, node_id: taffy::NodeId) -> AtomicRefMut<'_, taffy::Cache> {
|
|
||||||
let id = usize::from(node_id);
|
|
||||||
let mut_ref: AtomicRefMut<'_, _> = (*self.source_child_nodes[id]).borrow_mut();
|
|
||||||
AtomicRefMut::map(mut_ref, |node| &mut node.taffy_layout_cache)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn compute_child_layout(
|
fn compute_child_layout(
|
||||||
&mut self,
|
&mut self,
|
||||||
node_id: taffy::NodeId,
|
node_id: taffy::NodeId,
|
||||||
|
|
|
@ -73,7 +73,6 @@ impl TaffyContainer {
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
pub(crate) struct TaffyItemBox {
|
pub(crate) struct TaffyItemBox {
|
||||||
pub(crate) taffy_layout_cache: taffy::Cache,
|
|
||||||
pub(crate) taffy_layout: taffy::Layout,
|
pub(crate) taffy_layout: taffy::Layout,
|
||||||
pub(crate) child_fragments: Vec<Fragment>,
|
pub(crate) child_fragments: Vec<Fragment>,
|
||||||
#[serde(skip_serializing)]
|
#[serde(skip_serializing)]
|
||||||
|
@ -92,7 +91,6 @@ pub(crate) enum TaffyItemBoxInner {
|
||||||
impl fmt::Debug for TaffyItemBox {
|
impl fmt::Debug for TaffyItemBox {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_struct("TaffyItemBox")
|
f.debug_struct("TaffyItemBox")
|
||||||
.field("taffy_layout_cache", &self.taffy_layout_cache)
|
|
||||||
.field("taffy_layout", &self.taffy_layout)
|
.field("taffy_layout", &self.taffy_layout)
|
||||||
.field("child_fragments", &self.child_fragments.len())
|
.field("child_fragments", &self.child_fragments.len())
|
||||||
.field("style", &self.style)
|
.field("style", &self.style)
|
||||||
|
@ -111,7 +109,6 @@ impl TaffyItemBox {
|
||||||
};
|
};
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
taffy_layout_cache: Default::default(),
|
|
||||||
taffy_layout: Default::default(),
|
taffy_layout: Default::default(),
|
||||||
child_fragments: Vec::new(),
|
child_fragments: Vec::new(),
|
||||||
positioning_context: PositioningContext::new_for_containing_block_for_all_descendants(),
|
positioning_context: PositioningContext::new_for_containing_block_for_all_descendants(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue