Skip to content

Commit

Permalink
v120 (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorin-Oakenpants authored Sep 27, 2023
1 parent 9cca1b5 commit d748695
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
3 changes: 2 additions & 1 deletion js/generic.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,14 +397,15 @@ const get_isVer = () => new Promise(resolve => {
}
isVer = verNo
if (verNo < 102) {isVerExtra = " or lower"
} else if (verNo == 119) {isVerExtra = "+"}
} else if (verNo == 120) {isVerExtra = "+"}
log_perf(SECTG, "isVer", t0, "", isVer + isVerExtra)
return resolve()
}
output(cascade())

function cascade() {
try {
if ("function" === typeof CSSPropertyRule) return 120 // 1854937
try {location.href = "http://a>b/"} catch(e) {if (e.name === "SyntaxError") return 119} // 1817591
if (CSS2Properties.prototype.hasOwnProperty("fontSynthesisPosition")) return 118 // 1849010
if (CanvasRenderingContext2D.prototype.hasOwnProperty("fontStretch")) return 117 // 1842467
Expand Down
9 changes: 7 additions & 2 deletions tests/testgeneric.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,12 @@ const get_isTB = () => new Promise(resolve => {
// extensions can block resources://
// FF ~5ms, TB ~20ms
setTimeout(() => resolve(false), 100)

let source = "resource://torbutton-assets/aboutTor.css"
// ToDo: TB13+: does not work on android
if (CanvasRenderingContext2D.prototype.hasOwnProperty("letterSpacing")) {source = "chrome://browser/content/abouttor/aboutTor.css"} // FF115+
let css = document.createElement("link")
css.href = "resource://torbutton-assets/aboutTor.css"
css.href = source
css.type = "text/css"
css.rel = "stylesheet"
document.head.appendChild(css)
Expand Down Expand Up @@ -379,7 +383,8 @@ const get_isVer = () => new Promise(resolve => {
output(cascade())

function cascade() {
isVerMax = 119
isVerMax = 120
if ("function" === typeof CSSPropertyRule) return 120 // 1854937
try {location.href = "http://a>b/"} catch(e) {if (e.name === "SyntaxError") return 119} // 1817591
if ("function" === typeof CSS2Properties && CSS2Properties.prototype.hasOwnProperty("fontSynthesisPosition")) return 118 // 1849010
if (CanvasRenderingContext2D.prototype.hasOwnProperty("fontStretch")) return 117 // 1842467
Expand Down
8 changes: 6 additions & 2 deletions tests/versions.html
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
if (debug.length) {dom.debug.innerHTML = debug.join("<br>")}
}

let countTZP = 0, expectTZP = 70, maxVer = 119, oTZP = {}, oResults = {}
let countTZP = 0, expectTZP = 71, maxVer = 120, oTZP = {}, oResults = {}
function run_tzp() {
// start global timer
gTZP = performance.now()
Expand Down Expand Up @@ -277,12 +277,16 @@
offsetPosition : layout.css.motion-path-offset-position.enabled
*/

// 120: 1854937
let t120 = performance.now()
let ver120 = ("function" === typeof CSSPropertyRule)
rec(120, 120, "1854937", ver120, performance.now()-t120)

// 119: 1817591
let t119 = performance.now()
try {
location.href = "http://a>b/"
} catch(e) {
debug.push("119 1817591 : "+ e.name)
rec(119, 119, "1817591", e.name === "SyntaxError", performance.now()-t119)
}

Expand Down

0 comments on commit d748695

Please sign in to comment.