aboutsummaryrefslogtreecommitdiff
path: root/src/html.cc
diff options
context:
space:
mode:
authorRodrigo Arias Mallo <rodarima@gmail.com>2025-08-24 18:02:58 +0200
committerRodrigo Arias Mallo <rodarima@gmail.com>2025-08-30 16:08:34 +0200
commite36fef7d312e226988c9733b03b18089bdf3e295 (patch)
treecba7872513e59cb17035d000a71fd53f8829e79a /src/html.cc
parentcfa3923a5ffed809b4d4a54f6100f85b9f7a296d (diff)
Consider also the current element display:none
The display_none flag is only set _after_ the open tag has run, so it will only affect child elements. If the current form input element has a display:none itself, it should be also considered. The new function a_Html_should_display() evaluates both conditions.
Diffstat (limited to 'src/html.cc')
-rw-r--r--src/html.cc11
1 files changed, 11 insertions, 0 deletions
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)