DescriptionNOT FOR LANDING! Explore the possibility of implementing the CSS Region interface.
====== New prototype below ======
The new prototype takes a different approach. The getRegions()
and getRegionsForContent() APIs are now custom implemented.
They get a Vector of RenderRegion* objects and introspect the
type of the regions similarly with CanvasRenderingContext2D strokeStyle
or fillStyle.
A V8 Array is created and filled with the wrappers for the objects representing
the regions. The array is set as the return value for the functions.
Another thing present in the prototype is a new dummy PseudoElement interface
that implements the Region interface. It was created as a proof-of-concept for the
moment when PseudoElements will be exposed through the CSS OM.
The PseudoElement objects are not destroyed when they are discarded through CSS.
They live until there's no other reference from V8 to the objects. On a dead pseudo-element
the Region API will return null values.
The prototype solves:
- the ugly hack in the bindings generator from the previous prototype
- the life cycle issue with storing a RenderRegion pointer inside a CSSRegion object
====== Old Prototype below ======
This is a proof-of-concept for a possible approach of implementing the Region interface.
The idea is to make the Region interface a NoInterfaceObject interface and
mark Element as implementing Region.
This allows us to implement the Region interface functions without affecting the
inheritance tree for Element.
When we are asked to return an array of such objects:
- we instantiate a Region interface object in C++, wrapping the RenderRegion object
- when we generate the V8 wrapper, we verify what kind of object that region
actually is. For now, only Elements are allowed.
- we return in V8 a wrap of the native object that region actually represents
This way, we can mix all kind of V8 objects inside the array returned by getRegions.
BUG=
Patch Set 1 #
Total comments: 14
Patch Set 2 : Prototype v2 #
Total comments: 19
Messages
Total messages: 9 (0 generated)
|