Commit 23f50648 authored by andersca@apple.com's avatar andersca@apple.com

WebCore:

2008-06-25  Anders Carlsson  <andersca@apple.com>

        Reviewed by Mitz.

        <rdar://problem/6007111> 
        https://bugs.webkit.org/show_bug.cgi?id=19516
        DOM modification causes Access Violation (NULL pointer?)
        
        Null check the document element.
        
        * html/HTMLParser.cpp:
        (WebCore::HTMLParser::handleError):

LayoutTests:

2008-06-25  Anders Carlsson  <andersca@apple.com>

        Reviewed by Mitz.

        <rdar://problem/6007111> 
        https://bugs.webkit.org/show_bug.cgi?id=19516
        DOM modification causes Access Violation (NULL pointer?)

        * fast/dom/HTMLHtmlElement/duplicate-html-element-crash-expected.txt: Added.
        * fast/dom/HTMLHtmlElement/duplicate-html-element-crash.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34795 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 909b8eb8
2008-06-25 Anders Carlsson <andersca@apple.com>
Reviewed by Mitz.
<rdar://problem/6007111>
https://bugs.webkit.org/show_bug.cgi?id=19516
DOM modification causes Access Violation (NULL pointer?)
* fast/dom/HTMLHtmlElement/duplicate-html-element-crash-expected.txt: Added.
* fast/dom/HTMLHtmlElement/duplicate-html-element-crash.html: Added.
2008-06-25 Dan Bernstein <mitz@apple.com>
Reviewed by Dave Hyatt.
This tests that we won't crash when creating a new html element when the document does not have a document element.
SUCCESS - Did not crash!
<body onload="runTest()">
<script>
function runTest() {
if (window.layoutTestController)
layoutTestController.dumpAsText();
var div = document.createElement('div');
div.appendChild(document.body.parentElement);
var a = document.createElement('a');
a.innerHTML = '<x><html></html>';
document.appendChild(document.createElement('html'))
document.documentElement.innerHTML='<div>This tests that we won\'t crash when creating a new html element when the document does not ' +
'have a document element.</div><div>SUCCESS - Did not crash!</div>'
}
</script>
</body>
2008-06-25 Anders Carlsson <andersca@apple.com>
Reviewed by Mitz.
<rdar://problem/6007111>
https://bugs.webkit.org/show_bug.cgi?id=19516
DOM modification causes Access Violation (NULL pointer?)
Null check the document element.
* html/HTMLParser.cpp:
(WebCore::HTMLParser::handleError):
2008-06-25 Dan Bernstein <mitz@apple.com>
Reviewed by Dave Hyatt.
......@@ -394,7 +394,7 @@ bool HTMLParser::handleError(Node* n, bool flat, const AtomicString& localName,
}
} else if (h->hasLocalName(htmlTag)) {
if (!current->isDocumentNode() ) {
if (document->documentElement()->hasTagName(htmlTag)) {
if (document->documentElement() && document->documentElement()->hasTagName(htmlTag)) {
reportError(RedundantHTMLBodyError, &localName);
// we have another <HTML> element.... apply attributes to existing one
// make sure we don't overwrite already existing attributes
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment