Esempio n. 1
0
void InspectorNodeFinder::searchUsingDOMTreeTraversal(Node* parentNode)
{
    // Manual plain text search.
    for (auto node = parentNode; node; node = NodeTraversal::next(node, parentNode)) {
        switch (node->nodeType()) {
        case Node::TEXT_NODE:
        case Node::COMMENT_NODE:
        case Node::CDATA_SECTION_NODE: {
            if (node->nodeValue().findIgnoringCase(m_whitespaceTrimmedQuery) != notFound)
                m_results.add(node);
            break;
        }
        case Node::ELEMENT_NODE: {
            if (matchesElement(*toElement(node)))
                m_results.add(node);

            // Search inside frame elements.
            if (node->isFrameOwnerElement()) {
                HTMLFrameOwnerElement* frameOwner = toHTMLFrameOwnerElement(node);
                if (Document* document = frameOwner->contentDocument())
                    performSearch(document);
            }

            break;
        }
        default:
            break;
        }
    }
}
PaintLayerCompositor* PaintLayerCompositor::frameContentsCompositor(LayoutPart* layoutObject)
{
    if (!layoutObject->node()->isFrameOwnerElement())
        return nullptr;

    HTMLFrameOwnerElement* element = toHTMLFrameOwnerElement(layoutObject->node());
    if (Document* contentDocument = element->contentDocument()) {
        if (LayoutView* view = contentDocument->layoutView())
            return view->compositor();
    }
    return nullptr;
}
Esempio n. 3
0
bool RenderPart::requiresAcceleratedCompositing() const
{
    // There are two general cases in which we can return true. First, if this is a plugin 
    // renderer and the plugin has a layer, then we need a layer. Second, if this is 
    // a renderer with a contentDocument and that document needs a layer, then we need
    // a layer.
    if (widget() && widget()->isPluginView() && toPluginView(widget())->platformLayer())
        return true;

    if (!node() || !node()->isFrameOwnerElement())
        return false;

    HTMLFrameOwnerElement* element = toFrameOwnerElement(node());
    if (Document* contentDocument = element->contentDocument()) {
        if (RenderView* view = contentDocument->renderView())
            return view->usesCompositing();
    }

    return false;
}
Element* TopDocumentRootScrollerController::findGlobalRootScrollerElement() {
  if (!topDocument())
    return nullptr;

  DCHECK(topDocument()->rootScrollerController());
  Element* element =
      topDocument()->rootScrollerController()->effectiveRootScroller();

  while (element && element->isFrameOwnerElement()) {
    HTMLFrameOwnerElement* frameOwner = toHTMLFrameOwnerElement(element);
    DCHECK(frameOwner);

    Document* iframeDocument = frameOwner->contentDocument();
    if (!iframeDocument)
      return element;

    DCHECK(iframeDocument->rootScrollerController());
    element = iframeDocument->rootScrollerController()->effectiveRootScroller();
  }

  return element;
}