khtml::MediaQueryEvaluator

khtml::MediaQueryEvaluator Class Reference

#include <css_mediaquery.h>

Public Member Functions

 MediaQueryEvaluator (bool mediaFeatureResult=false)
 
 MediaQueryEvaluator (const DOM::DOMString &acceptedMediaType, bool mediaFeatureResult=false)
 
 MediaQueryEvaluator (const char *acceptedMediaType, bool mediaFeatureResult=false)
 
 MediaQueryEvaluator (const DOM::DOMString &acceptedMediaType, KHTMLPart *, RenderStyle *)
 
bool eval (const DOM::MediaListImpl *, CSSStyleSelector *=nullptr) const
 
bool eval (const MediaQueryExp *) const
 
bool mediaTypeMatch (const DOM::DOMString &mediaTypeToMatch) const
 
bool mediaTypeMatchSpecific (const char *mediaTypeToMatch) const
 

Static Public Member Functions

static void cleanup ()
 

Detailed Description

Class that evaluates css media queries as defined in CSS3 Module "Media Queries" (https://www.w3.org/TR/css3-mediaqueries/) Special constructors are needed, if simple media queries are to be evaluated without knowledge of the medium features.

This can happen for example when parsing UA stylesheets, if evaluation is done right after parsing.

the boolean parameter is used to approximate results of evaluation, if the device characteristics are not known. This can be used to prune the loading of stylesheets to only those which are probable to match.

Definition at line 98 of file css_mediaquery.h.

Constructor & Destructor Documentation

MediaQueryEvaluator::MediaQueryEvaluator ( bool  mediaFeatureResult = false)

Creates evaluator which evaluates only simple media queries Evaluator returns true for "all", and returns value of for any media features.

Definition at line 229 of file css_mediaquery.cpp.

MediaQueryEvaluator::MediaQueryEvaluator ( const DOM::DOMString acceptedMediaType,
bool  mediaFeatureResult = false 
)

Creates evaluator which evaluates only simple media queries Evaluator returns true for acceptedMediaType and returns value of for any media features.

Definition at line 236 of file css_mediaquery.cpp.

MediaQueryEvaluator::MediaQueryEvaluator ( const DOM::DOMString acceptedMediaType,
KHTMLPart part,
RenderStyle *  style 
)

Creates evaluator which evaluates full media queries.

Definition at line 252 of file css_mediaquery.cpp.

Member Function Documentation

bool MediaQueryEvaluator::eval ( const DOM::MediaListImpl *  mediaList,
CSSStyleSelector styleSelector = nullptr 
) const

Evaluates a list of media queries.

Definition at line 285 of file css_mediaquery.cpp.

bool MediaQueryEvaluator::eval ( const MediaQueryExp *  expr) const

Evaluates media query subexpression, ie "and (media-feature: value)" part.

Definition at line 812 of file css_mediaquery.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Jun 4 2020 22:35:26 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.