IHtmlFormElement.GetSubmission returns a GET DocumentRequest despite

Bug Report
Prerequisites

[ ] Can you reproduce the problem in a MWE?

[x] Are you running the latest version of AngleSharp?

AngleSharp 0.11.0
AngleSharp.Io 0.10.1

[ ] Did you check the FAQs to see if that helps you?

No. No link to an FAQ is provided in the GitHub project root or readme.
Googling for "anglesharp faq" returns third-party webpages with outdated information (e.g. from 2015 and 2016). AngleSharp changed its API design significantly in recent years rendering most existing documentation obsolete.

[x] Are you reporting to the correct repository? (there are multiple AngleSharp libraries, e.g., AngleSharp.Css for CSS support)

Yes, I believe so

[x] Did you perform a search in the issues?

Yes. I searched for variations of "form GetSubmission", "DocumentRequest GetSubmission" and "form wrong method".

For more information, see the CONTRIBUTING guide.
Description

This is inside an XUnit test for an ASP.NET Core 2.2 web-application.

I'm loading a HTML form with content like this (simplified for brevity

  	Company name
  	<input autocomplete="organization" placeholder="Amazing Company LLC" type="text" id="TenantName" name="TenantName" value="" />

  	Your name
  	<input autocomplete="name" placeholder="John Smith" type="text" id="DisplayName" name="DisplayName" value="" />

The document is requested and loaded like so:
  	IBrowsingContext ctx = BrowsingContext.New();
  	using( HttpClient client = this.factory.CreateClient() )
  	using( HttpResponseMessage getResponse = await client.GetAsync( "/register" ) )
  	using( Stream getResponseStream = await getResponse.Content.ReadAsStreamAsync() )
  	{
  		// Assert:

  		getResponse.EnsureSuccessStatusCode(); // Status Code 200-299
  		Assert.Equal( "text/html; charset=utf-8", getResponse.Content.Headers.ContentType.ToString() );

  		HtmlParser htmlParser = new HtmlParser();
  		IHtmlDocument html = await htmlParser.ParseDocumentAsync( getResponseStream );

  		IHtmlFormElement registrationForm = html.Forms.Single();

  		////////////

  		Dictionary<String,String> sampleValues = new Dictionary<String,String>()
  		{
  			{ nameof(RegistrationViewModel.TenantName), "New Test Tenant" },
  			{ nameof(RegistrationViewModel.DisplayName), "New Test User" },
                                  // etc...
                          } // dict

                          using( HttpResponseMessage postResponse = await client.SendFormAsync( form: registrationForm, submitButton: submitButton, formValues: sampleValues ) )
  		{
  			postResponse.EnsureSuccessStatusCode();
                          }
                  } // using

