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

text-decoration #9

Merged
merged 3 commits into from May 24, 2013
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Add stub visited callback and add equality to CSSTextDecoration

  • Loading branch information
Eric Atkinson
Eric Atkinson committed May 24, 2013
commit baa87a0e5164c9680c862570c5eb1cbd35c35899
@@ -144,6 +144,12 @@ impl<N, H: SelectHandler<N>> n::s::CssSelectHandler<N> for SelectHandlerWrapper<
false
}

fn node_is_visited(&self, _node: &N) -> bool {
// FIXME
warn_unimpl("node_is_visited");
false
}

fn ua_default_for_property(&self, property: n::p::CssProperty) -> n::h::CssHint {
warn!("not specifiying ua default for property %?", property);
n::h::CssHintDefault
32 test.rs
@@ -112,6 +112,22 @@ fn single_div_test(style: &str, f: &fn(&ComputedStyle)) {
f(&computed);
}

fn single_html_test(style: &str, f: &fn(&ComputedStyle)) {
let sheet = Stylesheet::new(test_url(), style_stream(style));
let mut select_ctx = SelectCtx::new();
let handler = &TestHandler::new();
select_ctx.append_sheet(sheet, OriginAuthor);
let dom = &TestNode(@NodeData {
name: ~"html",
id: ~"id1",
children: ~[],
parent: @mut None
});
let style = select_ctx.select_style(dom, handler);
let computed = style.computed_style();
f(&computed);
}

#[test]
fn test_background_color_simple() {
let style = "div { background-color: #123456; }";
@@ -345,6 +361,22 @@ fn test_text_align() {
}
}

#[test]
fn test_text_decoration(){
let style = "div { text-decoration: none; }";
do single_html_test(style) |computed| {
assert!(computed.text_decoration() == Specified(CSSTextDecorationNone));
}
let style = "html { text-decoration: underline; }";
do single_html_test(style) |computed| {
assert!(computed.text_decoration() == Specified(CSSTextDecorationUnderline));
}
let style = "";
do single_html_test(style) |computed| {
assert!(computed.text_decoration() == Specified(CSSTextDecorationNone));
}
}

#[test]
fn test_id_selector() {
let style = "#id1 { text-align: center; }";
@@ -280,6 +280,7 @@ pub enum CSSTextAlign {
CSSTextAlignJustify
}

#[deriving(Eq)]
pub enum CSSTextDecoration {
CSSTextDecorationNone,
CSSTextDecorationUnderline,
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.