Bug 45374 - Web Inspector: Selecting "Inspect Element" always shows <body> instead of the inspected element
Summary: Web Inspector: Selecting "Inspect Element" always shows <body> instead of the...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Ilya Tikhonovsky
URL:
Keywords:
: 45464 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-09-08 02:06 PDT by Martin Häcker
Modified: 2010-09-10 09:47 PDT (History)
10 users (show)

See Also:


Attachments
[patch] First iteration. (1.52 KB, patch)
2010-09-09 08:20 PDT, Ilya Tikhonovsky
joepeck: review+
joepeck: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Häcker 2010-09-08 02:06:15 PDT
Hi there,

if I have the inspector set to open at the bottom of the window and it is closed when I choose 'Inspect element' from the context menu after it is opened it always selects the body tag in the 'elements' pane instead of what was clicked.

Workaround for now is to do the right click dance again as the second time seems to work more reliably.

Still it is quite annoying and always takes some time to figure it out and gather that not the right thing was selected.
Comment 1 Ilya Tikhonovsky 2010-09-08 02:48:40 PDT
(In reply to comment #0)
> Hi there,

Could you please specify the browser name and version?
Comment 2 Ilya Tikhonovsky 2010-09-09 08:20:45 PDT
Created attachment 67037 [details]
[patch] First iteration.
Comment 3 Joseph Pecoraro 2010-09-09 09:26:18 PDT
Ilya, is there an explanation to go with this patch?
Comment 4 Ilya Tikhonovsky 2010-09-09 09:52:18 PDT
1. Open any page
2. Right-click on any element, select "Inspect Element"
3. Web Inspector is opened but the <body> element (for HTML) is focused rather than the selected element
4. Inspect the Web Inspector. An error message is logged in the console.

The regression was introduced in http://trac.webkit.org/changeset/66012 - focusNode() is invoked in InspectorController::populateScriptObjects() before the main document is set for the InspectorDOMAgent instance (which makes focusNode() bail out prematurely).
Comment 5 Ilya Tikhonovsky 2010-09-09 09:52:46 PDT
*** Bug 45464 has been marked as a duplicate of this bug. ***
Comment 6 Joseph Pecoraro 2010-09-09 09:55:00 PDT
As I wrote in the other bug. r=me if the explanation goes into the ChangeLog! =)
Comment 7 Ilya Tikhonovsky 2010-09-10 04:40:59 PDT
Committed r67185
        M       WebCore/ChangeLog
        M       WebCore/inspector/InspectorController.cpp
r67185 = 0e881294fa1aba4a75ffe861696dd21fa46f54a6 (refs/remotes/trunk)
Comment 8 Joseph Pecoraro 2010-09-10 09:47:32 PDT
http://trac.webkit.org/changeset/67185