Exemplo n.º 1
0
void InspectorOverlay::update()
{
    if (!m_highlightNode && !m_highlightRect && m_pausedInDebuggerMessage.isNull()) {
        m_client->hideHighlight();
        return;
    }

    FrameView* view = m_page->mainFrame()->view();
    FrameView* overlayView = overlayPage()->mainFrame()->view();
    IntRect visibleRect = enclosingIntRect(view->visibleContentRect());
    overlayView->resize(visibleRect.width(), visibleRect.height());

    // Clear canvas and paint things.
    reset();

    drawNodeHighlight();
    drawRectHighlight();
    drawPausedInDebuggerMessage();

    // Position DOM elements.
    overlayPage()->mainFrame()->document()->recalcStyle(Node::Force);
    if (overlayView->needsLayout())
        overlayView->layout();

    // Kick paint.
    m_client->highlight();
}
Exemplo n.º 2
0
void InspectorOverlay::update()
{
    if (!m_highlightNode && !m_highlightRect && m_pausedInDebuggerMessage.isNull() && m_size.isEmpty()) {
        m_client->hideHighlight();
        return;
    }

    FrameView* view = m_page->mainFrame()->view();
    if (!view)
        return;

    FrameView* overlayView = overlayPage()->mainFrame()->view();
    IntSize viewportSize = enclosingIntRect(view->visibleContentRect()).size();
    IntSize frameViewFullSize = enclosingIntRect(view->visibleContentRect(true)).size();
    IntSize size = m_size.isEmpty() ? frameViewFullSize : m_size;
    overlayView->resize(size);

    // Clear canvas and paint things.
    reset(viewportSize, m_size.isEmpty() ? IntSize() : frameViewFullSize);

    // Include scrollbars to avoid masking them by the gutter.
    drawGutter();
    drawNodeHighlight();
    drawRectHighlight();
    drawPausedInDebuggerMessage();

    // Position DOM elements.
    overlayPage()->mainFrame()->document()->recalcStyle(Node::Force);
    if (overlayView->needsLayout())
        overlayView->layout();

    // Kick paint.
    m_client->highlight();
}