diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2014-12-08 13:13:26 -0800 |
---|---|---|
committer | Patrick Walton <pcwalton@mimiga.net> | 2014-12-15 17:41:51 -0800 |
commit | 17835ba0cb446e1d542c7e5347210c03158a9fec (patch) | |
tree | b94a1e1d35e834887e72e13e914444fc28f19e54 /components/layout/layout_task.rs | |
parent | 56b78de5bce995198fbeb41adc58d7625ec93372 (diff) | |
download | servo-17835ba0cb446e1d542c7e5347210c03158a9fec.tar.gz servo-17835ba0cb446e1d542c7e5347210c03158a9fec.zip |
style: Implement quirks mode rules.
Diffstat (limited to 'components/layout/layout_task.rs')
-rw-r--r-- | components/layout/layout_task.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index deda7d481c7..d187aa1a37f 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -40,7 +40,7 @@ use script::layout_interface::{ContentBoxesQuery, ContentBoxQuery, ExitNowMsg, G use script::layout_interface::{HitTestResponse, LayoutChan, LayoutRPC, LoadStylesheetMsg}; use script::layout_interface::{MouseOverResponse, Msg, NoQuery, PrepareToExitMsg}; use script::layout_interface::{ReapLayoutDataMsg, Reflow, ReflowForDisplay, ReflowMsg}; -use script::layout_interface::{ScriptLayoutChan, TrustedNodeAddress}; +use script::layout_interface::{ScriptLayoutChan, SetQuirksModeMsg, TrustedNodeAddress}; use script_traits::{SendEventMsg, ReflowEvent, ReflowCompleteMsg, OpaqueScriptLayoutChannel}; use script_traits::{ScriptControlChan, UntrustedNodeAddress}; use servo_msg::compositor_msg::Scrollable; @@ -390,6 +390,7 @@ impl LayoutTask { match request { AddStylesheetMsg(sheet) => self.handle_add_stylesheet(sheet, possibly_locked_rw_data), LoadStylesheetMsg(url) => self.handle_load_stylesheet(url, possibly_locked_rw_data), + SetQuirksModeMsg => self.handle_set_quirks_mode(possibly_locked_rw_data), GetRPCMsg(response_chan) => { response_chan.send(box LayoutRPCImpl(self.rw_data.clone()) as Box<LayoutRPC + Send>); @@ -500,6 +501,15 @@ impl LayoutTask { LayoutTask::return_rw_data(possibly_locked_rw_data, rw_data); } + /// Sets quirks mode for the document, causing the quirks mode stylesheet to be loaded. + fn handle_set_quirks_mode<'a>(&'a self, + possibly_locked_rw_data: + &mut Option<MutexGuard<'a, LayoutTaskData>>) { + let mut rw_data = self.lock_rw_data(possibly_locked_rw_data); + rw_data.stylist.add_quirks_mode_stylesheet(); + LayoutTask::return_rw_data(possibly_locked_rw_data, rw_data); + } + /// Retrieves the flow tree root from the root node. fn try_get_layout_root(&self, node: LayoutNode) -> Option<FlowRef> { let mut layout_data_ref = node.mutate_layout_data(); |