1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-01-03 14:57:44 -05:00

[iframe] Pass document->nlinks to iframe

This commit is contained in:
Witold Filipczyk 2023-06-04 21:18:04 +02:00
parent 755b588387
commit fb4d1c9a27
4 changed files with 6 additions and 5 deletions

View File

@ -26,7 +26,7 @@
#include "util/time.h" #include "util/time.h"
void add_iframeset_entry(struct iframeset_desc **parent, void add_iframeset_entry(struct iframeset_desc **parent,
char *url, char *name, int y, int width, int height) char *url, char *name, int y, int width, int height, int nlink)
{ {
struct iframeset_desc *iframeset_desc; struct iframeset_desc *iframeset_desc;
struct iframe_desc *iframe_desc; struct iframe_desc *iframe_desc;
@ -44,7 +44,6 @@ void add_iframeset_entry(struct iframeset_desc **parent,
if (!*parent) return; if (!*parent) return;
iframeset_desc = *parent; iframeset_desc = *parent;
offset = iframeset_desc->n; offset = iframeset_desc->n;
iframe_desc = &iframeset_desc->iframe_desc[offset]; iframe_desc = &iframeset_desc->iframe_desc[offset];
iframe_desc->name = stracpy(name); iframe_desc->name = stracpy(name);
@ -53,6 +52,7 @@ void add_iframeset_entry(struct iframeset_desc **parent,
iframe_desc->y = y; iframe_desc->y = y;
iframe_desc->width = width; iframe_desc->width = width;
iframe_desc->height = height; iframe_desc->height = height;
iframe_desc->nlink = nlink;
if (!iframe_desc->uri) if (!iframe_desc->uri)
iframe_desc->uri = get_uri(about_blank, URI_NONE); iframe_desc->uri = get_uri(about_blank, URI_NONE);

View File

@ -16,6 +16,7 @@ struct iframe_desc {
int x; int x;
int y; int y;
int width, height; int width, height;
int nlink;
}; };
struct iframeset_desc { struct iframeset_desc {
@ -25,7 +26,7 @@ struct iframeset_desc {
struct iframe_desc iframe_desc[1]; /* must be last of struct. --Zas */ struct iframe_desc iframe_desc[1]; /* must be last of struct. --Zas */
}; };
void add_iframeset_entry(struct iframeset_desc **parent, char *url, char *name, int y, int width, int height); void add_iframeset_entry(struct iframeset_desc **parent, char *url, char *name, int y, int width, int height, int nlink);
void format_iframes(struct session *ses, struct iframeset_desc *ifsd, struct document_options *op, int depth); void format_iframes(struct session *ses, struct iframeset_desc *ifsd, struct document_options *op, int depth);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -2402,7 +2402,7 @@ html_special(struct html_context *html_context, html_special_type_T c, ...)
int width = va_arg(l, int); int width = va_arg(l, int);
int height = va_arg(l, int); int height = va_arg(l, int);
add_iframeset_entry(&document->iframe_desc, url, name, y, width, height); add_iframeset_entry(&document->iframe_desc, url, name, y, width, height, document->nlinks);
} }
break; break;
} }

View File

@ -2,9 +2,9 @@
<body> <body>
TESTY1 TESTY1
<br>TTTEST<a href="/">TESTY1</a>TTEST<br> <br>TTTEST<a href="/">TESTY1</a>TTEST<br>
<!--<iframe src="file:///" height="200" width="800" name="t1"></iframe> -->
<br>TTTEST<a href="/home">TESTY2</a>TTEST<br> <br>TTTEST<a href="/home">TESTY2</a>TTEST<br>
<iframe src="file:///usr/share/doc/" height="400" width="800" name="t2"></iframe><hr> <iframe src="file:///usr/share/doc/" height="400" width="800" name="t2"></iframe><hr>
<br>TTTEST<a href="/home/witekfl">TESTY3</a>TTEST<br> <br>TTTEST<a href="/home/witekfl">TESTY3</a>TTEST<br>
<iframe src="file:///" height="200" width="800" name="t1"></iframe>
</body> </body>
</html> </html>