{"id":20386993,"url":"https://github.com/cmdcolin/technical_oddities","last_synced_at":"2025-03-04T23:25:37.188Z","repository":{"id":137213415,"uuid":"65316637","full_name":"cmdcolin/technical_oddities","owner":"cmdcolin","description":"A compilation of short descriptions of tech oddities that are weird, debunked or not","archived":false,"fork":false,"pushed_at":"2023-03-26T21:34:34.000Z","size":28,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-15T08:44:05.690Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cmdcolin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-09T17:56:51.000Z","updated_at":"2023-09-16T15:32:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"3b3c4711-0aec-4e28-afa2-0ee7b6ae4e99","html_url":"https://github.com/cmdcolin/technical_oddities","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdcolin%2Ftechnical_oddities","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdcolin%2Ftechnical_oddities/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdcolin%2Ftechnical_oddities/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdcolin%2Ftechnical_oddities/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmdcolin","download_url":"https://codeload.github.com/cmdcolin/technical_oddities/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241936988,"owners_count":20045158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T02:42:01.952Z","updated_at":"2025-03-04T23:25:37.160Z","avatar_url":"https://github.com/cmdcolin.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# technical_oddities\n\nA compilation of short descriptions of tech oddities, debunked or not\n\n## Chrome - Adding many strings together causes a crash\n\nIf you add a very large number of strings together in javascript, chrome will crash with a call stack error, but it will be very hard to find what part of the code (e.g. if this was in a larger project) generated this error because breakpoints near this error fail in DevTools\n\nTry running the following and opening it up in your browser\n\n    (echo \"\u003cscript\u003evar s='Generate a call stack error'\";for i in {1..100000}; do echo \"+' $i'\"; done; echo \"\u003c/script\u003e\")\u003eerr.html\n\nedit 2023: may not crash chrome anymore, even if increases to 1,000,000, but may have similar type of situation with many ternary https://twitter.com/cmdcolin/status/1640104370800066561\n\n## Javascript - Maximum size of a HTML5 canvas element\n\nMany browsers have a maximum size of an HTML5 canvas element, typically with any one dimension limited to the max size of a 16 bit signed int http://stackoverflow.com/questions/6081483/maximum-size-of-a-canvas-element but considerably less when considering both dimensions\n\nA quite jarring consequence though is that creating a canvas larger than allowed limits does not throw an error from the creation or the drawing to it\n\nSee also https://github.com/jhildenbiddle/canvas-size#test-results\n\n## PhantomJS - The size of the default form elements don't scale with zoomFactor\n\nUsing zoomFactor is a promising way to make a website render \"retina\" type screenshots from webpages, but using a higher zoomFactor will scale all web page elements except the size of checkboxes, radio elements, and other form elements.\n\nSource code a screenshot demonstrating issue here https://gist.github.com/cmdcolin/05a916eead041dd4288cd461b15b0197\n\nWhen you dig into it, it seems to come back to a WebKit core issues that are confusing to follow https://bugs.webkit.org/show_bug.cgi?id=51544\n\nupdate 2023: try in puppeteer...will report back\n\n## SVG - large feature sizes are not drawn\n\nExample\n\n```\n  \u003csvg width=\"1400px\" height=\"8px\"\u003e\n    \u003crect\n      data-testid=\"bb-535451550-0\"\n      x=\"-100000000\"\n      y=\"0\"\n      width=\"100000100\"\n      height=\"3.3333333333333335\"\n      fill=\"goldenrod\"\n    \u003e\u003c/rect\u003e\n  \u003c/svg\u003e\n\n```\n\nIn Chrome 83 this is not visible on the screen, but ideally would be a 100px wide box\n\n## Canvas - large clearRect does not clear region properly\n\nSimilar to the above SVG issue, performing something similar, clearing a large region from offscreen areas, with clearRect also fails on canvas\n\n```\n// this fails and the red bar disappears\nconst elt = document.getElementById(\"cnv\"); // canvas with width=1000 height=10\nconst ctx = elt.getContext(\"2d\");\nctx.fillStyle = \"#f00a\";\nctx.fillRect(0, 0, 1000, 10, 10);\nctx.clearRect(-94504.1, 0, 29790.800000000003, 7);\n\n// this works and the green bar does not disappear\nconst elt2 = document.getElementById(\"cnv2\"); // canvas with width=1000 height=100\nconst ctx2 = elt2.getContext(\"2d\");\nctx2.fillStyle = \"#0f0a\";\nctx2.fillRect(0, 0, 1000, 10, 10);\nctx2.clearRect(-94504.1, 0, 29790.800000000003, 7);\n```\n\nSee \n\nhttps://bugs.chromium.org/p/chromium/issues/detail?id=1131528#c_ts1602745683\nhttps://codesandbox.io/s/sleepy-fermi-lhy2f?file=/src/index.js\n\n## Can only store 2^24 elements in Map or ~2^23 in regular JS object\n\nSee https://searchvoidstar.tumblr.com/post/659634228574715904/an-amazing-error-message-if-you-put-more-than-2-24\n\nOnly affects some platforms e.g. V8\n\n\n### Chrome - The maximum string length is 512MB. If you use TextDecoder it returns silently if exceeded\n\nSee https://cmdcolin.github.io/2021-10-30-spooky.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmdcolin%2Ftechnical_oddities","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmdcolin%2Ftechnical_oddities","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmdcolin%2Ftechnical_oddities/lists"}