The SendFormAsync extension method is defined like so:
  public static Task<HttpResponseMessage> SendFormAsync
  (
  	this HttpClient client,
  	IHtmlFormElement form,
  	IHtmlElement submitButton,
  	IEnumerable<KeyValuePair<String,String>> formValues
  )
  {
  	foreach( KeyValuePair<String,String> kvp in formValues )
  	{
  		IElement elementForFormName = form[ kvp.Key ];
  		if( elementForFormName is IHtmlInputElement inputElement )
  		{
  			IHtmlInputElement element = Assert.IsAssignableFrom<IHtmlInputElement>( inputElement );
  			element.Value = kvp.Value;
  		}
  		else if( elementForFormName is IHtmlTextAreaElement textAreaElement )
  		{
  			IHtmlTextAreaElement element = Assert.IsAssignableFrom<IHtmlTextAreaElement>( textAreaElement );
  			element.Value = kvp.Value;
  		}
  		else if( elementForFormName is IHtmlButtonElement buttonElement )
  		{
  			IHtmlButtonElement element = Assert.IsAssignableFrom<IHtmlButtonElement>( buttonElement );
  			element.Value = kvp.Value;
  		}
  		else
  		{
  			// Throw? Any element types I'm forgetting about?
  		}
  	}

  	DocumentRequest formSubmission = form.GetSubmission( submitButton );
  	Uri formTargetUri = (Uri)formSubmission.Target;

  	if( submitButton.HasAttribute( "formaction" ) )
  	{
  		String formAction = submitButton.GetAttribute("formaction");
  		Assert.True( Uri.TryCreate( formAction, UriKind.RelativeOrAbsolute, out Uri formActionUri ), userMessage: "Assert that the formaction=\"\" attribute is valid" );

  		if( formActionUri.IsAbsoluteUri )
  		{
  			formTargetUri = formActionUri;
  		}
  		else
  		{
  			formTargetUri = new Uri( baseUri: client.BaseAddress, relativeUri: formActionUri );
  		}
  	}
  	else
  	{
  		formTargetUri = new Uri( baseUri: client.BaseAddress, relativeUri: formTargetUri.PathAndQuery );
  	}

  	HttpRequestMessage submision = new HttpRequestMessage( method: new HttpMethod( formSubmission.Method.ToString().ToUpperInvariant() ), requestUri: formTargetUri )
  	{
  		Content = new StreamContent( formSubmission.Body )
  	};

  	foreach( KeyValuePair<String,String> header in formSubmission.Headers )
  	{
  		submision.Headers.TryAddWithoutValidation( header.Key, header.Value );
  		submision.Content.Headers.TryAddWithoutValidation( header.Key, header.Value );
  	}

  	return client.SendAsync( submision );
  }

Expected behavior: [What you expected to happen]
The client.SendAsync call at the bottom resulted in a GET request where all of the form fields were provided as querystring parameters with an empty HTTP request body instead of as a POST request with the form fields in the body.
I noticed that the cause is on this line:
DocumentRequest formSubmission = form.GetSubmission( submitButton );

The formSubmission object here has the wrong Method and has an empty request body and all the form fields are querystrings.
When I debug it, the IHtmlFormElement form object it has .Method = "post". The submitButton does not have any attributes (like formaction="") that would interfere with the form submission process. The form itself is submitted correctly in a desktop browser.
Why is form.GetSubmission ignoring the attributes on the <form>?

Why is form.GetSubmission ignoring the attributes on the <form>?

I don't know but I'll find out :)
On a sidenote I do not understand the SendFormAsync method - I think you could potentially be better off using a SubmitAsync extension method (there are ones that accept, e.g., an anonymous object, or a dict, or ... - from what I see they do exactly what you do / need to do - just with more edge cases in mind). I'm not sure though.

Alright so I added some tests and everything is fine in AngleSharp. I inspected your code and apparently you do not set the URL of your document (you are using the HtmlParser and not the BrowsingContext, which is advised for anything that goes beyond parsing, e.g., dynamic DOM handling) - the standard URL as per W3C spec is about:blank.
By W3C spec the form method is only considered for http and https URLs. In this case a generic backup case is performed as about is not specifically handled.
Here is just one of the tests:
var config = Configuration.Default;
var context = BrowsingContext.New(config);
var content = "<form method=post><input name=a value=foo><input name=b value=bar></form>";
var document = await context.OpenAsync(req => req.Content(content).Address("http://example.com"));
var form = document.Forms[0];
var documentRequest = form.GetSubmission();

Assert.AreEqual(HttpMethod.Post, documentRequest.Method);
Assert.AreEqual("", documentRequest.Target.Href.Substring(document.Url.Length));
Assert.AreEqual("a=foo&b=bar", GetText(documentRequest.Body));


Jbaker/fix placeholder reset

Alaska Airlines Pull Request
Resolves: #202
Type of change:
Please delete options that are not relevant.

[ ] New capability
[x] Revision of an existing capability
[ ] Infrastructure change (automation, etc.)
[ ] Other (please elaborate)

Checklist:

[x] My update follows the CONTRIBUTING guidelines of this project
[x] I have performed a self-review of my own update

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.
Thank you for your submission!
-- Auro Design System Team

