Bug 89323

Summary: [REGRESSION r120357] Web Inspector: no right-click context menu item 'inspect element'
Product: WebKit Reporter: Philippe Wittenbergh <phiw2>
Component: Web Inspector (Deprecated)Assignee: Timothy Hatcher <timothy>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, brkemper, bweinstein, dppeak, enrica, jiapu.mail, joepeck, keishi, kevin, lars.sonchocky-helldorf, loislo, pfeldman, pmuellr, rik, timothy, tsbehlman, webkit.review.bot, yurys
Priority: P2 Keywords: InRadar, Regression
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
screenshot with WebKit nightly
none
screenshot with Safari 5.1.7
none
Proposed Change
none
Proposed Change for WebKit2
none
Proposed Change for WebKit2 (Round 2) none

Description Philippe Wittenbergh 2012-06-17 20:33:04 PDT
Since r120398, I can no longer inspect an element by right-clicking on it. The context menu item is missing. Worked fine with r120350. Happens both on 10.6 and 10.7.

(I disabled all extensions just in case, but that didn't help anything)
Comment 1 Alexander Pavlov (apavlov) 2012-06-18 02:20:04 PDT
I tend to close this as WONTFIX, since I cannot reproduce the issue with WebKit ToT (r120576) on Chromium. I also cannot see any change that may seem offending in the range you've provided.

Which browser/bare WebKit are you using, on what OS, and does it reproduce for you on any web page?
Comment 2 Philippe Wittenbergh 2012-06-18 02:33:25 PDT
(In reply to comment #1)
> Which browser/bare WebKit are you using, on what OS, and does it reproduce for you on any web page?

Webkit nightly builds (WebKit-SVN-r12xxx.dmg, downloaded from http://nightly.webkit.org/) on OS X 10.6 and 10.7 (all up to date) as noted in my report. It happens on any and all pages.
Safari 5.1.7 works as expected.
I run my OS in French, but that shouldn't matter, I think.
Comment 3 Philippe Wittenbergh 2012-06-18 02:35:13 PDT
Created attachment 148074 [details]
screenshot with WebKit nightly

Taken with WebKit-SVN-r120575.
Comment 4 Philippe Wittenbergh 2012-06-18 02:37:08 PDT
Created attachment 148076 [details]
screenshot with Safari 5.1.7

(expected behaviour)
Comment 5 Alexander Pavlov (apavlov) 2012-06-18 03:06:20 PDT
Timothy, can you triage/handle the issue appropriately? This seems to be broken only in the bare WebKit nightly, and I cannot see any offending change in the range reported.
Comment 6 Kevin M. Dean 2012-06-18 08:19:38 PDT
Just confirming that I'm seeing the same issue with the nightlies.
Comment 7 Dave 2012-06-20 06:51:05 PDT
I can confirm as I'm seeing the same issue with WebKit nightly builds.

Safari info -- Version 5.1.7 (7534.57.2, r120807)
Mac OS X -- 10.7.4
Comment 8 Brad 2012-06-21 11:05:55 PDT
I've been having this same probem for the last several nightlies, and I am currently on r120914. I miss using the menu a lot. Fortunately, the magnifying glass still works. I tried turning off extensions, but it didn't help. I am also using Glims, which I have not yet tried disabling.
Comment 9 Timothy Hatcher 2012-06-22 07:32:00 PDT
I'm looking into it.
Comment 10 Timothy Hatcher 2012-06-22 07:32:39 PDT
<rdar://problem/11702613>
Comment 11 Brad 2012-06-28 10:48:14 PDT
I just noticed in r121418 that the "Inspect Element" menu item does appear (and works) when I click on a text form field such as an input[type='text'] or a textarea. But still not on other things (such as the input[type='submit'] on this page). I don't know if this was the case or not in earlier nightlies.
Comment 12 tsbehlman 2012-06-28 19:15:38 PDT
(In reply to comment #11)
> I just noticed in r121418 that the "Inspect Element" menu item does appear (and works) when I click on a text form field such as an input[type='text'] or a textarea. But still not on other things (such as the input[type='submit'] on this page). I don't know if this was the case or not in earlier nightlies.

I can confirm the exact same behavior in r121382.
Comment 13 Dave 2012-06-29 14:05:26 PDT
I can confirm that the issue first appeared in build r120398.  The "Inspect Element" feature was functioning correctly in build r120350.
Comment 14 Timothy Hatcher 2012-07-01 13:48:56 PDT
I'm pretty sure this broke with http://trac.webkit.org/changeset/120357.

That change added a new context menu item tag, before the Inspect Element tag. This changed the enum values and thus broke any client built with an older WebKit version.
Comment 15 Timothy Hatcher 2012-07-01 14:19:26 PDT
Created attachment 150337 [details]
Proposed Change
Comment 16 Sam Weinig 2012-07-01 14:33:53 PDT
Comment on attachment 150337 [details]
Proposed Change

View in context: https://bugs.webkit.org/attachment.cgi?id=150337&action=review

> Source/WebCore/ChangeLog:12
> +        Fix the order of the ContextMenuAction enum to be binary compatible with
> +        older versions of WebKit.

It seems bad that we could have a binary compatibility issue like this in WebCore.  Can we change it so that the WebKit API is mapped via a switch statement to the WebCore enum so this can't happen in the future?

> Source/WebKit/mac/ChangeLog:11
> +        * WebView/WebUIDelegatePrivate.h:
> +        Add missing enums that were added in ContextMenuItem.h but left out here.

Is there anyway we can guard against this in the future?  Perhaps a switch statement without a default case somewhere?
Comment 17 Timothy Hatcher 2012-07-01 16:07:29 PDT
(In reply to comment #16)
> (From update of attachment 150337 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=150337&action=review
> 
> > Source/WebCore/ChangeLog:12
> > +        Fix the order of the ContextMenuAction enum to be binary compatible with
> > +        older versions of WebKit.
> 
> It seems bad that we could have a binary compatibility issue like this in WebCore.  Can we change it so that the WebKit API is mapped via a switch statement to the WebCore enum so this can't happen in the future?
> 
> > Source/WebKit/mac/ChangeLog:11
> > +        * WebView/WebUIDelegatePrivate.h:
> > +        Add missing enums that were added in ContextMenuItem.h but left out here.
> 
> Is there anyway we can guard against this in the future?  Perhaps a switch statement without a default case somewhere?

That would be the best approach. But we don't really add items often at all.
Comment 18 WebKit Review Bot 2012-07-01 17:27:39 PDT
Comment on attachment 150337 [details]
Proposed Change

Clearing flags on attachment: 150337

Committed r121646: <http://trac.webkit.org/changeset/121646>
Comment 19 WebKit Review Bot 2012-07-01 17:27:45 PDT
All reviewed patches have been landed.  Closing bug.
Comment 20 Kevin M. Dean 2012-07-01 23:34:01 PDT
I'm seeing no difference with r121656. Inspect element is still not appearing on anything but form fields.
Comment 21 Kevin M. Dean 2012-07-02 00:04:38 PDT
Webkit doesn't seem to want to Quit in the builds where Inspect Element is missing as well. I select Quit and the window closes but the app doesn't quit and Quit in the menu grays out. Back to the last working version for me.
Comment 22 Kevin M. Dean 2012-07-02 00:11:28 PDT
Seems the Quit issue is covered with Bug 90093
Comment 23 Kevin M. Dean 2012-07-02 08:40:54 PDT
Tried again with r121678, and not fixed there either. Needs to be re-opened.
Comment 24 Brad 2012-07-02 17:19:50 PDT
I've had the quitting problem too, but didn't think about it being related. ALSO: another place where the menu is OK, is when  there is contenteditable="true" on the item or one of its ancestors.
Comment 25 Kevin M. Dean 2012-07-02 18:40:57 PDT
Per the other bug, the quitting issue has been fixed and started after this bug, so not related.
Comment 26 Joseph Pecoraro 2012-07-03 15:23:23 PDT
*** Bug 90499 has been marked as a duplicate of this bug. ***
Comment 27 Kevin M. Dean 2012-07-03 15:35:13 PDT
(In reply to comment #26)
> *** Bug 90499 has been marked as a duplicate of this bug. ***

I noticed in the other bug you mentioned "The issue should be fixed in WebKit after r121678."

It's not fixed as I previously reported and should be re-opened unless others are seeing it as fixed.
Comment 28 Joseph Pecoraro 2012-07-03 15:44:19 PDT
> I'm seeing no difference with r121656. Inspect element is still not appearing on anything but form fields.

Tim, it sounds like people are still seeing this. Any ideas?
Comment 29 lars.sonchocky-helldorf 2012-07-06 13:51:46 PDT
The bug is still present in WebKit Version 5.1.7 (6534.57.2, r121952)
Comment 30 Kevin M. Dean 2012-07-06 14:02:59 PDT
Someone must have taken this whole week off.
Comment 31 Timothy Hatcher 2012-07-09 07:15:07 PDT
In fact, I did. I'm now back from vacation and will look into this again.
Comment 32 Timothy Hatcher 2012-07-10 12:36:51 PDT
Created attachment 151502 [details]
Proposed Change for WebKit2

This needed fixed in WebKit2 also. The previous fix only fixed WebKit1 clients. I've tested this against Safari 5.1.7.
Comment 33 Timothy Hatcher 2012-07-10 12:42:04 PDT
Comment on attachment 151502 [details]
Proposed Change for WebKit2

This is going to need a more complex fix. Moving the enum will fix it for Safari 5.1.7 but it will disappear for Safari 6.
Comment 34 Timothy Hatcher 2012-07-12 14:43:51 PDT
Created attachment 152068 [details]
Proposed Change for WebKit2 (Round 2)
Comment 35 WebKit Review Bot 2012-07-12 15:58:26 PDT
Comment on attachment 152068 [details]
Proposed Change for WebKit2 (Round 2)

Clearing flags on attachment: 152068

Committed r122520: <http://trac.webkit.org/changeset/122520>
Comment 36 WebKit Review Bot 2012-07-12 15:58:39 PDT
All reviewed patches have been landed.  Closing bug.
Comment 37 Philippe Wittenbergh 2012-07-13 05:47:17 PDT
Thanks, the context menu works nicely now :).
@ r122535