aboutsummaryrefslogtreecommitdiff
path: root/src/css.cc
AgeCommit message (Collapse)Author
2016-05-11Silenced a few old debug messages.Jorge Arellano Cid
2014-08-10trim spacescorvid
...now that floats and grows are in the repo and I won't be making Sebastian's life difficult with a bunch of whitespace changes.
2014-03-05use a singe matchCache per CssContextJohannes Hofmann
This fixes a crash with the following HTML: <head> <style type="text/css"> .first .second .third{ border-top-color:#aaa !important; } #n .a, .b{ color: #aaa !important; border:#bbb; } </style> </head> <body> <div id="submit" value="Submit" class="a"> jhu </div> </body> The problem is that CssSelectors can be shared between normal and !important rules. The matchCacheOffset was overwritten in that case causing the crash on access. noticed-by and test-case-by: corvid
2014-02-16css: embed klass into CssSimpleSelectorJohannes Hofmann
2014-02-16css: embed selectorList in CssSelectorJohannes Hofmann
2014-02-16css: mark CssStyleSheet::apply() as constJohannes Hofmann
2014-02-15share user agent style between CssContext'sJohannes Hofmann
2014-02-15css: move cached matching information out of CssStyleSheetJohannes Hofmann
CssStyleSheet::apply() no longer modifies the CssStyleSheet. Cached matching information is now store in a MatchCache object which is part of CssContext. This makes it possible to share CssStyleSheet's between multiple CssContext's.
2013-04-19trim some spacescorvid
2012-11-07fix memory corruption introduced in bd95974b1399Johannes Hofmann
2012-10-29rm semicolonscorvid
2012-01-21ignore remote CSS rules that could reveal browser historyJohannes Hofmann
For a discussion of the problem see: http://dbaron.org/mozilla/visited-privacy
2012-01-13fix descendant selector matchingJohannes Hofmann
When matching descendant selectors we need to test all possibilities and not just the first one. While at it refactor CssSelector::match (). Testcase: <html> <head> <style type=text/css> .a > .b .c { font-weight:bold }</style> </head> <body> <div class=a> <div class=b> <div class=b> <div class=c>should be bold</div> </div> </div> </div> </body> </html> Noticed-by: Sebastian Geerken <sgeerken@dillo.org>
2011-12-30try to make CssStyleSheet::apply more readableJohannes Hofmann
2011-12-30cleanup CssStyleSheet a bitJohannes Hofmann
2011-12-30move buildUserAgentStyle and buildUserStyle to styleengine.ccJohannes Hofmann
By moving buildUserAgentStyle and buildUserStyle from css.cc to styleengine.cc we can avoid the circular dependency between css.hh and cssparser.hh.
2011-12-30use array of CssStyleSheets instead of pointers in CssContextJohannes Hofmann
2011-12-30simplify CssContext a bitJohannes Hofmann
2011-11-11locale-independent ASCII character case handlingcorvid
Basically, I and i are different letters in Turkic languages, and this causes problems for str(n)casecmp and toupper/tolower in these locales when dillo is dealing with ASCII.
2011-10-17typocorvid
2011-09-06remove trailing whitespaceJorge Arellano Cid
2011-08-28fix doctree leakJohannes Hofmann
HTML like <div>hello</div> </body> </html> <div>hello</div> currently causes the document tree to be a forest with two root nodes. To ensure we don't leak the first tree, an additional root node is introduced to hold all document trees. Catched by: Jeremy's valgrind logs Reported by: corvid <corvid@lavabit.com>
2011-08-24add support for CSS adjacent sibling selectorsJohannes Hofmann
2011-08-02don't reuse user- and useragent-stylesheetJohannes Hofmann
The notMatchingBefore variable in CssSelector is modified as a page is styled. Thererfore we can't share a single copy of the user- and useragent-stylesheets between CssContexts. Testcase: <html> <body> <a href=whatever.html> <img alt=test src=whatever.jpg> </a> <div> <img src=something.jpg> </div> </body> </html> On reload the first image looses it's border. Tests with gettimeofday showed times below 1ms to create user- and useragent-styles on a Pentium-M 1.8 GHz laptop. reported-by: corvid <corvid@lavabit.com>
2011-06-07support !important in style attributesJohannes Hofmann
2010-11-13Full CSS border-style implementationJorge Arellano Cid
The drawBorder{Top,Bottom,Left,Right} functions are similar. They use a trapezium as draw polygon, or drawTypedLine() for dots and dashes. Although the concept is simple, achieving pixel accuracy is laborious [1]. [1] http://www.dillo.org/css_compat/tests/border-style.html
2010-10-17no need to inline CssPropertyList copy constructorJohannes Hofmann
2010-10-11allow to apply CssContext to an arbitrary node in the docTreeJohannes Hofmann
2010-10-11mergeJohannes Hofmann
2010-10-01rework border-width handlingJohannes Hofmann
The initial value of border-width-* is "medium" not 0 (see http://www.w3.org/TR/CSS2/box.html#border-width-properties). Redo the border handling for tables to deal with this.
2010-09-24call layout->setBgColor() from web.ccJohannes Hofmann
2010-09-17set font and color on <html> tag, so authors can override itJohannes Hofmann
2010-04-23use CSS rule position when specificity is equalJohannes Hofmann
When two CSS rules have the same specificity make sure they are applied in the order as they appear in the stylesheets (see [1]). Testcase: <html><head><style> A:link {color: red} A.foo {color: green} </style></head><body> <a class="foo" href=http://www.dillo.org>should be green</a> </body></html> Reported by: corvid [1] http://www.w3.org/TR/CSS2/cascade.html#cascading-order
2010-01-11add quirk to reset font properties in tables (fixes e.g. gmail)Johannes Hofmann
2009-12-18Changed the default background color when allow_white_bg=NOJorge Arellano Cid
2009-11-27fix nested <ul> handling in user agent styleJohannes Hofmann
Originally I hoped that <ul> elements would be nested like this: <ul> <li>foo</li> <ul> <li>bar</li> </ul> </ul> in which case we could use ul > ul. But instead it seems to be common to use: <ul> <li>foo</li> <li> <ul> <li>bar</li> </ul> </li> </ul> The child selector ('>') is slightly more efficient than the general descendant (' ') selector, but it doesn't seem to matter much anyway.
2009-11-07adjust user-agent style for thJohannes Hofmann
Make th look like td, but with bold and centering added. Submitted by: Jeremy Henty
2009-09-20trim some spacescorvid
2009-07-23properly count multiple classes in CssSimpleSelector::specificity ()Johannes Hofmann
2009-07-17Fix an implicit int cast error when int != int32_tJorge Arellano Cid
2009-07-11allow multiple class strings in CssSimpleSelectorJohannes Hofmann
2009-07-11make CssSimpleSelector members privateJohannes Hofmann
2009-07-11cleanupsJohannes Hofmann
2009-07-11support multiple classes per doctree nodeJohannes Hofmann
2009-06-22remove system includescorvid
2009-06-11make <var> italic (noticed by corvid)Johannes Hofmann
2009-04-23commentsJohannes Hofmann
2009-04-19wrap long lines in src/ css codecorvid
2009-04-08support CSS @import directiveJohannes Hofmann
2009-03-15move CssPropertyInfo definition to cssparser.ccJohannes Hofmann