Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KDE Libraries
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
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)
DOMString
CSSStyleDeclarationImpl
::
getPropertyValue
(
int
propertyID
)
const
{
if
(
!
m_lstValues
)
return
DOMString
();
if
(
!
m_lstValues
||
m_lstValues
->
isEmpty
())
return
DOMString
();
CSSValueImpl
*
value
=
getPropertyCSSValue
(
propertyID
);
if
(
value
)
return
value
->
cssText
();
...
...
@@ -427,7 +428,7 @@ DOMString CSSStyleDeclarationImpl::getShortHandValue( const int* properties, int
CSSValueImpl
*
CSSStyleDeclarationImpl
::
getPropertyCSSValue
(
int
propertyID
)
const
{
if
(
!
m_lstValues
)
return
0
;
if
(
!
m_lstValues
||
m_lstValues
->
isEmpty
()
)
return
0
;
QListIterator
<
CSSProperty
*>
lstValuesIt
(
*
m_lstValues
);
CSSProperty
*
current
;
...
...
@@ -644,7 +645,7 @@ static void initShorthandMap(QHash<int, PropertyLonghand>& shorthandMap)
void
CSSStyleDeclarationImpl
::
removeProperty
(
int
propertyID
,
DOM
::
DOMString
*
old
)
{
if
(
!
m_lstValues
)
if
(
!
m_lstValues
||
m_lstValues
->
isEmpty
()
)
return
;
bool
changed
=
false
;
...
...
@@ -731,7 +732,7 @@ void CSSStyleDeclarationImpl::clear()
bool
CSSStyleDeclarationImpl
::
getPropertyPriority
(
int
propertyID
)
const
{
if
(
m_lstValues
)
{
if
(
m_lstValues
&&
!
m_lstValues
->
isEmpty
()
)
{
QListIterator
<
CSSProperty
*>
lstValuesIt
(
*
m_lstValues
);
CSSProperty
*
current
;
while
(
lstValuesIt
.
hasNext
())
{
...
...
@@ -833,24 +834,26 @@ CSSRuleImpl *CSSStyleDeclarationImpl::parentRule() const
DOM
::
DOMString
CSSStyleDeclarationImpl
::
cssText
()
const
{
DOMString
result
;
if
(
!
m_lstValues
||
m_lstValues
->
isEmpty
())
{
return
DOMString
();
}
DOMString
result
;
const
CSSProperty
*
positionXProp
=
0
;
const
CSSProperty
*
positionYProp
=
0
;
if
(
m_lstValues
)
{
QListIterator
<
CSSProperty
*>
lstValuesIt
(
*
m_lstValues
);
while
(
lstValuesIt
.
hasNext
())
{
const
CSSProperty
*
cur
=
lstValuesIt
.
next
();
if
(
cur
->
id
()
==
CSS_PROP_BACKGROUND_POSITION_X
)
positionXProp
=
cur
;
else
if
(
cur
->
id
()
==
CSS_PROP_BACKGROUND_POSITION_Y
)
positionYProp
=
cur
;
else
result
+=
cur
->
cssText
();
}
QListIterator
<
CSSProperty
*>
lstValuesIt
(
*
m_lstValues
);
while
(
lstValuesIt
.
hasNext
())
{
const
CSSProperty
*
cur
=
lstValuesIt
.
next
();
if
(
cur
->
id
()
==
CSS_PROP_BACKGROUND_POSITION_X
)
positionXProp
=
cur
;
else
if
(
cur
->
id
()
==
CSS_PROP_BACKGROUND_POSITION_Y
)
positionYProp
=
cur
;
else
result
+=
cur
->
cssText
();
}
// 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
// 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