If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Inline whose first child contains no non-space characters has a 0 scrollWidth in RTL

NEW
Unassigned

Status

()

Core
DOM
3 years ago
3 years ago

People

(Reporter: bz, Unassigned)

Tracking

({regression})

Trunk
x86
Mac OS X
regression
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Testcase:

<!DOCTYPE html>
<html dir="rtl">
  <span><span></span>Some text</span>
  <pre><script>
      document.writeln(document.querySelector("span").offsetWidth);
      document.writeln(document.querySelector("span").scrollWidth);
    </script>
</html>

The problem is that scrollWidth uses GetPaddingRectRelativeToSelf on the primary frame, but doesn't include its continuations afaict.  So we get 0 in this case, because of bidi splitting.

It looks like this is a regression from bug 833542.
Flags: needinfo?(roc)
Chrome also gets 0.

The spec is unclear, since it refers to an element's "padding-edge" without specifying which fragment is meant.
http://dev.w3.org/csswg/cssom-view/#scrolling-area

I suspect exactly how inline boxes are split due to bidi is also underspecified.

So basically, I'm not sure if 0 should be considered a bug. It seems to me unlikely to matter in practice since scrollWidth is normally used on scrollable containers and an inline can't be one.
Flags: needinfo?(roc)
Note that chrome gets 0 even if the inner span is removed and even in ltr text.
You need to log in before you can comment on or make changes to this bug.