Skip to content

Commit f977455

Browse files
committed
temp CSSStyleDeclaration
1 parent b950b25 commit f977455

File tree

4 files changed

+22
-14
lines changed

4 files changed

+22
-14
lines changed

src/browser/env.zig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,15 @@ const Interfaces = generate.Tuple(.{
1919
@import("url/url.zig").Interfaces,
2020
@import("xhr/xhr.zig").Interfaces,
2121
@import("xmlserializer/xmlserializer.zig").Interfaces,
22+
CSSStyleDeclaration,
2223
});
2324

25+
pub const CSSStyleDeclaration = struct {
26+
pub fn get_display(_: *CSSStyleDeclaration) []const u8 {
27+
return "anythingbutnotnone";
28+
}
29+
};
30+
2431
pub const JsThis = Env.JsThis;
2532
pub const JsObject = Env.JsObject;
2633
pub const Callback = Env.Callback;

src/browser/html/window.zig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ pub const Window = struct {
115115
return &self.storage_shelf.?.bucket.session;
116116
}
117117

118+
const Env = @import("../env.zig");
119+
pub fn _getComputedStyle(_: *Window, _: *parser.Element) Env.CSSStyleDeclaration {
120+
return .{};
121+
}
122+
118123
// TODO handle callback arguments.
119124
pub fn _setTimeout(self: *Window, cbk: Callback, delay: ?u32, state: *SessionState) !u32 {
120125
if (self.timeoutid >= self.timeoutids.len) return error.TooMuchTimeout;

src/browser/polyfill/intersection_observer.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@
5050
/**
5151
* A local reference to the root document.
5252
*/
53-
var document = (function(startDoc) {
54-
var doc = startDoc;
55-
var frame = getFrameElement(doc);
56-
while (frame) {
57-
doc = frame.ownerDocument;
58-
frame = getFrameElement(doc);
59-
}
60-
return doc;
61-
})(window.document);
53+
// var document = (function(startDoc) {
54+
// var doc = startDoc;
55+
// var frame = getFrameElement(doc);
56+
// while (frame) {
57+
// doc = frame.ownerDocument;
58+
// frame = getFrameElement(doc);
59+
// }
60+
// return doc;
61+
// })(window.document);
6262

6363
/**
6464
* An IntersectionObserver registry. This registry exists to hold a strong
@@ -631,10 +631,6 @@
631631
* @private
632632
*/
633633
IntersectionObserver.prototype._getRootRect = function() {
634-
console.log('window.document: '+ window.document);
635-
console.log('document: '+ document);
636-
console.log('window.self: '+ window.self);
637-
console.log('window: '+ window);
638634
var rootRect;
639635
if (this.root && !isDoc(this.root)) {
640636
rootRect = getBoundingClientRect(this.root);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const std = @import("std");
22
// intersection_observer.js code comes from
33
// https://github.com/GoogleChromeLabs/intersection-observer/blob/main/intersection-observer.js
4-
4+
// It has been modified to not make a local copy of document as this is loaded ahead of time
55
pub const source = @embedFile("intersection_observer.js");

0 commit comments

Comments
 (0)