Discussion:
[chromium-discuss] Image object in chromium
zhaoshuang
2018-11-21 10:03:45 UTC
Permalink
in javascript , we have this code:

*var img = new Image();*

I want know how to implement Image object in chromium. I search in v8 code,
it is not built-in object. So I think it is be create in Blink.
Anyone can give me some suggestions? I'll appreciate it
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
PhistucK
2018-11-21 10:37:24 UTC
Permalink
It is a constructor for HTMLImageElement (see the IDL
<https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/html/html_image_element.idl?q=file:idl+image+file:blink&sq=package:chromium&dr=C&l=27>
) -
new Image().toString()
"[object HTMLImageElement]"

The element is implemented here -
https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/html/html_image_element.h
https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/html/html_image_element.cc
Looks like CreateForJSConstructor
<https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/html/html_image_element.cc?sq=package:chromium&dr=C&g=0&l=150>
is
responsible for implementing new Image(...).

Bindings (the way to expose C++ as JavaScript object/members) generated
automatically from the aforementioned IDL -
https://cs.chromium.org/chromium/src/out/Debug/gen/third_party/blink/renderer/bindings/core/v8/v8_html_iframe_element.h
https://cs.chromium.org/chromium/src/out/Debug/gen/third_party/blink/renderer/bindings/core/v8/v8_html_image_element.cc

☆*PhistucK*
*var img = new Image();*
I want know how to implement Image object in chromium. I search in v8
code, it is not built-in object. So I think it is be create in Blink.
Anyone can give me some suggestions? I'll appreciate it
--
--
http://groups.google.com/a/chromium.org/group/chromium-discuss
---
You received this message because you are subscribed to the Google Groups
"Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
zhaoshuang
2018-11-22 02:03:10 UTC
Permalink
I got it , thanks very much

圚 2018幎11月21日星期䞉 UTC+8䞋午6:38:42PhistucK写道
Post by PhistucK
It is a constructor for HTMLImageElement (see the IDL
<https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/html/html_image_element.idl?q=file:idl+image+file:blink&sq=package:chromium&dr=C&l=27>
) -
new Image().toString()
"[object HTMLImageElement]"
The element is implemented here -
https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/html/html_image_element.h
https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/html/html_image_element.cc
Looks like CreateForJSConstructor
<https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/html/html_image_element.cc?sq=package:chromium&dr=C&g=0&l=150> is
responsible for implementing new Image(...).
Bindings (the way to expose C++ as JavaScript object/members) generated
automatically from the aforementioned IDL -
https://cs.chromium.org/chromium/src/out/Debug/gen/third_party/blink/renderer/bindings/core/v8/v8_html_iframe_element.h
https://cs.chromium.org/chromium/src/out/Debug/gen/third_party/blink/renderer/bindings/core/v8/v8_html_image_element.cc
☆*PhistucK*
*var img = new Image();*
I want know how to implement Image object in chromium. I search in v8
code, it is not built-in object. So I think it is be create in Blink.
Anyone can give me some suggestions? I'll appreciate it
--
--
http://groups.google.com/a/chromium.org/group/chromium-discuss
---
You received this message because you are subscribed to the Google Groups
"Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
Loading...