Gitweb links:
...log
http://git.netsurf-browser.org/libnslayout.git/shortlog/b77ae8ab7d1ce435d8afd3c77613c5a56c477025
...commit
http://git.netsurf-browser.org/libnslayout.git/commit/b77ae8ab7d1ce435d8afd3c77613c5a56c477025
...tree
http://git.netsurf-browser.org/libnslayout.git/tree/b77ae8ab7d1ce435d8afd3c77613c5a56c477025
The branch, master has been updated
via b77ae8ab7d1ce435d8afd3c77613c5a56c477025 (commit)
from 4e1b55215d62b41dc74151d2eecadb6e82bacfd1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/libnslayout.git/commit/?id=b77ae8ab7d1ce435d8afd3c77613c5a56c477025
commit b77ae8ab7d1ce435d8afd3c77613c5a56c477025
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Docs: Update architecture with plan for client-started fetches.
diff --git a/docs/architecture.md b/docs/architecture.md
index 26232c9..63142fe 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -152,14 +152,35 @@ For a client initiated fetch of CSS, the selection
context is updated when
we have fetched the style sheet, and LibNSLog is informed.
For a LibNSLayout initiated fetch, LibNSLayout creates a `nsl_resource_t`
-and passes a pointer to to to the client, along with the URL to fetch.
+and passes a pointer to the client, along with the URL to fetch.
The `nsl_resource_t` is opaque to the client. When the resource is fetched,
the client calls a callback passing, the `nsl_resource_t`, and a pointer to
the client handle for the resource (`hlcache_handle`, in NetSurf). Then
`LibNSLayout` can set the pointer to the client resource handle inside the
-`nsl_resource_t`, and the pointer will be used to ask the client about e.g.
-intrinsic dimensions. The pointer to the client handle will also appear in
-the render list that is given to the client for display.
-
-> **TODO**: How to do fetches started by client for e.g. images, that
-> LibNSLayout needs to know about.
+`nsl_resource_t`, and the client handle pointer will be used to ask the client
+about e.g. intrinsic dimensions. The pointer to the client handle will also
+appear in the render list that is given to the client for display.
+
+For fetches started by client (for example, replaced-element images) that
+LibNSLayout needs to know about, the client starts the fetch when it gets
+the DOM event about the newly added/modified IMG element, it then informs
+LibNSLayout of the updated DOM node, passing the client handle for the
+resource. Since there is a non-null client resource handle, LibNSLayout
+knows it's a replaced element, and can ask the client for intrinsic dimensions.
+
+```c
+nslayout_res nslayout_dom_event_add_element_replaced(
+ nslayout *layout,
+ dom_node *element,
+ nsl_resource_t *replaced,
+ nsl_resource_type_t type);
+```
+
+The `nsl_resource_type_t` would be a client defined enum allowing the client
+have different handle types for different things, e.g. image resource handle,
+and form button handle. The type would be passed back with the resource.
+
+The client is responsible for calling a function to tell LibNSLayout what
+the intrinsic dimensions are for a resource, if applicable. It can do this
+once it has the information (e.g. once it's fetched and parsed the header of
+an image).
-----------------------------------------------------------------------
Summary of changes:
docs/architecture.md | 35 ++++++++++++++++++++++++++++-------
1 file changed, 28 insertions(+), 7 deletions(-)
diff --git a/docs/architecture.md b/docs/architecture.md
index 26232c9..63142fe 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -152,14 +152,35 @@ For a client initiated fetch of CSS, the selection
context is updated when
we have fetched the style sheet, and LibNSLog is informed.
For a LibNSLayout initiated fetch, LibNSLayout creates a `nsl_resource_t`
-and passes a pointer to to to the client, along with the URL to fetch.
+and passes a pointer to the client, along with the URL to fetch.
The `nsl_resource_t` is opaque to the client. When the resource is fetched,
the client calls a callback passing, the `nsl_resource_t`, and a pointer to
the client handle for the resource (`hlcache_handle`, in NetSurf). Then
`LibNSLayout` can set the pointer to the client resource handle inside the
-`nsl_resource_t`, and the pointer will be used to ask the client about e.g.
-intrinsic dimensions. The pointer to the client handle will also appear in
-the render list that is given to the client for display.
-
-> **TODO**: How to do fetches started by client for e.g. images, that
-> LibNSLayout needs to know about.
+`nsl_resource_t`, and the client handle pointer will be used to ask the client
+about e.g. intrinsic dimensions. The pointer to the client handle will also
+appear in the render list that is given to the client for display.
+
+For fetches started by client (for example, replaced-element images) that
+LibNSLayout needs to know about, the client starts the fetch when it gets
+the DOM event about the newly added/modified IMG element, it then informs
+LibNSLayout of the updated DOM node, passing the client handle for the
+resource. Since there is a non-null client resource handle, LibNSLayout
+knows it's a replaced element, and can ask the client for intrinsic dimensions.
+
+```c
+nslayout_res nslayout_dom_event_add_element_replaced(
+ nslayout *layout,
+ dom_node *element,
+ nsl_resource_t *replaced,
+ nsl_resource_type_t type);
+```
+
+The `nsl_resource_type_t` would be a client defined enum allowing the client
+have different handle types for different things, e.g. image resource handle,
+and form button handle. The type would be passed back with the resource.
+
+The client is responsible for calling a function to tell LibNSLayout what
+the intrinsic dimensions are for a resource, if applicable. It can do this
+once it has the information (e.g. once it's fetched and parsed the header of
+an image).
--
NetSurf Layout Engine
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org