mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Don't try to share style on quirks mode whenever two elements have different id
This commit is contained in:
parent
95aac490a5
commit
af8026a98c
1 changed files with 8 additions and 1 deletions
|
@ -26,7 +26,7 @@ use rule_tree::{CascadeLevel, RuleTree, StrongRuleNode, StyleSource};
|
||||||
use selector_map::{PrecomputedHashMap, SelectorMap, SelectorMapEntry};
|
use selector_map::{PrecomputedHashMap, SelectorMap, SelectorMapEntry};
|
||||||
use selector_parser::{SelectorImpl, PerPseudoElementMap, PseudoElement};
|
use selector_parser::{SelectorImpl, PerPseudoElementMap, PseudoElement};
|
||||||
use selectors::NthIndexCache;
|
use selectors::NthIndexCache;
|
||||||
use selectors::attr::NamespaceConstraint;
|
use selectors::attr::{CaseSensitivity, NamespaceConstraint};
|
||||||
use selectors::bloom::{BloomFilter, NonCountingBloomFilter};
|
use selectors::bloom::{BloomFilter, NonCountingBloomFilter};
|
||||||
use selectors::matching::{ElementSelectorFlags, matches_selector, MatchingContext, MatchingMode};
|
use selectors::matching::{ElementSelectorFlags, matches_selector, MatchingContext, MatchingMode};
|
||||||
use selectors::matching::VisitedHandlingMode;
|
use selectors::matching::VisitedHandlingMode;
|
||||||
|
@ -1405,6 +1405,13 @@ impl Stylist {
|
||||||
where
|
where
|
||||||
E: TElement,
|
E: TElement,
|
||||||
{
|
{
|
||||||
|
// If id needs to be compared case-insensitively, the logic below
|
||||||
|
// wouldn't work. Just conservatively assume it may have such rules.
|
||||||
|
match self.quirks_mode().classes_and_ids_case_sensitivity() {
|
||||||
|
CaseSensitivity::AsciiCaseInsensitive => return true,
|
||||||
|
CaseSensitivity::CaseSensitive => {}
|
||||||
|
}
|
||||||
|
|
||||||
let hash = id.get_hash();
|
let hash = id.get_hash();
|
||||||
for (data, _) in self.cascade_data.iter_origins() {
|
for (data, _) in self.cascade_data.iter_origins() {
|
||||||
if data.mapped_ids.might_contain_hash(hash) {
|
if data.mapped_ids.might_contain_hash(hash) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue