Age | Commit message (Collapse) | Author |
|
This is a continuation of the previous two commits.
As allocating a JS cell already primarily involves a realm instead of a
global object, and we'll need to pass one to the allocate() function
itself eventually (it's bridged via the global object right now), the
create() functions need to receive a realm as well.
The plan is for this to be the highest-level function that actually
receives a realm and passes it around, AOs on an even higher level will
use the "current realm" concept via VM::current_realm() as that's what
the spec assumes; passing around realms (or global objects, for that
matter) on higher AO levels is pointless and unlike for allocating
individual objects, which may happen outside of regular JS execution, we
don't need control over the specific realm that is being used there.
|
|
|
|
|
|
|
|
|
|
|
|
Again, this is an entirely virtual class since the methods involve
direct access to the Painter. Though, maybe I could just expose the
Painter...
|
|
This one requires drawing to the canvas, so it doesn't make so much
sense to move the implementation over.
|
|
|
|
|
|
The implementation of this got a little funky, because it has to access
methods from CanvasState.
|
|
As with CanvasPath, this is to better match the spec IDL.
|
|
|
|
|
|
This better matches the spec, and makes it possible for things like
Path2D to reuse the same implementation without duplicate code. :^)
|
|
|
|
The changes from 8a03b17 to allow any JS::Value aren't a good fit, as
shown by the excessive amount of verify_cast needed :^)
|
|
|
|
This patch implements the "create a new browsing context" function from
the HTML spec and replaces our existing logic with it.
The big difference is that browsing contexts now initially navigate to
"about:blank" instead of starting out in a strange "empty" state.
This makes it possible for websites to create a new iframe and start
scripting inside it right away, without having to load an URL into it.
|
|
The way we've been creating DOM::Document has been pretty far from what
the spec tells us to do, and this is a first big step towards getting us
closer to spec.
The new Document::create_and_initialize() is called by FrameLoader after
loading a "text/html" resource.
We create the JS Realm and the Window object when creating the Document
(previously, we'd do it on first access to Document::interpreter().)
The realm execution context is owned by the Environment Settings Object.
|
|
|
|
This will be used to implement the rather intricate construction order
in the HTML spec.
|
|
This should really return the WindowProxy, but since we don't have the
infrastructure set up just yet, just return the window object itself
for now.
|
|
|
|
|
|
|
|
This is a cautious first step towards being able to create JS objects
before a global object has been instantiated.
|
|
This PageClient callback was never used for anything.
|
|
|
|
|
|
`Window` itself isn't generated from an IDL file so it doesn't get to
make use of this mixin, but it ideally would do so.
|
|
|
|
Also added FIXMEs for some missing methods while I was at it.
|
|
This avoids slow RTTI lookups in selector matching.
|
|
This avoids slow RTTI lookups in Document::base_url().
|
|
This disables this system progress bar, and instead creates one
out of pseudo elements, that can be selected and styled with the
::-webkit-progress-bar/value selectors.
|
|
|
|
|
|
|
|
Origin is defined in the HTML Standard, and therefore belongs into the
HTML directory and namespace in LibWeb.
https://html.spec.whatwg.org/multipage/origin.html#origin
|
|
This prevents us from needing a sv suffix, and potentially reduces the
need to run generic code for a single character (as contains,
starts_with, ends_with etc. for a char will be just a length and
equality check).
No functional changes.
|
|
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.
|
|
This protects it from GC.
|
|
The main thing that is missing is validating certain pieces of data
against XML productions in well-formed mode, but nothing uses
well-formed mode right now.
Required by Closure Library for sanitising HTML.
https://github.com/google/closure-library/blob/e687b3d8ab014787b9f10b08b3f597b637392480/closure/goog/html/sanitizer/safedomtreeprocessor.js#L117
|
|
This patch adds the document type concept to documents and sets it in
various places.
|
|
|
|
|
|
All Scripts have an associated settings object.
https://html.spec.whatwg.org/multipage/webappapis.html#settings-object
|
|
|
|
Previously we forwarded all event handler attributes to Window from
these two elements, however, we are only supposed to forward blur,
error, focus, load, resize and scroll.
|