Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@chunhtai
Copy link
Contributor

Previous pr was reverted due to a internal test failure

the issue was the flutterscrollablesemanticsobject does not handle the case where scrollextent can be infinity. The fix is in the second commit.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.
  • The reviewer has submitted any presubmit flakes in this PR using the engine presubmit flakes form before re-triggering the failure.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

CGRect result;
const SkRect& rect = _semanticsObject.node.rect;
float x, y, width, height;
float scrollExtentMax = _semanticsObject.node.scrollExtentMax == INFINITY
Copy link
Member

Choose a reason for hiding this comment

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

You shouldn't check equality against INFINITY, there is the isfinite function https://en.cppreference.com/w/c/numeric/math/isfinite

Comment on lines 233 to 236
x = rect.x();
y = rect.y();
width = rect.width();
height = rect.height() + scrollExtentMax;
Copy link
Member

Choose a reason for hiding this comment

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

nit: I liked the CGRectMake calls better fwiw. It's a bit easier to maintain since it enforces all things are set before returning the result.


namespace {

constexpr float kScrollExtentMaxForInf = 1000;
Copy link
Member

Choose a reason for hiding this comment

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

It's probably worth commenting why 1000. That sounds like a small number, it's hard for me to know if it's adequate.

w * effectivelyScale, h * effectivelyScale)));
XCTAssertTrue(CGSizeEqualToSize(
scrollable.contentSize,
CGSizeMake(w * effectivelyScale, (h + 1000 + scrollPosition) * effectivelyScale)));
Copy link
Member

Choose a reason for hiding this comment

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

Pull out 1000 into a variable, name it so people have a chance of finding the const where it comes from.

Copy link
Member

@gaaclarke gaaclarke left a comment

Choose a reason for hiding this comment

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

lgtm!

@chunhtai chunhtai added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Jun 17, 2021
@fluttergithubbot
Copy link
Contributor

This pull request is not suitable for automatic merging in its current state.

  • The status or check suite licenses_check has failed. Please fix the issues identified (or deflake) before re-applying this label.

@fluttergithubbot fluttergithubbot removed the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Jun 18, 2021
@chunhtai chunhtai force-pushed the issues/80711-reland branch from 86e6a53 to d6feb68 Compare June 18, 2021 01:47
@chunhtai chunhtai added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Jun 18, 2021
@fluttergithubbot fluttergithubbot merged commit 53e4dcf into flutter:master Jun 18, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 20, 2021
wqyfavor pushed a commit to wqyfavor/engine that referenced this pull request Jun 21, 2021
chunhtai added a commit to chunhtai/engine that referenced this pull request Jun 21, 2021
chunhtai added a commit that referenced this pull request Jun 21, 2021
moffatman pushed a commit to moffatman/engine that referenced this pull request Aug 5, 2021
moffatman pushed a commit to moffatman/engine that referenced this pull request Aug 5, 2021
naudzghebre pushed a commit to naudzghebre/engine that referenced this pull request Sep 2, 2021
naudzghebre pushed a commit to naudzghebre/engine that referenced this pull request Sep 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes platform-ios waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants