示例#1
0
// Note: This is moved from the old FrameAndroid.cpp
static void recursiveCleanupForFullLayout(WebCore::RenderObject* obj)
{
    obj->setNeedsLayout(true, false);
#ifdef ANDROID_LAYOUT
    if (obj->isTable())
        (static_cast<WebCore::RenderTable *>(obj))->clearSingleColumn();
#endif
    for (WebCore::RenderObject* n = obj->firstChild(); n; n = n->nextSibling())
        recursiveCleanupForFullLayout(n);
}
示例#2
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();
}
示例#3
0
HRESULT STDMETHODCALLTYPE DOMElement::boundingBox( 
    /* [retval][out] */ LPRECT rect)
{
    ::SetRectEmpty(rect);

    if (!m_element)
        return E_FAIL;

    WebCore::RenderObject *renderer = m_element->renderer();
    if (renderer) {
        IntRect boundsIntRect = renderer->absoluteBoundingBoxRect();
        rect->left = boundsIntRect.x();
        rect->top = boundsIntRect.y();
        rect->right = boundsIntRect.x() + boundsIntRect.width();
        rect->bottom = boundsIntRect.y() + boundsIntRect.height();
    }

    return S_OK;
}
示例#4
0
const GraphicsLayer*
NodePrivate::enclosingGraphicsLayer() const
{
#if USE(ACCELERATED_COMPOSITING)
    WebCore::RenderObject* renderer = webcore()->renderer();
    if (!renderer)
        return 0;
    WebCore::RenderLayer* renderlayer = renderer->enclosingLayer();
    if (!renderlayer)
        return 0;
    WebCore::RenderLayer* compositedlayer = renderlayer->enclosingCompositingLayer();
    if (!compositedlayer)
        return 0;
    WebCore::GraphicsLayer* graphicslayer = compositedlayer->backing()->graphicsLayer();
    if (!graphicslayer)
        return 0;
    GraphicsLayerPrivate* wkc = GraphicsLayerWKC_wkc(graphicslayer);
    return &wkc->wkc();
#else
    return 0;
#endif
}
示例#5
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;
}
示例#6
0
static IntPoint convertAbsoluteLocationForRenderObject(const LayoutPoint& location, const WebCore::RenderObject& renderObject)
{
    return roundedIntPoint(renderObject.absoluteToLocal(location, UseTransforms));
}