DescriptionThis change came to simplify media query evaluation inside the PreloadScanner, and enable future resource preloading without going through the main thread.
I've listed possible improvements to this code below, but I'd like to have it reviewed before I continue work on it.
Major changes:
* Added a MediaValues class that "freezes" the various media values needed for MQE when it is initialized
* Removed use of AtomicString from MediaQueryExp, to make it thread-safe
* Initialize MediaValues and provide them to the PreloadScanner during its initialization
* Run MQE inside the PreloadScanner, according to provided MediaValues
* Removed mediaAttribute passing to the HTMLResourcePreloader
Possible improvements:
* The added code in MediaQueryEvaluator.cpp can be DRYer. It also adds a lot of conditional statements that may be refactored out later on.
* More tests can be added and especially MQ feature specific tests. (Only min/max-width are tested ATM)
* Turning MediaQueryExp thread-safe was done by simply eliminating all AtomicString in favor of String. I'm not sure this is the proper way to do that, and if it creates performance implications. It may need refactoring.
Patch Set 1 #
Total comments: 1
Messages
Total messages: 4 (0 generated)
|