[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:23:55 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit a8f54e5a988e4bdfa31c35ce260696ea59a19acc
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Jan 27 01:29:19 2004 +0000
Reviewed by Dave.
- fixed <rdar://problem/3538433>: HomePage: table background URL with a single quote in it does not work
* khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseAttribute): Use addCSSImageProperty
instead of addCSSProperty, obviating the need for the "url()" syntax (and fixing quoting issues).
* khtml/html/html_tableimpl.cpp:
(HTMLTableElementImpl::parseAttribute): Ditto.
(HTMLTablePartElementImpl::parseAttribute): Ditto.
* khtml/html/html_elementimpl.h: Added addCSSStringProperty and addCSSImageProperty.
* khtml/html/html_elementimpl.cpp:
(HTMLElementImpl::addCSSStringProperty): Added. Calls setStringProperty. Not used yet.
(HTMLElementImpl::addCSSImageProperty): Added. Calls setImageProperty.
* khtml/css/css_valueimpl.h: Added setStringProperty and setImageProperty.
* khtml/css/css_valueimpl.cpp:
(CSSStyleDeclarationImpl::setStringProperty): Added. Sets a property without parsing.
(CSSStyleDeclarationImpl::setImageProperty): Added. Sets a property without parsing.
You'd think we'd be able to just use setStringProperty, but that's not how the image
properties work.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5982 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 3b4ee72..e480ac2 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,30 @@
2004-01-26 Darin Adler <darin at apple.com>
+ Reviewed by Dave.
+
+ - fixed <rdar://problem/3538433>: HomePage: table background URL with a single quote in it does not work
+
+ * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseAttribute): Use addCSSImageProperty
+ instead of addCSSProperty, obviating the need for the "url()" syntax (and fixing quoting issues).
+
+ * khtml/html/html_tableimpl.cpp:
+ (HTMLTableElementImpl::parseAttribute): Ditto.
+ (HTMLTablePartElementImpl::parseAttribute): Ditto.
+
+ * khtml/html/html_elementimpl.h: Added addCSSStringProperty and addCSSImageProperty.
+ * khtml/html/html_elementimpl.cpp:
+ (HTMLElementImpl::addCSSStringProperty): Added. Calls setStringProperty. Not used yet.
+ (HTMLElementImpl::addCSSImageProperty): Added. Calls setImageProperty.
+
+ * khtml/css/css_valueimpl.h: Added setStringProperty and setImageProperty.
+ * khtml/css/css_valueimpl.cpp:
+ (CSSStyleDeclarationImpl::setStringProperty): Added. Sets a property without parsing.
+ (CSSStyleDeclarationImpl::setImageProperty): Added. Sets a property without parsing.
+ You'd think we'd be able to just use setStringProperty, but that's not how the image
+ properties work.
+
+2004-01-26 Darin Adler <darin at apple.com>
+
* Makefile.am: Switch from pbxbuild to xcodebuild.
2004-01-26 David Hyatt <hyatt at apple.com>
diff --git a/WebCore/khtml/css/css_valueimpl.cpp b/WebCore/khtml/css/css_valueimpl.cpp
index 5fce7d3..e1b9bb8 100644
--- a/WebCore/khtml/css/css_valueimpl.cpp
+++ b/WebCore/khtml/css/css_valueimpl.cpp
@@ -309,6 +309,28 @@ void CSSStyleDeclarationImpl::setProperty(int id, int value, bool important, boo
setChanged();
}
+void CSSStyleDeclarationImpl::setStringProperty(int propertyId, const DOMString &value, CSSPrimitiveValue::UnitTypes type, bool important, bool nonCSSHint)
+{
+ if (!m_lstValues) {
+ m_lstValues = new QPtrList<CSSProperty>;
+ m_lstValues->setAutoDelete(true);
+ }
+ removeProperty(propertyId, nonCSSHint);
+ setParsedValue(propertyId, new CSSPrimitiveValueImpl(value, type), important, nonCSSHint, m_lstValues);
+ setChanged();
+}
+
+void CSSStyleDeclarationImpl::setImageProperty(int propertyId, const DOMString &URL, bool important, bool nonCSSHint)
+{
+ if (!m_lstValues) {
+ m_lstValues = new QPtrList<CSSProperty>;
+ m_lstValues->setAutoDelete(true);
+ }
+ removeProperty(propertyId, nonCSSHint);
+ setParsedValue(propertyId, new CSSImageValueImpl(URL, this), important, nonCSSHint, m_lstValues);
+ setChanged();
+}
+
void CSSStyleDeclarationImpl::setProperty ( const DOMString &propertyString)
{
if(!m_lstValues) {
diff --git a/WebCore/khtml/css/css_valueimpl.h b/WebCore/khtml/css/css_valueimpl.h
index 4ea6491..0acb364 100644
--- a/WebCore/khtml/css/css_valueimpl.h
+++ b/WebCore/khtml/css/css_valueimpl.h
@@ -62,6 +62,8 @@ public:
// this treats integers as pixels!
// needed for conversion of html attributes
void setLengthProperty(int id, const DOM::DOMString &value, bool important, bool nonCSSHint = true, bool multiLength = false);
+ void setStringProperty(int propertyId, const DOM::DOMString &value, DOM::CSSPrimitiveValue::UnitTypes, bool important = false, bool nonCSSHint = false); // parsed string value
+ void setImageProperty(int propertyId, const DOM::DOMString &URL, bool important = false, bool nonCSSHint = false);
// add a whole, unparsed property
void setProperty ( const DOMString &propertyString);
diff --git a/WebCore/khtml/html/html_baseimpl.cpp b/WebCore/khtml/html/html_baseimpl.cpp
index 0ba1f57..f93cc46 100644
--- a/WebCore/khtml/html/html_baseimpl.cpp
+++ b/WebCore/khtml/html/html_baseimpl.cpp
@@ -74,12 +74,13 @@ void HTMLBodyElementImpl::parseAttribute(AttributeImpl *attr)
{
QString url = khtml::parseURL( attr->value() ).string();
if (!url.isEmpty()) {
- url = getDocument()->completeURL( url );
- addCSSProperty(CSS_PROP_BACKGROUND_IMAGE, "url('"+url+"')" );
+ addCSSImageProperty(CSS_PROP_BACKGROUND_IMAGE, getDocument()->completeURL(url));
m_bgSet = true;
}
- else
+ else {
+ removeCSSProperty(CSS_PROP_BACKGROUND_IMAGE);
m_bgSet = false;
+ }
break;
}
case ATTR_MARGINWIDTH:
diff --git a/WebCore/khtml/html/html_elementimpl.cpp b/WebCore/khtml/html/html_elementimpl.cpp
index 19689e7..ffbf819 100644
--- a/WebCore/khtml/html/html_elementimpl.cpp
+++ b/WebCore/khtml/html/html_elementimpl.cpp
@@ -231,6 +231,20 @@ void HTMLElementImpl::addCSSProperty(int id, int value)
setChanged();
}
+void HTMLElementImpl::addCSSStringProperty(int id, const DOMString &value, CSSPrimitiveValue::UnitTypes type)
+{
+ if(!m_styleDecls) createDecl();
+ m_styleDecls->setStringProperty(id, value, type, false, true);
+ setChanged();
+}
+
+void HTMLElementImpl::addCSSImageProperty(int id, const DOMString &URL)
+{
+ if(!m_styleDecls) createDecl();
+ m_styleDecls->setImageProperty(id, URL, false, true);
+ setChanged();
+}
+
void HTMLElementImpl::addCSSLength(int id, const DOMString &value)
{
if(!m_styleDecls) createDecl();
diff --git a/WebCore/khtml/html/html_elementimpl.h b/WebCore/khtml/html/html_elementimpl.h
index 702bb76..f844be8 100644
--- a/WebCore/khtml/html/html_elementimpl.h
+++ b/WebCore/khtml/html/html_elementimpl.h
@@ -47,9 +47,11 @@ public:
virtual void parseAttribute(AttributeImpl *token);
- void addCSSLength(int id, const DOMString &value);
- void addCSSProperty(int id, const DOMString &value);
+ void addCSSLength(int id, const DOMString &value); // value will be parsed by the CSS parser
+ void addCSSProperty(int id, const DOMString &value); // value will be parsed by the CSS parser
void addCSSProperty(int id, int value);
+ void addCSSStringProperty(int id, const DOMString &value, DOM::CSSPrimitiveValue::UnitTypes = DOM::CSSPrimitiveValue::CSS_STRING);
+ void addCSSImageProperty(int id, const DOMString &URL);
void addHTMLColor( int id, const DOMString &c );
void removeCSSProperty(int id);
diff --git a/WebCore/khtml/html/html_tableimpl.cpp b/WebCore/khtml/html/html_tableimpl.cpp
index fbfcba3..954b999 100644
--- a/WebCore/khtml/html/html_tableimpl.cpp
+++ b/WebCore/khtml/html/html_tableimpl.cpp
@@ -437,11 +437,9 @@ void HTMLTableElementImpl::parseAttribute(AttributeImpl *attr)
break;
case ATTR_BACKGROUND:
{
- if (!attr->value().isEmpty()) {
- QString url = khtml::parseURL( attr->value() ).string();
- url = getDocument()->completeURL( url );
- addCSSProperty(CSS_PROP_BACKGROUND_IMAGE, "url('"+url+"')" );
- }
+ QString url = khtml::parseURL( attr->value() ).string();
+ if (!url.isEmpty())
+ addCSSImageProperty(CSS_PROP_BACKGROUND_IMAGE, getDocument()->completeURL(url));
else
removeCSSProperty(CSS_PROP_BACKGROUND_IMAGE);
break;
@@ -568,11 +566,9 @@ void HTMLTablePartElementImpl::parseAttribute(AttributeImpl *attr)
break;
case ATTR_BACKGROUND:
{
- if (attr->val()) {
- QString url = khtml::parseURL( attr->value() ).string();
- url = getDocument()->completeURL( url );
- addCSSProperty(CSS_PROP_BACKGROUND_IMAGE, "url('"+url+"')" );
- }
+ QString url = khtml::parseURL( attr->value() ).string();
+ if (!url.isEmpty())
+ addCSSImageProperty(CSS_PROP_BACKGROUND_IMAGE, getDocument()->completeURL(url));
else
removeCSSProperty(CSS_PROP_BACKGROUND_IMAGE);
break;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list