Commit 5923d91c authored by Dirk Mueller's avatar Dirk Mueller

cleanups

svn path=/trunk/kdelibs/; revision=128629
parent 0a1b7c4a
All tags known by KHTML are listed in khtmltags.in.
The maketags script generates a header file from this list.
It also makes a gperf input file. gperf is than used to create
the khtmltags.c file which contains a (almost) perfect hash
function for recognizing HTML-tags.
The HTML-tokenizer converts during parsing all tags to numeric
tag-IDs. These IDs can then be used to select functions fast and
to look up relevant CSS data.
khtmlparser.cpp contains a jump-table which indexes from tag-ID
to the relevant tag-open and tag-close functions. A 0-entry means
that no function should be called for this tag.
ADDING NEW TAGS
===============
If you want to add a new tag, you can do so in the file "khtmltags.in".
Please keep this file sorted. You then have to run ./maketags to
generate a new khtmltags.h and a new hash-function so that the new tag
will be recognized. Then you should manually update the jumptable in
"khtmlparer.cpp". If you do not want to implement the tag you can add
an entry for the tag at the right position and fill it with two zeros.
......@@ -17,7 +17,7 @@
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
KDE_CXXFLAGS = $(USE_EXCEPTIONS) -UQT_NO_COMPAT
KDE_CXXFLAGS = $(USE_EXCEPTIONS) $(WOVERLOADED_VIRTUAL)
noinst_LTLIBRARIES = libkhtmldom.la
libkhtmldom_la_SOURCES = \
......@@ -47,9 +47,7 @@ myinclude_HEADERS = \
# css_extensions.h
INCLUDES = -I$(top_srcdir)/kimgio -I$(top_srcdir)/kio -I$(top_srcdir)/dcop \
-I$(top_srcdir)/khtml -I$(top_srcdir)/khtml/misc -I$(top_srcdir)/khtml/css \
-I$(top_srcdir)/khtml/dom -I$(top_srcdir)/khtml/xml -I$(top_srcdir)/khtml/html \
$(all_includes)
-I$(top_srcdir)/khtml $(all_includes)
SRCDOC_DEST=$(kde_htmldir)/en/kdelibs/khtml
......
......@@ -20,14 +20,9 @@
*
* $Id$
*/
#include "css_ruleimpl.h"
#include "css_stylesheet.h"
#include "css_value.h"
#include "dom_exception.h"
#include "dom_string.h"
#include "css/css_ruleimpl.h"
#include "css_rule.h"
using namespace DOM;
CSSRule::CSSRule()
......
......@@ -20,24 +20,21 @@
*
* $Id$
*/
#include "dom_stringimpl.h"
#include "css_stylesheet.h"
#include "css_stylesheetimpl.h"
#include "css_rule.h"
#include "dom/dom_exception.h"
#include "dom/css_rule.h"
#include "dom/dom_doc.h"
#include "dom_node.h"
#include "dom_exception.h"
#include "xml/dom_docimpl.h"
#include "misc/htmlhashes.h"
#include "html/html_headimpl.h"
#include "xml/dom_docimpl.h"
#include "dom/dom_doc.h"
#include "css/css_stylesheetimpl.h"
#include "misc/htmlhashes.h"
#include <stdio.h>
using namespace DOM;
StyleSheet::StyleSheet()
{
impl = 0;
......
......@@ -20,11 +20,12 @@
*
* $Id$
*/
#include "css_rule.h"
#include "css_value.h"
#include "css_valueimpl.h"
#include "dom_exception.h"
#include "dom_string.h"
#include "dom/css_rule.h"
#include "dom/dom_exception.h"
#include "css/css_valueimpl.h"
using namespace DOM;
CSSStyleDeclaration::CSSStyleDeclaration()
......
......@@ -21,16 +21,12 @@
* $Id$
*/
#include "dom2_events.h"
#include "dom2_views.h"
#include "dom2_eventsimpl.h"
#include "dom_string.h"
#include "dom_exception.h"
#include "dom/dom2_views.h"
#include "dom/dom_exception.h"
#include "xml/dom2_eventsimpl.h"
using namespace DOM;
EventListener::EventListener()
{
}
......@@ -86,7 +82,7 @@ DOMString Event::type() const
{
if (!impl)
throw DOMException(DOMException::INVALID_STATE_ERR);
return impl->type();
}
......@@ -176,7 +172,7 @@ DOMString Event::eventModuleName()
{
if (!impl)
throw DOMException(DOMException::INVALID_STATE_ERR);
return impl->eventModuleName();
}
......
......@@ -23,19 +23,12 @@
*
* $Id$
*/
#include "dom2_range.h"
#include "dom2_traversal.h"
#include "dom_node.h"
#include "dom_doc.h"
#include "dom_string.h"
#include "dom_text.h"
#include "dom_exception.h"
#include "dom_docimpl.h"
#include "dom2_rangeimpl.h"
#include "dom/dom_exception.h"
#include "xml/dom_docimpl.h"
#include "xml/dom2_rangeimpl.h"
using namespace DOM;
Range::Range()
{
// a range can't exist by itself - it must be associated with a document
......
......@@ -21,10 +21,8 @@
* $Id$
*/
#include "dom2_traversal.h"
#include "dom_node.h"
#include "dom_exception.h"
#include "dom2_traversalimpl.h"
#include "dom/dom_exception.h"
#include "xml/dom2_traversalimpl.h"
using namespace DOM;
......
......@@ -21,22 +21,11 @@
* $Id$
*/
/*
#include "dom2_views.h"
#include "dom2_viewsimpl.h"
#include "dom_doc.h"
#include "dom_exception.h"
*/
#include "dom2_views.h"
#include "dom_node.h"
#include "dom_exception.h"
#include "dom2_viewsimpl.h"
#include "dom_doc.h"
#include "dom2_traversal.h"
#include "dom2_traversalimpl.h"
#include "dom_element.h"
#include "dom_elementimpl.h"
#include "dom/dom2_views.h"
#include "dom/dom_exception.h"
#include "dom/dom_doc.h"
#include "xml/dom_elementimpl.h"
#include "xml/dom2_viewsimpl.h"
using namespace DOM;
......@@ -79,7 +68,7 @@ Document AbstractView::document() const
{
if (!impl)
throw DOMException(DOMException::INVALID_STATE_ERR);
return impl->document();
}
......@@ -87,7 +76,7 @@ CSSStyleDeclaration AbstractView::getComputedStyle(const Element &elt, const DOM
{
if (!impl)
throw DOMException(DOMException::INVALID_STATE_ERR);
return impl->getComputedStyle(static_cast<ElementImpl*>(elt.handle()),pseudoElt.implementation());
}
......
......@@ -21,26 +21,19 @@
* $Id$
*/
#include "dom_string.h"
#include "dom_doc.h"
#include "dom_docimpl.h"
#include "dom_node.h"
#include "dom_nodeimpl.h"
#include "dom_exception.h"
#include "dom_element.h"
#include "dom_elementimpl.h"
#include "dom_text.h"
#include "dom_xml.h"
#include "dom2_range.h"
#include "dom2_traversal.h"
#include "dom2_events.h"
#include "dom2_views.h"
#include "css_value.h"
#include "dom/dom_exception.h"
#include "dom/dom_xml.h"
#include "dom/dom2_range.h"
#include "dom/dom2_events.h"
#include "dom/dom2_views.h"
#include "xml/dom_docimpl.h"
#include "xml/dom_elementimpl.h"
#include <kdebug.h>
using namespace DOM;
DOMImplementation::DOMImplementation()
{
impl = 0;
......@@ -81,7 +74,7 @@ bool DOMImplementation::hasFeature( const DOMString &feature, const DOMString &v
}
DocumentType DOMImplementation::createDocumentType ( const DOMString &qualifiedName,
const DOMString &publicId,
const DOMString &publicId,
const DOMString &systemId )
{
if (!impl)
......
......@@ -21,11 +21,10 @@
* $Id$
*/
#include "dom_string.h"
#include "dom_element.h"
#include "dom_elementimpl.h"
#include "dom_node.h"
#include "dom_exception.h"
#include "dom/dom_exception.h"
#include "xml/dom_elementimpl.h"
using namespace DOM;
Attr::Attr() : Node()
......@@ -233,7 +232,7 @@ DOMString Element::getAttributeNS( const DOMString &namespaceURI,
}
void Element::setAttributeNS( const DOMString &namespaceURI,
const DOMString &qualifiedName,
const DOMString &qualifiedName,
const DOMString &value)
{
if (!impl)
......
......@@ -21,15 +21,13 @@
* $Id$
*/
#include "dom_node.h"
#include "dom_doc.h"
#include "dom_exception.h"
#include "dom_string.h"
#include "dom_nodeimpl.h"
#include "dom_elementimpl.h"
#include "dom2_events.h"
#include <qstring.h>
#include "dom/dom_doc.h"
#include "dom/dom_exception.h"
#include "xml/dom_elementimpl.h"
#include "dom/dom2_events.h"
#include <qrect.h>
using namespace DOM;
// ### eventually we should get these methods to throw NOT_FOUND_ERR
......
......@@ -21,10 +21,9 @@
* $Id$
*/
#include "dom_string.h"
#include "dom_stringimpl.h"
#include "dom/dom_string.h"
#include "xml/dom_stringimpl.h"
#include <kglobal.h>
using namespace DOM;
......
......@@ -21,14 +21,12 @@
* $Id$
*/
#include "dom_exception.h"
#include "dom_string.h"
#include "dom/dom_exception.h"
#include "dom/dom_text.h"
#include "xml/dom_textimpl.h"
#include "dom_text.h"
#include "dom_textimpl.h"
using namespace DOM;
CharacterData::CharacterData() : Node()
{
}
......
......@@ -22,13 +22,12 @@
*/
#include "dom_xml.h"
#include "dom_string.h"
#include "dom_textimpl.h"
#include "dom_xmlimpl.h"
#include "dom_exception.h"
using namespace DOM;
#include "dom/dom_xml.h"
#include "dom/dom_exception.h"
#include "xml/dom_textimpl.h"
#include "xml/dom_xmlimpl.h"
using namespace DOM;
CDATASection::CDATASection()
{
......
......@@ -22,15 +22,12 @@
*/
// --------------------------------------------------------------------------
#include "dom_string.h"
#include "dom/html_base.h"
#include "html/html_baseimpl.h"
#include "misc/htmlhashes.h"
#include "html_base.h"
#include "html_baseimpl.h"
using namespace DOM;
#include "htmlhashes.h"
#include "htmlhashes.h"
HTMLBodyElement::HTMLBodyElement() : HTMLElement()
{
}
......
......@@ -22,13 +22,13 @@
*/
// --------------------------------------------------------------------------
#include "dom_string.h"
#include "html_block.h"
#include "html_blockimpl.h"
#include "dom/html_block.h"
#include "html/html_blockimpl.h"
using namespace DOM;
#include "htmlhashes.h"
#include "misc/htmlhashes.h"
HTMLBlockquoteElement::HTMLBlockquoteElement() : HTMLElement()
{
......
......@@ -24,20 +24,13 @@
#include "html_document.h"
#include "dom_node.h"
#include "dom_element.h"
#include "dom_doc.h"
#include "dom_string.h"
#include "dom_textimpl.h"
#include "html_misc.h"
#include "html_element.h"
#include "html_documentimpl.h"
#include "html_elementimpl.h"
#include "html_miscimpl.h"
#include "htmlhashes.h"
#include "khtmlview.h"
using namespace DOM;
#include "dom/html_misc.h"
#include "xml/dom_textimpl.h"
#include "html/html_documentimpl.h"
#include "html/html_miscimpl.h"
#include "misc/htmlhashes.h"
using namespace DOM;
HTMLDocument::HTMLDocument() : Document(false) // create the impl here
{
......@@ -194,7 +187,7 @@ void HTMLDocument::setCookie( const DOMString & value )
{
if (impl)
((HTMLDocumentImpl *)impl)->setCookie(value);
}
void HTMLDocument::open( )
......
......@@ -20,15 +20,14 @@
*
* $Id$
*/
#include "dom_string.h"
#include "html_element.h"
#include "html_elementimpl.h"
#include "html_misc.h" // HTMLCollection
#include "html_miscimpl.h" // HTMLCollectionImpl
#include "dom_exception.h"
using namespace DOM;
#include "dom/dom_exception.h"
#include "dom/html_misc.h"
#include "html/html_miscimpl.h" // HTMLCollectionImpl
#include "htmlhashes.h"
#include "misc/htmlhashes.h"
using namespace DOM;
HTMLElement::HTMLElement() : Element()
{
......
......@@ -22,16 +22,17 @@
*/
// --------------------------------------------------------------------------
#include "html_form.h"
#include "html_formimpl.h"
#include "dom_doc.h"
#include "dom_string.h"
#include "html_miscimpl.h"
#include "dom_exception.h"
#include "dom_docimpl.h"
using namespace DOM;
#include "dom/html_form.h"
#include "dom/dom_exception.h"
#include "dom/dom_doc.h"
#include "html/html_formimpl.h"
#include "html/html_miscimpl.h"
#include "htmlhashes.h"
#include "xml/dom_docimpl.h"
#include "misc/htmlhashes.h"
using namespace DOM;
HTMLButtonElement::HTMLButtonElement() : HTMLElement()
{
......
......@@ -22,13 +22,11 @@
*/
// --------------------------------------------------------------------------
#include "dom_string.h"
#include "html_form.h"
#include "html_head.h"
#include "html_headimpl.h"
using namespace DOM;
#include "dom/html_head.h"
#include "html/html_headimpl.h"
#include "misc/htmlhashes.h"
#include "htmlhashes.h"
using namespace DOM;
HTMLBaseElement::HTMLBaseElement() : HTMLElement()
{
......
......@@ -22,15 +22,15 @@
*/
// --------------------------------------------------------------------------
#include "dom_string.h"
#include "dom_doc.h"
#include "html_image.h"
#include "html_imageimpl.h"
#include "html_misc.h"
#include "html_miscimpl.h"
using namespace DOM;
#include "dom/dom_doc.h"
#include "dom/html_image.h"
#include "dom/html_misc.h"
#include "html/html_imageimpl.h"
#include "html/html_miscimpl.h"
#include "misc/htmlhashes.h"
#include "htmlhashes.h"
using namespace DOM;
HTMLAreaElement::HTMLAreaElement() : HTMLElement()
{
......
......@@ -22,14 +22,13 @@
*/
// --------------------------------------------------------------------------
#include "dom_string.h"
#include "html_inline.h"
#include "html_inlineimpl.h"
#include "html_baseimpl.h"
#include "dom_docimpl.h"
using namespace DOM;
#include "dom/html_inline.h"
#include "html/html_inlineimpl.h"
#include "html/html_baseimpl.h"
#include "xml/dom_docimpl.h"
#include "misc/htmlhashes.h"
#include "htmlhashes.h"
using namespace DOM;
HTMLAnchorElement::HTMLAnchorElement() : HTMLElement()
{
......
......@@ -22,11 +22,11 @@
*/
// --------------------------------------------------------------------------
#include "html_list.h"
#include "html_listimpl.h"
using namespace DOM;
#include "dom/html_list.h"
#include "html/html_listimpl.h"
#include "misc/htmlhashes.h"
#include "htmlhashes.h"
using namespace DOM;
HTMLDListElement::HTMLDListElement() : HTMLElement()
{
......
......@@ -22,14 +22,12 @@
*/
// --------------------------------------------------------------------------
#include "dom_string.h"
#include "dom/html_misc.h"
#include "html/html_miscimpl.h"
#include "misc/htmlhashes.h"
#include "html_misc.h"
#include "html_miscimpl.h"
using namespace DOM;
#include "htmlhashes.h"
HTMLBaseFontElement::HTMLBaseFontElement() : HTMLElement()
{
}
......
......@@ -20,16 +20,12 @@
*
* $Id$
*/
#include "html_object.h"
#include "dom_string.h"
#include "html_misc.h"
#include "html_miscimpl.h"
#include "html_objectimpl.h"
#include "html_element.h"
#include "html_elementimpl.h"
#include "dom/html_object.h"
#include "htmlhashes.h"
#include "html/html_objectimpl.h"
#include "misc/htmlhashes.h"
HTMLAppletElement::HTMLAppletElement() : HTMLElement()