Bug 1765668 Comment 6 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Daniel Holbert [:dholbert] from comment #4)
> So this demonstrates that this is specifically an issue with us mis-handling the border and only the border (either double-counting it, or forgetting to subtract it away, or something like that) on the abspos containing block

Looking through `ReflowInput::CalculateHypotheticalPosition(` for border-specific stuff, I found this:
```c++
  // The specified offsets are relative to the absolute containing block's
  // padding edge and our current values are relative to the border edge, so
  // translate.
  const LogicalMargin border = aCBReflowInput->ComputedLogicalBorder(wm);
  aHypotheticalPos.mIStart -= border.IStart(wm);
  aHypotheticalPos.mBStart -= border.BStart(wm);
```
https://searchfox.org/mozilla-central/rev/5204ea3d3dac5832075fb61d9689dd7879ed91b2/layout/generic/ReflowInput.cpp#1389-1394

As a hacky-experiment, I tried changing the first `-=` to `+=` -- and that makes my attached testcase 1 and testcase 2 render as-expected!

So I suspect this is a case where we need to see if the corresponding writing-mode axes have the same "polarity" vs. if they disagree.  (In this testcase, `wm`'s inline-axis is LTR, whereas the corresponding axis in the abspos containing block is RTL (from `vertical-rl`), so that reversal presumably means we need to add offsets rather than subtract them, or something along those lines.)
(In reply to Daniel Holbert [:dholbert] from comment #4)
> So this demonstrates that this is specifically an issue with us mis-handling the border and only the border (either double-counting it, or forgetting to subtract it away, or something like that) on the abspos containing block

This^ observation prompted me to look through `ReflowInput::CalculateHypotheticalPosition(` for border-specific stuff; and I found this:
```c++
  // The specified offsets are relative to the absolute containing block's
  // padding edge and our current values are relative to the border edge, so
  // translate.
  const LogicalMargin border = aCBReflowInput->ComputedLogicalBorder(wm);
  aHypotheticalPos.mIStart -= border.IStart(wm);
  aHypotheticalPos.mBStart -= border.BStart(wm);
```
https://searchfox.org/mozilla-central/rev/5204ea3d3dac5832075fb61d9689dd7879ed91b2/layout/generic/ReflowInput.cpp#1389-1394

As a hacky-experiment, I tried changing the first `-=` to `+=` -- and that makes my attached testcase 1 and testcase 2 render as-expected!

So I suspect this is a case where we need to see if the corresponding writing-mode axes have the same "polarity" vs. if they disagree.  (In this testcase, `wm`'s inline-axis is LTR, whereas the corresponding axis in the abspos containing block is RTL (from `vertical-rl`), so that reversal presumably means we need to add offsets rather than subtract them, or something along those lines.)

Back to Bug 1765668 Comment 6