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

✨ Relax the iOS fixed-position transfer requirements #16049

Merged
merged 2 commits into from Aug 27, 2018

Conversation

jridgewell
Copy link
Contributor

Removes the max element height restriction, and allows any declared top or bottom to be transferred.

Fixes #15809.
Starts work on #14788.

@nainar
Copy link
Contributor

nainar commented Aug 9, 2018

Pinging @choumx for next steps here and assigning it to them as well.

opacity > 0 &&
offsetHeight < 300 &&
(this.isAllowedCoord_(top) || this.isAllowedCoord_(bottom))));
fe.forceTransfer || (opacity > 0 && !!(top || bottom)));

Choose a reason for hiding this comment

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

This will return true if top: 1 and bottom: 1, right? I think you want (!top || !bottom).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This matches current behavior. You could spec top: 0; bottom: 0 which passes the old isAllowedCoord_.

Choose a reason for hiding this comment

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

Oh they're strings not numbers.

Ok, for posterity: we only transfer fixed elements that are not auto-positioned to avoid jumping position after transferring to the fixed layer (due to loss of parent positioning context). We could do this work, but we don't (yet).

// transparent) - that's a lot of work for no benefit. Additionally,
// transparent elements used for "service" needs and thus best kept
// in the original tree. The visibility, however, is not considered
// because `visibility` CSS is inherited.

Choose a reason for hiding this comment

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

Nit: Add "We also only consider elements stuck to the top or bottom edge of the viewport as an optimization heuristic."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're dropping the top/bottom requirement. 😛

opacity > 0 &&
offsetHeight < 300 &&
(this.isAllowedCoord_(top) || this.isAllowedCoord_(bottom))));
fe.forceTransfer || (opacity > 0 && !!(top || bottom)));

Choose a reason for hiding this comment

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

Oh they're strings not numbers.

Ok, for posterity: we only transfer fixed elements that are not auto-positioned to avoid jumping position after transferring to the fixed layer (due to loss of parent positioning context). We could do this work, but we don't (yet).

jridgewell and others added 2 commits August 27, 2018 16:08
Removes the max element height restriction, and allows any declared top or bottom to be transfered.
@jridgewell jridgewell merged commit 0b9a1c8 into ampproject:master Aug 27, 2018
@jridgewell jridgewell deleted the loosen-ios-fixed-transfer branch August 27, 2018 22:26
torch2424 pushed a commit to torch2424/amphtml that referenced this pull request Aug 29, 2018
* Relax the iOS fixed-position transfer requirements

Removes the max element height restriction, and allows any declared top or bottom to be transfered.

* Fix tests
@jridgewell jridgewell added this to In progress in Fixed Layer via automation Sep 6, 2018
@jridgewell jridgewell moved this from In progress to Done in Fixed Layer Sep 6, 2018
jridgewell added a commit to jridgewell/amphtml that referenced this pull request Oct 5, 2018
erwinmombay pushed a commit that referenced this pull request Oct 5, 2018
jridgewell added a commit to jridgewell/amphtml that referenced this pull request Oct 5, 2018
erwinmombay pushed a commit that referenced this pull request Oct 5, 2018
jridgewell added a commit that referenced this pull request Oct 5, 2018
torch2424 pushed a commit to torch2424/amphtml that referenced this pull request Oct 10, 2018
Enriqe pushed a commit to Enriqe/amphtml that referenced this pull request Nov 28, 2018
* Relax the iOS fixed-position transfer requirements

Removes the max element height restriction, and allows any declared top or bottom to be transfered.

* Fix tests
Enriqe pushed a commit to Enriqe/amphtml that referenced this pull request Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Fixed Layer
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants