Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility with lazySizes library #6

Open
wjordan opened this issue Jun 2, 2017 · 1 comment
Open

Incompatibility with lazySizes library #6

wjordan opened this issue Jun 2, 2017 · 1 comment

Comments

@wjordan
Copy link

wjordan commented Jun 2, 2017

I attempted to run strictdom on a page that runs lazySizes framework to lazy-load elements into the DOM, and it threw errors like the following:

fastdom-strict.js:918 Uncaught Error: Can only get getBoundingClientRect during 'measure' phase
    at error (fastdom-strict.js:918)
    at Measure.test (fastdom-strict.js:580)
    at HTMLDivElement.clone.value [as getBoundingClientRect] (fastdom-strict.js:552)
    at checkElements (lazysizes.js:339)
    at Object._ (lazysizes.js:554)
    at init (lazysizes.js:633)
    at lazysizes.js:673

Although LazySizes contains its own logic to handle layout thrashing, these errors make strictdom incompatible with lazySizes for detecting layout thrashing coming from other page elements.

Following the suggestion in the fastdom README that "Potentially a third-party library could depend on FastDom, and better integrate within an app that itself uses it," I opened a feature-request issue (aFarkas/lazysizes#396) requesting strictdom support in lazySizes. However, the author of that library commented,

strictdom does not test for layout thrashing, it tests for a rule that is a) unnecessary to avoid layout thrashing and even worse b) increases the potential of creating layout thrashing with other libs, especially animation libraries. At the end it tests for something, that should be seen as bad practice.

Not being an expert on layout-thrashing myself, could you offer a response to this author's criticism of strictdom, and/or think of a solution to the above incompatibility issue between lazySizes and strictdom? I'm hoping that untangling this conflict will help stabilize current best practices a bit.

@Textras
Copy link

Textras commented Apr 30, 2019

@aFarkus has forked strictDOM and is who you are referring too I think, so perhaps file the issue in that fork? Perhaps he made modifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants