Repository navigation
style: Remove -servo-display-for-hypothetical-box from longhand - #19709
Conversation
|
Heads up! This PR modifies the following files:
|
9368bb8 to
d6dc633
Compare
| blockified_display, | ||
| is_item_or_root, | ||
| ); | ||
| if let Some(box_) = self.style.get_box_if_mutated() { |
There was a problem hiding this comment.
What's the reason using box_ instead of box?
|
|
||
| pub fn set_display(&mut self, v: longhands::display::computed_value::T) { | ||
| fn match_display_keyword( | ||
| &mut self, |
There was a problem hiding this comment.
I found we still need self argument because we'd like to call it from other methods inside this impl.
However, the mut is unnecessary. I'll remove it.
There was a problem hiding this comment.
Ah! Yes!! I totally forgot this way! Thanks a lot!
| self.gecko.mOriginalDisplay = self.match_display_keyword(v); | ||
| } | ||
|
|
||
| pub fn get_original_display(&self) -> &structs::root::mozilla::StyleDisplay { |
There was a problem hiding this comment.
No, we don't use it.
Let me remove it.
| is_item_or_root, | ||
| ); | ||
| if let Some(box_) = self.style.get_box_if_mutated() { | ||
| box_.set_original_display(blockified_display); |
There was a problem hiding this comment.
How is this ok in any way? This is completely changing the output.
Before this change: original_display: display, display: blockified_display.
After this change: original_display: blockified_display, display: display.
That looks pretty wrong.
There was a problem hiding this comment.
Also, it's not ok to just do it if the display struct has mutated, this needs to mutate it unconditionally.
There was a problem hiding this comment.
Before this change:
original_display: display, display: blockified_display.
After this change:original_display: blockified_display, display: display.
I think we still need is_item_or_root inside set_original_display of servo part.
With the current patch, it will set both display and original_display directly.
Thus, with passing blockified_display, I think the after this change will be original_display: blockified_display, display: blockified_display.
Let me try to fix it.
| // Save the display value without style adjustments now, | ||
| // which we need for hypothetical boxes. | ||
| let display = box_.clone_display(); | ||
| box_.set_original_display(display); |
There was a problem hiding this comment.
I think I need to follow the original condition to set the original_display here.
89c10f2 to
e13bab1
Compare
| self.copy_display_from(other) | ||
| } | ||
|
|
||
| pub fn set_original_display( |
There was a problem hiding this comment.
This is still wrong, you don't want to set mOriginalDisplay from StyleAdjuster, you just want to set mDisplay, I'd keep the set_adjusted_display name for doing that.
There was a problem hiding this comment.
Got it. Let me change it back to set_adjusted_display.
I was thinking the purpose is to set original display so I named it with set_original_display.
c972443 to
eb04098
Compare
| v: longhands::display::computed_value::T, | ||
| _is_item_or_root: bool | ||
| ) { | ||
| self.gecko.mOriginalDisplay = Self::match_display_keyword(v); |
There was a problem hiding this comment.
This is still not what needs to happen?
So, to clarify, mOriginalDisplay can't change from StyleAdjuster, only mDisplay should. This does the opposite as written.
There was a problem hiding this comment.
Ahh, yeah, sorry, I miss this one 😣
Please let me update it again!
eb04098 to
e2b3724
Compare
emilio
left a comment
There was a problem hiding this comment.
Hmm, there's a more subtle issue here, which is that, as written, servo doesn't set original_display correctly, right?
Where would that happen? In gecko it happens in copy_display_from and such. In servo it doesn't neither in set_display nor in copy_display_from.
I guess we could make this setup similar to what justify-items does... But that's slightly annoying. We do need to special-case those functions for the display property.
e2b3724 to
500587f
Compare
| pub hash: u64, | ||
| % endif | ||
| % if style_struct.name == "Box": | ||
| /// The original font which is equivalent to `mOriginalDisplay` in gecko |
There was a problem hiding this comment.
nit: Comment needs updating (this is the original display).
Maybe just:
// The display value specified by the CSS stylesheets (without any style adjustments), which is needed for hypothetical layout boxes.
| ::T(v.into_iter().collect()); | ||
| } | ||
| % elif longhand.ident == "display": | ||
| /// Set ${longhand.name}. |
There was a problem hiding this comment.
Maybe Set display directly? And comment on why we set both?
There was a problem hiding this comment.
Yeah, it should be commented only with Set display.
There was a problem hiding this comment.
Is it okay to explain like this?
/// Similar to `set_display` in `gecko`, we need to specify
/// `original_display` when setting `display`; thus, we need
/// to special-case this method.
There was a problem hiding this comment.
Maybe just:
/// We need to keep track of the original display for hypothetical boxes, so we need to special-case this.
| } | ||
|
|
||
| % if longhand.ident == "display": | ||
| /// Set ${longhand.name} from other struct. |
There was a problem hiding this comment.
Ditto, let's make the comment a bit more specific, and document why the special case is needed.
|
@bors-servo try |
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 -->
| #[inline] | ||
| pub fn copy_display_from(&mut self, other: &Self) { | ||
| self.display = other.display.clone(); | ||
| self.original_display = other.original_display.clone(); |
There was a problem hiding this comment.
Welp, there's a bug here, this should use other.display, not other.original_display.
There was a problem hiding this comment.
Ohhh! Thanks for the good catching!
| ::T(v.into_iter().collect()); | ||
| } | ||
| % elif longhand.ident == "display": | ||
| /// Set ${longhand.name}. |
There was a problem hiding this comment.
Maybe just:
/// We need to keep track of the original display for hypothetical boxes, so we need to special-case this.
500587f to
b5133cf
Compare
|
@bors-servo r+ |
|
📌 Commit b5133cf has been approved by |
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 -->
|
💔 Test failed - mac-rel-wpt3 |
|
💔 Test failed - linux-rel-css |
|
Ok, that test comes from #7355, and I'm not sure what makes it pass now... Maybe needs some investigation. |
|
So, this is:
And it's creating an |
…Servo. This is functionally equivalent right now (set_adjusted_display will just do set_display), but won't be after servo#19709.
style: Adjust the writing-mode fixup to call set_adjusted_display on Servo. This is functionally equivalent right now (set_adjusted_display will just do set_display), but won't be after #19709. <!-- 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/19758) <!-- Reviewable:end -->
3ab8b65 to
0291a75
Compare
|
@bors-servo try |
|
@CYBAI: 🔑 Insufficient privileges: and not in try users |
|
@CYBAI Unfortunately, it seems that homu hasn't deployed yet, so you will not be able to use your try powers until someone deploys the changes made. @bors-servo try |
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 -->
|
@KiChjang haha, after above try, I know it's not deployed yet. Thanks for the try! |
|
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev |
|
@bors-servo r+ |
|
📌 Commit 0291a75 has been approved by |
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 -->
|
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev |
This is a sub-PR of #19015
r? emilio
For the
fn set_original_displayinsideproperties.mako.rs, I removedis_item_or_rootfirst to see how the tests result is. If it's needed, I'll add it back../mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is