summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp
AgeCommit message (Collapse)Author
2023-04-07LibWeb: Port {Mouse,UI,Wheel,}Event to new StringKenneth Myhra
This ports MouseEvent, UIEvent, WheelEvent, and Event to new String. They all had a dependency to T::create() in WebDriverConnection::fire_an_event() and therefore had to be ported in the same commit.
2023-04-06LibWeb: Port {HTML,UIEvents,XHR}::EventNames to new StringKenneth Myhra
2023-03-19LibWeb: Stub out a few form validation and selection methodsElisée Maurer
2023-03-10Everywhere: Rename equals_ignoring_case => equals_ignoring_ascii_caseAndreas Kling
Let's make it clear that these functions deal with ASCII case only.
2023-03-08LibWeb: Do not discard String returned from url_encode() to avoid UAFKenneth Myhra
This caused UAF since the string returned from url_encode() was immediately discarded. Co-authored-by: Luke Wilde <lukew@serenityos.org>
2023-03-05LibWeb: Port SubmitEvent to new StringKenneth Myhra
2023-03-01LibWeb: Port URL and URLSearchParams to new StringKenneth Myhra
2023-02-18LibWeb: Make factory method of HTML::SubmitEvent fallibleKenneth Myhra
2023-02-18LibWeb: Make factory method of DOM::HTMLCollection fallibleKenneth Myhra
2023-02-18LibWeb: Make factory methods of DOM::Event fallibleKenneth Myhra
Because of interdependencies between DOM::Event and UIEvents::MouseEvent to template function fire_an_event() in WebDriverConnection.cpp, the commit: 'LibWeb: Make factory methods of UIEvents::MouseEvent fallible' have been squashed into this commit.
2023-02-12LibWeb: Implement HTMLFormElement::get_submittable_elements()Kenneth Myhra
This implements a convenience method on HTMLFormElement to retrieve a list in tree order of submittable elements associated with the form element.
2023-01-29LibJS+Everywhere: Allow Cell::initialize overrides to throw OOM errorsTimothy Flynn
Note that as of this commit, there aren't any such throwers, and the call site in Heap::allocate will drop exceptions on the floor. This commit only serves to change the declaration of the overrides, make sure they return an empty value, and to propagate OOM errors frm their base initialize invocations.
2023-01-10LibWeb: Move setting of Web object prototypes to initialize()Timothy Flynn
This needs to happen before prototype/constructor intitialization can be made lazy. Otherwise, GC could run during the C++ constructor and try to collect the object currently being created.
2023-01-03LibWeb: Implement HTMLFormElement::resetSrikavin Ramkumar
This patch sets up the necessary infrastructure for implementing reset algorithms for form-associated controls.
2022-12-06Everywhere: Rename to_{string => deprecated_string}() where applicableLinus Groh
This will make it easier to support both string types at the same time while we convert code, and tracking down remaining uses. One big exception is Value::to_string() in LibJS, where the name is dictated by the ToString AO.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-11-25LibWeb: Implement [SameObject] behavior for HTMLFormElement.elementsAndreas Kling
2022-10-16LibWeb: Let LoadRequest::set_body() take by valueKenneth Myhra
This changes the signature of LoadRequest::set_body() to take by value and then use move semantics to move the contents of the ByteBuffer. This is done to avoid the fallible copy constructor of ByteBuffer.
2022-10-01LibWeb: Remove unecessary dependence on Window from HTML classesAndrew Kaster
These classes only needed Window to get at its realm. Pass a realm directly to construct HTML classes.
2022-09-29AK+Everywhere: Replace "protocol" with "scheme" url helpersnetworkException
URL had properly named replacements for protocol(), set_protocol() and create_with_file_protocol() already. This patch removes these function and updates all call sites to use the functions named according to the specification. See https://url.spec.whatwg.org/#concept-url-scheme
2022-09-06LibWeb: Use cached_web_prototype() as much as possibleAndreas Kling
Unlike ensure_web_prototype<T>(), the cached version doesn't require the prototype type to be fully formed, so we can use it without including the FooPrototype.h header. It's also a bit less verbose. :^)
2022-09-06LibWeb: Make HTMLCollection and subclasses GC-allocatedAndreas Kling
2022-09-06LibWeb+LibJS: Make the EventTarget hierarchy (incl. DOM) GC-allocatedAndreas Kling
This is a monster patch that turns all EventTargets into GC-allocated PlatformObjects. Their C++ wrapper classes are removed, and the LibJS garbage collector is now responsible for their lifetimes. There's a fair amount of hacks and band-aids in this patch, and we'll have a lot of cleanup to do after this.
2022-09-06LibWeb: Make DOM::Event and all its subclasses GC-allocatedAndreas Kling
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
2022-03-17Libraries: Use default constructors/destructors in LibWebLenny Maiorani
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."
2022-03-03LibWeb: Include cookies in form submissionLuke Wilde
Services expect cookies to be submitted with forms, especially login screens. Allows us to sign in to GitHub (including two factor authentication) and start using it!
2022-02-26LibWeb: Fix LibWeb build with ClangAndreas Kling
Clang doesn't like unused lambda captures.
2022-02-25LibWeb: Support HTMLFormElement.elements and HTMLFormElement.lengthAndreas Kling
Note that we implement .elements as a HTMLCollection for now, instead of the correct HTMLFormControlsCollection subclass. This covers most use-cases already. 1% progression on ACID3. :^)
2022-02-19LibWeb: Move QualifiedName into the Web::DOM namespaceAndreas Kling
2022-02-19LibWeb: Return current document URL if form action missing or emptyAdam Plumb
2022-02-09LibWeb: Do not set Content-Length headers twice for POST requestsBrian Gianforcaro
While trying to get http://lite.duckduckgo.com to work in the Browser I noticed that we kept on getting 400 (Bad Request) errors when you click the "Search" button for a request. After turning on `JOB_DEBUG` to see what headers we were sending it turned out that we were actually setting `Content-Length` twice once in LibWeb, and again when the request is handled by LibHTTP. Since LibHTTP transparently handles this now, we can avoid it in LibWeb.
2021-11-18LibWeb: Move BrowsingContext into HTML/Andreas Kling
Browsing contexts are defined by the HTML specification, so let's move them into the HTML directory. :^)
2021-10-01LibWeb: Add the missing SubmitEvent IDL constructorIdan Horowitz
This commit also removes the SubmitEvent.cpp file, as all of the method implementations were trivial and could be inlined into the header file.
2021-09-13LibWeb: Add the Web::URL namespace and move URLEncoder to itIdan Horowitz
This namespace will be used for all interfaces defined in the URL specification, like URL and URLSearchParams. This has the unfortunate side-effect of requiring us to use the fully qualified AK::URL name whenever we want to refer to the AK class, so this commit also fixes all such references.
2021-09-09LibWeb: Rename Document::complete_url() => parse_url()Andreas Kling
This better matches the spec nomenclature.
2021-08-24LibWeb+Browser: Remove unnecessary InProcessWebView.h includesAndreas Kling
2021-08-12LibWeb: Remove pointless type castsDaniel Bertalan
In these cases, the parameters' static type matched the desired dynamic type, so these calls were discarded.
2021-06-24AK: Rename downcast<T> => verify_cast<T>Andreas Kling
This makes it much clearer what this cast actually does: it will VERIFY that the thing we're casting is a T (using is<T>()).
2021-06-01LibWeb: Use correct percent encode set for form submissionsLuke
We currently only support application/x-www-form-urlencoded for form submissions, which uses a special percent encode set when percent encoding the body/query. However, we were not using this percent encode set. With the new URL implementation, we can now specify the percent encode set to be used, allowing us to use this special percent encode set. This is one of the fixes needed to make the Google cookie consent work.
2021-05-30LibWeb: Rename Web::Frame to Web::BrowsingContextAndreas Kling
Our "frame" concept very closely matches what the web specs call a "browsing context", so let's rename it to that. :^) The "main frame" becomes the "top-level browsing context", and "sub-frames" are now "nested browsing contexts".
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-20LibWeb: Register FormAssociatedElement with their owner formAndreas Kling
This will eventually allow us to implement HTMLFormControlsCollection.
2021-04-06LibWeb: Rename "for_each_in_subtree(_of_type)" to ↵Luke
"for_each_in_inclusive_subtree(_of_type)" This is because it includes the initial node that the function was called on, which makes it "inclusive" as according to the spec. This is important as there are non-inclusive variants, particularly used in the node mutation algorithms.
2021-02-07LibWeb: Use move semantics for QualifiedName more oftenAndreas Kling
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling