Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upSome janitoring over the layout crate #22684
Conversation
nox
added some commits
Jan 10, 2019
highfive
assigned
Manishearth
Jan 14, 2019
This comment has been minimized.
This comment has been minimized.
highfive
commented
Jan 14, 2019
Heads up! This PR modifies the following files:
|
highfive
added
the
S-awaiting-review
label
Jan 14, 2019
This comment has been minimized.
This comment has been minimized.
highfive
commented
Jan 14, 2019
This comment has been minimized.
This comment has been minimized.
r? @SimonSapin |
highfive
assigned
SimonSapin
and unassigned
Manishearth
Jan 14, 2019
emilio
approved these changes
Jan 14, 2019
.unwrap() | ||
.send(ConstellationControlMsg::ReportCSSError( | ||
self.pipelineid, | ||
"".to_owned(), |
This comment has been minimized.
This comment has been minimized.
emilio
Jan 14, 2019
Member
We have the URL here so reporting it should be trivial, mind filing an issue for that?
This comment has been minimized.
This comment has been minimized.
self.positioning(), | ||
established_reference_frame.is_some(), | ||
) { | ||
if established_reference_frame.is_some() || |
This comment has been minimized.
This comment has been minimized.
emilio
Jan 14, 2019
Member
can you do instead:
let abspos_containing_block = established_reference_frame.is_some() || ....;
if abspos_containing_block {
fragment.style.get_box().position, | ||
false, | ||
) { | ||
if fragment.style.get_box().position != StylePosition::Static { |
This comment has been minimized.
This comment has been minimized.
emilio
Jan 14, 2019
Member
And same here?
This looks wrong btw, an inline can also establish a reference frame.
This comment has been minimized.
This comment has been minimized.
nox
Jan 14, 2019
Author
Member
Want me to file a follow-up issue? This is just the same code as before right?
|
||
impl<'a> LayoutDamageComputation for &'a mut dyn Flow { | ||
fn compute_layout_damage(self) -> SpecialRestyleDamage { | ||
impl dyn Flow { |
This comment has been minimized.
This comment has been minimized.
/// text display items it may be `TextCursor` or `VerticalTextCursor`. | ||
#[inline] | ||
fn get_cursor(values: &ComputedValues, default_cursor: CursorKind) -> Option<CursorKind> { | ||
match ( |
This comment has been minimized.
This comment has been minimized.
emilio
Jan 14, 2019
Member
You could also just move it to style, your call.
In any case I think this is simpler to read as follows, if you want to make that change:
let ui = values.get_inherited_ui();
if ui.pointer_events == PointerEvents::None {
return None;
}
match ui.cursor {
// ...
}
This comment has been minimized.
This comment has been minimized.
nox
Jan 14, 2019
Author
Member
Made some changes like you suggested but didn't move it to style given there is no other user.
nox
added some commits
Jan 14, 2019
nox
force-pushed the
next-layout
branch
from
7110895
to
d1799e6
Jan 14, 2019
This comment has been minimized.
This comment has been minimized.
From Travis Diff in /home/travis/build/servo/servo/components/script/dom/window.rs at line 1602:
}
pub fn scroll_offset_query(&self, node: &Node) -> Vector2D<f32> {
- if let Some(scroll_offset) = self
- .scroll_offsets
- .borrow()
- .get(&node.to_opaque())
- {
+ if let Some(scroll_offset) = self.scroll_offsets.borrow().get(&node.to_opaque()) {
return *scroll_offset;
}
Vector2D::new(0.0, 0.0)
Diff in /home/travis/build/servo/servo/components/script/dom/window.rs at line 1621:
// The scroll offsets are immediatly updated since later calls
// to topScroll and others may access the properties before
// webrender has a chance to update the offsets.
- self.scroll_offsets.borrow_mut().insert(
- node.to_opaque(),
- Vector2D::new(x_ as f32, y_ as f32),
- );
+ self.scroll_offsets
+ .borrow_mut()
+ .insert(node.to_opaque(), Vector2D::new(x_ as f32, y_ as f32));
let NodeScrollIdResponse(scroll_id) = self.layout_rpc.node_scroll_id();
Run `./mach fmt` to fix the formatting |
SimonSapin
approved these changes
Jan 14, 2019
&QueryMsg::ResolvedStyleQuery(..) | | ||
&QueryMsg::OffsetParentQuery(_) | | ||
&QueryMsg::StyleQuery(_) => false, | ||
ReflowGoal::LayoutQuery(ref querymsg, _) => match *querymsg { |
This comment has been minimized.
This comment has been minimized.
SimonSapin
Jan 14, 2019
Member
No need to change this back, but in the 2018 edition you can remove &
from most patterns without adding *
in the matched expression.
nox
added some commits
Jan 14, 2019
nox
force-pushed the
next-layout
branch
from
d1799e6
to
cf15336
Jan 14, 2019
This comment has been minimized.
This comment has been minimized.
@bors-servo r=emilio,SimonSapin |
This comment has been minimized.
This comment has been minimized.
|
highfive
assigned
emilio
and unassigned
SimonSapin
Jan 14, 2019
highfive
added
S-awaiting-merge
and removed
S-awaiting-review
labels
Jan 14, 2019
added a commit
that referenced
this pull request
Jan 14, 2019
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
nox commentedJan 14, 2019
•
edited by SimonSapin
This PR moves a bunch of code around and makes some methods from one-use traits into inherent methods.
This change is