Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/62e3ee6c7ec751674c6ff1d4b5235cb1ab482e55
...commit
http://git.netsurf-browser.org/netsurf.git/commit/62e3ee6c7ec751674c6ff1d4b5235cb1ab482e55
...tree
http://git.netsurf-browser.org/netsurf.git/tree/62e3ee6c7ec751674c6ff1d4b5235cb1ab482e55
The branch, master has been updated
via 62e3ee6c7ec751674c6ff1d4b5235cb1ab482e55 (commit)
via 049695fa070c23580291949053b6d1faf8ffd749 (commit)
via 948207472ac1d405e6e6552eb51c6ed1a67ee32e (commit)
from 97007d095e25af302abeb32662353f84f720863c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=62e3ee6c7ec751674c6ff1d4b5235cb1ab482e55
commit 62e3ee6c7ec751674c6ff1d4b5235cb1ab482e55
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Layout: Use box helper for first child checks.
diff --git a/content/handlers/html/layout.c b/content/handlers/html/layout.c
index e9112fa..ee12128 100644
--- a/content/handlers/html/layout.c
+++ b/content/handlers/html/layout.c
@@ -1578,7 +1578,7 @@ layout_next_margin_block(const nscss_len_ctx *len_ctx,
css_computed_overflow_y(box->style) !=
CSS_OVERFLOW_VISIBLE) ||
(box->type == BOX_INLINE_CONTAINER &&
- box != box->parent->children)) {
+ !box_is_first_child(box))) {
/* Collapse to this box; return it */
return box;
}
@@ -4141,7 +4141,7 @@ layout_block_context(struct box *block,
if (((box->type == BOX_BLOCK && (box->flags & HAS_HEIGHT)) ||
box->type == BOX_TABLE ||
(box->type == BOX_INLINE_CONTAINER &&
- box != box->parent->children) ||
+ !box_is_first_child(box)) ||
margin_collapse == box) &&
in_margin == true) {
/* Margin goes above this box. */
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=049695fa070c23580291949053b6d1faf8ffd749
commit 049695fa070c23580291949053b6d1faf8ffd749
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Box: Add helper to check if box is first child.
diff --git a/content/handlers/html/box.h b/content/handlers/html/box.h
index f096b67..0952b84 100644
--- a/content/handlers/html/box.h
+++ b/content/handlers/html/box.h
@@ -366,4 +366,15 @@ bool box_normalise_block(
const struct box *root,
struct html_content *c);
+/**
+ * Check if layout box is a first child.
+ *
+ * \param[in] b Box to check.
+ * \return true iff box is first child.
+ */
+static inline bool box_is_first_child(struct box *b)
+{
+ return (b->parent == NULL || b == b->parent->children);
+}
+
#endif
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=948207472ac1d405e6e6552eb51c6ed1a67ee32e
commit 948207472ac1d405e6e6552eb51c6ed1a67ee32e
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Layout: Tidy condition so it can be read.
diff --git a/content/handlers/html/layout.c b/content/handlers/html/layout.c
index 2d2c424..e9112fa 100644
--- a/content/handlers/html/layout.c
+++ b/content/handlers/html/layout.c
@@ -4138,13 +4138,12 @@ layout_block_context(struct box *block,
}
/* Vertical margin */
- if (((box->type == BOX_BLOCK &&
- (box->flags & HAS_HEIGHT)) ||
- box->type == BOX_TABLE ||
- (box->type == BOX_INLINE_CONTAINER &&
- box != box->parent->children) ||
- margin_collapse == box) &&
- in_margin == true) {
+ if (((box->type == BOX_BLOCK && (box->flags & HAS_HEIGHT)) ||
+ box->type == BOX_TABLE ||
+ (box->type == BOX_INLINE_CONTAINER &&
+ box != box->parent->children) ||
+ margin_collapse == box) &&
+ in_margin == true) {
/* Margin goes above this box. */
cy += max_pos_margin - max_neg_margin;
box->y += max_pos_margin - max_neg_margin;
-----------------------------------------------------------------------
Summary of changes:
content/handlers/html/box.h | 11 +++++++++++
content/handlers/html/layout.c | 15 +++++++--------
2 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/content/handlers/html/box.h b/content/handlers/html/box.h
index f096b67..0952b84 100644
--- a/content/handlers/html/box.h
+++ b/content/handlers/html/box.h
@@ -366,4 +366,15 @@ bool box_normalise_block(
const struct box *root,
struct html_content *c);
+/**
+ * Check if layout box is a first child.
+ *
+ * \param[in] b Box to check.
+ * \return true iff box is first child.
+ */
+static inline bool box_is_first_child(struct box *b)
+{
+ return (b->parent == NULL || b == b->parent->children);
+}
+
#endif
diff --git a/content/handlers/html/layout.c b/content/handlers/html/layout.c
index 2d2c424..ee12128 100644
--- a/content/handlers/html/layout.c
+++ b/content/handlers/html/layout.c
@@ -1578,7 +1578,7 @@ layout_next_margin_block(const nscss_len_ctx *len_ctx,
css_computed_overflow_y(box->style) !=
CSS_OVERFLOW_VISIBLE) ||
(box->type == BOX_INLINE_CONTAINER &&
- box != box->parent->children)) {
+ !box_is_first_child(box))) {
/* Collapse to this box; return it */
return box;
}
@@ -4138,13 +4138,12 @@ layout_block_context(struct box *block,
}
/* Vertical margin */
- if (((box->type == BOX_BLOCK &&
- (box->flags & HAS_HEIGHT)) ||
- box->type == BOX_TABLE ||
- (box->type == BOX_INLINE_CONTAINER &&
- box != box->parent->children) ||
- margin_collapse == box) &&
- in_margin == true) {
+ if (((box->type == BOX_BLOCK && (box->flags & HAS_HEIGHT)) ||
+ box->type == BOX_TABLE ||
+ (box->type == BOX_INLINE_CONTAINER &&
+ !box_is_first_child(box)) ||
+ margin_collapse == box) &&
+ in_margin == true) {
/* Margin goes above this box. */
cy += max_pos_margin - max_neg_margin;
box->y += max_pos_margin - max_neg_margin;
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org