summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--config.h.in5
-rw-r--r--doc/Cookies.txt16
-rw-r--r--dw/fltkplatform.cc2
-rw-r--r--dw/fltkviewbase.cc2
-rw-r--r--dw/table.cc10
-rw-r--r--dw/textblock.cc10
-rw-r--r--src/css.cc6
-rw-r--r--src/css.hh3
-rw-r--r--src/cssparser.cc14
-rw-r--r--src/cssparser.hh5
-rw-r--r--src/gif.c3
-rw-r--r--src/styleengine.cc23
-rw-r--r--src/styleengine.hh1
14 files changed, 56 insertions, 45 deletions
diff --git a/ChangeLog b/ChangeLog
index 80e7d4d5..97d68a4e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -41,6 +41,7 @@ dillo-2.2.1 [not released yet]
+- Reintroduce bg_color dillorc option.
- Make Dillo compile with Clang.
- Fix Textblock flushing.
+ - Support !important in style attributes.
Patches: Johannes Hofmann
+- Implement line-height.
- Draw image maps when image not loaded.
diff --git a/config.h.in b/config.h.in
index 371d658f..fcffdf8f 100644
--- a/config.h.in
+++ b/config.h.in
@@ -78,9 +78,6 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
/* Define to the version of this package. */
#undef PACKAGE_VERSION
@@ -106,7 +103,7 @@
#undef VERSION
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
- <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ <pthread.h>, or <semaphore.h> is not used. If the typedef was allowed, the
#define below would cause a syntax error. */
#undef _UINT32_T
diff --git a/doc/Cookies.txt b/doc/Cookies.txt
index a8e82a83..49e743b3 100644
--- a/doc/Cookies.txt
+++ b/doc/Cookies.txt
@@ -7,14 +7,13 @@ Last update: March 2010
Cookies in Dillo
==================
-Dillo's cookies implementation is guided by ongoing work by the HTTP State WG
-( http://www.ietf.org/dyn/wg/charter/httpstate-charter ) to specify current
-real-world cookies usage.
+The current specification for cookies is RFC 6265
+( http://tools.ietf.org/html/rfc6265 ).
Cookies are handled by a dpi (plugin) which shares them between your
instances of Dillo.
-Currently, cookie limits are: 20 per domain, and 1200 in total.
+Current cookie limits are: 20 per domain, and 1200 in total.
When the dpi exits, cookies that you have ACCEPTed are saved to
~/.dillo/cookies.txt, and ACCEPT_SESSION cookies are forgotten.
@@ -66,15 +65,10 @@ information (SPAM, Spying, etc).
with more information than you have about yourself.
Some people may tell you this is "paranoid". But please, take my words
-as those of someone that has written a web browser, a cookies implementation,
-and that has deep understanding of HTTP (RFC-2068) and cookies (RFC-2965).
-
- Non technical persons may like to read:
- http://www.junkbusters.com/cookies.html
+as those of someone who has written a web browser, a cookies implementation,
+and who has deep understanding of HTTP and cookies.
The dillo project is especially concerned about privacy and security
issues. Our advice is to avoid cookies whenever possible and at most set
ACCEPT_SESSION to specific, trusted sites. -- You have been warned.
-
-Thats all folks!
diff --git a/dw/fltkplatform.cc b/dw/fltkplatform.cc
index 148ac812..d4db5d7a 100644
--- a/dw/fltkplatform.cc
+++ b/dw/fltkplatform.cc
@@ -421,7 +421,7 @@ int FltkPlatform::textWidth (core::style::Font *font, const char *text,
FltkFont *ff = (FltkFont*) font;
int curr = 0, next = 0, nb;
- if (font->fontVariant == 1) {
+ if (font->fontVariant == core::style::FONT_VARIANT_SMALL_CAPS) {
int sc_fontsize = lout::misc::roundInt(ff->size * 0.78);
for (curr = 0; next < len; curr = next) {
next = nextGlyph(text, curr);
diff --git a/dw/fltkviewbase.cc b/dw/fltkviewbase.cc
index 689868f6..22fb06ef 100644
--- a/dw/fltkviewbase.cc
+++ b/dw/fltkviewbase.cc
@@ -543,7 +543,7 @@ void FltkWidgetView::drawText (core::style::Font *font,
char chbuf[4];
wchar_t wc, wcu;
- if (font->fontVariant == 1) {
+ if (font->fontVariant == core::style::FONT_VARIANT_SMALL_CAPS) {
int sc_fontsize = lout::misc::roundInt(ff->size * 0.78);
for (curr = 0; next < len; curr = next) {
next = theLayout->nextGlyph(text, curr);
diff --git a/dw/table.cc b/dw/table.cc
index 6708b3f0..8a46ce7c 100644
--- a/dw/table.cc
+++ b/dw/table.cc
@@ -320,11 +320,19 @@ void Table::addCell (Widget *widget, int colspan, int rowspan)
for (int col = 0; col < colspanEff; col++)
for (int row = 0; row < rowspan; row++)
if (!(col == 0 && row == 0)) {
+ int i = (curRow + row) * numCols + curCol + col;
+
+ child = children->get(i);
+ if (child) {
+ MSG("Overlapping spans in table.\n");
+ assert(child->type == Child::SPAN_SPACE);
+ delete child;
+ }
child = new Child ();
child->type = Child::SPAN_SPACE;
child->spanSpace.startCol = curCol;
child->spanSpace.startRow = curRow;
- children->set ((curRow + row) * numCols + curCol + col, child);
+ children->set (i, child);
}
// Set the "root" cell.
diff --git a/dw/textblock.cc b/dw/textblock.cc
index 02393ccd..401ada66 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -1403,11 +1403,6 @@ void Textblock::drawLine (Line *line, core::View *view, core::Rectangle *area)
word->content.type == core::Content::WIDGET) {
if (word->size.width > 0) {
- if (word->style->hasBackground ()) {
- drawBox (view, word->style, area, xWidget,
- yWidgetBase - line->boxAscent, word->size.width,
- line->boxAscent + line->boxDescent, false);
- }
if (word->content.type == core::Content::WIDGET) {
core::Widget *child = word->content.widget;
core::Rectangle childArea;
@@ -1415,6 +1410,11 @@ void Textblock::drawLine (Line *line, core::View *view, core::Rectangle *area)
if (child->intersects (area, &childArea))
child->draw (view, &childArea);
} else {
+ if (word->style->hasBackground ()) {
+ drawBox (view, word->style, area, xWidget,
+ yWidgetBase - line->boxAscent, word->size.width,
+ line->boxAscent + line->boxDescent, false);
+ }
drawText(wordIndex, view, area, xWidget, yWidgetBase);
}
}
diff --git a/src/css.cc b/src/css.cc
index cb0864fd..d8f086db 100644
--- a/src/css.cc
+++ b/src/css.cc
@@ -535,7 +535,8 @@ CssContext::~CssContext () {
*/
void CssContext::apply (CssPropertyList *props, Doctree *docTree,
DoctreeNode *node,
- CssPropertyList *tagStyle, CssPropertyList *nonCssHints) {
+ CssPropertyList *tagStyle, CssPropertyList *tagStyleImportant,
+ CssPropertyList *nonCssHints) {
if (sheet[CSS_PRIMARY_USER_AGENT])
sheet[CSS_PRIMARY_USER_AGENT]->apply (props, docTree, node);
@@ -554,6 +555,9 @@ void CssContext::apply (CssPropertyList *props, Doctree *docTree,
if (sheet[CSS_PRIMARY_AUTHOR_IMPORTANT])
sheet[CSS_PRIMARY_AUTHOR_IMPORTANT]->apply (props, docTree, node);
+ if (tagStyleImportant)
+ tagStyleImportant->apply (props);
+
if (sheet[CSS_PRIMARY_USER_IMPORTANT])
sheet[CSS_PRIMARY_USER_IMPORTANT]->apply (props, docTree, node);
}
diff --git a/src/css.hh b/src/css.hh
index bf7d3c1d..61c1d12f 100644
--- a/src/css.hh
+++ b/src/css.hh
@@ -475,7 +475,8 @@ class CssContext {
CssPrimaryOrder order);
void apply (CssPropertyList *props,
Doctree *docTree, DoctreeNode *node,
- CssPropertyList *tagStyle, CssPropertyList *nonCssHints);
+ CssPropertyList *tagStyle, CssPropertyList *tagStyleImportant,
+ CssPropertyList *nonCssHints);
};
#endif
diff --git a/src/cssparser.cc b/src/cssparser.cc
index 1075ef63..f173f403 100644
--- a/src/cssparser.cc
+++ b/src/cssparser.cc
@@ -1590,22 +1590,16 @@ void CssParser::parse(DilloHtml *html, DilloUrl *url, CssContext * context,
}
}
-CssPropertyList *CssParser::parseDeclarationBlock(const char *buf, int buflen)
+void CssParser::parseDeclarationBlock(const char *buf, int buflen,
+ CssPropertyList *props,
+ CssPropertyList *propsImortant)
{
- CssPropertyList *props = new CssPropertyList (true);
CssParser parser (NULL, CSS_ORIGIN_AUTHOR, buf, buflen);
parser.withinBlock = true;
do
- parser.parseDeclaration(props, NULL);
+ parser.parseDeclaration(props, propsImortant);
while (!(parser.ttype == CSS_TK_END ||
(parser.ttype == CSS_TK_CHAR && parser.tval[0] == '}')));
-
- if (props->size () == 0) {
- delete props;
- props = NULL;
- }
-
- return props;
}
diff --git a/src/cssparser.hh b/src/cssparser.hh
index 1542405d..8609877b 100644
--- a/src/cssparser.hh
+++ b/src/cssparser.hh
@@ -47,8 +47,9 @@ class CssParser {
void ignoreStatement();
public:
- static CssPropertyList *parseDeclarationBlock(const char *buf,
- int buflen);
+ static void parseDeclarationBlock(const char *buf, int buflen,
+ CssPropertyList *props,
+ CssPropertyList *propsImortant);
static void parse(DilloHtml *html, DilloUrl *url, CssContext *context,
const char *buf, int buflen, CssOrigin origin);
static const char *propertyNameString(CssPropertyName name);
diff --git a/src/gif.c b/src/gif.c
index b5486c46..4b5c817c 100644
--- a/src/gif.c
+++ b/src/gif.c
@@ -810,8 +810,6 @@ static size_t Gif_do_img_desc(DilloGif *gif, void *Buf,
return 0;
}
- gif->linebuf = dMalloc(gif->Width);
-
a_Dicache_set_parms(gif->url, gif->version, gif->Image,
gif->Width, gif->Height, DILLO_IMG_TYPE_INDEXED);
@@ -842,6 +840,7 @@ static size_t Gif_do_img_desc(DilloGif *gif, void *Buf,
gif->y = 0;
Gif_lwz_init(gif);
gif->spill_line_index = 0;
+ gif->linebuf = dMalloc(gif->Width);
gif->state = 3; /*Process the lzw data next */
if (gif->Image && gif->ColorMap_ofs) {
a_Dicache_set_cmap(gif->url, gif->version, gif->Image,
diff --git a/src/styleengine.cc b/src/styleengine.cc
index d763146e..9a8a1738 100644
--- a/src/styleengine.cc
+++ b/src/styleengine.cc
@@ -52,6 +52,7 @@ StyleEngine::StyleEngine (dw::core::Layout *layout) {
n->wordStyle = NULL;
n->backgroundStyle = NULL;
n->styleAttrProperties = NULL;
+ n->styleAttrPropertiesImportant = NULL;
n->nonCssProperties = NULL;
n->inheritBackgroundColor = false;
}
@@ -82,6 +83,7 @@ void StyleEngine::startElement (int element) {
stack->increase ();
Node *n = stack->getRef (stack->size () - 1);
n->styleAttrProperties = NULL;
+ n->styleAttrPropertiesImportant = NULL;
n->nonCssProperties = NULL;
n->style = NULL;
n->wordStyle = NULL;
@@ -138,10 +140,14 @@ void StyleEngine::setStyle (const char *styleAttr) {
Node *n = stack->getRef (stack->size () - 1);
assert (n->styleAttrProperties == NULL);
// parse style information from style="" attribute, if it exists
- if (styleAttr && prefs.parse_embedded_css)
- n->styleAttrProperties =
- CssParser::parseDeclarationBlock (styleAttr,
- strlen (styleAttr));
+ if (styleAttr && prefs.parse_embedded_css) {
+ n->styleAttrProperties = new CssPropertyList (true);
+ n->styleAttrPropertiesImportant = new CssPropertyList (true);
+
+ CssParser::parseDeclarationBlock (styleAttr, strlen (styleAttr),
+ n->styleAttrProperties,
+ n->styleAttrPropertiesImportant);
+ }
};
/**
@@ -213,6 +219,8 @@ void StyleEngine::endElement (int element) {
if (n->styleAttrProperties)
delete n->styleAttrProperties;
+ if (n->styleAttrPropertiesImportant)
+ delete n->styleAttrPropertiesImportant;
if (n->nonCssProperties)
delete n->nonCssProperties;
if (n->style)
@@ -706,7 +714,8 @@ Style * StyleEngine::backgroundStyle () {
* This method is private. Call style() to get a current style object.
*/
Style * StyleEngine::style0 (int i) {
- CssPropertyList props, *styleAttrProperties, *nonCssProperties;
+ CssPropertyList props, *styleAttrProperties, *styleAttrPropertiesImportant;
+ CssPropertyList *nonCssProperties;
// get previous style from the stack
StyleAttrs attrs = *stack->getRef (i - 1)->style;
@@ -723,11 +732,13 @@ Style * StyleEngine::style0 (int i) {
preprocessAttrs (&attrs);
styleAttrProperties = stack->getRef (i)->styleAttrProperties;
+ styleAttrPropertiesImportant = stack->getRef(i)->styleAttrPropertiesImportant;
nonCssProperties = stack->getRef (i)->nonCssProperties;
// merge style information
cssContext->apply (&props, doctree, stack->getRef(i)->doctreeNode,
- styleAttrProperties, nonCssProperties);
+ styleAttrProperties, styleAttrPropertiesImportant,
+ nonCssProperties);
// apply style
apply (i, &attrs, &props);
diff --git a/src/styleengine.hh b/src/styleengine.hh
index e37aeed1..b73a8b5f 100644
--- a/src/styleengine.hh
+++ b/src/styleengine.hh
@@ -21,6 +21,7 @@ class StyleEngine {
private:
struct Node {
CssPropertyList *styleAttrProperties;
+ CssPropertyList *styleAttrPropertiesImportant;
CssPropertyList *nonCssProperties;
dw::core::style::Style *style;
dw::core::style::Style *wordStyle;