Bug 900724 - Prevent form association when creating elements in template contents. r=hsivonen

This commit is contained in:
William Chen
2013-08-13 14:31:18 -07:00
parent 952b0d1ecd
commit 52d73f9751
4 changed files with 42 additions and 7 deletions

View File

@@ -5231,8 +5231,8 @@ public abstract class TreeBuilder<T> implements TokenHandler,
checkAttributes(attributes, "http://www.w3.org/1999/xhtml");
// ]NOCPP]
// Can't be called for custom elements
T elt = createElement("http://www.w3.org/1999/xhtml", elementName.name, attributes, fragment ? null
: form);
T elt = createElement("http://www.w3.org/1999/xhtml", elementName.name, attributes,
form == null || fragment || isTemplateContents() ? null : form);
StackNode<T> current = stack[currentPtr];
if (current.isFosterParenting()) {
fatal();
@@ -5254,7 +5254,8 @@ public abstract class TreeBuilder<T> implements TokenHandler,
checkAttributes(attributes, "http://www.w3.org/1999/xhtml");
// ]NOCPP]
// Can't be called for custom elements
T elt = createElement("http://www.w3.org/1999/xhtml", name, attributes, fragment ? null : form);
T elt = createElement("http://www.w3.org/1999/xhtml", name, attributes,
form == null || fragment || isTemplateContents() ? null : form);
StackNode<T> current = stack[currentPtr];
if (current.isFosterParenting()) {
fatal();
@@ -5338,7 +5339,8 @@ public abstract class TreeBuilder<T> implements TokenHandler,
checkAttributes(attributes, "http://www.w3.org/1999/xhtml");
// ]NOCPP]
// Can't be called for custom elements
T elt = createElement("http://www.w3.org/1999/xhtml", name, attributes, fragment ? null : form);
T elt = createElement("http://www.w3.org/1999/xhtml", name, attributes,
form == null || fragment || isTemplateContents() ? null : form);
StackNode<T> current = stack[currentPtr];
appendElement(elt, current.node);
elementPushed("http://www.w3.org/1999/xhtml", name, elt);