Now works when a query class will reverse the result of the query. #2

merged 3 commits into from Jan 25, 2012
Commits on Jan 25, 2012
  1. @joshje

    Handles layout change on element which would invalidate query once cl…

    joshje committed Jan 25, 2012
    …ass is applied.
    For example, an element whose width is usually 50% but becomes 100%
    when the max-width selector query returns true. This would immediately
    invalidate the result, resulting in a flicker.
    The solution is to test whilst the class is removed and then add the
    class back if required.
  2. @joshje

    Width now calculated by cloning and removing a node

    joshje committed Jan 25, 2012
    In order to avoid a scenario where the removal of the class would
    momentarily reveal alternative styling, tests for width are run against
    an invisible clone of the element.
  3. @joshje