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

Form action url 11219 #13358

Merged
merged 1 commit into from Sep 28, 2016
Merged

Form action url 11219 #13358

merged 1 commit into from Sep 28, 2016

Conversation

@ducks
Copy link
Contributor

ducks commented Sep 21, 2016

First pass at fixing #10580.
I've added a new macro that returns a DomString with either the attr val or the doc url.
I then made the form element use that macro on the action attribute.
I also added a test that contains an iframe with a form and base url that submits to a page in
a resources directory.

I made all these changes based on #11219 (comment).

The only thing I'm confused on is how to change step 8. It looks to just be getting the action so I'm wondering if I need to change either step 9 or 10 instead?


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #10580 (github issue number if applicable).
  • There are tests for these changes OR

using that macro with the form action,
making the form submit process use base url,
adding tests.


This change is Reviewable

@highfive
Copy link

highfive commented Sep 21, 2016

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @mbrubeck (or someone else) soon.

@highfive
Copy link

highfive commented Sep 21, 2016

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/htmlformelement.rs, components/script/dom/macros.rs
Copy link
Contributor

mbrubeck left a comment

This looks good, thanks! Just a few minor changes are needed.

@@ -124,6 +124,26 @@ macro_rules! make_url_or_base_getter(
);

#[macro_export]
macro_rules! make_string_or_document_url(

This comment has been minimized.

@mbrubeck

mbrubeck Sep 21, 2016

Contributor

I think the macro name should be expanded to make_string_or_document_url_getter!.

@@ -0,0 +1,9 @@
<!doctype html>

This comment has been minimized.

@mbrubeck

mbrubeck Sep 21, 2016

Contributor

This test should be added to the manifest. You can use this command to do so:

./mach test-wpt --manifest-update tests/wpt/web-platform-tests/html/semantics/forms/the-form-element/form-action-url.html
<script src="/resources/testharnessreport.js"></script>
<script>
var t = async_test("Submit a form from an iframe with a base url");
var success = t.step_func_done();

This comment has been minimized.

@mbrubeck

mbrubeck Sep 21, 2016

Contributor

I think this should be something like var success = function() { t.step_func_done(); };. Currently it calls step_func_done immediately, causing the test to always succeed.

This comment has been minimized.

@Ms2ger

Ms2ger Sep 23, 2016

Contributor

This is not true; step_func_done already returns a function (hence func).

@@ -0,0 +1,13 @@
<!doctype html>
<base href="resources/"></base>

This comment has been minimized.

@mbrubeck

mbrubeck Sep 21, 2016

Contributor

This file should be inside the resources directory itself (otherwise the test harness will think that it is a test). You could move the "target.html" file a subdirectory of resources and use that as the new base URL.

<!doctype html>
<base href="resources/"></base>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

This comment has been minimized.

@jdm

jdm Sep 21, 2016

Member

These scripts don't appear to be necessary in this file.

@ducks
Copy link
Contributor Author

ducks commented Sep 22, 2016

Thanks for the feedback. I made the changes to reflect but the test seems to just time out now.

@jdm
Copy link
Member

jdm commented Sep 23, 2016

@rjgoldsborough The problem is the t.step_func_done(). You want t.done() instead; then the test will complete.

@mbrubeck
Copy link
Contributor

mbrubeck commented Sep 23, 2016

Sorry about that! I was seeing the test succeed even in a build without the fix, but I mis-diagnosed the cause...

@ducks ducks force-pushed the ducks:form-action-url-11219 branch from 5b88169 to 22a05f4 Sep 23, 2016
@ducks
Copy link
Contributor Author

ducks commented Sep 23, 2016

Heh. np :)

Fixed the test and now it passes.
I see one of the checks failed on windows because of missing mach.
I'm not sure if there is anything I can do about that?

@jdm
Copy link
Member

jdm commented Sep 23, 2016

That's #13340.

