From 5f26ca10f23b8a3b0ef3710afc02d78468bd24dd Mon Sep 17 00:00:00 2001 From: Seo Sanghyeon Date: Fri, 2 Aug 2013 22:51:06 +0900 Subject: [PATCH] Add clear --- ll.rs | 9 +++++++++ netsurfcss.rc | 23 ++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/ll.rs b/ll.rs index e0c56ec..f2f67de 100644 --- a/ll.rs +++ b/ll.rs @@ -346,6 +346,14 @@ pub mod properties { pub static CSS_FLOAT_RIGHT: css_float_e = 0x2; pub static CSS_FLOAT_NONE: css_float_e = 0x3; + pub type css_clear_e = c_enum; + + pub static CSS_CLEAR_INHERIT: css_clear_e = 0x0; + pub static CSS_CLEAR_NONE: css_clear_e = 0x1; + pub static CSS_CLEAR_LEFT: css_clear_e = 0x2; + pub static CSS_CLEAR_RIGHT: css_clear_e = 0x3; + pub static CSS_CLEAR_BOTH: css_clear_e = 0x4; + pub type css_position_e = c_enum; pub static CSS_POSITION_INHERIT: css_position_e = 0x0; @@ -597,6 +605,7 @@ pub mod computed { fn css_computed_padding_left(style: *css_computed_style, length: *mut css_fixed, unit: *mut css_unit) -> uint8_t; fn css_computed_display(style: *css_computed_style, root: bool) -> uint8_t; fn css_computed_float(style: *css_computed_style) -> uint8_t; + fn css_computed_clear(style: *css_computed_style) -> uint8_t; fn css_computed_position(style: *css_computed_style) -> uint8_t; fn css_computed_width(style: *css_computed_style, length: *mut css_fixed, unit: *mut css_unit) -> uint8_t; fn css_computed_height(style: *css_computed_style, length: *mut css_fixed, unit: *mut css_unit) -> uint8_t; diff --git a/netsurfcss.rc b/netsurfcss.rc index 9fe3625..42c492d 100644 --- a/netsurfcss.rc +++ b/netsurfcss.rc @@ -1105,7 +1105,7 @@ pub mod computed { use hint::CssHint; use select::CssSelectResults; use values::{CssColorValue, CssMarginValue, CssPaddingValue, CssBorderWidthValue, CssDisplayValue}; - use values::{CssFloatValue, CssPositionValue, CssWidthValue, CssHeightValue, CssFontFamilyValue}; + use values::{CssFloatValue, CssClearValue, CssPositionValue, CssWidthValue, CssHeightValue, CssFontFamilyValue}; use values::{CssFontSizeValue, CssFontStyleValue, CssFontWeightValue, CssTextAlignValue, CssTextDecorationValue}; use values::{CssLineHeightValue}; use ll::properties::*; @@ -1347,6 +1347,13 @@ pub mod computed { CssFloatValue::new(type_) } + pub fn clear(&self) -> CssClearValue { + let type_ = unsafe { css_computed_clear(self.computed_style) }; + let type_ = type_ as css_clear_e; + + CssClearValue::new(type_) + } + pub fn font_family(&self) -> CssFontFamilyValue { let mut names: **lwc_string = null(); let type_ = unsafe { css_computed_font_family(self.computed_style, @@ -1629,6 +1636,20 @@ mod values { } } + pub enum CssClearValue { + CssClearInherit = 0x0, + CssClearNone = 0x1, + CssClearLeft = 0x2, + CssClearRight = 0x3, + CssClearBoth = 0x4 + } + + impl CssClearValue { + pub fn new(type_: css_clear_e) -> CssClearValue { + c_enum_to_rust_enum(type_) + } + } + pub enum CssFontFamilyValue { CssFontFamilyInherit, CssFontFamilySerif,