示例#1
0
MediaList::MediaList(CSSImportRule* parentRule, const String& media)
    : StyleBase(parentRule)
    , m_fallback(false)
{
    ExceptionCode ec = 0;
    setMediaText(media, ec);
    if (ec)
        setMediaText("invalid", ec);
}
示例#2
0
MediaList::MediaList(CSSImportRule* parentRule, const String& media)
    : m_fallback(false)
    , m_parentStyleSheet(parentRule->parentStyleSheet())
    , m_lastLine(0)
{
    ExceptionCode ec = 0;
    setMediaText(media, ec);
    if (ec)
        setMediaText("invalid", ec);
}
示例#3
0
MediaList::MediaList(CSSStyleSheet* parentSheet, const String& media, bool fallbackToDescriptor)
    : StyleBase(parentSheet)
    , m_fallback(fallbackToDescriptor)
{
    ExceptionCode ec = 0;
    setMediaText(media, ec);
    // FIXME: parsing can fail. The problem with failing constructor is that
    // we would need additional flag saying MediaList is not valid
    // Parse can fail only when fallbackToDescriptor == false, i.e when HTML4 media descriptor
    // forward-compatible syntax is not in use. 
    // DOMImplementationCSS seems to mandate that media descriptors are used
    // for both html and svg, even though svg:style doesn't use media descriptors
    // Currently the only places where parsing can fail are
    // creating <svg:style>, creating css media / import rules from js
    if (ec)
        setMediaText("invalid", ec);
}