1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[iframe] do not reset current_link

This commit is contained in:
Witold Filipczyk 2023-06-04 17:46:22 +02:00
parent cdcb32af8a
commit 2aa34e0f22
5 changed files with 23 additions and 20 deletions

View File

@ -519,7 +519,7 @@ html_iframe_do(char *a, char *object_src,
} }
if (height > 0) { if (height > 0) {
int y = html_context->part->cy + 1; int y = html_context->part->cy + 2;
char *url2; char *url2;
ln_break(html_context, height + 3); ln_break(html_context, height + 3);

View File

@ -459,8 +459,8 @@ draw_doc(struct session *ses, struct document_view *doc_view, int active)
if (document_has_iframes(doc_view->document)) { if (document_has_iframes(doc_view->document)) {
draw_iframe_lines(term, doc_view->document->iframe_desc, box->x, box->y, &color); draw_iframe_lines(term, doc_view->document->iframe_desc, box->x, box->y, &color);
if (vs->current_link == -1) // if (vs->current_link == -1)
vs->current_link = 0; // vs->current_link = 0;
} }
#ifdef CONFIG_LIBSIXEL #ifdef CONFIG_LIBSIXEL
while (!list_empty(term->images)) { while (!list_empty(term->images)) {
@ -517,11 +517,14 @@ draw_frames(struct session *ses)
} }
foreach (doc_view, ses->scrn_iframes) { foreach (doc_view, ses->scrn_iframes) {
doc_view->last_x = doc_view->last_y = -1; doc_view->last_x = doc_view->last_y = -1;
n++; //n++;
}
if (n) {
l = &cur_loc(ses)->vs.current_link;
*l = int_max(*l, 0) % int_max(n, 1);
} }
l = &cur_loc(ses)->vs.current_link;
*l = int_max(*l, 0) % int_max(n, 1);
current_doc_view = current_frame(ses); current_doc_view = current_frame(ses);
d = 0; d = 0;

View File

@ -1510,10 +1510,10 @@ current_frame(struct session *ses)
if (!current_frame_number--) return doc_view; if (!current_frame_number--) return doc_view;
} }
foreach (doc_view, ses->scrn_iframes) { // foreach (doc_view, ses->scrn_iframes) {
if (document_has_iframes(doc_view->document)) continue; // if (document_has_iframes(doc_view->document)) continue;
if (!current_frame_number--) return doc_view; // if (!current_frame_number--) return doc_view;
} // }
doc_view = ses->doc_view; doc_view = ses->doc_view;

View File

@ -26,7 +26,6 @@
#include "viewer/text/view.h" #include "viewer/text/view.h"
#include "viewer/text/vs.h" #include "viewer/text/vs.h"
/** @relates view_state */ /** @relates view_state */
void void
init_vs(struct view_state *vs, struct uri *uri, int plain) init_vs(struct view_state *vs, struct uri *uri, int plain)
@ -176,8 +175,8 @@ next_frame(struct session *ses, int p)
int n; int n;
if (!have_location(ses) if (!have_location(ses)
|| (ses->doc_view && !document_has_frames(ses->doc_view->document) || (ses->doc_view && !document_has_frames(ses->doc_view->document)))
&& !document_has_iframes(ses->doc_view->document))) // && !document_has_iframes(ses->doc_view->document)))
return; return;
ses->navigate_mode = NAVIGATE_LINKWISE; ses->navigate_mode = NAVIGATE_LINKWISE;
@ -189,10 +188,10 @@ next_frame(struct session *ses, int p)
if (!document_has_frames(doc_view->document)) if (!document_has_frames(doc_view->document))
n++; n++;
} }
foreach (doc_view, ses->scrn_iframes) { // foreach (doc_view, ses->scrn_iframes) {
if (!document_has_iframes(doc_view->document)) // if (!document_has_frames(doc_view->document))
n++; // n++;
} // }
vs->current_link += p; vs->current_link += p;
if (!n) n = 1; if (!n) n = 1;

View File

@ -1,9 +1,10 @@
<html> <html>
<body> <body>
TESTY1 TESTY1
<iframe src="file:///" height="200" width="800" name="t1"></iframe><hr> <br>TTTEST<a href="/">TESTY1</a>TTEST<br>
TESTY2 <!--<iframe src="file:///" height="200" width="800" name="t1"></iframe> -->
<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>
TESTY3 <br>TTTEST<a href="/home/witekfl">TESTY3</a>TTEST<br>
</body> </body>
</html> </html>