New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 658834 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
(currently inactive on Chromium)
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocking:
issue 558575



Sign in to add a comment

[scroll anchoring] define a more conservative set of layout-affecting properties for SANACLAP

Project Member Reported by skobes@chromium.org, Oct 24 2016

Issue description

SANACLAP (http://bit.ly/sanaclap) as currently implemented (in  issue 637626 ) triggers a suppression for any style change that causes StyleDifference::needsLayout(), plus tranforms.

This covers a large and continually-evolving set of properties, most of which we don't actually care about (http://bit.ly/blink-layout-props).

We should limit SANACLAP suppression triggering to a fixed set of properties that we can list in the spec.
 

Comment 1 by skobes@chromium.org, Oct 24 2016

I think a good "conservative set" would be:

- left, top, right, bottom
- margin-left, margin-top, margin-right, margin-bottom
- padding-left, padding-top, padding-right, padding-bottom
- border-left-width, border-top-width, border-right-width, border-bottom-width
- width, min-width, max-width, height, min-height, max-height
- display, position, float, clear, overflow, transform
- shorthands for the above

Comment 2 by ymalik@chromium.org, Oct 24 2016

Cc: -ymalik@chromium.org skobes@chromium.org
Owner: ymalik@chromium.org

Comment 3 by ojan@chromium.org, Oct 25 2016

If we're going with the minimal set, we can exclude things that aren't strictly needed for web compat.

I think we don't need the border-*-width, right? Do we need display, float, clear and overflow?

Technically, of the margin/padding ones, we only need margin-top and padding-top, but I think it would be too weird to only include one edge.

Comment 4 by ojan@chromium.org, Oct 25 2016

So, that would leave us with:
- left, top, right, bottom
- margin-left, margin-top, margin-right, margin-bottom
- padding-left, padding-top, padding-right, padding-bottom
- width, min-width, max-width, height, min-height, max-height
- position, transform
- shorthands for the above

I like that we're ending up with a short list. That makes it very clear that this is a quirk needed for web compatibility. If we were designing the platform from scratch, we would not do SANACLAP at all and would just have you use overflow-anchor appropriately.

Comment 5 by skobes@chromium.org, Oct 25 2016

SGTM.  I had included display, float, clear, and overflow because they feel conceptually similar to pulling things in/out of flow, but I don't think we saw any sites that need them suppressed.

Comment 6 by ymalik@chromium.org, Oct 25 2016

I think change in the display property should also disable anchoring. Though we haven't found specific examples of breakages, I can see it being a common way to hide headers on scroll down. For e.g if WSJ's code was slightly different, it would be stuck in the js loop if we didn't suppress display changes ( issue 652377 ).

Also, because the list has gone down quite a bit, it would be valuable to get some insights into changes that are causing this suppression. We could change the m_scrollAnchorDisablingPropertyChanged variable to hold bits representing the type of change (roughly 1 bit for each bullet in comment 4). This is obviously not scalable if we add more CSS properties and I don't understand the implications of adding more bits to the every LayoutObject on a webpage, but I see other variables greater than 1 bit. WDYT?  

Comment 7 by skobes@chromium.org, Oct 25 2016

It actually doesn't make sense to have "display" because changes to "display" will destroy or recreate the LayoutObject.  The same anchor cannot exist both before and after a change to "display" on itself or one of its ancestors.

I think we should try not to add more bits to LayoutObject.
Project Member

Comment 8 by bugdroid1@chromium.org, Oct 26 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/85861c2144feef2c65bb34f3bcc36e3d57180cb5

commit 85861c2144feef2c65bb34f3bcc36e3d57180cb5
Author: ymalik <ymalik@chromium.org>
Date: Wed Oct 26 04:03:04 2016

Refine the criteria for ScrollAnchor-disabling properties

The change of the following CSS properties on an anchor node's ancestor
causes anchoring suppresion:
- left, top, right, bottom
- margin-left, margin-top, margin-right, margin-bottom
- padding-left, padding-top, padding-right, padding-bottom
- width, min-width, max-width, height, min-height, max-height
- position, transform
- shorthands for the above

BUG= 658834 

Review-Url: https://codereview.chromium.org/2450033002
Cr-Commit-Position: refs/heads/master@{#427584}

[modify] https://crrev.com/85861c2144feef2c65bb34f3bcc36e3d57180cb5/third_party/WebKit/Source/core/style/ComputedStyle.cpp
[modify] https://crrev.com/85861c2144feef2c65bb34f3bcc36e3d57180cb5/third_party/WebKit/Source/core/style/ComputedStyle.h

Comment 9 by ymalik@chromium.org, Oct 26 2016

Labels: Hotlist-Input-Dev
Status: Fixed (was: Assigned)

Sign in to add a comment