Skip to content

Commit eba315d

Browse files
committed
rename s_c_a_p_s_c to real_s_c_a_p_s_c; fix docs
1 parent 8e60b20 commit eba315d

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

components/layout_2020/display_list/stacking_context.rs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ pub(crate) enum StackingContextContent {
207207
fragment: ArcRefCell<Fragment>,
208208
},
209209

210-
/// An index into [StackingContext::inline_stacking_containers].
210+
/// An index into [StackingContext::atomic_inline_stacking_containers].
211211
///
212-
/// There is no section field, because these are always in [StackingContextSection::Content].
212+
/// There is no section field, because these are always in [StackingContextSection::Foreground].
213213
InlineStackingContainer { index: usize },
214214
}
215215

@@ -298,16 +298,16 @@ pub struct StackingContext {
298298
/// > if it created a new stacking context, but omitting any positioned
299299
/// > descendants or descendants that actually create a stacking context
300300
/// > (letting the parent stacking context paint them, instead).
301-
stacking_contexts_and_positioned_stacking_containers: Vec<StackingContext>,
301+
real_stacking_contexts_and_positioned_stacking_containers: Vec<StackingContext>,
302302

303303
/// Float stacking containers.
304-
/// Separate from stacking_contexts_or_positioned_stacking_containers
304+
/// Separate from real_stacking_contexts_or_positioned_stacking_containers
305305
/// because they should never be stolen by the parent stacking context.
306306
/// <https://drafts.csswg.org/css-position-4/#paint-a-stacking-container>
307307
float_stacking_containers: Vec<StackingContext>,
308308

309309
/// Atomic inline stacking containers.
310-
/// Separate from stacking_contexts_or_positioned_stacking_containers
310+
/// Separate from real_stacking_contexts_or_positioned_stacking_containers
311311
/// because they should never be stolen by the parent stacking context, and
312312
/// separate from float_stacking_containers so that [StackingContextContent]
313313
/// can index into this vec to paint them in fragment order.
@@ -327,7 +327,7 @@ impl StackingContext {
327327
initializing_fragment_style: Some(initializing_fragment_style),
328328
context_type,
329329
contents: vec![],
330-
stacking_contexts_and_positioned_stacking_containers: vec![],
330+
real_stacking_contexts_and_positioned_stacking_containers: vec![],
331331
float_stacking_containers: vec![],
332332
atomic_inline_stacking_containers: vec![],
333333
}
@@ -339,7 +339,7 @@ impl StackingContext {
339339
initializing_fragment_style: None,
340340
context_type: StackingContextType::RealStackingContext,
341341
contents: vec![],
342-
stacking_contexts_and_positioned_stacking_containers: vec![],
342+
real_stacking_contexts_and_positioned_stacking_containers: vec![],
343343
float_stacking_containers: vec![],
344344
atomic_inline_stacking_containers: vec![],
345345
}
@@ -349,10 +349,10 @@ impl StackingContext {
349349
fn add_stacking_context(&mut self, stacking_context: StackingContext) {
350350
match stacking_context.context_type {
351351
StackingContextType::RealStackingContext => {
352-
&mut self.stacking_contexts_and_positioned_stacking_containers
352+
&mut self.real_stacking_contexts_and_positioned_stacking_containers
353353
},
354354
StackingContextType::PositionedStackingContainer => {
355-
&mut self.stacking_contexts_and_positioned_stacking_containers
355+
&mut self.real_stacking_contexts_and_positioned_stacking_containers
356356
},
357357
StackingContextType::FloatStackingContainer => &mut self.float_stacking_containers,
358358
StackingContextType::AtomicInlineStackingContainer => {
@@ -370,11 +370,11 @@ impl StackingContext {
370370

371371
pub(crate) fn sort(&mut self) {
372372
self.contents.sort_by(|a, b| a.section().cmp(&b.section()));
373-
self.stacking_contexts_and_positioned_stacking_containers
373+
self.real_stacking_contexts_and_positioned_stacking_containers
374374
.sort_by(|a, b| a.z_index().cmp(&b.z_index()));
375375

376376
debug_assert!(self
377-
.stacking_contexts_and_positioned_stacking_containers
377+
.real_stacking_contexts_and_positioned_stacking_containers
378378
.iter()
379379
.all(|c| match c.context_type {
380380
StackingContextType::RealStackingContext |
@@ -500,7 +500,7 @@ impl StackingContext {
500500
let first_if_any = self.contents.first().or_else(|| {
501501
// There wasn’t any `StackingContextFragment` in the root `StackingContext`,
502502
// because the root element generates a stacking context. Let’s find that one.
503-
self.stacking_contexts_and_positioned_stacking_containers
503+
self.real_stacking_contexts_and_positioned_stacking_containers
504504
.first()
505505
.and_then(|first_child_stacking_context| {
506506
first_child_stacking_context.contents.first()
@@ -601,7 +601,7 @@ impl StackingContext {
601601

602602
// Step 3: Stacking contexts with negative ‘z-index’
603603
let mut stealable_children = self
604-
.stacking_contexts_and_positioned_stacking_containers
604+
.real_stacking_contexts_and_positioned_stacking_containers
605605
.iter()
606606
.peekable();
607607
while stealable_children
@@ -911,15 +911,16 @@ impl BoxFragment {
911911
let mut stolen_children = vec![];
912912
if context_type != StackingContextType::RealStackingContext {
913913
stolen_children = mem::replace(
914-
&mut child_stacking_context.stacking_contexts_and_positioned_stacking_containers,
914+
&mut child_stacking_context
915+
.real_stacking_contexts_and_positioned_stacking_containers,
915916
stolen_children,
916917
);
917918
}
918919

919920
child_stacking_context.sort();
920921
parent_stacking_context.add_stacking_context(child_stacking_context);
921922
parent_stacking_context
922-
.stacking_contexts_and_positioned_stacking_containers
923+
.real_stacking_contexts_and_positioned_stacking_containers
923924
.append(&mut stolen_children);
924925
}
925926

0 commit comments

Comments
 (0)