summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-02-14 16:42:23 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-02-14 16:42:23 +0000
commit60c74c2e3c0190313e039fbb77dcd433921a3f72 (patch)
tree732cca90dd054bea83548abec1885dc7d6bf481a
parentfc7efc6e4a972c67adb8a1ada287ee3f064d6f1f (diff)
downloadnetsurf-60c74c2e3c0190313e039fbb77dcd433921a3f72.tar.gz
netsurf-60c74c2e3c0190313e039fbb77dcd433921a3f72.tar.bz2
More comments for object dimension calculation.
svn path=/trunk/netsurf/; revision=11678
-rw-r--r--render/layout.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/render/layout.c b/render/layout.c
index 9f2dc88e0..8757dd8e2 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -833,7 +833,7 @@ bool layout_block_object(struct box *block)
* \param uppate_width Whether to update the width.
* \param update_height Whether to update the height.
*
- * See CSS 10.3 and 10.6.
+ * See CSS 2.1 sections 10.3 and 10.6.
*/
void layout_get_object_dimensions(struct box *box, int *width, int *height,
@@ -843,12 +843,15 @@ void layout_get_object_dimensions(struct box *box, int *width, int *height,
assert(width != NULL && height != NULL);
if (*width == AUTO && *height == AUTO) {
+ /* No given dimensions; use intrinsic dimensions */
if (update_width)
*width = content_get_width(box->object);
if (update_height)
*height = content_get_height(box->object);
} else if (update_width && *width == AUTO) {
+ /* Have given height; width is calculated from the given height
+ * and ratio of intrinsic dimensions */
int intrinsic_width = content_get_width(box->object);
int intrinsic_height = content_get_height(box->object);
@@ -859,6 +862,8 @@ void layout_get_object_dimensions(struct box *box, int *width, int *height,
*width = intrinsic_width;
} else if (update_height && *height == AUTO) {
+ /* Have given width; height is calculated from the given width
+ * and ratio of intrinsic dimensions */
int intrinsic_width = content_get_width(box->object);
int intrinsic_height = content_get_height(box->object);