Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Construct URLSearchParams from array or object #22555

Merged
merged 2 commits into from Dec 26, 2018

Conversation

@CYBAI
Copy link
Collaborator

CYBAI commented Dec 25, 2018


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #22554, fix #22556 and also fix #22557
  • There are tests in url/urlsearchparams-constructor.any.js for these changes

This change is Reviewable

@highfive
Copy link

highfive commented Dec 25, 2018

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/webidls/URLSearchParams.webidl, components/script/dom/urlsearchparams.rs
  • @KiChjang: components/script/dom/webidls/URLSearchParams.webidl, components/script/dom/urlsearchparams.rs
[Construct with object with two keys]
expected: FAIL

[Construct with object with NULL, non-ASCII, and surrogate keys]

This comment has been minimized.

@CYBAI

CYBAI Dec 25, 2018

Author Collaborator

I've observed the Construct with object with two keys case and Construct with object with NULL, non-ASCII, and surrogate keys case will be PASSed intermittently in my local.

I belive the root cause would be related to the MozMap type is HashMap which is an unordered collection so we might get result in different order when using map 🤔

Per the spec for WebIDL record, it should be ordered maps. Maybe we need to make the map inside MozMap to be BTreeMap instead?

This comment has been minimized.

@jdm

jdm Dec 25, 2018

Member

That sounds like a really good idea!

This comment has been minimized.

@CYBAI

CYBAI Dec 25, 2018

Author Collaborator

Yeah, let me file an issue for it! :)

This comment has been minimized.

@CYBAI

CYBAI Dec 25, 2018

Author Collaborator

Just found #15012. Maybe record type in WebIDL is kind of incorrect now?

@jdm would you think it's fine to file another issue to indicate we'd like to use BTreeMap for record? Or, it's better to leave comment in #15012 ?

This comment has been minimized.

@jdm

jdm Dec 25, 2018

Member

I thought no it would be valid to change to BTreeMap now, since full record support is much more complex.

This comment has been minimized.

@CYBAI

CYBAI Dec 26, 2018

Author Collaborator

Filed at #22557

@CYBAI
Copy link
Collaborator Author

CYBAI commented Dec 25, 2018

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Dec 25, 2018

Trying commit 5879dd2 with merge eb09196...

bors-servo added a commit that referenced this pull request Dec 25, 2018
Construct URLSearchParams from array or object

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22554
- [x] There are tests in `url/urlsearchparams-constructor.any.js` for these changes

<!-- 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/22555)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 25, 2018

💔 Test failed - linux-rel-wpt

@CYBAI CYBAI force-pushed the CYBAI:new-urlsearchparams branch from 5879dd2 to 4b4428a Dec 25, 2018
@CYBAI
Copy link
Collaborator Author

CYBAI commented Dec 25, 2018

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Dec 25, 2018

Trying commit 4b4428a with merge ac42b63...

bors-servo added a commit that referenced this pull request Dec 25, 2018
Construct URLSearchParams from array or object

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22554
- [x] There are tests in `url/urlsearchparams-constructor.any.js` for these changes

<!-- 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/22555)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 25, 2018

💔 Test failed - linux-rel-css

@jdm
Copy link
Member

jdm commented Dec 25, 2018

That failure is #13480.

components/script/dom/urlsearchparams.rs Outdated Show resolved Hide resolved
@jdm jdm assigned jdm and unassigned avadacatavra Dec 25, 2018
@CYBAI CYBAI force-pushed the CYBAI:new-urlsearchparams branch from 4b4428a to 6dd3efd Dec 25, 2018
@jdm
Copy link
Member

jdm commented Dec 25, 2018

@bors-servo
Copy link
Contributor

bors-servo commented Dec 25, 2018

📌 Commit 6dd3efd has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Dec 26, 2018

💔 Test failed - mac-rel-css1

@jdm
Copy link
Member

jdm commented Dec 26, 2018

