Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
L
lcc-shape
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
wangmingming
lcc-shape
Commits
d5db4145
Commit
d5db4145
authored
Aug 03, 2023
by
wangmingming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
333
parent
52882e94
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1035 additions
and
3304 deletions
+1035
-3304
js_dom_run.js
js_dom_run.js
+1008
-3274
Window.js
jsdom/lib/jsdom/browser/Window.js
+4
-4
EventTarget-impl.js
jsdom/lib/jsdom/living/events/EventTarget-impl.js
+1
-1
Navigator.js
jsdom/lib/jsdom/living/generated/Navigator.js
+9
-13
HTMLCanvasElement-impl.js
jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js
+13
-12
No files found.
js_dom_run.js
View file @
d5db4145
This diff is collapsed.
Click to expand it.
jsdom/lib/jsdom/browser/Window.js
View file @
d5db4145
...
...
@@ -265,13 +265,13 @@ function Window(options) {
// debugger;
// }
let
res
=
Reflect
.
get
(
target
,
p
,
receiver
);
if
(
p
!==
'debug'
){
if
(
p
!==
'debug'
&&
p
!==
'Object'
){
console
.
log
(
'window get'
,
p
,
typeof
res
)
}
if
(
p
===
'offsetHeight'
){
debugger
;
}
//
if (p === 'offsetHeight'){
//
debugger;
//
}
// console.log(Reflect.get(target, '_cf_chl_ctx', receiver))
if
(
!
[
'_registeredHandlers'
,
'window'
,
'_currentEvent'
,
'performance'
,
'debug'
,
'_eventListenerss'
,
'top'
].
includes
(
p
)
&&
res
&&
typeof
res
===
'object'
&&
typeof
p
!==
'symbol'
)
{
...
...
jsdom/lib/jsdom/living/events/EventTarget-impl.js
View file @
d5db4145
...
...
@@ -306,7 +306,7 @@ function innerInvokeEventListeners(eventImpl, listeners, phase, itemInShadowTree
return
found
;
}
if
(
type
===
'mousemove'
){
debugger
//
debugger
}
// Copy event listeners before iterating since the list can be modified during the iteration.
const
handlers
=
listeners
[
type
].
slice
();
...
...
jsdom/lib/jsdom/living/generated/Navigator.js
View file @
d5db4145
...
...
@@ -185,7 +185,7 @@ exports.install = (globalObject, globalNames) => {
getHighEntropyValues
:
function
(
e
)
{
console
.
log
(
'getHighEntropyValues'
,
e
)
let
r
;
switch
(
e
)
{
switch
(
e
[
0
]
)
{
case
'architecture'
:
r
=
{
"architecture"
:
"arm"
,
...
...
@@ -227,20 +227,10 @@ exports.install = (globalObject, globalNames) => {
}
break
;
case
'mobile'
:
r
=
{
"brands"
:
[{
"brand"
:
"Not/A)Brand"
,
"version"
:
"99"
},
{
"brand"
:
"Google Chrome"
,
"version"
:
"115"
},
{
"brand"
:
"Chromium"
,
"version"
:
"115"
}],
"mobile"
:
false
,
"platform"
:
"macOS"
}
r
=
{
"brands"
:[{
"brand"
:
"Not.A/Brand"
,
"version"
:
"8"
},{
"brand"
:
"Chromium"
,
"version"
:
"114"
},{
"brand"
:
"Google Chrome"
,
"version"
:
"114"
}],
"mobile"
:
false
,
"platform"
:
"macOS"
}
break
;
case
'model'
:
r
=
{
"brands"
:
[{
"brand"
:
"Not/A)Brand"
,
"version"
:
"99"
},
{
"brand"
:
"Google Chrome"
,
"version"
:
"115"
},
{
"brand"
:
"Chromium"
,
"version"
:
"115"
}],
"mobile"
:
false
,
"platform"
:
"macOS"
}
r
=
{
"brands"
:[{
"brand"
:
"Not.A/Brand"
,
"version"
:
"8"
},{
"brand"
:
"Chromium"
,
"version"
:
"114"
},{
"brand"
:
"Google Chrome"
,
"version"
:
"114"
}],
"mobile"
:
false
,
"model"
:
""
,
"platform"
:
"macOS"
}
break
;
case
'platform'
:
r
=
{
...
...
@@ -273,6 +263,12 @@ exports.install = (globalObject, globalNames) => {
}
return
{
then
:
function
(){
return
r
}
}
}
}
}
...
...
jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js
View file @
d5db4145
...
...
@@ -51,6 +51,7 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
}
getContext
(
contextId
)
{
// console.log('contextId', contextId)
const
canvas
=
this
.
_getCanvas
();
if
(
canvas
)
{
if
(
!
this
.
_context
)
{
...
...
@@ -66,7 +67,7 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
wrapNodeCanvasMethod
(
this
.
_context
,
"drawImage"
);
}
}
if
(
contextId
===
'webgl'
)
{
if
(
contextId
===
'webgl'
||
contextId
===
'webgl2'
)
{
var
v_new_toggle
=
true
var
v_new
=
function
(
v
)
{
var
temp
=
v_new_toggle
;
...
...
@@ -91,7 +92,6 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
function
WebGLShader
()
{
}
this
.
_toggle
=
{}
this
.
createBuffer
=
function
()
{
v_console_log
(
' [*] WebGLRenderingContext -> createBuffer[func]'
);
return
v_new
(
WebGLBuffer
)
...
...
@@ -191,12 +191,10 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
class
WebGLDebugRendererInfo
{
get
UNMASKED_VENDOR_WEBGL
()
{
self
.
_toggle
[
37445
]
=
1
;
return
37445
}
get
UNMASKED_RENDERER_WEBGL
()
{
self
.
_toggle
[
37446
]
=
1
;
return
37446
}
}
...
...
@@ -227,7 +225,7 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
}
this
.
getParameter
=
function
(
key
)
{
v_console_log
(
' [*] WebGLRenderingContext -> getParameter[func]:'
,
key
)
this
.
_toggle
=
{
let
_toggle
=
{
3413
:
8
,
3412
:
8
,
3411
:
8
,
...
...
@@ -252,8 +250,8 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
37446
:
null
,
34047
:
null
}
if
(
this
.
_toggle
[
key
])
{
return
this
.
_toggle
[
key
]
if
(
_toggle
[
key
])
{
return
_toggle
[
key
]
}
else
{
if
(
key
==
33902
)
{
...
...
@@ -401,13 +399,14 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
v_saf
(
this
.
createBuffer
,
'createBuffer'
)
v_saf
(
this
.
createProgram
,
'createProgram'
)
v_saf
(
this
.
createShader
,
'createShader'
)
v_saf
(
this
.
getSupportedExtensions
,
'getSupportedExtensions'
)
//
v_saf(this.getSupportedExtensions, 'getSupportedExtensions')
v_saf
(
this
.
getExtension
,
'getExtension'
)
v_saf
(
this
.
getParameter
,
'getParameter'
)
v_saf
(
this
.
getContextAttributes
,
'getContextAttributes'
)
v_saf
(
this
.
getShaderPrecisionFormat
,
'getShaderPrecisionFormat'
)
})
Object
.
defineProperties
(
WebGLRenderingContext
.
prototype
,
{
getSupportedExtensions
:
{
value
:
WebGLRenderingContext
.
getSupportedExtensions
,
writable
:
true
,
configurable
:
true
,
enumerable
:
true
},
DEPTH_BUFFER_BIT
:
{
"value"
:
256
,
"writable"
:
false
,
"enumerable"
:
true
,
"configurable"
:
false
},
STENCIL_BUFFER_BIT
:
{
"value"
:
1024
,
"writable"
:
false
,
"enumerable"
:
true
,
"configurable"
:
false
},
COLOR_BUFFER_BIT
:
{
"value"
:
16384
,
"writable"
:
false
,
"enumerable"
:
true
,
"configurable"
:
false
},
...
...
@@ -1086,10 +1085,12 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
configurable
:
true
},
})
// let t = proxy(new WebGLRenderingContext
, 'WebGLRenderingContext11')
let
t
=
new
WebGLRenderingContext
()
return
t
let
t
=
proxy
(
new
WebGLRenderingContext
()
,
'WebGLRenderingContext11'
)
//
let t = new WebGLRenderingContext()
this
.
_context
=
t
;
}
// console.log('contextId res', this._context)
return
this
.
_context
;
}
...
...
@@ -1113,7 +1114,7 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
let
color
=
Math
.
floor
(
Math
.
random
()
*
150
);
ctx
.
fillStyle
=
"rgba("
+
color
+
","
+
color
+
","
+
color
+
",1)"
;
ctx
.
fillRect
(
randInt
(
0
,
this
.
width
),
randInt
(
0
,
this
.
height
),
3
,
3
)
ctx
.
fillRect
(
randInt
(
0
,
this
.
width
),
randInt
(
0
,
this
.
height
),
1
,
1
)
}
}
...
...
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