Open Bug 1140412 Opened 9 years ago Updated 2 years ago

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

Categories

(Core :: DOM: Core & HTML, defect, P5)

x86
macOS
defect

Tracking

()

People

(Reporter: bzbarsky, Unassigned)

References

Details

(Keywords: regression)

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.
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven't been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.