summaryrefslogtreecommitdiff
path: root/devdoc/dw-size-request-pos.doc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2015-06-03 22:40:07 +0200
committerSebastian Geerken <devnull@localhost>2015-06-03 22:40:07 +0200
commit0a565f9b2bfc084a3292ad0c3db85e76cc8dc060 (patch)
treeae743c7a37bfde4293c142e4a6d32648526b7776 /devdoc/dw-size-request-pos.doc
parentda88ede8c401449729ae9c4b78f4c9914d81fa09 (diff)
Moved dev docs to devdoc.
Diffstat (limited to 'devdoc/dw-size-request-pos.doc')
-rw-r--r--devdoc/dw-size-request-pos.doc73
1 files changed, 73 insertions, 0 deletions
diff --git a/devdoc/dw-size-request-pos.doc b/devdoc/dw-size-request-pos.doc
new file mode 100644
index 00000000..08af0eec
--- /dev/null
+++ b/devdoc/dw-size-request-pos.doc
@@ -0,0 +1,73 @@
+/** \page dw-size-request-pos Size requisitions depending on positions
+
+<div style="border: 2px solid #ffff00; margin: 1em 0;
+ padding: 0.5em 1em; background-color: #ffffe0">The complex "widget
+ sizes" is currently divided into three documents: \ref
+ dw-widget-sizes, \ref dw-grows, and **Size requisitions depending on
+ positions** (this document). </div>
+
+Motivation
+==========
+
+As described in \ref dw-out-of-flow (*The sizeRequest/sizeAllocate
+problem*), the principle that the size of a widget depends only on the
+sizes of its children causes some problems with floats; the current
+solution is a frequent correction by calling
+dw::core::Widget::queueResize. In this document, an alternative
+approach is presented.
+
+
+General Idea
+============
+
+A widget size may depend on the position relative to an anchestor
+widget. If a widget wants to get the size of a child widget, it should
+
+1. call the new method dw::core::Widget::sizeRequestReference,
+ which returns NULL, when the child's size does not depend on the
+ position, or a widget relative to which the child's position must
+ be calculated;
+2. call dw::core::Widget::sizeRequest with the position relative to
+ this widget.
+
+The position passed to dw::core::Widget::sizeRequest must be the
+position at which this child will be allocated.
+
+There are situations where the parent widget is unable to determine
+this position before the size is known. An example: a textblock widget
+cannot determine the position of an inline widget (like an image, or
+an inline block) before the line is finished; on the other hand,
+finishing the line depends on knowing the sizes of the inline widgets.
+
+This may result in a conflict, when the size of an inline widgets
+depends on the position. Fortunately, this is not the case in dillo:
+the only widget whose size depends on the position is dw::Textblock
+(the size will depend on the position within its floats container); but
+an inline blocks constitute its own floats container, so that there is
+no dependance on a position within another widget.
+
+Generally, this case should be handled by providing a fallback
+strategy. (TODO: How does this look like? The widget is forced to
+calculate its size independant of the position?)
+
+Resizing
+--------
+Currently, the size of a widget has to be recalculated, when
+
+1. it has called dw::core::Widget::queueResize, or
+2. the size of a child widget has to be recalculated.
+
+Since for this new approach, the size does not only depend on the size
+of the children, the second condition must be modified. However,
+regarding changes of the position is not sufficient. Consider this
+example, where a float size changes as soon as the image is loaded:
+
+\image html dw-size-request-pos-01.png
+
+The second paragraph ("A longer paragraph" ...) stays at the same
+position, both absolute and relative to the float container, but has
+to be rewrapped because of the float.
+
+(TODO: A detailed design is yet to de developed.)
+
+*/ \ No newline at end of file