mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Remove a stale comment and add missed context.rs (LayoutContext)
This commit is contained in:
parent
989a96526b
commit
5e3ea3f872
2 changed files with 14 additions and 7 deletions
14
src/servo/layout/context.rs
Normal file
14
src/servo/layout/context.rs
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
use resource::image_cache_task::ImageCacheTask;
|
||||||
|
use servo_text::font_cache::FontCache;
|
||||||
|
use std::net::url::Url;
|
||||||
|
use geom::rect::Rect;
|
||||||
|
use au = gfx::geometry::au;
|
||||||
|
|
||||||
|
/* Represents layout task context. */
|
||||||
|
|
||||||
|
struct LayoutContext {
|
||||||
|
font_cache: @FontCache,
|
||||||
|
image_cache: ImageCacheTask,
|
||||||
|
doc_url: Url,
|
||||||
|
screen_size: Rect<au>
|
||||||
|
}
|
|
@ -46,13 +46,6 @@ impl @FlowContext : InlineLayout {
|
||||||
let mut min_width = au(0);
|
let mut min_width = au(0);
|
||||||
let mut pref_width = au(0);
|
let mut pref_width = au(0);
|
||||||
|
|
||||||
/* TODO: implement a "line sizes" API. Each inline element
|
|
||||||
should report its longest possible chunk (i.e., text run) and
|
|
||||||
shortest chunk (i.e., smallest word or hyphenatable segment).
|
|
||||||
|
|
||||||
Until this exists, pretend that the text is indivisible, just
|
|
||||||
like a replaced element. */
|
|
||||||
|
|
||||||
do self.access_inline |d| {
|
do self.access_inline |d| {
|
||||||
for d.boxes.each |box| {
|
for d.boxes.each |box| {
|
||||||
min_width = au::max(min_width, box.get_min_width());
|
min_width = au::max(min_width, box.get_min_width());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue