aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrendan Zabarauskas <bjzaba@yahoo.com.au>2014-05-21 15:51:38 -0700
committerBrendan Zabarauskas <bjzaba@yahoo.com.au>2014-05-21 15:51:38 -0700
commit60f21b12b2661c960514b5864e0d78d6a1e3ecd8 (patch)
treee9e3340d3d39a87d8b2939ada83c6599f48e0634 /src
parent9efaf831fc759961f2be5442c12e0bd71f4c6c47 (diff)
downloadservo-60f21b12b2661c960514b5864e0d78d6a1e3ecd8.tar.gz
servo-60f21b12b2661c960514b5864e0d78d6a1e3ecd8.zip
Add doc comments explaining some return types
Diffstat (limited to 'src')
-rw-r--r--src/components/main/layout/box_.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/components/main/layout/box_.rs b/src/components/main/layout/box_.rs
index 2e2e1309638..e55a4ed2793 100644
--- a/src/components/main/layout/box_.rs
+++ b/src/components/main/layout/box_.rs
@@ -1086,7 +1086,11 @@ impl Box {
}
}
- /// Split box which includes new-line character
+ /// Split box which includes new-line character.
+ ///
+ /// A return value of `None` indicates that the box could not be split.
+ /// Otherwise the split boxes are returned. The right boxe is optional due
+ /// to the possibility of it being whitespace.
pub fn split_by_new_line(&self) -> Option<(Box, Option<Box>)> {
match self.specific {
GenericBox | IframeBox(_) | ImageBox(_) | TableBox | TableCellBox |
@@ -1127,6 +1131,10 @@ impl Box {
}
/// Attempts to split this box so that its width is no more than `max_width`.
+ ///
+ /// A return value of `None` indicates that the box could not be split.
+ /// Otherwise the split boxes are returned. The left and right boxes are
+ /// optional due to the possibility of them being whitespace.
pub fn split_to_width(&self, max_width: Au, starts_line: bool) -> Option<(Option<Box>, Option<Box>)> {
match self.specific {
GenericBox | IframeBox(_) | ImageBox(_) | TableBox | TableCellBox |