Bug 42875

Summary: Atomize strings used by the HTML5 tree builder
Product: WebKit Reporter: Adam Barth <abarth>
Component: New BugsAssignee: Adam Barth <abarth>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, eric, hyatt
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 41123    
Attachments:
Description Flags
Patch
none
Patch
none
Patch for landing none

Description Adam Barth 2010-07-23 00:11:12 PDT
Atomize strings used by the HTML5 tree builder
Comment 1 Adam Barth 2010-07-23 00:12:15 PDT
Created attachment 62385 [details]
Patch
Comment 2 Adam Barth 2010-07-23 00:12:56 PDT
These numbers are from my laptop on battery, so they're not as rock solid as usual.  Your milage may vary:

== pre ==

Running 20 times
Ignoring warm-up run (4940)
4330
4334
4304
4390
4409
4338
4331
4353
4349
4360
4364
4368
4378
4379
4378
4399
4416
4396
4429
4468

avg 4373.65
stdev 38.241698445545005

== post ==

Running 20 times
Ignoring warm-up run (4825)
4251
4298
4262
4262
4282
4312
4346
4312
4304
4327
4325
4319
4342
4343
4337
4379
4352
4358
4376
4363

avg 4322.5
stdev 36.51232668565508
Comment 3 WebKit Commit Bot 2010-07-23 06:38:31 PDT
Comment on attachment 62385 [details]
Patch

Rejecting patch 62385 from commit-queue.

Failed to run "['WebKitTools/Scripts/run-webkit-tests', '--no-launch-safari', '--exit-after-n-failures=1', '--ignore-tests', 'compositing', '--quiet']" exit_code: 1
Running build-dumprendertree
Compiling Java tests
make: Nothing to be done for `default'.
Running tests from /Users/eseidel/Projects/CommitQueue/LayoutTests
Testing 20713 test cases.
html5lib/runner.html -> failed

Exiting early after 1 failures. 15522 tests run.
318.97s total testing time

15521 test cases (99%) succeeded
1 test case (<1%) had incorrect layout
26 test cases (<1%) had stderr output

Full output: http://queues.webkit.org/results/3566399
Comment 4 Adam Barth 2010-07-23 10:04:29 PDT
I don't understand how this patch affected the old tree builder.  For example, the bgsound element no longer appears in the DOM...
Comment 5 Adam Barth 2010-07-23 11:39:02 PDT
Created attachment 62452 [details]
Patch
Comment 6 Adam Barth 2010-07-23 11:40:10 PDT
Eric, please take another look.  The fix for this issue is kind of goofy.  :(
Comment 7 Eric Seidel (no email) 2010-07-23 12:19:24 PDT
Comment on attachment 62452 [details]
Patch

That's just crazy.  I wonder how many other tags like this that we're "recognizing" and not supposed to.

I don't understand why this is the correct fix.  Why haven't we had trouble when we added <video> and <audio> etc?
Comment 8 Adam Barth 2010-07-23 13:28:14 PDT
It looks like some of the other conditional tags are in the

static HashSet<AtomicStringImpl*>* inlineTagList()

However, not all of them have their conditions, which leads me to believe those builds are broken.  It's also unclear to me whether we parse HTML the same when you change these compile flags.

I'll be glad to get rid of this mess.  At the moment, the attached patch appears to be the most expedient.
Comment 9 Eric Seidel (no email) 2010-07-23 13:43:48 PDT
OK.  I'll look at the patch again this evening.  I just want to make sure we're not completely pooping on the old tree builder.  I'm certainly not going to ask you to re-arch it or anything, but I'd like to stare at how the other tags are working before r+ing this.
Comment 10 Darin Adler 2010-07-23 21:23:15 PDT
Comment on attachment 62452 [details]
Patch

> +            if (*tags[i] == HTMLNames::bgsoundTag

Why not "using namespace HTMLNames" at the top of this file?

r=me
Comment 11 Adam Barth 2010-07-24 08:32:41 PDT
> Why not "using namespace HTMLNames" at the top of this file?

Will do.
Comment 12 Adam Barth 2010-07-24 09:54:05 PDT
Created attachment 62506 [details]
Patch for landing
Comment 13 WebKit Commit Bot 2010-07-24 18:03:27 PDT
Comment on attachment 62506 [details]
Patch for landing

Clearing flags on attachment: 62506

Committed r64018: <http://trac.webkit.org/changeset/64018>
Comment 14 WebKit Commit Bot 2010-07-24 18:03:32 PDT
All reviewed patches have been landed.  Closing bug.