It's a bit sad to mark the test as intermittent when this PR is fixing a bunch of its tests. Why not change the MozMap implementation in this PR instead?

@CYBAI
Copy link
Collaborator Author

CYBAI commented Dec 26, 2018

@jdm I wondered if it's not good to change MozMap in this PR because I thought it's not related to URLSearchParams itself. But, I also start to think that it should be fine to fix it in this PR and maybe I can separate them into different commits to say why we need to change the MozMap. So, I'm working on fixing the MozMap! Thanks for telling me that you think it's fine to fix MozMap in this PR :)

@CYBAI
Copy link
Collaborator Author

CYBAI commented Dec 26, 2018

@jdm With testing to use BTreeMap locally, I found we can pass Construct with object with NULL, non-ASCII, and surrogate keys consistently and fail Construct with object with two keys consistently.

The reason why we'll fail Construct with object with two keys is, while iterating BTreeMap, the map will be ordered by key. For example, if keys are inserted with c and then a, it will be iterated with a and then c.

After doing more investigation, maybe what we want for the orderer map for WebIDL record is something like indexmap ?

Would you think it's fine to install that crate?

@CYBAI
Copy link
Collaborator Author

CYBAI commented Dec 26, 2018

@bors-servo try=wpt

  • Just tried to use IndexMap and the tests can PASS consistently in my local :)

It's a bit sad to mark the test as intermittent when this PR is fixing a bunch of its tests. Why not change the MozMap implementation in this PR instead?

Sorry again and yeah, I should tryt to avoid introducing a known intermittent in the future, thanks!

@bors-servo
Copy link
Contributor

bors-servo commented Dec 26, 2018

Trying commit 0d9b21c with merge 312f000...

bors-servo added a commit that referenced this pull request Dec 26, 2018
Construct URLSearchParams from array or object

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22554, fix #22556 and also fix #22557
- [x] There are tests in `url/urlsearchparams-constructor.any.js` for these changes

<!-- 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/22555)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 26, 2018

☀️ Test successful - linux-rel-css, linux-rel-wpt, status-taskcluster
State: approved= try=True

@CYBAI CYBAI force-pushed the CYBAI:new-urlsearchparams branch from 0d9b21c to 5f6b61b Dec 26, 2018
@CYBAI
Copy link
Collaborator Author

CYBAI commented Dec 26, 2018

@bors-servo try=wpt

  • Let's try againg to see if we'll get that intermittents 👀
@bors-servo
Copy link
Contributor

bors-servo commented Dec 26, 2018

Trying commit 5f6b61b with merge afcd442...

bors-servo added a commit that referenced this pull request Dec 26, 2018
Construct URLSearchParams from array or object

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22554, fix #22556 and also fix #22557
- [x] There are tests in `url/urlsearchparams-constructor.any.js` for these changes

<!-- 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/22555)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 26, 2018

☀️ Test successful - linux-rel-css, linux-rel-wpt, status-taskcluster
State: approved= try=True

@CYBAI CYBAI force-pushed the CYBAI:new-urlsearchparams branch from 5f6b61b to 115b73f Dec 26, 2018
@jdm
Copy link
Member

jdm commented Dec 26, 2018

@bors-servo r+
Thanks for fixing that!

@bors-servo
Copy link
Contributor

bors-servo commented Dec 26, 2018

📌 Commit 115b73f has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Dec 26, 2018

Testing commit 115b73f with merge 7bc6c8d...

bors-servo added a commit that referenced this pull request Dec 26, 2018
Construct URLSearchParams from array or object

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22554, fix #22556 and also fix #22557
- [x] There are tests in `url/urlsearchparams-constructor.any.js` for these changes

<!-- 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/22555)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 26, 2018

@bors-servo bors-servo merged commit 115b73f into servo:master Dec 26, 2018
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@CYBAI CYBAI deleted the CYBAI:new-urlsearchparams branch Dec 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.