Summary by Sourcery
Enhance the auro-select component to support simultaneous use of the label slot and placeholder attribute, fix a bug related to placeholder handling, and update documentation with relevant examples.
New Features:

Introduce the ability to use the label slot and placeholder attribute together in the auro-select component.

Bug Fixes:

Fix the issue where the placeholder text was incorrectly handled when the option was a string in the auro-select component.

Documentation:

Add documentation and examples for using the label slot with the placeholder attribute in the auro-select component.

:tada: This PR is included in version 2.10.8 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


Actor State TTL: Remove comment suggesting to remove feature gate in 1.12

The comment associated with the ActorStateTTL feature gate suggests to remove the gate in v1.12. This is obviously not the case so let's remove the comment. The project can decide when we do want to remove it in future.

Add a small comment that it will be removed in future release?

@mukundansundar Is this not implied for all feature gates?


Maintaining phone connections

As a user, I want to be able to have a stable connection to the car, through my device, so that I can drive the car without any glitches or interruptions.
Acceptance Criteria:

[x] The device should have a stable connection to the emulator for at least 2 whole minutes.
[x] The device will be able to send commands to the emulator.

We are done with this! It went well we have established connection!


Speed up TestDataFrameDefault test

@anmyachev , whether should this issue be closed with merged PR #1956 ?

Sure, thanks @YarShev !

part of #2008


Semantic Search for images with text in the frontend is not working properly

When searching images with text queries via semantic search,
no results are displayed.

Steps to reproduce

https://dwts.ltdemos.informatik.uni-hamburg.de/project/1/search/
Click into search bar
De-select "Text" modality
Select "Semantic" search type
Search for "Forest fires are dangerous"

this was completely reworked in #389 . We now have seperate doc, image, sentence search views. In image seach view, you can search for images with text.


Is there a reason the calendar pop-up closes when going forward then back a month with minValue set?

Discussed in https://github.com/adobe/react-spectrum/discussions/3425

Originally posted by will-stone August 22, 2022
Hi everyone,
Not sure if this is a bug or not yet, so thought I'd ask the community: is there a (accessbility) reason why the calendar pop-up closes when going back to the current month and minValue is set to today? It feels a little jarring, I would have expected the month to show but the previous month button to become disabled, as it is when opened.
https://react-spectrum.adobe.com/react-aria/useDatePicker.html#minimum-and-maximum-values
https://user-images.githubusercontent.com/654103/185946435-feeae428-d16e-404a-a6c6-2986a36d8744.mp4

bug in aria docs example, might be fixed by FocusScope PR

Still experiencing the same exact bug as described here.

I found that both FF and Chrome versions have an error in the console. It's because scope[0] at https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/focus/src/FocusScope.tsx#L453 isn't something with a parent or siblings. The getFocusableTreewalker() call on the next file is what throws the error because the first param is null. I've added code "fix" when there is no "root" and to search the scope until it finds a node that has a previous sibling and parent. The code seems happy with this, finding the "next" button as the element to focus, but this doesn't address the problem in Firefox and in Chrome the focused item is still today's date.
I also checked at the start of focusFirstInScope() in FF the document.body is focused and the activeElement is "body", while in Chrome the document. Body isn't focused and the activeElement is still "body".

Reopening.
On iPhone Safari with VO on, Popover closes when you navigate back to the minValue.

There appear to be three paths of execution in different browsers:

In Firefox, the focus is immediately set to the calendar cell.
In iOS Safari with VO, the focus remains on the disabled previous button.
In other browsers, the focus is moved away from the disabled button, but not to the document body.

Looking closely at all three of these cases the main difference is that in the iOS Safari VO case this line of code executes after the utils.js MutationObserver blur has happened, while in the other cases this code occurs before any utils.js synthetic blur code can execute.


Have you tried F1 > Developer: Inspect Tokens?

