Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v120 #250

Merged
merged 4 commits into from
Sep 27, 2023
Merged

v120 #250

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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