diff options
author | Adenilson Cavalcanti <cavalcantii@gmail.com> | 2015-02-02 10:52:17 -0800 |
---|---|---|
committer | Adenilson Cavalcanti <cavalcantii@gmail.com> | 2015-02-02 10:52:17 -0800 |
commit | 417ffca937ae4063976fbe1e1bfddefcdc143af9 (patch) | |
tree | 1cba9a42fa438e064fbdcf8cf89aee87977272ff /components/layout/layout_task.rs | |
parent | 755adf0ddefb060007c0319655f994445aea4709 (diff) | |
download | servo-417ffca937ae4063976fbe1e1bfddefcdc143af9.tar.gz servo-417ffca937ae4063976fbe1e1bfddefcdc143af9.zip |
Implements 2 helper functions for Color type (white() and black())
and uses it in layout_task.rs.
Diffstat (limited to 'components/layout/layout_task.rs')
-rw-r--r-- | components/layout/layout_task.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index 285e3889bf3..422ded0b3ad 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -664,7 +664,7 @@ impl LayoutTask { // FIXME(pcwalton): This is really ugly and can't handle overflow: scroll. Refactor // it with extreme prejudice. - let mut color = color::rgba(1.0, 1.0, 1.0, 1.0); + let mut color = color::white(); for child in node.traverse_preorder() { if child.type_id() == Some(NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLHtmlElement))) || child.type_id() == Some(NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLBodyElement))) { @@ -676,9 +676,12 @@ impl LayoutTask { .background_color) .to_gfx_color() }; - // FIXME: Add equality operators for azure color type. - if element_bg_color.r != 0.0 || element_bg_color.g != 0.0 || - element_bg_color.b != 0.0 || element_bg_color.a != 0.0 { + + let black = color::black(); + // TODO: Use equality operators when we sync with rust-azure. + if element_bg_color.r != black.r || element_bg_color.g != black.g || + element_bg_color.b != black.b || element_bg_color.a != black.a { + color = element_bg_color; break; } |