Пример #1
0
void
NodePrivate::getNodeCompositeRect(WKCRect* rect, int tx, int ty)
{
    WebCore::RenderObject* renderer = m_webcore->renderer();
    if (!renderer)
        return;

    WebCore::RenderStyle& style = renderer->style();
    bool isOverflowXHidden = (style.overflowX() == WebCore::OHIDDEN);
    bool isOverflowYHidden = (style.overflowY() == WebCore::OHIDDEN);

    WebCore::LayoutRect core_rect = WebCore::LayoutRect(rect->fX, rect->fY, rect->fWidth, rect->fHeight);
    m_webcore->getNodeCompositeRect(&core_rect, isOverflowXHidden, isOverflowYHidden, tx, ty);
    rect->fX = core_rect.x();
    rect->fY = core_rect.y();
    rect->fWidth = core_rect.width();
    rect->fHeight = core_rect.height();
}
Пример #2
0
HRESULT STDMETHODCALLTYPE DOMElement::font(WebFontDescription* webFontDescription)
{
    if (!webFontDescription) {
        ASSERT_NOT_REACHED();
        return E_POINTER;
    }

    ASSERT(m_element);

    WebCore::RenderObject* renderer = m_element->renderer();
    if (!renderer)
        return E_FAIL;

    FontDescription fontDescription = renderer->style()->font().fontDescription();
    AtomicString family = fontDescription.family().family();
    webFontDescription->family = family.characters();
    webFontDescription->familyLength = family.length();
    webFontDescription->size = fontDescription.computedSize();
    webFontDescription->bold = fontDescription.weight() >= WebCore::FontWeight600;
    webFontDescription->italic = fontDescription.italic();

    return S_OK;
}