| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
Now clients provide a unit conversion context and libcss provides
code to perform unit conversion.
This reduces the amount of common code that clients have to write.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The API changes are:
1. When building a selection context, stylesheets added with
`css_select_ctx_{append|insert}_sheet()` now have to have
media strings associcated with them. Previously they took
a simple bitfield for CSS media type.
2. When selecting for an element, the client needs to specify
the current media requirements. Previously it only had to
provide the bitfield for CSS media type.
3. Same for the css_select_font_faces API.
The selection handling has been updated to handle the new
API, however it is currently only looking at the media type
when performing selection.
Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
|
| |
|
|
|
|
|
| |
Note this changes the public API. We can't compose directly
over child style now, since it may be interned.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we performed normal selection from CSS sources, and then iterated
over all the properties in the populated computed style. If the properties were
unset or their values were not from either a UA stylesheet or user stylesheet
with !important set, then we asked the client program (e.g. NetSurf) if there
were any presentational hints for that node, for each such property.
In the worst case this triggered N_PROPERTIES * N_NODES calls back to the client
program, even for properties that can't be set via HTML attributes.
The new API asks the client to supply a list of all the presentational hints
that apply to the given node. For most nodes on modern documents, this is 0.
Any presentational hints are applied before selection from CSS sources.
|
|
|
|
|
|
|
|
|
| |
- Remove client allocation function.
- Change node_classes callback not to yield array ownership to libcss.
- Node bloom filters now built by, during selection libcss.
- Added selection callbacks to get and set data on document nodes.
Test suite, example, and documentation updated to match.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now we pass a node bloom filter to css_get_style. That node bloom
filter is filled with the node's ancestor element, class, and id
names. Internally, libcss also generates a bloom filter for each
selector chain. If the selector chain's bloom filter is not a
subset of the node bloom filter, we know that the selector chain's
rule does not apply to the node. This avoids the slow selector
chain matching process.
Other smaller optimisations to move the ruling out of selector
chains for inapplicable media types and other reasons to before
we start comparing rules from different sources to find the next
rule. All this is now done in hash.c so select.c never sees the
trivially ruled out rules.
|
|
|
|
|
|
| |
Things missing: parser tests; the following descriptors: font-feature-settings, font-stretch, font-variant, unicode-range.
svn path=/trunk/libcss/; revision=13244
|
|
|
|
| |
svn path=/trunk/libcss/; revision=12007
|
|
|
|
| |
svn path=/trunk/libcss/; revision=11972
|
|
|
|
| |
svn path=/trunk/libcss/; revision=11557
|
|
|
|
| |
svn path=/trunk/libcss/; revision=11214
|
|
|
|
| |
svn path=/trunk/libcss/; revision=11211
|
|
|
|
| |
svn path=/trunk/libcss/; revision=10901
|
|
|
|
|
|
|
| |
TODO: update the tests to include a refcounting proof
svn path=/trunk/libcss/; revision=10162
|
|
|
|
|
|
|
|
|
| |
They are properties of the context in which the stylesheet is used.
Therefore, for top-level sheets, this information must be provided at selection
time. For child sheets, the origin is inherited from their parent and the
applicable media types are specified on the linking mechanism.
svn path=/trunk/libcss/; revision=9802
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) element selectors
2) universal selectors with class names
3) universal selectors with ids
4) universal selectors
Only bother looking for matching selectors in 2 & 3 if the node being selected for has class names or an id, respectively.
In theory, this should speed up style selection somewhat.
svn path=/trunk/libcss/; revision=8882
|
|
|
|
| |
svn path=/trunk/libcss/; revision=8653
|
|
|
|
|
|
|
|
| |
another selection handler callback for this.
Change selector hash to use an ASCII case-insensitive hash function.
svn path=/trunk/libcss/; revision=8602
|
|
|
|
|
|
| |
resultant absolute font size should not be clamped to a fixed minimum (e.g. if the client has a minimum permissible font size)
svn path=/trunk/libcss/; revision=8586
|
|
|
|
|
|
| |
Some progress towards computing absolute values.
svn path=/trunk/libcss/; revision=8311
|
|
|
|
|
|
| |
voice-family properties.
svn path=/trunk/libcss/; revision=8306
|
|
|
|
| |
svn path=/trunk/libcss/; revision=8024
|
|
|
|
|
|
|
|
| |
This one stands a chance of working sanely.
While this compiles, please don't expect it to link.
svn path=/trunk/libcss/; revision=6820
|
|
|
|
|
|
|
| |
The client will have to maintain some state to be able to calculate this struct for every node selection, but that shouldn't be overly onerous.
Also, the mess surrounding centering can only be sensibly solved through the addition of a new, prefixed, property.
svn path=/trunk/libcss/; revision=6816
|
|
|
|
|
|
|
|
|
| |
It passes the tests, perhaps we need more of them.
Lifetimes of lwc_string objects really need attention before we can consider
this finished.
svn path=/trunk/libcss/; revision=6517
|
|
|
|
| |
svn path=/trunk/libcss/; revision=6482
|
|
|
|
|
|
|
|
|
| |
saner, as any node may match a pseudo class, not just the immediate target of the selection.
Munge test data to no longer expect :active to match -- there's currently no way to specify which node(s) in the tree have which pseudo classes applying to them.
The pseudo classes on @page are no longer supported (namely, :left, :right, :first). These, and @page itself, probably want a dedicated API, as they are nothing to do with normal selection. Probably something like css_error css_select_page_margins(ctx, CSS_PAGE_LEFT, &computed);
svn path=/trunk/libcss/; revision=6476
|
|
|
|
| |
svn path=/trunk/libcss/; revision=6474
|
|
|
|
| |
svn path=/trunk/libcss/; revision=6407
|
|
|
|
| |
svn path=/trunk/libcss/; revision=6404
|
|
|
|
|
|
|
|
| |
Refactor stuff while we're at it.
Selector chains containing universal simple components are expensive to match/reject, as they require matching details on every previous sibling/ancestor (depending on the combinator type). Thus, we aim to handle the universal case last, to have the best chance of avoiding it.
svn path=/trunk/libcss/; revision=6403
|
|
|
|
| |
svn path=/trunk/libcss/; revision=6402
|
|
|
|
| |
svn path=/trunk/libcss/; revision=6401
|
|
|
|
|
|
| |
It's far better that the client creates computed style objects which we then populate. This will allow more efficient composition of styles as, in the most common case, it won't require any memory allocation.
svn path=/trunk/libcss/; revision=6390
|
|
|
|
|
|
|
| |
Make css_computed_style_create() private.
Implement css_computed_style_[create,destroy]().
svn path=/trunk/libcss/; revision=6389
|
|
|
|
|
|
| |
complete.
svn path=/trunk/libcss/; revision=6289
|
|
|
|
| |
svn path=/trunk/libcss/; revision=6286
|
|
svn path=/trunk/libcss/; revision=6284
|