aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/form.cc6
-rw-r--r--src/html.cc11
-rw-r--r--src/html_common.hh3
3 files changed, 16 insertions, 4 deletions
diff --git a/src/form.cc b/src/form.cc
index d13bff24..62c36d4f 100644
--- a/src/form.cc
+++ b/src/form.cc
@@ -574,7 +574,7 @@ void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize)
}
/* Don't add to textbox if we are under a display:none element */
- if (!S_TOP(html)->display_none)
+ if (a_Html_should_display(html))
HT2TB(html)->addWidget (embed, html->backgroundStyle());
}
dFree(type);
@@ -687,7 +687,7 @@ void Html_tag_content_textarea(DilloHtml *html, const char *tag, int tagsize)
textres->setEditable(false);
Html_add_input(html, DILLO_HTML_INPUT_TEXTAREA, embed, name, NULL, false);
- if (!S_TOP(html)->display_none)
+ if (a_Html_should_display(html))
HT2TB(html)->addWidget (embed, html->backgroundStyle ());
dFree(name);
@@ -781,7 +781,7 @@ void Html_tag_open_select(DilloHtml *html, const char *tag, int tagsize)
attrbuf);
}
- if (!S_TOP(html)->display_none)
+ if (a_Html_should_display(html))
HT2TB(html)->addWidget (embed, html->backgroundStyle ());
Html_add_input(html, type, embed, name, NULL, false);
diff --git a/src/html.cc b/src/html.cc
index c06fd172..17bba438 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -4026,6 +4026,17 @@ static void Html_display_listitem(DilloHtml *html)
}
}
+bool a_Html_should_display(DilloHtml *html)
+{
+ if (S_TOP(html)->display_none)
+ return false;
+
+ if (html->style()->display == DISPLAY_NONE)
+ return false;
+
+ return true;
+}
+
/**
* Process a tag, given as 'tag' and 'tagsize'. -- tagsize is [1 based]
* ('tag' must include the enclosing angle brackets)
diff --git a/src/html_common.hh b/src/html_common.hh
index 2bb6c935..926f9fc9 100644
--- a/src/html_common.hh
+++ b/src/html_common.hh
@@ -3,7 +3,7 @@
*
* Copyright (C) 2008-2016 Jorge Arellano Cid <jcid@dillo.org>
* Copyright (C) 2008-2014 Johannes Hofmann <Johannes.Hofmann@gmx.de>
- * Copyright (C) 2024 Rodrigo Arias Mallo <rodarima@gmail.com>
+ * Copyright (C) 2024-2025 Rodrigo Arias Mallo <rodarima@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -288,5 +288,6 @@ bool a_Html_tag_set_valign_attr(DilloHtml *html,
const char *tag, int tagsize);
void a_Html_load_stylesheet(DilloHtml *html, DilloUrl *url);
+bool a_Html_should_display(DilloHtml *html);
#endif /* __HTML_COMMON_HH__ */