mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #25223 - pshaughn:xmlerrortype, r=Manishearth
Changed error type on qname, per spec <!-- Please describe your changes on the following line: --> As specified in https://dom.spec.whatwg.org/#validate invalid QNames when creating a namespaced document/element/attribute get an invalid character exception, not a namespace exception. --- <!-- 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 fix #25110 <!-- Either: --> - [X] There are tests for these changes <!-- 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. -->
This commit is contained in:
commit
69152c7c96
5 changed files with 3 additions and 289 deletions
|
@ -10,15 +10,10 @@ use html5ever::{LocalName, Namespace, Prefix};
|
|||
|
||||
/// Validate a qualified name. See https://dom.spec.whatwg.org/#validate for details.
|
||||
pub fn validate_qualified_name(qualified_name: &str) -> ErrorResult {
|
||||
// Step 2.
|
||||
match xml_name_type(qualified_name) {
|
||||
XMLName::InvalidXMLName => {
|
||||
// Step 1.
|
||||
Err(Error::InvalidCharacter)
|
||||
},
|
||||
XMLName::Name => {
|
||||
// Step 2.
|
||||
Err(Error::Namespace)
|
||||
},
|
||||
XMLName::InvalidXMLName => Err(Error::InvalidCharacter),
|
||||
XMLName::Name => Err(Error::InvalidCharacter), // see whatwg/dom#671
|
||||
XMLName::QName => Ok(()),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue