diff options
Diffstat (limited to 'WebCore/css/MediaQueryExp.cpp')
-rw-r--r-- | WebCore/css/MediaQueryExp.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/WebCore/css/MediaQueryExp.cpp b/WebCore/css/MediaQueryExp.cpp index 53c0b73..a93ddcc 100644 --- a/WebCore/css/MediaQueryExp.cpp +++ b/WebCore/css/MediaQueryExp.cpp @@ -2,6 +2,7 @@ * CSS Media Query * * Copyright (C) 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>. + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,6 +32,7 @@ #include "CSSParser.h" #include "CSSPrimitiveValue.h" #include "CSSValueList.h" +#include "StringBuilder.h" namespace WebCore { @@ -82,4 +84,22 @@ MediaQueryExp::~MediaQueryExp() { } +String MediaQueryExp::serialize() const +{ + if (!m_serializationCache.isNull()) + return m_serializationCache; + + StringBuilder result; + result.append("("); + result.append(m_mediaFeature.lower()); + if (m_value) { + result.append(": "); + result.append(m_value->cssText()); + } + result.append(")"); + + const_cast<MediaQueryExp*>(this)->m_serializationCache = result.toString(); + return m_serializationCache; +} + } // namespace |