summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb
AgeCommit message (Collapse)Author
2020-07-27AK: Change the signature of AK::encode_base64() to use Span.asynts
2020-07-27LibCore+LibWeb: Move guess-mimetype-based-on-filename logic to LibCoreAndreas Kling
This could be useful in more places.
2020-07-27LibWeb: Add a whole bunch of HTML DOM bindingsLuke
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.
2020-07-27LibGfx: Templatize Point, Size, and RectMatthew Olsson
2020-07-26LibWeb: Move CSS classes into the Web::CSS namespaceAndreas Kling
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-07-26LibWeb: Make SVGElement and SVGGeometryElement constructors protectedAndreas Kling
2020-07-26LibWeb: Simplify type traits for SVGGraphicsElementAndreas Kling
2020-07-26LibWeb: Switch to using AK::is and AK::downcastAndreas Kling
2020-07-26LibWeb: Move HTML object model stuff into LibWeb/HTML/Andreas Kling
Take a hint from SVG and more all the HTML classes into HTML instead of mixing them with the DOM classes.
2020-07-26LibWeb: LayoutSVG should not claim to be a LayoutCanvas :^)Andreas Kling
Also make the class_name() match the actual class name.
2020-07-26LibWeb: Refactor SVG files into their own directory; follow spec layoutMatthew Olsson
2020-07-26LibWeb: Abstract common operations of graphical SVG elementsMatthew Olsson
2020-07-26LibGfx: Add FloatPoint methodsMatthew Olsson
Adds some conversion constructors, as well as the missing arithmetic operations.
2020-07-26LibWeb: Add elliptical curve support to svg path elementsMatthew Olsson
2020-07-26LibWeb: Begin SVG element supportMatthew Olsson
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.
2020-07-25test-web: Add ability to change page mid-testLuke
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.
2020-07-24LibWeb: Use [Reflect] for Element.id and Element.className :^)Andreas Kling
2020-07-24LibWeb: Allow specifying a custom attribute name for [Reflect]Andreas Kling
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;
2020-07-24LibWeb: Add HTMLElement.lang (and make HTMLElement.title reflecting)Andreas Kling
2020-07-24LibWeb: Add HTMLImageElement.src and HTMLImageElement.altAndreas Kling
These are reflecting attributes! :^)
2020-07-24LibWeb: Add code generation for reflecting IDL attributesAndreas Kling
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."
2020-07-23LibWeb: Rename Element::tag_name() => local_name()Andreas Kling
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.
2020-07-23LibWeb: Add a helper for creating a fake (start tag) HTML tokenAndreas Kling
Sometimes the parsing rules say we need to insert a fake HTML token. Let's have a convenient way of doing that!
2020-07-23LibJS: Simplify Cell::initialize()Andreas Kling
Remove the Interpreter& argument and pass only GlobalObject&. We can find everything we need via the global object anyway.
2020-07-23LibWeb: Add tests for atob() and btoa()Nico Weber
2020-07-23LibWeb+test-web: Create test-web program, add doctype testLuke
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.
2020-07-22LibWeb: Make btoa() and atob() correctly handle values between 128 and 255Nico Weber
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.
2020-07-22AK: Make encode_base64 take a ByteBuffer and return a StringNico Weber
That makes the interface symmetric with decode_base64 and it's what all current callers want (except for one, which is buggy).
2020-07-22LibJS: Add FIXMEs to a few functions that need UTF-16 handlingNico Weber
2020-07-22LibWeb: Replaced elements had backwards application of intrinsic ratioAndreas Kling
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.
2020-07-22LibWeb: Set the intrinsic width/height of <img> instead of hacking itAndreas Kling
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.
2020-07-22LibWeb: Parse "width" and "height" presentation attributes on <img>Andreas Kling
These are HTML lengths that map to CSS width and height respectively.
2020-07-22LibWeb: Add a dedicated function for parsing HTML length valuesAndreas Kling
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.
2020-07-22LibWeb: Assert we're parsing a fragment on fragment casesLuke
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.
2020-07-21LibWeb: Use "namespace Web::Foo {" since C++20 allows it :^)Andreas Kling
Thanks @nico for teaching me about this!
2020-07-21LibWeb: Implement quirks mode detectionLuke
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.
2020-07-16LibWeb: Require parent window argument for MessageBoxTom
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.
2020-07-11LibWeb: Check if layout node is still present after dispatch_eventKevin Meyer
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.
2020-07-11LibWeb: Remove some unnecessary castsKevin Meyer
2020-07-11LibWeb: Fix EVENT_DEBUG dump compilationKevin Meyer
2020-07-08LibWeb: Don't call did_layout in non-main frame documentsKevin Meyer
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.
2020-07-08LibWeb: Add type for FrameLoader::loadKevin Meyer
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.
2020-07-07LibWeb: Turn floated display:inline elements into block-level elementsAndreas Kling
2020-07-07LibWeb: Make context menus work in WebContentViewAndreas Kling
As usual, this was just a matter of plumbing the PageClient calls from the WebContent side over to the WebContentView side. :^)
2020-07-07LibWeb: Fix PageView::url() null-checkKevin Meyer
2020-07-06LibWeb: Make WebContentView show the hover hand over links :^)Andreas Kling
2020-07-06LibWeb: Don't show unnecessary scrollbars in WebContentViewAndreas Kling
This behaves a little weird right now, and will probably require more coordination between the widget and the WebContent process.
2020-07-06LibWeb: Make the WebContentView::on_load_start hook actually work :^)Andreas Kling
2020-07-06Browser+LibWeb: Pave the way for using WebContentView in BrowserAndreas Kling
This commit sets everything up, but we still always instantiate a plain Web::PageView in Browser::Tab..