[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
hyatt
hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:38:39 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit acbb0d415f864359a7a8b53b5d107b5e4c691f4c
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Apr 25 01:32:49 2003 +0000
Rename inQuirksMode to inCompatMode. Drop uses of it in
the render tree code in favor of style()->htmlHacks().
Remove dead code in the parser dealing with discarded attributes.
Optimize bidi run justification by adding a guard.
Fix :target to not match :root when no fragment ID is specified.
Reviewed by mjs/gramps
* khtml/css/cssstyleselector.cpp:
* khtml/html/html_baseimpl.cpp:
(HTMLBodyElementImpl::parseAttribute):
* khtml/html/html_headimpl.cpp:
(HTMLLinkElementImpl::setStyleSheet):
(HTMLStyleElementImpl::childrenChanged):
* khtml/html/html_tableimpl.cpp:
(HTMLTableElementImpl::createSharedCellDecls):
* khtml/html/htmlparser.cpp:
(KHTMLParser::~KHTMLParser):
(KHTMLParser::reset):
(KHTMLParser::parseToken):
(KHTMLParser::insertNode):
* khtml/html/htmlparser.h:
* khtml/html/htmltokenizer.cpp:
(HTMLTokenizer::parseTag):
* khtml/khtml_part.cpp:
(KHTMLPart::gotoAnchor):
* khtml/rendering/bidi.cpp:
* khtml/rendering/render_block.cpp:
* khtml/rendering/render_flow.cpp:
(RenderFlow::paintLineBoxDecorations):
(RenderFlow::repaint):
* khtml/rendering/render_inline.cpp:
* khtml/rendering/render_inline.h:
* khtml/rendering/render_list.cpp:
(getParentOfFirstLineBox):
* khtml/rendering/render_object.cpp:
(RenderObject::createObject):
* khtml/rendering/render_text.cpp:
(RenderText::paintObject):
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::DocumentImpl):
(DocumentImpl::recalcStyle):
(DocumentImpl::recalcStyleSelector):
* khtml/xml/dom_docimpl.h:
* khtml/xml/dom_elementimpl.cpp:
(ElementImpl::createDecl):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4182 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index a57ac9f..f9a1c5b 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,55 @@
+2003-04-24 David Hyatt <hyatt at apple.com>
+
+ Rename inQuirksMode to inCompatMode. Drop uses of it in
+ the render tree code in favor of style()->htmlHacks().
+
+ Remove dead code in the parser dealing with discarded attributes.
+
+ Optimize bidi run justification by adding a guard.
+
+ Fix :target to not match :root when no fragment ID is specified.
+
+ Reviewed by mjs/gramps
+
+ * khtml/css/cssstyleselector.cpp:
+ * khtml/html/html_baseimpl.cpp:
+ (HTMLBodyElementImpl::parseAttribute):
+ * khtml/html/html_headimpl.cpp:
+ (HTMLLinkElementImpl::setStyleSheet):
+ (HTMLStyleElementImpl::childrenChanged):
+ * khtml/html/html_tableimpl.cpp:
+ (HTMLTableElementImpl::createSharedCellDecls):
+ * khtml/html/htmlparser.cpp:
+ (KHTMLParser::~KHTMLParser):
+ (KHTMLParser::reset):
+ (KHTMLParser::parseToken):
+ (KHTMLParser::insertNode):
+ * khtml/html/htmlparser.h:
+ * khtml/html/htmltokenizer.cpp:
+ (HTMLTokenizer::parseTag):
+ * khtml/khtml_part.cpp:
+ (KHTMLPart::gotoAnchor):
+ * khtml/rendering/bidi.cpp:
+ * khtml/rendering/render_block.cpp:
+ * khtml/rendering/render_flow.cpp:
+ (RenderFlow::paintLineBoxDecorations):
+ (RenderFlow::repaint):
+ * khtml/rendering/render_inline.cpp:
+ * khtml/rendering/render_inline.h:
+ * khtml/rendering/render_list.cpp:
+ (getParentOfFirstLineBox):
+ * khtml/rendering/render_object.cpp:
+ (RenderObject::createObject):
+ * khtml/rendering/render_text.cpp:
+ (RenderText::paintObject):
+ * khtml/xml/dom_docimpl.cpp:
+ (DocumentImpl::DocumentImpl):
+ (DocumentImpl::recalcStyle):
+ (DocumentImpl::recalcStyleSelector):
+ * khtml/xml/dom_docimpl.h:
+ * khtml/xml/dom_elementimpl.cpp:
+ (ElementImpl::createDecl):
+
2003-04-24 Darin Adler <darin at apple.com>
Reviewed by Chris.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index a57ac9f..f9a1c5b 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,55 @@
+2003-04-24 David Hyatt <hyatt at apple.com>
+
+ Rename inQuirksMode to inCompatMode. Drop uses of it in
+ the render tree code in favor of style()->htmlHacks().
+
+ Remove dead code in the parser dealing with discarded attributes.
+
+ Optimize bidi run justification by adding a guard.
+
+ Fix :target to not match :root when no fragment ID is specified.
+
+ Reviewed by mjs/gramps
+
+ * khtml/css/cssstyleselector.cpp:
+ * khtml/html/html_baseimpl.cpp:
+ (HTMLBodyElementImpl::parseAttribute):
+ * khtml/html/html_headimpl.cpp:
+ (HTMLLinkElementImpl::setStyleSheet):
+ (HTMLStyleElementImpl::childrenChanged):
+ * khtml/html/html_tableimpl.cpp:
+ (HTMLTableElementImpl::createSharedCellDecls):
+ * khtml/html/htmlparser.cpp:
+ (KHTMLParser::~KHTMLParser):
+ (KHTMLParser::reset):
+ (KHTMLParser::parseToken):
+ (KHTMLParser::insertNode):
+ * khtml/html/htmlparser.h:
+ * khtml/html/htmltokenizer.cpp:
+ (HTMLTokenizer::parseTag):
+ * khtml/khtml_part.cpp:
+ (KHTMLPart::gotoAnchor):
+ * khtml/rendering/bidi.cpp:
+ * khtml/rendering/render_block.cpp:
+ * khtml/rendering/render_flow.cpp:
+ (RenderFlow::paintLineBoxDecorations):
+ (RenderFlow::repaint):
+ * khtml/rendering/render_inline.cpp:
+ * khtml/rendering/render_inline.h:
+ * khtml/rendering/render_list.cpp:
+ (getParentOfFirstLineBox):
+ * khtml/rendering/render_object.cpp:
+ (RenderObject::createObject):
+ * khtml/rendering/render_text.cpp:
+ (RenderText::paintObject):
+ * khtml/xml/dom_docimpl.cpp:
+ (DocumentImpl::DocumentImpl):
+ (DocumentImpl::recalcStyle):
+ (DocumentImpl::recalcStyleSelector):
+ * khtml/xml/dom_docimpl.h:
+ * khtml/xml/dom_elementimpl.cpp:
+ (ElementImpl::createDecl):
+
2003-04-24 Darin Adler <darin at apple.com>
Reviewed by Chris.
diff --git a/WebCore/khtml/css/cssstyleselector.cpp b/WebCore/khtml/css/cssstyleselector.cpp
index d168f51..60cf1be 100644
--- a/WebCore/khtml/css/cssstyleselector.cpp
+++ b/WebCore/khtml/css/cssstyleselector.cpp
@@ -908,9 +908,6 @@ bool CSSStyleSelector::checkOneSelector(DOM::CSSSelector *sel, DOM::ElementImpl
}
break;
case CSSSelector::PseudoTarget:
- if (!e->getDocument()->getCSSTarget() && // :target matches the root when no CSS target exists
- e == e->getDocument()->documentElement())
- return true;
if (e == e->getDocument()->getCSSTarget())
return true;
break;
diff --git a/WebCore/khtml/html/html_baseimpl.cpp b/WebCore/khtml/html/html_baseimpl.cpp
index f4aaaff..3a08d56 100644
--- a/WebCore/khtml/html/html_baseimpl.cpp
+++ b/WebCore/khtml/html/html_baseimpl.cpp
@@ -124,7 +124,7 @@ void HTMLBodyElementImpl::parseAttribute(AttributeImpl *attr)
else if ( attr->id() == ATTR_ALINK )
aStr = "a:active";
aStr += " { color: " + attr->value().string() + "; }";
- m_styleSheet->parseString(aStr, !getDocument()->inQuirksMode());
+ m_styleSheet->parseString(aStr, !getDocument()->inCompatMode());
m_styleSheet->setNonCSSHints();
if (attached())
getDocument()->updateStyleSelector();
diff --git a/WebCore/khtml/html/html_headimpl.cpp b/WebCore/khtml/html/html_headimpl.cpp
index e7e91ac..3edd866 100644
--- a/WebCore/khtml/html/html_headimpl.cpp
+++ b/WebCore/khtml/html/html_headimpl.cpp
@@ -264,9 +264,9 @@ void HTMLLinkElementImpl::setStyleSheet(const DOM::DOMString &url, const DOM::DO
if (m_sheet)
m_sheet->deref();
m_sheet = new CSSStyleSheetImpl(this, url);
- kdDebug( 6030 ) << "style sheet parse mode strict = " << ( !getDocument()->inQuirksMode() ) << endl;
+ kdDebug( 6030 ) << "style sheet parse mode strict = " << ( !getDocument()->inCompatMode() ) << endl;
m_sheet->ref();
- m_sheet->parseString( sheetStr, !getDocument()->inQuirksMode() );
+ m_sheet->parseString( sheetStr, !getDocument()->inCompatMode() );
MediaListImpl *media = new MediaListImpl( m_sheet, m_media );
m_sheet->setMedia( media );
@@ -427,7 +427,7 @@ void HTMLStyleElementImpl::childrenChanged()
m_loading = true;
m_sheet = new CSSStyleSheetImpl(this);
m_sheet->ref();
- m_sheet->parseString( text, !getDocument()->inQuirksMode() );
+ m_sheet->parseString( text, !getDocument()->inCompatMode() );
MediaListImpl *media = new MediaListImpl( m_sheet, m_media );
m_sheet->setMedia( media );
m_loading = false;
diff --git a/WebCore/khtml/html/html_tableimpl.cpp b/WebCore/khtml/html/html_tableimpl.cpp
index 87fe158..8462661 100644
--- a/WebCore/khtml/html/html_tableimpl.cpp
+++ b/WebCore/khtml/html/html_tableimpl.cpp
@@ -91,7 +91,7 @@ DOM::CSSStyleDeclarationImpl* HTMLTableElementImpl::createSharedCellDecls()
m_sharedCellDecls->ref();
m_sharedCellDecls->setParent(getDocument()->elementSheet());
m_sharedCellDecls->setNode(this);
- m_sharedCellDecls->setStrictParsing( !getDocument()->inQuirksMode() );
+ m_sharedCellDecls->setStrictParsing( !getDocument()->inCompatMode() );
if (m_noBorder)
m_sharedCellDecls->setProperty(CSS_PROP_BORDER_WIDTH, "0", false, true);
diff --git a/WebCore/khtml/html/htmlparser.cpp b/WebCore/khtml/html/htmlparser.cpp
index 7ee0635..a47f847 100644
--- a/WebCore/khtml/html/htmlparser.cpp
+++ b/WebCore/khtml/html/htmlparser.cpp
@@ -157,11 +157,6 @@ KHTMLParser::~KHTMLParser()
delete [] forbiddenTag;
delete isindex;
-
- for (int i = 0; i < DISCARD_MAX; i++) {
- if (discardedAttrs[i])
- discardedAttrs[i]->deref();
- }
}
void KHTMLParser::reset()
@@ -186,10 +181,6 @@ void KHTMLParser::reset()
isindex = 0;
discard_until = 0;
-
- discardedStackPos = 0;
- for (int i = 0; i < DISCARD_MAX; i++)
- discardedAttrs[i] = 0;
}
void KHTMLParser::parseToken(Token *t)
@@ -216,7 +207,7 @@ void KHTMLParser::parseToken(Token *t)
// holy shit. apparently some sites use </br> instead of <br>
// be compatible with IE and NS
- if(t->id == ID_BR+ID_CLOSE_TAG && document->document()->inQuirksMode())
+ if(t->id == ID_BR+ID_CLOSE_TAG && document->document()->inCompatMode())
t->id -= ID_CLOSE_TAG;
if(t->id > ID_CLOSE_TAG)
@@ -269,17 +260,6 @@ void KHTMLParser::parseToken(Token *t)
{
ElementImpl *e = static_cast<ElementImpl *>(n);
e->setAttributeMap(0);
-
- // Save the discarded attributes in case we do a reconstruction later.
- // For <table><form><tr bgcolor=blue>..., we need to save off the bgcolor
- // so that when we recreate the row, we can reattach the correct attributes.
- // <body> fixup is handled already, so we don't need to deal with that here. -dwh
- if ((n->id() == ID_TR || n->id() == ID_TD) && discardedStackPos < DISCARD_MAX) {
- if (t->attrs)
- t->attrs->ref();
- discardedAttrs[discardedStackPos] = t->attrs;
- discardedStackPos++;
- }
}
#ifdef PARSER_DEBUG
@@ -653,14 +633,6 @@ bool KHTMLParser::insertNode(NodeImpl *n, bool flat)
else
e = new HTMLTableRowElementImpl( document );
- // Now reattach any discarded attributes if they exist. -dwh
- if (discardedStackPos > 0 && current->id() != ID_TABLE) {
- discardedStackPos--;
- e->setAttributeMap(discardedAttrs[discardedStackPos]);
- if (discardedAttrs[discardedStackPos])
- discardedAttrs[discardedStackPos]->deref();
- discardedAttrs[discardedStackPos] = 0;
- }
insertNode(e);
handled = true;
break;
diff --git a/WebCore/khtml/html/htmlparser.h b/WebCore/khtml/html/htmlparser.h
index 20d2f20..eac4eb2 100644
--- a/WebCore/khtml/html/htmlparser.h
+++ b/WebCore/khtml/html/htmlparser.h
@@ -133,13 +133,6 @@ protected:
void reopenResidualStyleTags(HTMLStackElem* elem);
ushort *forbiddenTag;
-
- // For error handling, we sometimes destroy and recreate elements (usually when
- // a form is nested inside a table and outside a row). Hold onto a single
- // element's attribute map so that we can reattach it later should we need to. -dwh
-#define DISCARD_MAX 5
- DOM::NamedAttrMapImpl* discardedAttrs[DISCARD_MAX];
- int discardedStackPos;
/*
* currently active form
diff --git a/WebCore/khtml/html/htmltokenizer.cpp b/WebCore/khtml/html/htmltokenizer.cpp
index ad5a593..fb87600 100644
--- a/WebCore/khtml/html/htmltokenizer.cpp
+++ b/WebCore/khtml/html/htmltokenizer.cpp
@@ -878,7 +878,7 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
// Fix bug 34302 at kde.bugs.org. Go ahead and treat
// <!--> as a valid comment, since both mozilla and IE on windows
// can handle this case. Only do this in quirks mode. -dwh
- if (*src == '>' && parser->doc()->inQuirksMode()) {
+ if (*src == '>' && parser->doc()->inCompatMode()) {
comment = false;
++src;
cBuffer[cBufferPos++] = src->cell();
diff --git a/WebCore/khtml/khtml_part.cpp b/WebCore/khtml/khtml_part.cpp
index 272e7f5..d92574d 100644
--- a/WebCore/khtml/khtml_part.cpp
+++ b/WebCore/khtml/khtml_part.cpp
@@ -1961,7 +1961,7 @@ bool KHTMLPart::gotoAnchor( const QString &name )
HTMLCollectionImpl *anchors =
new HTMLCollectionImpl( d->m_doc, HTMLCollectionImpl::DOC_ANCHORS);
anchors->ref();
- n = anchors->namedItem(name, !d->m_doc->inQuirksMode());
+ n = anchors->namedItem(name, !d->m_doc->inCompatMode());
anchors->deref();
}
diff --git a/WebCore/khtml/rendering/bidi.cpp b/WebCore/khtml/rendering/bidi.cpp
index 056b2e1..b24ba26 100644
--- a/WebCore/khtml/rendering/bidi.cpp
+++ b/WebCore/khtml/rendering/bidi.cpp
@@ -698,25 +698,29 @@ void RenderBlock::computeHorizontalPositionsForLine(InlineFlowBox* lineBox, Bidi
break;
}
- for (r = sFirstBidiRun; r; r = r->nextRun) {
- int spaceAdd = 0;
- if (numSpaces > 0 && r->obj->isText() && !r->compact) {
- // get the number of spaces in the run
- int spaces = 0;
- for ( int i = r->start; i < r->stop; i++ )
- if ( static_cast<RenderText *>(r->obj)->text()[i].direction() == QChar::DirWS )
- spaces++;
- KHTMLAssert(spaces <= numSpaces);
- spaceAdd = (availableWidth - totWidth)*spaces/numSpaces;
- numSpaces -= spaces;
- totWidth += spaceAdd;
- static_cast<TextRun*>(r->box)->setSpaceAdd(spaceAdd);
+ if (numSpaces > 0) {
+ for (r = sFirstBidiRun; r; r = r->nextRun) {
+ int spaceAdd = 0;
+ if (numSpaces > 0 && r->obj->isText() && !r->compact) {
+ // get the number of spaces in the run
+ int spaces = 0;
+ for ( int i = r->start; i < r->stop; i++ )
+ if ( static_cast<RenderText *>(r->obj)->text()[i].direction() == QChar::DirWS )
+ spaces++;
+ KHTMLAssert(spaces <= numSpaces);
+ spaceAdd = (availableWidth - totWidth)*spaces/numSpaces;
+ numSpaces -= spaces;
+ totWidth += spaceAdd;
+ static_cast<TextRun*>(r->box)->setSpaceAdd(spaceAdd);
+ }
}
}
-
+
// The widths of all runs are now known. We can now place every inline box (and
// compute accurate widths for the inline flow boxes).
- lineBox->placeBoxesHorizontally(x);
+ int rightPos = lineBox->placeBoxesHorizontally(x);
+ if (rightPos > m_overflowWidth)
+ m_overflowWidth = rightPos; // FIXME: Work for rtl overflow also.
}
void RenderBlock::computeVerticalPositionsForLine(InlineFlowBox* lineBox)
@@ -1788,7 +1792,6 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start)
end:
- int determinedWidth = w + tmpW;
if( lBreak == start && !lBreak.obj->isBR() ) {
// we just add as much as possible
if ( m_pre ) {
@@ -1804,7 +1807,6 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start)
// better to break between object boundaries than in the middle of a word
lBreak.obj = o;
lBreak.pos = 0;
- determinedWidth -= tmpW;
} else {
// Don't ever break in the middle of a word if we can help it.
// There's no room at all. We just have to be on this line,
@@ -1815,10 +1817,6 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start)
}
}
- // FIXME: XXXdwh Support rtl.
- if (style()->direction() == LTR && m_overflowWidth < borderLeft() + paddingLeft() + determinedWidth)
- m_overflowWidth = borderLeft() + paddingLeft() + determinedWidth;
-
// make sure we consume at least one char/object.
if( lBreak == start )
++lBreak;
diff --git a/WebCore/khtml/rendering/render_block.cpp b/WebCore/khtml/rendering/render_block.cpp
index 7bde4bf..bc99c69 100644
--- a/WebCore/khtml/rendering/render_block.cpp
+++ b/WebCore/khtml/rendering/render_block.cpp
@@ -595,7 +595,7 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
bool bottomChildQuirk = false;
bool determinedTopQuirk = false;
- bool strictMode = isAnonymousBox() ? true : (!element()->getDocument()->inQuirksMode());
+ bool strictMode = !style()->htmlHacks();
//kdDebug() << "RenderBlock::layoutBlockChildren " << prevMargin << endl;
diff --git a/WebCore/khtml/rendering/render_flow.cpp b/WebCore/khtml/rendering/render_flow.cpp
index d582974..b7a1457 100644
--- a/WebCore/khtml/rendering/render_flow.cpp
+++ b/WebCore/khtml/rendering/render_flow.cpp
@@ -210,11 +210,7 @@ void RenderFlow::paintLineBoxDecorations(QPainter *p, int _x, int _y,
if (style()->visibility() == VISIBLE && paintAction == PaintActionForeground) {
// We only paint line box decorations in strict or almost strict mode.
// Otherwise we let the TextRuns paint their own decorations.
- RenderObject* curr = this;
- while (curr && !curr->element())
- curr = curr->container();
- bool quirksMode = (curr && curr->element()->getDocument()->inQuirksMode());
- if (quirksMode)
+ if (style()->htmlHacks())
return;
// We can check the first box and last box and avoid painting if we don't
@@ -260,7 +256,7 @@ void RenderFlow::repaint(bool immediate)
effectiveWidth()+ow*2, effectiveHeight()+ow*2, immediate);
}
else
- return RenderBox::repaint();
+ return RenderBox::repaint(immediate);
}
}
diff --git a/WebCore/khtml/rendering/render_inline.cpp b/WebCore/khtml/rendering/render_inline.cpp
index 9004799..ca501ef 100644
--- a/WebCore/khtml/rendering/render_inline.cpp
+++ b/WebCore/khtml/rendering/render_inline.cpp
@@ -1,6 +1,8 @@
/*
* This file is part of the render object implementation for KHTML.
*
+ * Copyright (C) 1999 Lars Knoll (knoll at kde.org)
+ * (C) 1999 Antti Koivisto (koivisto at kde.org)
* Copyright (C) 2003 Apple Computer, Inc.
*
* This library is free software; you can redistribute it and/or
diff --git a/WebCore/khtml/rendering/render_inline.h b/WebCore/khtml/rendering/render_inline.h
index f2be1a1..023c138 100644
--- a/WebCore/khtml/rendering/render_inline.h
+++ b/WebCore/khtml/rendering/render_inline.h
@@ -1,6 +1,8 @@
/*
* This file is part of the render object implementation for KHTML.
*
+ * Copyright (C) 1999 Lars Knoll (knoll at kde.org)
+ * (C) 1999 Antti Koivisto (koivisto at kde.org)
* Copyright (C) 2003 Apple Computer, Inc.
*
* This library is free software; you can redistribute it and/or
diff --git a/WebCore/khtml/rendering/render_list.cpp b/WebCore/khtml/rendering/render_list.cpp
index 8a9552c..401414b 100644
--- a/WebCore/khtml/rendering/render_list.cpp
+++ b/WebCore/khtml/rendering/render_list.cpp
@@ -210,8 +210,7 @@ static RenderObject* getParentOfFirstLineBox(RenderObject* curr, RenderObject* m
if (currChild->isTable() || !currChild->isRenderBlock())
break;
- if (currChild->element() &&
- (currChild->element()->getDocument()->inQuirksMode()) &&
+ if (currChild->style()->htmlHacks() && currChild->element() &&
(currChild->element()->id() == ID_UL || currChild->element()->id() == ID_OL))
break;
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index 13bda0e..1302cd9 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -68,16 +68,15 @@ RenderObject *RenderObject::createObject(DOM::NodeImpl* node, RenderStyle* styl
break;
case INLINE:
case BLOCK:
- // In quirks mode, if <td> has a display of block, build a table cell instead.
+ // In compat mode, if <td> has a display of block, build a table cell instead.
// This corrects erroneous HTML. A better fix would be to implement full-blown
// CSS2 anonymous table render object construction, but until then, this will have
// to suffice. -dwh
- if (style->display() == BLOCK && node->id() == ID_TD &&
- node->getDocument()->inQuirksMode())
+ if (style->display() == BLOCK && node->id() == ID_TD && style->htmlHacks())
o = new (arena) RenderTableCell(node);
// In quirks mode if <table> has a display of block, make a table. If it has
// a display of inline, make an inline-table.
- else if (node->id() == ID_TABLE && node->getDocument()->inQuirksMode())
+ else if (node->id() == ID_TABLE && style->htmlHacks())
o = new (arena) RenderTable(node);
else if (style->display() == INLINE)
o = new (arena) RenderInline(node);
diff --git a/WebCore/khtml/rendering/render_text.cpp b/WebCore/khtml/rendering/render_text.cpp
index ec777dc..273e6f5 100644
--- a/WebCore/khtml/rendering/render_text.cpp
+++ b/WebCore/khtml/rendering/render_text.cpp
@@ -728,16 +728,10 @@ void RenderText::paintObject(QPainter *p, int /*x*/, int y, int /*w*/, int h,
}
}
- if (d != TDNONE && paintAction == PaintActionForeground)
- {
- RenderObject* curr = this;
- while (curr && !curr->element())
- curr = curr->container();
- bool quirksMode = (curr && curr->element()->getDocument()->inQuirksMode());
- if (quirksMode) {
- p->setPen(_style->color());
- s->paintDecoration(p, tx, ty, d);
- }
+ if (d != TDNONE && paintAction == PaintActionForeground &&
+ style()->htmlHacks()) {
+ p->setPen(_style->color());
+ s->paintDecoration(p, tx, ty, d);
}
#if APPLE_CHANGES
diff --git a/WebCore/khtml/xml/dom_docimpl.cpp b/WebCore/khtml/xml/dom_docimpl.cpp
index dd569f7..d7ed68c 100644
--- a/WebCore/khtml/xml/dom_docimpl.cpp
+++ b/WebCore/khtml/xml/dom_docimpl.cpp
@@ -295,7 +295,7 @@ DocumentImpl::DocumentImpl(DOMImplementationImpl *_implementation, KHTMLView *v)
m_usesDescendantRules = false;
m_styleSelector = new CSSStyleSelector( this, m_usersheet, m_styleSheets, m_url,
- !inQuirksMode() );
+ !inCompatMode() );
m_windowEventListeners.setAutoDelete(true);
m_pendingStylesheets = 0;
@@ -931,7 +931,7 @@ void DocumentImpl::recalcStyle( StyleChange change )
//kdDebug() << "DocumentImpl::attach: setting to charset " << settings->charset() << endl;
_style->setFontDef(fontDef);
_style->htmlFont().update( paintDeviceMetrics() );
- if ( inQuirksMode() )
+ if ( inCompatMode() )
_style->setHtmlHacks(true); // enable html specific rendering tricks
StyleChange ch = diff( _style, oldStyle );
@@ -2000,7 +2000,7 @@ void DocumentImpl::recalcStyleSelector()
if ( m_view && m_view->mediaType() == "print" )
usersheet += m_printSheet;
m_styleSelector = new CSSStyleSelector( this, usersheet, m_styleSheets, m_url,
- !inQuirksMode() );
+ !inCompatMode() );
m_styleSelectorDirty = false;
}
diff --git a/WebCore/khtml/xml/dom_docimpl.h b/WebCore/khtml/xml/dom_docimpl.h
index 1414cbe..4067ed8 100644
--- a/WebCore/khtml/xml/dom_docimpl.h
+++ b/WebCore/khtml/xml/dom_docimpl.h
@@ -299,7 +299,7 @@ public:
void setParseMode( ParseMode m ) { pMode = m; }
ParseMode parseMode() const { return pMode; }
- bool inQuirksMode() { return pMode == Compat; }
+ bool inCompatMode() { return pMode == Compat; }
bool inAlmostStrictMode() { return pMode == AlmostStrict; }
bool inStrictMode() { return pMode == Strict; }
diff --git a/WebCore/khtml/xml/dom_elementimpl.cpp b/WebCore/khtml/xml/dom_elementimpl.cpp
index 19a30e8..1fb4199 100644
--- a/WebCore/khtml/xml/dom_elementimpl.cpp
+++ b/WebCore/khtml/xml/dom_elementimpl.cpp
@@ -432,7 +432,7 @@ void ElementImpl::createDecl( )
m_styleDecls->ref();
m_styleDecls->setParent(getDocument()->elementSheet());
m_styleDecls->setNode(this);
- m_styleDecls->setStrictParsing( !getDocument()->inQuirksMode() );
+ m_styleDecls->setStrictParsing( !getDocument()->inCompatMode() );
}
void ElementImpl::dispatchAttrRemovalEvent(AttributeImpl *attr)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list