Hello guys, I don't know where else to ask, but if I want to change the color of "Other" tokens, which is in html is basically all text inside brakets, I use kind of a hack selecting it like token: "".
Maybe there is another way to do it?
Originally posted by @alexdima in https://github.com/microsoft/monaco-editor/issues/1805#issuecomment-581654990

:+1: Yes, that is the way to do it.
The default theme also does it like that https://github.com/microsoft/vscode/blob/b6f87798570cef6d99554fe10c747e9f6b02a274/src/vs/editor/standalone/common/themes.ts#L15


Added Carousel in Vanilla JS

Description
A carousel is a slideshow for cycling through series of contents. This can be used for testimonials, reviews section etc.
Fixes #58
Type of change
Please delete options that are not relevant.

[x] This change requires a documentation update

Checklist:

[x] My code follows the style guidelines(Clean Code) of this project
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[x] I have added tests/screenshots(if any) that prove my fix is effective or that my feature works

@kiruba-r11 Resolve Conflict


Modify the vle to support label inheritance

Hello, I'm Matheus and I've been assigned to this project.

Hi! I'm Marco and I'll be working on this task.

Hey, I am Hrishikesh and I have been assigned to this project

Hello, Moeed here. I'll be working on this project.

Hi, I am the new Operations Manager Jayden from Vancouver Team.

Hi, I am the new Operations Manager Steve from Vancouver Team.

Hello, I am Kalyan. Looking forward to work with you all on this project.

Hello, I'm Zahid and I'll be working on this task.

Hello, Looking Forward !!

VLE was modified and added support for label inheritance. Merged PR's are : #786 and #789


fix windows build, speedup debug binaries

Scope & Purpose
(Can you describe what functional change your PR is trying to effect?)

[x] Bug-Fix for devel-branch (i.e. no need for backports?)

Testing & Verification
This change is a trivial rework / code cleanup without any test coverage.

I am not sure if this change is responsible but a p directory is created as sibling of my build directory during the build phase.

please postpone this until 3.5 GA is ready

Works for me! I can build on windows again 👍

https://jenkins01.arangodb.biz/view/PR/job/arangodb-matrix-pr/4599/

Can you try to include this commit from 3.4?
4982ca6c3d856b74c62a95b61c90f97d3a98be7a
Fixed the issue there.

closing in favour of a completely new branch - diverged to much already.


Expose the packages installed by FixateWorld

I think it would be better to have a function that calculates the solution, and then have FixateWorld be a wrapper around that.

@kaniini we do!  This is what ResolveWorld does, which drives apko show-packages.
The "problem" is that there isn't a way of passing the same solution into FixateWorld or equivalent without futzing with the description of what we install (which we could do).

I think I may have found a way we can avoid this entirely.  Will play tonight and see!


[Persistent] Performance on 09-persistent-matmul on A100 worse than non-persistent

Describe the issue
With A100, I ran two benchmarks with the provided 09-persistent-matmul.py on https://triton-lang.org/main/getting-started/tutorials/09-persistent-matmul.html
With M=N=4K, I ran
python 09-persistent-matmul.py --prec fp16 --K_range 128 4096 --K_step 128

With M=N=8K, I ran
python 09-persistent-matmul.py --prec fp16 --K_range 256 8192 --K_step 256

I did not change anything from the script, except for M and N when running for 4K.
I have the plots below, which show that persistent matmul is only better than non-persistent in very small Ks, different from the results in the Pipelining Persistent Kernels talk.

I am expecting persistent matmul to perform better across all Ks due to the benefit of pipelining across different output tiles.
I wonder if my obvservation is expected, and if I have missed anything (e.g. should I do things like num_programs = NUM_SM * occupancy as in the softmax tutorial). Thank you!
What I've tried
My script can be found here: https://github.com/CharlieFRuan/scratch/blob/03a57252aef6681b9f135a99c0a98c94fd2584f9/triton_workspace/persitent_matmul_bench/plot.ipynb
I also checked the TTGIR and searched for async -- they all seem to be at the right places.
For the hyperparameters, I just used the provided ones in the script:
BLOCK_SIZE_M: 128, BLOCK_SIZE_N: 256, BLOCK_SIZE_K: 64, GROUP_SIZE_M: 8, num_warps: 8, num_ctas: 1, num_stages: 3, maxnreg: None

