mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Auto merge of #19294 - emilio:debug-detached-pseudo, r=heycam
style: Collect more debugging info when collecting rules of detached pseudos. Called Option::unwrap() on a None value is not a helpful crash message. This will hopefully help figure out what is causing bug 1418856. <!-- 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/19294) <!-- Reviewable:end -->
This commit is contained in:
commit
af6c2f93b9
1 changed files with 12 additions and 5 deletions
|
@ -756,11 +756,18 @@ pub trait TElement
|
||||||
/// element-backed pseudo-element, in which case we return the originating
|
/// element-backed pseudo-element, in which case we return the originating
|
||||||
/// element.
|
/// element.
|
||||||
fn rule_hash_target(&self) -> Self {
|
fn rule_hash_target(&self) -> Self {
|
||||||
let is_implemented_pseudo =
|
if let Some(pseudo) = self.implemented_pseudo_element() {
|
||||||
self.implemented_pseudo_element().is_some();
|
match self.closest_non_native_anonymous_ancestor() {
|
||||||
|
Some(e) => e,
|
||||||
if is_implemented_pseudo {
|
None => {
|
||||||
self.closest_non_native_anonymous_ancestor().unwrap()
|
panic!(
|
||||||
|
"Trying to collect rules for a detached pseudo-element: \
|
||||||
|
{:?} {:?}",
|
||||||
|
pseudo,
|
||||||
|
self,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
*self
|
*self
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue