mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Thread ParseError return values through CSS parsing.
This commit is contained in:
parent
58e39bfffa
commit
27ae1ef2e7
121 changed files with 2133 additions and 1505 deletions
|
@ -2061,7 +2061,7 @@ impl ElementMethods for Element {
|
|||
// https://dom.spec.whatwg.org/#dom-element-matches
|
||||
fn Matches(&self, selectors: DOMString) -> Fallible<bool> {
|
||||
match SelectorParser::parse_author_origin_no_namespace(&selectors) {
|
||||
Err(()) => Err(Error::Syntax),
|
||||
Err(_) => Err(Error::Syntax),
|
||||
Ok(selectors) => {
|
||||
let mut ctx = MatchingContext::new(MatchingMode::Normal, None);
|
||||
Ok(matches_selector_list(&selectors, &Root::from_ref(self), &mut ctx))
|
||||
|
@ -2077,7 +2077,7 @@ impl ElementMethods for Element {
|
|||
// https://dom.spec.whatwg.org/#dom-element-closest
|
||||
fn Closest(&self, selectors: DOMString) -> Fallible<Option<Root<Element>>> {
|
||||
match SelectorParser::parse_author_origin_no_namespace(&selectors) {
|
||||
Err(()) => Err(Error::Syntax),
|
||||
Err(_) => Err(Error::Syntax),
|
||||
Ok(selectors) => {
|
||||
let root = self.upcast::<Node>();
|
||||
for element in root.inclusive_ancestors() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue