[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
mjs
mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:11:46 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit a6baa4649a183891d2573506212bc927b4f472ca
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Nov 14 19:29:44 2003 +0000
Reviewed by Ken.
- fixed 3471925 - getting and setting cssText not implemented
* khtml/css/css_valueimpl.cpp:
(CSSStyleDeclarationImpl::cssText): Implemented by gathering text of all
properties, separated with semicolons.
(CSSStyleDeclarationImpl::setCssText): Implemented by clearing all existing
properties and invoking css parser.
(CSSValueListImpl::cssText): Implemented.
(FontValueImpl::cssText): Implemented.
(ShadowValueImpl::cssText): Implemented.
(CSSProperty::cssText): Implemented.
* khtml/css/css_valueimpl.h: Declared new methods; made
CSSValueImpl::cssText() pure virtual; removed
CSSValueImpl::setCssText().
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5496 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index a30e549..fd31d08 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,22 @@
+2003-11-14 Maciej Stachowiak <mjs at apple.com>
+
+ Reviewed by Ken.
+
+ - fixed 3471925 - getting and setting cssText not implemented
+
+ * khtml/css/css_valueimpl.cpp:
+ (CSSStyleDeclarationImpl::cssText): Implemented by gathering text of all
+ properties, separated with semicolons.
+ (CSSStyleDeclarationImpl::setCssText): Implemented by clearing all existing
+ properties and invoking css parser.
+ (CSSValueListImpl::cssText): Implemented.
+ (FontValueImpl::cssText): Implemented.
+ (ShadowValueImpl::cssText): Implemented.
+ (CSSProperty::cssText): Implemented.
+ * khtml/css/css_valueimpl.h: Declared new methods; made
+ CSSValueImpl::cssText() pure virtual; removed
+ CSSValueImpl::setCssText().
+
2003-11-14 Darin Adler <darin at apple.com>
Reviewed by John.
diff --git a/WebCore/khtml/css/css_valueimpl.cpp b/WebCore/khtml/css/css_valueimpl.cpp
index a292b7e..0b35f44 100644
--- a/WebCore/khtml/css/css_valueimpl.cpp
+++ b/WebCore/khtml/css/css_valueimpl.cpp
@@ -351,13 +351,31 @@ CSSRuleImpl *CSSStyleDeclarationImpl::parentRule() const
DOM::DOMString CSSStyleDeclarationImpl::cssText() const
{
- return DOM::DOMString();
- // ###
+ DOMString result;
+
+ if ( m_lstValues) {
+ QPtrListIterator<CSSProperty> lstValuesIt(*m_lstValues);
+ CSSProperty *current;
+ for ( lstValuesIt.toFirst(); (current = lstValuesIt.current()); ++lstValuesIt ) {
+ result += current->cssText();
+ }
+ }
+
+ return result;
}
-void CSSStyleDeclarationImpl::setCssText(DOM::DOMString /*str*/)
+void CSSStyleDeclarationImpl::setCssText(DOM::DOMString text)
{
- // ###
+ if (m_lstValues) {
+ m_lstValues->clear();
+ } else {
+ m_lstValues = new QPtrList<CSSProperty>;
+ m_lstValues->setAutoDelete( true );
+ }
+
+ CSSParser parser( strictParsing );
+ parser.parseDeclaration( this, text, false );
+ setChanged();
}
bool CSSStyleDeclarationImpl::parseString( const DOMString &/*string*/, bool )
@@ -378,16 +396,6 @@ CSSValueImpl::~CSSValueImpl()
{
}
-DOM::DOMString CSSValueImpl::cssText() const
-{
- return DOM::DOMString();
-}
-
-void CSSValueImpl::setCssText(DOM::DOMString /*str*/)
-{
- // ###
-}
-
unsigned short CSSInheritedValueImpl::cssValueType() const
{
return CSSValue::CSS_INHERIT;
@@ -437,8 +445,13 @@ void CSSValueListImpl::append(CSSValueImpl *val)
DOM::DOMString CSSValueListImpl::cssText() const
{
- // ###
- return DOM::DOMString();
+ DOMString result = "";
+
+ for (QPtrListIterator<CSSValueImpl> iterator(m_values); iterator.current(); ++iterator) {
+ result += iterator.current()->cssText();
+ }
+
+ return result;
}
// -------------------------------------------------------------------------------------
@@ -888,6 +901,51 @@ FontValueImpl::~FontValueImpl()
delete family;
}
+DOMString FontValueImpl::cssText() const
+{
+ // font variant weight size / line-height family
+
+ DOMString result("");
+
+ if (style) {
+ result += style->cssText();
+ }
+ if (variant) {
+ if (result.length() > 0) {
+ result += " ";
+ }
+ result += variant->cssText();
+ }
+ if (weight) {
+ if (result.length() > 0) {
+ result += " ";
+ }
+ result += weight->cssText();
+ }
+ if (size) {
+ if (result.length() > 0) {
+ result += " ";
+ }
+ result += size->cssText();
+ }
+ if (lineHeight) {
+ if (!size) {
+ result += " ";
+ }
+ result += "/";
+ result += lineHeight->cssText();
+ }
+ if (family) {
+ if (result.length() > 0) {
+ result += " ";
+ }
+ result += family->cssText();
+ }
+
+ return result;
+}
+
+
// Used for text-shadow and box-shadow
ShadowValueImpl::ShadowValueImpl(CSSPrimitiveValueImpl* _x, CSSPrimitiveValueImpl* _y,
CSSPrimitiveValueImpl* _blur, CSSPrimitiveValueImpl* _color)
@@ -902,3 +960,35 @@ ShadowValueImpl::~ShadowValueImpl()
delete color;
}
+DOMString ShadowValueImpl::cssText() const
+{
+ DOMString text("");
+ if (color) {
+ text += color->cssText();
+ }
+ if (x) {
+ if (text.length() > 0) {
+ text += " ";
+ }
+ text += x->cssText();
+ }
+ if (y) {
+ if (text.length() > 0) {
+ text += " ";
+ }
+ text += y->cssText();
+ }
+ if (blur) {
+ if (text.length() > 0) {
+ text += " ";
+ }
+ text += blur->cssText();
+ }
+
+ return text;
+}
+
+DOMString CSSProperty::cssText() const
+{
+ return getPropertyName(m_id) + DOMString(": ") + m_value->cssText() + (m_bImportant ? DOMString(" !important") : DOMString()) + DOMString("; ");
+}
diff --git a/WebCore/khtml/css/css_valueimpl.h b/WebCore/khtml/css/css_valueimpl.h
index 327228d..82d4c45 100644
--- a/WebCore/khtml/css/css_valueimpl.h
+++ b/WebCore/khtml/css/css_valueimpl.h
@@ -66,7 +66,7 @@ public:
void setProperty ( const DOMString &propertyString);
DOM::DOMString item ( unsigned long index );
- DOM::DOMString cssText() const;
+ virtual DOM::DOMString cssText() const;
void setCssText(DOM::DOMString str);
virtual bool isStyleDeclaration() { return true; }
@@ -103,8 +103,7 @@ public:
virtual unsigned short cssValueType() const = 0;
- virtual DOM::DOMString cssText() const;
- void setCssText(DOM::DOMString str);
+ virtual DOM::DOMString cssText() const = 0;
virtual bool isValue() { return true; }
virtual bool isFontValue() { return false; }
@@ -314,7 +313,9 @@ public:
virtual ~FontValueImpl();
virtual unsigned short cssValueType() const { return CSSValue::CSS_CUSTOM; }
-
+
+ virtual DOM::DOMString cssText() const;
+
virtual bool isFontValue() { return true; }
CSSPrimitiveValueImpl *style;
@@ -335,6 +336,8 @@ public:
virtual unsigned short cssValueType() const { return CSSValue::CSS_CUSTOM; }
+ virtual DOM::DOMString cssText() const;
+
CSSPrimitiveValueImpl* x;
CSSPrimitiveValueImpl* y;
CSSPrimitiveValueImpl* blur;
@@ -376,6 +379,8 @@ public:
CSSValueImpl *value() { return m_value; }
+ virtual DOM::DOMString cssText() const;
+
// make sure the following fits in 4 bytes.
int m_id : 29;
bool m_bImportant : 1;
diff --git a/WebCore/kwq/KWQKPartsBrowserInterface.mm b/WebCore/kwq/KWQKPartsBrowserInterface.mm
index 27bd845..50575c7 100644
--- a/WebCore/kwq/KWQKPartsBrowserInterface.mm
+++ b/WebCore/kwq/KWQKPartsBrowserInterface.mm
@@ -35,7 +35,7 @@ namespace KParts {
QVariant BrowserInterface::property(const char *name) const
{
if (strcmp(name, "historyLength") == 0) {
- return QVariant([_part->bridge() historyLength]);
+ return QVariant((uint)[_part->bridge() historyLength]);
}
ERROR("property %s not implemented", name);
return QVariant();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list