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

ScrollIntoView() should take scroll-margin into account. #9191

Merged
merged 1 commit into from Jan 29, 2018

Conversation

Projects
None yet
5 participants
@chromium-wpt-export-bot
Copy link
Collaborator

chromium-wpt-export-bot commented Jan 25, 2018

According to the spec, https://www.w3.org/TR/css-scroll-snap-1/,
:target/scrollIntoView()/etc should take scroll-margin, into account.

Currently in ContainerNode, BoundingBox() is calculated from its
UpperLeftCorner and LowerRightCorner. This patch move the logic to
LayoutObject and keeps the wrapper in ContainerNode.

When the rect is needed for ScrollIntoView, these two points might be
generated from different LayoutBoxes, and we should apply the
scroll-margin accordingly. We put these together into a new method -
LayoutObject::AbsoluteBoundingBoxRectForScrollIntoView() and wrap it as
Node::BoundingBoxForScrollIntoView().

Bug: 803606
Change-Id: I9002d6148fe8ed8f0851fa213431bd6260b993bb
Reviewed-on: https://chromium-review.googlesource.com/877444
Commit-Queue: Sandra Sun sunyunjia@chromium.org
Reviewed-by: David Bokan bokan@chromium.org
Cr-Commit-Position: refs/heads/master@{#532589}

@w3c-bots

This comment has been minimized.

Copy link

w3c-bots commented Jan 25, 2018

Build PASSED

Started: 2018-01-29 21:46:09
Finished: 2018-01-29 21:57:23

Failing Jobs

  • MicrosoftEdge:14.14393

View more information about this build on:

@tobie

This comment has been minimized.

Copy link
Contributor

tobie commented Jan 25, 2018

Summoning @wpt-pr-bot.

@wpt-pr-bot
Copy link
Collaborator

wpt-pr-bot left a comment

Already reviewed downstream.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-877444 branch 7 times, most recently from 82907f8 to 3993fd1 Jan 25, 2018

ScrollIntoView() should take scroll-margin into account.
According to the spec, https://www.w3.org/TR/css-scroll-snap-1/,
:target/scrollIntoView()/etc should take scroll-margin, into account.

Currently in ContainerNode, BoundingBox() is calculated from its
UpperLeftCorner and LowerRightCorner. This patch move the logic to
LayoutObject and keeps the wrapper in ContainerNode.

When the rect is needed for ScrollIntoView, these two points might be
generated from different LayoutBoxes, and we should apply the
scroll-margin accordingly. We put these together into a new method -
LayoutObject::AbsoluteBoundingBoxRectForScrollIntoView() and wrap it as
Node::BoundingBoxForScrollIntoView().

Bug: 803606
Change-Id: I9002d6148fe8ed8f0851fa213431bd6260b993bb
Reviewed-on: https://chromium-review.googlesource.com/877444
Commit-Queue: Sandra Sun <sunyunjia@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532589}

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-877444 branch from 3993fd1 to 6e57dd5 Jan 29, 2018

@chromium-wpt-export-bot chromium-wpt-export-bot merged commit fcf46c6 into master Jan 29, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-877444 branch Jan 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.