diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-07-19 18:40:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-19 18:40:44 -0400 |
commit | 1128f40f4e383987d5ef04528fea4bfd5bff9889 (patch) | |
tree | 0895d20466365c700131f8f5b59dccc30ef4cc88 /components/script/dom/domexception.rs | |
parent | bb6265b99bdd41987bf85e191807a4ab10fee361 (diff) | |
parent | 23f15c94efe800db6bbee44a3a5d7464f5c19f31 (diff) | |
download | servo-1128f40f4e383987d5ef04528fea4bfd5bff9889.tar.gz servo-1128f40f4e383987d5ef04528fea4bfd5bff9889.zip |
Auto merge of #23797 - asajeffrey:webxr-framebuffer, r=Manishearth
Added framebuffer and related attributes to XRWebGLLayer
<!-- Please describe your changes on the following line: -->
Implement the `framebuffer` attribute of `XRWebGLLayer`.
---
<!-- 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
- [X] These changes have tests
<!-- 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/23797)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/domexception.rs')
-rw-r--r-- | components/script/dom/domexception.rs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/components/script/dom/domexception.rs b/components/script/dom/domexception.rs index b5b0ca5a8c4..3cfe6092dd1 100644 --- a/components/script/dom/domexception.rs +++ b/components/script/dom/domexception.rs @@ -13,7 +13,7 @@ use crate::dom::globalscope::GlobalScope; use dom_struct::dom_struct; #[repr(u16)] -#[derive(Clone, Copy, Debug, JSTraceable, MallocSizeOf)] +#[derive(Clone, Copy, Debug, Eq, JSTraceable, MallocSizeOf, Ord, PartialEq, PartialOrd)] pub enum DOMErrorName { IndexSizeError = DOMExceptionConstants::INDEX_SIZE_ERR, HierarchyRequestError = DOMExceptionConstants::HIERARCHY_REQUEST_ERR, @@ -36,7 +36,8 @@ pub enum DOMErrorName { TimeoutError = DOMExceptionConstants::TIMEOUT_ERR, InvalidNodeTypeError = DOMExceptionConstants::INVALID_NODE_TYPE_ERR, DataCloneError = DOMExceptionConstants::DATA_CLONE_ERR, - NotReadableError = DOMExceptionConstants::NOT_READABLE_ERR, + NotReadableError, + OperationError, } impl DOMErrorName { @@ -64,6 +65,7 @@ impl DOMErrorName { "InvalidNodeTypeError" => Some(DOMErrorName::InvalidNodeTypeError), "DataCloneError" => Some(DOMErrorName::DataCloneError), "NotReadableError" => Some(DOMErrorName::NotReadableError), + "OperationError" => Some(DOMErrorName::OperationError), _ => None, } } @@ -107,6 +109,9 @@ impl DOMException { }, DOMErrorName::DataCloneError => "The object can not be cloned.", DOMErrorName::NotReadableError => "The I/O read operation failed.", + DOMErrorName::OperationError => { + "The operation failed for an operation-specific reason." + }, }; ( @@ -147,11 +152,11 @@ impl DOMException { } impl DOMExceptionMethods for DOMException { - // https://heycam.github.io/webidl/#dfn-DOMException + // https://heycam.github.io/webidl/#dom-domexception-code fn Code(&self) -> u16 { match DOMErrorName::from(&self.name) { - Some(code) => code as u16, - None => 0 as u16, + Some(code) if code <= DOMErrorName::DataCloneError => code as u16, + _ => 0, } } |