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

Update step numbers in URL constructor #29703

Merged
merged 1 commit into from May 8, 2023

Conversation

ohno418
Copy link
Contributor

@ohno418 ohno418 commented May 3, 2023

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.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #___ (GitHub issue number if applicable)
  • These changes do not require tests because no behavior has changed.

Comment on lines -108 to -109
// Step 8: Instead of construcing a new `URLSearchParams` object here, construct it
// on-demand inside `URL::SearchParams`.
Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Contributor Author

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.)

Copy link
Member

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.

Copy link
Contributor Author

@ohno418 ohno418 May 4, 2023

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!

@ohno418 ohno418 force-pushed the update-url-constructor-steps branch from 604d02d to 1f88c52 Compare May 3, 2023 07:39
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>
@ohno418 ohno418 force-pushed the update-url-constructor-steps branch from 1f88c52 to 3336bf6 Compare May 6, 2023 07:30
@ohno418 ohno418 changed the title Update the steps for URL constructor Update step numbers in URL constructor May 6, 2023
@ohno418
Copy link
Contributor Author

ohno418 commented May 6, 2023

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:

whatwg/url@ea3b75d

Comment on lines +105 to +108
// 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.
Copy link
Contributor Author

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

@mrobinson
Copy link
Member

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 3336bf6 has been approved by mrobinson

@bors-servo
Copy link
Contributor

⌛ Testing commit 3336bf6 with merge c67d760...

@github-actions
Copy link

github-actions bot commented May 8, 2023

