Bug 15195 - KJSProxy::m_handlerLineno is not reset between page loads in some cases
Summary: KJSProxy::m_handlerLineno is not reset between page loads in some cases
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Eric Seidel (no email)
URL:
Keywords: EasyFix, LayoutTestFailure
Depends on:
Blocks:
 
Reported: 2007-09-12 15:28 PDT by Matt Perry
Modified: 2010-06-11 17:15 PDT (History)
3 users (show)

See Also:


Attachments
Reset KJSProxy::m_handlerLineno in KJSProxy::clear (1.48 KB, patch)
2008-01-14 00:39 PST, Eric Seidel (no email)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Perry 2007-09-12 15:28:20 PDT
Run this command (all one line):
run-webkit-tests dom/html/level1/core/documentinvalidcharacterexceptioncreateentref.html dom/xhtml/level2/html/frame.xhtml 


The second test will fail.  The frame.xhtml test has dependencies on previous test runs*.  The reason it doesn't fail normally is that run-webkit-tests restarts DumpRenderTree every 1000 tests, and during normal execution, frame.xhtml is run in a more "fresh" DumpRenderTree.  (Another way to see this failure is to bump up the testsPerDumpTool to a large value, say 10000).

* The specific dependency here is that KJSProxy::m_handlerLineno is not reset between pages in some cases.  This shows up in the DRT output as a CONSOLE MESSAGE with an invalid line number.
Comment 1 Matt Perry 2007-09-12 15:59:41 PDT
Resummarizing to match the core bug here (it's probably not feasible to remove the interdependency of layout tests).
Comment 2 David Kilzer (:ddkilzer) 2007-09-12 22:05:12 PDT
Confirmed with a local debug build of WebKit r25529 and DRT.

Comment 3 Eric Seidel (no email) 2008-01-11 15:40:13 PST
Another easy fix.
Comment 4 Eric Seidel (no email) 2008-01-14 00:39:42 PST
Created attachment 18431 [details]
Reset KJSProxy::m_handlerLineno in KJSProxy::clear

 WebCore/ChangeLog                 |   14 ++++++++++++++
 WebCore/bindings/js/kjs_proxy.cpp |    4 ++++
 2 files changed, 18 insertions(+), 0 deletions(-)
Comment 5 Darin Adler 2008-01-14 23:38:24 PST
Comment on attachment 18431 [details]
Reset KJSProxy::m_handlerLineno in KJSProxy::clear

Here are some things I notice:

    1) XML doesn't set the line number at all while parsing.

    2) The functions to create event handlers should ask the document's tokenizer what the current line number is, perhaps with a special function that is specifically designed for event handlers, rather than storing a line number inside the KJSProxy object, which seems upside down and backwards to me.

    3) Setting the line number back to 0 is OK, but really doesn't help all that much.

r=me because there's little harm here. But I don't really like the idea of the comment in KJSProxy::clear() mentioning FrameLoader::clear().
Comment 6 Eric Seidel (no email) 2008-01-15 06:29:16 PST
Comment on attachment 18431 [details]
Reset KJSProxy::m_handlerLineno in KJSProxy::clear

I'd rather fix this in a better way. And fix it for XML at the same time.  Clearing review flag.
Comment 7 Alexey Proskuryakov 2010-06-11 17:15:38 PDT
I think that this was quietly fixed (in a different way) in r34273.