Skip to content

Commit

Permalink
Remove unused variable and parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
sammykim committed Sep 13, 2013
1 parent 2372a84 commit 80a6ea0
Showing 1 changed file with 3 additions and 40 deletions.
43 changes: 3 additions & 40 deletions src/components/main/layout/box_builder.rs
Expand Up @@ -17,15 +17,14 @@ use layout::inline::{InlineFlowData, InlineLayout};
use layout::text::TextRunScanner;
use css::node_style::StyledNode;

use newcss::values::{CSSDisplay, CSSDisplayBlock, CSSDisplayInline, CSSDisplayInlineBlock};
use newcss::values::{CSSDisplayBlock, CSSDisplayInline, CSSDisplayInlineBlock};
use newcss::values::{CSSDisplayTable, CSSDisplayInlineTable, CSSDisplayListItem};
use newcss::values::{CSSDisplayTableRowGroup, CSSDisplayTableHeaderGroup, CSSDisplayTableFooterGroup};
use newcss::values::{CSSDisplayTableRow, CSSDisplayTableColumnGroup, CSSDisplayTableColumn};
use newcss::values::{CSSDisplayTableCell, CSSDisplayTableCaption};
use newcss::values::{CSSDisplayNone};
use newcss::values::{CSSFloatNone, CSSFloatLeft, CSSFloatRight};
use layout::float_context::{FloatLeft, FloatRight};
use script::dom::element::*;
use script::dom::node::{AbstractNode, CommentNodeTypeId, DoctypeNodeTypeId};
use script::dom::node::{ElementNodeTypeId, LayoutView, TextNodeTypeId};
use servo_util::range::Range;
Expand Down Expand Up @@ -58,40 +57,6 @@ enum InlineSpacerSide {
LogicalAfter,
}

fn simulate_UA_display_rules(node: AbstractNode<LayoutView>) -> CSSDisplay {
// FIXME
/*let resolved = do node.aux |nd| {
match nd.style.display_type {
Inherit | Initial => DisplayInline, // TODO: remove once resolve works
Specified(v) => v
}
};*/

let resolved = CSSDisplayInline;
if resolved == CSSDisplayNone {
return resolved;
}

match node.type_id() {
DoctypeNodeTypeId | CommentNodeTypeId => CSSDisplayNone,
TextNodeTypeId => CSSDisplayInline,
ElementNodeTypeId(element_type_id) => {
match element_type_id {
HTMLHeadElementTypeId |
HTMLScriptElementTypeId => CSSDisplayNone,
HTMLParagraphElementTypeId |
HTMLDivElementTypeId |
HTMLBodyElementTypeId |
HTMLHeadingElementTypeId |
HTMLHtmlElementTypeId |
HTMLUListElementTypeId |
HTMLOListElementTypeId => CSSDisplayBlock,
_ => resolved
}
}
}
}

impl<'self> BoxGenerator<'self> {
/* Debug ids only */

Expand Down Expand Up @@ -130,10 +95,8 @@ impl<'self> BoxGenerator<'self> {
builder: &mut LayoutTreeBuilder) {
debug!("BoxGenerator[f%d]: pushing node: %s", self.flow.id(), node.debug_str());

// first, determine the box type, based on node characteristics
let simulated_display = simulate_UA_display_rules(node);
// TODO: remove this once UA styles work
let box_type = self.decide_box_type(node, simulated_display);
let box_type = self.decide_box_type(node);

debug!("BoxGenerator[f%d]: point a", self.flow.id());

Expand Down Expand Up @@ -256,7 +219,7 @@ impl<'self> BoxGenerator<'self> {
}
}

fn decide_box_type(&self, node: AbstractNode<LayoutView>, _: CSSDisplay) -> RenderBoxType {
fn decide_box_type(&self, node: AbstractNode<LayoutView>) -> RenderBoxType {
if node.is_text() {
RenderBox_Text
} else if node.is_image_element() {
Expand Down

5 comments on commit 80a6ea0

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from jdm
at sammykim@80a6ea0

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging sammykim/servo/issue906 = 80a6ea0 into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sammykim/servo/issue906 = 80a6ea0 merged ok, testing candidate = da26497

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = da26497

Please sign in to comment.