@bors-servo
Copy link
Contributor

bors-servo commented Sep 26, 2016

The latest upstream changes (presumably #13426) made this pull request unmergeable. Please resolve the merge conflicts.

@mbrubeck
Copy link
Contributor

mbrubeck commented Sep 26, 2016

Looks great, thanks! Please squash and rebase, and then this can land with r=mbrubeck.

@ducks
Copy link
Contributor Author

ducks commented Sep 26, 2016

Sweet! I was just working on the rebase now and I can squash them all down as well. Thanks.

@ducks ducks force-pushed the ducks:form-action-url-11219 branch from 22a05f4 to 7420ff3 Sep 26, 2016
@jdm
Copy link
Member

jdm commented Sep 26, 2016

@bors-servo: r=mbrubeck

@bors-servo
Copy link
Contributor

bors-servo commented Sep 26, 2016

📌 Commit 7420ff3 has been approved by mbrubeck

@jdm
Copy link
Member

jdm commented Sep 26, 2016

I think the manifest timeouts may be caused by an incorrect rebase of MANIFEST.json. @rjgoldsborough What if you run ./mach update-manifest and push the result?

@ducks
Copy link
Contributor Author

ducks commented Sep 26, 2016

@jdm, think you nailed it.

https://gist.github.com/rjgoldsborough/b62e2b09545533575f48a3cb3634f3e7

I noticed a lot change in the manifest when rebasing but I guessed those were just from the master changes.

@ducks
Copy link
Contributor Author

ducks commented Sep 27, 2016

Should I try redoing this PR/fix the rebase?

@jdm
Copy link
Member

jdm commented Sep 27, 2016

@rjgoldsborough I would just overwrite the contents of the manifest with the version from master, then run ./mach update-manifest to fix it.

@ducks
Copy link
Contributor Author

ducks commented Sep 27, 2016

yeah, I should have rebased first, :(

@ducks ducks force-pushed the ducks:form-action-url-11219 branch from 8323672 to b5c1e5f Sep 27, 2016
@jdm
Copy link
Member

jdm commented Sep 27, 2016

Yep. Rebase and squash the commits into one, and this will be fine to merge.

using that macro with the form action,
making the form submit process use base url,
adding tests.
@ducks ducks force-pushed the ducks:form-action-url-11219 branch from b5c1e5f to ce249d9 Sep 27, 2016
@KiChjang
Copy link
Member

KiChjang commented Sep 27, 2016

@bors-servo r=mbrubeck

@bors-servo
Copy link
Contributor

bors-servo commented Sep 27, 2016

📌 Commit ce249d9 has been approved by mbrubeck

@bors-servo
Copy link
Contributor

bors-servo commented Sep 27, 2016

Testing commit ce249d9 with merge 040075a...

bors-servo added a commit that referenced this pull request Sep 27, 2016
Form action url 11219

First pass at fixing #10580.
I've added a new macro that returns a DomString with either the attr val or the doc url.
I then made the form element use that macro on the action attribute.
I also added a test that contains an iframe with a form and base url that submits to a page in
a resources directory.

I made all these changes based on #11219 (comment).

The only thing I'm confused on is how to change step 8. It looks to just be getting the action so I'm wondering if I need to change either step 9 or 10 instead?

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #10580 (github issue number if applicable).

- [X] There are tests for these changes OR

using that macro with the form action,
making the form submit process use base url,
adding tests.

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

bors-servo commented Sep 27, 2016

💔 Test failed - mac-rel-wpt

@KiChjang
Copy link
Member

KiChjang commented Sep 27, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Sep 28, 2016

Previous build results for arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, windows-dev are reusable. Rebuilding only mac-rel-wpt...

@bors-servo
Copy link
Contributor

bors-servo commented Sep 28, 2016

@bors-servo bors-servo merged commit ce249d9 into servo:master Sep 28, 2016
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

7 participants
You can’t perform that action at this time.