summaryrefslogtreecommitdiff
path: root/render/box.c
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2006-12-31 23:47:17 +0000
committerJames Bursa <james@netsurf-browser.org>2006-12-31 23:47:17 +0000
commitd117eb452763e1da14c89b9a5379285b56d6ad78 (patch)
tree137186df11689bc8ff7c9349a0910a74cd89c77a /render/box.c
parent3d09fed0af65ba1dc295573ecd7bf9385aec5186 (diff)
downloadnetsurf-d117eb452763e1da14c89b9a5379285b56d6ad78.tar.gz
netsurf-d117eb452763e1da14c89b9a5379285b56d6ad78.tar.bz2
Stop animated images rendering for hidden or fallback boxes.
svn path=/trunk/netsurf/; revision=3128
Diffstat (limited to 'render/box.c')
-rw-r--r--render/box.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/render/box.c b/render/box.c
index fe70c61f8..6f5b3f158 100644
--- a/render/box.c
+++ b/render/box.c
@@ -459,6 +459,34 @@ struct box *box_find_by_id(struct box *box, const char *id)
/**
+ * Determine if a box is visible when the tree is rendered.
+ *
+ * \param box box to check
+ * \return true iff the box is rendered
+ */
+
+bool *box_visible(struct box *box)
+{
+ struct box *fallback;
+
+ /* visibility: hidden */
+ if (box->style && box->style->visibility == CSS_VISIBILITY_HIDDEN)
+ return false;
+
+ /* check if a fallback */
+ while (box->parent) {
+ for (fallback = box->parent->fallback; fallback;
+ fallback = fallback->next)
+ if (fallback == box)
+ return false;
+ box = box->parent;
+ }
+
+ return true;
+}
+
+
+/**
* Print a box tree to stderr.
*/