Bug 35378 - Web Inspector: evaluate-on-hover does not work on HTML files.
Summary: Web Inspector: evaluate-on-hover does not work on HTML files.
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: Pavel Feldman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-25 04:35 PST by Pavel Feldman
Modified: 2010-02-25 10:47 PST (History)
5 users (show)

See Also:


Attachments
[PATCH] Proposed change. (36.22 KB, patch)
2010-02-25 04:44 PST, Pavel Feldman
no flags Details | Formatted Diff | Diff
[PATCH] Proposed change. (Same with updated expectations for HTML test) (53.11 KB, patch)
2010-02-25 04:55 PST, Pavel Feldman
timothy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Feldman 2010-02-25 04:35:56 PST
1. Open some HTML page with inline script
2. Stop on breakpoint inside that script
3. Hover over elements to see evaluated results

Expected: popover with result
Actual: nothing happens

The reason is that evaluate-on-hover works for highlighted source only, so we need to highlight inner JavaScript to make it work.
Comment 1 Pavel Feldman 2010-02-25 04:44:28 PST
Created attachment 49474 [details]
[PATCH] Proposed change.

This change also removes editing-related complexities from the highlighter logic.
Comment 2 Pavel Feldman 2010-02-25 04:55:19 PST
Created attachment 49476 [details]
[PATCH] Proposed change. (Same with updated expectations for HTML test)
Comment 3 WebKit Review Bot 2010-02-25 04:56:37 PST
Attachment 49476 [details] did not pass style-queue:

Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1
WebCore/inspector/front-end/SourceHTMLTokenizer.js:143:  Line contains tab character.  [whitespace/tab] [5]
WebCore/inspector/front-end/SourceHTMLTokenizer.js:144:  Line contains tab character.  [whitespace/tab] [5]
Total errors found: 2 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Timothy Hatcher 2010-02-25 07:07:51 PST
Comment on attachment 49476 [details]
[PATCH] Proposed change. (Same with updated expectations for HTML test)

> +            var match = /<\/[Ss][Cc][Rr][Ii][Pp][Tt]/.exec(line);

Why not just do //i?
Comment 5 Pavel Feldman 2010-02-25 10:13:32 PST
(In reply to comment #4)
> (From update of attachment 49476 [details])
> > +            var match = /<\/[Ss][Cc][Rr][Ii][Pp][Tt]/.exec(line);
> 
> Why not just do //i?

Fixed.
Comment 6 Pavel Feldman 2010-02-25 10:47:04 PST
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	LayoutTests/ChangeLog
	M	LayoutTests/inspector/syntax-highlight-html-expected.txt
	M	WebCore/ChangeLog
	M	WebCore/inspector/front-end/SourceCSSTokenizer.js
	M	WebCore/inspector/front-end/SourceCSSTokenizer.re2js
	M	WebCore/inspector/front-end/SourceHTMLTokenizer.js
	M	WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
	M	WebCore/inspector/front-end/SourceJavaScriptTokenizer.js
	M	WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js
	M	WebCore/inspector/front-end/SourceTokenizer.js
	M	WebCore/inspector/front-end/TextEditorHighlighter.js
	M	WebCore/inspector/front-end/TextViewer.js
Committed r55248