netsurf: branch master updated. release/3.1-374-ga807d76

NetSurf Browser Project (Commit Mailer) no-reply at netsurf-browser.org
Mon Aug 4 14:50:18 BST 2014


Gitweb links:

...log http://git.netsurf-browser.org/netsurf.git/shortlog/a807d762f9bfd06c903ab220c68e021c8ae99d37
...commit http://git.netsurf-browser.org/netsurf.git/commit/a807d762f9bfd06c903ab220c68e021c8ae99d37
...tree http://git.netsurf-browser.org/netsurf.git/tree/a807d762f9bfd06c903ab220c68e021c8ae99d37

The branch, master has been updated
       via  a807d762f9bfd06c903ab220c68e021c8ae99d37 (commit)
       via  04ea4b52a07b49655b39df8f26496b66049a7f81 (commit)
      from  af16c38d2dbe2decfc45015bd4ee020cb52c608b (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=a807d762f9bfd06c903ab220c68e021c8ae99d37
commit a807d762f9bfd06c903ab220c68e021c8ae99d37
Author: Michael Drake <tlsa at netsurf-browser.org>
Commit: Michael Drake <tlsa at netsurf-browser.org>

    mailto urls don't have passwords or ports, so we don't need to look for ':'.

diff --git a/render/box.c b/render/box.c
index dd7c31f..4943119 100644
--- a/render/box.c
+++ b/render/box.c
@@ -342,6 +342,79 @@ void box_bounds(struct box *box, struct rect *r)
 	r->y1 = r->y0 + height;
 }
 
+enum box_walk_dir {
+	BOX_WALK_CHILDREN,
+	BOX_WALK_PARENT,
+	BOX_WALK_NEXT_SIBLING,
+	BOX_WALK_FLOAT_CHILDREN,
+	BOX_WALK_NEXT_FLOAT_SIBLING
+};
+
+static inline struct box *box_move_xy(struct box *b, enum box_walk_dir dir,
+		int *x, int *y)
+{
+	switch (dir) {
+	case BOX_WALK_CHILDREN:
+		b = b->children;
+		*x += b->x;
+		*y += b->y;
+		return b;
+
+	case BOX_WALK_PARENT:
+		*x -= b->x;
+		*y -= b->y;
+		return b->parent;
+
+	case BOX_WALK_NEXT_SIBLING:
+		*x -= b->x;
+		*y -= b->y;
+		b = b->next;
+		*x += b->x;
+		*y += b->y;
+		return b;
+
+	case BOX_WALK_FLOAT_CHILDREN:
+		b = b->float_children;
+		*x += b->x;
+		*y += b->y;
+		return b;
+
+	case BOX_WALK_NEXT_FLOAT_SIBLING:
+		*x -= b->x;
+		*y -= b->y;
+		b = b->next_float;
+		*x += b->x;
+		*y += b->y;
+		return b;
+	}
+}
+
+
+static struct box *box_next_xy(struct box *b, int *x, int *y)
+{
+	assert(b != NULL);
+
+	if (b->float_children != NULL) {
+		/* Next node is float child */
+		b = box_move_xy(b, BOX_WALK_FLOAT_CHILDREN, x, y);
+	} else if (b->children != NULL) {
+		/* Next node is child */
+		b = box_move_xy(b, BOX_WALK_CHILDREN, x, y);
+	} else if (b->type == BOX_FLOAT_LEFT || b->type == BOX_FLOAT_RIGHT) {
+		/* Go to next float sibling */
+		b = box_move_xy(b, BOX_WALK_NEXT_FLOAT_SIBLING, x, y);
+	} else {
+		/* Go to next sibling, or nearest ancestor with next sibling. */
+		while (b->next == NULL && b->parent != NULL) {
+			b = box_move_xy(b, BOX_WALK_PARENT, x, y);
+		}
+
+		b = box_move_xy(b, BOX_WALK_NEXT_SIBLING, x, y);
+	}
+
+	return b;
+}
+
 
 /**
  * Find the boxes at a point.
@@ -373,7 +446,8 @@ struct box *box_at_point(struct box *box, const int x, const int y,
 	int bx = *box_x, by = *box_y;
 	struct box *child, *sibling;
 	bool physically;
-
+printf("x0:%i y0:%i x1:%i y1:%i\n", box->descendant_x0, box->descendant_y0,
+		box->descendant_y0, box->descendant_y1);
 	assert(box);
 
 	/* consider floats first, since they will often overlap other boxes */
