Bug 25397 - document.write to an image document fails
Summary: document.write to an image document fails
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2009-04-25 13:00 PDT by Alexey Proskuryakov
Modified: 2018-09-24 15:17 PDT (History)
3 users (show)

See Also:

test case (will assert) (491 bytes, text/html)
2009-04-25 22:09 PDT, Alexey Proskuryakov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2009-04-25 13:00:48 PDT
Trying to write into an image document (e.g. <iframe src="image.gif>) fails with an assertion in debug builds, and is just ignored in release builds.

It seems that we shouldn't subclass HTMLDocument, as all HTML documents need to support writing HTML content in them. This affects LexisNexis (requires an account to reproduce).
Comment 1 Alexey Proskuryakov 2009-04-25 22:09:26 PDT
Created attachment 29798 [details]
test case (will assert)
Comment 2 Alexey Proskuryakov 2009-12-11 10:27:29 PST
This no longer fails with an assertion as of r51997, but it doesn't work either.
Comment 3 Eric Seidel (no email) 2010-06-24 00:05:14 PDT
Seems document.write should just be ignored for image documents, like how it is for XML.
Comment 4 Alexey Proskuryakov 2010-06-24 00:13:13 PDT
Is this what HTML5 now says? My understanding was that document.write() is supposed to behave exactly the same as it does for any HTML documents.
Comment 5 Eric Seidel (no email) 2010-06-24 00:16:19 PDT
HTML5 throws an exception in XML docs:

But doesn't talk about image documents.  Perhaps those need to have the generic write handling.