Changeset 61783 in webkit


Ignore:
Timestamp:
Jun 24, 2010 1:13:55 PM (14 years ago)
Author:
Nate Chapin
Message:

2010-06-24 Nate Chapin <Nate Chapin>

Reviewed by Adam Barth.

Take a KURL parameter in Document's constructor.
This will remove the one case where Document::url()
and FrameLoader::url() are not equal, allowing us to
remove FrameLoader::url().

https://bugs.webkit.org/show_bug.cgi?id=41166

Refactor only, no new tests.

  • dom/DOMImplementation.cpp: (WebCore::DOMImplementation::createDocument): Take a KURL and pass it through to Document. (WebCore::DOMImplementation::createHTMLDocument):
  • dom/DOMImplementation.h:
  • dom/Document.cpp: (WebCore::Document::Document): Call setURL() for non-empty KURL input parameters. (WebCore::Document::initSecurityContext): m_url is now initialized, so use it instead

of m_frame->loader()->url() for initializing the SecurityOrigin.

  • dom/Document.h: (WebCore::Document::create): (WebCore::Document::createXHTML):
  • html/HTMLDocument.cpp:
  • html/HTMLDocument.h: Add KURL parameter to create() and constructor.
  • html/HTMLViewSourceDocument.cpp:
  • html/HTMLViewSourceDocument.h: Add KURL parameter to create() and constructor.
  • loader/CachedFont.cpp: (WebCore::CachedFont::ensureSVGFontData):
  • loader/DocumentWriter.cpp: (WebCore::DocumentWriter::createDocument): Take a KURL and pass it through to Document. (WebCore::DocumentWriter::begin): Pass existing url parameter to constructors, and remove

redundant Document::setURL() call.

  • loader/DocumentWriter.h:
  • loader/FTPDirectoryDocument.cpp:
  • loader/FTPDirectoryDocument.h: Add KURL parameter to create() and constructor.
  • loader/ImageDocument.cpp:
  • loader/ImageDocument.h: Add KURL parameter to create() and constructor.
  • loader/MediaDocument.cpp:
  • loader/MediaDocument.h: Add KURL parameter to create() and constructor.
  • loader/PlaceholderDocument.h: Add KURL parameter to create() and constructor.
  • loader/PluginDocument.cpp:
  • loader/PluginDocument.h: Add KURL parameter to create() and constructor.
  • loader/SinkDocument.cpp:
  • loader/SinkDocument.h: Add KURL parameter to create() and constructor.
  • loader/TextDocument.cpp:
  • loader/TextDocument.h: Add KURL parameter to create() and constructor.
  • svg/SVGDocument.cpp:
  • svg/SVGDocument.h: Add KURL parameter to create() and constructor.
  • xml/DOMParser.cpp: (WebCore::DOMParser::parseFromString):
  • xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::responseXML):
  • xml/XSLTProcessor.cpp: (WebCore::XSLTProcessor::createDocumentFromSource):
