aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout
diff options
context:
space:
mode:
authorDeokjin Kim <deokjin81.kim@samsung.com>2015-01-20 11:02:41 +0900
committerDeokjin Kim <deokjin81.kim@samsung.com>2015-01-20 11:02:41 +0900
commitee0ce0d8f4eecede189ee85cf51a64519ffa5c80 (patch)
treed563b117f264b305d5288caa00f4010f127e7c58 /components/layout
parent80a6f0ae0880914f972b24a11216eed25d873576 (diff)
parentccf5f96fa91540ca73cfb24dd130d5124975fc6e (diff)
downloadservo-ee0ce0d8f4eecede189ee85cf51a64519ffa5c80.tar.gz
servo-ee0ce0d8f4eecede189ee85cf51a64519ffa5c80.zip
Merge branch 'master' of https://github.com/servo/servo into font_style
Diffstat (limited to 'components/layout')
-rw-r--r--components/layout/display_list_builder.rs3
-rw-r--r--components/layout/fragment.rs23
2 files changed, 20 insertions, 6 deletions
diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs
index 54725d122b0..2e4ae665ea9 100644
--- a/components/layout/display_list_builder.rs
+++ b/components/layout/display_list_builder.rs
@@ -44,6 +44,7 @@ use servo_util::geometry::{mod, Au, to_px};
use servo_util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize};
use servo_util::opts;
use std::default::Default;
+use std::iter::repeat;
use std::num::FloatMath;
use style::computed::{AngleOrCorner, LengthOrPercentage, HorizontalDirection, VerticalDirection};
use style::computed::{Image, LinearGradient};
@@ -881,7 +882,7 @@ impl FragmentDisplayListBuilding for Fragment {
renderer.deref().lock().send(SendPixelContents(sender));
receiver.recv()
},
- None => Vec::from_elem(width * height * 4, 0xFFu8)
+ None => repeat(0xFFu8).take(width * height * 4).collect(),
};
let canvas_display_item = box ImageDisplayItem {
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) => {