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
Translate the scroll coordinate to ScrollOrigin #17851
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wpt-pr-bot
approved these changes
Jul 16, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already reviewed downstream.
chromium-wpt-export-bot
changed the title
Transform the scroll coordinate in Element to ScrollOrigin
Transform the scroll coordinate to ScrollOrigin
Jul 16, 2019
chromium-wpt-export-bot
force-pushed
the
chromium-export-cl-1700001
branch
2 times, most recently
from
July 16, 2019 15:18
b15cf19
to
b14896f
Compare
chromium-wpt-export-bot
changed the title
Transform the scroll coordinate to ScrollOrigin
Translate the scroll coordinate to ScrollOrigin
Jul 17, 2019
chromium-wpt-export-bot
force-pushed
the
chromium-export-cl-1700001
branch
2 times, most recently
from
July 22, 2019 06:43
5dfe101
to
196bfd5
Compare
chromium-wpt-export-bot
force-pushed
the
chromium-export-cl-1700001
branch
4 times, most recently
from
July 25, 2019 15:33
88cd8e5
to
865ca18
Compare
chromium-wpt-export-bot
force-pushed
the
chromium-export-cl-1700001
branch
from
August 7, 2019 10:22
865ca18
to
1f0f501
Compare
chromium-wpt-export-bot
force-pushed
the
chromium-export-cl-1700001
branch
3 times, most recently
from
August 15, 2019 10:18
b5f1f0c
to
25e3316
Compare
chromium-wpt-export-bot
force-pushed
the
chromium-export-cl-1700001
branch
2 times, most recently
from
August 22, 2019 16:58
2e8bb6b
to
f43baed
Compare
chromium-wpt-export-bot
force-pushed
the
chromium-export-cl-1700001
branch
4 times, most recently
from
October 4, 2019 10:35
1bc2e2f
to
c19afe7
Compare
chromium-wpt-export-bot
force-pushed
the
chromium-export-cl-1700001
branch
5 times, most recently
from
October 9, 2019 11:46
3f61a9f
to
ce328c4
Compare
Currently, the value of ScrollLeft / ScrollTop / ScrollTo for a box in Element is the offset to the origin of ScrollableArea(left-top corner). This behavior isn't consistent with Document-scroll or the behavior of other vendors either whose origin is ScrollOrigin. There're compatibility problems when the box has leftward or upwards scroll overflow direction. According to the Specification, the scroll x-coordinate of a leftward box is nonpositive, and the scroll y-coordinate of an upwards box is also nonpositive. With using the origin of ScrollableArea, the coordinate is always nonnegative. In order to fix it, this patch transforms the scroll coordinate of a box in Element interface to use ScrollOrigin as its origin. There are a few cases needed to recalculate the scroll coordinate to meet this change. Since the origin of scroll coordinate transforms from the ScrollableArea origin to ScrollOrigin(), current_coordinate is equal to old_coordinate - ScrollOrigin. E.g. current_scrollLeft = old_scrollLeft - ScrollOrigin().X(). This behavior is guarded by a feature flag. See intent to ship blink-dev thread: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/7X2CKPGeEa0 Bug: 721759 Change-Id: I0ceed62e6845c6e5cd976e59b36f292d60bb669c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1700001 Reviewed-by: Jochen Eisinger <jochen@chromium.org> Reviewed-by: David Bokan <bokan@chromium.org> Reviewed-by: Frédéric Wang <fwang@igalia.com> Commit-Queue: cathie chen <cathiechen@igalia.com> Cr-Commit-Position: refs/heads/master@{#704470}
chromium-wpt-export-bot
force-pushed
the
chromium-export-cl-1700001
branch
from
October 10, 2019 03:10
ce328c4
to
022536f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, the value of ScrollLeft / ScrollTop / ScrollTo for a box in
Element is the offset to the origin of ScrollableArea(left-top corner).
This behavior isn't consistent with Document-scroll or the behavior of
other vendors either whose origin is ScrollOrigin. There're compatibility
problems when the box has leftward or upwards scroll overflow direction.
According to the Specification, the scroll x-coordinate of a leftward box
is nonpositive, and the scroll y-coordinate of an upwards box is also
nonpositive. With using the origin of ScrollableArea, the coordinate
is always nonnegative.
In order to fix it, this patch transforms the scroll coordinate of a
box in Element interface to use ScrollOrigin as its origin.
There are a few cases needed to recalculate the scroll coordinate to
meet this change. Since the origin of scroll coordinate transforms
from the ScrollableArea origin to ScrollOrigin(), current_coordinate
is equal to old_coordinate - ScrollOrigin. E.g.
current_scrollLeft = old_scrollLeft - ScrollOrigin().X().
This behavior is guarded by a feature flag.
See intent to ship blink-dev thread:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/7X2CKPGeEa0
Bug: 721759
Change-Id: I0ceed62e6845c6e5cd976e59b36f292d60bb669c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1700001
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Reviewed-by: Frédéric Wang <fwang@igalia.com>
Commit-Queue: cathie chen <cathiechen@igalia.com>
Cr-Commit-Position: refs/heads/master@{#704470}