mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-16 00:08:59 +00:00
browser: remove useless switch
This commit is contained in:
@@ -225,8 +225,10 @@ pub const Page = struct {
|
|||||||
|
|
||||||
const e = parser.nodeToElement(next.?);
|
const e = parser.nodeToElement(next.?);
|
||||||
const tag = try parser.elementHTMLGetTagType(@as(*parser.ElementHTML, @ptrCast(e)));
|
const tag = try parser.elementHTMLGetTagType(@as(*parser.ElementHTML, @ptrCast(e)));
|
||||||
switch (tag) {
|
|
||||||
.script => {
|
// ignore non-script tags
|
||||||
|
if (tag != .script) continue;
|
||||||
|
|
||||||
// ignore non-js script.
|
// ignore non-js script.
|
||||||
// > type
|
// > type
|
||||||
// > Attribute is not set (default), an empty string, or a JavaScript MIME
|
// > Attribute is not set (default), an empty string, or a JavaScript MIME
|
||||||
@@ -274,9 +276,6 @@ pub const Page = struct {
|
|||||||
// > page.
|
// > page.
|
||||||
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#notes
|
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#notes
|
||||||
self.evalScript(e) catch |err| log.warn("evaljs: {any}", .{err});
|
self.evalScript(e) catch |err| log.warn("evaljs: {any}", .{err});
|
||||||
},
|
|
||||||
else => continue,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO wait for deferred scripts
|
// TODO wait for deferred scripts
|
||||||
|
|||||||
Reference in New Issue
Block a user