DescriptionAlways evaluate media features to true without MediaValues.
Having a constructor taking bool made it possible to construct a
MediaQueryEvaluator passing a pointer to an object of an arbitrary
type as the pointer was converted to a bool without a warning.
By closer inspection, the use of the m_expectedResult value had two
purposes. One was to return true for matching media type ignoring the
rest of the media query. The other cases were for testing purposes
where there was no media rules to match, so the result didn't matter.
Since there are no useful applications for returning false for media
queries containing expressions in addition to type, we can safely
return true for all query expression when no MediaValues object is
present.
There is one place we change the behavior. The StyleResolver
constructor has a fallback evaluator when we have no FrameView. That
should never happen, though, and it would yield incorrect results
regardless of whether we would always return true or false for media
query expressions.
R=timloh@chromium.org,meade@chromium.org
Committed: https://crrev.com/1be8b135bdccee366e212865d42db161e11137e4
Cr-Commit-Position: refs/heads/master@{#426752}
Patch Set 1 #Patch Set 2 : DCHECK(view). #
Depends on Patchset: Messages
Total messages: 24 (16 generated)
|