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.
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.
Note that chrome gets 0 even if the inner span is removed and even in ltr text.