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

Skip adding/accumulating ClipRect values which corresponding rect offset is auto. #18210

Merged
merged 2 commits into from Aug 31, 2017

Conversation

@mantaroh
Copy link
Contributor

mantaroh commented Aug 24, 2017

This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1390352

This patch will skip adding/accumulating the values which corresponding rect offset is auto, and make Servo_AnimationValues_ComputeDistance return negative value instead of 0.0 when the function fails to distinguish its failure.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors

There are already these tests in dom/smil/tests of gecko, this PR will enable these tests.
For detail, see https://bugzilla.mozilla.org/show_bug.cgi?id=1390352.


This change is Reviewable

@mantaroh
Copy link
Contributor Author

mantaroh commented Aug 24, 2017

@BorisChiou
Copy link
Contributor

BorisChiou commented Aug 24, 2017

@bors-servo delegate+

@bors-servo
Copy link
Contributor

bors-servo commented Aug 24, 2017

✌️ @mantaroh can now approve this pull request

@mantaroh
Copy link
Contributor Author

mantaroh commented Aug 24, 2017

@bors-servo r=hiro, manishearth, birtles p=10

@bors-servo
Copy link
Contributor

bors-servo commented Aug 24, 2017

📌 Commit 3b0ad07 has been approved by hiro,

@bors-servo
Copy link
Contributor

bors-servo commented Aug 24, 2017

Testing commit 3b0ad07 with merge a177afb...

bors-servo added a commit that referenced this pull request Aug 24, 2017
Skip adding/accumulating ClipRect values which corresponding rect offset is auto.

<!-- Please describe your changes on the following line: -->
This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1390352

This patch will skip adding/accumulating the values which corresponding rect offset is auto, and  make Servo_AnimationValues_ComputeDistance return negative value instead of 0.0 when the function fails to distinguish its failure.

---
<!-- 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

<!-- Either: -->
There are already these tests in dom/smil/tests of gecko, this PR will enable these tests.
For detail, see https://bugzilla.mozilla.org/show_bug.cgi?id=1390352.

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

bors-servo commented Aug 24, 2017

💔 Test failed - linux-rel-wpt

@mantaroh
Copy link
Contributor Author

mantaroh commented Aug 24, 2017

  ▶ TIMEOUT [expected OK] /_mozilla/mozilla/paint_timing.html
  │ 
  │ VMware, Inc.
  │ Gallium 0.4 on softpipe
  └ 3.3 (Core Profile) Mesa 17.2.0-devel

  ▶ Unexpected subtest result in /_mozilla/mozilla/paint_timing.html:
  └ NOTRUN [expected PASS] Performance entries observer

@jdm
I can't find this intermittent from issues.
Do you know this type error?

