summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dw/textblock.cc9
-rw-r--r--src/form.cc5
-rw-r--r--src/html.cc9
-rw-r--r--src/html_common.hh1
4 files changed, 6 insertions, 18 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc
index 282ed1ad..65521b5a 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -1706,10 +1706,11 @@ void Textblock::addSpace (core::style::Style *style)
// page->words[nw].eff_space);
//DBG_OBJ_ARRSET_NUM (page, "words.%d.content.space", nw,
// page->words[nw].content.space);
-
- words->getRef(nw)->spaceStyle->unref ();
- words->getRef(nw)->spaceStyle = style;
- style->ref ();
+ if (style != words->getRef(nw)->spaceStyle) {
+ words->getRef(nw)->spaceStyle->unref ();
+ words->getRef(nw)->spaceStyle = style;
+ style->ref ();
+ }
}
}
}
diff --git a/src/form.cc b/src/form.cc
index 0f125c95..4a7e399a 100644
--- a/src/form.cc
+++ b/src/form.cc
@@ -552,7 +552,6 @@ void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize)
// strtol(attrbuf, NULL, 10));
}
HT2TB(html)->addWidget (embed, html->styleEngine->backgroundStyle());
- html->PrevWasSPC = false;
}
dFree(type);
dFree(name);
@@ -596,7 +595,6 @@ void Html_tag_open_isindex(DilloHtml *html, const char *tag, int tagsize)
Html_add_input(html, DILLO_HTML_INPUT_INDEX, embed, NULL, NULL, FALSE);
HT2TB(html)->addWidget (embed, html->styleEngine->backgroundStyle ());
- html->PrevWasSPC = false;
a_Url_free(action);
html->InFlags &= ~IN_FORM;
@@ -665,7 +663,6 @@ void Html_tag_open_textarea(DilloHtml *html, const char *tag, int tagsize)
Html_add_input(html, DILLO_HTML_INPUT_TEXTAREA, embed, name, NULL, false);
HT2TB(html)->addWidget (embed, html->styleEngine->backgroundStyle ());
- html->PrevWasSPC = false;
dFree(name);
}
@@ -752,7 +749,6 @@ void Html_tag_open_select(DilloHtml *html, const char *tag, int tagsize)
HT2TB(html)->addWidget (embed, html->styleEngine->backgroundStyle ());
Html_add_input(html, type, embed, name, NULL, false);
- html->PrevWasSPC = false;
a_Html_stash_init(html);
dFree(name);
}
@@ -1917,7 +1913,6 @@ static Embed *Html_input_image(DilloHtml *html, const char *tag, int tagsize)
factory->createComplexButtonResource(IM2DW(Image), false);
button = new Embed(complex_b_r);
HT2TB(html)->addWidget (button, html->styleEngine->style ());
- html->PrevWasSPC = false;
// gtk_widget_set_sensitive(widget, FALSE); /* Until end of FORM! */
/* a right button press brings up the image menu */
diff --git a/src/html.cc b/src/html.cc
index 82592f49..9ea8b808 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -449,7 +449,6 @@ DilloHtml::DilloHtml(BrowserWindow *p_bw, const DilloUrl *url,
pre_column = 0;
PreFirstChar = false;
PrevWasCR = false;
- PrevWasSPC = false;
InVisitedLink = false;
ReqTagClose = false;
TagSoup = true;
@@ -1106,9 +1105,8 @@ static void Html_process_space(DilloHtml *html, const char *space,
} else {
if (SGML_SPCDEL) {
/* SGML_SPCDEL ignores white space immediately after an open tag */
- } else if (!html->PrevWasSPC) {
+ } else {
HT2TB(html)->addSpace(html->styleEngine->wordStyle ());
- html->PrevWasSPC = true;
}
if (parse_mode == DILLO_HTML_PARSE_MODE_STASH_AND_BODY)
@@ -1199,7 +1197,6 @@ static void Html_process_word(DilloHtml *html, const char *word, int size)
i += len;
HT2TB(html)->addText(word2 + start, i - start,
html->styleEngine->wordStyle ());
- html->PrevWasSPC = false;
} else {
do {
i += len;
@@ -1207,7 +1204,6 @@ static void Html_process_word(DilloHtml *html, const char *word, int size)
(!a_Utf8_ideographic(word2+i, word2_end, &len)));
HT2TB(html)->addText(word2 + start, i - start,
html->styleEngine->wordStyle ());
- html->PrevWasSPC = false;
}
}
if (Pword == word2)
@@ -2158,7 +2154,6 @@ static void Html_tag_open_img(DilloHtml *html, const char *tag, int tagsize)
Image = a_Html_image_new(html, tag, tagsize, url);
HT2TB(html)->addWidget((Widget*)Image->dw, html->styleEngine->style());
- html->PrevWasSPC = false;
/* Image maps */
if (a_Html_get_attr(html, tag, tagsize, "ismap")) {
@@ -2657,11 +2652,9 @@ static void Html_tag_open_li(DilloHtml *html, const char *tag, int tagsize)
}
numtostr((*list_number)++, buf, 16, style->listStyleType);
list_item->initWithText (buf, wordStyle);
- html->PrevWasSPC = true; /* space added in initWithText */
} else {
// unordered
list_item->initWithWidget (new Bullet(), wordStyle);
- html->PrevWasSPC = true; /* space added in initWithWidget */
}
}
diff --git a/src/html_common.hh b/src/html_common.hh
index 6c15e405..8795637f 100644
--- a/src/html_common.hh
+++ b/src/html_common.hh
@@ -168,7 +168,6 @@ public: //BUG: for now everything is public
bool PreFirstChar; /* used to skip the first CR or CRLF in PRE tags */
bool PrevWasCR; /* Flag to help parsing of "\r\n" in PRE tags */
bool PrevWasOpenTag; /* Flag to help deferred parsing of white space */
- bool PrevWasSPC; /* Flag to help handling collapsing white space */
bool InVisitedLink; /* used to 'contrast_visited_colors' */
bool ReqTagClose; /* Flag to help handling bad-formed HTML */
bool TagSoup; /* Flag to enable the parser's cleanup functions */