Skip to content

fix logic at OverflowDirection::LeftAndDown - #19478

Closed
tigercosmos wants to merge 1 commit into
servo:masterfrom
tigercosmos:k1
Closed

tigercosmos wants to merge 1 commit into
servo:masterfrom
tigercosmos:k1

Conversation

@tigercosmos

@tigercosmos tigercosmos commented Dec 4, 2017 •

Copy link
Copy Markdown
Contributor

fix logic at OverflowDirection::LeftAndDown


  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@highfive

highfive commented Dec 4, 2017

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @emilio: components/layout/query.rs

@highfive

highfive commented Dec 4, 2017

Copy link
Copy Markdown

warning Warning warning

  • These commits modify layout 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 Dec 4, 2017
@emilio

emilio commented Dec 4, 2017

Copy link
Copy Markdown
Member

Looks good, but needs tests. Let's see if there's any existing one...

@bors-servo try

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 0616817 with merge f60f7a3...

bors-servo pushed a commit that referenced this pull request Dec 4, 2017
fix logic at OverflowDirection::LeftAndDown

<!-- Please describe your changes on the following line: -->
fix logic at OverflowDirection::LeftAndDown
r? emilio

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

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

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

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel-wpt

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Dec 4, 2017
@tigercosmos

Copy link
Copy Markdown
Contributor Author

@bors-servo retry

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 0616817 with merge ac5e5d6...

bors-servo pushed a commit that referenced this pull request Dec 4, 2017
fix logic at OverflowDirection::LeftAndDown

<!-- Please describe your changes on the following line: -->
fix logic at OverflowDirection::LeftAndDown

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

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

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

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel-wpt

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Dec 4, 2017
@jdm

jdm commented Dec 4, 2017

Copy link
Copy Markdown
Member

All of the mac test jobs passed without any unexpected results, so we can assume the linux ones would be the same.

@tigercosmos

Copy link
Copy Markdown
Contributor Author

@emilio No test is influenced. I thought that is because many place, in which should have overflow direction, are now in TODO.

@tigercosmos

Copy link
Copy Markdown
Contributor Author

@emilio I guess there is no difference because the origin implement is just not quite correct.
for example:
leftward and upward

  • top edge
    • The top-most edge of the element’s top padding edge and the top margin edge of all of the element’s descendants' boxes, excluding boxes that have an ancestor of the element as their containing block.
  • right edge
    • The element’s right padding edge.
  • bottom edge
    • The element’s bottom padding edge.
  • left edge
    • The left-most edge of the element’s left padding edge and the left margin edge of all of the element’s descendants' boxes, excluding boxes that have an ancestor of the element as their containing block.

Among:

        OverflowDirection::LeftAndUp => {
            let top = min(iterator.union_rect.origin.y, iterator.origin_rect.origin.y);
            let left = min(iterator.union_rect.origin.x, iterator.origin_rect.origin.x);
            Rect::new(Point2D::new(left, top), iterator.origin_rect.size)
        },

Size2D should not be origin_rect, it should also include top and left margin.

@emilio

emilio commented Dec 5, 2017

Copy link
Copy Markdown
Member

I think it should be doable to write a test that affects this, shouldn't it? Or should this wait / be squashed into your other offset queries patches?

@tigercosmos

tigercosmos commented Dec 5, 2017 •

Copy link
Copy Markdown
Contributor Author

@emilio Is my argument above correct? If so, this PR should do more works.

@emilio

emilio commented Dec 10, 2017

Copy link
Copy Markdown
Member

Hi @tigercosmos, is there any particular reason this PR was closed? Sorry for not having being able to reply to that comment, but answering it requires a bit of time because I'm not terribly familiar with it.

@tigercosmos

Copy link
Copy Markdown
Contributor Author

@emilio Close now because I cannot provide a solution for OverflowDirection in short term. However I will still try to find one. You did help me a lot, thanks.

@tigercosmos
tigercosmos deleted the k1 branch May 24, 2018 16:39
@tigercosmos

Copy link
Copy Markdown
Contributor Author

the new one in #20868

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed. S-tests-failed The changes caused existing tests to fail.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong logic at OverflowDirection::LeftAndDown

5 participants