summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2018-01-03 22:18:12 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2018-01-05 13:49:51 +0000
commita67973f312b7cba8a6d56f9841a542a731a9ddb4 (patch)
tree342bd3ba62f3b3a002a0424944268b18b2e4dfac /render
parentae286be5a9a5c1150dfa7627f2b30a73238b506c (diff)
downloadnetsurf-a67973f312b7cba8a6d56f9841a542a731a9ddb4.tar.gz
netsurf-a67973f312b7cba8a6d56f9841a542a731a9ddb4.tar.bz2
Layout: No need to expose layout_calculate_descendant_bboxes().
Diffstat (limited to 'render')
-rw-r--r--render/layout.c109
-rw-r--r--render/layout.h8
2 files changed, 57 insertions, 60 deletions
diff --git a/render/layout.c b/render/layout.c
index b19d93f44..83dbc536d 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -5061,56 +5061,6 @@ layout_position_relative(struct box *root, struct box *fp, int fx, int fy)
}
-/* exported function documented in render/layout.h */
-bool layout_document(html_content *content, int width, int height)
-{
- bool ret;
- struct box *doc = content->layout;
- const struct gui_layout_table *font_func = content->font_func;
-
- layout_minmax_block(doc, font_func);
-
- layout_block_find_dimensions(width, height, 0, 0, doc);
- doc->x = doc->margin[LEFT] + doc->border[LEFT].width;
- doc->y = doc->margin[TOP] + doc->border[TOP].width;
- width -= doc->margin[LEFT] + doc->border[LEFT].width +
- doc->padding[LEFT] + doc->padding[RIGHT] +
- doc->border[RIGHT].width + doc->margin[RIGHT];
- if (width < 0) {
- width = 0;
- }
- doc->width = width;
-
- ret = layout_block_context(doc, height, content);
-
- /* make <html> and <body> fill available height */
- if (doc->y + doc->padding[TOP] + doc->height + doc->padding[BOTTOM] +
- doc->border[BOTTOM].width + doc->margin[BOTTOM] <
- height) {
- doc->height = height - (doc->y + doc->padding[TOP] +
- doc->padding[BOTTOM] +
- doc->border[BOTTOM].width +
- doc->margin[BOTTOM]);
- if (doc->children)
- doc->children->height = doc->height -
- (doc->children->margin[TOP] +
- doc->children->border[TOP].width +
- doc->children->padding[TOP] +
- doc->children->padding[BOTTOM] +
- doc->children->border[BOTTOM].width +
- doc->children->margin[BOTTOM]);
- }
-
- layout_lists(doc, font_func);
- layout_position_absolute(doc, doc, 0, 0, content);
- layout_position_relative(doc, doc, 0, 0);
-
- layout_calculate_descendant_bboxes(doc);
-
- return ret;
-}
-
-
/**
* Find a box's bounding box relative to itself, i.e. the box's border edge box
*
@@ -5215,8 +5165,13 @@ layout_update_descendant_bbox(struct box *box,
}
-/* exported function documented in render/layout.h */
-void layout_calculate_descendant_bboxes(struct box *box)
+/**
+ * Recursively calculate the descendant_[xy][01] values for a laid-out box tree
+ * and inform iframe browser windows of their size and position.
+ *
+ * \param box tree of boxes to update
+ */
+static void layout_calculate_descendant_bboxes(struct box *box)
{
struct box *child;
@@ -5303,3 +5258,53 @@ void layout_calculate_descendant_bboxes(struct box *box)
layout_update_descendant_bbox(box, child, 0, 0);
}
}
+
+
+/* exported function documented in render/layout.h */
+bool layout_document(html_content *content, int width, int height)
+{
+ bool ret;
+ struct box *doc = content->layout;
+ const struct gui_layout_table *font_func = content->font_func;
+
+ layout_minmax_block(doc, font_func);
+
+ layout_block_find_dimensions(width, height, 0, 0, doc);
+ doc->x = doc->margin[LEFT] + doc->border[LEFT].width;
+ doc->y = doc->margin[TOP] + doc->border[TOP].width;
+ width -= doc->margin[LEFT] + doc->border[LEFT].width +
+ doc->padding[LEFT] + doc->padding[RIGHT] +
+ doc->border[RIGHT].width + doc->margin[RIGHT];
+ if (width < 0) {
+ width = 0;
+ }
+ doc->width = width;
+
+ ret = layout_block_context(doc, height, content);
+
+ /* make <html> and <body> fill available height */
+ if (doc->y + doc->padding[TOP] + doc->height + doc->padding[BOTTOM] +
+ doc->border[BOTTOM].width + doc->margin[BOTTOM] <
+ height) {
+ doc->height = height - (doc->y + doc->padding[TOP] +
+ doc->padding[BOTTOM] +
+ doc->border[BOTTOM].width +
+ doc->margin[BOTTOM]);
+ if (doc->children)
+ doc->children->height = doc->height -
+ (doc->children->margin[TOP] +
+ doc->children->border[TOP].width +
+ doc->children->padding[TOP] +
+ doc->children->padding[BOTTOM] +
+ doc->children->border[BOTTOM].width +
+ doc->children->margin[BOTTOM]);
+ }
+
+ layout_lists(doc, font_func);
+ layout_position_absolute(doc, doc, 0, 0, content);
+ layout_position_relative(doc, doc, 0, 0);
+
+ layout_calculate_descendant_bboxes(doc);
+
+ return ret;
+}
diff --git a/render/layout.h b/render/layout.h
index 0aa0da3e9..cd5ddd77f 100644
--- a/render/layout.h
+++ b/render/layout.h
@@ -42,12 +42,4 @@ struct gui_layout_table;
*/
bool layout_document(struct html_content *content, int width, int height);
-/**
- * Recursively calculate the descendant_[xy][01] values for a laid-out box tree
- * and inform iframe browser windows of their size and position.
- *
- * \param box tree of boxes to update
- */
-void layout_calculate_descendant_bboxes(struct box *box);
-
#endif