SVN commit 497604 by carewolf: Some slight clean-up in setting CSS content M +9 -10 css/cssstyleselector.cpp M +10 -1 rendering/render_style.cpp M +2 -1 rendering/render_style.h --- branches/KDE/3.5/kdelibs/khtml/css/cssstyleselector.cpp #497603:497604 @@ -3169,17 +3169,20 @@ break; if (isInitial) { - style->clearContent(); + style->setContentNormal(); return; } if (primitiveValue && primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_IDENT) { // normal | none - if (primitiveValue->getIdent() == CSS_VAL_NORMAL || primitiveValue->getIdent() == CSS_VAL_NONE) { - style->clearContent(); - return; - } - assert(false); + if (primitiveValue->getIdent() == CSS_VAL_NORMAL) + style->setContentNormal(); + else + if (primitiveValue->getIdent() == CSS_VAL_NONE) + style->setContentNone(); + else + assert(false); + return; } if(!value->isValueList()) return; @@ -3215,10 +3218,6 @@ } else if (val->primitiveType()==CSSPrimitiveValue::CSS_IDENT) { - //DOM::DOMString quotes("-khtml-quotes"); - //CounterImpl *counter = new CounterImpl; - //counter->m_identifier = quotes; - //counter->m_listStyle = LNONE; EQuoteContent quote; switch (val->getIdent()) { case CSS_VAL_OPEN_QUOTE: --- branches/KDE/3.5/kdelibs/khtml/rendering/render_style.cpp #497603:497604 @@ -745,6 +745,10 @@ if (c1->_content.counter != c2->_content.counter) return false; } + else if (c1->_contentType == CONTENT_QUOTE) { + if (c1->_content.quote != c2->_content.quote) + return false; + } c1 = c1->_nextContent; c2 = c2->_nextContent; @@ -878,11 +882,16 @@ newContentData->_contentType = CONTENT_QUOTE; } -void RenderStyle::clearContent() { +void RenderStyle::setContentNormal() { delete content; content = 0; } +void RenderStyle::setContentNone() { + setContentNormal(); + content = new ContentData; +} + ContentData::~ContentData() { clearContent(); --- branches/KDE/3.5/kdelibs/khtml/rendering/render_style.h #497603:497604 @@ -1275,7 +1275,8 @@ void setContent(CachedObject* o, bool add); void setContent(DOM::CounterImpl* c, bool add); void setContent(EQuoteContent q, bool add); - void clearContent(); + void setContentNone(); + void setContentNormal(); DOM::CSSValueListImpl* counterReset() const { return counter_reset; } DOM::CSSValueListImpl* counterIncrement() const { return counter_increment; }