New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
www.lazada.com.ph - Star rating UI elements are not properly displayed #28130
Comments
<li>
<div class="container-star progress-title" style="width:79.80000000000001px;height:15.96px">
<img class="star" src="//laz-img-cdn.alicdn.com/tfs/TB19ZvEgfDH8KJjy1XcXXcpdXXa-64-64.png" style="width:15.96px;height:15.96px">
<img class="star" src="//laz-img-cdn.alicdn.com/tfs/TB19ZvEgfDH8KJjy1XcXXcpdXXa-64-64.png" style="width:15.96px;height:15.96px">
<img class="star" src="//laz-img-cdn.alicdn.com/tfs/TB19ZvEgfDH8KJjy1XcXXcpdXXa-64-64.png" style="width:15.96px;height:15.96px">
<img class="star" src="//laz-img-cdn.alicdn.com/tfs/TB19ZvEgfDH8KJjy1XcXXcpdXXa-64-64.png" style="width:15.96px;height:15.96px">
<img class="star" src="//laz-img-cdn.alicdn.com/tfs/TB19ZvEgfDH8KJjy1XcXXcpdXXa-64-64.png" style="width:15.96px;height:15.96px">
</div>
<span class="progress-wrap">
<div class="pdp-review-progress">
<div class="bar bg"></div>
<div class="bar fg" style="width:80%"></div>
</div>
</span>
<span class="percent">8</span>
</li> The size seems to be dynamically adjusted given the values into each style attribute. The width of the wrapper is
which makes it really tight and subject to any pixels rounding issue. for example if I set it to be
which makes a diffference of This is computed here: o(t, [
{
key: "select",
value: function(e) {
var t = this.props.onSelect;
t && t(e);
}
},
{
key: "render",
value: function() {
var e = this,
t = this.props,
a = t.size,
r = void 0 === a ? 12 : a,
o = t.score,
n = void 0 === o ? 0 : o,
l = t.className,
s = void 0 === l ? "" : l,
c = [
"//laz-img-cdn.alicdn.com/tfs/TB15K7RdOqAXuNjy1XdXXaYcVXa-64-64.png",
"//laz-img-cdn.alicdn.com/tfs/TB17MwRdOqAXuNjy1XdXXaYcVXa-64-64.png",
"//laz-img-cdn.alicdn.com/tfs/TB16MwRdOqAXuNjy1XdXXaYcVXa-64-64.png",
"//laz-img-cdn.alicdn.com/tfs/TB16gwRdOqAXuNjy1XdXXaYcVXa-64-64.png",
"//laz-img-cdn.alicdn.com/tfs/TB13svEgfDH8KJjy1XcXXcpdXXa-64-64.png",
"//laz-img-cdn.alicdn.com/tfs/TB14IvEgfDH8KJjy1XcXXcpdXXa-64-64.png",
"//laz-img-cdn.alicdn.com/tfs/TB14buYglfH8KJjy1XbXXbLdXXa-64-64.png",
"//laz-img-cdn.alicdn.com/tfs/TB19svEgfDH8KJjy1XcXXcpdXXa-64-64.png",
"//laz-img-cdn.alicdn.com/tfs/TB14HuYglfH8KJjy1XbXXbLdXXa-64-64.png"
],
u =
"//laz-img-cdn.alicdn.com/tfs/TB18ZvEgfDH8KJjy1XcXXcpdXXa-64-64.png",
d = ("" + n).split("."),
f = u,
p = parseInt(d[0]),
h = parseInt((d[1] && d[1].charAt(0)) || 0),
m = 1.33 * r;
return i.default.createElement(
"div",
{
className: "container-star " + s,
style: {
width: 5 * m + "px",
height: m + "px"
}
},
[1, 2, 3, 4, 5].map(function(t, a) {
return (
(f =
p >= t
? "//laz-img-cdn.alicdn.com/tfs/TB19ZvEgfDH8KJjy1XcXXcpdXXa-64-64.png"
: p === t - 1 && h > 0
? c[h - 1]
: u),
i.default.createElement("img", {
key: a,
className: "star",
src: f,
style: {
width: m + "px",
height: m + "px"
},
onClick: function() {
e.select(t);
}
})
);
})
);
}
}
]),
t
);
so
which I guess for chrome with the rounding issues gives The computed sizes as displayed in the layout with Chrome
Firefox
I guess the main difference is here in the layout. @dholbert Can we consider this acceptable differences? Of should it be the same values? TO NOTE: If they remove the width constraint on the container. Everything is working. /* pc-mod.css | https://laz-g-cdn.alicdn.com/lzdfe/pdp-modules/1.0.13/pc-mod.css */
.pdp-mod-review .mod-rating .detail li .progress-title {
/* display: inline-block; */
display: inline-flex;
} I'm pushing to needscontact. |
Yeah, Firefox's layout engine doesn't support CSS sizes with a fine enough precision to represent exact hundredths-of-a-pixel. We use a fixed point representation which rounds to the nearest 60th of a pixel. So, if the site has We have https://bugzilla.mozilla.org/show_bug.cgi?id=265084 filed on thinking about changing our representation, but it's unlikely to happen soon. So for now, we should recommend that sites avoid depending on fine-tuned barely-fitting layout arithmetic with hardcoded hundredth-of-a-pixel sizes. |
And in particular: if a site wants to precisely divide up a width into N equal chunks, the most reliable way to do that is using CSS Flexbox. E.g. if they restyle the wrapper here to have |
URL: https://www.lazada.com.ph/products/bose-soundsport-free-wireless-headphones-midnight-blue-i156795182-s189140091.html?spm=a2o6y.10450891.0.0.3045c92ejLfoVR
Browser / Version: Firefox Nightly 68.0a1 (2019-03-20)
Operating System: Windows 10 Pro
Tested Another Browser: Yes
Problem type: Design is broken
Description: Star rating UI elements are not properly displayed
Steps to Reproduce:
Expected Behavior:
The star components of each UI element must be inline.
Actual Behavior:
The last component of each element is displayed on a different line.
Notes:
Affected area:
Watchers:
@softvision-oana-arbuzov
@softvision-sergiulogigan
@cipriansv
sv;
Browser Configuration
From webcompat.com with ❤️
The text was updated successfully, but these errors were encountered: