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
Update step numbers in URL constructor #29703
Conversation
// Step 8: Instead of construcing a new `URLSearchParams` object here, construct it | ||
// on-demand inside `URL::SearchParams`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know exactly why this happened, but this PR doesn't change the behavior around URLSearchParams
, continuing to ignore the related steps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change just updating the step numbers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. The corresponding spec change related to this PR can be found here: whatwg/url@ae3c28b8
(I probably should have mentioned this somewhere, such as in commit message.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the code changes are an improvement here, because they increase the nesting level of the method. Would it be possible to avoid changing the code if there is no behavior changes and also to paste a small description of each step in quotes. With a small amount of text, at least it will still be clear what each step does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, that makes sense. I'll make the change. Thank you!
604d02d
to
1f88c52
Compare
Two commits have been made ahead of the current implementation of Servo's URL constructor: - Align with a more modern IDL definition style [1] - Add URL.canParse() [2] Since these commits don't alter the actual behavior, this commit only updates the step numbers and adds brief descriptions for each step. No behavior change is expected with this commit. [1]: whatwg/url@ea3b75d [2]: whatwg/url@ae3c28b Signed-off-by: Yutaro Ohno <yutaro.ono.418@gmail.com>
1f88c52
to
3336bf6
Compare
As I mentioned in the commit message, the current implementation status of the URL constructor appears to correspond to the state before the following commit of the spec: |
// Step 3. Let query be parsedURL’s query. | ||
// Step 5. Set this’s query object to a new URLSearchParams object. | ||
// Step 6. Initialize this’s query object with query. | ||
// Step 7. Set this’s query object’s URL object to this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit confusing. Step 5 and 8, which were previously skipped, seem to correspond these four steps.
Step 8 is split into some parts here:
whatwg/url@ea3b75d#diff-29243b3b9b716b55c6a61970b0c4864f464b139d397fb961a05bb6e1e2b97cabL2840-L2842
Here's the current spec:
https://url.spec.whatwg.org/#constructors
@bors-servo r+ |
📌 Commit 3336bf6 has been approved by |
Test results for linux-wpt-layout-2013 from try job (#4912618224): Flaky unexpected result (16)
Stable unexpected results that are known to be intermittent (20)
|
☀️ Test successful - checks-github |
Two commits have been made ahead of the current implementation of
Servo's URL constructor:
Since these commits don't alter the actual behavior, this commit only
updates the step numbers and adds brief descriptions for each step.
No behavior change is expected with this commit.
./mach build -d
does not report any errors./mach test-tidy
does not report any errors