From 62be8a6d8d1f92a11642e084ffc4598481cae785 Mon Sep 17 00:00:00 2001 From: Cameron Paul Date: Thu, 29 May 2025 17:23:28 -0500 Subject: [PATCH 1/2] Add test for floating blockquote --- test/html/Makefile.am | 2 ++ test/html/render/floating-blockquote.html | 26 +++++++++++++++++++ test/html/render/floating-blockquote.ref.html | 26 +++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 test/html/render/floating-blockquote.html create mode 100644 test/html/render/floating-blockquote.ref.html diff --git a/test/html/Makefile.am b/test/html/Makefile.am index 044d54373..d74cfe49e 100644 --- a/test/html/Makefile.am +++ b/test/html/Makefile.am @@ -14,6 +14,7 @@ TESTS = \ render/b-div.html \ render/div-100-percent-with-padding.html \ render/float-img-justify.html \ + render/floating-blockquote.html \ render/github-infinite-loop.html \ render/hackernews.html \ render/img-aspect-ratio-absolute.html \ @@ -50,6 +51,7 @@ TESTS = \ XFAIL_TESTS = \ render/div-100-percent-with-padding.html \ render/float-img-justify.html \ + render/floating-blockquote.html \ render/margin-auto.html \ render/max-width-html.html \ render/min-width-html.html \ diff --git a/test/html/render/floating-blockquote.html b/test/html/render/floating-blockquote.html new file mode 100644 index 000000000..f4ae29ce4 --- /dev/null +++ b/test/html/render/floating-blockquote.html @@ -0,0 +1,26 @@ + + + + Test floating blockquote + + + +
+ + diff --git a/test/html/render/floating-blockquote.ref.html b/test/html/render/floating-blockquote.ref.html new file mode 100644 index 000000000..fddbfa333 --- /dev/null +++ b/test/html/render/floating-blockquote.ref.html @@ -0,0 +1,26 @@ + + + + Test floating blockquote + + + +
+ + From a337bac1061ad45e2b0da119abd83ee76e0f019d Mon Sep 17 00:00:00 2001 From: Cameron Paul Date: Thu, 29 May 2025 19:40:03 -0500 Subject: [PATCH 2/2] Prevent double adding text blocks for blockquote and dd --- src/html.cc | 21 ++------------------- src/styleengine.cc | 2 +- test/html/Makefile.am | 1 - 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/html.cc b/src/html.cc index c06fd1726..6fc94ecbb 100644 --- a/src/html.cc +++ b/src/html.cc @@ -2777,15 +2777,6 @@ static void Html_tag_close_a(DilloHtml *html) html->InVisitedLink = false; } -/* - *
- */ -static void Html_tag_open_blockquote(DilloHtml *html, - const char *tag, int tagsize) -{ - Html_add_textblock(html, true, 9, false); -} - /* * */ @@ -3047,14 +3038,6 @@ static void Html_tag_open_dt(DilloHtml *html, const char *tag, int tagsize) HT2TB(html)->addParbreak (9, html->wordStyle ()); } -/* - *
- */ -static void Html_tag_open_dd(DilloHtml *html, const char *tag, int tagsize) -{ - Html_add_textblock(html, true, 9, false); -} - /* *
  */
@@ -3490,7 +3473,7 @@ static const TagInfo Tags[] = {
  /* basefont 010001 -- obsolete in HTML5 */
  /* bdo 010101 */
  {"big", B8(01011),'R', Html_tag_open_default, NULL, NULL},
- {"blockquote", B8(01110),'R', Html_tag_open_blockquote, NULL, NULL},
+ {"blockquote", B8(01110),'R', Html_tag_open_default, NULL, NULL},
  {"body", B8(01110),'O', Html_tag_open_body, NULL, Html_tag_close_body},
  {"br", B8(01001),'F', Html_tag_open_default, Html_tag_content_br, NULL},
  {"button", B8(01111),'R', Html_tag_open_button,NULL,Html_tag_close_button},
@@ -3500,7 +3483,7 @@ static const TagInfo Tags[] = {
  {"code", B8(01011),'R', Html_tag_open_default, NULL, NULL},
  /* col 010010 'F' */
  /* colgroup */
- {"dd", B8(01110),'O', Html_tag_open_dd, NULL, NULL},
+ {"dd", B8(01110),'O', Html_tag_open_default, NULL, NULL},
  {"del", B8(01111),'R', Html_tag_open_default, NULL, NULL},
  {"dfn", B8(01011),'R', Html_tag_open_default, NULL, NULL},
  {"dir", B8(01100),'R', Html_tag_open_dir, NULL, Html_tag_close_par},
diff --git a/src/styleengine.cc b/src/styleengine.cc
index ef8ab3c02..908d7828f 100644
--- a/src/styleengine.cc
+++ b/src/styleengine.cc
@@ -1027,7 +1027,7 @@ void StyleEngine::init () {
       ":link {color: blue; text-decoration: underline; cursor: pointer}"
       ":visited {color: #800080; text-decoration: underline; cursor: pointer}"
       "h1, h2, h3, h4, h5, h6, b, strong {font-weight: bolder}"
-      "address, article, aside, center, div, figure, figcaption, footer,"
+      "address, article, aside, blockquote, center, div, dd, figure, figcaption, footer,"
       " h1, h2, h3, h4, h5, h6, header, main, nav, ol, p, pre, section, ul"
       " {display: block}"
       "i, em, cite, address, var {font-style: italic}"
diff --git a/test/html/Makefile.am b/test/html/Makefile.am
index d74cfe49e..5093d446a 100644
--- a/test/html/Makefile.am
+++ b/test/html/Makefile.am
@@ -51,7 +51,6 @@ TESTS = \
 XFAIL_TESTS = \
 	render/div-100-percent-with-padding.html \
 	render/float-img-justify.html \
-	render/floating-blockquote.html \
 	render/margin-auto.html \
 	render/max-width-html.html \
 	render/min-width-html.html \