diff --git a/render/layout.c b/render/layout.c
index 5b0d8a0..e0f0a34 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -5068,7 +5068,7 @@ static void layout_get_box_bbox(struct box *box, int *desc_x0, int *desc_y0,
 
 		css_computed_font_size(box->style, &font_size, &font_unit);
 		text_height = nscss_len2px(font_size, font_unit, box->style);
-
+printf("%i", text_height);
 		*desc_y0 = (*desc_y0 < -text_height) ? *desc_y0 : -text_height;
 	}
 }
diff --git a/utils/nsurl.c b/utils/nsurl.c
index d327947..a85b447 100644
--- a/utils/nsurl.c
+++ b/utils/nsurl.c
@@ -411,13 +411,15 @@ static void nsurl__get_string_markers(const char * const url_s,
 				/* End of the authority */
 				break;
 
-			} else if (*pos == ':' && marker.colon_first ==
+			} else if (marker.scheme_type != NSURL_SCHEME_MAILTO &&
+					*pos == ':' && marker.colon_first ==
 					marker.authority) {
 				/* could be username:password or host:port
 				 * separator */
 				marker.colon_first = pos - url_s;
 
-			} else if (*pos == ':' && marker.colon_first !=
+			} else if (marker.scheme_type != NSURL_SCHEME_MAILTO &&
+					*pos == ':' && marker.colon_first !=
 					marker.authority) {
 				/* could be host:port separator */
 				marker.colon_last = pos - url_s;


commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=04ea4b52a07b49655b39df8f26496b66049a7f81
commit 04ea4b52a07b49655b39df8f26496b66049a7f81
Author: Michael Drake <tlsa at netsurf-browser.org>
Commit: Michael Drake <tlsa at netsurf-browser.org>

    Add debug.

diff --git a/utils/nsurl.c b/utils/nsurl.c
index 591907f..d327947 100644
--- a/utils/nsurl.c
+++ b/utils/nsurl.c
@@ -501,6 +501,22 @@ static void nsurl__get_string_markers(const char * const url_s,
 			marker.fragment = marker.end;
 	}
 
+#ifdef NSURL_DEBUG
+	LOG(("marker.start: %i", marker.start));
+	LOG(("marker.scheme_end: %i", marker.scheme_end));
+	LOG(("marker.authority: %i", marker.authority));
+
+	LOG(("marker.colon_first: %i", marker.colon_first));
+	LOG(("marker.at: %i", marker.at));
+	LOG(("marker.colon_last: %i", marker.colon_last));
+
+	LOG(("marker.path: %i", marker.path));
+	LOG(("marker.query: %i", marker.query));
+	LOG(("marker.fragment: %i", marker.fragment));
+
+	LOG(("marker.end: %i", marker.end));
+#endif
+
 	/* Got all the URL components pegged out now */
 	*markers = marker;
 }


-----------------------------------------------------------------------

Summary of changes:
 render/box.c    |   76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 render/layout.c |    2 +-
 utils/nsurl.c   |   22 ++++++++++++++-
 3 files changed, 96 insertions(+), 4 deletions(-)

diff --git a/render/box.c b/render/box.c
index dd7c31f..4943119 100644
--- a/render/box.c
+++ b/render/box.c
@@ -342,6 +342,79 @@ void box_bounds(struct box *box, struct rect *r)
 	r->y1 = r->y0 + height;
 }
 
