mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-02-04 14:33:47 +00:00
fix crash on amazon product page
This commit is contained in:
@@ -153,3 +153,11 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script id=list_caching>
|
||||||
|
{
|
||||||
|
// this ordering used to crash
|
||||||
|
const list = document.getElementsByTagName('div');
|
||||||
|
testing.expectEqual('0', list[0].textContent);
|
||||||
|
testing.expectEqual(3, list.length);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|||||||
@@ -114,8 +114,11 @@ pub fn NodeLive(comptime mode: Mode) type {
|
|||||||
if (self._last_length) |cached_length| {
|
if (self._last_length) |cached_length| {
|
||||||
return cached_length;
|
return cached_length;
|
||||||
}
|
}
|
||||||
|
// not ideal, but this can happen if list[x] is called followed
|
||||||
|
// by list.length.
|
||||||
|
self._tw.reset();
|
||||||
|
self._last_index = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we're here, it means it's either the first time we're called
|
// If we're here, it means it's either the first time we're called
|
||||||
// or the DOM version has changed. Either way, the _tw should be
|
// or the DOM version has changed. Either way, the _tw should be
|
||||||
// at the start position. It's important that self._last_index == 0
|
// at the start position. It's important that self._last_index == 0
|
||||||
|
|||||||
Reference in New Issue
Block a user