Commit caefa334 authored by David Faure's avatar David Faure

getElementById has been moved to Document (from HTMLDocument) in DOM 2

svn path=/trunk/kdelibs/; revision=122728
parent 76a28cec
......@@ -228,6 +228,12 @@ EntityReference Document::createEntityReference( const DOMString &name )
return 0;
}
Element Document::getElementById( const DOMString &elementId ) const
{
if(impl) return ((DocumentImpl *)impl)->getElementById( elementId );
return 0;
}
NodeList Document::getElementsByTagName( const DOMString &tagName )
{
if (impl) return ((DocumentImpl *)impl)->getElementsByTagName( tagName );
......
......@@ -361,6 +361,21 @@ public:
*/
EntityReference createEntityReference ( const DOMString &name );
/**
* Moved from HTMLDocument in DOM Level 2
* Returns the Element whose <code> id </code> is given by
* elementId. If no such element exists, returns <code> null
* </code> . Behavior is not defined if more than one element has
* this <code> id </code> .
*
* @param elementId The unique <code> id </code> value for an
* element.
*
* @return The matching element.
*
*/
Element getElementById ( const DOMString &elementId ) const;
/**
* Returns a <code> NodeList </code> of all the <code> Element
* </code> s with a given tag name in the order in which they
......
......@@ -268,12 +268,6 @@ void HTMLDocument::writeln( const DOMString &text )
((HTMLDocumentImpl *)impl)->writeln( text );
}
Element HTMLDocument::getElementById( const DOMString &elementId )
{
if(!impl) return 0;
return ((HTMLDocumentImpl *)impl)->getElementById( elementId );
}
NodeList HTMLDocument::getElementsByName( const DOMString &elementName )
{
if(!impl) return 0;
......
......@@ -263,20 +263,6 @@ public:
*/
void writeln ( const DOMString &text );
/**
* Returns the Element whose <code> id </code> is given by
* elementId. If no such element exists, returns <code> null
* </code> . Behavior is not defined if more than one element has
* this <code> id </code> .
*
* @param elementId The unique <code> id </code> value for an
* element.
*
* @return The matching element.
*
*/
Element getElementById ( const DOMString &elementId );
/**
* Returns the (possibly empty) collection of elements whose
* <code> name </code> value is given by <code> elementName
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment