aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/model.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-10-30 15:58:07 -0500
committerGitHub <noreply@github.com>2017-10-30 15:58:07 -0500
commitb6475cf433747a8b0cd177f0a16abae9d795e41c (patch)
treec8602323589a5bc7b0832b8456a91e43214a6b11 /components/layout/model.rs
parent10227e3cd28773acad8dd8144afac61bdcf5941b (diff)
parentf37fa0cf6d0bac9665331ea7d7199f9825ada0f3 (diff)
downloadservo-b6475cf433747a8b0cd177f0a16abae9d795e41c.tar.gz
servo-b6475cf433747a8b0cd177f0a16abae9d795e41c.zip
Auto merge of #19057 - mrobinson:update-wr-sticky-api, r=glennw
Update WR to use the new sticky positioning API <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because they do not change behavior. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19057) <!-- Reviewable:end -->
Diffstat (limited to 'components/layout/model.rs')
-rw-r--r--components/layout/model.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/components/layout/model.rs b/components/layout/model.rs
index 02cae69fa21..9d0d4c69926 100644
--- a/components/layout/model.rs
+++ b/components/layout/model.rs
@@ -425,6 +425,14 @@ impl MaybeAuto {
}
#[inline]
+ pub fn to_option(&self) -> Option<Au> {
+ match *self {
+ MaybeAuto::Specified(value) => Some(value),
+ MaybeAuto::Auto => None,
+ }
+ }
+
+ #[inline]
pub fn specified_or_default(&self, default: Au) -> Au {
match *self {
MaybeAuto::Auto => default,