I also ran autotuning on the persistent matmul kernel with M=N=K=8192 and M=N=K=4096 with a comprehensive list of configs (shown below) -- the one provided is the best one according to the autotuner.
for block_size_m in [256, 128, 64, 32]:
    for block_size_n in [256, 128, 64, 32]:
        for block_size_k in [64, 32, 16]:
            for num_stages in [3, 4]:
                for num_warps in [4, 8]:

Environment details
Triton: main HEAD from yesterday at https://github.com/triton-lang/triton/commit/5ebd1e5a6630877e73cad547fd9495a5441c78be
GPU: A100

I did some more benchmarking on A100. I tuned both persistent and non-persistent kernel with the following search space using a MNK=(4K,4K,2K) problem, (no NUM_SMs for non-persistent):
def get_configs():
    num_sms = torch.cuda.get_device_properties("cuda").multi_processor_count
    configs = []
    for bs_m in [32, 64, 128, 256]:
        for bs_n in [64, 128, 256]:
            for bs_k in [32, 64, 128]:
                    if bs_m == 256 and bs_n == 256 and bs_k == 128:
                        continue
                    for num_stages in [3, 4, 5]:
                        for num_warps in [2, 4, 8]:
                            for num_sm_multiple in [1, 2, 3]:
                                configs.append(triton.Config({
                                    "BLOCK_SIZE_M": bs_m, "BLOCK_SIZE_N": bs_n, "BLOCK_SIZE_K": bs_k,
                                    "GROUP_SIZE_M": 1, "NUM_SMS": num_sms * num_sm_multiple
                                }, num_stages=num_stages, num_warps=num_warps))
    return configs

Persistent's best config uses 2 * the SM count (108 for A100):
{
  "BLOCK_SIZE_M": 128, "BLOCK_SIZE_N": 128, "BLOCK_SIZE_K": 64, "GROUP_SIZE_M": 8, "num_stages": 3,
  "num_warps": 4, "NUM_SMS": 216
}

However, the performance of persistent matmul is still quite bad (only better in very small Ks) (ran with the same script as https://triton-lang.org/main/getting-started/tutorials/09-persistent-matmul.html)

We were able to reproduce the fp8 example on H100, where persistent matmul indeed performs better, but not in fp16.
Therefore, my question is, why persistent matmul is not performing better despite the benefits like reduced thread block launching overhead? Should I see a performance boost other than H100 fp8? Thanks! cc @pawelszczerbuk


IGNITE-23599 Automatic reset for table partitions of HA zones

https://issues.apache.org/jira/browse/IGNITE-23599

I would expect at least 2-3 more tests: two majority lost in a row, correct behaviour of rebalances after majority lost (majority lost -> scale up, majority lost -> filter change)

I added the tests for scaleUp. But the test for filter change needs another number of nodes and it's configurations (attributes), I also prepared the infra for extending HA suites in this manner in the next PR https://github.com/apache/ignite-3/pull/4843/files#diff-0598f8c3fb6a622b56b139c6f0cdac49329b3963fe1c7057e21a0aed7bdfe0c2R54 - can I add the filter test in the next PR too. Just don't want to move this code in this PR and increase its size


Exempt govdeliver_subscribe view from csrf protection

@kave
@rosskarchner
Test
Before pulling, visit /blog/ and enter in an email to subscribe. It shouldn't respond. Looking on the access log will show that it returns a 403. Pull it down and then retry. It should succeed. Keep in mind you need the GOVDELIVERY_ACCOUNT_CODE, GOVDELIVERY_USER, and GOVDELIVERY_PASS set in the env. If you need the credentials, they're in the wsgi file on the server.

:+1:

:+1: