aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/selector_matching.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-12-07 22:54:56 -0800
committerPatrick Walton <pcwalton@mimiga.net>2014-12-15 17:41:37 -0800
commit10f1ed5e311e7092d3e24b58c4960f5e8a511ac0 (patch)
treeef72767ba32a4268b20002c1a80a0d13ea9b47a4 /components/style/selector_matching.rs
parente0e14c60d68474a0dec94d2ec71d979a95fbc6a6 (diff)
downloadservo-10f1ed5e311e7092d3e24b58c4960f5e8a511ac0.tar.gz
servo-10f1ed5e311e7092d3e24b58c4960f5e8a511ac0.zip
style: Parse the legacy `border` attribute per the legacy HTML specification.
Additionally, this patch cleans up some miscellaneous formatting issues and refactors files in `layout/css/` somewhat to eliminate needless levels of indirection. It also fixes our handling of presentational hints that only apply if border is nonzero.
Diffstat (limited to 'components/style/selector_matching.rs')
-rw-r--r--components/style/selector_matching.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/components/style/selector_matching.rs b/components/style/selector_matching.rs
index 228ff41af05..b1fbd5042e8 100644
--- a/components/style/selector_matching.rs
+++ b/components/style/selector_matching.rs
@@ -799,6 +799,13 @@ pub fn common_style_affecting_attributes() -> [CommonStyleAffectingAttributeInfo
]
}
+/// Attributes that, if present, disable style sharing. All legacy HTML attributes must be in
+/// either this list or `common_style_affecting_attributes`. See the comment in
+/// `synthesize_presentational_hints_for_legacy_attributes`.
+pub fn rare_style_affecting_attributes() -> [Atom, ..1] {
+ [ atom!("border") ]
+}
+
/// Determines whether the given element matches the given single selector.
///
/// NB: If you add support for any new kinds of selectors to this routine, be sure to set
@@ -993,6 +1000,12 @@ pub fn matches_simple_selector<'a,E,N>(selector: &SimpleSelector,
matches_generic_nth_child(element, 0, 1, true, true)
}
+ ServoNonzeroBorder => {
+ *shareable = false;
+ let elem = element.as_element();
+ elem.has_nonzero_border()
+ }
+
Negation(ref negated) => {
*shareable = false;
!negated.iter().all(|s| matches_simple_selector(s, element, shareable))