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 upUse the document base url when resolving form action URLs #10580
Comments
|
I would like to take this one please. |
|
Go ahead! |
|
So I need to add a .html in |
|
There should be no need for the ini if the test passes. Those files are used for annotation test results that are anything besides PASS. |
|
I don't understand what should I put in
Should I use this?
|
|
Assuming there is a function some_success_function() {
t.step_func_done();
} |
|
@mylainos Are you still working on this? Any questions? |
|
@jdm I've a problem with the target of the form. |
|
Most recent attempt to solve this in #11219, which had some comments that needed addressing in #11219 (comment). |
|
I'll take a crack at this one, please |
|
Please do! Ask questions about anything that's unclear! |
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 -->
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 -->
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 -->
According to the specification, we need to be using the base URL. This means calling
document.base_url()instead ofwindow.get_url()as the code currently does (specifically,make_url_or_base_getter, which is used for theactionandformactionattributes in elements likeHTMLFormElement).Code:
components/script/dom/macros.rsTest:
Visit this from a web server (eg.
python -m SimpleHTTPServer) with aresources/directory that contains atarget.htmlfile that isn't empty.There does not appear to be an automated test for this yet, so we'll need to write a test! It belongs in
tests/wpt/metadata/html/semantics/forms/the-form-element/. Specifically, it should have an iframe that contains a form with a base url, and the form should be submitted via JavaScript (form.submit()). The resulting page should notify the parent page that it was successful (window.parent.some_success_function()).