Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Unmaintained
KDE Libraries
Commits
4749596b
Commit
4749596b
authored
Nov 20, 2014
by
Andrea Iacovitti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check also for list emptiness.
parent
456db086
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
16 deletions
+19
-16
khtml/css/css_valueimpl.cpp
khtml/css/css_valueimpl.cpp
+19
-16
No files found.
khtml/css/css_valueimpl.cpp
View file @
4749596b
...
@@ -197,7 +197,8 @@ DOMString CSSStyleDeclarationImpl::removeProperty(const DOMString &propertyName)
...
@@ -197,7 +197,8 @@ DOMString CSSStyleDeclarationImpl::removeProperty(const DOMString &propertyName)
DOMString
CSSStyleDeclarationImpl
::
getPropertyValue
(
int
propertyID
)
const
DOMString
CSSStyleDeclarationImpl
::
getPropertyValue
(
int
propertyID
)
const
{
{
if
(
!
m_lstValues
)
return
DOMString
();
if
(
!
m_lstValues
||
m_lstValues
->
isEmpty
())
return
DOMString
();
CSSValueImpl
*
value
=
getPropertyCSSValue
(
propertyID
);
CSSValueImpl
*
value
=
getPropertyCSSValue
(
propertyID
);
if
(
value
)
if
(
value
)
return
value
->
cssText
();
return
value
->
cssText
();
...
@@ -427,7 +428,7 @@ DOMString CSSStyleDeclarationImpl::getShortHandValue( const int* properties, int
...
@@ -427,7 +428,7 @@ DOMString CSSStyleDeclarationImpl::getShortHandValue( const int* properties, int
CSSValueImpl
*
CSSStyleDeclarationImpl
::
getPropertyCSSValue
(
int
propertyID
)
const
CSSValueImpl
*
CSSStyleDeclarationImpl
::
getPropertyCSSValue
(
int
propertyID
)
const
{
{
if
(
!
m_lstValues
)
return
0
;
if
(
!
m_lstValues
||
m_lstValues
->
isEmpty
()
)
return
0
;
QListIterator
<
CSSProperty
*>
lstValuesIt
(
*
m_lstValues
);
QListIterator
<
CSSProperty
*>
lstValuesIt
(
*
m_lstValues
);
CSSProperty
*
current
;
CSSProperty
*
current
;
...
@@ -644,7 +645,7 @@ static void initShorthandMap(QHash<int, PropertyLonghand>& shorthandMap)
...
@@ -644,7 +645,7 @@ static void initShorthandMap(QHash<int, PropertyLonghand>& shorthandMap)
void
CSSStyleDeclarationImpl
::
removeProperty
(
int
propertyID
,
DOM
::
DOMString
*
old
)
void
CSSStyleDeclarationImpl
::
removeProperty
(
int
propertyID
,
DOM
::
DOMString
*
old
)
{
{
if
(
!
m_lstValues
)
if
(
!
m_lstValues
||
m_lstValues
->
isEmpty
()
)
return
;
return
;
bool
changed
=
false
;
bool
changed
=
false
;
...
@@ -731,7 +732,7 @@ void CSSStyleDeclarationImpl::clear()
...
@@ -731,7 +732,7 @@ void CSSStyleDeclarationImpl::clear()
bool
CSSStyleDeclarationImpl
::
getPropertyPriority
(
int
propertyID
)
const
bool
CSSStyleDeclarationImpl
::
getPropertyPriority
(
int
propertyID
)
const
{
{
if
(
m_lstValues
)
{
if
(
m_lstValues
&&
!
m_lstValues
->
isEmpty
()
)
{
QListIterator
<
CSSProperty
*>
lstValuesIt
(
*
m_lstValues
);
QListIterator
<
CSSProperty
*>
lstValuesIt
(
*
m_lstValues
);
CSSProperty
*
current
;
CSSProperty
*
current
;
while
(
lstValuesIt
.
hasNext
())
{
while
(
lstValuesIt
.
hasNext
())
{
...
@@ -833,24 +834,26 @@ CSSRuleImpl *CSSStyleDeclarationImpl::parentRule() const
...
@@ -833,24 +834,26 @@ CSSRuleImpl *CSSStyleDeclarationImpl::parentRule() const
DOM
::
DOMString
CSSStyleDeclarationImpl
::
cssText
()
const
DOM
::
DOMString
CSSStyleDeclarationImpl
::
cssText
()
const
{
{
DOMString
result
;
if
(
!
m_lstValues
||
m_lstValues
->
isEmpty
())
{
return
DOMString
();
}
DOMString
result
;
const
CSSProperty
*
positionXProp
=
0
;
const
CSSProperty
*
positionXProp
=
0
;
const
CSSProperty
*
positionYProp
=
0
;
const
CSSProperty
*
positionYProp
=
0
;
if
(
m_lstValues
)
{
QListIterator
<
CSSProperty
*>
lstValuesIt
(
*
m_lstValues
);
QListIterator
<
CSSProperty
*>
lstValuesIt
(
*
m_lstValues
);
while
(
lstValuesIt
.
hasNext
())
{
while
(
lstValuesIt
.
hasNext
())
{
const
CSSProperty
*
cur
=
lstValuesIt
.
next
();
const
CSSProperty
*
cur
=
lstValuesIt
.
next
();
if
(
cur
->
id
()
==
CSS_PROP_BACKGROUND_POSITION_X
)
if
(
cur
->
id
()
==
CSS_PROP_BACKGROUND_POSITION_X
)
positionXProp
=
cur
;
positionXProp
=
cur
;
else
if
(
cur
->
id
()
==
CSS_PROP_BACKGROUND_POSITION_Y
)
else
if
(
cur
->
id
()
==
CSS_PROP_BACKGROUND_POSITION_Y
)
positionYProp
=
cur
;
positionYProp
=
cur
;
else
else
result
+=
cur
->
cssText
();
result
+=
cur
->
cssText
();
}
}
}
// FIXME: This is a not-so-nice way to turn x/y positions into single background-position in output.
// FIXME: This is a not-so-nice way to turn x/y positions into single background-position in output.
// It is required because background-position-x/y are non-standard properties and generated output
// It is required because background-position-x/y are non-standard properties and generated output
// would not work in Firefox
// would not work in Firefox
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment