mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #19709 - CYBAI:servo-display-out-of-mako, r=emilio
style: Remove -servo-display-for-hypothetical-box from longhand This is a sub-PR of #19015 r? emilio For the `fn set_original_display` inside `properties.mako.rs`, I removed `is_item_or_root` first to see how the tests result is. If it's needed, I'll add it back. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #19697 - [x] These changes do not require tests <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19709) <!-- Reviewable:end -->
This commit is contained in:
commit
1b46e2e759
5 changed files with 64 additions and 56 deletions
|
@ -3113,33 +3113,23 @@ fn static_assert() {
|
|||
gecko_enum_prefix="StyleDisplay",
|
||||
gecko_strip_moz_prefix=False) %>
|
||||
|
||||
pub fn set_display(&mut self, v: longhands::display::computed_value::T) {
|
||||
fn match_display_keyword(
|
||||
v: longhands::display::computed_value::T
|
||||
) -> structs::root::mozilla::StyleDisplay {
|
||||
use properties::longhands::display::computed_value::T as Keyword;
|
||||
// FIXME(bholley): Align binary representations and ditch |match| for cast + static_asserts
|
||||
let result = match v {
|
||||
match v {
|
||||
% for value in display_keyword.values_for('gecko'):
|
||||
Keyword::${to_camel_case(value)} =>
|
||||
structs::${display_keyword.gecko_constant(value)},
|
||||
% endfor
|
||||
};
|
||||
self.gecko.mDisplay = result;
|
||||
self.gecko.mOriginalDisplay = result;
|
||||
}
|
||||
}
|
||||
|
||||
/// Set the display value from the style adjustment code. This is pretty
|
||||
/// much like set_display, but without touching the mOriginalDisplay field,
|
||||
/// which we want to keep.
|
||||
pub fn set_adjusted_display(&mut self,
|
||||
v: longhands::display::computed_value::T,
|
||||
_is_item_or_root: bool) {
|
||||
use properties::longhands::display::computed_value::T as Keyword;
|
||||
let result = match v {
|
||||
% for value in display_keyword.values_for('gecko'):
|
||||
Keyword::${to_camel_case(value)} =>
|
||||
structs::${display_keyword.gecko_constant(value)},
|
||||
% endfor
|
||||
};
|
||||
pub fn set_display(&mut self, v: longhands::display::computed_value::T) {
|
||||
let result = Self::match_display_keyword(v);
|
||||
self.gecko.mDisplay = result;
|
||||
self.gecko.mOriginalDisplay = result;
|
||||
}
|
||||
|
||||
pub fn copy_display_from(&mut self, other: &Self) {
|
||||
|
@ -3151,6 +3141,14 @@ fn static_assert() {
|
|||
self.copy_display_from(other)
|
||||
}
|
||||
|
||||
pub fn set_adjusted_display(
|
||||
&mut self,
|
||||
v: longhands::display::computed_value::T,
|
||||
_is_item_or_root: bool
|
||||
) {
|
||||
self.gecko.mDisplay = Self::match_display_keyword(v);
|
||||
}
|
||||
|
||||
<%call expr="impl_keyword_clone('display', 'mDisplay', display_keyword)"></%call>
|
||||
|
||||
<% overflow_x = data.longhands_by_name["overflow-x"] %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue