Skip to content
Permalink
Browse files
2010-10-27 Adam Barth <abarth@webkit.org>
        Reviewed by Ojan Vafai.

        REGRESSION(66511): CORDYS Process Factory doesn't work
        https://bugs.webkit.org/show_bug.cgi?id=48453

        Test some appendChild cases that didn't have coverage before.

        * fast/dom/allowed-children-expected.txt: Added.
        * fast/dom/allowed-children.html: Added.
2010-10-27  Adam Barth  <abarth@webkit.org>

        Reviewed by Ojan Vafai.

        REGRESSION(66511): CORDYS Process Factory doesn't work
        https://bugs.webkit.org/show_bug.cgi?id=48453

        When Ojan refactored this function in 66511, he missed an "else",
        which causes us to generated HIERARCHY_REQUEST_ERR in some cases where
        we're not supposed to.  This patch restores the "else" behavior (using
        an early return) and adds a test for the cases that caused problems in
        the field.

        Test: fast/dom/allowed-children.html

        * dom/Node.cpp:
        (WebCore::isChildTypeAllowed):

Canonical link: https://commits.webkit.org/61236@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70718 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Adam Barth committed Oct 27, 2010
1 parent 7359ea5 commit aace88fd490d94dd99bd6285c875684a319ee8c1
Showing 5 changed files with 93 additions and 1 deletion.
@@ -1,3 +1,15 @@
2010-10-27 Adam Barth <abarth@webkit.org>

Reviewed by Ojan Vafai.

REGRESSION(66511): CORDYS Process Factory doesn't work
https://bugs.webkit.org/show_bug.cgi?id=48453

Test some appendChild cases that didn't have coverage before.

* fast/dom/allowed-children-expected.txt: Added.
* fast/dom/allowed-children.html: Added.

2010-10-27 Adam Roben <aroben@apple.com>

Add Windows-specific results for test added in r70692
@@ -0,0 +1,17 @@
This test ensures that objects RGBColor objects return the correct values.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


PASS u.tagName is 'Long'
PASS (new XMLSerializer()).serializeToString(doc) is '<Long/>'
PASS u.tagName is 'Long'
PASS (new XMLSerializer()).serializeToString(doc) is '<Long><b>15</b></Long>'
PASS u.tagName is 'Long'
PASS (new XMLSerializer()).serializeToString(doc) is '<Long id="1">1</Long>'
PASS u.tagName is 'Long'
PASS (new XMLSerializer()).serializeToString(doc) is '<Long id="1">15<b>1</b>16</Long>'
PASS successfullyParsed is true

TEST COMPLETE

@@ -0,0 +1,45 @@
<html>
<head>
<link rel="stylesheet" href="../js/resources/js-test-style.css">
<script src="../js/resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("This test ensures that objects RGBColor objects return the correct values.");

var cases = [
{
"markup": "<Long />",
"tagName": "'Long'",
"serialization": "'<Long/>'"
}, {
"markup": "<Long><b>15</b></Long>",
"tagName": "'Long'",
"serialization": "'<Long><b>15</b></Long>'"
}, {
"markup": "<Long id='1'>1</Long>",
"tagName": "'Long'",
"serialization": "'<Long id=\"1\">1</Long>'"
}, {
"markup": "<Long id='1'>15<b>1</b>16</Long>",
"tagName": "'Long'",
"serialization": "'<Long id=\"1\">15<b>1</b>16</Long>'"
}
];

for (var i = 0; i < cases.length; ++i) {
var doc = document.implementation.createDocument("", "", null);
var doc2 = (new DOMParser()).parseFromString(cases[i].markup, "text/xml");
var u = doc.importNode(doc2.childNodes[0], true);
shouldBe("u.tagName", cases[i].tagName);
doc.appendChild(u);
shouldBe("(new XMLSerializer()).serializeToString(doc)", cases[i].serialization);
}

successfullyParsed = true;
</script>
<script src="../js/resources/js-test-post.js"></script>
</body>
</html>
@@ -1,3 +1,21 @@
2010-10-27 Adam Barth <abarth@webkit.org>

Reviewed by Ojan Vafai.

REGRESSION(66511): CORDYS Process Factory doesn't work
https://bugs.webkit.org/show_bug.cgi?id=48453

When Ojan refactored this function in 66511, he missed an "else",
which causes us to generated HIERARCHY_REQUEST_ERR in some cases where
we're not supposed to. This patch restores the "else" behavior (using
an early return) and adds a test for the cases that caused problems in
the field.

Test: fast/dom/allowed-children.html

* dom/Node.cpp:
(WebCore::isChildTypeAllowed):

2010-10-27 Beth Dakin <bdakin@apple.com>

Reviewed by Darin Adler.
@@ -1080,13 +1080,13 @@ static bool isChildTypeAllowed(Node* newParent, Node* child)
if (child->nodeType() != Node::DOCUMENT_FRAGMENT_NODE) {
if (!newParent->childTypeAllowed(child->nodeType()))
return false;
return true;
}

for (Node *n = child->firstChild(); n; n = n->nextSibling()) {
if (!newParent->childTypeAllowed(n->nodeType()))
return false;
}

return true;
}

0 comments on commit aace88f

Please sign in to comment.