Closed
Bug 1246860
Opened 8 years ago
Closed 8 years ago
stockx.com listing pages are blank on Firefox but show full listing on Chrome
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla47
People
(Reporter: jaws, Assigned: mrrrgn)
References
Details
(Keywords: regression, site-compat)
Attachments
(4 files, 2 obsolete files)
66.97 KB,
image/png
|
Details | |
346.07 KB,
image/png
|
Details | |
504.36 KB,
image/png
|
Details | |
6.31 KB,
patch
|
lizzard
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
STR: Visit https://stockx.com/jordan-11-retro-72-10 ER: See details of shoe for sale AR: Large blank area in the middle of the page. See attached screenshots for comparison.
Reporter | ||
Comment 1•8 years ago
|
||
I also tried disabling tracking protection but that didn't fix it.
Reporter | ||
Comment 2•8 years ago
|
||
Reporter | ||
Comment 3•8 years ago
|
||
Reporter | ||
Comment 4•8 years ago
|
||
[Tracking Requested - why for this release]: notable regression in webcompat, looks like the issue is somewhere in React which is heavily used by web developers
Blocks: 715181
tracking-firefox46:
--- → ?
Reporter | ||
Comment 5•8 years ago
|
||
I used mozregression and narrowed this down to bug 715181. Can you take a look at this Morgan?
Flags: needinfo?(winter2718)
Do you have "Uncaught TypeError: Cannot read property 'subtitle' of undefined" ? This patch uses sparse arrays and sorts them on line 118832 of https://stockx.com/skin/frontend/grails/default/public/js/script.js?v=c7bed6b7588fd1536c5070c3f4e5f3df Current impl. patches holes in sparse arrays: ``` [,,,,,,,,,,,,,,,,,,,,{size: 1},{size: 2}].sort(function (a, b) { return +a.size - +b.size; }) ```
Reporter | ||
Comment 7•8 years ago
|
||
No, I get `TypeError: option is undefined` at script.js line 118837.
> 118834 options.sort(function (a, b) {
> 118835 return +a.size - +b.size;
> 118836 }).forEach(function (option) {
> 118837 var hasVal = option.subtitle && +option.subtitle > 0;
> 118838 var optionClasses = (0, _classnames2['default'])('select-option', { 'no-val': !hasVal }, { 'active': option.selected }, { 'all': option.title == 'All' || option.title == 'Size' });
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → winter2718
Flags: needinfo?(winter2718)
Updated•8 years ago
|
Assignee: winter2718 → nobody
status-firefox44:
--- → unaffected
status-firefox45:
--- → unaffected
status-firefox46:
--- → affected
status-firefox47:
--- → affected
Updated•8 years ago
|
Keywords: regression,
site-compat
Assignee | ||
Comment 9•8 years ago
|
||
Working up a patch for this today. Custom comparators now trigger a different sorting algorithm, and it's not handling holes properly: js> [,,,,,,,,,,,,,,,,,,,,{size: 1},{size: 2}].sort() [{size:1}, {size:2}, , , , , , , , , , , , , , , , , , , , ,] js> [,,,,,,,,,,,,,,,,,,,,{size: 1},{size: 2}].sort((a, b) => {+a.size - +b.size}); [{size:1}, {size:2}, (void 0), (void 0), (void 0), (void 0), (void 0), (void 0), (void 0), (void 0), (void 0), (void 0), (void 0), (void 0), (void 0), (void 0), (void 0), (void 0), (void 0), (void 0), (void 0), (void 0)] js> [,,,,,,,,,,,,,,,,,,,,{size: 1},{size: 2}].sort().forEach((o)=>{print(o)}); [object Object] [object Object] js> [,,,,,,,,,,,,,,,,,,,,{size: 1},{size: 2}].sort((a, b)=>{+a.size - +b.size}).forEach((o)=>{print(o)}); [object Object] [object Object] undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined
Status: ASSIGNED → NEW
status-firefox44:
unaffected → ---
status-firefox45:
unaffected → ---
status-firefox46:
affected → ---
status-firefox47:
affected → ---
Keywords: regression,
site-compat
Assignee | ||
Comment 10•8 years ago
|
||
Apologies. The sorting algorithm was not preserving holes, instead they were being converted to void(0) which always evaluates to undefined.
Attachment #8717521 -
Flags: review?(till)
Assignee | ||
Comment 11•8 years ago
|
||
Comment on attachment 8717521 [details] [diff] [review] holes.diff Review of attachment 8717521 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/builtin/Sorting.js @@ +76,2 @@ > lBuffer[i] = array[start + i]; > + } Unnecessary leftover, removed locally.
Assignee | ||
Comment 12•8 years ago
|
||
Confirmation screenshot.
Comment 13•8 years ago
|
||
Comment on attachment 8717521 [details] [diff] [review] holes.diff Review of attachment 8717521 [details] [diff] [review]: ----------------------------------------------------------------- r=me with feedback addressed. ::: js/src/builtin/Sorting.js @@ +79,2 @@ > rBuffer[j] = array[mid + 1 + j]; > + } Here too, I assume. @@ +108,5 @@ > } > > +// Helper function for overwriting a sparce array with a > +// dense array, filling remaining slots with holes. > +function MoveHoles(sparce, sparceLen, dense, denseLen) { s/sparce/sparse/g @@ +112,5 @@ > +function MoveHoles(sparce, sparceLen, dense, denseLen) { > + for (var i in dense) > + sparce[i] = dense[i]; > + for (var j = denseLen; j < sparceLen; j++) > + delete sparce[j]; I wonder if it'd be faster to shrink and then re-grow the array. Would only be valid on genuine Arrays, of course, but might be worth it. @@ +121,5 @@ > + // To save effort we will do all of our work on a dense array, > + // then create holes at the end. > + var denseArray = []; > + var denseLen = 0; > + for (var i in array) This needs braces. @@ +123,5 @@ > + var denseArray = []; > + var denseLen = 0; > + for (var i in array) > + if (i in array) > + denseArray[denseLen++] = array[i]; This needs to use _DefineDataProperty instead of brackets. Otherwise a setter on Array.prototype can observe and change behavior here. Please add a test that would've caught this. @@ +144,2 @@ > var mid, end, endOne, endTwo; > + for (var windowSize = 1; windowSize < denseLen; windowSize = 2*windowSize) { Pre-existing, but because I just see it: spaces around the * please. ::: js/src/tests/ecma_6/Array/sort_holes.js @@ +1,2 @@ > +/* Any copyright is dedicated to the Public Domain. > + * http://creativecommons.org/licenses/publicdomain/ */ No need to remove it but for future reference: PD is the default license for tests, so they don't need a header at all.
Attachment #8717521 -
Flags: review?(till) → review+
Updated•8 years ago
|
Component: Desktop → JavaScript Engine
Product: Tech Evangelism → Core
Assignee | ||
Comment 14•8 years ago
|
||
Pushing after the try push looks good: https://treeherder.mozilla.org/#/jobs?repo=try&revision=58aa065e2c25
Comment 16•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/3821b8259c65
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox47:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Comment 17•8 years ago
|
||
This seems to have caused an 11% regression on ss-tagcloud: More details: http://arewefastyet.com/regressions/#/regression/1802490 Morgan, is there perhaps a way to speed this up / only do the work if it's required? We have an intrinsic for checking if an array is dense, might be worth using that here.
Flags: needinfo?(winter2718)
Assignee | ||
Comment 18•8 years ago
|
||
(In reply to Till Schneidereit [:till] from comment #17) > This seems to have caused an 11% regression on ss-tagcloud: > More details: http://arewefastyet.com/regressions/#/regression/1802490 > > Morgan, is there perhaps a way to speed this up / only do the work if it's > required? We have an intrinsic for checking if an array is dense, might be > worth using that her I really did a number on Array.sort, yikes. I have some ideas for speeding this up. Plan on working on it in bug: 1247283
Flags: needinfo?(winter2718)
Assignee | ||
Comment 19•8 years ago
|
||
* bug 1247283
Assignee | ||
Comment 21•8 years ago
|
||
(In reply to Liz Henry (:lizzard) (needinfo? me) from comment #20) > Does this affect 46 as well? Oy, just checked on my dev edition. It does indeed.
Flags: needinfo?(winter2718)
Comment 22•8 years ago
|
||
Tracking for 46 since this is a regression from 46. Did you sort out the performance issue? Once you have let's uplift that work to 46.
Assignee | ||
Comment 23•8 years ago
|
||
Yes, the patches associated with Bug 1246860 and Bug 1247283 solve this issue.
Comment 24•8 years ago
|
||
OK, we should uplift those patches to 46 then.... Untracking here and tracking in the bugs you mention.
Comment 25•8 years ago
|
||
Wait, one of the bugs you mention is this bug. Can you request uplift on the patches in this bug, and bug 1247283, to aurora, so they'll be fixed in 46 when it releases? Tracking this bug again for 46....
Flags: needinfo?(winter2718)
Assignee | ||
Updated•8 years ago
|
Flags: needinfo?(winter2718)
Target Milestone: mozilla47 → mozilla46
Assignee | ||
Comment 26•8 years ago
|
||
Attachment #8717521 -
Attachment is obsolete: true
Assignee | ||
Comment 27•8 years ago
|
||
Comment on attachment 8723429 [details] [diff] [review] holes.diff Approval Request Comment [Feature/regressing bug #]: 1246860 [User impact if declined]: Many sites broken (web frameworks affected). [Describe test coverage new/current, TreeHerder]: Unit tests are included. See the bug description for an example of an affected web page. [Risks and why]: Breaks the web. [String/UUID change made/needed]:
Attachment #8723429 -
Flags: approval-mozilla-aurora?
Assignee | ||
Comment 28•8 years ago
|
||
(In reply to Liz Henry (:lizzard) (needinfo? me) from comment #25) > Wait, one of the bugs you mention is this bug. Can you request uplift on the > patches in this bug, and bug 1247283, to aurora, so they'll be fixed in 46 > when it releases? > Tracking this bug again for 46.... I've requested uplift for the patch here (holes.diff) and the one on bug 1247283 (arrayperf.diff) along with a note specifying that they should be applied in the order: holes.diff then arrayperf.diff Let me know if I need to take further actions.
Target Milestone: mozilla46 → mozilla47
Assignee | ||
Comment 29•8 years ago
|
||
(In reply to Liz Henry (:lizzard) (needinfo? me) from comment #25) > Wait, one of the bugs you mention is this bug. Can you request uplift on the > patches in this bug, and bug 1247283, to aurora, so they'll be fixed in 46 > when it releases? > Tracking this bug again for 46.... I've requested uplift for the patch here (holes.diff) and the one on bug 1247283 (arrayperf.diff) along with a note specifying that they should be applied in the order: holes.diff then arrayperf.diff Let me know if I need to take further actions.
Assignee | ||
Comment 30•8 years ago
|
||
Attachment #8723429 -
Attachment is obsolete: true
Attachment #8723429 -
Flags: approval-mozilla-aurora?
Assignee | ||
Comment 31•8 years ago
|
||
Comment on attachment 8723434 [details] [diff] [review] holes.diff Approval Request Comment [Feature/regressing bug #]: 1246860 [User impact if declined]: Many sites broken (web frameworks affected). [Describe test coverage new/current, TreeHerder]: Unit tests are included. See the bug description for an example of an affected web page. [Risks and why]: [String/UUID change made/needed]:
Attachment #8723434 -
Flags: approval-mozilla-aurora?
Comment 32•8 years ago
|
||
Comment on attachment 8723434 [details] [diff] [review] holes.diff Fix for a regression from 46, includes tests, please uplift to aurora
Attachment #8723434 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•8 years ago
|
Keywords: regression,
site-compat
Comment 33•8 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-aurora/rev/4f3bb934fb37
Updated•8 years ago
|
Version: unspecified → 46 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•