diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2020-01-01 15:04:58 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2020-01-26 15:50:07 -0500 |
commit | 90c2cd9b7972806198fc65891049dc34e413cb99 (patch) | |
tree | a1cb100c516af764e45e485a9e7d0785818aca0f /dom/html/nsHTMLDocument.cpp | |
parent | 57cbe109c7c824020b2ae412923ae707ed6fd9d6 (diff) | |
download | uxp-90c2cd9b7972806198fc65891049dc34e413cb99.tar.gz |
Bug 1276438 part 2. Move the implementation of the .body setter from nsHTMLDocument to nsIDocument.
Tag UXP Issue mcp-graveyard/UXP#1344
Tag UXP Issue mcp-graveyard/UXP#252
Diffstat (limited to 'dom/html/nsHTMLDocument.cpp')
-rw-r--r-- | dom/html/nsHTMLDocument.cpp | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/dom/html/nsHTMLDocument.cpp b/dom/html/nsHTMLDocument.cpp index 23c73298d7..1eeef737af 100644 --- a/dom/html/nsHTMLDocument.cpp +++ b/dom/html/nsHTMLDocument.cpp @@ -1034,31 +1034,6 @@ nsHTMLDocument::SetBody(nsIDOMHTMLElement* aBody) return rv.StealNSResult(); } -void -nsHTMLDocument::SetBody(nsGenericHTMLElement* newBody, ErrorResult& rv) -{ - nsCOMPtr<Element> root = GetRootElement(); - - // The body element must be either a body tag or a frameset tag. And we must - // have a html root tag, otherwise GetBody will not return the newly set - // body. - if (!newBody || - !newBody->IsAnyOfHTMLElements(nsGkAtoms::body, nsGkAtoms::frameset) || - !root || !root->IsHTMLElement() || - !root->IsHTMLElement(nsGkAtoms::html)) { - rv.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR); - return; - } - - // Use DOM methods so that we pass through the appropriate security checks. - nsCOMPtr<Element> currentBody = GetBodyElement(); - if (currentBody) { - root->ReplaceChild(*newBody, *currentBody, rv); - } else { - root->AppendChild(*newBody, rv); - } -} - NS_IMETHODIMP nsHTMLDocument::GetHead(nsIDOMHTMLHeadElement** aHead) { |