Repository navigation
Upgrade rust-selectors, pass ':empty' tests - #6607
Conversation
|
Critic review: https://critic.hoppipolla.co.uk/r/5531 This is an external review system which you may optionally use for the code review of your pull request. In order to help critic track your changes, please do not make in-place history rewrites (e.g. via |
There was a problem hiding this comment.
This unimplemented!() is intentional because I'm not sure how this should be implemented for LayoutNode. If anyone has suggestions, please let me know
There was a problem hiding this comment.
Based on reading ThreadSafeLayoutNode::text_content, try something like:
if let Some(text) = TextCast::to_layout_js(&self.node) {
unsafe {
!CharacterDataCast::from_layout_js(&text).data_for_layout().is_empty()
}
} else {
ElementCast::to_layout_js(&self.node).is_some()
}There was a problem hiding this comment.
Added in the latest force push
|
@SimonSapin r? |
|
|
|
These two implementations aren't equivalent. |
In what ways are they different? At least for now, I'm very unfamiliar with any of the layout code ( |
<style>
#x { background: red; }
#x:empty { background: green }
</style>
<p id=x><!--foo--></p>
<script>
console.log(document.getElementById("x").matches(":empty"));
</script> |
|
I don’t see the difference either. As far as I can tell both impls would return false for comment nodes. |
|
|
|
Oh, I see. @frewsxcv, I think you want |
|
Ah, I understand, thanks for the clarification. Let me know how that latest force push looks. |
|
r+ if you add that test |
|
Sounds reasonable. I'll add |
|
I'd like to add a regression test for this, but I think it is blocked by #6663 since it affects the WPT test that I would be modifying |
|
@Ms2ger Can I help get this moving? The r+ here is blocked on a WPT upgrade which is blocked on some other bugs. Serialization of 2D canvas/WebGL messages is blocked on this, and e10s is blocked on that. |
|
Considering this test:
I don't think I need to add a new test case for this since it already exists (but currently doesn't work). Since I haven't explicitly stated, I am not actively working on #6663. |
|
Just add a new test under |
|
Added a couple tests, let me know how they look |
|
Thanks! One nit, though: in reftests, any red being visible idiomatically implies failure, so use blue or another colour? |
|
Changed the colors to orange and purple |
|
@bors-servo r+ |
|
📌 Commit b1b03a3 has been approved by |
Upgrade rust-selectors, pass ':empty' tests servo/rust-selectors#36 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6607) <!-- Reviewable:end -->
servo/rust-selectors#36