'use strict';

var addDomEvent = require('../../events/add-dom-event.js');
var createProjectionNode = require('./create-projection-node.js');

const DocumentProjectionNode = createProjectionNode.createProjectionNode({
    attachResizeListener: (ref, notify) => addDomEvent.addDomEvent(ref, "resize", notify),
    measureScroll: () => ({
        x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0,
        y: document.documentElement.scrollTop || document.body?.scrollTop || 0,
    }),
    checkIsScrollRoot: () => true,
});

exports.DocumentProjectionNode = DocumentProjectionNode;
