<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>40393</bug_id>
          
          <creation_ts>2010-06-09 16:09:56 -0700</creation_ts>
          <short_desc>HTML5 Parser: Fix fast/profiler tests that depend on event handler line numbers</short_desc>
          <delta_ts>2010-06-10 11:18:14 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Other</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>39259</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Tony Gentilcore">tonyg</reporter>
          <assigned_to name="Tony Gentilcore">tonyg</assigned_to>
          <cc>abarth</cc>
    
    <cc>eric</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>236072</commentid>
    <comment_count>0</comment_count>
    <who name="Tony Gentilcore">tonyg</who>
    <bug_when>2010-06-09 16:09:56 -0700</bug_when>
    <thetext>HTML5 Parser: Fix fast/profiler tests that depend on event handler line numbers</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>236073</commentid>
    <comment_count>1</comment_count>
      <attachid>58306</attachid>
    <who name="Tony Gentilcore">tonyg</who>
    <bug_when>2010-06-09 16:15:39 -0700</bug_when>
    <thetext>Created attachment 58306
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>236078</commentid>
    <comment_count>2</comment_count>
      <attachid>58306</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-06-09 16:33:08 -0700</bug_when>
    <thetext>Comment on attachment 58306
Patch

WebCore/html/HTML5Tokenizer.cpp:105
 +          if (scriptController)
I&apos;m worried that constructTreeFromToken can cause script to run synchronously, which could invalidate the |frame|, which would invalidate scriptController.  Maybe we need a private helper function to get the script controller?

if (ScriptController* scriptController = script())
    scriptController-&gt;setEventHandlerLineNumber(...)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>236178</commentid>
    <comment_count>3</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-06-09 23:14:04 -0700</bug_when>
    <thetext>I&apos;m going to spoil you, but I&apos;m going to merge your patch to TOT.  :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>236180</commentid>
    <comment_count>4</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-06-09 23:35:01 -0700</bug_when>
    <thetext>Committed r60940: &lt;http://trac.webkit.org/changeset/60940&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>236272</commentid>
    <comment_count>5</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-06-10 03:11:00 -0700</bug_when>
    <thetext>Woh.  Wasn&apos;t this a huge slowdown on the benchmark?  We&apos;re adding two branches and a virtual function call to the per-token loop, no?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>236273</commentid>
    <comment_count>6</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-06-10 03:12:42 -0700</bug_when>
    <thetext>Why do we need to reset the line number to 0 after each token is processed?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>236365</commentid>
    <comment_count>7</comment_count>
    <who name="Tony Gentilcore">tonyg</who>
    <bug_when>2010-06-10 07:52:25 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; I&apos;m going to spoil you, but I&apos;m going to merge your patch to TOT.  :)

Thanks!

Man you&apos;re fast. I had the same patch ready but it didn&apos;t finish building before the get together last night.

There was one more place in Tokenizer that the script() fn could be used. I&apos;ll mail a patch for that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>236366</commentid>
    <comment_count>8</comment_count>
    <who name="Tony Gentilcore">tonyg</who>
    <bug_when>2010-06-10 07:54:42 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; Why do we need to reset the line number to 0 after each token is processed?

I haven&apos;t confirmed, but I&apos;m nearly certain that is for the case when a script dynamically adds an element with an event handler (it shouldn&apos;t be associated w/ the line number of the parser). In any case, it seemed safest to match the old Tokenizer&apos;s behavior for now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>236367</commentid>
    <comment_count>9</comment_count>
    <who name="Tony Gentilcore">tonyg</who>
    <bug_when>2010-06-10 07:55:12 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; Woh.  Wasn&apos;t this a huge slowdown on the benchmark?  We&apos;re adding two branches and a virtual function call to the per-token loop, no?

Can you point me to the benchmark to run?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>236408</commentid>
    <comment_count>10</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-06-10 10:12:51 -0700</bug_when>
    <thetext>&gt; Can you point me to the benchmark to run?

http://trac.webkit.org/browser/trunk/WebCore/benchmarks/parser/html-parser.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>236459</commentid>
    <comment_count>11</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-06-10 11:18:14 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #6)