@@ -384,7 +384,7 @@ pub extern "C" fn Servo_AnimationValues_ComputeDistance(from: RawServoAnimationV
-> f64 {
let from_value = AnimationValue::as_arc(&from);
let to_value = AnimationValue::as_arc(&to);
from_value.compute_squared_distance(to_value).map(|d| d.sqrt()).unwrap_or(0.0)
from_value.compute_squared_distance(to_value).map(|d| d.sqrt()).unwrap_or(-1.0)

This comment has been minimized.

@nox

nox Aug 24, 2017

Member

You explained the change in the commit, but a comment right here would be useful to convey that a negative distance means an error occurred.

fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> {
if !self.can_animate_with(other, procedure) {
return Err(());
}

This comment has been minimized.

@nox

nox Aug 24, 2017

Member

There is a better way to do that:

let animate_component = |this, other| {
    match (this.animate(other, procedure)?, procedure) {
        (None, Procedure::Interpolate { .. }) => Ok(None),
        (None, _) => Err(()),
        (result, _) => Ok(result),
    }
}

This way you don't need code to check whether the two values should be allowed to interpolate at all beforehand.

You could even wrap the Option<T> of the ClipRect fields in its own new type and implement Animate by hand for it, keeping the derived code for ClipRect.

This comment has been minimized.

@mantaroh

mantaroh Aug 25, 2017

Author Contributor

Thanks.
Ah! OK. I'll use Closure!

@jdm
Copy link
Member

jdm commented Aug 24, 2017

@mantaroh That's #18219; it's a new test that was just added yesterday.

@mantaroh
Copy link
Contributor Author

mantaroh commented Aug 24, 2017

Thanks @jdm !
I'll retry after addressing it.

mantaroh added 2 commits Aug 24, 2017
…s auto.

This patch will skip add_weighted() when self_portion + other_portion not equal
to zero. (i.e. adding or accumulating).
Gecko does same behavior since we can't add two auto value.
…ead of 0.0 when the function fails to distinguish its failure.

We need to check whether the function fails or not in order to check whether
we support the specified paced animation values.

Current servo returns 0.0 when failed computing distance, so servo doesn't
distinguish its failure. This patch makes Servo_AnimationValue_ComputeDistance
return a negative value when the function fails.
@mantaroh
Copy link
Contributor Author

mantaroh commented Aug 25, 2017

r? @nox

@upsuper
Copy link
Member

upsuper commented Aug 30, 2017

I think you can land this PR with previous review from Bugzilla as far as @nox doesn't complain about the updated patch.

@nox
Copy link
Member

nox commented Aug 30, 2017

Would have been nice to have a better spec link on the Animate impl, the one you put doesn't show that animating auto with auto should only work when interpolating.

@nox
nox approved these changes Aug 30, 2017
@nox
Copy link
Member

nox commented Aug 30, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Aug 30, 2017

📌 Commit 5e40a80 has been approved by nox

@bors-servo
Copy link
Contributor

bors-servo commented Aug 30, 2017

Testing commit 5e40a80 with merge 59b641c...

bors-servo added a commit that referenced this pull request Aug 30, 2017
Skip adding/accumulating ClipRect values which corresponding rect offset is auto.

<!-- Please describe your changes on the following line: -->
This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1390352

This patch will skip adding/accumulating the values which corresponding rect offset is auto, and  make Servo_AnimationValues_ComputeDistance return negative value instead of 0.0 when the function fails to distinguish its failure.

---
<!-- 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

<!-- Either: -->
There are already these tests in dom/smil/tests of gecko, this PR will enable these tests.
For detail, see https://bugzilla.mozilla.org/show_bug.cgi?id=1390352.

<!-- 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/17288)
<!-- Reviewable:end -->
@jdm
Copy link
Member

jdm commented Aug 30, 2017

That failure was #13480, so you can retry.

@nox
Copy link
Member

nox commented Aug 30, 2017

@bors-servo retry

@bors-servo
Copy link
Contributor

bors-servo commented Aug 30, 2017

Testing commit 5e40a80 with merge 3bd031a...

bors-servo added a commit that referenced this pull request Aug 30, 2017
Skip adding/accumulating ClipRect values which corresponding rect offset is auto.

<!-- Please describe your changes on the following line: -->
This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1390352

This patch will skip adding/accumulating the values which corresponding rect offset is auto, and  make Servo_AnimationValues_ComputeDistance return negative value instead of 0.0 when the function fails to distinguish its failure.

---
<!-- 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

<!-- Either: -->
There are already these tests in dom/smil/tests of gecko, this PR will enable these tests.
For detail, see https://bugzilla.mozilla.org/show_bug.cgi?id=1390352.

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

bors-servo commented Aug 30, 2017

💔 Test failed - mac-rel-wpt3

@jdm
Copy link
Member

jdm commented Aug 30, 2017

   Compiling mime_guess v1.8.1
error: Could not compile `mime_guess`.

Not sure what to make of this error, but it's not related to these changes; probably need to investigate the build machine.

@jdm
Copy link
Member

jdm commented Aug 30, 2017

In any case, go ahead and retry.

@nox
Copy link
Member

nox commented Aug 30, 2017

@bors-servo retry

@bors-servo
Copy link
Contributor

bors-servo commented Aug 30, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Aug 30, 2017

💔 Test failed - mac-rel-wpt1

@mantaroh
Copy link
Contributor Author

mantaroh commented Aug 30, 2017

@nox , @jdm
Many thanks.

@mantaroh
Copy link
Contributor Author

mantaroh commented Aug 31, 2017

I think test fail of mac-rel-wpt1 is related to #18228
@bors-servo retry

@upsuper
Copy link
Member

upsuper commented Aug 31, 2017

@bors-servo retry

@bors-servo
Copy link
Contributor

bors-servo commented Aug 31, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Aug 31, 2017

💔 Test failed - mac-rel-wpt1

@upsuper
Copy link
Member

upsuper commented Aug 31, 2017

@bors-servo retry

bors-servo added a commit that referenced this pull request Aug 31, 2017
Skip adding/accumulating ClipRect values which corresponding rect offset is auto.

<!-- Please describe your changes on the following line: -->
This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1390352

This patch will skip adding/accumulating the values which corresponding rect offset is auto, and  make Servo_AnimationValues_ComputeDistance return negative value instead of 0.0 when the function fails to distinguish its failure.

---
<!-- 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

<!-- Either: -->
There are already these tests in dom/smil/tests of gecko, this PR will enable these tests.
For detail, see https://bugzilla.mozilla.org/show_bug.cgi?id=1390352.

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

bors-servo commented Aug 31, 2017

Testing commit 5e40a80 with merge 5624c0e...

@bors-servo
Copy link
Contributor

bors-servo commented Aug 31, 2017

@bors-servo bors-servo merged commit 5e40a80 into servo:master Aug 31, 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
@mantaroh
Copy link
Contributor Author

mantaroh commented Aug 31, 2017

Thanks @upsuper !

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.

None yet

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