You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no intention to support this feature! This is merely speculation.
Some parts of the CSS Object Model received dummy implementations to support CodeMirror. Code mirror performs quite a few checks, comparing sizes of elements against window viewport sizes, e.g., to determine if it should scroll to content.
While there is no intention the core of Gost-DOM to support this;
The Component Model
At the time of writing this; some refactoring is taking place, moving some responsibility into "components", from a system inspired by the "Entity, Component, System" model.
Each node in the DOM is an entity and entities can contain a no of "Components". A "Component" is intended to support behaviour; but have no state of its own. This is meant as a solution to the problem that the DOM spec is inherently object-oriented in nature, but Go isn't.
Different "systems" could be implemented in terms of such components; currently HTML rendering follows this, but more problems will probably have their solutions moved to this methodology.
So you could potentially add a component to HTML/SVG/MathML elements that can calculate their sizes, and as such, keep the implementation of sizing completely decoupled from the code DOM implementation.
Example: innerHTML/outerHTML
HTML rendering uses the component system to implement <template> elements. Template elements render HTML differently from other elements; as they don't have children in the DOM. Instead, their content is a document fragment; and it is the contents of that fragment which is rendered.
This is implemented by adding a Renderer component to template elements. The implementation of HTML rendering delegates rendering to the Renderer if the current element has one; otherwise falls back to a default implementation.
Warning
There is no intention to support this feature! This is merely speculation.
Some parts of the CSS Object Model received dummy implementations to support CodeMirror. Code mirror performs quite a few checks, comparing sizes of elements against window viewport sizes, e.g., to determine if it should scroll to content.
While there is no intention the core of Gost-DOM to support this;
The Component Model
At the time of writing this; some refactoring is taking place, moving some responsibility into "components", from a system inspired by the "Entity, Component, System" model.
Each node in the DOM is an entity and entities can contain a no of "Components". A "Component" is intended to support behaviour; but have no state of its own. This is meant as a solution to the problem that the DOM spec is inherently object-oriented in nature, but Go isn't.
Different "systems" could be implemented in terms of such components; currently HTML rendering follows this, but more problems will probably have their solutions moved to this methodology.
So you could potentially add a component to HTML/SVG/MathML elements that can calculate their sizes, and as such, keep the implementation of sizing completely decoupled from the code DOM implementation.
Example:
innerHTML/outerHTMLHTML rendering uses the component system to implement
<template>elements. Template elements render HTML differently from other elements; as they don't have children in the DOM. Instead, their content is a document fragment; and it is the contents of that fragment which is rendered.This is implemented by adding a
Renderercomponent to template elements. The implementation of HTML rendering delegates rendering to theRendererif the current element has one; otherwise falls back to a default implementation.