Bug 43677

Summary: document->documentElement can always be null
Product: WebKit Reporter: Adam Barth <abarth>
Component: New BugsAssignee: Adam Barth <abarth>
Status: RESOLVED FIXED    
Severity: Normal CC: sam, skylined
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Attachments:
Description Flags
Patch sam: review+

Description Adam Barth 2010-08-07 13:28:01 PDT
document->documentElement can always be null
Comment 1 Adam Barth 2010-08-07 13:28:45 PDT
Created attachment 63824 [details]
Patch
Comment 2 Sam Weinig 2010-08-07 13:32:04 PDT
Comment on attachment 63824 [details]
Patch

Looks good. Is there a test we can add?
Comment 3 Adam Barth 2010-08-07 13:39:37 PDT
Probably.  You just need to grab an object that has this method and then remove the <html> element from the document, and then call the method.
Comment 4 Adam Barth 2010-08-07 14:50:31 PDT
Here's the repro:

<body onload="document.open();window.styleMedia.matchMedium();">
Comment 5 Adam Barth 2010-08-07 14:50:46 PDT
*** Bug 43139 has been marked as a duplicate of this bug. ***
Comment 6 Adam Barth 2010-08-07 15:40:41 PDT
Committed r64925: <http://trac.webkit.org/changeset/64925>