Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upmake nodeList iterable #13081
make nodeList iterable #13081
Conversation
highfive
commented
Aug 27, 2016
|
Heads up! This PR modifies the following files:
|
highfive
commented
Aug 27, 2016
|
Well... |
| "path": "dom/nodes/NodeList-Iterable.html", | ||
| "url": "/dom/nodes/NodeList-Iterable.html" | ||
| } | ||
| ], |
This comment has been minimized.
This comment has been minimized.
izgzhen
Aug 27, 2016
Contributor
Looks like you hand-write this? Try ./mach update-manifest for adding test files
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
hsinewu
Aug 27, 2016
Author
Contributor
Oh, do you mean the inconsistency of the path?
I have no idea about that :)
This comment has been minimized.
This comment has been minimized.
izgzhen
Aug 27, 2016
Contributor
Never mind :) it passed the CI so it is good. I am just surprised that the new entry it the first one in items
|
BTW, consider adding a descriptive title to the testing HTML file like "NodeList Iterable Test". Good luck! |
|
You can test for the presence of the Symbol.iterator property and whether for/of loops work |
|
(sorry, fat fingers) |
|
@Ms2ger I haven't heard of that |
|
This test makes more sense to me. |
|
I'm thinking of ways to create NodeList without using function like There is a NodeList constructor(I test it on firefox) but I can't construct it with |
| test(function() { | ||
| for(var method of methods) | ||
| assert_true(method in nodes); | ||
| }, "NodeList has " /*+ methods.join()*/ + " methods."); |
This comment has been minimized.
This comment has been minimized.
hsinewu
Aug 28, 2016
Author
Contributor
for some reason when I invoke join method, the test always timeout, reporting find no tests.
|
It doesn't look like anything's changed in |
| nothing = document.querySelectorAll('span'); | ||
| }) | ||
| testIterable(paragraphs); | ||
| testIterable(nothing); |
This comment has been minimized.
This comment has been minimized.
KiChjang
Aug 28, 2016
Member
Also, this test is full of tabs, please change them into spaces instead.
This comment has been minimized.
This comment has been minimized.
|
@KiChjang So there should be a |
|
Okay ... looks like the basic indexing is implemented before, but except for
As I tested locally, these |
|
No, don't care about
But looks like even if I didn't uncomment this line (on my local version), the |
|
@izgzhen Yes, there is no |
|
I just realize I could have look it up elsewhere.
Is this test script applicable in our case? |
|
I think you are right. Only |
|
But they are NOT there with that line uncommented, in my experiment? Actually, I have no idea how declaration in IDL affect the build. |
|
|
|
@KiChjang need reviewing :3 |
| <script> | ||
| var paragraphs; | ||
| setup(function() { | ||
| paragraphs = document.querySelectorAll('p'); |
This comment has been minimized.
This comment has been minimized.
KiChjang
Sep 3, 2016
Member
I don't think querySelectorAll is implemented on the document, and I'm not sure whether there's work going towards implementing CSS Selectors DOM interface.
Pinging @SimonSapin to see if we'd want to work on that.
This comment has been minimized.
This comment has been minimized.
KiChjang
Sep 3, 2016
Member
However, getElementsByName is implemented, so instead of depending on querySelectorsAll, you may want to use the former instead.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
The test doesn't look like it properly tests for the iterable properties of a NodeList - it only tests for the presence of methods to call in |
|
@bors-servo r+ |
|
|
make nodeList iterable <!-- Please describe your changes on the following line: --> Not sure what to test in the script. Need some advice. o_O --- <!-- 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 #13021 (github issue number if applicable). <!-- Either: --> - [X] There are tests for these changes <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/13081) <!-- Reviewable:end -->
|
|
hsinewu commentedAug 27, 2016
•
edited
Not sure what to test in the script.
Need some advice. o_O
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is