https://bugs.webkit.org/show_bug.cgi?id=83483
Reviewed by Yury Semikhatsky.
Source/WebCore:
Added the null check.
Test: inspector/elements/dom-search-crash.html
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::performSearch):
LayoutTests:
* inspector/elements/dom-search-crash-expected.txt: Added.
* inspector/elements/dom-search-crash.html: Added.
* inspector/elements/resources/dom-search-crash-iframe.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113700
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-04-09 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: searching document with no documentElement results in 0x0 access.
+ https://bugs.webkit.org/show_bug.cgi?id=83483
+
+ Reviewed by Yury Semikhatsky.
+
+ * inspector/elements/dom-search-crash-expected.txt: Added.
+ * inspector/elements/dom-search-crash.html: Added.
+ * inspector/elements/resources/dom-search-crash-iframe.html: Added.
+
2012-04-10 Philippe Normand <pnormand@igalia.com>
Unreviewed, GTK baselines for two new tests.
--- /dev/null
+Tests that elements panel search is not crashing on documentElement-less cases.
+
+
+
+Running: testSetUp
+
+Running: testNoCrash
+
--- /dev/null
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script>
+function test()
+{
+ InspectorTest.runTestSuite([
+ function testSetUp(next)
+ {
+ WebInspector.showPanel("elements");
+ WebInspector.domAgent.requestDocument(next);
+ },
+
+ function testNoCrash(next)
+ {
+ WebInspector.domAgent.performSearch("FooBar", next);
+ }
+ ]);
+}
+</script>
+</head>
+
+<body>
+<p>
+Tests that elements panel search is not crashing on documentElement-less cases.
+</p>
+<iframe src="resources/dom-search-crash-iframe.html" onload="runTest()"></iframe>
+</body>
+</html>
--- /dev/null
+<script>
+document.documentElement.parentNode.removeChild(document.documentElement);
+</script>
+2012-04-09 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: searching document with no documentElement results in 0x0 access.
+ https://bugs.webkit.org/show_bug.cgi?id=83483
+
+ Reviewed by Yury Semikhatsky.
+
+ Added the null check.
+
+ Test: inspector/elements/dom-search-crash.html
+
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::performSearch):
+
2012-04-10 Patrick Gansterer <paroga@webkit.org>
[CMake] Add missing source files to build system
for (Vector<Document*>::iterator it = docs.begin(); it != docs.end(); ++it) {
Document* document = *it;
Node* node = document->documentElement();
+ if (!node)
+ continue;
// Manual plain text search.
while ((node = node->traverseNextNode(document->documentElement()))) {