mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
style: Add code to make part rules affect the style of the elements.
I still haven't implemented each_part(), so this will do nothing yet. The cascade order stuff is fishy, I know, and I'll fix in a followup if it's fine with you. I moved the sorting of the rules to rule_collector, since it seemed to me it was better that way that duplicating the code, and those SelectorMap functions only have a single caller anyway. Differential Revision: https://phabricator.services.mozilla.com/D32647
This commit is contained in:
parent
39de0a068e
commit
7139a4185a
6 changed files with 100 additions and 27 deletions
|
@ -182,10 +182,6 @@ impl SelectorMap<Rule> {
|
|||
|
||||
let quirks_mode = context.quirks_mode();
|
||||
|
||||
// At the end, we're going to sort the rules that we added, so remember
|
||||
// where we began.
|
||||
let init_len = matching_rules_list.len();
|
||||
|
||||
if rule_hash_target.is_root() {
|
||||
SelectorMap::get_matching_rules(
|
||||
element,
|
||||
|
@ -259,14 +255,10 @@ impl SelectorMap<Rule> {
|
|||
cascade_level,
|
||||
shadow_cascade_order,
|
||||
);
|
||||
|
||||
// Sort only the rules we just added.
|
||||
matching_rules_list[init_len..]
|
||||
.sort_unstable_by_key(|block| (block.specificity, block.source_order()));
|
||||
}
|
||||
|
||||
/// Adds rules in `rules` that match `element` to the `matching_rules` list.
|
||||
fn get_matching_rules<E, F>(
|
||||
pub (crate) fn get_matching_rules<E, F>(
|
||||
element: E,
|
||||
rules: &[Rule],
|
||||
matching_rules: &mut ApplicableDeclarationList,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue