diff options
author | jhaas@chromium.org <jhaas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-11 18:47:34 +0000 |
---|---|---|
committer | jhaas@chromium.org <jhaas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-11 18:47:34 +0000 |
commit | dcc45d06e47c3e07f18d4fbef6909f315a4f6210 (patch) | |
tree | ff6c5868633038b72c2c5256a7f4a49307113684 /webkit/port | |
parent | be18d3eae2db247dc5a0e211cc97579620324641 (diff) | |
download | chromium_src-dcc45d06e47c3e07f18d4fbef6909f315a4f6210.zip chromium_src-dcc45d06e47c3e07f18d4fbef6909f315a4f6210.tar.gz chromium_src-dcc45d06e47c3e07f18d4fbef6909f315a4f6210.tar.bz2 |
Fix Chromium bug 4178
"new Image()" was aliased in the V8 bindings to document.createElement('image').
While the behavior of new Image() doesn't appear to be well-defined in spec,
all other browsers always create an HTML image element, regardless of the type of
the current document. Changed our implementation to conform.
Review URL: http://codereview.chromium.org/10268
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5186 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/port')
-rw-r--r-- | webkit/port/bindings/v8/v8_custom.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/webkit/port/bindings/v8/v8_custom.cpp b/webkit/port/bindings/v8/v8_custom.cpp index b737061..b476a91 100644 --- a/webkit/port/bindings/v8/v8_custom.cpp +++ b/webkit/port/bindings/v8/v8_custom.cpp @@ -1330,9 +1330,13 @@ NAMED_PROPERTY_GETTER(DOMWindow) { // It must return the value of property after initialization. static HashMap<String, String> kLazyInitMap; if (kLazyInitMap.isEmpty()) { + // "new Image()" does not appear to be well-defined in a spec, but Safari, + // Opera, and Firefox all consider it to always create an HTML image + // element, regardless of the current doctype. kLazyInitMap.set("Image", "function Image() { \ - return document.createElement('image'); \ + return document.createElementNS( \ + 'http://www.w3.org/1999/xhtml', 'img'); \ }; \ Image"); kLazyInitMap.set("Option", |