diff options
author | Ms2ger <ms2ger@gmail.com> | 2015-01-19 13:40:29 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2015-01-19 13:48:32 +0100 |
commit | 394f8163433559cea294cb4a4e335cc43ccde1fe (patch) | |
tree | 152db85a8df8c3e01dc881f62b66adbf2e8617f6 /components/layout/fragment.rs | |
parent | 60a901328acb871c7cdad64e14777b91dc61cb05 (diff) | |
download | servo-394f8163433559cea294cb4a4e335cc43ccde1fe.tar.gz servo-394f8163433559cea294cb4a4e335cc43ccde1fe.zip |
Disallow lines that span more than 160 columns.
The Rust style guide suggests 100, but we have too many violations in the
tree already. This check can be tightened over time.
Diffstat (limited to 'components/layout/fragment.rs')
-rw-r--r-- | components/layout/fragment.rs | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index 521b000dfcf..8bad0a288b6 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -1256,11 +1256,24 @@ impl Fragment { pub fn find_split_info_by_new_line(&self) -> Option<(SplitInfo, Option<SplitInfo>, Arc<Box<TextRun>> /* TODO(bjz): remove */)> { match self.specific { - SpecificFragmentInfo::Canvas(_) | SpecificFragmentInfo::Generic | SpecificFragmentInfo::Iframe(_) | SpecificFragmentInfo::Image(_) | SpecificFragmentInfo::Table | SpecificFragmentInfo::TableCell | - SpecificFragmentInfo::TableRow | SpecificFragmentInfo::TableWrapper => None, - SpecificFragmentInfo::TableColumn(_) => panic!("Table column fragments do not need to split"), - SpecificFragmentInfo::UnscannedText(_) => panic!("Unscanned text fragments should have been scanned by now!"), - SpecificFragmentInfo::InlineBlock(_) | SpecificFragmentInfo::InlineAbsoluteHypothetical(_) => { + SpecificFragmentInfo::Canvas(_) | + SpecificFragmentInfo::Generic | + SpecificFragmentInfo::Iframe(_) | + SpecificFragmentInfo::Image(_) | + SpecificFragmentInfo::Table | + SpecificFragmentInfo::TableCell | + SpecificFragmentInfo::TableRow | + SpecificFragmentInfo::TableWrapper => { + None + } + SpecificFragmentInfo::TableColumn(_) => { + panic!("Table column fragments do not need to split") + } + SpecificFragmentInfo::UnscannedText(_) => { + panic!("Unscanned text fragments should have been scanned by now!") + } + SpecificFragmentInfo::InlineBlock(_) | + SpecificFragmentInfo::InlineAbsoluteHypothetical(_) => { panic!("Inline blocks or inline absolute hypothetical fragments do not get split") } SpecificFragmentInfo::ScannedText(ref text_fragment_info) => { |