Skip to content

Extend whitespace::T with additional helper methods - #8542

Merged
bors-servo merged 1 commit into
servo:masterfrom
KiChjang:style-whitespace-methods
Nov 23, 2015
Merged

bors-servo merged 1 commit into
servo:masterfrom
KiChjang:style-whitespace-methods

Conversation

@KiChjang

Copy link
Copy Markdown
Contributor

Fixes #8128.

Review on Reviewable

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

Copy link
Copy Markdown

warning Warning warning

  • These commits modify layout code, but no reftests are modified. Please consider adding a reftest!

@jdm

jdm commented Nov 16, 2015

Copy link
Copy Markdown
Member

r? @SimonSapin

Comment thread components/style/inline.rs Outdated

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.

Since the type is defined in the same crate, I don’t think a trait is necessary here. Have you tried making this an inherent impl white_space::T {}?

Less important: I’m not sure about this file’s name or having a separate file in the first place. Do you expect to have more code related to inline layout go here in future?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If I read your comment in #8128 right, you said that these methods should live in an extension trait in a file called inline.rs. Do you mean that I should disregard that comment and implement these methods in properties.mako.rs instead?

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.

Ah, sorry for the misunderstanding, my earlier message wasn’t clear and didn’t have it in mind anymore when I replied here.

Since Ms2ger mentioned replacing something from components/layout/fragment.rs, I was assuming that it would stay in the layout crate. If you want to define in the layout crates methods for a type defined in the style crate, then you’d need a trait. And if it’s related to inline layout, it would make sense to have it in components/layout/inline.rs.

But looking now at what these methods actually do, it’s not a complex layout algorithm that particularly belongs in the layout crate. I think having it in the style crate is fine.

So, yeah, please make it an inherent impl without a trait, next to the definition of the white space property in properties.mako.rs. Thanks!

@KiChjang
KiChjang force-pushed the style-whitespace-methods branch from 8e9a0d9 to 724ce0e Compare November 20, 2015 07:40
@Ms2ger

Ms2ger commented Nov 20, 2015

Copy link
Copy Markdown
Contributor

I think the idea was for this new module/trait to live in the layout crate, not the style crate. (I don't feel strongly either way.)

@KiChjang
KiChjang force-pushed the style-whitespace-methods branch from 724ce0e to 7de7cb4 Compare November 20, 2015 19:03
@KiChjang

Copy link
Copy Markdown
Contributor Author

Now it lives under properties.mako.rs. The Mako codegen will generate the implemented methods for white_space.

r? @SimonSapin

@SimonSapin

Copy link
Copy Markdown
Member

@bors-servo r+


Reviewed 7 of 7 files at r2.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


Comments from the review on Reviewable.io

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 7de7cb4 has been approved by SimonSapin

@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 23, 2015
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 7de7cb4 with merge fba3bc2...

bors-servo pushed a commit that referenced this pull request Nov 23, 2015
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Nov 23, 2015
@jdm

jdm commented Nov 23, 2015

Copy link
Copy Markdown
Member

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 7de7cb4 with merge 6449cd0...

bors-servo pushed a commit that referenced this pull request Nov 23, 2015
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Nov 23, 2015
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt

@bors-servo
bors-servo merged commit 7de7cb4 into servo:master Nov 23, 2015
@KiChjang
KiChjang deleted the style-whitespace-methods branch November 23, 2015 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants