void HTMLLinkElement::tokenizeRelAttribute(const AtomicString& relStr)
{
    m_isStyleSheet = m_isIcon = m_alternate = false;
    String rel = relStr.domString().lower();
    if (rel == "stylesheet")
        m_isStyleSheet = true;
    else if (rel == "icon" || rel == "shortcut icon")
        m_isIcon = true;
    else if (rel == "alternate stylesheet" || rel == "stylesheet alternate")
        m_isStyleSheet = m_alternate = true;
    else {
        // Tokenize the rel attribute and set bits based on specific keywords that we find.
        rel.replace('\n', ' ');
        Vector<String> list = rel.split(' ');
        Vector<String>::const_iterator end = list.end();
        for (Vector<String>::const_iterator it = list.begin(); it != end; ++it) {
            if (*it == "stylesheet")
                m_isStyleSheet = true;
            else if (*it == "alternate")
                m_alternate = true;
            else if (*it == "icon")
                m_isIcon = true;
        }
    }
}
Пример #2
0
FontPlatformData::FontPlatformData(const FontDescription& fontDescription, const AtomicString& familyName)
    : m_font(new QFont("Times New Roman", 12))
{
    m_font->setFamily(familyName.domString());
    m_font->setPixelSize(qRound(fontDescription.computedSize()));
    m_font->setItalic(fontDescription.italic());
    if (fontDescription.bold()) {
        // Qt's Bold is 75, Webkit is 63.
        m_font->setWeight(QFont::Bold);
    } else {
        m_font->setWeight(fontDescription.weight());
    }
}