Age | Commit message (Collapse) | Author |
|
|
|
This could be useful in more places.
|
|
Note that these aren't full implementations of the bindings. This
mostly implements the low hanging fruit (namely, basic reflections)
There are some attributes that should be USVString instead of
DOMString. However, USVString is a slightly different definition
of DOMString, so it should suffice for now.
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
Take a hint from SVG and more all the HTML classes into HTML instead of
mixing them with the DOM classes.
|
|
Also make the class_name() match the actual class name.
|
|
|
|
|
|
Adds some conversion constructors, as well as the missing arithmetic
operations.
|
|
|
|
This commit starts adding a basic SVG element. Currently, svg elements
have support for the width and height properties, as well as the stroke,
stroke-width, and fill properties. The only child element supported
is the path element, as most other graphical elements are just shorthand
for paths.
|
|
This allows you to not have to write a separate test file
for the same thing but in a different situation.
This doesn't handle when you change the page with location.href
however.
Changes the name of the page load handlers to prevent confusion
with this.
|
|
|
|
Sometimes the IDL attribute and the DOM attribute don't have the same
exact name. In those cases, we can now do this:
[Reflect=foobar] attribute DOMString fooBar;
|
|
|
|
These are reflecting attributes! :^)
|
|
You can now tag reflecting attributes with [Reflect] to generate code
that does basic DOM element attribute get/set.
(This patch also makes it easy to add more extended attributes like
that going forward.)
From the HTML spec:
"Some IDL attributes are defined to reflect a particular content
attribute. This means that on getting, the IDL attribute returns
the current value of the content attribute, and on setting,
the IDL attribute changes the value of the content attribute
to the given value."
|
|
To prepare for fully qualified tag names, let's call this local_name.
Note that we still keep an Element::tag_name() around since that's what
the JS bindings end up calling into for the Element.tagName property.
|
|
Sometimes the parsing rules say we need to insert a fake HTML token.
Let's have a convenient way of doing that!
|
|
Remove the Interpreter& argument and pass only GlobalObject&. We can
find everything we need via the global object anyway.
|
|
|
|
LibWeb currently has no test suite or program. Let's change that :^)
test-web is mostly a copy of test-js, but modified for LibWeb.
test-web imports both LibJS/Tests/test-common.js and
LibWeb/Test/test-common.js
LibWeb's suite provides the ability to specify the page to load,
what to do before the page is loaded, and what to do after it's
loaded.
This also provides a test of document.doctype and its close sibling
document.compatMode.
Currently, this isn't added to Lagom because of CodeGenerators.
|
|
btoa() takes a byte string, so it must decode the UTF-8 argument into
a Vector<u8> before calling encode_base64.
Likewise, in atob() decode_base64 returns a byte string, so that needs
to be converted to UTF-8.
With this, `btoa(String.fromCharCode(255))` is '/w==' as it should
be, and `atob(btoa(String.fromCharCode(255))) == String.fromCharCode(255)`
remains true.
|
|
That makes the interface symmetric with decode_base64 and it's
what all current callers want (except for one, which is buggy).
|
|
|
|
If we know the width, but not the height, we have to *divide* with the
intrinsic ratio to get the height (not multiply.) :^)
This makes things like <img width=300 src=image.png> work right.
|
|
Images were added before replaced element layout knew about intrinsic
sizes, so this was a bit backwards. We now instead transfer the known
intrinsic sizes from the ImageLoader to the LayoutImage.
|
|
These are HTML lengths that map to CSS width and height respectively.
|
|
Presentation attribute lengths (width, height, etc.) can always be
unit-less (e.g "400") so going via the normal CSS parsing path only
works when the document is in quirks mode.
Add a separate parse_html_length() that always allows unit-less values.
|
|
The specification says that parts labelled as a "fragment case" will
only occur when parsing a fragment. It says that if it occurs when
not parsing a fragment, then it is a specification error.
We should probably assume at this point that it's an implementation
error. This fixes a few little mistakes that were caught out by this.
Also moves the context element outside insertion mode reset,
as other (unimplemented) parts refer to it, such as
"adjusted current node".
Also cleans up insertion mode reset.
|
|
Thanks @nico for teaching me about this!
|
|
This allows us to determine which mode to render the page in.
Exposes "doctype" and "compatMode" on Document.
Exposes "name", "publicId" and "systemId" on DocumentType.
|
|
Since the vast majority of message boxes should be modal, require
the parent window to be passed in, which can be nullptr for the
rare case that they don't. By it being the first argument, the
default arguments also don't need to be explicitly stated in most
cases, and it encourages passing in a parent window handle.
Fix up several message boxes that should have been modal.
|
|
Fixes https://github.com/SerenityOS/serenity/issues/2638
Dispatching an event can change the document. Therefore another check
for the layout_root needs to be done.
|
|
|
|
|
|
Fixes https://github.com/SerenityOS/serenity/issues/2649
Loading a page with iframes could lead to a scenario, where the iframe
document finished layout prior to the main frame beeing laid out
initially. This caused a crash/assertion of the browser.
|
|
This should enable to destinguish between IFrame, Reload and Navigation
motivated loads in order to call the appropriate hooks.
This change is motivated as loading the IFrame test page causes the
IFrame url to be added to the history and shows up as the current
browser location bar.
|
|
|
|
As usual, this was just a matter of plumbing the PageClient calls from
the WebContent side over to the WebContentView side. :^)
|
|
|
|
|
|
This behaves a little weird right now, and will probably require more
coordination between the widget and the WebContent process.
|
|
|
|
This commit sets everything up, but we still always instantiate a plain
Web::PageView in Browser::Tab..
|