Repository navigation
Implement RadioNodeList - #9407
Conversation
|
@bors-servo try |
Implement RadioNodeList I also had to implement the NamedGetter for HTMLFormControlsCollection as well, since that's the only consumer of RadioNodeList and I wanted to see which wpt test passes.
There was a problem hiding this comment.
You could alternatively just return 1 or 0 in here and then just call sum() on the iterator
There was a problem hiding this comment.
Or maybe even better:
let count = self.collection.elements_iter().filter(|elem| {
elem.get_string_attribute(&atom!("name")) == name
|| elem.get_string_attribute(&atom!("id")) == name
}).count()There was a problem hiding this comment.
I would do that if the API is not unstable. Ideally, I would reuse this for the filter_map below, but .count() consumes the iterator so I had to repeat the entire mapping.
|
💔 Test failed - linux-dev |
9d11ba4 to
0288984
Compare
Looking good here! O Spiritus Sancti, in Nomine Patris, I summon @jdm or @Ms2ger to guide my hand in enabling the RadioNodeList interface. |
|
@KiChjang I allow you to add RadioNodeList to the list in interfaces.html. |
6d75ca1 to
d8102a0
Compare
|
I think this is ready to be re-reviewed, I've eliminated the extra iterator. |
d8102a0 to
e5f634b
Compare
|
The code looks ok, but why are there still failing tests listed in htmlformcontrolscollection.html.ini? |
e5f634b to
9fc228d
Compare
|
This is the test case that is failing: test(function () {
rdoList.value = "on";
assert_equals(rdoList.value, document.getElementById("r2").value,
"The value attribute should be the second radio input element's value.");
assert_true(document.getElementById("r2").checked,
"The second radio input element should be checked.");
document.getElementById("r1").removeAttribute("value");
rdoList.value = "on";
assert_equals(rdoList.value, document.getElementById("r1").value,
"The value attribute should be the first radio input element's value.");
assert_true(document.getElementById("r1").checked,
"The first radio input element should be checked.");
}, "Check the RadioNodeList.value on setting to 'on'");In particular, it's the "The value attribute should be the first radio input element's value." assertion. Since the value attribute is removed from the r1 radio element, the rdoList.value assignment should have matched against r1 and set its checked value to true, but it did not. I'm still trying to figure out whether it's a problem with the implementation of |
|
I see. You shouldn't include code for both ChildrenList and Simple, instead, there should be a specific variant of NodeList for that particular kind of collections, and you should just piggy-back that in RadioNodeList. |
|
Actually, something doesn't quite make sense in this test case... the line |
|
Ok, ignore what I wrote... it's actually my implementation of |
|
So I think I'm onto something here - |
|
💔 Test failed - mac-rel-wpt |
|
@bors-servo retry
|
Implement RadioNodeList I also had to implement the NamedGetter for HTMLFormControlsCollection as well, since that's the only consumer of RadioNodeList and I wanted to see which wpt test passes. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9407) <!-- Reviewable:end -->
|
💔 Test failed - mac-dev-unit |
|
@bors-servo retry
|
Implement RadioNodeList I also had to implement the NamedGetter for HTMLFormControlsCollection as well, since that's the only consumer of RadioNodeList and I wanted to see which wpt test passes. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9407) <!-- Reviewable:end -->
|
💔 Test failed - mac-rel-wpt |
|
@bors-servo retry Git snafu. |
|
⚡ Previous build results for android, gonk, linux-dev, linux-rel, mac-dev-unit are reusable. Rebuilding only mac-rel-css, mac-rel-wpt... |
|
💔 Test failed - mac-rel-wpt |
|
@bors-servo retry git snafu |
|
⚡ Previous build results for android, gonk, linux-dev, linux-rel, mac-dev-unit, mac-rel-css are reusable. Rebuilding only mac-rel-wpt... |
|
☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt |
I also had to implement the NamedGetter for HTMLFormControlsCollection as well, since that's the only consumer of RadioNodeList and I wanted to see which wpt test passes.