Location:
trunk/WebCore
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r61781 r61783  
     12010-06-24  Nate Chapin  <japhet@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Take a KURL parameter in Document's constructor.
     6        This will remove the one case where Document::url()
     7        and FrameLoader::url() are not equal, allowing us to
     8        remove FrameLoader::url().
     9
     10        https://bugs.webkit.org/show_bug.cgi?id=41166
     11
     12        Refactor only, no new tests.
     13
     14        * dom/DOMImplementation.cpp:
     15        (WebCore::DOMImplementation::createDocument): Take a KURL and pass it through to Document.
     16        (WebCore::DOMImplementation::createHTMLDocument):
     17        * dom/DOMImplementation.h:
     18        * dom/Document.cpp:
     19        (WebCore::Document::Document): Call setURL() for non-empty KURL input parameters.
     20        (WebCore::Document::initSecurityContext): m_url is now initialized, so use it instead
     21            of m_frame->loader()->url() for initializing the SecurityOrigin.
     22        * dom/Document.h:
     23        (WebCore::Document::create):
     24        (WebCore::Document::createXHTML):
     25        * html/HTMLDocument.cpp:
     26        * html/HTMLDocument.h: Add KURL parameter to create() and constructor.
     27        * html/HTMLViewSourceDocument.cpp:
     28        * html/HTMLViewSourceDocument.h: Add KURL parameter to create() and constructor.
     29        * loader/CachedFont.cpp:
     30        (WebCore::CachedFont::ensureSVGFontData):
     31        * loader/DocumentWriter.cpp:
     32        (WebCore::DocumentWriter::createDocument): Take a KURL and pass it through to Document.
     33        (WebCore::DocumentWriter::begin): Pass existing url parameter to constructors, and remove
     34            redundant Document::setURL() call.
     35        * loader/DocumentWriter.h:
     36        * loader/FTPDirectoryDocument.cpp:
     37        * loader/FTPDirectoryDocument.h: Add KURL parameter to create() and constructor.
     38        * loader/ImageDocument.cpp:
     39        * loader/ImageDocument.h: Add KURL parameter to create() and constructor.
     40        * loader/MediaDocument.cpp:
     41        * loader/MediaDocument.h: Add KURL parameter to create() and constructor.
     42        * loader/PlaceholderDocument.h: Add KURL parameter to create() and constructor.
     43        * loader/PluginDocument.cpp:
     44        * loader/PluginDocument.h: Add KURL parameter to create() and constructor.
     45        * loader/SinkDocument.cpp:
     46        * loader/SinkDocument.h: Add KURL parameter to create() and constructor.
     47        * loader/TextDocument.cpp:
     48        * loader/TextDocument.h: Add KURL parameter to create() and constructor.
     49        * svg/SVGDocument.cpp:
     50        * svg/SVGDocument.h: Add KURL parameter to create() and constructor.
     51        * xml/DOMParser.cpp:
     52        (WebCore::DOMParser::parseFromString):
     53        * xml/XMLHttpRequest.cpp:
     54        (WebCore::XMLHttpRequest::responseXML):
     55        * xml/XSLTProcessor.cpp:
     56        (WebCore::XSLTProcessor::createDocumentFromSource):
     57
    1582010-06-24  Brady Eidson  <beidson@apple.com>
    259
  • trunk/WebCore/dom/DOMImplementation.cpp

    r61584 r61783  
    228228#if ENABLE(SVG)
    229229    if (namespaceURI == SVGNames::svgNamespaceURI)
    230         doc = SVGDocument::create(0);
     230        doc = SVGDocument::create(0, KURL());
    231231    else
    232232#endif
    233233#if ENABLE(WML)
    234234    if (namespaceURI == WMLNames::wmlNamespaceURI)
    235         doc = WMLDocument::create(0);
     235        doc = WMLDocument::create(0, KURL());
    236236    else
    237237#endif
    238238    if (namespaceURI == HTMLNames::xhtmlNamespaceURI)
    239         doc = Document::createXHTML(0);
     239        doc = Document::createXHTML(0, KURL());
    240240    else
    241         doc = Document::create(0);
     241        doc = Document::create(0, KURL());
    242242
    243243    RefPtr<Node> documentElement;
     
    296296PassRefPtr<HTMLDocument> DOMImplementation::createHTMLDocument(const String& title)
    297297{
    298     RefPtr<HTMLDocument> d = HTMLDocument::create(0);
     298    RefPtr<HTMLDocument> d = HTMLDocument::create(0, KURL());
    299299    d->open();
    300300    d->write("<!doctype html><html><body></body></html>");
     
    303303}
    304304
    305 PassRefPtr<Document> DOMImplementation::createDocument(const String& type, Frame* frame, bool inViewSourceMode)
     305PassRefPtr<Document> DOMImplementation::createDocument(const String& type, Frame* frame, const KURL& url, bool inViewSourceMode)
    306306{
    307307    if (inViewSourceMode)
    308         return HTMLViewSourceDocument::create(frame, type);
     308        return HTMLViewSourceDocument::create(frame, url, type);
    309309
    310310    // Plugins cannot take HTML and XHTML from us, and we don't even need to initialize the plugin database for those.
    311311    if (type == "text/html")
    312         return HTMLDocument::create(frame);
     312        return HTMLDocument::create(frame, url);
    313313    if (type == "application/xhtml+xml"
    314314#if ENABLE(XHTMLMP)
     
    316316#endif
    317317        )
    318         return Document::createXHTML(frame);
     318        return Document::createXHTML(frame, url);
    319319
    320320#if ENABLE(WML)
    321321    if (type == "text/vnd.wap.wml" || type == "application/vnd.wap.wmlc")
    322         return WMLDocument::create(frame);
     322        return WMLDocument::create(frame, url);
    323323#endif
    324324
     
    326326    // Plugins cannot take FTP from us either
    327327    if (type == "application/x-ftp-directory")
    328         return FTPDirectoryDocument::create(frame);
     328        return FTPDirectoryDocument::create(frame, url);
    329329#endif
    330330
     
    336336    // We do not want QuickTime to take over all image types, obviously.
    337337    if ((type == "application/pdf" || type == "text/pdf") && pluginData && pluginData->supportsMimeType(type))
    338         return PluginDocument::create(frame);
     338        return PluginDocument::create(frame, url);
    339339    if (Image::supportsType(type))
    340         return ImageDocument::create(frame);
     340        return ImageDocument::create(frame, url);
    341341
    342342#if ENABLE(VIDEO)
    343343     // Check to see if the type can be played by our MediaPlayer, if so create a MediaDocument
    344344     if (MediaPlayer::supportsType(ContentType(type)))
    345          return MediaDocument::create(frame);
     345         return MediaDocument::create(frame, url);
    346346#endif
    347347
     
    350350    // and also serves as an optimization to prevent loading the plug-in database in the common case.
    351351    if (type != "text/plain" && pluginData && pluginData->supportsMimeType(type))
    352         return PluginDocument::create(frame);
     352        return PluginDocument::create(frame, url);
    353353    if (isTextMIMEType(type))
    354         return TextDocument::create(frame);
     354        return TextDocument::create(frame, url);
    355355
    356356#if ENABLE(SVG)
     
    360360        if (!settings || !settings->usesDashboardBackwardCompatibilityMode())
    361361#endif
    362             return SVGDocument::create(frame);
     362            return SVGDocument::create(frame, url);
    363363    }
    364364#endif
    365365    if (isXMLMIMEType(type))
    366         return Document::create(frame);
    367 
    368     return HTMLDocument::create(frame);
    369 }
    370 
    371 }
     366        return Document::create(frame, url);
     367
     368    return HTMLDocument::create(frame, url);
     369}
     370
     371}
  • trunk/WebCore/dom/DOMImplementation.h

    r56412 r61783  
    3535class Frame;
    3636class HTMLDocument;
     37class KURL;
    3738class String;
    3839
     
    5758
    5859    // Other methods (not part of DOM)
    59     static PassRefPtr<Document> createDocument(const String& MIMEType, Frame*, bool inViewSourceMode);
     60    static PassRefPtr<Document> createDocument(const String& MIMEType, Frame*, const KURL&, bool inViewSourceMode);
    6061
    6162    static bool isXMLMIMEType(const String& MIMEType);
  • trunk/WebCore/dom/Document.cpp

    r61736 r61783  
    355355};
    356356
    357 Document::Document(Frame* frame, bool isXHTML, bool isHTML)
     357Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML)
    358358    : ContainerNode(0)
    359359    , m_domtree_version(0)
     
    413413
    414414    m_frame = frame;
     415
     416    if (!url.isEmpty())
     417        setURL(url);
    415418
    416419    m_axObjectCache = 0;
     
    46134616    // In the common case, create the security context from the currently
    46144617    // loading URL.
    4615     const KURL& url = m_frame->loader()->url();
    4616     m_cookieURL = url;
    4617     ScriptExecutionContext::setSecurityOrigin(SecurityOrigin::create(url, m_frame->loader()->sandboxFlags()));
     4618    m_cookieURL = m_url;
     4619    ScriptExecutionContext::setSecurityOrigin(SecurityOrigin::create(m_url, m_frame->loader()->sandboxFlags()));
    46184620
    46194621    if (SecurityOrigin::allowSubstituteDataAccessToLocal()) {
  • trunk/WebCore/dom/Document.h

    r61670 r61783  
    186186class Document : public ContainerNode, public ScriptExecutionContext {
    187187public:
    188     static PassRefPtr<Document> create(Frame* frame)
     188    static PassRefPtr<Document> create(Frame* frame, const KURL& url)
    189189    {
    190         return adoptRef(new Document(frame, false, false));
     190        return adoptRef(new Document(frame, url, false, false));
    191191    }
    192     static PassRefPtr<Document> createXHTML(Frame* frame)
     192    static PassRefPtr<Document> createXHTML(Frame* frame, const KURL& url)
    193193    {
    194         return adoptRef(new Document(frame, true, false));
     194        return adoptRef(new Document(frame, url, true, false));
    195195    }
    196196    virtual ~Document();
     
    992992
    993993protected:
    994     Document(Frame*, bool isXHTML, bool isHTML);
     994    Document(Frame*, const KURL&, bool isXHTML, bool isHTML);
    995995
    996996    void clearXMLVersion() { m_xmlVersion = String(); }
  • trunk/WebCore/html/HTMLDocument.cpp

    r61674 r61783  
    8282using namespace HTMLNames;
    8383
    84 HTMLDocument::HTMLDocument(Frame* frame)
    85     : Document(frame, false, true)
     84HTMLDocument::HTMLDocument(Frame* frame, const KURL& url)
     85    : Document(frame, url, false, true)
    8686{
    8787    clearXMLVersion();
  • trunk/WebCore/html/HTMLDocument.h

    r61104 r61783  
    3636class HTMLDocument : public Document, public CachedResourceClient {
    3737public:
    38     static PassRefPtr<HTMLDocument> create(Frame* frame)
     38    static PassRefPtr<HTMLDocument> create(Frame* frame, const KURL& url)
    3939    {
    40         return adoptRef(new HTMLDocument(frame));
     40        return adoptRef(new HTMLDocument(frame, url));
    4141    }
    4242    virtual ~HTMLDocument();
     
    8181
    8282protected:
    83     HTMLDocument(Frame*);
     83    HTMLDocument(Frame*, const KURL&);
    8484
    8585private:
  • trunk/WebCore/html/HTMLViewSourceDocument.cpp

    r61662 r61783  
    4545using namespace HTMLNames;
    4646
    47 HTMLViewSourceDocument::HTMLViewSourceDocument(Frame* frame, const String& mimeType)
    48     : HTMLDocument(frame)
     47HTMLViewSourceDocument::HTMLViewSourceDocument(Frame* frame, const KURL& url, const String& mimeType)
     48    : HTMLDocument(frame, url)
    4949    , m_type(mimeType)
    5050{
  • trunk/WebCore/html/HTMLViewSourceDocument.h

    r61662 r61783  
    3838class HTMLViewSourceDocument : public HTMLDocument {
    3939public:
    40     static PassRefPtr<HTMLViewSourceDocument> create(Frame* frame, const String& mimeType)
     40    static PassRefPtr<HTMLViewSourceDocument> create(Frame* frame, const KURL& url, const String& mimeType)
    4141    {
    42         return adoptRef(new HTMLViewSourceDocument(frame, mimeType));
     42        return adoptRef(new HTMLViewSourceDocument(frame, url, mimeType));
    4343    }
    4444
     
    4848
    4949private:
    50     HTMLViewSourceDocument(Frame*, const String& mimeType);
     50    HTMLViewSourceDocument(Frame*, const KURL&, const String& mimeType);
    5151
    5252    // Returns LegacyHTMLDocumentParser or TextDocumentParser based on m_type.
  • trunk/WebCore/loader/CachedFont.cpp

    r61094 r61783  
    137137    ASSERT(m_isSVGFont);
    138138    if (!m_externalSVGDocument && !errorOccurred() && !isLoading() && m_data) {
    139         m_externalSVGDocument = SVGDocument::create(0);
     139        m_externalSVGDocument = SVGDocument::create(0, KURL());
    140140        m_externalSVGDocument->open();
    141141
  • trunk/WebCore/loader/DocumentWriter.cpp

    r61568 r61783  
    8181}
    8282
    83 PassRefPtr<Document> DocumentWriter::createDocument()
     83PassRefPtr<Document> DocumentWriter::createDocument(const KURL& url)
    8484{
    8585    if (!m_frame->loader()->stateMachine()->isDisplayingInitialEmptyDocument() && m_frame->loader()->client()->shouldUsePluginDocument(m_mimeType))
    86         return PluginDocument::create(m_frame);
     86        return PluginDocument::create(m_frame, url);
    8787    if (!m_frame->loader()->client()->hasHTMLView())
    88         return PlaceholderDocument::create(m_frame);
    89     return DOMImplementation::createDocument(m_mimeType, m_frame, m_frame->inViewSourceMode());
     88        return PlaceholderDocument::create(m_frame, url);
     89    return DOMImplementation::createDocument(m_mimeType, m_frame, url, m_frame->inViewSourceMode());
    9090}
    9191
     
    9898    // Create a new document before clearing the frame, because it may need to
    9999    // inherit an aliased security context.
    100     RefPtr<Document> document = createDocument();
     100    RefPtr<Document> document = createDocument(url);
    101101   
    102102    // If the new document is for a Plugin but we're supposed to be sandboxed from Plugins,
    103103    // then replace the document with one whose parser will ignore the incoming data (bug 39323)
    104104    if (document->isPluginDocument() && m_frame->loader()->isSandboxed(SandboxPlugins))
    105         document = SinkDocument::create(m_frame);
     105        document = SinkDocument::create(m_frame, url);
    106106
    107107    bool resetScripting = !(m_frame->loader()->stateMachine()->isDisplayingInitialEmptyDocument() && m_frame->document()->securityOrigin()->isSecureTransitionTo(url));
     
    111111
    112112    m_frame->loader()->setURL(url);
    113     document->setURL(url);
    114113    m_frame->setDocument(document);
    115114
  • trunk/WebCore/loader/DocumentWriter.h

    r57927 r61783  
    6868
    6969private:
    70     PassRefPtr<Document> createDocument();
     70    PassRefPtr<Document> createDocument(const KURL&);
    7171
    7272    Frame* m_frame;
  • trunk/WebCore/loader/FTPDirectoryDocument.cpp

    r61737 r61783  
    432432}
    433433
    434 FTPDirectoryDocument::FTPDirectoryDocument(Frame* frame)
    435     : HTMLDocument(frame)
     434FTPDirectoryDocument::FTPDirectoryDocument(Frame* frame, const KURL& url)
     435    : HTMLDocument(frame, url)
    436436{
    437437#ifndef NDEBUG
  • trunk/WebCore/loader/FTPDirectoryDocument.h

    r61104 r61783  
    3434class FTPDirectoryDocument : public HTMLDocument {
    3535public:
    36     static PassRefPtr<FTPDirectoryDocument> create(Frame* frame)
     36    static PassRefPtr<FTPDirectoryDocument> create(Frame* frame, const KURL& url)
    3737    {
    38         return adoptRef(new FTPDirectoryDocument(frame));
     38        return adoptRef(new FTPDirectoryDocument(frame, url));
    3939    }
    4040
    4141private:
    42     FTPDirectoryDocument(Frame*);
     42    FTPDirectoryDocument(Frame*, const KURL&);
    4343    virtual DocumentParser* createParser();
    4444};
  • trunk/WebCore/loader/ImageDocument.cpp

    r61737 r61783  
    196196// --------
    197197
    198 ImageDocument::ImageDocument(Frame* frame)
    199     : HTMLDocument(frame)
     198ImageDocument::ImageDocument(Frame* frame, const KURL& url)
     199    : HTMLDocument(frame, url)
    200200    , m_imageElement(0)
    201201    , m_imageSizeIsKnown(false)
  • trunk/WebCore/loader/ImageDocument.h

    r61104 r61783  
    3434class ImageDocument : public HTMLDocument {
    3535public:
    36     static PassRefPtr<ImageDocument> create(Frame* frame)
     36    static PassRefPtr<ImageDocument> create(Frame* frame, const KURL& url)
    3737    {
    38         return adoptRef(new ImageDocument(frame));
     38        return adoptRef(new ImageDocument(frame, url));
    3939    }
    4040
     
    4848
    4949private:
    50     ImageDocument(Frame*);
     50    ImageDocument(Frame*, const KURL&);
    5151
    5252    virtual DocumentParser* createParser();
  • trunk/WebCore/loader/MediaDocument.cpp

    r61737 r61783  
    139139}
    140140   
    141 MediaDocument::MediaDocument(Frame* frame)
    142     : HTMLDocument(frame)
     141MediaDocument::MediaDocument(Frame* frame, const KURL& url)
     142    : HTMLDocument(frame, url)
    143143    , m_replaceMediaElementTimer(this, &MediaDocument::replaceMediaElementTimerFired)
    144144{
  • trunk/WebCore/loader/MediaDocument.h

    r61104 r61783  
    3535class MediaDocument : public HTMLDocument {
    3636public:
    37     static PassRefPtr<MediaDocument> create(Frame* frame)
     37    static PassRefPtr<MediaDocument> create(Frame* frame, const KURL& url)
    3838    {
    39         return adoptRef(new MediaDocument(frame));
     39        return adoptRef(new MediaDocument(frame, url));
    4040    }
    4141    virtual ~MediaDocument();
     
    4444
    4545private:
    46     MediaDocument(Frame*);
     46    MediaDocument(Frame*, const KURL&);
    4747
    4848    virtual bool isMediaDocument() const { return true; }       
  • trunk/WebCore/loader/PlaceholderDocument.h

    r53514 r61783  
    3333class PlaceholderDocument : public Document {
    3434public:
    35     static PassRefPtr<PlaceholderDocument> create(Frame* frame)
     35    static PassRefPtr<PlaceholderDocument> create(Frame* frame, const KURL& url)
    3636    {
    37         return adoptRef(new PlaceholderDocument(frame));
     37        return adoptRef(new PlaceholderDocument(frame, url));
    3838    }
    3939
     
    4141
    4242private:
    43     PlaceholderDocument(Frame* frame) : Document(frame, false, false) { }
     43    PlaceholderDocument(Frame* frame, const KURL& url) : Document(frame, url, false, false) { }
    4444};
    4545
  • trunk/WebCore/loader/PluginDocument.cpp

    r61737 r61783  
    159159}
    160160   
    161 PluginDocument::PluginDocument(Frame* frame)
    162     : HTMLDocument(frame)
     161PluginDocument::PluginDocument(Frame* frame, const KURL& url)
     162    : HTMLDocument(frame, url)
    163163{
    164164    setParseMode(Compat);
  • trunk/WebCore/loader/PluginDocument.h

    r61104 r61783  
    3434class PluginDocument : public HTMLDocument {
    3535public:
    36     static PassRefPtr<PluginDocument> create(Frame* frame)
     36    static PassRefPtr<PluginDocument> create(Frame* frame, const KURL& url)
    3737    {
    38         return adoptRef(new PluginDocument(frame));
     38        return adoptRef(new PluginDocument(frame, url));
    3939    }
    4040
     
    4545
    4646private:
    47     PluginDocument(Frame*);
     47    PluginDocument(Frame*, const KURL&);
    4848
    4949    virtual DocumentParser* createParser();
  • trunk/WebCore/loader/SinkDocument.cpp

    r61737 r61783  
    6161}
    6262
    63 SinkDocument::SinkDocument(Frame* frame)
    64     : HTMLDocument(frame)
     63SinkDocument::SinkDocument(Frame* frame, const KURL& url)
     64    : HTMLDocument(frame, url)
    6565{
    6666    setParseMode(Compat);
  • trunk/WebCore/loader/SinkDocument.h

    r61104 r61783  
    3333class SinkDocument : public HTMLDocument {
    3434public:
    35     static PassRefPtr<SinkDocument> create(Frame* frame)
     35    static PassRefPtr<SinkDocument> create(Frame* frame, const KURL& url)
    3636    {
    37         return adoptRef(new SinkDocument(frame));
     37        return adoptRef(new SinkDocument(frame, url));
    3838    }
    3939
    4040private:
    41     SinkDocument(Frame*);
     41    SinkDocument(Frame*, const KURL&);
    4242   
    4343    virtual DocumentParser* createParser();
  • trunk/WebCore/loader/TextDocument.cpp

    r61737 r61783  
    185185}
    186186
    187 TextDocument::TextDocument(Frame* frame)
    188     : HTMLDocument(frame)
     187TextDocument::TextDocument(Frame* frame, const KURL& url)
     188    : HTMLDocument(frame, url)
    189189{
    190190}
  • trunk/WebCore/loader/TextDocument.h

    r61104 r61783  
    3434class TextDocument : public HTMLDocument {
    3535public:
    36     static PassRefPtr<TextDocument> create(Frame* frame)
     36    static PassRefPtr<TextDocument> create(Frame* frame, const KURL& url)
    3737    {
    38         return adoptRef(new TextDocument(frame));
     38        return adoptRef(new TextDocument(frame, url));
    3939    }
    4040
    4141private:
    42     TextDocument(Frame*);
     42    TextDocument(Frame*, const KURL&);
    4343   
    4444    virtual DocumentParser* createParser();
  • trunk/WebCore/svg/SVGDocument.cpp

    r53514 r61783  
    3636namespace WebCore {
    3737
    38 SVGDocument::SVGDocument(Frame* frame)
    39     : Document(frame, false, false)
     38SVGDocument::SVGDocument(Frame* frame, const KURL& url)
     39    : Document(frame, url, false, false)
    4040{
    4141}
  • trunk/WebCore/svg/SVGDocument.h

    r47313 r61783  
    3434    class SVGDocument : public Document {
    3535    public:
    36         static PassRefPtr<SVGDocument> create(Frame* frame)
     36        static PassRefPtr<SVGDocument> create(Frame* frame, const KURL& url)
    3737        {
    38             return adoptRef(new SVGDocument(frame));
     38            return adoptRef(new SVGDocument(frame, url));
    3939        }
    4040
     
    5252
    5353    private:
    54         SVGDocument(Frame*);
     54        SVGDocument(Frame*, const KURL&);
    5555
    5656        virtual bool isSVGDocument() const { return true; }
  • trunk/WebCore/xml/DOMParser.cpp

    r34574 r61783  
    3030        return 0;
    3131
    32     RefPtr<Document> doc = DOMImplementation::createDocument(contentType, 0, false);
     32    RefPtr<Document> doc = DOMImplementation::createDocument(contentType, 0, KURL(), false);
    3333
    3434    doc->open();
  • trunk/WebCore/xml/XMLHttpRequest.cpp

    r61654 r61783  
    241241            m_responseXML = 0;
    242242        } else {
    243             m_responseXML = Document::create(0);
     243            m_responseXML = Document::create(0, KURL());
    244244            m_responseXML->open();
    245245            m_responseXML->setURL(m_url);
  • trunk/WebCore/xml/XSLTProcessor.cpp

    r61637 r61783  
    6969    RefPtr<Document> result;
    7070    if (sourceMIMEType == "text/plain") {
    71         result = Document::create(frame);
     71        result = Document::create(frame, sourceIsDocument ? ownerDocument->url() : KURL());
    7272        transformTextStringToXHTMLDocumentString(documentSource);
    7373    } else
    74         result = DOMImplementation::createDocument(sourceMIMEType, frame, false);
     74        result = DOMImplementation::createDocument(sourceMIMEType, frame, sourceIsDocument ? ownerDocument->url() : KURL(), false);
    7575
    7676    // Before parsing, we need to save & detach the old document and get the new document
     
    8383    }
    8484
    85     if (sourceIsDocument)
    86         result->setURL(ownerDocument->url());
    8785    result->open();
    8886
Note: See TracChangeset for help on using the changeset viewer.