Skip to content

style: Move -moz-force-broken-image-icon out of mako - #19279

Merged
bors-servo merged 1 commit into
servo:masterfrom
canova:force-broken-image
Nov 19, 2017
Merged

bors-servo merged 1 commit into
servo:masterfrom
canova:force-broken-image

Conversation

@canova

@canova canova commented Nov 18, 2017 •

Copy link
Copy Markdown
Contributor

  • These changes do not require tests because these are just refactoring.

This change is Reviewable

@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @bholley: components/style/values/specified/ui.rs, components/style/values/specified/mod.rs, components/style/values/computed/ui.rs, components/style/values/computed/mod.rs, components/style/properties/longhand/ui.mako.rs
  • @emilio: components/style/values/specified/ui.rs, components/style/values/specified/mod.rs, components/style/values/computed/ui.rs, components/style/values/computed/mod.rs, components/style/properties/longhand/ui.mako.rs

@highfive

Copy link
Copy Markdown

warning Warning warning

  • These commits modify style code, but no tests are modified. Please consider adding a test!

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 18, 2017
@canova

canova commented Nov 18, 2017

Copy link
Copy Markdown
Contributor Author

r? @emilio or @Manishearth
That should be easy to review :)

@highfive highfive assigned emilio and unassigned mbrubeck Nov 18, 2017
@emilio emilio mentioned this pull request Nov 18, 2017
48 of 49 tasks
Comment thread components/style/values/specified/ui.rs Outdated
pub struct MozForceBrokenImageIcon(pub bool);

impl MozForceBrokenImageIcon {
/// Return initial value of -moz-script-min-size.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the comment

Comment thread components/style/values/specified/ui.rs Outdated
impl MozForceBrokenImageIcon {
/// Return initial value of -moz-script-min-size.
#[inline]
pub fn initial_value() -> MozForceBrokenImageIcon {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it be better to name the initial_value in false?

@emilio emilio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good with those!

Comment thread components/style/values/specified/ui.rs Outdated
impl MozForceBrokenImageIcon {
/// Return initial value of -moz-script-min-size.
#[inline]
pub fn initial_value() -> MozForceBrokenImageIcon {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, +1 for naming this method false.

_context: &ParserContext,
input: &mut Parser<'i, 't>
) -> Result<MozForceBrokenImageIcon, ParseError<'i>> {
match input.expect_integer()? {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a note here saying that we intentionally don't support calc.

Comment thread components/style/values/specified/ui.rs Outdated

impl From<MozForceBrokenImageIcon> for u8 {
fn from(v: MozForceBrokenImageIcon) -> u8 {
match v.0 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about: if v.0 { 1 } else { 0 }?

@emilio

emilio commented Nov 18, 2017

Copy link
Copy Markdown
Member

And glad to see you around again @canaltinova! :)

@canova
canova force-pushed the force-broken-image branch from 4dc2db0 to 2f77dd6 Compare November 18, 2017 22:00
@canova

canova commented Nov 18, 2017

Copy link
Copy Markdown
Contributor Author

Thanks both of you for reviewing!
But we cannot name a method false in rust(I'm open to suggestions):
https://play.rust-lang.org/?gist=26051931f271b2b7d0803f283569717d&version=stable

Also, thanks @emilio! I will be here more often :)

@KiChjang

KiChjang commented Nov 18, 2017 •

Copy link
Copy Markdown
Contributor

@canaltinova The easiest way is often to add an underscore after the keyword, i.e. name it false_.

@canova

canova commented Nov 18, 2017

Copy link
Copy Markdown
Contributor Author

@KiChjang Yeah, for example, we used that solution for box_.rs before but personally I don't like to add underscore at the end of a function if we can use another name instead. Maybe we can use something like false_value to workaround that? :)

@canova
canova force-pushed the force-broken-image branch from 2f77dd6 to b2df766 Compare November 19, 2017 19:58
@canova

canova commented Nov 19, 2017

Copy link
Copy Markdown
Contributor Author

Anyway, I'm going with false_value, probably that's not too important to block the PR :)
@bors-servo r=emilio

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit b2df766 has been approved by emilio

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Nov 19, 2017
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit b2df766 with merge 6361aed...

bors-servo pushed a commit that referenced this pull request Nov 19, 2017
style: Move -moz-force-broken-image-icon out of mako

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix part of #19015.

<!-- Either: -->
- [X] These changes do not require tests because these are just refactoring.

<!-- 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/19279)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ 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
Approved by: emilio
Pushing 6361aed to master...

@bors-servo
bors-servo merged commit b2df766 into servo:master Nov 19, 2017
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Nov 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants