@@ -60,6 +60,7 @@ public var media: String?
60
60
public var title : String ?
61
61
public var scope : String ?
62
62
public var classs : String ?
63
+ public var manifest : String ?
63
64
public var value : String ?
64
65
public var clear : String ?
65
66
public var start : String ?
@@ -85,6 +86,7 @@ public var prompt: String?
85
86
public var onfocus : String ?
86
87
public var enctype : String ?
87
88
public var onclick : String ?
89
+ public var ontouchstart : String ?
88
90
public var onkeyup : String ?
89
91
public var profile : String ?
90
92
public var version : String ?
@@ -131,6 +133,7 @@ public var onkeypress: String?
131
133
public var ondblclick : String ?
132
134
public var onmouseout : String ?
133
135
public var httpEquiv : String ?
136
+ public var dataText : String ?
134
137
public var background : String ?
135
138
public var onmousemove : String ?
136
139
public var onmouseover : String ?
@@ -334,9 +337,9 @@ var scopesBuffer = [UInt64: String]()
334
337
335
338
// swiftlint:disable cyclomatic_complexity function_body_length
336
339
private func evaluate( _ node: String , _ attrs: [ String : String ? ] = [ : ] , _ closure: Closure ) {
337
-
340
+
338
341
// Push the attributes.
339
-
342
+
340
343
let stackid = idd
341
344
let stackdir = dir
342
345
let stackrel = rel
@@ -377,6 +380,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
377
380
let stacktitle = title
378
381
let stackscope = scope
379
382
let stackclass = classs
383
+ let stackmanifest = manifest
380
384
let stackvalue = value
381
385
let stackclear = clear
382
386
let stackstart = start
@@ -402,6 +406,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
402
406
let stackonfocus = onfocus
403
407
let stackenctype = enctype
404
408
let stackonclick = onclick
409
+ let stackontouchstart = ontouchstart
405
410
let stackonkeyup = onkeyup
406
411
let stackprofile = profile
407
412
let stackversion = version
@@ -447,6 +452,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
447
452
let stackondblclick = ondblclick
448
453
let stackonmouseout = onmouseout
449
454
let stackhttpEquiv = httpEquiv
455
+ let stackdataText = dataText
450
456
let stackbackground = background
451
457
let stackonmousemove = onmousemove
452
458
let stackonmouseover = onmouseover
@@ -459,9 +465,9 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
459
465
let stackmarginheight = marginheight
460
466
let stackacceptCharset = acceptCharset
461
467
let stackinner = inner
462
-
468
+
463
469
// Reset the values before a nested scope evalutation.
464
-
470
+
465
471
idd = nil
466
472
dir = nil
467
473
rel = nil
@@ -502,6 +508,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
502
508
title = nil
503
509
scope = nil
504
510
classs = nil
511
+ manifest = nil
505
512
value = nil
506
513
clear = nil
507
514
start = nil
@@ -527,6 +534,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
527
534
onfocus = nil
528
535
enctype = nil
529
536
onclick = nil
537
+ ontouchstart = nil
530
538
onkeyup = nil
531
539
profile = nil
532
540
version = nil
@@ -572,6 +580,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
572
580
ondblclick = nil
573
581
onmouseout = nil
574
582
httpEquiv = nil
583
+ dataText = nil
575
584
background = nil
576
585
onmousemove = nil
577
586
onmouseover = nil
@@ -584,25 +593,25 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
584
593
marginheight = nil
585
594
acceptCharset = nil
586
595
inner = nil
587
-
596
+
588
597
scopesBuffer [ Process . tid] = ( scopesBuffer [ Process . tid] ?? " " ) + " < " + node
589
-
598
+
590
599
// Save the current output before the nested scope evalutation.
591
-
600
+
592
601
var output = scopesBuffer [ Process . tid] ?? " "
593
-
602
+
594
603
// Clear the output buffer for the evalutation.
595
-
604
+
596
605
scopesBuffer [ Process . tid] = " "
597
-
606
+
598
607
// Evaluate the nested scope.
599
-
608
+
600
609
closure ( )
601
-
610
+
602
611
// Render attributes set by the evalutation.
603
-
612
+
604
613
var mergedAttributes = [ String: String? ] ( )
605
-
614
+
606
615
if let idd = idd { mergedAttributes [ " id " ] = idd }
607
616
if let dir = dir { mergedAttributes [ " dir " ] = dir }
608
617
if let rel = rel { mergedAttributes [ " rel " ] = rel }
@@ -643,6 +652,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
643
652
if let title = title { mergedAttributes [ " title " ] = title }
644
653
if let scope = scope { mergedAttributes [ " scope " ] = scope }
645
654
if let classs = classs { mergedAttributes [ " class " ] = classs }
655
+ if let manifest = manifest { mergedAttributes [ " manifest " ] = manifest }
646
656
if let value = value { mergedAttributes [ " value " ] = value }
647
657
if let clear = clear { mergedAttributes [ " clear " ] = clear }
648
658
if let start = start { mergedAttributes [ " start " ] = start }
@@ -668,6 +678,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
668
678
if let onfocus = onfocus { mergedAttributes [ " onfocus " ] = onfocus }
669
679
if let enctype = enctype { mergedAttributes [ " enctype " ] = enctype }
670
680
if let onclick = onclick { mergedAttributes [ " onclick " ] = onclick }
681
+ if let ontouchstart = ontouchstart { mergedAttributes [ " ontouchstart " ] = ontouchstart }
671
682
if let onkeyup = onkeyup { mergedAttributes [ " onkeyup " ] = onkeyup }
672
683
if let profile = profile { mergedAttributes [ " profile " ] = profile }
673
684
if let version = version { mergedAttributes [ " version " ] = version }
@@ -713,6 +724,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
713
724
if let ondblclick = ondblclick { mergedAttributes [ " ondblclick " ] = ondblclick }
714
725
if let onmouseout = onmouseout { mergedAttributes [ " onmouseout " ] = onmouseout }
715
726
if let httpEquiv = httpEquiv { mergedAttributes [ " http-equiv " ] = httpEquiv }
727
+ if let dataText = dataText { mergedAttributes [ " data-text " ] = dataText }
716
728
if let background = background { mergedAttributes [ " background " ] = background }
717
729
if let onmousemove = onmousemove { mergedAttributes [ " onmousemove " ] = onmousemove }
718
730
if let onmouseover = onmouseover { mergedAttributes [ " onmouseover " ] = onmouseover }
@@ -724,28 +736,28 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
724
736
if let placeholder = placeholder { mergedAttributes [ " placeholder " ] = placeholder }
725
737
if let marginheight = marginheight { mergedAttributes [ " marginheight " ] = marginheight }
726
738
if let acceptCharset = acceptCharset { mergedAttributes [ " accept-charset " ] = acceptCharset }
727
-
739
+
728
740
for item in attrs. enumerated ( ) {
729
741
mergedAttributes. updateValue ( item. element. 1 , forKey: item. element. 0 )
730
742
}
731
-
743
+
732
744
output += mergedAttributes. reduce ( " " ) { result, item in
733
745
if let value = item. value {
734
746
return result + " \( item. key) = \" \( value) \" "
735
747
} else {
736
748
return result
737
749
}
738
750
}
739
-
751
+
740
752
if let inner = inner {
741
753
scopesBuffer [ Process . tid] = output + " > " + ( inner) + " </ " + node + " > "
742
754
} else {
743
755
let current = scopesBuffer [ Process . tid] ?? " "
744
756
scopesBuffer [ Process . tid] = output + " > " + current + " </ " + node + " > "
745
757
}
746
-
758
+
747
759
// Pop the attributes.
748
-
760
+
749
761
idd = stackid
750
762
dir = stackdir
751
763
rel = stackrel
@@ -786,6 +798,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
786
798
title = stacktitle
787
799
scope = stackscope
788
800
classs = stackclass
801
+ manifest = stackmanifest
789
802
value = stackvalue
790
803
clear = stackclear
791
804
start = stackstart
@@ -811,6 +824,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
811
824
onfocus = stackonfocus
812
825
enctype = stackenctype
813
826
onclick = stackonclick
827
+ ontouchstart = stackontouchstart
814
828
onkeyup = stackonkeyup
815
829
profile = stackprofile
816
830
version = stackversion
@@ -856,6 +870,7 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
856
870
ondblclick = stackondblclick
857
871
onmouseout = stackonmouseout
858
872
httpEquiv = stackhttpEquiv
873
+ dataText = stackdataText
859
874
background = stackbackground
860
875
onmousemove = stackonmousemove
861
876
onmouseover = stackonmouseover
@@ -867,6 +882,6 @@ private func evaluate(_ node: String, _ attrs: [String: String?] = [:], _ closur
867
882
cellspacing = stackcellspacing
868
883
marginheight = stackmarginheight
869
884
acceptCharset = stackacceptCharset
870
-
885
+
871
886
inner = stackinner
872
887
}
0 commit comments