Daniel Clark <dan...@microsoft.com> writes:

> Can you remind me what the current behavior is without the remembered
> scroll offset? I am wondering if there’s any scenario where changing
> this could break existing anchor pos usage.

Without this the inset-modified containing block for `position-area`
doesn't take the scroll offset into account. If percentage-sizes are
used on anchor positioned elements, the resulting size will be quite
useless when scrolled. Example:

```
<!DOCTYPE html>
<style>
  #container {
     overflow: scroll;
     position: relative;
     width: 400px;
     height: 400px;
  }
  #anchor {
    anchor-name:--a;
    margin-left: 100px;
    width: 50px;
    height: 50px;
    background: hotpink;
  }
  #anchored {
    display: none;
    position: absolute;
    position-anchor: --a;
    position-area: bottom;
    position-try-fallbacks: flip-block;
    position-try-order: most-height;
    width: 100px;
    height: 100%;
    box-sizing: border-box;
    border: solid;
    background: cyan;
  }
</style>
<div id="container">
  <div style="height:500px;"></div>
  <div id="anchor"></div>
  <div id="anchored"></div>
  <div style="height:1000px;"></div>
</div>
<script>
  anchor.onclick = function() {
    let s = anchored.style
    s.display = s.display == "block" ? "none" : "block";
  }
</script>
```

Scroll down to the hotpink box and click it.

With this change, a cyan box will appear above or below the hotpink box,
taking up all available space in the scrollport.

Without this change, the scroll offset isn't taken into account, but the
inset-modified containing block sizes are still confined by that of the
scrollport. This means, among other things, that there will be zero
height below the anchor, because this is at offset 500px+50px, and the
height of the scrollport is only 400px (minus the horizontal scrollbar,
even). Above the anchor, there's 500px of space, but this is too large
to fit within the scrollport at any scroll offset except 0, so that
option is discarded.

>> Will this feature be supported on all six Blink platforms (Windows,
>> Mac, Linux, ChromeOS, Android, and Android WebView)?
>
>> No
>
> Any reason this can’t ship on all platforms?

Sorry, this was an oversight. Now fixed. It will ship on all
platforms. Thanks for catching.

-- 
Morten Stenshorne, Software developer,
Blink/Layout, Google, Oslo, Norway

-- 
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to blink-dev+unsubscr...@chromium.org.
To view this discussion visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/87frjqzjm5.fsf%40bro.lan.

Reply via email to