summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
AgeCommit message (Collapse)Author
2021-01-25Everywhere: Debug macros instead of constexpr.asynts
This was done with the following script: find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/dbgln<debug_([a-z_]+)>/dbgln<\U\1_DEBUG>/' {} \; find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/if constexpr \(debug_([a-z0-9_]+)/if constexpr \(\U\1_DEBUG/' {} \;
2021-01-25Everywhere: Name debug macros more consistently.asynts
Personally, I prefer the naming convention DEBUG_FOO over FOO_DEBUG, but the majority of the debug macros are already named in the latter naming convention, so I just enforce consistency here. This was done with the following script: find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/DEBUG_PATH/PATH_DEBUG/' {} \;
2021-01-25Everywhere: Remove unnecessary debug comments.asynts
It would be tempting to uncomment these statements, but that won't work with the new changes. This was done with the following commands: find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec awk -i inplace '$0 !~ /\/\/#define/ { if (!toggle) { print; } else { toggle = !toggle } } ; $0 ~/\/\/#define/ { toggle = 1 }' {} \; find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec awk -i inplace '$0 !~ /\/\/ #define/ { if (!toggle) { print; } else { toggle = !toggle } } ; $0 ~/\/\/ #define/ { toggle = 1 }' {} \;
2021-01-25Everywhere: Use CMake to generate AK/Debug.h.asynts
This was done with the help of several scripts, I dump them here to easily find them later: awk '/#ifdef/ { print "#cmakedefine01 "$2 }' AK/Debug.h.in for debug_macro in $(awk '/#ifdef/ { print $2 }' AK/Debug.h.in) do find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/#ifdef '$debug_macro'/#if '$debug_macro'/' {} \; done # Remember to remove WRAPPER_GERNERATOR_DEBUG from the list. awk '/#cmake/ { print "set("$2" ON)" }' AK/Debug.h.in
2021-01-24LibWeb: Disable resource cache for file:// URLsAndreas Kling
This makes the browser a bit less annoying when testing local files, since you no longer have to restart it for changes to take effect. Longer-term we should have a proper way to decide which resources are cacheable.
2021-01-23LibWeb: Add XHREventTarget and ProgressEvent constructors to WindowLuke
2021-01-23LibWeb: Add XHREventTarget and have XHR inherit from itLuke
2021-01-23LibWeb: Flesh out existing XHR methods a bit moreLuke
This makes open, send and setRequestHeader a bit more spec compliant and adds a bunch of FIXMEs for unimplemented parts.
2021-01-23LibWeb: Remove Range constructor/prototype caches from WindowObjectAndreas Kling
These are constructed on the code generator path now instead.
2021-01-23LibWeb: Generate JS bindings for Range from IDL :^)Andreas Kling
2021-01-23LibWeb: Make WrapperGenerator consider "unsigned" part of a typeAndreas Kling
2021-01-23LibWeb: Generate JS bindings for XMLHttpRequest from IDL :^)Andreas Kling
Remove the hand-written XHR bindings in favor of generated ones.
2021-01-23LibWeb: Add very basic support for IDL constantsAndreas Kling
You can now put constants on an IDL interface and they will pop up on both the constructor and prototype objects.
2021-01-23LibWeb: Move XMLHttpRequest to separate XHR directoryAndreas Kling
In keeping with the one-directory-per-web-spec layout, let's move XHR into its own clubhouse.
2021-01-22Build: Use cmake's make_directory utility instead of env(1) and mkdir(1)Emanuele Torre
..in CMake files. Also, the `-S`s were unnecessary here since "mkdir" doesn't have any spaces and these are not shebangs.
2021-01-22Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-22Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-22Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-22Libraries: Add missing headersBen Wiederhake
A C++ source file containing just #include <LibFoo/Bar.h> should always compile cleanly. This patch adds missing header inclusions that could have caused weird error messages if they were used in a different context. Also, this confused QtCreator.
2021-01-22Meta: Get building on NixOS (#5005)Jonathan Turner
2021-01-20LibGfx: Give Bitmap a scale factorNico Weber
Gfx::Bitmap can now store its scale factor. Normally it's 1, but in high dpi mode it can be 2. If a Bitmap with a scale factor of 2 is blitted to a Painter with scale factor of 2, the pixels can be copied over without any resampling. (When blitting a Bitmap with a scale factor of 1 to a Painter with scale factor of 2, the Bitmap is painted at twice its width and height at paint time. Blitting a Bitmap with a scale factor of 2 to a Painter with scale factor 1 is not supported.) A Bitmap with scale factor of 2 reports the same width() and height() as one with scale factor 1. That's important because many places in the codebase use a bitmap's width() and height() to layout Widgets, and all widget coordinates are in logical coordinates as well, per Documentation/HighDPI.md. Bitmap grows physical_width() / physical_height() to access the actual pixel size. Update a few callers that work with pixels to call this instead. Make Painter's constructor take its scale factor from the target bitmap that's passed in, and update its various blit() methods to handle blitting a 2x bitmap to a 2x painter. This allows removing some gnarly code in Compositor. (In return, put some new gnarly code in LibGfxScaleDemo to preserve behavior there.) No intended behavior change.
2021-01-18LibWeb: Very basic support for CSS flex-directionAndreas Kling
The FFC now supports both vertical and horizontal flex layout, based on the flex-direction property. It's still extremely naive, but at least now you can be naive in two directions! :^) This implementation of flexbox is going to take a lot of work, but at least now we've gotten started.
2021-01-18LibWeb: Add Layout::Box::margin_box_height()Andreas Kling
2021-01-18LibWeb: Parse the CSS "flex-direction" propertyAndreas Kling
2021-01-18LibWeb: Add a very naive Layout::FlexFormattingContext :^)Andreas Kling
This is very dumb and only lays out its child boxes on a horizontal line with their shrink-to-fit widths. You have to start somewhere! :^)
2021-01-18LibWeb: Add Layout::Box::margin_box_width()Andreas Kling
2021-01-18LibWeb: Parse "display: flex" and create BlockBox layout nodes for themAndreas Kling
I'm not 100% sure that BlockBox is the right layout node for flex containers, but it's the most obviously fitting one we already have.
2021-01-18LibWeb: Stub out the PerformanceTiming object from Navigation TimingAndreas Kling
Just have all the timing functions return 0 for now. We can now run the Shynet JS on https://linus.dev/ although the XHR is rejected by our same-origin policy.
2021-01-18LibWeb: Add support for XMLHttpRequest request headersAndreas Kling
Implement XMLHttpRequest.setRequestHeader() and include the headers in the outgoing HTTP request.
2021-01-18LibWeb: Make the Window object "inherit" from EventTarget :^)Andreas Kling
Since Web::Bindings::WindowObject inherits from JS::GlobalObject, it cannot also inherit from Web::Bindings::EventTargetWrapper. However, that's not actually necessary. Instead, we simply set the Window object's prototype to the EventTargetPrototype, and add a little extra branch in the impl_from() function that turns the JS "this" value into a DOM::EventTarget*. With this, you can now call window.addEventListener()! Very cool :^) Fixes #4758.
2021-01-18LibWeb: Move IDL attributes and functions to the prototypeAndreas Kling
Instead of each IDL interface wrapper having its own set of all the attributes and functions, they are moved to the prototype. This matches what we already do in LibJS. Also, this should be spec compliant with the web as well, though there may be *some* content out there that expects some things to be directly on the wrapper since that's how things used to work in major browsers a long time ago. But let's just not worry about that for now. More work towards #4789
2021-01-18LibWeb: Construct the IDL interface prototype chains automaticallyAndreas Kling
Have each IDL prototype trigger the construction of its own prototype.
2021-01-18LibWeb: Actually instantiate all the web constructors/prototypesAndreas Kling
We now instantiate all the generated web API constructors and expose them on the window object. We also set the generated prototypes on instantiated wrappers. Also, we should obviously find a way to generate this code. :^)
2021-01-18LibWeb: Generate constructor and prototype classes for IDL interfacesAndreas Kling
This patch adds a FooPrototype and FooConstructor class for each IDL interface we generate JS bindings for. These classes are very primitive and don't do everything they should yet, but we have to start somewhere. :^) Work towards #4789
2021-01-18LibWeb: Move HTML::SubmitEvent functions out of lineAndreas Kling
2021-01-17LibWeb: Add fast_is<T>() for some DOM and layout node subclassesAndreas Kling
The generic is<T>() uses dynamic_cast which is fine in the majority of cases, but when one of them shows up in profiles, we can make it faster by answering the is-a question manually.
2021-01-17Everywhere: Remove more <AK/SharedBuffer.h> includesAndreas Kling
2021-01-16LibWeb+WebContent: Use anonymous files for OOPWV backing storesAndreas Kling
To support this, the GUI process and the WebContent service will now coordinate their backing store bitmaps. Each backing store can be referred to by a serial ID, and we don't need to keep resending it as a file descriptor. We should probably do something similar in WindowServer. :^)
2021-01-16WindowServer+LibGUI: Pass the system theme using Core::AnonymousBufferAndreas Kling
This was the last remaining user of shbufs in WindowServer, and so WindowServer no longer pledges "shared_buffer" :^)
2021-01-16Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-16Everywhere: Remove a bunch of <AK/SharedBuffer.h> includesAndreas Kling
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling