summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/DOM/XMLHttpRequest.cpp
AgeCommit message (Collapse)Author
2020-09-20LibWeb: Add Bindings::ScriptExecutionContextAndreas Kling
This will be inherited by documents and workers, to provide a common abstraction for script execution. (We don't have workers yet, but we might as well make this little space for them now to simplify things down the road.)
2020-09-06LibWeb: Move DOM event dispatch to its own classAndreas Kling
For now, the new DOM::EventDispatcher is very simple, it just iterates over the set of listeners on an EventTarget and invokes the callbacks as it goes. This simplifies EventTarget subclasses since they no longer have to implement the callback mechanism themselves.
2020-08-26LibJS: Add a helper for calling JS::Function's with argumentsAnotherTest
The fact that a `MarkedValueList` had to be created was just annoying, so here's an alternative. This patchset also removes some (now) unneeded MarkedValueList.h includes.
2020-08-14LibJS+LibWeb: Clear exceptions after call'ing JavaScript functionsAndreas Kling
Decorated Interpreter::call() with [[nodiscard]] to provoke thinking about the returned value at each call site. This is definitely not perfect and we should really start thinking about slimming down the public-facing LibJS interpreter API. Fixes #3136.
2020-07-26LibWeb: Move DOM classes into the Web::DOM namespaceAndreas Kling
LibWeb keeps growing and the Web namespace is filling up fast. Let's put DOM stuff into Web::DOM, just like we already started doing with SVG stuff in Web::SVG.
2020-06-23LibWeb: Make wrapper factory functions take JS::GlobalObject&Andreas Kling
Instead of taking the JS::Heap&. This allows us to get rid of some calls to JS::Interpreter::global_object(). We're getting closer and closer to multiple global objects. :^)
2020-06-21LibWeb: Generate Event and MouseEvent bindings from IDL :^)Andreas Kling
We still have to hand-write a function to turn an Event& into a wrapper but this is still a hue improvement. Eventually we'll find a way to auto-generate that function as well.
2020-06-01LibWeb: Move ResourceLoader into a new Loader/ directoryAndreas Kling
2020-05-03ProtocolServer: Pass HTTP response headers to the clientAndreas Kling
We now store the response headers in a download object on the protocol server side and pass it to the client when finishing up a download. Response headers are passed as an IPC::Dictionary. :^)
2020-04-29LibJS: Pass JS::Function around by reference moreAndreas Kling
2020-04-29LibWeb: Make EventListener::function() return a referenceAndreas Kling
2020-04-23LibWeb: Add XMLHttpRequest.readyState and constantsLinus Groh
2020-04-19LibJS: Add MarkedValueList and use it for argument passingAndreas Kling
A MarkedValueList is basically a Vector<JS::Value> that registers with the Heap and makes sure that the stored values don't get GC'd. Before this change, we were unsafely keeping Vector<JS::Value> in some places, which is out-of-reach for the live reference finding logic since Vector puts its elements on the heap by default. We now pass all the JavaScript tests even when running with "js -g", which does a GC on every heap allocation.
2020-04-08LibWeb: Support relative URL's in XMLHttpRequestAndreas Kling
In order to complete a relative URL, we need a Document. Fix this by giving XMLHttpRequest a pointer to its window object. Then we can go from the window to the document, and then we're home free. :^)
2020-04-08LibWeb: Add XMLHttpRequest object :^)Andreas Kling
This patch adds very basic XMLHttpRequest support to LibWeb. Here's an example that currently works: var callback = function() { alert(this.responseText); } var xhr = new XMLHttpRequest(); xhr.addEventListener("load", callback); xhr.open("GET", "http://serenityos.org/~kling/test/example.txt"); xhr.send(); There are many limitations and bugs, but it's pretty dang awesome that we have XHR. :^)