+enum box_walk_dir {
+	BOX_WALK_CHILDREN,
+	BOX_WALK_PARENT,
+	BOX_WALK_NEXT_SIBLING,
+	BOX_WALK_FLOAT_CHILDREN,
+	BOX_WALK_NEXT_FLOAT_SIBLING
+};
+
+static inline struct box *box_move_xy(struct box *b, enum box_walk_dir dir,
+		int *x, int *y)
+{
+	switch (dir) {
+	case BOX_WALK_CHILDREN:
+		b = b->children;
+		*x += b->x;
+		*y += b->y;
+		return b;
+
+	case BOX_WALK_PARENT:
+		*x -= b->x;
+		*y -= b->y;
+		return b->parent;
+
+	case BOX_WALK_NEXT_SIBLING:
+		*x -= b->x;
+		*y -= b->y;
+		b = b->next;
+		*x += b->x;
+		*y += b->y;
+		return b;
+
+	case BOX_WALK_FLOAT_CHILDREN:
+		b = b->float_children;
+		*x += b->x;
+		*y += b->y;
+		return b;
+
+	case BOX_WALK_NEXT_FLOAT_SIBLING:
+		*x -= b->x;
+		*y -= b->y;
+		b = b->next_float;
+		*x += b->x;
+		*y += b->y;
+		return b;
+	}
+}
+
+
+static struct box *box_next_xy(struct box *b, int *x, int *y)
+{
+	assert(b != NULL);
+
+	if (b->float_children != NULL) {
+		/* Next node is float child */
+		b = box_move_xy(b, BOX_WALK_FLOAT_CHILDREN, x, y);
+	} else if (b->children != NULL) {
+		/* Next node is child */
+		b = box_move_xy(b, BOX_WALK_CHILDREN, x, y);
+	} else if (b->type == BOX_FLOAT_LEFT || b->type == BOX_FLOAT_RIGHT) {
+		/* Go to next float sibling */
+		b = box_move_xy(b, BOX_WALK_NEXT_FLOAT_SIBLING, x, y);
+	} else {
+		/* Go to next sibling, or nearest ancestor with next sibling. */
+		while (b->next == NULL && b->parent != NULL) {
+			b = box_move_xy(b, BOX_WALK_PARENT, x, y);
+		}
+
+		b = box_move_xy(b, BOX_WALK_NEXT_SIBLING, x, y);
+	}
+
+	return b;
+}
+
 
 /**
  * Find the boxes at a point.
@@ -373,7 +446,8 @@ struct box *box_at_point(struct box *box, const int x, const int y,
 	int bx = *box_x, by = *box_y;
 	struct box *child, *sibling;
 	bool physically;
-
+printf("x0:%i y0:%i x1:%i y1:%i\n", box->descendant_x0, box->descendant_y0,
+		box->descendant_y0, box->descendant_y1);
 	assert(box);
 
 	/* consider floats first, since they will often overlap other boxes */
diff --git a/render/layout.c b/render/layout.c
index 5b0d8a0..e0f0a34 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -5068,7 +5068,7 @@ static void layout_get_box_bbox(struct box *box, int *desc_x0, int *desc_y0,
 
 		css_computed_font_size(box->style, &font_size, &font_unit);
 		text_height = nscss_len2px(font_size, font_unit, box->style);
-
+printf("%i", text_height);
 		*desc_y0 = (*desc_y0 < -text_height) ? *desc_y0 : -text_height;
 	}
 }
diff --git a/utils/nsurl.c b/utils/nsurl.c
index 591907f..a85b447 100644
--- a/utils/nsurl.c
+++ b/utils/nsurl.c
@@ -411,13 +411,15 @@ static void nsurl__get_string_markers(const char * const url_s,
 				/* End of the authority */
 				break;
 
-			} else if (*pos == ':' && marker.colon_first ==
+			} else if (marker.scheme_type != NSURL_SCHEME_MAILTO &&
+					*pos == ':' && marker.colon_first ==
 					marker.authority) {
 				/* could be username:password or host:port
 				 * separator */
 				marker.colon_first = pos - url_s;
 
-			} else if (*pos == ':' && marker.colon_first !=
+			} else if (marker.scheme_type != NSURL_SCHEME_MAILTO &&
+					*pos == ':' && marker.colon_first !=
 					marker.authority) {
 				/* could be host:port separator */
 				marker.colon_last = pos - url_s;
@@ -501,6 +503,22 @@ static void nsurl__get_string_markers(const char * const url_s,
 			marker.fragment = marker.end;
 	}
 
+#ifdef NSURL_DEBUG
+	LOG(("marker.start: %i", marker.start));
+	LOG(("marker.scheme_end: %i", marker.scheme_end));
+	LOG(("marker.authority: %i", marker.authority));
+
+	LOG(("marker.colon_first: %i", marker.colon_first));
+	LOG(("marker.at: %i", marker.at));
+	LOG(("marker.colon_last: %i", marker.colon_last));
+
+	LOG(("marker.path: %i", marker.path));
+	LOG(("marker.query: %i", marker.query));
+	LOG(("marker.fragment: %i", marker.fragment));
+
+	LOG(("marker.end: %i", marker.end));
+#endif
+
 	/* Got all the URL components pegged out now */
 	*markers = marker;
 }


-- 
NetSurf Browser



More information about the netsurf-commits mailing list