@breakside/jskit 2022.7.1 → 2022.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Frameworks/DOM.jsframework/Info.json +2 -2
- package/Frameworks/DOM.jsframework/io.breakside.JSKit.DOM-bundle.js +2 -2
- package/Frameworks/FontKit.jsframework/Info.json +2 -2
- package/Frameworks/FontKit.jsframework/JS/FNTFontDescriptor.js +9 -6
- package/Frameworks/FontKit.jsframework/io.breakside.JSKit.FontKit-bundle.js +2 -2
- package/Frameworks/Foundation.jsframework/Info.json +2 -2
- package/Frameworks/Foundation.jsframework/JS/JSEnvironment.js +5 -0
- package/Frameworks/Foundation.jsframework/JS/JSHTMLHTTPClient.js +9 -1
- package/Frameworks/Foundation.jsframework/JS/JSImage.js +12 -5
- package/Frameworks/Foundation.jsframework/JS/JSURLResponse.js +10 -0
- package/Frameworks/Foundation.jsframework/JS/JSXMLParser.js +81 -8
- package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
- package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
- package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
- package/Info.json +2 -2
- package/Node/io.breakside.jskit-bundle.js +2 -2
- package/Root/Frameworks/APIKit/Info.yaml +1 -1
- package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
- package/Root/Frameworks/AuthKit/Info.yaml +1 -1
- package/Root/Frameworks/CSSOM/Info.yaml +1 -1
- package/Root/Frameworks/ChartKit/Info.yaml +1 -1
- package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
- package/Root/Frameworks/DBKit/Info.yaml +1 -1
- package/Root/Frameworks/DOM/Info.yaml +1 -1
- package/Root/Frameworks/Dispatch/Info.yaml +1 -1
- package/Root/Frameworks/Dispatch/JSHTMLDispatchQueue.js +4 -2
- package/Root/Frameworks/FontKit/FNTFontDescriptor.js +9 -6
- package/Root/Frameworks/FontKit/Info.yaml +1 -1
- package/Root/Frameworks/Foundation/Info.yaml +1 -1
- package/Root/Frameworks/Foundation/JSEnvironment.js +5 -0
- package/Root/Frameworks/Foundation/JSHTMLHTTPClient.js +9 -1
- package/Root/Frameworks/Foundation/JSImage.js +12 -5
- package/Root/Frameworks/Foundation/JSURLResponse.js +10 -0
- package/Root/Frameworks/Foundation/JSXMLParser.js +81 -8
- package/Root/Frameworks/ImageKit/Info.yaml +1 -1
- package/Root/Frameworks/MediaKit/Info.yaml +1 -1
- package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
- package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
- package/Root/Frameworks/PDFKit/Info.yaml +1 -1
- package/Root/Frameworks/QRKit/Info.yaml +1 -1
- package/Root/Frameworks/SearchKit/Info.yaml +1 -1
- package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
- package/Root/Frameworks/ServerKit/Info.yaml +1 -1
- package/Root/Frameworks/ServerKit/SKHTTPServer+Node.js +8 -0
- package/Root/Frameworks/ServerKit/SKNodeHTTPRequest.js +3 -0
- package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
- package/Root/Frameworks/TestKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKit/UIApplication.js +15 -1
- package/Root/Frameworks/UIKit/UICollectionView.js +93 -34
- package/Root/Frameworks/UIKit/UICollectionViewCell.js +11 -1
- package/Root/Frameworks/UIKit/UICollectionViewLayout.js +1 -1
- package/Root/Frameworks/UIKit/UIDraggingSession.js +7 -0
- package/Root/Frameworks/UIKit/UIHTMLWindowServer.js +13 -1
- package/Root/Frameworks/UIKit/UIScrollView.js +15 -12
- package/Root/Frameworks/UIKit/UISegmentedControl.js +15 -0
- package/Root/Frameworks/UIKit/UITabView.js +5 -6
- package/Root/Frameworks/UIKit/UIWindow.js +21 -0
- package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.DOM",
|
|
4
|
-
"JSBundleVersion": "2022.
|
|
4
|
+
"JSBundleVersion": "2022.20.0",
|
|
5
5
|
"JSDevelopmentLanguage": "en",
|
|
6
6
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
7
7
|
"JSBundleEnvironments": {
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
"node": "DOM+Node.js"
|
|
10
10
|
},
|
|
11
11
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
12
|
-
"GitRevision": "
|
|
12
|
+
"GitRevision": "77c03ed85e862b4c68c6d2961cdc7cdcf82f0d85"
|
|
13
13
|
}
|
|
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.DOM'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "framework",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.JSKit.DOM",
|
|
6
|
-
"JSBundleVersion": "2022.
|
|
6
|
+
"JSBundleVersion": "2022.20.0",
|
|
7
7
|
"JSDevelopmentLanguage": "en",
|
|
8
8
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
9
9
|
"JSBundleEnvironments": {
|
|
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.DOM'] = {
|
|
|
11
11
|
"node": "DOM+Node.js"
|
|
12
12
|
},
|
|
13
13
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
14
|
-
"GitRevision": "
|
|
14
|
+
"GitRevision": "77c03ed85e862b4c68c6d2961cdc7cdcf82f0d85"
|
|
15
15
|
},
|
|
16
16
|
"Resources": [],
|
|
17
17
|
"ResourceLookup": {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.FontKit",
|
|
4
|
-
"JSBundleVersion": "2022.
|
|
4
|
+
"JSBundleVersion": "2022.20.0",
|
|
5
5
|
"JSDevelopmentLanguage": "en",
|
|
6
6
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
7
7
|
"JSBundleEnvironments": {
|
|
8
8
|
"html": "FontKit+HTML.js"
|
|
9
9
|
},
|
|
10
10
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
11
|
-
"GitRevision": "
|
|
11
|
+
"GitRevision": "77c03ed85e862b4c68c6d2961cdc7cdcf82f0d85"
|
|
12
12
|
}
|
|
@@ -42,13 +42,16 @@ JSClass("FNTFontDescriptor", JSDataFontDescriptor, {
|
|
|
42
42
|
}
|
|
43
43
|
var os2 = this.font.tables['OS/2'];
|
|
44
44
|
if (os2){
|
|
45
|
-
this._weight = Math.floor(os2.
|
|
46
|
-
this._style = (os2.
|
|
45
|
+
this._weight = Math.floor(os2.usWeightClass / 100) * 100;
|
|
46
|
+
this._style = (os2.fsSelection & 0x1) ? JSFont.Style.italic : JSFont.Style.normal;
|
|
47
|
+
}
|
|
48
|
+
var name = font.tables.name;
|
|
49
|
+
if (name){
|
|
50
|
+
this._family = name.family;
|
|
51
|
+
this._postScriptName = name.postscript;
|
|
52
|
+
this._face = name.face;
|
|
53
|
+
this._name = name.fullName;
|
|
47
54
|
}
|
|
48
|
-
// this._family
|
|
49
|
-
// this._name
|
|
50
|
-
// this._face
|
|
51
|
-
// this._postScriptName
|
|
52
55
|
this._characterToGlyphMap = {};
|
|
53
56
|
this._glyphToCharacterMap = {};
|
|
54
57
|
},
|
|
@@ -3,14 +3,14 @@ JSBundle.bundles['io.breakside.JSKit.FontKit'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "framework",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.JSKit.FontKit",
|
|
6
|
-
"JSBundleVersion": "2022.
|
|
6
|
+
"JSBundleVersion": "2022.20.0",
|
|
7
7
|
"JSDevelopmentLanguage": "en",
|
|
8
8
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
9
9
|
"JSBundleEnvironments": {
|
|
10
10
|
"html": "FontKit+HTML.js"
|
|
11
11
|
},
|
|
12
12
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
13
|
-
"GitRevision": "
|
|
13
|
+
"GitRevision": "77c03ed85e862b4c68c6d2961cdc7cdcf82f0d85"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [],
|
|
16
16
|
"ResourceLookup": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.Foundation",
|
|
4
|
-
"JSBundleVersion": "2022.
|
|
4
|
+
"JSBundleVersion": "2022.20.0",
|
|
5
5
|
"JSDevelopmentLanguage": "en",
|
|
6
6
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
7
7
|
"JSBundleEnvironments": {
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
"node": "Foundation+Node.js"
|
|
10
10
|
},
|
|
11
11
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
12
|
-
"GitRevision": "
|
|
12
|
+
"GitRevision": "77c03ed85e862b4c68c6d2961cdc7cdcf82f0d85"
|
|
13
13
|
}
|
|
@@ -112,6 +112,11 @@ JSClass("JSEnvironment", JSObject, {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
return null;
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
booleanForName: function(name){
|
|
118
|
+
var stringValue = this.stringForName(name);
|
|
119
|
+
return (stringValue === 'true' || stringValue === '1' || stringValue === 'yes' || stringValue === 'on');
|
|
115
120
|
}
|
|
116
121
|
|
|
117
122
|
});
|
|
@@ -38,7 +38,15 @@ JSClass("JSHTMLHTTPClient", JSObject, {
|
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
var failEventHandler = function(e){
|
|
41
|
-
|
|
41
|
+
if (e.type == "error"){
|
|
42
|
+
complete(new Error("XMLHttpRequest error (network down, timeout, CORS, etc)"));
|
|
43
|
+
}else if (e.type == "timeout"){
|
|
44
|
+
complete(new Error("XMLHttpRequest timeout"));
|
|
45
|
+
}else if (e.type == "abort"){
|
|
46
|
+
complete(new Error("XMLHttpRequest aborted"));
|
|
47
|
+
}else{
|
|
48
|
+
complete(new Error("XMLHttpRequest failed with event: " + e.type));
|
|
49
|
+
}
|
|
42
50
|
};
|
|
43
51
|
try {
|
|
44
52
|
var response = null;
|
|
@@ -417,7 +417,7 @@ _JSDataImage.sizeFromSVGData = function(data){
|
|
|
417
417
|
size.width = px(attrs.width);
|
|
418
418
|
size.height = px(attrs.height);
|
|
419
419
|
}else if (attrs.viewBox){
|
|
420
|
-
var box = attrs.viewBox.split(/\s+/).map(function(n){ parseInt(n); });
|
|
420
|
+
var box = attrs.viewBox.split(/\s+/).map(function(n){ return parseInt(n); });
|
|
421
421
|
size.width = box[2];
|
|
422
422
|
size.height = box[3];
|
|
423
423
|
}
|
|
@@ -449,14 +449,21 @@ JSClass("_JSURLImage", JSImage, {
|
|
|
449
449
|
|
|
450
450
|
getData: function(completion, target){
|
|
451
451
|
if (!completion){
|
|
452
|
-
completion = Promise.completion(Promise.
|
|
452
|
+
completion = Promise.completion(Promise.rejectNonNullSecondArgument);
|
|
453
453
|
}
|
|
454
454
|
var session = JSURLSession.shared;
|
|
455
455
|
var task = session.dataTaskWithURL(this.url, function(error){
|
|
456
|
-
if (error !== null
|
|
457
|
-
completion.call(target, null);
|
|
456
|
+
if (error !== null){
|
|
457
|
+
completion.call(target, null, error);
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
try{
|
|
461
|
+
task.response.assertSuccess();
|
|
462
|
+
}catch (e){
|
|
463
|
+
completion.call(target, null, e);
|
|
464
|
+
return;
|
|
458
465
|
}
|
|
459
|
-
completion.call(target, task.response.data);
|
|
466
|
+
completion.call(target, task.response.data, null);
|
|
460
467
|
});
|
|
461
468
|
task.resume();
|
|
462
469
|
return completion.promise;
|
|
@@ -163,6 +163,16 @@ JSURLResponse.StatusClass = {
|
|
|
163
163
|
serverError: 5
|
|
164
164
|
};
|
|
165
165
|
|
|
166
|
+
JSURLResponse.error = function(statusCode, object){
|
|
167
|
+
var response = JSURLResponse.init();
|
|
168
|
+
response.statusCode = statusCode;
|
|
169
|
+
if (object !== undefined){
|
|
170
|
+
response.data = JSON.stringify(object).utf8();
|
|
171
|
+
response.headerMap.add("Content-Type", response.jsonMime);
|
|
172
|
+
}
|
|
173
|
+
return new JSURLResponseError(response);
|
|
174
|
+
};
|
|
175
|
+
|
|
166
176
|
JSGlobalObject.JSURLResponseError = function(response){
|
|
167
177
|
if (this === undefined){
|
|
168
178
|
return new JSURLResponseError();
|
|
@@ -36,6 +36,7 @@ JSClass("JSXMLParser", JSObject, {
|
|
|
36
36
|
var c;
|
|
37
37
|
var lineNumber = 1;
|
|
38
38
|
var lineOffset;
|
|
39
|
+
var entityMap = JSCopy(defaultEntityMap);
|
|
39
40
|
var readToken = function(){
|
|
40
41
|
if (offset >= length){
|
|
41
42
|
return null;
|
|
@@ -131,8 +132,77 @@ JSClass("JSXMLParser", JSObject, {
|
|
|
131
132
|
return {kind: 'PI', name: name, value: readUntil('?>')};
|
|
132
133
|
}
|
|
133
134
|
if (token == '<!DOCTYPE'){
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
readWhitespace();
|
|
136
|
+
name = readName();
|
|
137
|
+
readWhitespace();
|
|
138
|
+
var doctype = {kind: 'Doctype', name: name, publicId: null, systemId: null, entities: {}};
|
|
139
|
+
if (offset < length && input[offset] !== '>'){
|
|
140
|
+
if (input[offset] != '['){
|
|
141
|
+
name = readName();
|
|
142
|
+
readWhitespace();
|
|
143
|
+
if (name == "SYSTEM"){
|
|
144
|
+
if (offset < length && (input[offset] == "'" || input[offset] == '"')){
|
|
145
|
+
doctype.systemId = readAttributeValue();
|
|
146
|
+
readWhitespace();
|
|
147
|
+
}else{
|
|
148
|
+
throw new Error("Expecting quote at " + lineNumber + ':' + (offset - lineOffset));
|
|
149
|
+
}
|
|
150
|
+
}else if (name === "PUBLIC"){
|
|
151
|
+
if (offset < length && (input[offset] == "'" || input[offset] == '"')){
|
|
152
|
+
doctype.publicId = readAttributeValue();
|
|
153
|
+
readWhitespace();
|
|
154
|
+
if (offset < length && (input[offset] == "'" || input[offset] == '"')){
|
|
155
|
+
doctype.systemId = readAttributeValue();
|
|
156
|
+
readWhitespace();
|
|
157
|
+
}else{
|
|
158
|
+
throw new Error("Expecting quote at " + lineNumber + ':' + (offset - lineOffset));
|
|
159
|
+
}
|
|
160
|
+
}else{
|
|
161
|
+
throw new Error("Expecting quote at " + lineNumber + ':' + (offset - lineOffset));
|
|
162
|
+
}
|
|
163
|
+
}else{
|
|
164
|
+
throw new Error("Expecting SYSTEM or PUBLIC at " + lineNumber + ':' + (offset - lineOffset));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (offset < length && input[offset] == '['){
|
|
168
|
+
++offset;
|
|
169
|
+
readWhitespace();
|
|
170
|
+
while (offset < length && input[offset] !== ']'){
|
|
171
|
+
token = readToken();
|
|
172
|
+
if (token == '<!'){
|
|
173
|
+
name = readName();
|
|
174
|
+
if (name === "ENTITY"){
|
|
175
|
+
readWhitespace();
|
|
176
|
+
if (offset >= length){
|
|
177
|
+
throw new Error("Expecting ENTITY name at " + lineNumber + ':' + (offset - lineOffset));
|
|
178
|
+
}
|
|
179
|
+
name = readName();
|
|
180
|
+
readWhitespace();
|
|
181
|
+
if (offset >= length){
|
|
182
|
+
throw new Error("Expecting ENTITY value at " + lineNumber + ':' + (offset - lineOffset));
|
|
183
|
+
}
|
|
184
|
+
entityMap[name] = readAttributeValue();
|
|
185
|
+
}
|
|
186
|
+
readUntil('>');
|
|
187
|
+
}else if (token == '<?'){
|
|
188
|
+
readUntil('?>');
|
|
189
|
+
}else if (token == '<!--'){
|
|
190
|
+
readUntil('-->');
|
|
191
|
+
}
|
|
192
|
+
readWhitespace();
|
|
193
|
+
}
|
|
194
|
+
if (offset >= length || input[offset] !== ']'){
|
|
195
|
+
throw new Error("Expecting ] at end of DOCTYPE at " + lineNumber + ':' + (offset - lineOffset));
|
|
196
|
+
}
|
|
197
|
+
++offset;
|
|
198
|
+
readWhitespace();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
if (offset >= length || input[offset] !== '>'){
|
|
202
|
+
throw new Error("Expecting > at end of DOCTYPE at " + lineNumber + ':' + (offset - lineOffset));
|
|
203
|
+
}
|
|
204
|
+
++offset;
|
|
205
|
+
return doctype;
|
|
136
206
|
}
|
|
137
207
|
if (token == '<![CDATA['){
|
|
138
208
|
return {kind: 'CDATA', value: readUntil(']]>')};
|
|
@@ -154,7 +224,7 @@ JSClass("JSXMLParser", JSObject, {
|
|
|
154
224
|
if (offset < length && input[offset] == '='){
|
|
155
225
|
++offset;
|
|
156
226
|
readWhitespace();
|
|
157
|
-
attributes.push({name: attrName, value: textByDecodingEntities(readAttributeValue())});
|
|
227
|
+
attributes.push({name: attrName, value: textByDecodingEntities(readAttributeValue(), entityMap)});
|
|
158
228
|
}else{
|
|
159
229
|
attributes.push({name: attrName, value: null});
|
|
160
230
|
}
|
|
@@ -189,7 +259,7 @@ JSClass("JSXMLParser", JSObject, {
|
|
|
189
259
|
++offset;
|
|
190
260
|
return {kind: 'ElementEnd', name: name};
|
|
191
261
|
}
|
|
192
|
-
return {kind: 'Text', value: textByDecodingEntities(token)};
|
|
262
|
+
return {kind: 'Text', value: textByDecodingEntities(token, entityMap)};
|
|
193
263
|
};
|
|
194
264
|
var readUntil = function(token){
|
|
195
265
|
var index = input.indexOf(token, offset);
|
|
@@ -267,7 +337,10 @@ JSClass("JSXMLParser", JSObject, {
|
|
|
267
337
|
}
|
|
268
338
|
obj = readObject();
|
|
269
339
|
var elementNameStack = [];
|
|
270
|
-
var namespaces = {
|
|
340
|
+
var namespaces = {
|
|
341
|
+
':default:': null,
|
|
342
|
+
'xml': 'http://www.w3.org/XML/1998/namespace'
|
|
343
|
+
};
|
|
271
344
|
var namespacesStack = [];
|
|
272
345
|
var hasDocumentElement = false;
|
|
273
346
|
var hasSentDoctype = false;
|
|
@@ -361,7 +434,7 @@ JSClass("JSXMLParser", JSObject, {
|
|
|
361
434
|
|
|
362
435
|
});
|
|
363
436
|
|
|
364
|
-
var textByDecodingEntities = function(text){
|
|
437
|
+
var textByDecodingEntities = function(text, map){
|
|
365
438
|
var index = text.indexOf('&');
|
|
366
439
|
var length = text.length;
|
|
367
440
|
var end;
|
|
@@ -390,7 +463,7 @@ var textByDecodingEntities = function(text){
|
|
|
390
463
|
value = String.fromCharCode(code);
|
|
391
464
|
}
|
|
392
465
|
}else{
|
|
393
|
-
value =
|
|
466
|
+
value = map[entity] || null;
|
|
394
467
|
if (value === null){
|
|
395
468
|
throw new Error("Cannot lookup entity: &" + entity + ';');
|
|
396
469
|
}
|
|
@@ -404,7 +477,7 @@ var textByDecodingEntities = function(text){
|
|
|
404
477
|
return text;
|
|
405
478
|
};
|
|
406
479
|
|
|
407
|
-
var
|
|
480
|
+
var defaultEntityMap = {
|
|
408
481
|
'lt': '<',
|
|
409
482
|
'LT': '<',
|
|
410
483
|
'gt': '>',
|
|
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.Foundation'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "framework",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.JSKit.Foundation",
|
|
6
|
-
"JSBundleVersion": "2022.
|
|
6
|
+
"JSBundleVersion": "2022.20.0",
|
|
7
7
|
"JSDevelopmentLanguage": "en",
|
|
8
8
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
9
9
|
"JSBundleEnvironments": {
|
|
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.Foundation'] = {
|
|
|
11
11
|
"node": "Foundation+Node.js"
|
|
12
12
|
},
|
|
13
13
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
14
|
-
"GitRevision": "
|
|
14
|
+
"GitRevision": "77c03ed85e862b4c68c6d2961cdc7cdcf82f0d85"
|
|
15
15
|
},
|
|
16
16
|
"Resources": [
|
|
17
17
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.SecurityKit",
|
|
4
|
-
"JSBundleVersion": "2022.
|
|
4
|
+
"JSBundleVersion": "2022.20.0",
|
|
5
5
|
"JSDevelopmentLanguage": "en",
|
|
6
6
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
7
7
|
"JSBundleEnvironments": {
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
"node": "SecurityKit+Node.js"
|
|
10
10
|
},
|
|
11
11
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
12
|
-
"GitRevision": "
|
|
12
|
+
"GitRevision": "77c03ed85e862b4c68c6d2961cdc7cdcf82f0d85"
|
|
13
13
|
}
|
|
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.SecurityKit'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "framework",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.JSKit.SecurityKit",
|
|
6
|
-
"JSBundleVersion": "2022.
|
|
6
|
+
"JSBundleVersion": "2022.20.0",
|
|
7
7
|
"JSDevelopmentLanguage": "en",
|
|
8
8
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
9
9
|
"JSBundleEnvironments": {
|
|
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.SecurityKit'] = {
|
|
|
11
11
|
"node": "SecurityKit+Node.js"
|
|
12
12
|
},
|
|
13
13
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
14
|
-
"GitRevision": "
|
|
14
|
+
"GitRevision": "77c03ed85e862b4c68c6d2961cdc7cdcf82f0d85"
|
|
15
15
|
},
|
|
16
16
|
"Resources": [],
|
|
17
17
|
"ResourceLookup": {
|
package/Info.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "node",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.jskit",
|
|
4
|
-
"JSBundleVersion": "2022.
|
|
4
|
+
"JSBundleVersion": "2022.20.0",
|
|
5
5
|
"JSExecutableName": "jskit",
|
|
6
6
|
"NPMOrganization": "breakside",
|
|
7
7
|
"JSResources": [
|
|
8
8
|
"Tests/HTMLTestRunner.js",
|
|
9
9
|
"Tests/NodeTestRunner.js"
|
|
10
10
|
],
|
|
11
|
-
"GitRevision": "
|
|
11
|
+
"GitRevision": "77c03ed85e862b4c68c6d2961cdc7cdcf82f0d85"
|
|
12
12
|
}
|
|
@@ -3,14 +3,14 @@ JSBundle.bundles['io.breakside.jskit'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "node",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.jskit",
|
|
6
|
-
"JSBundleVersion": "2022.
|
|
6
|
+
"JSBundleVersion": "2022.20.0",
|
|
7
7
|
"JSExecutableName": "jskit",
|
|
8
8
|
"NPMOrganization": "breakside",
|
|
9
9
|
"JSResources": [
|
|
10
10
|
"Tests/HTMLTestRunner.js",
|
|
11
11
|
"Tests/NodeTestRunner.js"
|
|
12
12
|
],
|
|
13
|
-
"GitRevision": "
|
|
13
|
+
"GitRevision": "77c03ed85e862b4c68c6d2961cdc7cdcf82f0d85"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [
|
|
16
16
|
{
|
|
@@ -42,13 +42,16 @@ JSClass("FNTFontDescriptor", JSDataFontDescriptor, {
|
|
|
42
42
|
}
|
|
43
43
|
var os2 = this.font.tables['OS/2'];
|
|
44
44
|
if (os2){
|
|
45
|
-
this._weight = Math.floor(os2.
|
|
46
|
-
this._style = (os2.
|
|
45
|
+
this._weight = Math.floor(os2.usWeightClass / 100) * 100;
|
|
46
|
+
this._style = (os2.fsSelection & 0x1) ? JSFont.Style.italic : JSFont.Style.normal;
|
|
47
|
+
}
|
|
48
|
+
var name = font.tables.name;
|
|
49
|
+
if (name){
|
|
50
|
+
this._family = name.family;
|
|
51
|
+
this._postScriptName = name.postscript;
|
|
52
|
+
this._face = name.face;
|
|
53
|
+
this._name = name.fullName;
|
|
47
54
|
}
|
|
48
|
-
// this._family
|
|
49
|
-
// this._name
|
|
50
|
-
// this._face
|
|
51
|
-
// this._postScriptName
|
|
52
55
|
this._characterToGlyphMap = {};
|
|
53
56
|
this._glyphToCharacterMap = {};
|
|
54
57
|
},
|
|
@@ -112,6 +112,11 @@ JSClass("JSEnvironment", JSObject, {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
return null;
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
booleanForName: function(name){
|
|
118
|
+
var stringValue = this.stringForName(name);
|
|
119
|
+
return (stringValue === 'true' || stringValue === '1' || stringValue === 'yes' || stringValue === 'on');
|
|
115
120
|
}
|
|
116
121
|
|
|
117
122
|
});
|
|
@@ -38,7 +38,15 @@ JSClass("JSHTMLHTTPClient", JSObject, {
|
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
var failEventHandler = function(e){
|
|
41
|
-
|
|
41
|
+
if (e.type == "error"){
|
|
42
|
+
complete(new Error("XMLHttpRequest error (network down, timeout, CORS, etc)"));
|
|
43
|
+
}else if (e.type == "timeout"){
|
|
44
|
+
complete(new Error("XMLHttpRequest timeout"));
|
|
45
|
+
}else if (e.type == "abort"){
|
|
46
|
+
complete(new Error("XMLHttpRequest aborted"));
|
|
47
|
+
}else{
|
|
48
|
+
complete(new Error("XMLHttpRequest failed with event: " + e.type));
|
|
49
|
+
}
|
|
42
50
|
};
|
|
43
51
|
try {
|
|
44
52
|
var response = null;
|
|
@@ -417,7 +417,7 @@ _JSDataImage.sizeFromSVGData = function(data){
|
|
|
417
417
|
size.width = px(attrs.width);
|
|
418
418
|
size.height = px(attrs.height);
|
|
419
419
|
}else if (attrs.viewBox){
|
|
420
|
-
var box = attrs.viewBox.split(/\s+/).map(function(n){ parseInt(n); });
|
|
420
|
+
var box = attrs.viewBox.split(/\s+/).map(function(n){ return parseInt(n); });
|
|
421
421
|
size.width = box[2];
|
|
422
422
|
size.height = box[3];
|
|
423
423
|
}
|
|
@@ -449,14 +449,21 @@ JSClass("_JSURLImage", JSImage, {
|
|
|
449
449
|
|
|
450
450
|
getData: function(completion, target){
|
|
451
451
|
if (!completion){
|
|
452
|
-
completion = Promise.completion(Promise.
|
|
452
|
+
completion = Promise.completion(Promise.rejectNonNullSecondArgument);
|
|
453
453
|
}
|
|
454
454
|
var session = JSURLSession.shared;
|
|
455
455
|
var task = session.dataTaskWithURL(this.url, function(error){
|
|
456
|
-
if (error !== null
|
|
457
|
-
completion.call(target, null);
|
|
456
|
+
if (error !== null){
|
|
457
|
+
completion.call(target, null, error);
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
try{
|
|
461
|
+
task.response.assertSuccess();
|
|
462
|
+
}catch (e){
|
|
463
|
+
completion.call(target, null, e);
|
|
464
|
+
return;
|
|
458
465
|
}
|
|
459
|
-
completion.call(target, task.response.data);
|
|
466
|
+
completion.call(target, task.response.data, null);
|
|
460
467
|
});
|
|
461
468
|
task.resume();
|
|
462
469
|
return completion.promise;
|