This source file includes following definitions.
- m_filterRule
- style
- cssText
- reattach
- trace
#include "config.h"
#include "core/css/CSSFilterRule.h"
#include "core/css/PropertySetCSSStyleDeclaration.h"
#include "core/css/StylePropertySet.h"
#include "core/css/StyleRule.h"
#include "wtf/text/StringBuilder.h"
namespace WebCore {
CSSFilterRule::CSSFilterRule(StyleRuleFilter* filterRule, CSSStyleSheet* parent)
: CSSRule(parent)
, m_filterRule(filterRule)
{
}
CSSFilterRule::~CSSFilterRule()
{
if (m_propertiesCSSOMWrapper)
m_propertiesCSSOMWrapper->clearParentRule();
}
CSSStyleDeclaration* CSSFilterRule::style() const
{
if (!m_propertiesCSSOMWrapper)
m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_filterRule->mutableProperties(), const_cast<CSSFilterRule*>(this));
return m_propertiesCSSOMWrapper.get();
}
String CSSFilterRule::cssText() const
{
StringBuilder result;
result.appendLiteral("@-webkit-filter ");
String filterName = m_filterRule->filterName();
result.append(filterName);
result.appendLiteral(" { ");
String descs = m_filterRule->properties().asText();
result.append(descs);
if (!descs.isEmpty())
result.append(' ');
result.append('}');
return result.toString();
}
void CSSFilterRule::reattach(StyleRuleBase* rule)
{
ASSERT(rule);
m_filterRule = toStyleRuleFilter(rule);
if (m_propertiesCSSOMWrapper)
m_propertiesCSSOMWrapper->reattach(m_filterRule->mutableProperties());
}
void CSSFilterRule::trace(Visitor* visitor)
{
visitor->trace(m_filterRule);
CSSRule::trace(visitor);
}
}