Bug 43677 - document->documentElement can always be null
Summary: document->documentElement can always be null
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Adam Barth
URL:
Keywords:
: 43139 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-08-07 13:28 PDT by Adam Barth
Modified: 2010-08-07 15:40 PDT (History)
2 users (show)

See Also:


Attachments
Patch (1.25 KB, patch)
2010-08-07 13:28 PDT, Adam Barth
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>