From 21661c817ca0f56daea62ed4f311e482dbded84c Mon Sep 17 00:00:00 2001 From: corvid Date: Tue, 10 Dec 2013 21:06:46 +0000 Subject: dillorc update http_user_agent examples --- dillorc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dillorc b/dillorc index fc0b1019..829d4f6f 100644 --- a/dillorc +++ b/dillorc @@ -209,8 +209,8 @@ search_url="Google http://www.google.com/search?ie=UTF-8&oe=UTF-8&q=%s" # # See http://zytrax.com/tech/web/browser_ids.htm for a compilation of strings. # -# http_user_agent="Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0" -# http_user_agent="Wget/1.12 (linux-gnu)" +# http_user_agent="Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0" +# http_user_agent="Wget/1.13.4 (linux-gnu)" #The default is "Dillo/"+current_version_number #------------------------------------------------------------------------- -- cgit v1.2.3 From 163e393444f77ac697eb74580355b3c70c1c7800 Mon Sep 17 00:00:00 2001 From: Sebastian Geerken Date: Fri, 20 Dec 2013 21:59:01 +0100 Subject: RTFL messages. --- dw/alignedtextblock.cc | 1 + dw/findtext.cc | 2 ++ dw/fltkimgbuf.cc | 8 ++++++-- dw/fltkplatform.cc | 2 ++ dw/fltkviewport.cc | 1 + dw/image.cc | 2 ++ dw/layout.cc | 2 ++ dw/listitem.cc | 1 + dw/selection.cc | 1 + dw/style.cc | 26 +++++++++++++++++++++++--- dw/style.hh | 10 ++++++++-- dw/table.cc | 2 ++ dw/tablecell.cc | 1 + dw/textblock.cc | 6 +++++- dw/ui.cc | 1 + dw/widget.cc | 4 ++++ lout/debug.hh | 24 ++++++++++++++++++------ src/dillo.cc | 1 + 18 files changed, 81 insertions(+), 14 deletions(-) diff --git a/dw/alignedtextblock.cc b/dw/alignedtextblock.cc index 0d910c93..24dab2e8 100644 --- a/dw/alignedtextblock.cc +++ b/dw/alignedtextblock.cc @@ -81,6 +81,7 @@ void AlignedTextblock::setRefTextblock (AlignedTextblock *ref) AlignedTextblock::~AlignedTextblock() { list->unref (listPos); + DBG_OBJ_DELETE (); } void AlignedTextblock::updateValue () diff --git a/dw/findtext.cc b/dw/findtext.cc index 4390e3ee..cc57e991 100644 --- a/dw/findtext.cc +++ b/dw/findtext.cc @@ -47,6 +47,8 @@ FindtextState::~FindtextState () delete iterator; if (hlIterator) delete hlIterator; + + DBG_OBJ_DELETE (); } void FindtextState::setWidget (Widget *widget) diff --git a/dw/fltkimgbuf.cc b/dw/fltkimgbuf.cc index d9d653ec..86497160 100644 --- a/dw/fltkimgbuf.cc +++ b/dw/fltkimgbuf.cc @@ -85,6 +85,8 @@ FltkImgbuf::FltkImgbuf (Type type, int width, int height, double gamma) FltkImgbuf::FltkImgbuf (Type type, int width, int height, double gamma, FltkImgbuf *root) { + DBG_OBJ_CREATE ("dw::fltk::FltkImgbuf"); + _MSG("FltkImgbuf: new scaled %p, root is %p\n", this, root); init (type, width, height, gamma, root); } @@ -156,8 +158,6 @@ void FltkImgbuf::init (Type type, int width, int height, double gamma, FltkImgbuf::~FltkImgbuf () { - _MSG("~FltkImgbuf[%s %p] deleted\n", isRoot() ? "root":"scaled", this); - if (!isRoot()) root->detachScaledBuf (this); @@ -166,6 +166,8 @@ FltkImgbuf::~FltkImgbuf () if (scaledBuffers) delete scaledBuffers; + + DBG_OBJ_DELETE (); } /** @@ -386,6 +388,8 @@ core::Imgbuf* FltkImgbuf::getScaledBuf (int width, int height) // This size is not yet used, so a new buffer has to be created. FltkImgbuf *sb = new FltkImgbuf (type, width, height, gamma, this); scaledBuffers->append (sb); + DBG_OBJ_ASSOC_CHILD (sb); + return sb; } diff --git a/dw/fltkplatform.cc b/dw/fltkplatform.cc index 2a160d63..9f51eba2 100644 --- a/dw/fltkplatform.cc +++ b/dw/fltkplatform.cc @@ -474,6 +474,8 @@ FltkPlatform::~FltkPlatform () Fl::remove_idle (generalStaticIdle, (void*)this); delete idleQueue; delete resources; + + DBG_OBJ_DELETE (); } void FltkPlatform::setLayout (core::Layout *layout) diff --git a/dw/fltkviewport.cc b/dw/fltkviewport.cc index 7e91a83a..9603c508 100644 --- a/dw/fltkviewport.cc +++ b/dw/fltkviewport.cc @@ -85,6 +85,7 @@ FltkViewport::FltkViewport (int X, int Y, int W, int H, const char *label): FltkViewport::~FltkViewport () { delete gadgets; + DBG_OBJ_DELETE (); } void FltkViewport::adjustScrollbarsAndGadgetsAllocation () diff --git a/dw/image.cc b/dw/image.cc index 3aef42ac..1421418e 100644 --- a/dw/image.cc +++ b/dw/image.cc @@ -164,6 +164,8 @@ Image::~Image() buffer->unref (); if (mapKey) delete mapKey; + + DBG_OBJ_DELETE (); } void Image::sizeRequestImpl (core::Requisition *requisition) diff --git a/dw/layout.cc b/dw/layout.cc index f7bd7597..d83b2e8a 100644 --- a/dw/layout.cc +++ b/dw/layout.cc @@ -307,6 +307,8 @@ Layout::~Layout () delete view; delete anchorsTable; delete textZone; + + DBG_OBJ_DELETE (); } void Layout::addWidget (Widget *widget) diff --git a/dw/listitem.cc b/dw/listitem.cc index 11086a9e..05344d79 100644 --- a/dw/listitem.cc +++ b/dw/listitem.cc @@ -37,6 +37,7 @@ ListItem::ListItem (ListItem *ref, bool limitTextWidth): ListItem::~ListItem() { + DBG_OBJ_DELETE (); } void ListItem::initWithWidget (core::Widget *widget, diff --git a/dw/selection.cc b/dw/selection.cc index 2201af44..b67f4a6d 100644 --- a/dw/selection.cc +++ b/dw/selection.cc @@ -61,6 +61,7 @@ SelectionState::SelectionState () SelectionState::~SelectionState () { reset (); + DBG_OBJ_DELETE (); } void SelectionState::reset () diff --git a/dw/style.cc b/dw/style.cc index 4ab5673a..8a6dd163 100644 --- a/dw/style.cc +++ b/dw/style.cc @@ -237,8 +237,20 @@ container::typed::HashTable * Style::styleTable = Style::Style (StyleAttrs *attrs) { + DBG_OBJ_CREATE ("dw::core::style::Style"); + copyAttrs (attrs); + DBG_OBJ_ASSOC_CHILD (font); + DBG_OBJ_ASSOC_CHILD (color); + DBG_OBJ_ASSOC_CHILD (backgroundColor); + DBG_OBJ_ASSOC_CHILD (backgroundImage); + DBG_OBJ_ASSOC_CHILD (borderColor.top); + DBG_OBJ_ASSOC_CHILD (borderColor.bottom); + DBG_OBJ_ASSOC_CHILD (borderColor.left); + DBG_OBJ_ASSOC_CHILD (borderColor.right); + DBG_OBJ_ASSOC_CHILD (x_tooltip); + refCount = 1; font->ref (); @@ -285,6 +297,8 @@ Style::~Style () styleTable->remove (this); totalRef--; + + DBG_OBJ_DELETE (); } void Style::copyAttrs (StyleAttrs *attrs) @@ -356,6 +370,7 @@ int FontAttrs::hashValue() Font::~Font () { free ((char*)name); + DBG_OBJ_DELETE (); } void Font::copyAttrs (FontAttrs *attrs) @@ -399,6 +414,7 @@ int ColorAttrs::hashValue() Color::~Color () { + DBG_OBJ_DELETE (); } int Color::shadeColor (int color, int d) @@ -482,6 +498,8 @@ void StyleImage::StyleImgRenderer::setBuffer (core::Imgbuf *buffer, bool resize) image->imgbufTiled = NULL; image->imgbufSrc = buffer; + DBG_OBJ_ASSOC_CHILD (image->imgbufSrc); + if (image->imgbufSrc) { image->imgbufSrc->ref (); @@ -506,6 +524,8 @@ void StyleImage::StyleImgRenderer::setBuffer (core::Imgbuf *buffer, bool resize) image->imgbufSrc->createSimilarBuf (image->tilesX * image->imgbufSrc->getRootWidth(), image->tilesY * image->imgbufSrc->getRootHeight()); + + DBG_OBJ_ASSOC_CHILD (image->imgbufTiled); } } } @@ -546,7 +566,7 @@ void StyleImage::StyleImgRenderer::fatal () StyleImage::StyleImage () { - //printf ("new StyleImage %p\n", this); + DBG_OBJ_CREATE ("dw::core::style::Color"); refCount = 0; imgbufSrc = NULL; @@ -559,8 +579,6 @@ StyleImage::StyleImage () StyleImage::~StyleImage () { - //printf ("delete StyleImage %p\n", this); - if (imgbufSrc) imgbufSrc->unref (); if (imgbufTiled) @@ -568,6 +586,8 @@ StyleImage::~StyleImage () delete imgRendererDist; delete styleImgRenderer; + + DBG_OBJ_DELETE (); } void StyleImage::ExternalImgRenderer::setBuffer (core::Imgbuf *buffer, diff --git a/dw/style.hh b/dw/style.hh index 089cf59b..7127b6db 100644 --- a/dw/style.hh +++ b/dw/style.hh @@ -8,6 +8,7 @@ #endif #include "../lout/signal.hh" +#include "../lout/debug.hh" namespace dw { namespace core { @@ -660,7 +661,10 @@ private: static Font *create0 (Layout *layout, FontAttrs *attrs, bool tryEverything); protected: - inline Font () { refCount = 0; } + inline Font () { + DBG_OBJ_CREATE ("dw::core::style::Font"); + refCount = 0; + } virtual ~Font (); void copyAttrs (FontAttrs *attrs); @@ -712,7 +716,9 @@ private: protected: inline Color (int color): ColorAttrs (color) { - refCount = 0; } + DBG_OBJ_CREATE ("dw::core::style::Color"); + refCount = 0; + } virtual ~Color (); public: diff --git a/dw/table.cc b/dw/table.cc index 8db9ef2a..6fe0da8b 100644 --- a/dw/table.cc +++ b/dw/table.cc @@ -98,6 +98,8 @@ Table::~Table() delete baseline; delete rowStyle; delete colPercents; + + DBG_OBJ_DELETE (); } void Table::sizeRequestImpl (core::Requisition *requisition) diff --git a/dw/tablecell.cc b/dw/tablecell.cc index 5a005e3d..8612f620 100644 --- a/dw/tablecell.cc +++ b/dw/tablecell.cc @@ -42,6 +42,7 @@ TableCell::TableCell (TableCell *ref, bool limitTextWidth): TableCell::~TableCell() { + DBG_OBJ_DELETE (); } bool TableCell::wordWrap(int wordIndex, bool wrapAll) diff --git a/dw/textblock.cc b/dw/textblock.cc index 8623a574..2c4ca20b 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -313,7 +313,7 @@ Textblock::~Textblock () parent class destructor. (???) */ words = NULL; - //DBG_OBJ_SET_NUM(this, "num_lines", lines->size ()); + DBG_OBJ_DELETE (); } /** @@ -1932,6 +1932,7 @@ void Textblock::addText0 (const char *text, size_t len, short flags, Word *word = addWord (size->width, size->ascent, size->descent, flags, style); + DBG_OBJ_ASSOC_CHILD (style); word->content.type = core::Content::TEXT; word->content.text = layout->textZone->strndup(text, len); @@ -2200,6 +2201,7 @@ void Textblock::addParbreak (int space, core::style::Style *style) } word = addWord (0, 0, 0, 0, style); + DBG_OBJ_ASSOC_CHILD (style); word->content.type = core::Content::BREAK; word->badnessAndPenalty.setPenalty (PENALTY_FORCE_BREAK); word->content.breakSpace = space; @@ -2223,6 +2225,8 @@ void Textblock::addLinebreak (core::style::Style *style) // ... otherwise, it has no size (and does not enlarge the line). word = addWord (0, 0, 0, 0, style); + DBG_OBJ_ASSOC_CHILD (style); + word->content.type = core::Content::BREAK; word->badnessAndPenalty.setPenalty (PENALTY_FORCE_BREAK); word->content.breakSpace = 0; diff --git a/dw/ui.cc b/dw/ui.cc index 8963d3bf..22199980 100644 --- a/dw/ui.cc +++ b/dw/ui.cc @@ -44,6 +44,7 @@ Embed::Embed(Resource *resource) Embed::~Embed() { delete resource; + DBG_OBJ_DELETE (); } void Embed::sizeRequestImpl (Requisition *requisition) diff --git a/dw/widget.cc b/dw/widget.cc index b09c51e9..385bdb97 100644 --- a/dw/widget.cc +++ b/dw/widget.cc @@ -108,6 +108,8 @@ Widget::~Widget () parent->removeChild (this); else layout->removeWidget (); + + DBG_OBJ_DELETE (); } @@ -335,6 +337,8 @@ void Widget::setStyle (style::Style *style) this->style = style; + DBG_OBJ_ASSOC_CHILD (style); + if (style && style->backgroundImage) { // Create instance of WidgetImgRenderer when needed. Until this // widget is deleted, "widgetImgRenderer" will be kept, since it diff --git a/lout/debug.hh b/lout/debug.hh index bbbe401b..e0d66a1b 100644 --- a/lout/debug.hh +++ b/lout/debug.hh @@ -76,6 +76,13 @@ fflush (stdout); \ } D_STMT_END +#define DBG_OBJ_DELETE() \ + D_STMT_START { \ + printf (RTFL_PREFIX_FMT "obj-delete:%p\n", \ + RTFL_PREFIX_ARGS, this); \ + fflush (stdout); \ + } D_STMT_END + #define DBG_OBJ_BASECLASS(klass) \ D_STMT_START { \ printf (RTFL_PREFIX_FMT "obj-ident:%p:%p\n", \ @@ -85,9 +92,11 @@ #define DBG_OBJ_ASSOC(parent, child) \ D_STMT_START { \ - printf (RTFL_PREFIX_FMT "obj-assoc:%p:%p\n", \ - RTFL_PREFIX_ARGS, parent, child); \ - fflush (stdout); \ + if (child) { \ + printf (RTFL_PREFIX_FMT "obj-assoc:%p:%p\n", \ + RTFL_PREFIX_ARGS, parent, child); \ + fflush (stdout); \ + } \ } D_STMT_END #define DBG_OBJ_ASSOC_PARENT(parent) \ @@ -99,9 +108,11 @@ #define DBG_OBJ_ASSOC_CHILD(child) \ D_STMT_START { \ - printf (RTFL_PREFIX_FMT "obj-assoc:%p:%p\n", \ - RTFL_PREFIX_ARGS, this, child); \ - fflush (stdout); \ + if (child) { \ + printf (RTFL_PREFIX_FMT "obj-assoc:%p:%p\n", \ + RTFL_PREFIX_ARGS, this, child); \ + fflush (stdout); \ + } \ } D_STMT_END #define DBG_OBJ_SET_NUM(var, val) \ @@ -160,6 +171,7 @@ #define DBG_OBJ_MSG_START(obj) #define DBG_OBJ_MSG_END(obj) #define DBG_OBJ_CREATE(klass) +#define DBG_OBJ_DELETE() #define DBG_OBJ_BASECLASS(klass) #define DBG_OBJ_ASSOC_PARENT(parent) #define DBG_OBJ_ASSOC_CHILD(child) diff --git a/src/dillo.cc b/src/dillo.cc index 2b9f1645..5a67946b 100644 --- a/src/dillo.cc +++ b/src/dillo.cc @@ -379,6 +379,7 @@ int main(int argc, char **argv) DBG_OBJ_COLOR("#c0ff80", "dw::*"); DBG_OBJ_COLOR("#c0c0ff", "dw::fltk::*"); DBG_OBJ_COLOR("#ffa0a0", "dw::core::*"); + DBG_OBJ_COLOR("#ffe0a0", "dw::core::style::*"); uint_t opt_id; uint_t options_got = 0; -- cgit v1.2.3 From f88732b807281ac94e4dc6575daf9d2a13905eb0 Mon Sep 17 00:00:00 2001 From: Sebastian Geerken Date: Sat, 21 Dec 2013 13:31:52 +0100 Subject: Some more RTFL messages. --- dw/fltkimgbuf.cc | 5 +++++ dw/image.cc | 2 ++ dw/imgbuf.hh | 8 ++++++++ 3 files changed, 15 insertions(+) diff --git a/dw/fltkimgbuf.cc b/dw/fltkimgbuf.cc index 86497160..e537c761 100644 --- a/dw/fltkimgbuf.cc +++ b/dw/fltkimgbuf.cc @@ -78,6 +78,8 @@ void FltkImgbuf::freeall () FltkImgbuf::FltkImgbuf (Type type, int width, int height, double gamma) { + DBG_OBJ_CREATE ("dw::fltk::FltkImgbuf"); + _MSG("FltkImgbuf: new root %p\n", this); init (type, width, height, gamma, NULL); } @@ -124,6 +126,9 @@ void FltkImgbuf::init (Type type, int width, int height, double gamma, this->height = height; this->gamma = gamma; + DBG_OBJ_SET_NUM ("width", width); + DBG_OBJ_SET_NUM ("height", height); + // TODO: Maybe this is only for root buffers switch (type) { case RGBA: bpp = 4; break; diff --git a/dw/image.cc b/dw/image.cc index 1421418e..74f96e57 100644 --- a/dw/image.cc +++ b/dw/image.cc @@ -437,6 +437,8 @@ void Image::setBuffer (core::Imgbuf *buffer, bool resize) buffer->ref (); } + DBG_OBJ_ASSOC_CHILD (this->buffer); + if (oldBuf) oldBuf->unref (); } diff --git a/dw/imgbuf.hh b/dw/imgbuf.hh index 3ccbe3c5..f9870bcf 100644 --- a/dw/imgbuf.hh +++ b/dw/imgbuf.hh @@ -5,6 +5,8 @@ # error Do not include this file directly, use "core.hh" instead. #endif +#include "../lout/debug.hh" + namespace dw { namespace core { @@ -161,6 +163,12 @@ class Imgbuf: public lout::object::Object, public lout::signal::ObservedObject public: enum Type { RGB, RGBA, GRAY, INDEXED, INDEXED_ALPHA }; + inline Imgbuf () { + DBG_OBJ_CREATE ("dw::core::Imgbuf"); + DBG_OBJ_BASECLASS (lout::object::Object); + DBG_OBJ_BASECLASS (lout::signal::ObservedObject); + } + /* * Methods called from the image decoding */ -- cgit v1.2.3 From 4b4a884d9e18d785dc3055149a3e17979b1a0529 Mon Sep 17 00:00:00 2001 From: Sebastian Geerken Date: Sat, 21 Dec 2013 15:53:11 +0100 Subject: Fix: RTFL message. --- dw/style.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dw/style.cc b/dw/style.cc index 8a6dd163..5970fd6f 100644 --- a/dw/style.cc +++ b/dw/style.cc @@ -566,7 +566,7 @@ void StyleImage::StyleImgRenderer::fatal () StyleImage::StyleImage () { - DBG_OBJ_CREATE ("dw::core::style::Color"); + DBG_OBJ_CREATE ("dw::core::style::StyleImage"); refCount = 0; imgbufSrc = NULL; -- cgit v1.2.3 From 0f070a78145091a04034b3db9c558e032ec22a2f Mon Sep 17 00:00:00 2001 From: Sebastian Geerken Date: Fri, 27 Dec 2013 00:44:59 +0100 Subject: Minor RTFL fixes. --- dw/style.cc | 6 +++--- lout/debug.hh | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dw/style.cc b/dw/style.cc index 5970fd6f..3a01d903 100644 --- a/dw/style.cc +++ b/dw/style.cc @@ -249,7 +249,7 @@ Style::Style (StyleAttrs *attrs) DBG_OBJ_ASSOC_CHILD (borderColor.bottom); DBG_OBJ_ASSOC_CHILD (borderColor.left); DBG_OBJ_ASSOC_CHILD (borderColor.right); - DBG_OBJ_ASSOC_CHILD (x_tooltip); + //DBG_OBJ_ASSOC_CHILD (x_tooltip); refCount = 1; @@ -498,7 +498,7 @@ void StyleImage::StyleImgRenderer::setBuffer (core::Imgbuf *buffer, bool resize) image->imgbufTiled = NULL; image->imgbufSrc = buffer; - DBG_OBJ_ASSOC_CHILD (image->imgbufSrc); + DBG_OBJ_ASSOC (image, image->imgbufSrc); if (image->imgbufSrc) { image->imgbufSrc->ref (); @@ -525,7 +525,7 @@ void StyleImage::StyleImgRenderer::setBuffer (core::Imgbuf *buffer, bool resize) (image->tilesX * image->imgbufSrc->getRootWidth(), image->tilesY * image->imgbufSrc->getRootHeight()); - DBG_OBJ_ASSOC_CHILD (image->imgbufTiled); + DBG_OBJ_ASSOC (image, image->imgbufTiled); } } } diff --git a/lout/debug.hh b/lout/debug.hh index e0d66a1b..40e27b13 100644 --- a/lout/debug.hh +++ b/lout/debug.hh @@ -38,7 +38,9 @@ #include #include -#define RTFL_PREFIX_FMT "[rtfl]%s:%d:%d:" +// "\n" at the beginning just in case that the previous line is not finished +// yet. +#define RTFL_PREFIX_FMT "\n[rtfl]%s:%d:%d:" #define RTFL_PREFIX_ARGS __FILE__, __LINE__, getpid() #define DBG_OBJ_MSG(aspect, prio, msg) \ -- cgit v1.2.3 From 8e29939bf4c39601f1e55accd0ba7b78f071ffa3 Mon Sep 17 00:00:00 2001 From: Sebastian Geerken Date: Fri, 27 Dec 2013 12:39:30 +0100 Subject: Removed preprocessor warning. --- src/cssparser.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cssparser.cc b/src/cssparser.cc index b283957a..47632979 100644 --- a/src/cssparser.cc +++ b/src/cssparser.cc @@ -19,6 +19,7 @@ #include #include +#include "lout/debug.hh" #include "msg.h" #include "colors.h" #include "html_common.hh" @@ -27,7 +28,6 @@ using namespace dw::core::style; -#define DEBUG_MSG(A, B, ...) _MSG(B, __VA_ARGS__) #define MSG_CSS(A, ...) MSG(A, __VA_ARGS__) #define DEBUG_TOKEN_LEVEL 0 #define DEBUG_PARSE_LEVEL 0 -- cgit v1.2.3 From 3518ed24f16336b1ec0f4d41bb692e622341289b Mon Sep 17 00:00:00 2001 From: Sebastian Geerken Date: Mon, 6 Jan 2014 14:32:36 +0100 Subject: Fixed memory leak (CSS URIs). --- src/css.hh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/css.hh b/src/css.hh index a7143c27..6088e2df 100644 --- a/src/css.hh +++ b/src/css.hh @@ -293,6 +293,7 @@ class CssProperty { switch (type) { case CSS_TYPE_STRING: case CSS_TYPE_SYMBOL: + case CSS_TYPE_URI: dFree (value.strVal); break; case CSS_TYPE_BACKGROUND_POSITION: -- cgit v1.2.3 From 0ebdb086c956a168a9d8ecf775edb536d0277629 Mon Sep 17 00:00:00 2001 From: Sebastian Geerken Date: Mon, 6 Jan 2014 23:32:17 +0100 Subject: Fixed another memory leak related to background images. --- src/styleengine.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/styleengine.cc b/src/styleengine.cc index 98b31d32..3f621cee 100644 --- a/src/styleengine.cc +++ b/src/styleengine.cc @@ -548,6 +548,8 @@ void StyleEngine::apply (int i, StyleAttrs *attrs, CssPropertyList *props, attrs->backgroundImage->connectDeletion (new StyleImageDeletionReceiver (clientKey)); } + + a_Url_free (imgUrl); } break; case CSS_PROPERTY_BACKGROUND_POSITION: -- cgit v1.2.3 From 261a91428881c7735c0b997ff8f03c8f5981ff03 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Thu, 9 Jan 2014 20:57:51 +0100 Subject: some whitespace cleanups --- src/cssparser.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cssparser.cc b/src/cssparser.cc index 47632979..be5032d6 100644 --- a/src/cssparser.cc +++ b/src/cssparser.cc @@ -275,7 +275,7 @@ typedef struct { CSS_SHORTHAND_BORDER, /* special, used for 'border' */ CSS_SHORTHAND_FONT, /* special, used for 'font' */ } type; - const CssPropertyName * properties;/* CSS_SHORTHAND_MULTIPLE: + const CssPropertyName *properties; /* CSS_SHORTHAND_MULTIPLE: * must be terminated by -1 * CSS_SHORTHAND_DIRECTIONS: * must have length 4 @@ -859,7 +859,7 @@ bool CssParser::parseRgbColor(int32_t *c) { bool CssParser::parseValue(CssPropertyName prop, CssValueType type, - CssPropertyValue * val) + CssPropertyValue *val) { CssLengthType lentype; bool found, ret = false; @@ -1187,8 +1187,8 @@ static int Css_shorthand_info_cmp(const void *a, const void *b) ((CssShorthandInfo *) b)->symbol); } -void CssParser::parseDeclaration(CssPropertyList * props, - CssPropertyList * importantProps) +void CssParser::parseDeclaration(CssPropertyList *props, + CssPropertyList *importantProps) { CssPropertyInfo pi = {NULL, {CSS_TYPE_UNUSED}, NULL}, *pip; CssShorthandInfo *sip; @@ -1703,7 +1703,7 @@ void CssParser::ignoreStatement() } } -void CssParser::parse(DilloHtml *html, DilloUrl *url, CssContext * context, +void CssParser::parse(DilloHtml *html, DilloUrl *url, CssContext *context, const char *buf, int buflen, CssOrigin origin) { -- cgit v1.2.3 From 40abd170cc8c735a99bfb34860793c49f39a9500 Mon Sep 17 00:00:00 2001 From: Sebastian Geerken Date: Mon, 13 Jan 2014 20:50:20 +0100 Subject: Corrected RTFL macros. --- lout/debug.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lout/debug.hh b/lout/debug.hh index 40e27b13..083234f8 100644 --- a/lout/debug.hh +++ b/lout/debug.hh @@ -170,8 +170,8 @@ #define DBG_OBJ_MSG(aspect, prio, msg) #define DBG_OBJ_MSGF(aspect, prio, fmt, ...) -#define DBG_OBJ_MSG_START(obj) -#define DBG_OBJ_MSG_END(obj) +#define DBG_OBJ_MSG_START() +#define DBG_OBJ_MSG_END() #define DBG_OBJ_CREATE(klass) #define DBG_OBJ_DELETE() #define DBG_OBJ_BASECLASS(klass) -- cgit v1.2.3 From 2d9a9d80894d673a99522dd33ae27da2bc432dda Mon Sep 17 00:00:00 2001 From: corvid Date: Tue, 14 Jan 2014 18:39:40 +0000 Subject: comment to a quick glance, that looked like division could be involved. --- dw/fltkviewport.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dw/fltkviewport.cc b/dw/fltkviewport.cc index 9603c508..707c0bd7 100644 --- a/dw/fltkviewport.cc +++ b/dw/fltkviewport.cc @@ -393,7 +393,7 @@ void FltkViewport::scrollTo (int x, int y) } /* multiple calls to scroll can happen before a redraw occurs. - * scrollDX / scrollDY can therefore be non-zero here. + * scrollDX and scrollDY can therefore be non-zero here. */ updateCanvasWidgets (x - scrollX, y - scrollY); scrollDX += x - scrollX; -- cgit v1.2.3 From 76e1bd77ca2905f185b2363c589b77840687168d Mon Sep 17 00:00:00 2001 From: corvid Date: Sun, 2 Feb 2014 15:30:49 +0000 Subject: our simplistic TLD list grows more and more worthless --- dpi/cookies.c | 10 +++++----- src/url.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dpi/cookies.c b/dpi/cookies.c index 32f2d5b9..6c5e958e 100644 --- a/dpi/cookies.c +++ b/dpi/cookies.c @@ -1042,14 +1042,14 @@ static uint_t Cookies_internal_dots_required(const char *host) if (tld_len > 0) { /* These TLDs were chosen by examining the current publicsuffix list - * in September 2013 and picking out those where it was simplest for + * in February 2014 and picking out those where it was simplest for * them to describe the situation by beginning with a "*.[tld]" rule * or every rule was "[something].[tld]". */ - const char *const tlds[] = {"au","bd","bn","ck","cy","er","et","fj", - "fk","gn","gu","il","jm","ke","kh","kp", - "kw","lb","lr","mm","mt","mz","ni","np", - "nz","pg","tr","uk","ye","za","zm","zw"}; + const char *const tlds[] = {"bd","bn","ck","cy","er","et","fj","fk", + "gu","il","jm","ke","kh","kw","mm","mz", + "ni","np","nz","pg","tr","uk","ye","za", + "zm","zw"}; uint_t i, tld_num = sizeof(tlds) / sizeof(tlds[0]); for (i = 0; i < tld_num; i++) { diff --git a/src/url.c b/src/url.c index 6780ca8e..9d3e14b2 100644 --- a/src/url.c +++ b/src/url.c @@ -688,14 +688,14 @@ static uint_t Url_host_public_internal_dots(const char *host) if (tld_len > 0) { /* These TLDs were chosen by examining the current publicsuffix list - * in September 2013 and picking out those where it was simplest for + * in February 2014 and picking out those where it was simplest for * them to describe the situation by beginning with a "*.[tld]" rule * or every rule was "[something].[tld]". */ - const char *const tlds[] = {"au","bd","bn","ck","cy","er","et","fj", - "fk","gn","gu","il","jm","ke","kh","kp", - "kw","lb","lr","mm","mt","mz","ni","np", - "nz","pg","tr","uk","ye","za","zm","zw"}; + const char *const tlds[] = {"bd","bn","ck","cy","er","et","fj","fk", + "gu","il","jm","ke","kh","kw","mm","mz", + "ni","np","nz","pg","tr","uk","ye","za", + "zm","zw"}; uint_t i, tld_num = sizeof(tlds) / sizeof(tlds[0]); for (i = 0; i < tld_num; i++) { -- cgit v1.2.3 From 73a5b8c1d1bdf4d2cad8fdea3deb81ae8e34c9d3 Mon Sep 17 00:00:00 2001 From: corvid Date: Sun, 2 Feb 2014 17:05:01 +0000 Subject: trim some spaces --- dw/fltkimgbuf.cc | 22 +++++++++++----------- dw/imgrenderer.hh | 6 +++--- dw/layout.cc | 24 ++++++++++++------------ dw/style.cc | 32 ++++++++++++++++---------------- dw/style.hh | 4 ++-- dw/table.cc | 2 +- lout/container.cc | 8 ++++---- lout/container.hh | 2 +- src/cssparser.cc | 2 +- src/html.cc | 6 +++--- src/html_common.hh | 2 +- src/styleengine.cc | 2 +- test/dw_image_background.cc | 2 +- 13 files changed, 57 insertions(+), 57 deletions(-) diff --git a/dw/fltkimgbuf.cc b/dw/fltkimgbuf.cc index e537c761..26b46969 100644 --- a/dw/fltkimgbuf.cc +++ b/dw/fltkimgbuf.cc @@ -52,10 +52,10 @@ uchar *FltkImgbuf::findGammaCorrectionTable (double gamma) } _MSG("Creating new table for gamma = %g\n", gamma); - + GammaCorrectionTable *gct = new GammaCorrectionTable(); gct->gamma = gamma; - + for (int i = 0; i < 256; i++) gct->map[i] = 255 * pow((double)i / 255, gamma); @@ -107,7 +107,7 @@ void FltkImgbuf::init (Type type, int width, int height, double gamma, } else if (width > MAX_WIDTH) { // Too large dimensions cause dangerous overflow errors, so we // limit dimensions to harmless values. - // + // // Example: 65535 * 65536 / 65536 (see scaling below) results in // the negative value -1. @@ -140,11 +140,11 @@ void FltkImgbuf::init (Type type, int width, int height, double gamma, rawdata = new uchar[bpp * width * height]; // Set light-gray as interim background color. memset(rawdata, 222, width*height*bpp); - + refCount = 1; deleteOnUnref = true; copiedRows = new lout::misc::BitSet (height); - + // The list is only used for root buffers. if (isRoot()) scaledBuffers = new lout::container::typed::List (true); @@ -308,15 +308,15 @@ inline void FltkImgbuf::scaleBuffer (const core::byte *src, int srcWidth, int v[bpp]; for(int i = 0; i < bpp; i++) v[i] = 0; - + for(int xo = xo1; xo < xo2; xo++) for(int yo = yo1; yo < yo2; yo++) { const core::byte *ps = src + bpp * (yo * srcWidth + xo); for(int i = 0; i < bpp; i++) - v[i] += + v[i] += (scaleMode == BEAUTIFUL_GAMMA ? gammaMap2[ps[i]] : ps[i]); } - + core::byte *pd = dest + bpp * (y * destWidth + x); for(int i = 0; i < bpp; i++) pd[i] = @@ -332,7 +332,7 @@ void FltkImgbuf::copyRow (int row, const core::byte *data) // Flag the row done and copy its data. copiedRows->set (row, true); memcpy(rawdata + row * width * bpp, data, width * bpp); - + // Update all the scaled buffers of this root image. for (Iterator it = scaledBuffers->iterator(); it.hasNext(); ) { @@ -417,7 +417,7 @@ void FltkImgbuf::getRowArea (int row, dw::core::Rectangle *area) // scaled buffer int sr1 = scaledY (row); int sr2 = scaledY (row + 1); - + area->x = 0; area->y = sr1; area->width = width; @@ -533,7 +533,7 @@ int FltkImgbuf::scaledY(int ySrc) int FltkImgbuf::backscaledY(int yScaled) { assert (root != NULL); - + // Notice that rounding errors because of integers do not play a // role. This method cannot be the exact inverse of scaledY, since // scaleY is not bijective, and so not invertible. Instead, both diff --git a/dw/imgrenderer.hh b/dw/imgrenderer.hh index 325a1998..e3b5e95e 100644 --- a/dw/imgrenderer.hh +++ b/dw/imgrenderer.hh @@ -18,14 +18,14 @@ class ImgRenderer public: virtual ~ImgRenderer () { } - /** + /** * \brief Called, when an image buffer is attached. * * This is typically the case when all meta data (size, depth) has been read. */ virtual void setBuffer (core::Imgbuf *buffer, bool resize = false) = 0; - /** + /** * \brief Called, when data from a row is available and has been copied into * the image buffer. * @@ -40,7 +40,7 @@ public: * limit the number of draws. */ virtual void finish () = 0; - + /** * \brief Called, when there are problems with the retrieval of image data. * diff --git a/dw/layout.cc b/dw/layout.cc index d83b2e8a..6f2e8d8b 100644 --- a/dw/layout.cc +++ b/dw/layout.cc @@ -88,7 +88,7 @@ void Layout::LayoutImgRenderer::draw (int x, int y, int width, int height) { layout->queueDraw (x, y, width, height); } - + // ---------------------------------------------------------------------- void Layout::Receiver::canvasSizeChanged (int width, int ascent, int descent) @@ -753,10 +753,10 @@ void Layout::setBgImage (style::StyleImage *bgImage, if (bgImage) bgImage->ref (); - + if (this->bgImage) this->bgImage->unref (); - + this->bgImage = bgImage; this->bgRepeat = bgRepeat; this->bgAttachment = bgAttachment; @@ -784,33 +784,33 @@ void Layout::resizeIdle () // Reset already here, since in this function, queueResize() may be // called again. resizeIdleId = -1; - + if (topLevel) { Requisition requisition; Allocation allocation; - + topLevel->sizeRequest (&requisition); - + allocation.x = allocation.y = 0; allocation.width = requisition.width; allocation.ascent = requisition.ascent; allocation.descent = requisition.descent; topLevel->sizeAllocate (&allocation); - + canvasWidth = requisition.width; canvasAscent = requisition.ascent; canvasDescent = requisition.descent; - + emitter.emitCanvasSizeChanged (canvasWidth, canvasAscent, canvasDescent); - + // Tell the view about the new world size. view->setCanvasSize (canvasWidth, canvasAscent, canvasDescent); // view->queueDrawTotal (false); - + if (usesViewport) { int currHThickness = currHScrollbarThickness(); int currVThickness = currVScrollbarThickness(); - + if (!canvasHeightGreater && canvasAscent + canvasDescent > viewportHeight - currHThickness) { @@ -818,7 +818,7 @@ void Layout::resizeIdle () setSizeHints (); /* May queue a new resize. */ } - + // Set viewport sizes. view->setViewportSize (viewportWidth, viewportHeight, currHThickness, currVThickness); diff --git a/dw/style.cc b/dw/style.cc index 3a01d903..8ec230a1 100644 --- a/dw/style.cc +++ b/dw/style.cc @@ -546,7 +546,7 @@ void StyleImage::StyleImgRenderer::drawRow (int row) int w = image->imgbufSrc->getRootWidth (); int h = image->imgbufSrc->getRootHeight (); - + for (int x = 0; x < image->tilesX; x++) for (int y = 0; y < image->tilesX; y++) image->imgbufSrc->copyTo (image->imgbufTiled, x * w, y * h, @@ -602,20 +602,20 @@ void StyleImage::ExternalImgRenderer::drawRow (int row) StyleImage *backgroundImage; if (readyToDraw () && (backgroundImage = getBackgroundImage ())) { // All single rows are drawn. - + Imgbuf *imgbuf = backgroundImage->getImgbufSrc(); int imgWidth = imgbuf->getRootWidth (); int imgHeight = imgbuf->getRootHeight (); - + int x, y, width, height; getBgArea (&x, &y, &width, &height); - + int xRef, yRef, widthRef, heightRef; getRefArea (&xRef, &yRef, &widthRef, &heightRef); - + bool repeatX, repeatY, doDraw; int origX, origY, tileX1, tileX2, tileY1, tileY2; - + calcBackgroundRelatedValues (backgroundImage, getBackgroundRepeat (), getBackgroundAttachment (), @@ -635,7 +635,7 @@ void StyleImage::ExternalImgRenderer::drawRow (int row) for (int tileY = tileY1; tileY <= tileY2; tileY++) { int x1 = misc::max (origX + tileX1 * imgWidth, x); int x2 = misc::min (origX + (tileX2 + 1) * imgWidth, x + width); - + int yt = origY + tileY * imgHeight + row; if (yt >= y && yt < y + height) draw (x1, yt, x2 - x1, 1); @@ -1196,7 +1196,7 @@ void drawBackground (View *view, Layout *layout, Rectangle *area, Color::SHADING_INVERSE : Color::SHADING_NORMAL, true, intersection.x, intersection.y, intersection.width, intersection.height); - + if (bgImage) drawBackgroundImage (view, style->backgroundImage, style->backgroundRepeat, @@ -1206,7 +1206,7 @@ void drawBackground (View *view, Layout *layout, Rectangle *area, intersection.x, intersection.y, intersection.width, intersection.height, xRef, yRef, widthRef, heightRef); - + } } } @@ -1225,7 +1225,7 @@ void drawBackgroundImage (View *view, StyleImage *backgroundImage, bool repeatX, repeatY, doDraw; int origX, origY, tileX1, tileX2, tileY1, tileY2; - + calcBackgroundRelatedValues (backgroundImage, backgroundRepeat, backgroundAttachment, backgroundPositionX, backgroundPositionY, x, y, width, height, @@ -1258,8 +1258,8 @@ void drawBackgroundImage (View *view, StyleImage *backgroundImage, int yt = origY + tileY * imgHeightS; int y1 = misc::max (yt, y); int y2 = misc::min (yt + imgHeightT, y + height); - - view->drawImage (imgbufT, xt, yt, x1 - xt, y1 - yt, + + view->drawImage (imgbufT, xt, yt, x1 - xt, y1 - yt, x2 - x1, y2 - y1); } } @@ -1285,7 +1285,7 @@ void calcBackgroundRelatedValues (StyleImage *backgroundImage, backgroundRepeat == BACKGROUND_REPEAT_X; *repeatY = backgroundRepeat == BACKGROUND_REPEAT || backgroundRepeat == BACKGROUND_REPEAT_Y; - + *origX = xRef + (isPerLength (backgroundPositionX) ? multiplyWithPerLength (widthRef - imgWidth, backgroundPositionX) : @@ -1294,7 +1294,7 @@ void calcBackgroundRelatedValues (StyleImage *backgroundImage, (isPerLength (backgroundPositionY) ? multiplyWithPerLength (heightRef - imgHeight, backgroundPositionY) : absLengthVal (backgroundPositionY)); - + *tileX1 = xDraw < *origX ? - (*origX - xDraw + imgWidth - 1) / imgWidth : (xDraw - *origX) / imgWidth; @@ -1307,7 +1307,7 @@ void calcBackgroundRelatedValues (StyleImage *backgroundImage, *tileY2 = *origY < yDraw + heightDraw ? (yDraw + heightDraw - *origY - 1) / imgHeight : - (*origY - (yDraw + heightDraw) + imgHeight - 1) / imgHeight; - + *doDraw = true; if (!*repeatX) { // Only center tile (tileX = 0) is drawn, ... @@ -1318,7 +1318,7 @@ void calcBackgroundRelatedValues (StyleImage *backgroundImage, // ... but is not visible. *doDraw = false; } - + if (!*repeatY) { // Analogue. if (*tileY1 <= 0 && *tileY2 >= 0) diff --git a/dw/style.hh b/dw/style.hh index 7127b6db..e0ce9d89 100644 --- a/dw/style.hh +++ b/dw/style.hh @@ -448,7 +448,7 @@ inline int multiplyWithRelLength(int x, Length l) { return x * relLengthVal(l); } - + enum { /** \brief Represents "auto" lengths. */ LENGTH_AUTO = 0 @@ -813,7 +813,7 @@ public: { public: void getPaddingArea (int *x, int *y, int *width, int *height); - + StyleImage *getBackgroundImage (); BackgroundRepeat getBackgroundRepeat (); BackgroundAttachment getBackgroundAttachment (); diff --git a/dw/table.cc b/dw/table.cc index 6fe0da8b..b6f7209b 100644 --- a/dw/table.cc +++ b/dw/table.cc @@ -1072,7 +1072,7 @@ void Table::apportion_percentages2(int totalWidth, int forceTotalWidth) for (int col = 0; col < numCols; col++) { if (core::style::isPerLength (colPercents->get(col))) { // This could cause rounding errors: - // + // // int d = // core::dw::multiplyWithPerLength (extraWidth, // colPercents->get(col)) diff --git a/lout/container.cc b/lout/container.cc index de36a6f7..de7b93e2 100644 --- a/lout/container.cc +++ b/lout/container.cc @@ -208,7 +208,7 @@ int Vector::bsearch(Object *key, bool mustExist) // new implementation. if (numElements == 0) return mustExist ? -1 : 0; - + int high = numElements - 1, low = 0; while (true) { @@ -230,7 +230,7 @@ int Vector::bsearch(Object *key, bool mustExist) low = index + 1; } } - + /* void *result = ::bsearch (&key, array, numElements, sizeof (Object*), @@ -562,7 +562,7 @@ HashTable::~HashTable() PRINTF ("- deleting value: %s\n", value->toString()); delete value; } - } + } } } } @@ -596,7 +596,7 @@ void HashTable::intoStringBuffer(misc::StringBuffer *sb) node->object->intoStringBuffer(sb); sb->append(" => "); - + Object *value = ((KeyValuePair*)node)->value; if (value) value->intoStringBuffer(sb); diff --git a/lout/container.hh b/lout/container.hh index c87eb10c..09c8ffc0 100644 --- a/lout/container.hh +++ b/lout/container.hh @@ -114,7 +114,7 @@ private: private: Vector *vector; int index; - + public: VectorIterator(Vector *vector) { this->vector = vector; index = -1; } bool hasNext(); diff --git a/src/cssparser.cc b/src/cssparser.cc index 47632979..3f5f2869 100644 --- a/src/cssparser.cc +++ b/src/cssparser.cc @@ -716,7 +716,7 @@ bool CssParser::tokenMatchesProperty(CssPropertyName prop, CssValueType *type) dStrAsciiCasecmp(tval, "right") == 0 || dStrAsciiCasecmp(tval, "top") == 0 || dStrAsciiCasecmp(tval, "bottom") == 0)) - return true; + return true; // Fall Through (lenght and percentage) case CSS_TYPE_LENGTH_PERCENTAGE: case CSS_TYPE_LENGTH_PERCENTAGE_NUMBER: diff --git a/src/html.cc b/src/html.cc index 1257c102..8774b93e 100644 --- a/src/html.cc +++ b/src/html.cc @@ -1382,7 +1382,7 @@ static void Html_tag_cleanup_at_close(DilloHtml *html, int new_idx) * by closing them before opening another. * This is not an HTML SPEC restriction , but it avoids lots of trouble * inside dillo (concurrent inputs), and makes almost no sense to have. - */ + */ static void Html_tag_cleanup_nested_inputs(DilloHtml *html, int new_idx) { static int i_BUTTON = a_Html_tag_index("button"), @@ -1695,9 +1695,9 @@ static void Html_tag_close_head(DilloHtml *html) /* match for the well formed start of HEAD section */ if (html->Num_TITLE == 0) BUG_MSG("HEAD section lacks the TITLE element\n"); - + html->InFlags &= ~IN_HEAD; - + /* charset is already set, load remote stylesheets now */ for (int i = 0; i < html->cssUrls->size(); i++) { a_Html_load_stylesheet(html, html->cssUrls->get(i)); diff --git a/src/html_common.hh b/src/html_common.hh index a43d91b7..b70c8f80 100644 --- a/src/html_common.hh +++ b/src/html_common.hh @@ -233,7 +233,7 @@ public: { return styleEngine->wordStyle (bw, base_url); } inline void restyle () { styleEngine->restyle (bw, base_url); } - + }; /* diff --git a/src/styleengine.cc b/src/styleengine.cc index 3f621cee..64861973 100644 --- a/src/styleengine.cc +++ b/src/styleengine.cc @@ -551,7 +551,7 @@ void StyleEngine::apply (int i, StyleAttrs *attrs, CssPropertyList *props, a_Url_free (imgUrl); } - break; + break; case CSS_PROPERTY_BACKGROUND_POSITION: computeLength (&attrs->backgroundPositionX, p->value.posVal->posX, attrs->font); diff --git a/test/dw_image_background.cc b/test/dw_image_background.cc index 24966850..14cb7b97 100644 --- a/test/dw_image_background.cc +++ b/test/dw_image_background.cc @@ -117,7 +117,7 @@ int main(int argc, char **argv) image1 = StyleImage::create (); image1->connectDeletion (&isdr); - layout->setBgImage (image1, BACKGROUND_REPEAT_Y, + layout->setBgImage (image1, BACKGROUND_REPEAT_Y, BACKGROUND_ATTACHMENT_SCROLL, createPerLength (0.5), createAbsLength (30)); -- cgit v1.2.3 From 05faa251710c43dc20dc5cf1bffa3f0b23a119a0 Mon Sep 17 00:00:00 2001 From: Sebastian Geerken Date: Mon, 3 Feb 2014 21:27:09 +0100 Subject: Doc. --- doc/rounding-errors.doc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/rounding-errors.doc b/doc/rounding-errors.doc index 133a1fe5..a442033e 100644 --- a/doc/rounding-errors.doc +++ b/doc/rounding-errors.doc @@ -19,6 +19,17 @@ avoided by transforming the formula into Of corse, when all \f$y_i\f$ are calculated in a sequence, \f$\sum_{j=0}^{j=i} x_j\f$ and \f$\sum_{j=0}^{j=i-1} y_j\f$ can be -accumulated in the same loop. +accumulated in the same loop. Regard this as sample: -*/ \ No newline at end of file +\code +int n, x[n], a, b; // Should all be initialized. +int y[n], cumX = 0, cumY = 0; + +for (int i = 0; i < n; i++) { + cumX += x[i] + y[i] = (cumX * a) / b - cumY; + cumY += y[i]; +} +\endcode + +*/ -- cgit v1.2.3 From 2908fe39a624bce28f25c0212a0b9eea08914119 Mon Sep 17 00:00:00 2001 From: Sebastian Geerken Date: Thu, 6 Feb 2014 20:30:11 +0100 Subject: Added missing docs to Makefile.am. --- doc/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/Makefile.am b/doc/Makefile.am index dad95629..d48e3e73 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -14,6 +14,7 @@ EXTRA_DIST = \ fltk-problems.doc \ rounding-errors.doc \ uml-legend.doc \ + dw-line-breaking.doc \ dw-example-screenshot.png \ dw-viewport-without-scrollbar.png \ dw-viewport-with-scrollbar.png \ @@ -26,6 +27,7 @@ EXTRA_DIST = \ dw-textblock-collapsing-spaces-1-2.png \ dw-textblock-collapsing-spaces-2-1.png \ dw-textblock-collapsing-spaces-2-2.png \ + not-so-simple-container.png \ Cache.txt \ Cookies.txt \ Dillo.txt \ @@ -37,6 +39,7 @@ EXTRA_DIST = \ NC_design.txt \ Selection.txt \ Dpid.txt \ + CCCwork.txt \ README \ dillo.1.in -- cgit v1.2.3 From 8711f43231e783f0c71a0d3f903c747188bfa0ae Mon Sep 17 00:00:00 2001 From: corvid Date: Sat, 15 Feb 2014 18:41:12 +0000 Subject: rudimentary support for html5 video,audio,source,embed --- src/css.hh | 7 +-- src/html.cc | 136 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/html_common.hh | 5 +- 3 files changed, 143 insertions(+), 5 deletions(-) diff --git a/src/css.hh b/src/css.hh index 6088e2df..782b2c7b 100644 --- a/src/css.hh +++ b/src/css.hh @@ -464,10 +464,11 @@ class CssStyleSheet { (true, true, 256) {}; }; - static const int ntags = 90 + 10; // \todo don't hardcode + static const int ntags = 90 + 14; // \todo don't hardcode /* 90 is the full number of html4 elements, including those which we have - * implemented. From html 5, let's add: article, header, footer, mark, - * nav, section, aside, figure, figcaption, wbr. + * implemented. From html5, let's add: article, header, footer, mark, + * nav, section, aside, figure, figcaption, wbr, audio, video, source, + * embed. */ RuleList elementTable[ntags], anyTable; diff --git a/src/html.cc b/src/html.cc index 8774b93e..f759c56c 100644 --- a/src/html.cc +++ b/src/html.cc @@ -2514,6 +2514,138 @@ static void Html_tag_open_object(DilloHtml *html, const char *tag, int tagsize) a_Url_free(base_url); } +/* + *