Bug 35378

Summary: Web Inspector: evaluate-on-hover does not work on HTML files.
Product: WebKit Reporter: Pavel Feldman <pfeldman>
Component: Web Inspector (Deprecated)Assignee: Pavel Feldman <pfeldman>
Status: RESOLVED FIXED    
Severity: Normal CC: bweinstein, joepeck, rik, timothy, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed change.
none
[PATCH] Proposed change. (Same with updated expectations for HTML test) timothy: review+

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