Age | Commit message (Collapse) | Author |
|
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.
|
|
|
|
|
|
Instead of handling the 'auto' value implicitly for all CSS
properties that accept lenght types, we now accept it only for
specific properties where 'auto' is valid according to CSS 2.1.
This fixes an assertion with the following HTML fragment:
<div style="background:auto">hello</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The spec also has some rules about how, for instance, a footer can't go inside
a header, and that sort of thing, but that can wait until we have something
more sophisticated than a collection of IN_* flags.
|
|
|
|
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.
|
|
|
|
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>
|
|
|
|
|
|
|
|
|
|
|
|
* Instead of passing the nonCssHints as a CssPropertyList, set the hints
separately and create the list in StyleEngine.
* The CssPropertyList holding the nonCssHints is now completely managed
by StyleEngine and kept on the stack.
* Replace the table_cell_props mechanic in html.cc/table.cc with a
new method inheritNonCssHints() in StyleEngine.
|
|
Add lout::misc::roundInt() and use it for double -> int conversion
instead of doing the + 0.5 trick all over the place. It was wrong for
negative values and we might even replace roundInt() with rint() from
libm in the future.
Reported-by: corvid
|
|
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
|
|
|
|
* Add an additional CssValueType CSS_TYPE_LENGTH_PERCENTAGE_NUMBER
which can be a length, a percentage, or a number without unit.
* Numbers without units are represented as CssLength of type
CSS_LENGTH_TYPE_NONE.
* Properly detect numbers without unit in cases where they are not
allowed (see testcase below). For lengths only '0' can be
specified without unit.
Testcase:
<html>
<head>
<style tyoe="text/css">
div {border: solid black 2px}
</style>
</head>
<body>
<!-- correct - border-width should be set to 0 -> no border -->
<div style="border-width: 0">foo bar</div>
<!-- false - border-width should be left untouched -> 2px border -->
<div style="border-width: 40">foo bar</div>
<!-- false - border-width should be left untouched -> 2px border -->
<div style="border-width: 40 px">foo bar</div>
</body>
</html>
|
|
|
|
E.g. for letter-spacing sub-millimeter values actually make a
difference.
The maximum value that is representable is now 65535 mm which
should be enough in most cases.
|
|
The implementation in the fltk backend is still missing.
|
|
|
|
|
|
|
|
|
|
CssLength now stores px and mm values as pure integers similar to
what dw::core::style::Length does.
|
|
|
|
This needs to be done at parser level, so that alternative settings can
overrule a faulty negative one.
Testcase:
<html>
<head>
<style type="text/css" >
#foo {padding: -1px; background-color: green}
.bar {padding: 10px}
</style>
</head>
<body>
<div id="foo" class="bar">should be green and have 10px padding</div>
</body>
</html>
|
|
|
|
|
|
|
|
|