Bug 548828. Implement HTMLDocument.head. r=bzbarsky

This commit is contained in:
Mayank Gupta 2010-05-02 13:32:21 +05:30
parent 69e0aca09c
commit cbff1d114e
4 changed files with 16 additions and 2 deletions

View File

@ -96,6 +96,7 @@
#include "nsIDOMHTMLElement.h"
#include "nsIDOMHTMLMapElement.h"
#include "nsIDOMHTMLBodyElement.h"
#include "nsIDOMHTMLHeadElement.h"
#include "nsINameSpaceManager.h"
#include "nsGenericHTMLElement.h"
#include "nsCSSLoader.h"
@ -1641,6 +1642,16 @@ nsHTMLDocument::SetBody(nsIDOMHTMLElement* aBody)
return rootElem->AppendChild(aBody, getter_AddRefs(tmp));
}
NS_IMETHODIMP
nsHTMLDocument::GetHead(nsIDOMHTMLHeadElement** aHead)
{
*aHead = nsnull;
Element* head = GetHeadElement();
return head ? CallQueryInterface(head, aHead) : NS_OK;
}
NS_IMETHODIMP
nsHTMLDocument::GetImages(nsIDOMHTMLCollection** aImages)
{

View File

@ -194,7 +194,7 @@ public:
}
virtual nsIContent* GetBodyContentExternal();
class nsAutoEditingState {
public:
nsAutoEditingState(nsHTMLDocument* aDoc, EditingState aState)

View File

@ -104,6 +104,7 @@ interface nsIDOMEventGroup;
interface nsIDOMHTMLElement;
interface nsIDOMHTMLFormElement;
interface nsIDOMHTMLCollection;
interface nsIDOMHTMLHeadElement;
// CSS
interface nsIDOMCSSValue;

View File

@ -39,7 +39,7 @@
#include "domstubs.idl"
[scriptable, uuid(43ac2f64-8a1e-488a-9468-01a2155caf63)]
[scriptable, uuid(95cd5ad4-ae8a-4f0e-b168-35e03d5e0b9a)]
interface nsIDOMNSHTMLDocument : nsISupports
{
readonly attribute long width;
@ -113,4 +113,6 @@ interface nsIDOMNSHTMLDocument : nsISupports
// returns the current value of the document or current selection for command
DOMString queryCommandValue(in DOMString commandID);
readonly attribute nsIDOMHTMLHeadElement head;
};