summaryrefslogtreecommitdiff
path: root/Userland/Services/WebContent
AgeCommit message (Collapse)Author
2022-11-09Browser+LibWebView+WebContent: Add IPC to minimize and maximize windowTimothy Flynn
Requests to maximize and minimize Browser windows will be coming from the WebContent process rather than the WebDriver process. Add hooks to propagate these requests back up to the Browser.
2022-11-09Browser+WebContent+WebDriver: Move Get/Set Window Rect to WebContentTimothy Flynn
This also lets us more fully implement the "restore the window" method, which requires we block until the document reaches the "visible" state.
2022-11-09Browser+LibWebView+WebContent: Add IPC to re[store,size,position] windowTimothy Flynn
Requests to restore, resize, and reposition Browser windows will be coming from the WebContent process rather than the WebDriver process. Add hooks to propagate these requests back up to the Browser. The spec notes "The specification does not guarantee that the resulting window size will exactly match that which was requested", so these new methods return the actual new size/position.
2022-11-09Everywhere: Fix a few comment typosNico Weber
2022-11-09WebContent: Remove the DRIVER_TRY macro now that it is no longer neededTimothy Flynn
We can now invoke TRY directly, and don't need to wrap single-value return statements with braces.
2022-11-08WebContent+WebDriver: Fully implement closing a sessionTimothy Flynn
There were a couple steps missing to close the remote end. Further, we were not removing the session from the list of active sessions.
2022-11-08WebContent+WebDriver: Move the Get Current URL command to WebContentTimothy Flynn
2022-11-08WebContent+WebDriver: Move the Navigate To command to WebContentTimothy Flynn
2022-11-08WebContent+WebDriver: Set the navigator.webdriver flag from WebDriverTimothy Flynn
This moves setting the navigator.webdriver flag from after WebContent creates the WebDriver connection, to its own IPC to be triggered from WebDriver. This is closer to the spec, but mostly serves as an easy test to validate the connection.
2022-11-08WebContent: Add a very-empty WebDriver IPC class to WebContentTimothy Flynn
This just sets up the infrastructure for the WebContent process to house WebDriver IPCs, and adds an IPC for WebContent to create the WebDriver connection. The WebDriverConnection class inside WebContent ultimately will contain most of what is currently in WebDriver::Session (so the copyright attributions are copied here as well). The socket created by WebDriver is currently /tmp/browser_webdriver (formatted with some IDs). This will be moved to the /tmp/webdriver folder, as WebDriver will create multiple sockets to communicate with both Browser and WebContent as the IPCs are iteratively moved to WebContent. That path is unveiled here, though it is unused as of this commit.
2022-11-05WebContent: Capture horizontal overflow in full document screenshotsTimothy Flynn
The full-page screenshot was missing horizontal overflow content on most web pages. Change the dimensions of the captured screenshot to match the actual content size.
2022-11-05WebContent: Store and provide access to web page content sizeTimothy Flynn
2022-11-05LibWebView+WebContent: Add an IPC to take a full document screenshotTimothy Flynn
2022-11-05LibWebView+WebContent: Add an IPC to take an element screenshotTimothy Flynn
2022-11-05LibWebView+WebContent: Add an IPC to scroll an element into viewTimothy Flynn
Note that even though there is no response, this IPC has to be synchronous to allow all scroll events to trigger before returning to the calling WebDriver process.
2022-11-05WebContent: Abstract calculating an element's absolute rect to a helperTimothy Flynn
2022-11-03LibWebView+WebConent: Add an IPC to get an element's selected stateTimothy Flynn
2022-11-03LibWebView+WebConent: Add an IPC to get an element's enabled stateTimothy Flynn
2022-11-03LibWebView+WebConent: Add an IPC to get an element's absolute rectTimothy Flynn
2022-11-03WebContent: Add a static helper to find an element by its remote IDTimothy Flynn
Instead of repeating the same checks for each WebDriver /element endpoint, add a helper to perform the lookup.
2022-11-03LibWebView+WebContent: Add IPC to run the fragment serialization stepsTimothy Flynn
2022-11-02LibWeb+WebContent: Add WebDriver infrastructure for executing scriptsLinus Groh
This cannot be done on the Browser or WebDriver ends, or via the existing run_javascript() IPC endpoint, as we cannot transfer JS objects through the IPC boundary (yet), only serialized JSON, so the individual WebDriver steps around script execution need to run in the WebContent process.
2022-11-01LibWeb+LibWebView+WebContent: Add IPC to receive window position/sizeTimothy Flynn
This information will have to come from the Browser application. This adds IPCs to receive that information when it is available or changes.
2022-11-01Everywhere: Mark dependencies of most targets as PRIVATETim Schumacher
Otherwise, we end up propagating those dependencies into targets that link against that library, which creates unnecessary link-time dependencies. Also included are changes to readd now missing dependencies to tools that actually need them.
2022-11-01WebContent+Friends: Add get_element_text IPC and plumbingmartinfalisse
2022-10-25Services: Use new global variables at /sys/kernel/ directoryLiav A
2022-10-23LibWeb: Add button property in MouseEventAliaksandr Kalenik
2022-10-22WebContent+Friends: Add get_element_tag_name IPC and plumbingTobias Christiansen
2022-10-20WebContent+Friends: Add IPC and plumbing for WebDriver endpointTobias Christiansen
To use the `GET /session/{id}/element/{id}/css/{property name}` WebDriver endpoint, two new IPC calls through the Browser are implemented: - get_active_documents_type returns the type of the active document, which is either "xml" or "html" - get_computed_value_for_element returns the computed CSS value (as String) for the given element and CSS property name
2022-10-20LibWeb: Make the layout tree GC-allocatedAndreas Kling
This removes a set of complex reference cycles between DOM, layout tree and browsing context. It also makes lifetimes much easier to reason about, as the DOM and layout trees are now free to keep each other alive.
2022-10-19WebContent+Friends: Add get_element_property IPC and plumbingTobias Christiansen
2022-10-19WebContent+Friends: Add get_element_attribute IPC and plumbingTobias Christiansen
2022-10-19WebContent: Fix broken Optional<> returns through IPCTobias Christiansen
Apparently one can not use the brace-initializer to return an empty Optional through IPC, it has to be explicitly constructed.
2022-10-18WebContent: Add more IPC endpoints for getting ElementsTobias Christiansen
This patch adds `get_document_element()` and `query_selector_all()` which return Node's IDs. `get_document_element` returns the ID of the document element `query_selector_all` returns the IDs of all elements matching the selector starting at the Node associated with the start_node_id
2022-10-15WebContent+LibWeb+LibJS: Report exceptions to the JS consolePavel
Print exceptions passed to `HTML::report_exception` in the JS console Refactored `ExceptionReporter`: in order to report exception now you need to pass the relevant realm in it. For passed `JS::Value` we now create `JS::Error` object to print value as the error message.
2022-10-13LibWeb+WebContent: Add plumbing for 'webdriver-active flag'Linus Groh
2022-10-12Userland: Properly populate GENERATED_SOURCESAli Mohammad Pur
We previously put the generated headers in SOURCES, which did not mark them as GENERATED (and did not produce a proper dependency). This commit moves all generated headers into GENERATED_SOURCES, and removes useless header SOURCES.
2022-10-08LibWeb+WebContent: Add EventLoopPlugin::quit() virtualAndreas Kling
This allows you to customize breaking out of the system event loop.
2022-10-06WebContent: Don't pthread_setname_np() non-SerenityOS platformsAndreas Kling
2022-10-06WebContent: Use Web::Platform::Timer instead of Core::TimerAndreas Kling
This will allow WebContent to operate without a Core::EventLoop.
2022-10-06WebContent: Add ConnectionFromClient::fd() accessorAndreas Kling
2022-10-03Userland: Tighten promises by removing 'proc' where it isn't usedTimothy Flynn
This is a partial revert of commit 7af5eef. After 97d15e9, the 'proc' promise is not needed for operations using getsid(). This also fixes launching several applications in which 7af5eef added the 'proc' promise only in the second call to pledge().
2022-10-03SystemServer+LoginServer+Userland: Switch to sid-based socketsPeter Elliott
This commit does three things atomically: - switch over Core::Account+SystemServer+LoginServer to sid based socket names. - change socket names with %uid to %sid. - add/update necessary pledges and unveils. Userland: Switch over servers to sid based sockets Userland: Properly pledge and unveil for sid based sockets
2022-10-01LibWeb: Move Web prototypes and constructors to new Intrinsics objectAndrew Kaster
This Intrinsics object hangs off of a new HostDefined struct that takes the place of EnvironmentSettingsObject as the true [[HostDefined]] slot on JS::Realm objects created by LibWeb. This gets the intrinsics off of the GlobalObject, Window, similar to the previous refactor of LibJS to move the intrinsics into the Realm's [[Intrinics]] internal slot. A side effect of this change is that we cannot fully initialize a Window object until the [[HostDefined]] slot has been installed into the realm, which happens with the creation of the WindowEnvironmentSettingsObject. As such, any Window usage that has not been funned through a WindowESO will not have any cached Web prototyped or constructors, and will not have Window APIs available to javascript code. Currently this seems limited to usage of Window in the CSS parser, but a subsequent commit will clean those up to take Realm as well. However, this commit compiles so let's cut it off here :^).
2022-09-21LibWeb: Remove no-op impl() methods from the WEB_PLATFORM_OBJECT macroLinus Groh
These are leftovers from when wrapper objects still had an internal implementation, which is no longer the case.
2022-09-21LibWeb+WebContent: Move Serenity EventLoop and Font plugins into LibWebSam Atkins
These are exactly what's wanted by headless-browser too, so this saves us some duplication. LibWeb already links LibCore so it should not cause any issues for Ladybird.
2022-09-21Browser+WebContent+LibJS: Support `%c` specifiers in Console.log()Sam Atkins
...and the other Console methods. This lets you apply styling to a log message or any other text that passes through the Console `Formatter` operation. We store the CSS on the ConsoleClient instead of passing it along with the rest of the message, since I couldn't figure out a nice way of doing that, as Formatter has to return JS::Values. This way isn't nice, and has a risk of forgetting to clear the style and having it apply to subsequent messages, but it works. This is only supported in the Browser for now. REPL support would require parsing the CSS and figuring out the relevant ANSI codes. We also don't filter this styling at all, so you can `position: absolute` and `transform: translate(...)` all you want, which is less than ideal.
2022-09-21LibWeb+WebContent: Setup the js console client earlierdavidot
This allows us to print messages in inline scripts. Also add an example of this in the welcome page to test this.
2022-09-20LibWeb+WebContent+Browser: Plumb visibility state from GUI to web pagesAndreas Kling
OOPWV now reacts to show/hide events and informs LibWeb about the state change. This makes visibilitychange events fire when switching tabs. :^)
2022-09-17LibWeb: Get default fonts via Platform::FontPluginAndreas Kling
Instead of asking Gfx::FontDatabase for the "default font" and the "default fixed-width font", we now proxy those requests out via the Platform::FontPlugin. This will allow Ladybird to use other default fonts as fallback.