Bug 42238

Summary: Selection dumping code should not dump body's offset in the document
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: New BugsAssignee: Eric Seidel (no email) <eric>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, ap, eric, hyatt, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 41123    
Attachments:
Description Flags
Patch none

Description Eric Seidel (no email) 2010-07-14 00:15:20 PDT
Selection dumping code should not dump body's offset in the document
Comment 1 Eric Seidel (no email) 2010-07-14 00:17:37 PDT
Created attachment 61476 [details]
Patch
Comment 2 Eric Seidel (no email) 2010-07-14 00:18:45 PDT
I'll probably need to write a little script to update all the layout test results.

This will make our results stop being sensitive to whether or not we allow whitespace nodes between the <head> and the <body> elements.  We have enough tests which are sensitive to that for other reasons already.
Comment 3 Eric Seidel (no email) 2010-07-14 01:02:08 PDT
I wrote a little script to update all the results:
#!/usr/bin/python

import fileinput
import os.path
import re


# Use IGNORECASE because "BODY" will be "body" in xhtml.
position_regexp = re.compile(r"child \d {BODY} .* of document", re.IGNORECASE)


for (dirpath, dirnames, filenames) in os.walk("."):
    for name in filenames:
        if not name.endswith("-expected.txt"):
            continue
        full_path = os.path.join(dirpath, name)
        file_input = fileinput.input(full_path, inplace=True)
        for line in file_input:
            print position_regexp.sub("body", line),
Comment 4 Nikolas Zimmermann 2010-07-14 01:05:00 PDT
Comment on attachment 61476 [details]
Patch

rs=me. Remember, that you probably have to update results on all platforms.
Comment 5 Eric Seidel (no email) 2010-07-14 02:08:31 PDT
I am having to land this in pieces due to SVN trouble.

http://trac.webkit.org/changeset/63291
http://trac.webkit.org/changeset/63292
so far. 2 more to go.
Comment 6 WebKit Review Bot 2010-07-14 02:17:37 PDT
http://trac.webkit.org/changeset/63292 might have broken GTK Linux 32-bit Debug
The following changes are on the blame list:
http://trac.webkit.org/changeset/63292
http://trac.webkit.org/changeset/63293
Comment 7 Eric Seidel (no email) 2010-07-14 02:18:30 PDT
http://trac.webkit.org/changeset/63295 is part 3. :)
Comment 8 WebKit Review Bot 2010-07-14 02:19:01 PDT
http://trac.webkit.org/changeset/63291 might have broken GTK Linux 32-bit Release
Comment 9 Eric Seidel (no email) 2010-07-14 02:22:06 PDT
Committed r63296: <http://trac.webkit.org/changeset/63296>
Comment 10 Alexey Proskuryakov 2010-07-14 12:31:10 PDT
> Selection dumping code should not dump body's offset in the document

Is that to avoid visual noise in test results?
Comment 11 Eric Seidel (no email) 2010-07-14 12:57:20 PDT
Basically.  Caused redundant testing.  HTML5 as currently spec'd allows whitespace nodes between </head> and <body>, thus changing the offset of <body> within <html>.  That part of the spec is currently under some debate, but it's better to have 100 tests failing because of that change (instead of nearly 1000 which failed before this patch).