1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:48:11 +00:00
serenity/Libraries/LibWeb/Bindings
Matthew Olsson dd08c992e8 LibJS: Simplify and normalize publicly-exposed Object functions
Previously, the Object class had many different types of functions for
each action. For example: get_by_index, get(PropertyName),
get(FlyString). This is a bit verbose, so these methods have been
shortened to simply use the PropertyName structure. The methods then
internally call _by_index if necessary. Note that the _by_index
have been made private to enforce this change.

Secondly, a clear distinction has been made between "putting" and
"defining" an object property. "Putting" should mean modifying a
(potentially) already existing property. This is akin to doing "a.b =
'foo'".

This implies two things about put operations:
    - They will search the prototype chain for setters and call them, if
      necessary.
    - If no property exists with a particular key, the put operation
      should create a new property with the default attributes
      (configurable, writable, and enumerable).

In contrast, "defining" a property should completely overwrite any
existing value without calling setters (if that property is
configurable, of course).

Thus, all of the many JS objects have had any "put" calls changed to
"define_property" calls. Additionally, "put_native_function" and
"put_native_property" have had their "put" replaced with "define".

Finally, "put_own_property" has been made private, as all necessary
functionality should be exposed with the put and define_property
methods.
2020-05-27 13:17:35 +02:00
..
CanvasRenderingContext2DWrapper.cpp LibJS: Simplify and normalize publicly-exposed Object functions 2020-05-27 13:17:35 +02:00
CanvasRenderingContext2DWrapper.h LibWeb: Add CanvasRenderingContext2D.canvas 2020-05-21 01:24:36 +02:00
DocumentWrapper.cpp LibJS: Simplify and normalize publicly-exposed Object functions 2020-05-27 13:17:35 +02:00
DocumentWrapper.h LibWeb: Add document.querySelector() 2020-05-26 00:12:20 +02:00
ElementWrapper.cpp LibJS: Simplify and normalize publicly-exposed Object functions 2020-05-27 13:17:35 +02:00
ElementWrapper.h LibWeb: Add Element.getAttribute() and Element.setAttribute() :^) 2020-05-26 12:27:10 +02:00
EventListenerWrapper.cpp LibJS: Move builtin prototypes to the global object 2020-04-18 13:24:45 +02:00
EventListenerWrapper.h LibWeb: Use a JS::Handle to keep the EventListener function alive 2020-03-18 20:05:52 +01:00
EventTargetWrapper.cpp LibJS: Simplify and normalize publicly-exposed Object functions 2020-05-27 13:17:35 +02:00
EventTargetWrapper.h LibJS+LibWeb: Move native JS functions into dedicated member functions 2020-03-28 23:10:37 +01:00
EventWrapper.cpp LibJS: Move builtin prototypes to the global object 2020-04-18 13:24:45 +02:00
EventWrapper.h LibWeb: Add a DOM Event class (instead of events being simple strings) 2020-03-21 18:17:18 +01:00
HTMLCanvasElementWrapper.cpp LibJS: Simplify and normalize publicly-exposed Object functions 2020-05-27 13:17:35 +02:00
HTMLCanvasElementWrapper.h LibJS+LibWeb: Move native properties to separate getters/setters 2020-03-29 00:37:33 +01:00
HTMLImageElementWrapper.cpp LibWeb: Add a JavaScript wrapper for HTMLImageElement :^) 2020-04-14 20:37:01 +02:00
HTMLImageElementWrapper.h LibWeb: Add a JavaScript wrapper for HTMLImageElement :^) 2020-04-14 20:37:01 +02:00
ImageDataWrapper.cpp LibJS: Simplify and normalize publicly-exposed Object functions 2020-05-27 13:17:35 +02:00
ImageDataWrapper.h LibWeb: Add ImageData objects and implement 2D context putImageData() 2020-04-21 23:49:51 +02:00
LocationObject.cpp LibJS: Simplify and normalize publicly-exposed Object functions 2020-05-27 13:17:35 +02:00
LocationObject.h LibWeb: Allow reloading the current page with location.reload() 2020-05-18 22:05:13 +02:00
MouseEventWrapper.cpp LibJS: Simplify and normalize publicly-exposed Object functions 2020-05-27 13:17:35 +02:00
MouseEventWrapper.h LibJS+LibWeb: Move native properties to separate getters/setters 2020-03-29 00:37:33 +01:00
NavigatorObject.cpp LibJS: Simplify and normalize publicly-exposed Object functions 2020-05-27 13:17:35 +02:00
NavigatorObject.h LibWeb: Send User-Agent in HTTP requests 2020-05-21 12:58:57 +02:00
NodeWrapper.cpp LibWeb: Add a JavaScript wrapper for HTMLImageElement :^) 2020-04-14 20:37:01 +02:00
NodeWrapper.h LibWeb: Add <canvas> element and start fleshing out CRC2D 2020-03-19 19:07:56 +01:00
WindowObject.cpp LibJS: Simplify and normalize publicly-exposed Object functions 2020-05-27 13:17:35 +02:00
WindowObject.h LibJS: Move builtin prototypes to the global object 2020-04-18 13:24:45 +02:00
Wrappable.cpp LibWeb: Add missing copyright headers 2020-03-15 10:24:05 +01:00
Wrappable.h LibWeb: Add <canvas> element and start fleshing out CRC2D 2020-03-19 19:07:56 +01:00
Wrapper.h LibJS+LibWeb: Pass prototype to Object constructor 2020-04-18 11:00:55 +02:00
XMLHttpRequestConstructor.cpp LibJS: Simplify and normalize publicly-exposed Object functions 2020-05-27 13:17:35 +02:00
XMLHttpRequestConstructor.h LibWeb: Add XMLHttpRequest object :^) 2020-04-08 21:46:43 +02:00
XMLHttpRequestPrototype.cpp LibJS: Simplify and normalize publicly-exposed Object functions 2020-05-27 13:17:35 +02:00
XMLHttpRequestPrototype.h LibWeb: Add XMLHttpRequest.readyState and constants 2020-04-23 11:03:17 +02:00
XMLHttpRequestWrapper.cpp LibWeb: Add XMLHttpRequest object :^) 2020-04-08 21:46:43 +02:00
XMLHttpRequestWrapper.h LibWeb: Add XMLHttpRequest object :^) 2020-04-08 21:46:43 +02:00