TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: I found an obscure bug with Firefox. Is it worth reporting?

5 点作者 heigh10 个月前
It’s really quite strange but when you use a “number” input field in Firefox, then validate it with RegEx, it totally flips out.<p>I can provide examples but I guess my question is, is it worth reporting these? Or will it just never get fixed?<p>Edit: spellcheck

5 条评论

toast010 个月前
IMHO, it&#x27;s worth reporting, but temper your expectations of it being fixed. I&#x27;ve seen clearly written, easily reproduced, possibly easily fixed bugs linger in Bugzilla for decades. At Mozilla and other organizations using bugzilla and other trackers.<p>Spend a day turning this into a bug report that&#x27;s up to the standards of Mozilla; <i>maybe</i> another day trying to track down the behavior and suggest a patch. File the bug, and maybe the patch, and then implement a work around and go on with your life. Sure, watch for replies and try to respond in a timely fashion, but don&#x27;t expect anything.<p>That said, I&#x27;ve put in a bugzilla bug and it got fixed in a reasonable time and then pushed in the next eligible release; <a href="https:&#x2F;&#x2F;bugzilla.mozilla.org&#x2F;show_bug.cgi?id=1740856" rel="nofollow">https:&#x2F;&#x2F;bugzilla.mozilla.org&#x2F;show_bug.cgi?id=1740856</a> but it was widely applicable, and the observed behavior was clearly broken, but details were hard to observe for many (which is why effects from the bug were observed but not diagnosed in related bugs)
runjake10 个月前
I am not super good at this and only using half my brain, but I did my best attempt to convert this to vanilla JavaScript and get seemingly odd results.<p><pre><code> &lt;!DOCTYPE html&gt; &lt;input type=&quot;number&quot; id=&quot;progress&quot; class=&quot;form-control mr-0 pr-0&quot; placeholder=&quot;Progress (%)&quot; &#x2F;&gt; &lt;script&gt; document.getElementById(&#x27;progress&#x27;).addEventListener(&#x27;change&#x27;, function() { console.log(&quot;fired!&quot;); &#x2F;&#x2F; Remove any non-numeric. let val = this.value.replace(&#x2F;[^0-9.]&#x2F;g, &#x27;&#x27;); &#x2F;&#x2F; Only one decimal point. let parts = val.split(&#x27;.&#x27;); if (parts.length &gt; 2) { val = parts[0] + &#x27;.&#x27; + parts.slice(1).join(&#x27;&#x27;); } let numVal = parseFloat(val) || 0; if (numVal &gt; 100) { numVal = 100; } else if (numVal &lt; 0) { numVal = 0; } this.value = numVal === 0 ? &#x27;&#x27; : numVal; }); &lt;&#x2F;script&gt; </code></pre> Someone educate me, especially if I am off base or the code is inherently incorrect.
评论 #41117253 未加载
42lux10 个月前
If you are going to report it like you wrote this post, you don&#x27;t need to report it.
评论 #41108444 未加载
评论 #41116079 未加载
rossng10 个月前
Yes, you should report it. I&#x27;ve reported several Firefox bugs and the tickets often spring to life suddenly after several years of sitting there unaddressed. It makes life much easier for the developers if you include a clean, easy-to-reproduce test case.
KomoD10 个月前
Honestly, you could have spent the time you used to write this post and comments on making the report instead.<p>You basically wrote the entire bug report here, instead of doing it on Bugzilla.