Age | Commit message (Collapse) | Author |
|
The strdup function is not available in POSIX-2001, so we use our own
implementation in dlib: dStrdup.
Reviewed-by: dogma
|
|
|
|
...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.
|
|
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
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
For a discussion of the problem see:
http://dbaron.org/mozilla/visited-privacy
|
|
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>
|
|
|
|
|
|
By moving buildUserAgentStyle and buildUserStyle from css.cc to
styleengine.cc we can avoid the circular dependency between css.hh
and cssparser.hh.
|
|
|
|
|
|
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.
|
|
|
|
|
|
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>
|
|
|
|
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>
|
|
|
|
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
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
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
|
|
|
|
|
|
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.
|
|
Make th look like td, but with bold and centering added.
Submitted by: Jeremy Henty
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|