Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make writing-mode affect computed display #16044

Merged
merged 1 commit into from Mar 24, 2017
Merged

Conversation

@bd339
Copy link
Contributor

bd339 commented Mar 20, 2017

The first manual test-case in #15754 passes now, but the second test-case still renders "Text" horizontally, which is apparently because of servo's experimental support for writing-mode.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #15754 (github issue number if applicable).
  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@highfive
Copy link

highfive commented Mar 20, 2017

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @emilio (or someone else) soon.

@highfive
Copy link

highfive commented Mar 20, 2017

Heads up! This PR modifies the following files:

  • @bholley: components/style/properties/properties.mako.rs
  • @emilio: components/style/properties/properties.mako.rs
@highfive
Copy link

highfive commented Mar 20, 2017

warning Warning warning

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

emilio left a comment

We need to add a test for this. Even if the rendering it's not the expected one, we can test this with getComputedStyle, let's write a WPT test that does that.

use computed_values::display::T as display;
if context.layout_parent_style.writing_mode != style.writing_mode &&
style.get_box().clone_display() == display::inline {
style.mutate_box().set_display(display::inline_block);

This comment has been minimized.

@emilio

emilio Mar 20, 2017

Member

nit: Indent this and the following line to the left, four spaces from the if.

@@ -2115,6 +2115,14 @@ pub fn apply_declarations<'a, F, I>(device: &Device,
}

{
use computed_values::display::T as display;
if context.layout_parent_style.writing_mode != style.writing_mode &&

This comment has been minimized.

@emilio

emilio Mar 20, 2017

Member

Let's add here:

  • A quote and link to the spec.
  • A link to Boris' www-style mail.
  • (optionally) A link to the issue we're fixing to see the discussion.
If a box has a different writing-mode than its containing block, and has a specified display of inline, change the computed display to inline-block.
Also adds the second manual testcase from #15754 as a WPT to assert that the computed display does in fact change.
@bd339 bd339 force-pushed the bd339:iss15754 branch from c804070 to 8db0fca Mar 20, 2017
@bd339
Copy link
Contributor Author

bd339 commented Mar 23, 2017

@emilio
Copy link
Member

emilio commented Mar 23, 2017

Awesome, thank you for doing this!

@bors-servo r+

@bors-servo
Copy link
Contributor

bors-servo commented Mar 23, 2017

📌 Commit 8db0fca has been approved by emilio

@emilio
emilio approved these changes Mar 23, 2017
@bors-servo
Copy link
Contributor

bors-servo commented Mar 23, 2017

Testing commit 8db0fca with merge eb0bb87...

bors-servo added a commit that referenced this pull request Mar 23, 2017
Make writing-mode affect computed display

<!-- Please describe your changes on the following line: -->
The first manual test-case in #15754 passes now, but the second test-case still renders "Text" horizontally, which is apparently because of servo's experimental support for writing-mode.

---
<!-- 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 #15754 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/16044)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Mar 23, 2017

💔 Test failed - linux-rel-wpt

@bd339
Copy link
Contributor Author

bd339 commented Mar 24, 2017

Was that test failure because of these changes @emilio ?

@jdm
Copy link
Member

jdm commented Mar 24, 2017

@bors-servo: retry

@bors-servo
Copy link
Contributor

bors-servo commented Mar 24, 2017

Testing commit 8db0fca with merge eb4a1e75d0acf613e390787f6b154240fa2b0eca...

@bors-servo
Copy link
Contributor

bors-servo commented Mar 24, 2017

💔 Test failed - linux-rel-wpt

@jdm
Copy link
Member

jdm commented Mar 24, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Mar 24, 2017

Testing commit 8db0fca with merge 0f2c71a...

bors-servo added a commit that referenced this pull request Mar 24, 2017
Make writing-mode affect computed display

<!-- Please describe your changes on the following line: -->
The first manual test-case in #15754 passes now, but the second test-case still renders "Text" horizontally, which is apparently because of servo's experimental support for writing-mode.

---
<!-- 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 #15754 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/16044)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Mar 24, 2017

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-msvc-dev
Approved by: emilio
Pushing 0f2c71a to master...

@bors-servo bors-servo merged commit 8db0fca into servo:master Mar 24, 2017
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@bzbarsky
Copy link
Contributor

bzbarsky commented Mar 24, 2017

This broke a bunch of Gecko tests, because it's examining the value of the "writing mode" as defined at https://drafts.csswg.org/css-writing-modes-3/#writing-mode whereas it should be examining the value of the writing-mode property as defined at https://drafts.csswg.org/css-writing-modes-3/#propdef-writing-mode

As a simple example, this testcase: <span direction="ltr">some <span direction="rtl">long text that needs to wrap</span></span> gets broken because it makes the inner span an inline-block and then the wrapping is all wrong.

Emilio told me how to fix; I'll create a PR once I verify the fix actually does the right thing.

@bzbarsky
Copy link
Contributor

bzbarsky commented Mar 24, 2017

But I don't have time today to figure out how to run servo reftests and in particular how to add new ones.

We really need to figure out some way to share reftests with Gecko. :(

@bzbarsky
Copy link
Contributor

bzbarsky commented Mar 24, 2017

#16123 merged.

I really wish the CSS spec didn't have this naming confusion...

@bzbarsky
Copy link
Contributor

bzbarsky commented Mar 24, 2017

For what it's worth, this commit made the following previously-failing Gecko tests pass: layout/reftests/css-display/display-contents-writing-mode-2.html , layout/reftests/writing-mode/1134849-orthogonal-inline.html, layout/reftests/writing-mode/1196887-1-computed-display-inline-block.html

which is excellent. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

6 participants
You can’t perform that action at this time.