Bug 1359603 - Extra spec comments for style adjustments. r=heycam
MozReview-Commit-ID: J6qxBpQ43Ax
--- a/servo/components/style/style_adjuster.rs
+++ b/servo/components/style/style_adjuster.rs
@@ -48,16 +48,18 @@ impl<'a> StyleAdjuster<'a> {
/// value of 'float' is 'none'.
///
fn adjust_for_position(&mut self) {
if self.style.out_of_flow_positioned() && self.style.floated() {
self.style.mutate_box().set_float(float::none);
}
}
+ /// Apply the blockification rules based on the table in CSS 2.2 section 9.7.
+ /// https://drafts.csswg.org/css2/visuren.html#dis-pos-flo
fn blockify_if_necessary(&mut self,
layout_parent_style: &ComputedValues,
skip_root_and_element_display_fixup: bool) {
let mut blockify = false;
macro_rules! blockify_if {
($if_what:expr) => {
if !blockify {
blockify = $if_what;
@@ -242,16 +244,17 @@ impl<'a> StyleAdjuster<'a> {
overflow_y != original_overflow_y {
let mut box_style = self.style.mutate_box();
box_style.set_overflow_x(overflow_x);
box_style.set_overflow_y(overflow_y);
}
}
/// Adjusts the style to account for various fixups the don't fit naturally into the cascade.
+ /// When comparing to Gecko, this is similar to the work done by `nsStyleContext::ApplyStyleFixups`.
pub fn adjust(mut self,
layout_parent_style: &ComputedValues,
skip_root_and_element_display_fixup: bool) {
#[cfg(feature = "gecko")]
{
self.adjust_for_text_combine_upright(layout_parent_style);
}
self.adjust_for_top_layer();