From 32545116a7f7febc8fcda95188a7a39f01532f1a Mon Sep 17 00:00:00 2001 From: Bryan Bell Date: Mon, 28 Jul 2014 01:05:10 -0700 Subject: [PATCH] 255 -> 1.0 for color::rgba + remove dead code lint In build_display_list_abs (block.rs) and handle_reflow (layout_task.rs) 255 is incorrectly used instead of 1.0 for color::rgba (255 is correct with color::rgb but *not* color::rgba). In cors.rs remove the dead code warning for fn clear. The function shouldn't be removed since it'll be used in the future (fn clear is an implementation of http://fetch.spec.whatwg.org/#concept-cache-clear). --- src/components/layout/block.rs | 2 +- src/components/layout/layout_task.rs | 2 +- src/components/script/cors.rs | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/layout/block.rs b/src/components/layout/block.rs index 1812c6bc642..b4cc3a34ad9 100644 --- a/src/components/layout/block.rs +++ b/src/components/layout/block.rs @@ -1291,7 +1291,7 @@ impl BlockFlow { id: self.layer_id(0), display_list: Arc::new(display_list.flatten(ContentStackingLevel)), position: Rect(origin, size), - background_color: color::rgba(255.0, 255.0, 255.0, 0.0), + background_color: color::rgba(1.0, 1.0, 1.0, 0.0), scroll_policy: scroll_policy, }; self.base.layers.push_back(new_layer) diff --git a/src/components/layout/layout_task.rs b/src/components/layout/layout_task.rs index bed0096ff69..1ca2474ddde 100644 --- a/src/components/layout/layout_task.rs +++ b/src/components/layout/layout_task.rs @@ -689,7 +689,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(255.0, 255.0, 255.0, 255.0); + let mut color = color::rgba(1.0, 1.0, 1.0, 1.0); for child in node.traverse_preorder() { if child.type_id() == Some(ElementNodeTypeId(HTMLHtmlElementTypeId)) || child.type_id() == Some(ElementNodeTypeId(HTMLBodyElementTypeId)) { diff --git a/src/components/script/cors.rs b/src/components/script/cors.rs index 12c87e7b364..556ac15eacd 100644 --- a/src/components/script/cors.rs +++ b/src/components/script/cors.rs @@ -312,6 +312,7 @@ impl CORSCacheEntry { impl CORSCache { /// http://fetch.spec.whatwg.org/#concept-cache-clear + #[allow(dead_code)] fn clear (&mut self, request: &CORSRequest) { let CORSCache(buf) = self.clone(); let new_buf: Vec = buf.move_iter().filter(|e| e.origin == request.origin && request.destination == e.url).collect();