Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
b5bf00a3
Commit
b5bf00a3
authored
Jul 08, 2007
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A barebones implementation of getComputedStyle.
parent
5e7c1fc3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
env.js
build/runtest/env.js
+18
-9
No files found.
build/runtest/env.js
View file @
b5bf00a3
/*
* Simulated browser environment for Rhino
* By John Resig <http://ejohn.org/>
* Copyright 2007 John Resig, under the MIT License
*/
// The window Object
// The window Object
var
window
=
this
;
var
window
=
this
;
...
@@ -99,11 +105,6 @@ var window = this;
...
@@ -99,11 +105,6 @@ var window = this;
get
body
(){
get
body
(){
return
this
.
getElementsByTagName
(
"body"
)[
0
];
return
this
.
getElementsByTagName
(
"body"
)[
0
];
},
},
defaultView
:
{
getComputedStyle
:
{
getPropertyValue
:
function
(){
}
}
},
get
documentElement
(){
get
documentElement
(){
return
makeNode
(
this
.
_dom
.
getDocumentElement
()
);
return
makeNode
(
this
.
_dom
.
getDocumentElement
()
);
},
},
...
@@ -125,12 +126,20 @@ var window = this;
...
@@ -125,12 +126,20 @@ var window = this;
get
defaultView
(){
get
defaultView
(){
return
{
return
{
getComputedStyle
:
function
(){
getComputedStyle
:
function
(
elem
){
return
{
return
{
getPropertyValue
:
function
(){
getPropertyValue
:
function
(
prop
){
return
""
;
prop
=
prop
.
replace
(
/
\-(\w)
/g
,
function
(
m
,
c
){
}
return
c
.
toUpperCase
();
});
var
val
=
elem
.
style
[
prop
];
if
(
prop
==
"opacity"
&&
val
==
""
)
val
=
"1"
;
return
val
;
}
}
};
}
}
};
};
}
}
...
...
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