Skip to content

Commit

Permalink
servo: Merge #1208 - Use Any for the layout data (from pcwalton:any…
Browse files Browse the repository at this point in the history
…-layout-data); r=metajack

Breaks the dependency between `gfx` and `script`, which is nice.

This exposed some performance issues with Rust's `Any` type, which I've filed:

rust-lang/rust#10382

Source-Repo: https://github.com/servo/servo
Source-Revision: 4eb84496211bb48d2804a0ddcd16849536546103

UltraBlame original commit: 307ff07f5dc6474afb4176fcf3c599315d4408f2
  • Loading branch information
marco-c committed Sep 30, 2019
1 parent 791c06b commit 4d7e60b
Show file tree
Hide file tree
Showing 8 changed files with 679 additions and 407 deletions.
13 changes: 0 additions & 13 deletions servo/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -2004,16 +2004,6 @@ src
/
components
/
gfx
-
L
(
B
)
src
/
components
/
msg
WEBIDL_script
=
Expand Down Expand Up @@ -2118,9 +2108,6 @@ DONE_style
DONE_net
)
(
DONE_gfx
)
(
DONE_msg
)
RFLAGS_style
Expand Down
103 changes: 43 additions & 60 deletions servo/src/components/main/css/matching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ layout
incremental
;
use
layout
:
:
util
:
:
LayoutDataAccess
;
use
script
:
:
Expand Down Expand Up @@ -229,36 +238,18 @@ None
)
}
;
let
cell
=
Cell
:
:
new
(
applicable_declarations
)
;
do
self
.
write_layout_data
|
data
|
{
data
layout_data
(
)
.
applicable_declarations
=
cell
.
take
set
(
applicable_declarations
)
;
}
}
fn
match_subtree
Expand Down Expand Up @@ -542,57 +533,48 @@ None
}
;
let
computed_values
layout_data
=
do
self
.
read_layout_data
|
data
|
{
cascade
layout_data
(
data
.
applicable_declarations
parent_style
)
}
;
let
cell
computed_values
=
Cell
:
:
new
cascade
(
*
layout_data
.
applicable_declarations
.
borrow
(
computed_values
)
;
do
self
.
write_layout_data
|
data
|
{
ptr
parent_style
)
;
let
style
=
cell
layout_data
.
take
style
.
mutate
(
)
;
match
data
.
*
style
.
ptr
{
None
=
Expand All @@ -606,6 +588,7 @@ previous_style
)
=
>
{
self
.
set_restyle_damage
Expand All @@ -617,20 +600,20 @@ compute_damage
(
previous_style
&
style
computed_values
)
)
}
data
.
}
*
style
.
ptr
=
Some
(
style
computed_values
)
;
}
}
fn
cascade_subtree
Expand Down
Loading

0 comments on commit 4d7e60b

Please sign in to comment.