Changeset 87863 in webkit
- Timestamp:
- Jun 1, 2011, 4:13:53 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/dom/document-set-body-expected.txt (added)
-
LayoutTests/fast/dom/document-set-body.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/Document.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r87862 r87863 1 2011-06-01 Abhishek Arya <inferno@chromium.org> 2 3 Reviewed by Alexey Proskuryakov. 4 5 Tests setting document.body to non body elements, elements in other 6 documents. 7 https://bugs.webkit.org/show_bug.cgi?id=60831 8 9 * fast/dom/document-set-body-expected.txt: Added. 10 * fast/dom/document-set-body.html: Added. 11 1 12 2011-06-01 Adam Barth <abarth@webkit.org> 2 13 -
trunk/Source/WebCore/ChangeLog
r87856 r87863 1 2011-06-01 Abhishek Arya <inferno@chromium.org> 2 3 Reviewed by Alexey Proskuryakov. 4 5 Fix setting of document.body 6 https://bugs.webkit.org/show_bug.cgi?id=60831 7 8 1. Only allowing setting to an element if it has a body tag. 9 2. If element is from another document, import it. 10 11 Test: fast/dom/document-set-body.html 12 13 * dom/Document.cpp: 14 (WebCore::Document::setBody): 15 1 16 2011-06-01 Chris Fleizach <cfleizach@apple.com> 2 17 -
trunk/Source/WebCore/dom/Document.cpp
r87844 r87863 2032 2032 void Document::setBody(PassRefPtr<HTMLElement> newBody, ExceptionCode& ec) 2033 2033 { 2034 if (!newBody || !documentElement()) { 2034 ec = 0; 2035 2036 if (!newBody || !documentElement() || !newBody->hasTagName(bodyTag)) { 2035 2037 ec = HIERARCHY_REQUEST_ERR; 2036 2038 return; 2039 } 2040 2041 if (newBody->document() && newBody->document() != this) { 2042 RefPtr<Node> node = importNode(newBody.get(), true, ec); 2043 if (ec) 2044 return; 2045 2046 newBody = toHTMLElement(node.get()); 2037 2047 } 2038 2048
Note:
See TracChangeset
for help on using the changeset viewer.