[Webkit-unassigned] [Bug 277733] forum.vbulletin.com: Banner expand differently in Safari

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 13 07:17:41 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=277733

--- Comment #5 from Karl Dubost <karlcow at apple.com> ---
Created attachment 472137

  --> https://bugs.webkit.org/attachment.cgi?id=472137&action=review

devtools getClientRects differences

```
    function ot(e, t, n) {
      var r = Xe(e),
      i = (!le.boxSizingReliable() || n) &&
      'border-box' === ce.css(e, 'boxSizing', !1, r),
      o = i,
      a = Ge(e, t, r),
      s = 'offset' + t[0].toUpperCase() + t.slice(1);
      if (_e.test(a)) {
        if (!n) return a;
        a = 'auto'
      }
      return (
        !le.boxSizingReliable() &&
        i ||
        !le.reliableTrDimensions() &&
        fe(e, 'tr') ||
        'auto' === a ||
        !parseFloat(a) &&
        'inline' === ce.css(e, 'display', !1, r)
      ) &&
      e.getClientRects().length &&
      (
        i = 'border-box' === ce.css(e, 'boxSizing', !1, r),
        (o = s in e) &&
        (a = e[s])
      ),
      (a = parseFloat(a) || 0) + it(e, t, n || (i ? 'border' : 'content'), o, r, a) + 'px'
    }
```


There is a point in the code when we hit e.getClientRects(), we can already see differences. 

When Firefox returns a list of 12 DOMRect
Safari returns a list of 3. 

e is the HTML span element. 
and in both cases e.childNodes returns a list of 10 nodes.

but then the value is extracted from

```
a = e[s]
```

where `e` is still the span
and `s` is 'offsetWidth'

in Firefox and for the width of my windows:
a = 479

in Safari
a = 0

So then later it goes specifying the width to be 0 on the block with a style attribute, hence the difference of behavior in between Firefox/Chrome and Safari. 


So two possible sources of bugs:
* getClientRects()
* offsetWidth

Let's create a test case

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240813/7b2aff2e/attachment.htm>


More information about the webkit-unassigned mailing list