Skip to content

Commit

Permalink
Remove InputFragment
Browse files Browse the repository at this point in the history
Fixes #3724.
  • Loading branch information
Cameron Zwarich committed Nov 3, 2014
1 parent 1a3ff87 commit 5043a63
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
6 changes: 2 additions & 4 deletions components/layout/construct.rs
Expand Up @@ -24,7 +24,7 @@ use flow_ref::FlowRef;
use fragment::{Fragment, GenericFragment, IframeFragment, IframeFragmentInfo, ImageFragment};
use fragment::{ImageFragmentInfo, InlineAbsoluteHypotheticalFragment};
use fragment::{InlineAbsoluteHypotheticalFragmentInfo, InlineBlockFragment};
use fragment::{InlineBlockFragmentInfo, InputFragment, SpecificFragmentInfo, TableCellFragment};
use fragment::{InlineBlockFragmentInfo, SpecificFragmentInfo, TableCellFragment};
use fragment::{TableColumnFragment, TableColumnFragmentInfo, TableFragment, TableRowFragment};
use fragment::{TableWrapperFragment, UnscannedTextFragment, UnscannedTextFragmentInfo};
use incremental::{ReconstructFlow, RestyleDamage};
Expand Down Expand Up @@ -263,9 +263,6 @@ impl<'a> FlowConstructor<'a> {
Some(ElementNodeTypeId(HTMLImageElementTypeId)) => {
self.build_fragment_info_for_image(node, node.image_url())
}
Some(ElementNodeTypeId(HTMLInputElementTypeId)) => {
InputFragment
}
Some(ElementNodeTypeId(HTMLObjectElementTypeId)) => {
let data = node.get_object_data();
self.build_fragment_info_for_image(node, data)
Expand All @@ -274,6 +271,7 @@ impl<'a> FlowConstructor<'a> {
Some(ElementNodeTypeId(HTMLTableColElementTypeId)) => {
TableColumnFragment(TableColumnFragmentInfo::new(node))
}
Some(ElementNodeTypeId(HTMLInputElementTypeId)) |
Some(ElementNodeTypeId(HTMLTableDataCellElementTypeId)) |
Some(ElementNodeTypeId(HTMLTableHeaderCellElementTypeId)) => TableCellFragment,
Some(ElementNodeTypeId(HTMLTableRowElementTypeId)) |
Expand Down
4 changes: 2 additions & 2 deletions components/layout/display_list_builder.rs
Expand Up @@ -15,7 +15,7 @@ use context::LayoutContext;
use flow::{mod, Flow};
use fragment::{Fragment, GenericFragment, IframeFragment, IframeFragmentInfo, ImageFragment};
use fragment::{ImageFragmentInfo, InlineAbsoluteHypotheticalFragment, InlineBlockFragment};
use fragment::{InputFragment, ScannedTextFragment, ScannedTextFragmentInfo, TableFragment};
use fragment::{ScannedTextFragment, ScannedTextFragmentInfo, TableFragment};
use fragment::{TableCellFragment, TableColumnFragment, TableRowFragment, TableWrapperFragment};
use fragment::{UnscannedTextFragment};
use model;
Expand Down Expand Up @@ -500,7 +500,7 @@ impl FragmentDisplayListBuilding for Fragment {
}
}
GenericFragment | IframeFragment(..) | TableFragment | TableCellFragment |
TableRowFragment | TableWrapperFragment | InlineBlockFragment(_) | InputFragment |
TableRowFragment | TableWrapperFragment | InlineBlockFragment(_) |
InlineAbsoluteHypotheticalFragment(_) => {
if opts::get().show_debug_fragment_borders {
self.build_debug_borders_around_fragment(display_list,
Expand Down
24 changes: 11 additions & 13 deletions components/layout/fragment.rs
Expand Up @@ -133,7 +133,6 @@ pub enum SpecificFragmentInfo {
InlineAbsoluteHypotheticalFragment(InlineAbsoluteHypotheticalFragmentInfo),

InlineBlockFragment(InlineBlockFragmentInfo),
InputFragment,
ScannedTextFragment(Box<ScannedTextFragmentInfo>),
TableFragment,
TableCellFragment,
Expand All @@ -149,7 +148,6 @@ impl SpecificFragmentInfo {
match *self {
IframeFragment(_)
| ImageFragment(_)
| InputFragment
| ScannedTextFragment(_)
| TableFragment
| TableCellFragment
Expand All @@ -172,7 +170,6 @@ impl SpecificFragmentInfo {
ImageFragment(_) => "ImageFragment",
InlineAbsoluteHypotheticalFragment(_) => "InlineAbsoluteHypotheticalFragment",
InlineBlockFragment(_) => "InlineBlockFragment",
InputFragment => "InputFragment",
ScannedTextFragment(_) => "ScannedTextFragment",
TableFragment => "TableFragment",
TableCellFragment => "TableCellFragment",
Expand Down Expand Up @@ -638,8 +635,9 @@ impl Fragment {
fn quantities_included_in_intrinsic_inline_size(&self)
-> QuantitiesIncludedInIntrinsicInlineSizes {
match self.specific {
GenericFragment | IframeFragment(_) | ImageFragment(_) | InlineBlockFragment(_) |
InputFragment => QuantitiesIncludedInIntrinsicInlineSizes::all(),
GenericFragment | IframeFragment(_) | ImageFragment(_) | InlineBlockFragment(_) => {
QuantitiesIncludedInIntrinsicInlineSizes::all()
}
TableFragment | TableCellFragment => {
IntrinsicInlineSizeIncludesPadding |
IntrinsicInlineSizeIncludesBorder |
Expand Down Expand Up @@ -957,7 +955,7 @@ impl Fragment {
match self.specific {
GenericFragment | IframeFragment(_) | TableFragment | TableCellFragment |
TableColumnFragment(_) | TableRowFragment | TableWrapperFragment |
InlineAbsoluteHypotheticalFragment(_) | InputFragment => {}
InlineAbsoluteHypotheticalFragment(_) => {}
InlineBlockFragment(ref mut info) => {
let block_flow = info.flow_ref.as_block();
result.union_block(&block_flow.base.intrinsic_inline_sizes)
Expand Down Expand Up @@ -1014,7 +1012,7 @@ impl Fragment {
match self.specific {
GenericFragment | IframeFragment(_) | TableFragment | TableCellFragment |
TableRowFragment | TableWrapperFragment | InlineBlockFragment(_) |
InputFragment | InlineAbsoluteHypotheticalFragment(_) => Au(0),
InlineAbsoluteHypotheticalFragment(_) => Au(0),
ImageFragment(ref image_fragment_info) => {
image_fragment_info.computed_inline_size()
}
Expand All @@ -1033,7 +1031,7 @@ impl Fragment {
match self.specific {
GenericFragment | IframeFragment(_) | TableFragment | TableCellFragment |
TableRowFragment | TableWrapperFragment | InlineBlockFragment(_) |
InputFragment | InlineAbsoluteHypotheticalFragment(_) => Au(0),
InlineAbsoluteHypotheticalFragment(_) => Au(0),
ImageFragment(ref image_fragment_info) => {
image_fragment_info.computed_block_size()
}
Expand Down Expand Up @@ -1067,7 +1065,7 @@ impl Fragment {
-> Option<(SplitInfo, Option<SplitInfo>, Arc<Box<TextRun>> /* TODO(bjz): remove */)> {
match self.specific {
GenericFragment | IframeFragment(_) | ImageFragment(_) | TableFragment | TableCellFragment |
TableRowFragment | TableWrapperFragment | InputFragment => None,
TableRowFragment | TableWrapperFragment => None,
TableColumnFragment(_) => fail!("Table column fragments do not need to split"),
UnscannedTextFragment(_) => fail!("Unscanned text fragments should have been scanned by now!"),
InlineBlockFragment(_) | InlineAbsoluteHypotheticalFragment(_) => {
Expand Down Expand Up @@ -1116,7 +1114,7 @@ impl Fragment {
match self.specific {
GenericFragment | IframeFragment(_) | ImageFragment(_) | TableFragment |
TableCellFragment | TableRowFragment | TableWrapperFragment | InlineBlockFragment(_) |
InputFragment | InlineAbsoluteHypotheticalFragment(_) => None,
InlineAbsoluteHypotheticalFragment(_) => None,
TableColumnFragment(_) => fail!("Table column fragments do not have inline_size"),
UnscannedTextFragment(_) => {
fail!("Unscanned text fragments should have been scanned by now!")
Expand Down Expand Up @@ -1219,7 +1217,7 @@ impl Fragment {
pub fn assign_replaced_inline_size_if_necessary(&mut self, container_inline_size: Au) {
match self.specific {
GenericFragment | IframeFragment(_) | TableFragment | TableCellFragment |
TableRowFragment | TableWrapperFragment | InputFragment => return,
TableRowFragment | TableWrapperFragment => return,
TableColumnFragment(_) => fail!("Table column fragments do not have inline_size"),
UnscannedTextFragment(_) => {
fail!("Unscanned text fragments should have been scanned by now!")
Expand Down Expand Up @@ -1312,7 +1310,7 @@ impl Fragment {
pub fn assign_replaced_block_size_if_necessary(&mut self, containing_block_block_size: Au) {
match self.specific {
GenericFragment | IframeFragment(_) | TableFragment | TableCellFragment |
TableRowFragment | TableWrapperFragment | InputFragment => return,
TableRowFragment | TableWrapperFragment => return,
TableColumnFragment(_) => fail!("Table column fragments do not have block_size"),
UnscannedTextFragment(_) => {
fail!("Unscanned text fragments should have been scanned by now!")
Expand Down Expand Up @@ -1455,7 +1453,7 @@ impl Fragment {
TableWrapperFragment => false,
GenericFragment | IframeFragment(_) | ImageFragment(_) | ScannedTextFragment(_) |
TableFragment | TableCellFragment | TableColumnFragment(_) | TableRowFragment |
UnscannedTextFragment(_) | InputFragment => true,
UnscannedTextFragment(_) => true,
}
}

Expand Down

5 comments on commit 5043a63

@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.

merging zwarich/servo/remove-input-fragment = 5043a63 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.

zwarich/servo/remove-input-fragment = 5043a63 merged ok, testing candidate = 39960f3

@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 = 39960f3

Please sign in to comment.