changeset 2087:ea7b25dcf495

merge in recent changes from main repo
author corvid <corvid@lavabit.com>
date Sun, 12 Jun 2011 15:49:32 +0000
parents ccf085a4fa9c (current diff) a82b8ba0eb8e (diff)
children e555a2491c8c
files ChangeLog dw/fltkplatform.cc dw/fltkviewbase.cc src/cssparser.cc
diffstat 14 files changed, 56 insertions(+), 45 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Jun 11 08:33:49 2011 -0400
+++ b/ChangeLog	Sun Jun 12 15:49:32 2011 +0000
@@ -41,6 +41,7 @@
 +- 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.
--- a/config.h.in	Sat Jun 11 08:33:49 2011 -0400
+++ b/config.h.in	Sun Jun 12 15:49:32 2011 +0000
@@ -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
 
--- a/doc/Cookies.txt	Sat Jun 11 08:33:49 2011 -0400
+++ b/doc/Cookies.txt	Sun Jun 12 15:49:32 2011 +0000
@@ -7,14 +7,13 @@
  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 @@
 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!
--- a/dw/fltkplatform.cc	Sat Jun 11 08:33:49 2011 -0400
+++ b/dw/fltkplatform.cc	Sun Jun 12 15:49:32 2011 +0000
@@ -421,7 +421,7 @@
    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);
--- a/dw/fltkviewbase.cc	Sat Jun 11 08:33:49 2011 -0400
+++ b/dw/fltkviewbase.cc	Sun Jun 12 15:49:32 2011 +0000
@@ -543,7 +543,7 @@
       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);
--- a/dw/table.cc	Sat Jun 11 08:33:49 2011 -0400
+++ b/dw/table.cc	Sun Jun 12 15:49:32 2011 +0000
@@ -320,11 +320,19 @@
    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.
--- a/dw/textblock.cc	Sat Jun 11 08:33:49 2011 -0400
+++ b/dw/textblock.cc	Sun Jun 12 15:49:32 2011 +0000
@@ -1403,11 +1403,6 @@
              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 @@
                   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);
                }
             }
--- a/src/css.cc	Sat Jun 11 08:33:49 2011 -0400
+++ b/src/css.cc	Sun Jun 12 15:49:32 2011 +0000
@@ -535,7 +535,8 @@
  */
 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 @@
    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);
 }
--- a/src/css.hh	Sat Jun 11 08:33:49 2011 -0400
+++ b/src/css.hh	Sun Jun 12 15:49:32 2011 +0000
@@ -475,7 +475,8 @@
                     CssPrimaryOrder order);
       void apply (CssPropertyList *props,
          Doctree *docTree, DoctreeNode *node,
-         CssPropertyList *tagStyle, CssPropertyList *nonCssHints);
+         CssPropertyList *tagStyle, CssPropertyList *tagStyleImportant,
+         CssPropertyList *nonCssHints);
 };
 
 #endif
--- a/src/cssparser.cc	Sat Jun 11 08:33:49 2011 -0400
+++ b/src/cssparser.cc	Sun Jun 12 15:49:32 2011 +0000
@@ -1590,22 +1590,16 @@
    }
 }
 
-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;
 }
--- a/src/cssparser.hh	Sat Jun 11 08:33:49 2011 -0400
+++ b/src/cssparser.hh	Sun Jun 12 15:49:32 2011 +0000
@@ -47,8 +47,9 @@
       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);
--- a/src/gif.c	Sat Jun 11 08:33:49 2011 -0400
+++ b/src/gif.c	Sun Jun 12 15:49:32 2011 +0000
@@ -810,8 +810,6 @@
       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 @@
    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,
--- a/src/styleengine.cc	Sat Jun 11 08:33:49 2011 -0400
+++ b/src/styleengine.cc	Sun Jun 12 15:49:32 2011 +0000
@@ -52,6 +52,7 @@
    n->wordStyle = NULL;
    n->backgroundStyle = NULL;
    n->styleAttrProperties = NULL;
+   n->styleAttrPropertiesImportant = NULL;
    n->nonCssProperties = NULL;
    n->inheritBackgroundColor = false;
 }
@@ -82,6 +83,7 @@
    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 @@
    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 @@
 
    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 @@
  * 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 @@
    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);
--- a/src/styleengine.hh	Sat Jun 11 08:33:49 2011 -0400
+++ b/src/styleengine.hh	Sun Jun 12 15:49:32 2011 +0000
@@ -21,6 +21,7 @@
    private:
       struct Node {
          CssPropertyList *styleAttrProperties;
+         CssPropertyList *styleAttrPropertiesImportant;
          CssPropertyList *nonCssProperties;
          dw::core::style::Style *style;
          dw::core::style::Style *wordStyle;