MediaList::MediaList(CSSImportRule* parentRule, const String& media) : StyleBase(parentRule) , m_fallback(false) { ExceptionCode ec = 0; setMediaText(media, ec); if (ec) setMediaText("invalid", ec); }
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); }
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); }