Skip to content

Snap rectangles to nearest pixels consistently. - #7161

Merged
bors-servo merged 1 commit into
servo:masterfrom
mbrubeck:underline
Aug 11, 2015
Merged

bors-servo merged 1 commit into
servo:masterfrom
mbrubeck:underline

Conversation

@mbrubeck

Copy link
Copy Markdown
Contributor

Snapping the top-left and bottom-right corners separately can cause a rectangle to change size or even become empty when offset by a subpixel amount. Instead, this patch snaps the top-left corner, then snaps the size to a whole pixel amount, so any rectangle of a given original size will always have the same snapped size.

Fixes #7152. r? @pcwalton or @glennw

Review on Reviewable

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

Copy link
Copy Markdown
Contributor

@bors-servo: r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 80e59cc has been approved by pcwalton

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 80e59cc with merge 854a842...

@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 Aug 11, 2015
bors-servo pushed a commit that referenced this pull request Aug 11, 2015
Snap rectangles to nearest pixels consistently.

Snapping the top-left and bottom-right corners separately can cause a rectangle to change size or even become empty when offset by a subpixel amount.  Instead, this patch snaps the top-left corner, then snaps the size to a whole pixel amount, so any rectangle of a given original size will always have the same snapped size.

Fixes #7152. r? @pcwalton or @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7161)
<!-- Reviewable:end -->
@pcwalton

Copy link
Copy Markdown
Contributor

I'd expect CSS tests to pass due to this, but if you've run them that's fine

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux2

@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 Aug 11, 2015
@pcwalton

Copy link
Copy Markdown
Contributor
/css21_dev/html4/position-relative-035.htm
------------------------------------------
PASS expected FAIL [Parent]

@mbrubeck

Copy link
Copy Markdown
Contributor Author

@bors-servo retry

/css21_dev/html4/position-relative-035.htm

I suspect this is intermittent, since it is still failing on the Mac builder, and I've seen unexpected PASS from this test on my personal Linux box, even without this patch. I'll file an issue if this retry proves me right.

@bors-servo

Copy link
Copy Markdown
Contributor

⚡ Previous build results for android, gonk, linux1, mac1, mac2, mac3 are reusable. Rebuilding only linux2...

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux2

@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 Aug 11, 2015
Snapping the top-left and bottom-right corners separately can cause a
rectangle to change size when offset by a subpixel amount.  Instead, this
patch snaps the top-left corner, then rounds the size to a whole pixel amount,
so any rectangle of a given size will always have the same snapped size.

Fixes servo#7152.
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Aug 11, 2015
@mbrubeck

Copy link
Copy Markdown
Contributor Author

@bors-servo r=pcwalton

Adjusted test expectation.

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 3b6dc09 has been approved by pcwalton

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 3b6dc09 with merge 9c528c6...

@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 Aug 11, 2015
bors-servo pushed a commit that referenced this pull request Aug 11, 2015
Snap rectangles to nearest pixels consistently.

Snapping the top-left and bottom-right corners separately can cause a rectangle to change size or even become empty when offset by a subpixel amount.  Instead, this patch snaps the top-left corner, then snaps the size to a whole pixel amount, so any rectangle of a given original size will always have the same snapped size.

Fixes #7152. r? @pcwalton or @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7161)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, gonk, linux1, linux2, mac1, mac2, mac3

@bors-servo
bors-servo merged commit 3b6dc09 into servo:master Aug 11, 2015
@metajack metajack mentioned this pull request Aug 13, 2015
28 of 40 tasks
bjwbell added a commit to bjwbell/servo that referenced this pull request Sep 9, 2015
There is no easy way to pass position-relative-035 & also
pass both tests/ref/border_rounding_1px_invisible_issue_7184 and
tests/ref/text_decoration_underline_subpx.

servo#7161, "Snap rectangles to nearest
pixels...", did fix position-relative-035 (except
for OS X) but broke 1px borders.
@mbrubeck
mbrubeck deleted the underline branch May 11, 2016 03:43
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.

4 participants