Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert layout code to use logical directions #2797

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Convert layout code to use logical directions.

Also mark as expected failure a reftest that uses 'direction'.

That property is behind the new --experimental flag,
but enabling the flag fails at runtime.
  • Loading branch information
SimonSapin committed Jul 11, 2014
commit a0452392225895860e83ec3db052f909bbcc4a2d
@@ -53,13 +53,14 @@ pub extern "C" fn cef_run_message_loop() {
device_pixels_per_px: None,
time_profiler_period: None,
memory_profiler_period: None,
enable_experimental: false,
layout_threads: 1,
//layout_threads: cmp::max(rt::default_sched_threads() * 3 / 4, 1),
exit_after_load: false,
output_file: None,
headless: false,
hard_fail: false,
bubble_widths_separately: false,
bubble_isizes_separately: false,
};
native::start(0, 0 as **u8, proc() {
servo::run(opts);

Large diffs are not rendered by default.

@@ -294,7 +294,7 @@ impl<'a> FlowConstructor<'a> {

let mut inline_flow = box InlineFlow::from_fragments((*node).clone(), fragments);
let (ascent, descent) = inline_flow.compute_minimum_ascent_and_descent(self.font_context(), &**node.style());
inline_flow.minimum_height_above_baseline = ascent;
inline_flow.minimum_bsize_above_baseline = ascent;
inline_flow.minimum_depth_below_baseline = descent;
let mut inline_flow = inline_flow as Box<Flow>;
TextRunScanner::new().scan_for_runs(self.font_context(), inline_flow);
@@ -1037,10 +1037,10 @@ pub trait FlowConstructionUtils {
fn add_new_child(&mut self, new_child: FlowRef);

/// Finishes a flow. Once a flow is finished, no more child flows or boxes may be added to it.
/// This will normally run the bubble-widths (minimum and preferred -- i.e. intrinsic -- width)
/// calculation, unless the global `bubble_widths_separately` flag is on.
/// This will normally run the bubble-isizes (minimum and preferred -- i.e. intrinsic -- isize)
/// calculation, unless the global `bubble_isizes_separately` flag is on.
///
/// All flows must be finished at some point, or they will not have their intrinsic widths
/// All flows must be finished at some point, or they will not have their intrinsic isizes
/// properly computed. (This is not, however, a memory safety problem.)
fn finish(&mut self, context: &mut LayoutContext);
}
@@ -1062,16 +1062,16 @@ impl FlowConstructionUtils for FlowRef {
}

/// Finishes a flow. Once a flow is finished, no more child flows or fragments may be added to
/// it. This will normally run the bubble-widths (minimum and preferred -- i.e. intrinsic --
/// width) calculation, unless the global `bubble_widths_separately` flag is on.
/// it. This will normally run the bubble-isizes (minimum and preferred -- i.e. intrinsic --
/// isize) calculation, unless the global `bubble_isizes_separately` flag is on.
///
/// All flows must be finished at some point, or they will not have their intrinsic widths
/// All flows must be finished at some point, or they will not have their intrinsic isizes
/// properly computed. (This is not, however, a memory safety problem.)
///
/// This must not be public because only the layout constructor can do this.
fn finish(&mut self, context: &mut LayoutContext) {
if !context.opts.bubble_widths_separately {
self.get_mut().bubble_widths(context)
if !context.opts.bubble_isizes_separately {
self.get_mut().bubble_isizes(context)
}
}
}
@@ -6,8 +6,7 @@

use css::matching::{ApplicableDeclarationsCache, StyleSharingCandidateCache};

use geom::rect::Rect;
use geom::size::Size2D;
use geom::{Rect, Size2D};
use gfx::display_list::OpaqueNode;
use gfx::font_context::FontContext;
use gfx::font_cache_task::FontCacheTask;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.