You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Relaunch the application in order to use the Web Inspector
21
+
* Relaunch the application in order to use Web Inspector
22
22
23
-
## Using the Web Inspector
23
+
## Using Web Inspector
24
24
25
-
The Web Inspector can be opened by '''right clicking anywhere on a web page''' and choosing '''Inspect Element'''. Once open, it highlights the node on the page as it is selected in the hierarchy. You can also search for nodes by node name, id and CSS class name.
25
+
The most complete resource for Web Inspector is the [Web Inspector Reference](https://webkit.org/web-inspector/), and help links in Web Inspector itself can take you to help specific to the current part of the tools you are using.
26
+
27
+
Web Inspector can be opened by '''right clicking anywhere on a web page''' and choosing '''Inspect Element'''. Once open, it highlights the node on the page as it is selected in the hierarchy. You can also search for nodes by node name, id and CSS class name.
26
28
27
29
The Node pane shows the current node type and name, as well as any element attributes.
28
30
@@ -32,11 +34,11 @@ The Metrics pane provides a quick visual look at how margins, borders and paddin
32
34
33
35
Various HTML and JavaScript properties, including length of text nodes, offsetWidth/Height, class names, and parent/sibling information are vieweable in the Properties pane.
34
36
35
-
See [Safari User Guide for Web Developers](http://developer.apple.com/safari/library/documentation/AppleApplications/Conceptual/Safari_Developer_Guide/UsingtheWebInspector/UsingtheWebInspector.html) for more details on other panels of the Web Inspector.
37
+
See [Safari User Guide for Web Developers](http://developer.apple.com/safari/library/documentation/AppleApplications/Conceptual/Safari_Developer_Guide/UsingtheWebInspector/UsingtheWebInspector.html) for more details on other panels of Web Inspector.
36
38
37
-
## Hacking on the Web Inspector
39
+
## Hacking on Web Inspector
38
40
39
-
Most of the Web Inspector's code is HTML, JavaScript, and CSS—so it's very easy to implement new features and fix bugs!
41
+
Most of Web Inspector's code is HTML, JavaScript, and CSS—so it's very easy to implement new features and fix bugs!
40
42
41
43
[List Web Inspector bugs and feature requests](http://tinyurl.com/2vqypl)
42
44
@@ -120,7 +122,7 @@ Most of the Web Inspector's code is HTML, JavaScript, and CSS—so it's very eas
120
122
| Edit Breakpoint Condition | Right-Click on line number | Right-Click on line number |
Copy file name to clipboardExpand all lines: docs/Deep Dive/Web Inspector/Contributing.md
+44-16Lines changed: 44 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,55 @@
1
1
# Contributing to Web Inspector
2
2
3
-
## Modifying the Web Inspector
3
+
The process for contributing to Web Inspector is the same as for [contributing to WebKit](/Getting%20Started/ContributingCode.html).
4
4
5
-
The Web Inspector user interface is implemented using JavaScript, CSS, and HTML. So, it's relatively easy to dig into the Web Inspector's sources and fix bugs or add new features.
5
+
This page provides an overview of Web Inspector and some techniques useful when working on Web Inspector.
6
6
7
-
This wiki page documents the minimal steps required to modify styles used by the Web Inspector and submit your changes as a patch for review.
7
+
## Overview of Web Inspector
8
8
9
-
Let's say, we don't like red color for CSS property names, and we would prefer property names to be purple instead. Let's get started!
9
+
Web Inspector consists of two main parts:
10
10
11
-
## Inspect The Inspector
11
+
- the frontend, which is the user interface a developer interacts with.
12
+
- the backend, which instruments the inspected target, such as a web page.
12
13
13
-
Since the Web Inspector UI is just another web page, we can inspect the Web Inspector with a second-level Web Inspector instance to quickly see what's going on. This requires a few magic settings to enable the "Inspect..." context menu on the Web Inspector window.
14
14
15
-
For the Mac port, set the following defaults to allow inspecting the inspector.
15
+
### Frontend
16
+
The Web Inspector frontend is implemented using JavaScript, CSS, and HTML in files under `Source/WebInspectorUI/`.
It follows a Model-View-Controller (MVC) approach. Models are representations of the inspectable objects, events, and resources. Views are responsible for laying out the user interface and responding to user interaction. Controllers orchestrate the data flow between models and views.
19
+
20
+
21
+
### Backend
22
+
The Web Inspector backend is written primarily in C++. It collects representations of things on the inspected target, like DOM nodes, network requests and responses, scripts, stylehseets, events, etc. It also implements ways to observe, change and block resources, and override behaviors of the inspected target.
23
+
24
+
The files for the backend are more spread out. Find them under:
25
+
26
+
-`Source/JavaScriptCore/inspector`
27
+
-`Source/WebCore/inspector`
28
+
-`Source/WebKit/UIProcess/inspector`
29
+
-`Source/WebKit/WebProcess/inspector`.
30
+
31
+
32
+
### Protocol
33
+
The frontend and backend communicate via a JSON-based protocol which facilitates the exchange of messages with typed data payloads.
20
34
35
+
Protocol messages describe commands and events. Commands are invoked by the frontend on the backend, such as requesting a list of resources or updating the contents of a resource. Events are dispatched by the backend to be handled by the frontend, such as the notification that a new resource has been added.
21
36
22
-
After updating these settings, run the [https://developer.apple.com/safari/technology-preview/ Safari Technology Preview]. Then, open the Web Inspector and right-click to inspect the inspector itself.
37
+
The files for the inspector protocol definitions are found under `Source/JavaScriptCore/inspector/protocol`.
23
38
24
-
By inspecting the CSS property names in the second-level inspector, we quickly find that the colors are defined by rules in `Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css`.
25
-
To create and submit a patch with our changes, we must to create an accompanying Bugzilla bug, and compute the diff of our changes against WebKit trunk.
39
+
## Inspecting Web Inspector
40
+
41
+
Since the Web Inspector user interface is a web page, you can inspect it with a second-level Web Inspector instance.
42
+
43
+
To enable this, open the Settings tab of Web Inspector. Under the Experimental section, enable "Allow Inspecting Web Inspector". This enables the "Inspect Element" context menu item within Web Inspector itself.
44
+
45
+
You can also observe the exchange of protocol messages between the backend and frontend.
46
+
To do this, you must first enable the debug user interface in the second-level Web Inspector.
47
+
48
+
Press the keyboard shortcut Cmd-Opt-Shift-D to reveal additional buttons in the second-level Web Inspector tab bar. Click the button to dump all inspector message to the console. In the Console tab of the second-level Web Inspector, you can now see a live log of messages exchanged between the backend and frontend of the main Web Inspector.
49
+
50
+
## Making changes to Web Inspector
51
+
52
+
TBD
26
53
27
54
## Create / Update a Bug Report
28
55
@@ -33,7 +60,8 @@ The WebKit project uses "bugs" in Bugzilla for fixes, new features, and any othe
33
60
34
61
So, the first step is to ensure that your proposed enhancement or fix has an associated bug.
35
62
36
-
Once you find or create a bug report, make sure to add a comment stating your intent to work on the bug.
63
+
Once you find or create a bug report, make sure to add a comment stating your intent to work on the bug.
64
+
37
65
This step is very important; comments on bugs in the Web Inspector Bugzilla component will automatically notify Web Inspector reviewers.
38
66
39
67
This will allow them to answer any questions you may have about a proposed fix, and give feedback, pointers, and guidance for solving the issue.
@@ -45,7 +73,7 @@ This will allow them to answer any questions you may have about a proposed fix,
Copy file name to clipboardExpand all lines: docs/Deep Dive/Web Inspector/WebInspectorDebugging.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# Debugging the Web Inspector
1
+
# Debugging Web Inspector
2
2
3
-
This page contains tips and suggested workflows for isolating, understanding, and fixing code in the Web Inspector, particularly in the user interface.
3
+
This page contains tips and suggested workflows for isolating, understanding, and fixing code in Web Inspector, particularly in the user interface.
Copy file name to clipboardExpand all lines: docs/Deep Dive/Web Inspector/WebInspectorTests.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Writing Web Inspector Tests
2
2
3
-
This page describes how various parts of the Web Inspector are tested.
3
+
This page describes how various parts of Web Inspector are tested.
4
4
5
5
-----
6
6
@@ -13,7 +13,7 @@ There are several types of inspector tests:
13
13
***Manual Tests** exercise the user interface in ways that are difficult to automate or require infrastructure that doesn't exist yet.
14
14
***Library Tests** exercise subsystems such as pretty printing or the protocol generator in isolation from a running Web Inspector instance.
15
15
16
-
To date, the Web Inspector has no automated tests that exercise the user interface. In practice, the Inspector UI changes frequently, so such tests tend to be brittle, and have traditionally not been worth the trouble of maintaining.
16
+
Web Inspector does not have automated tests that exercise the user interface. In practice, the Inspector UI changes frequently, so such tests tend to be brittle, and have traditionally not been worth the trouble of maintaining.
17
17
18
18
## How Tests Execute
19
19
@@ -99,7 +99,7 @@ An `AsyncTestSuite` executes its test cases asynchronously, one after another, b
99
99
100
100
## How to Debug Tests
101
101
102
-
In general, the strategies for [wiki:"WebInspectorDebugging" debugging the Web Inspector] and debugging WebCore/WebKit2 apply the same to debugging inspector tests. Sometimes, tests can be more difficult to debug because the test harness' marshalling code can be broken by incorrectly written tests or bugs in the test harness. The test stubs provide several flags that enable extra or more reliable logging for debug purposes. Flags can be set in the corresponding `Test/TestStub.html` file for all test runs, or at the top of a `test()` method to only affect one test.
102
+
In general, the strategies for [wiki:"WebInspectorDebugging" debugging Web Inspector] and debugging WebCore/WebKit2 apply the same to debugging inspector tests. Sometimes, tests can be more difficult to debug because the test harness' marshalling code can be broken by incorrectly written tests or bugs in the test harness. The test stubs provide several flags that enable extra or more reliable logging for debug purposes. Flags can be set in the corresponding `Test/TestStub.html` file for all test runs, or at the top of a `test()` method to only affect one test.
0 commit comments