&gt; &gt; Why do we need to reset the line number to 0 after each token is processed?
&gt; 
&gt; I haven&apos;t confirmed, but I&apos;m nearly certain that is for the case when a script dynamically adds an element with an event handler (it shouldn&apos;t be associated w/ the line number of the parser). In any case, it seemed safest to match the old Tokenizer&apos;s behavior for now.

Some elements carry a createdByParser flag.  But I guess not all.  Otherwise that would be easy to check after the fact.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>58306</attachid>
            <date>2010-06-09 16:15:39 -0700</date>
            <delta_ts>2010-06-09 16:45:45 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-40393-20100609161537.patch</filename>
            <type>text/plain</type>
            <size>1883</size>
            <attacher name="Tony Gentilcore">tonyg</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvQ2hhbmdlTG9nIGIvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXgg
ZWZiMDY1MjkwMzVjZmFmMDI0M2NhNjE5YjI5ZGE5YWJhMDI4ZWUzYi4uNGQ2MThlNzM0NmQyZGRl
YTAwYTllMzhkYjNkNWViMzRiMTU3NjhmYiAxMDA2NDQKLS0tIGEvV2ViQ29yZS9DaGFuZ2VMb2cK
KysrIGIvV2ViQ29yZS9DaGFuZ2VMb2cKQEAgLTEsMyArMSwyMSBAQAorMjAxMC0wNi0wOSAgVG9u
eSBHZW50aWxjb3JlICA8dG9ueWdAY2hyb21pdW0ub3JnPgorCisgICAgICAgIFJldmlld2VkIGJ5
IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgIEhUTUw1IFBhcnNlcjogRml4IGZhc3QvcHJvZmls
ZXIgdGVzdHMgdGhhdCBkZXBlbmQgb24gZXZlbnQgaGFuZGxlciBsaW5lIG51bWJlcnMKKyAgICAg
ICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTQwMzkzCisKKyAgICAg
ICAgVGhpcyBlbXVsYXRlZCB0aGUgb2xkIGJlaGF2aW9yIGluIEhUTUxUb2tlbml6ZXI6cHJvY2Vz
c1Rva2VuKCkKKworICAgICAgICBObyBuZXcgdGVzdHMgYmVjYXVzZSBjb3ZlcmVkIGJ5OgorICAg
ICAgICAgLSBmYXN0L3Byb2ZpbGVyL2RlYWQtdGltZS5odG1sCisgICAgICAgICAtIG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B0
Q29udHJvbGxlciogc2NyaXB0Q29udHJvbGxlciA9IG1fZG9jdW1lbnQtPmZyYW1lKCkgPyBtX2Rv
Y3VtZW50LT5mcmFtZSgpLT5zY3JpcHQoKSA6IDA7CisgICAgICAgIGlmIChzY3JpcHRDb250cm9s
bGVyKQorICAgICAgICAgICAgc2NyaXB0Q29udHJvbGxlci0+c2V0RXZlbnRIYW5kbGVyTGluZU51
bWJlcihsaW5lTnVtYmVyKCkgKyAxKTsKKyAgICAgICAgCiAgICAgICAgIG1fdHJlZUJ1aWxkZXIt
PmNvbnN0cnVjdFRyZWVGcm9tVG9rZW4obV90b2tlbik7CiAgICAgICAgIG1fdG9rZW4uY2xlYXIo
KTsKIAorICAgICAgICBpZiAoc2NyaXB0Q29udHJvbGxlcikKKyAgICAgICAgICAgIHNjcmlwdENv
bnRyb2xsZXItPnNldEV2ZW50SGFuZGxlckxpbmVOdW1iZXIoMCk7CisgICAgICAgIAogICAgICAg
ICBpZiAoIW1fdHJlZUJ1aWxkZXItPmlzUGF1c2VkKCkpCiAgICAgICAgICAgICBjb250aW51ZTsK
IAo=
</data>
<flag name="review"
          id="43295"
          type_id="1"
          status="-"
          setter="abarth"
    />
          </attachment>
      

    </bug>

</bugzilla>