Test results for linux-wpt-layout-2013 from try job (#4912618224):

Flaky unexpected result (16)
  • TIMEOUT [expected OK] /_mozilla/mozilla/img_placeholder_load.html (#28717)
    • TIMEOUT [expected PASS] subtest: Loading a placeholder image should trigger an error on the img element Test timed out
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
    • NOTRUN [expected PASS] subtest: Overall test
  • FAIL [expected TIMEOUT] /css/css-backgrounds/animations/background-color-transition.html
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-window-open.html (#28691)
    • PASS [expected FAIL] subtest: load event does not fire on window.open('about:blank')
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-cross-origin.sub.window.html (#29056)
    • PASS [expected FAIL] subtest: Cross-origin navigation started from unload handler must be ignored
  • OK /html/browsers/browsing-the-web/read-media/pageload-image-in-popup.html (#23849)
    • PASS [expected FAIL] subtest: The document for a standalone media file should have one child in the body.
  • OK /html/browsers/history/the-history-interface/traverse_the_history_4.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals, last would be aborted
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html (#22647)
    • TIMEOUT [expected FAIL] subtest: Check that popups from a sandboxed iframe escape the sandbox if
      allow-popups-to-escape-sandbox is used Test timed out
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.html (#24066)
    • NOTRUN [expected FAIL] subtest: Check that popups from a sandboxed iframe do not escape the sandbox
  • OK [expected TIMEOUT] /html/semantics/forms/form-submission-0/reparent-form-during-planned-navigation-task.html (#29724)
    • PASS [expected TIMEOUT] subtest: reparent-form-during-planned-navigation-task
  • OK /html/syntax/parsing/DOMContentLoaded-defer.html (#21550)
    • PASS [expected FAIL] subtest: The end: DOMContentLoaded and defer scripts
  • OK /html/webappapis/dynamic-markup-insertion/document-write/module-static-import-delayed.html (#26243)
    • FAIL [expected PASS] subtest: document.write in an imported module assert_true: onload must be called expected true got false
  • TIMEOUT [expected OK] /html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-entry.html (#25805)
    • TIMEOUT [expected FAIL] subtest: Sanity check: this all works as expected with no promises involved Test timed out
  • CRASH [expected TIMEOUT] /webmessaging/broadcastchannel/cross-partition.https.tentative.html (#29058)
  • TIMEOUT [expected OK] /webmessaging/with-ports/018.html (#24485)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, javascript: Test timed out
  • TIMEOUT [expected OK] /webstorage/localstorage-about-blank-3P-iframe-opens-3P-window.partitioned.tentative.html (#29053)
    • TIMEOUT [expected PASS] subtest: StorageKey: test 3P about:blank window opened from a 3P iframe Test timed out
Stable unexpected results that are known to be intermittent (20)
  • TIMEOUT [expected OK] /_webgl/conformance/uniforms/out-of-bounds-uniform-array-access.html (#26225)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK [expected TIMEOUT] /fetch/api/basic/keepalive.any.html (#29536)
  • OK [expected TIMEOUT] /fetch/local-network-access/iframe.tentative.https.window.html (#29605)
    • PASS [expected TIMEOUT] subtest: local to local, grandparent navigates: no preflight required.
    • FAIL [expected TIMEOUT] subtest: public to local, grandparent navigates: failure. timeout adding grandchild
    • FAIL [expected TIMEOUT] subtest: public to local, grandparent navigates: success. timeout adding grandchild
  • TIMEOUT /fetch/metadata/generated/css-images.sub.tentative.html (#29047)
    • PASS [expected TIMEOUT] subtest: background-image sec-fetch-dest - Not sent to non-trustworthy same-site destination
  • OK /html/browsers/browsing-the-web/navigating-across-documents/empty-iframe-load-event.html (#29066)
    • PASS [expected FAIL] subtest: Check execution order on load handler
    • PASS [expected FAIL] subtest: Check execution order from nested timeout
  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-aboutblank-navigate-immediately.html (#29048)
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html (#28681)
    • FAIL [expected PASS] subtest: load & pageshow events do not fire on contentWindow of <iframe> element created with src='' assert_unreached: load should not be fired Reached unreachable code
  • TIMEOUT /html/browsers/browsing-the-web/navigating-across-documents/javascript-url-no-beforeunload.window.html (#29055)
    • PASS [expected TIMEOUT] subtest: Navigating an opened window via location.href to a javascript: URL must not fire beforeunload: undefined completion
    • FAIL [expected NOTRUN] subtest: Navigating an opened window with an iframe via location.href to a javascript: URL must not fire beforeunload on the iframe: undefined completion promise_test: Unhandled rejection with value: object "TypeError: w.frames[0] is undefined"
    • PASS [expected NOTRUN] subtest: Navigating an iframe via location.href to a javascript: URL must not fire beforeunload: string completion
    • PASS [expected NOTRUN] subtest: Navigating an iframe via src="" to a javascript: URL after insertion must not fire beforeunload: string completion
    • TIMEOUT [expected NOTRUN] subtest: Navigating an opened window via location.href to a javascript: URL must not fire beforeunload: string completion Test timed out
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin-fragment.html (#20768)
    • PASS [expected FAIL] subtest: Tests that a fragment navigation in the unload handler will not block the initial navigation
  • OK /html/browsers/history/the-history-interface/traverse_the_history_1.html (#21383)
    • FAIL [expected PASS] subtest: Multiple history traversals from the same task assert_array_equals: Pages opened during history navigation expected property 1 to be 2 but got 1 (expected array [4, 2] got [4, 1])
  • OK /html/browsers/the-window-object/open-close/creating_browsing_context_test_01.html (#29046)
    • PASS [expected FAIL] subtest: first argument: absolute url
  • TIMEOUT [expected OK] /html/interaction/focus/the-autofocus-attribute/supported-elements.html (#24145)
    • TIMEOUT [expected PASS] subtest: Non-HTMLElement should not support autofocus Test timed out
    • NOTRUN [expected FAIL] subtest: Host element with delegatesFocus should support autofocus
    • NOTRUN [expected FAIL] subtest: Host element with delegatesFocus including no focusable descendants should be skipped
    • NOTRUN [expected FAIL] subtest: Area element should support autofocus
  • OK [expected TIMEOUT] /html/interaction/focus/the-autofocus-attribute/update-the-rendering.html (#24145)
    • FAIL [expected TIMEOUT] subtest: "Flush autofocus candidates" should be happen before a scroll event and animation frame callbacks w.focus is not a function
  • OK /html/semantics/forms/form-submission-0/multipart-formdata.window.html (#28725)
    • FAIL [expected PASS] subtest: multipart/form-data: Basic test (formdata event) assert_equals: expected "\r\nContent-Disposition: form-data; name="basic"\r\n\r\ntest\r\n--\r\n" but got ""
  • OK /html/semantics/forms/form-submission-0/text-plain.window.html (#28687)
    • FAIL [expected PASS] subtest: text/plain: Basic File test (formdata event) assert_equals: expected "basic=file-test.txt\r\n" but got ""
    • PASS [expected FAIL] subtest: text/plain: \n in value (normal form)
  • OK [expected TIMEOUT] /html/semantics/links/links-created-by-a-and-area-elements/htmlanchorelement_noopener.html (#23205)
    • PASS [expected NOTRUN] subtest: Check that rel=noopener with target=_self does a normal load
    • FAIL [expected NOTRUN] subtest: Check that rel=noopener with target=_top does a normal load this.openedWindow.findLink is not a function
  • OK [expected ERROR] /html/semantics/scripting-1/the-script-element/defer-script/async-script.html?reload (#29054)
  • OK [expected TIMEOUT] /html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-entry-different-function-realm.html (#25805)
  • TIMEOUT [expected OK] /webmessaging/with-ports/017.html (#24486)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, about:blank Test timed out
  • TIMEOUT [expected OK] /webmessaging/without-ports/018.html (#24485)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, javascript: Test timed out

@bors-servo
Copy link
Contributor

☀️ Test successful - checks-github
Approved by: mrobinson
Pushing c67d760 to master...

@bors-servo bors-servo merged commit c67d760 into servo:master May 8, 2023
12 checks passed
@ohno418 ohno418 deleted the update-url-constructor-steps branch May 8, 2023 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants