void SerializerMarkupAccumulator::appendCustomAttributes(StringBuilder& out, const Element& element, Namespaces* namespaces) { if (!is<HTMLFrameOwnerElement>(element)) return; const HTMLFrameOwnerElement& frameOwner = downcast<HTMLFrameOwnerElement>(element); Frame* frame = frameOwner.contentFrame(); if (!frame) return; URL url = frame->document()->url(); if (url.isValid() && !url.isBlankURL()) return; // We need to give a fake location to blank frames so they can be referenced by the serialized frame. url = m_serializer.urlForBlankFrame(frame); appendAttribute(out, element, Attribute(frameOwnerURLAttributeName(frameOwner), url.string()), namespaces); }
void SerializerMarkupAccumulator::appendCustomAttributes(StringBuilder& out, Element* element, Namespaces* namespaces) { if (!element->isFrameOwnerElement()) return; HTMLFrameOwnerElement* frameOwner = static_cast<HTMLFrameOwnerElement*>(element); Frame* frame = frameOwner->contentFrame(); if (!frame) return; KURL url = frame->document()->url(); if (url.isValid() && !url.protocolIs("about")) return; // We need to give a fake location to blank frames so they can be referenced by the serialized frame. url = m_serializer->urlForBlankFrame(frame); appendAttribute(out, element, Attribute(frameOwnerURLAttributeName(*frameOwner), url.string()), namespaces); }