style: Replicate the list of stylesheets on the layout thread.

This is a patch that unifies a bit how Gecko and Stylo stylesheets work, in
order to be able to eventually move the stylesheets into the stylist, and be
able to incrementally update the invalidation map.
This commit is contained in:
Emilio Cobos Álvarez 2017-08-16 15:46:17 +02:00
parent b8159e659e
commit d1725b1f19
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
14 changed files with 413 additions and 198 deletions

View file

@ -27,8 +27,13 @@ use style::stylesheets::Stylesheet;
/// Asynchronous messages that script can send to layout.
pub enum Msg {
/// Adds the given stylesheet to the document.
AddStylesheet(ServoArc<Stylesheet>),
/// Adds the given stylesheet to the document. The second stylesheet is the
/// insertion point (if it exists, the sheet needs to be inserted before
/// it).
AddStylesheet(ServoArc<Stylesheet>, Option<ServoArc<Stylesheet>>),
/// Removes a stylesheet from the document.
RemoveStylesheet(ServoArc<Stylesheet>),
/// Change the quirks mode.
SetQuirksMode(QuirksMode),
@ -137,8 +142,6 @@ pub struct ScriptReflow {
pub reflow_info: Reflow,
/// The document node.
pub document: TrustedNodeAddress,
/// The document's list of stylesheets.
pub document_stylesheets: Vec<ServoArc<Stylesheet>>,
/// Whether the document's stylesheets have changed since the last script reflow.
pub stylesheets_changed: bool,
/// The current window size.