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
cf2317c7
Commit
cf2317c7
authored
Nov 16, 2014
by
Andrea Iacovitti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getComputedStyle for background-size, some site ask for it
parent
48f28703
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
khtml/css/css_renderstyledeclarationimpl.cpp
khtml/css/css_renderstyledeclarationimpl.cpp
+38
-0
No files found.
khtml/css/css_renderstyledeclarationimpl.cpp
View file @
cf2317c7
...
...
@@ -42,6 +42,7 @@ static const int computedProperties[] = {
CSS_PROP_BACKGROUND_POSITION
,
CSS_PROP_BACKGROUND_POSITION_X
,
CSS_PROP_BACKGROUND_POSITION_Y
,
CSS_PROP_BACKGROUND_SIZE
,
CSS_PROP_BORDER_COLLAPSE
,
CSS_PROP_BORDER_SPACING
,
CSS_PROP__KHTML_BORDER_HORIZONTAL_SPACING
,
...
...
@@ -481,6 +482,43 @@ CSSValueImpl *RenderStyleDeclarationImpl::getPropertyCSSValue( int propertyID )
case
CSS_PROP_BACKGROUND_POSITION_Y
:
RETURN_NULL_ON_NULL
(
renderer
);
return
valueForLength
(
style
->
backgroundYPosition
(),
renderer
->
contentHeight
());
case
CSS_PROP_BACKGROUND_SIZE
:
{
const
EBackgroundSizeType
backgroundSizeType
=
style
->
backgroundLayers
()
->
backgroundSizeType
();
switch
(
backgroundSizeType
)
{
case
BGSCONTAIN
:
return
new
CSSPrimitiveValueImpl
(
CSS_VAL_CONTAIN
);
case
BGSCOVER
:
return
new
CSSPrimitiveValueImpl
(
CSS_VAL_COVER
);
case
BGSLENGTH
:
{
const
LengthSize
bgLengthSize
=
style
->
backgroundLayers
()
->
backgroundSize
();
CSSValueListImpl
*
values
=
new
CSSValueListImpl
(
CSSValueListImpl
::
Space
);
switch
(
bgLengthSize
.
width
.
type
())
{
case
Auto
:
values
->
append
(
new
CSSPrimitiveValueImpl
(
CSS_VAL_AUTO
));
break
;
case
Percent
:
values
->
append
(
new
CSSPrimitiveValueImpl
(
bgLengthSize
.
width
.
percent
(),
CSSPrimitiveValue
::
CSS_PERCENTAGE
));
break
;
default:
values
->
append
(
new
CSSPrimitiveValueImpl
(
bgLengthSize
.
width
.
value
(),
CSSPrimitiveValue
::
CSS_PX
));
}
switch
(
bgLengthSize
.
height
.
type
())
{
case
Auto
:
values
->
append
(
new
CSSPrimitiveValueImpl
(
CSS_VAL_AUTO
));
break
;
case
Percent
:
values
->
append
(
new
CSSPrimitiveValueImpl
(
bgLengthSize
.
height
.
percent
(),
CSSPrimitiveValue
::
CSS_PERCENTAGE
));
break
;
default:
values
->
append
(
new
CSSPrimitiveValueImpl
(
bgLengthSize
.
height
.
value
(),
CSSPrimitiveValue
::
CSS_PX
));
}
return
values
;
}
default:
Q_ASSERT
(
0
);
}
break
;
}
case
CSS_PROP_BORDER_COLLAPSE
:
if
(
style
->
borderCollapse
())
return
new
CSSPrimitiveValueImpl
(
CSS_VAL_COLLAPSE
);
...
...
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