altmp / coreclr-module

CoreClr (.NET Core Common Language Runtime) community made module
MIT License
15 stars 7 forks source link

Rml QuerySelector crash client #14

Open TuK4z opened 5 months ago

TuK4z commented 5 months ago

RmlDocument = Alt.CreateRmlDocument("/client/RmlWeb/index.rml"); RmlNameTagElement = RmlDocument.QuerySelector("#nametag-container");

When using RML QuerySelector it's crashing without any errors and no crashdump. Tested in JS, everything working fine.

TuK4z commented 5 months ago

Edit, Sorry git wont let me add files i ll add rml code. Issue is only when using QuerySelector method.

<rml>
    <head>
        <title>Demo</title>
        <script>
            function myFunction() {
                console.log("Logas");
            }
        </script>
        <style>
            body, #nametag-container {
                font-family: arial;
                font-weight: bold;
                font-style: normal;
            }
            div{
                width: 100%;
                height: 100%;
            }

            .nametag {
                position: absolute;
                font-effect: outline(1px black);
                color: #FFFFFFFF;
                width: 150px;
                height: auto;
                font-size: 20dp;
                word-break: break-word;
            }

            .vehsell {
                position: absolute;
                font-effect: outline(1px black);
                color: #FFFFFFFF;
                width: 300px;
                height: auto;
                font-size: 20dp;
                word-break: break-word;
            }

            .virtual {
                position: absolute;
                font-effect: outline(1px black);
                width: 200px;
                height: auto;
                font-size: 15dp;
                word-break: break-word;
            }
            .virtual p{
                color: #f59e42;
                transform: translate(-50%, 50%);
            }

            .labelinfo{
                font-family: mukta;
                position: absolute;
                width: 450px;
                height: auto;
                word-break: break-word;
                text-align: center;
                transform: translate(-50%, 50%);
                font-effect: shadow( 1px 1px black );
            }
            .labelinfo p{
                font-size: 18dp;
                color: #f59e42;
            }
            .labelinfo h1{
                font-size: 22dp;
                color: #ebebeb;
            }
            .info-container svg{
                transform: translate(-50%, 50%);
            }

            .business {
                position: absolute;
                font-effect: outline(1px black);
                width: 200px;
                height: auto;
                font-size: 15dp;
                word-break: break-word;
            }
            .business p{
                color: #f59e42;
                transform: translate(-50%, 50%);
            }

            .house {
                position: absolute;
                font-effect: outline(1px black);
                width: 200px;
                height: auto;
                font-size: 15dp;
                word-break: break-word;
                margin-top: 150px;
            }
            .house p{
                color: #f59e42;
                transform: translate(-50%, 50%);
            }

            .hide {
                display: none;
            }
        </style>
    </head>
    <body>
        <div id="nametag-container"></div>
        <div id="vehsell-container"></div>
        <div id="virtual-container"></div>
        <div id="info-container"></div>
        <div id="business-container"></div>
        <div id="house-container"></div>
    </body>
</rml>

Using code below (QuerySelector) should crash client without errors

Alt.LoadRmlFont("/client/RmlWeb/arialbd.ttf", "arial", false, false); RmlDocument = Alt.CreateRmlDocument("/client/RmlWeb/index.rml"); RmlNameTagElement = RmlDocument.QuerySelector("#nametag-container");