Bug 20362 - Web Inspector: HTML errors not reported if the inspector is closed
Summary: Web Inspector: HTML errors not reported if the inspector is closed
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2008-08-12 10:59 PDT by Anthony Ricaud
Modified: 2014-01-14 11:27 PST (History)
12 users (show)

See Also:


Attachments
Testcase (377 bytes, text/html)
2008-08-12 11:01 PDT, Anthony Ricaud
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Ricaud 2008-08-12 10:59:13 PDT
When someone opens the inspector after loading a page, no HTML errors are reported. One could think there's no error on the page. I think it's counter productive for web developers.

Steps to reproduce:
1) Open the testcase
2) Open the console

Actual results:
No error reported

Result expected:
"Unmatched </div> encountered.  Ignoring tag. testcase.html (line 10)"
Comment 1 Anthony Ricaud 2008-08-12 11:01:31 PDT
Created attachment 22752 [details]
Testcase
Comment 2 Anthony Ricaud 2009-10-29 17:14:43 PDT
If we don't want to run the HTML error code when the inspector is closed, we should at least give hints to the developers. A tooltip in the console saying "Reload the page if you want to check HTML errors".
Comment 3 Brian Weinstein 2009-10-29 17:22:26 PDT
Javascript errors are shown, right? It's just HTML errors that aren't? I feel like we should be consistent.
Comment 4 Pavel Feldman 2009-10-29 17:27:04 PDT
(In reply to comment #3)
> Javascript errors are shown, right? It's just HTML errors that aren't? I feel
> like we should be consistent.

HTMLDocument.cpp

Tokenizer *HTMLDocument::createTokenizer()
{
    bool reportErrors = false;
#if ENABLE(INSPECTOR)
    if (Page* page = this->page())
        reportErrors = page->inspectorController()->windowVisible();
#endif

    return new HTMLTokenizer(this, reportErrors);
}

Who wants to hardcode 'true' under #if ENABLE(INSPECTOR)?
Comment 5 Brian Weinstein 2009-10-29 17:28:26 PDT
I can write the patch, I feel like this is the right way to go.
Comment 6 Anthony Ricaud 2009-10-29 17:34:17 PDT
Oh, this bug doesn't trace Hyatt's comments. He thinks the overhead is too important to enable that all the time. Hence my proposition for a tooltip.
Comment 7 Brian Weinstein 2009-10-29 17:35:55 PDT
Oh, I missed that. (In reply to comment #6)
> Oh, this bug doesn't trace Hyatt's comments. He thinks the overhead is too
> important to enable that all the time. Hence my proposition for a tooltip.

Oh, that seems fair. I didn't see a duplicate of the bug with Hyatt's comments. How do you think the tooltip should look?
Comment 8 Anthony Ricaud 2009-10-29 17:44:53 PDT
A simple log like the XHR feedback seems ok. Maybe we want a warning so that the user sees it in the status bar.
Comment 9 Timothy Hatcher 2009-10-29 20:06:17 PDT
My thoughts: The console has a special log, that has a yellow background and text like Rik mentioned. And a reload button in there.

Basically like a banner row thing. See it?
Comment 10 Timothy Hatcher 2009-10-29 20:07:02 PDT
I don't think it should be a warning that counds in the status bar.
Comment 11 Brian Weinstein 2009-10-29 20:11:22 PDT
(In reply to comment #9)
> My thoughts: The console has a special log, that has a yellow background and
> text like Rik mentioned. And a reload button in there.
> 
> Basically like a banner row thing. See it?

The banner idea works, but I feel like we should do something with this only if there is an error. If there is some way we can track whether or not an error occurred parsing, and not show this bar every time. I don't think we should spam the user to reload a page on the possibility there might be an error.
Comment 12 Timothy Hatcher 2009-10-29 20:34:00 PDT
We could add a cheap way for the parser to say when a warning/error occurred. If we do that, then we should show it in the count in the corner.
Comment 13 BJ Burg 2014-01-12 15:16:10 PST
I don't think WebCore forwards any errors from the HTML5 parser. Should it? I don't know what any of these errors would look like.
Comment 14 Radar WebKit Bug Importer 2014-01-12 15:16:33 PST
<rdar://problem/15801394>
Comment 15 Timothy Hatcher 2014-01-14 11:27:16 PST
IIRC the HTML errors mentioned here have long been removed from the parser.