mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Add support for parsing comments in the Swift HTML tokenizer
This commit is contained in:
parent
36a8ad9157
commit
9d0ce4df0f
Notes:
github-actions[bot]
2024-10-16 06:32:37 +00:00
Author: https://github.com/ADKaster
Commit: 9d0ce4df0f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1819
3 changed files with 273 additions and 0 deletions
|
@ -141,6 +141,28 @@ public class HTMLToken {
|
|||
}
|
||||
}
|
||||
}
|
||||
public var selfClosing: Bool {
|
||||
get {
|
||||
switch self.type {
|
||||
case .StartTag(_, let selfClosing, _, _):
|
||||
return selfClosing
|
||||
case .EndTag(_, let selfClosing, _, _):
|
||||
return selfClosing
|
||||
default:
|
||||
preconditionFailure("selfClosing called on non-tag token")
|
||||
}
|
||||
}
|
||||
set {
|
||||
switch self.type {
|
||||
case .StartTag(let tagName, _, let selfClosingAcknowledged, let attributes):
|
||||
self.type = .StartTag(tagName: tagName, selfClosing: newValue, selfClosingAcknowledged: selfClosingAcknowledged, attributes: attributes)
|
||||
case .EndTag(let tagName, _, let selfClosingAcknowledged, let attributes):
|
||||
self.type = .EndTag(tagName: tagName, selfClosing: newValue, selfClosingAcknowledged: selfClosingAcknowledged, attributes: attributes)
|
||||
default:
|
||||
preconditionFailure("selfClosing= called on non-tag token")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public init() {}
|
||||
public init(type: TokenType) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue