summaryrefslogtreecommitdiff
path: root/render/layout.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-06-24 09:30:33 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-06-24 09:30:33 +0000
commit5a4c8916efe2449f2cf43bef2f7746dd53469046 (patch)
treef8f019f04d6137557f61c30fe8c7b5584f33b51c /render/layout.c
parent93941435b800b3514660f19f6bac9b44506e3856 (diff)
downloadnetsurf-5a4c8916efe2449f2cf43bef2f7746dd53469046.tar.gz
netsurf-5a4c8916efe2449f2cf43bef2f7746dd53469046.tar.bz2
If iframes are reformatted due to containing document reflow, don't need to redraw them since they will be redrawn when the containing document is redrawn. Make iframe handling more robust.
svn path=/trunk/netsurf/; revision=12497
Diffstat (limited to 'render/layout.c')
-rw-r--r--render/layout.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/render/layout.c b/render/layout.c
index f9e1d5b2b..81a4df802 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -273,12 +273,6 @@ bool layout_block_context(struct box *block, int viewport_height,
return true;
}
- /* special case if the block contains an iframe */
- if (block->iframe) {
- browser_window_reformat(block->iframe, block->width,
- block->height == AUTO ? 0 : block->height);
- }
-
/* special case if the block contains an radio button or checkbox */
if (block->gadget && (block->gadget->type == GADGET_RADIO ||
block->gadget->type == GADGET_CHECKBOX)) {
@@ -512,11 +506,6 @@ bool layout_block_context(struct box *block, int viewport_height,
if (!layout_block_object(box))
return false;
- } else if (box->iframe) {
- browser_window_reformat(box->iframe, box->width,
- box->height == AUTO ?
- 0 : box->height);
-
} else if (box->type == BOX_INLINE_CONTAINER) {
box->width = box->parent->width;
if (!layout_inline_container(box, box->width, block,
@@ -1045,7 +1034,7 @@ bool layout_block_object(struct box *block)
#endif
if (content_get_type(block->object) == CONTENT_HTML) {
- content_reformat(block->object, block->width, 1);
+ content_reformat(block->object, false, block->width, 1);
} else {
/* Non-HTML objects */
/* this case handled already in
@@ -2515,7 +2504,7 @@ bool layout_line(struct box *first, int *width, int *y,
content_get_available_width(b->object)) {
htype = css_computed_height(b->style, &value, &unit);
- content_reformat(b->object, b->width, b->height);
+ content_reformat(b->object, false, b->width, b->height);
if (htype == CSS_HEIGHT_AUTO)
b->height = content_get_height(b->object);
@@ -2731,13 +2720,6 @@ bool layout_line(struct box *first, int *width, int *y,
b->next_float = cont->float_children;
cont->float_children = b;
- /* If the iframe's bw is in place, reformat it to the
- * new box size */
- if (b->iframe) {
- browser_window_reformat(b->iframe,
- b->width, b->height);
- }
-
split_box = 0;
}
}
@@ -5007,7 +4989,8 @@ static void layout_update_descendant_bbox(struct box *box, struct box *child,
/**
- * Recursively calculate the descendant_[xy][01] values for a laid-out box tree.
+ * 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
*/
@@ -5031,6 +5014,17 @@ void layout_calculate_descendant_bboxes(struct box *box)
box->descendant_y1 = content_get_height(box->object);
}
+ if (box->iframe != NULL) {
+ int x, y;
+ box_coords(box, &x, &y);
+
+ browser_window_set_position(box->iframe, x, y);
+ browser_window_set_dimensions(box->iframe,
+ box->width, box->height);
+ browser_window_reformat(box->iframe, true,
+ box->width, box->height);
+ }
+
if (box->type == BOX_INLINE || box->type == BOX_TEXT)
return;