Commit Graph

25 Commits

Author SHA1 Message Date
Matthew Olsson
6003bcfd2d Browser: Add a missing include in InspectorWidget 2023-03-06 13:05:43 +00:00
Jonah
e361025cfb Browser: Add Accessibility Tab to Inspector Widget
This tab allows you to view the accessibility tree like you do
the DOM tree. The implementation limited to the role currently,
once we add the name and description calculation algorithm, those
will be displayed here as well. Selections are also not currently
supported.
2023-01-07 10:51:53 +00:00
MacDue
3de5dcf383 Browser+WebContent: Fixup some DOM inspector weirdness
This fixes a few things I noticed whilst working on the inspector
for Ladybird.

1.
The computed and resolved values were being passed swapped around
from the inspect_dom_node() IPC call. I.e. computed values were
passed as resolved values and vice versa. This was then fixed by
swapping them again in the InspectorWidget (two errors canceled out).

2.
Resolved values were called "specified values" seemingly only in the
inspect_dom_node() IPC calls. This was a little confusing so I've
renamed them to back to "resolved values" for consistency.

3.
The inspector took and stored the DOM JSON strings unnecessarily,
all the models immediately parse the JSON and don't need the strings
to hang around.
2022-12-19 11:37:56 -05:00
Linus Groh
57dc179b1f Everywhere: Rename to_{string => deprecated_string}() where applicable
This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.

One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
2022-12-06 08:54:33 +01:00
Linus Groh
6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00
MacDue
95e6e3be74 Browser: Fix crash if clicking on non-visible nodes in the inspector
If you attempt to inspect a non-visible dom node it will hit
various assertions as things like style have not been computed.

With this change attempting to inspect these nodes will simply
clear the style and box model tabs.
2022-07-03 20:45:11 +02:00
DexesTTP
dcbbbf5b4a LibWebView: Move OutOfProcessWebView to a new LibWebView library
Also moves WebContentClient and the references to the generated IPC
descriptions, since they are all components of OutOfProcessWebView.

This patch has no functional changes.
2022-05-15 12:17:36 +02:00
Andreas Kling
544c796bcf Browser: Rename Inspector table view member names to match contents 2022-03-15 20:00:51 +01:00
Sam Atkins
0326ad34df Browser+LibWeb+WebContent: Show style for pseudo-elements :^)
This expands the InspectorWidget::Selection to include an optional
PseudoElement, which is then passed over IPC to request style
information for it.

As noted, this has some pretty big limitations because pseudo-elements
don't have DOM nodes:
- Declared style has to be recalculated when it's requested.
- We don't display the computed style.
- We don't display custom properties.
2022-03-10 17:30:09 +01:00
Sam Atkins
2c970b9516 Browser: Replace inspector's dom_node_id with a Selection struct 2022-03-10 17:30:09 +01:00
Vrins
39a5076f40 Browser+LibWeb: Add an Element size preview widget to inspector
This Adds an element size preview widget to the inspector widget
in a new tab. This functions similar to chrome and firefox and
shows the margin, border, padding, and content size of the selected
element in the inspector.

The colors for the size preview widget are taken from the chrome
browser.
2022-03-08 22:09:52 +01:00
Lenny Maiorani
160bda7228 Applications: Use default constructors/destructors
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-02-14 22:06:55 +00:00
Sam Atkins
54bbb97ac6 Browser+LibWeb+WebContent: Add variables display to Inspector
This allows us to see which custom properties apply to a given element,
which previously wasn't shown.
2021-12-10 06:52:17 +01:00
Andreas Kling
291dbff2e1 LibWeb: Remove the unused LayoutTreeModel
If we want to bring back this functionality, we'll have to rewrite it
for multi-process mode anyway.
2021-09-18 19:54:24 +02:00
Sam Atkins
e2c32a6c65 Everywhere: Use my shiny new serenityos.org email :^) 2021-09-03 12:22:36 +02:00
Sam Atkins
724f45c784 Browser: Reload the DOM Inspector's JSON data when loading a new page
Of course, there are other reasons the DOM might change, but one thing
at a time. :^)
2021-09-02 22:16:41 +02:00
Sam Atkins
73c95bcd5f Browser: Reset the DOM Inspector's state when re-opening it
This resets the DOM Inspector to a default state when re-opening it,
instead of it displaying the previous selection and properties, which
may be outdated. This is closer to how Chrome and Firefox behave.
Eventually, it probably makes sense to copy their behavior of selecting
the `<body>` element by default.
2021-09-02 22:16:41 +02:00
Sam Atkins
97379ace25 Browser: Implement "Inspect Element" context menu action
This is finally working for OOPWV! :^)
2021-09-02 22:16:41 +02:00
Sam Atkins
1da07734bb Browser: Display style properties in DOM Inspector
This makes use of the new `inspect_dom_node()` IPC call.
2021-09-02 22:16:41 +02:00
Sam Atkins
08aa7b77a7 Browser: Remove residual InProcessWebView code from DOM Inspector
This is no longer useful, and has to go before I can change how the
Models work.
2021-09-02 22:16:41 +02:00
Sam Atkins
37f060b873 Browser: Add "Inspect Element" to context menu :^)
This opens the DOM Inspector window, with the target element already
selected. (If the window is already open, it just selects the element.)

Note that this only applies to single-process mode for now. In OOP mode,
the "inspect element" action is disabled.
2021-08-23 15:59:29 +02:00
Sam Atkins
3ef4ba810a Browser: Hide inspected-element outline when DOM Inspector is closed
...and then show it again when the inspector is re-opened. :^)
2021-08-23 15:59:29 +02:00
Adam Hodgen
1e5e02c70b LibWeb+Browser: Support DOM Inspector for OutOfProcessWebView
This introduces a new DOMTreeJSONModel, which provides the Model for the
InspectorWidget when the Browser is running using the
OutOfProcessWebView.

This Model is constructed with a JSON object received via IPC from the
WebContentServer.
2021-06-29 23:06:48 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Andreas Kling
dc28c07fa5 Applications: Move to Userland/Applications/ 2021-01-12 12:05:23 +01:00