Changeset 161207 in webkit


Ignore:
Timestamp:
Jan 2, 2014, 7:50:28 AM (12 years ago)
Author:
Antti Koivisto
Message:

Remove PlaceholderDocument
https://bugs.webkit.org/show_bug.cgi?id=126382

Reviewed by Andreas Kling.

Remove PlaceholderDocument class and replace it with a bit in Document.

  • WebCore.xcodeproj/project.pbxproj:
  • dom/Document.cpp:

(WebCore::Document::Document):
(WebCore::Document::createRenderTree):

  • dom/Document.h:


Also make Synthesized a construction flag instead of a boolean parameter.

(WebCore::Document::createNonRenderedPlaceholder):

  • html/HTMLDocument.cpp:

(WebCore::HTMLDocument::HTMLDocument):

  • html/HTMLDocument.h:

(WebCore::HTMLDocument::create):
(WebCore::HTMLDocument::createSynthesizedDocument):

  • loader/DocumentWriter.cpp:

(WebCore::DocumentWriter::createDocument):

  • loader/PlaceholderDocument.cpp: Removed.
  • loader/PlaceholderDocument.h: Removed.
  • pdf/ios/PDFDocument.h:

(WebCore::PDFDocument::PDFDocument):

Location:
trunk/Source/WebCore
Files:
2 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r161044 r161207  
    16571657    loader/NetscapePlugInStreamLoader.cpp
    16581658    loader/PingLoader.cpp
    1659     loader/PlaceholderDocument.cpp
    16601659    loader/PolicyCallback.cpp
    16611660    loader/PolicyChecker.cpp
  • trunk/Source/WebCore/ChangeLog

    r161205 r161207  
     12014-01-02  Antti Koivisto  <antti@apple.com>
     2
     3        Remove PlaceholderDocument
     4        https://bugs.webkit.org/show_bug.cgi?id=126382
     5
     6        Reviewed by Andreas Kling.
     7
     8        Remove PlaceholderDocument class and replace it with a bit in Document.
     9
     10        * WebCore.xcodeproj/project.pbxproj:
     11        * dom/Document.cpp:
     12        (WebCore::Document::Document):
     13        (WebCore::Document::createRenderTree):
     14        * dom/Document.h:
     15       
     16            Also make Synthesized a construction flag instead of a boolean parameter.
     17
     18        (WebCore::Document::createNonRenderedPlaceholder):
     19        * html/HTMLDocument.cpp:
     20        (WebCore::HTMLDocument::HTMLDocument):
     21        * html/HTMLDocument.h:
     22        (WebCore::HTMLDocument::create):
     23        (WebCore::HTMLDocument::createSynthesizedDocument):
     24        * loader/DocumentWriter.cpp:
     25        (WebCore::DocumentWriter::createDocument):
     26        * loader/PlaceholderDocument.cpp: Removed.
     27        * loader/PlaceholderDocument.h: Removed.
     28        * pdf/ios/PDFDocument.h:
     29        (WebCore::PDFDocument::PDFDocument):
     30
    1312014-01-01  Antti Koivisto  <antti@apple.com>
    232
  • trunk/Source/WebCore/GNUmakefile.list.am

    r161044 r161207  
    40324032        Source/WebCore/loader/PingLoader.cpp \
    40334033        Source/WebCore/loader/PingLoader.h \
    4034         Source/WebCore/loader/PlaceholderDocument.cpp \
    4035         Source/WebCore/loader/PlaceholderDocument.h \
    40364034        Source/WebCore/loader/PolicyCallback.cpp \
    40374035        Source/WebCore/loader/PolicyCallback.h \
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj

    r161107 r161207  
    71157115    <ClCompile Include="..\loader\NetscapePlugInStreamLoader.cpp" />
    71167116    <ClCompile Include="..\loader\PingLoader.cpp" />
    7117     <ClCompile Include="..\loader\PlaceholderDocument.cpp" />
    71187117    <ClCompile Include="..\loader\PolicyCallback.cpp" />
    71197118    <ClCompile Include="..\loader\PolicyChecker.cpp" />
     
    1900619005    <ClInclude Include="..\loader\NetscapePlugInStreamLoader.h" />
    1900719006    <ClInclude Include="..\loader\PingLoader.h" />
    19008     <ClInclude Include="..\loader\PlaceholderDocument.h" />
    1900919007    <ClInclude Include="..\loader\PolicyCallback.h" />
    1901019008    <ClInclude Include="..\loader\PolicyChecker.h" />
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r161202 r161207  
    11791179                3774ABA50FA21EB400AD7DE9 /* OverlapTestRequestClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 3774ABA30FA21EB400AD7DE9 /* OverlapTestRequestClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
    11801180                377A3A9015EFCE9B0059F5C7 /* BitmapImageCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 377A3A8F15EFCE9A0059F5C7 /* BitmapImageCG.cpp */; };
    1181                 377C4CDF1014E9F600B9AE42 /* PlaceholderDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 377C4CDD1014E9F600B9AE42 /* PlaceholderDocument.h */; };
    1182                 377C4CE01014E9F600B9AE42 /* PlaceholderDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 377C4CDE1014E9F600B9AE42 /* PlaceholderDocument.cpp */; };
    11831181                3784C34B0E11AA34007D8D48 /* FontTraitsMask.h in Headers */ = {isa = PBXBuildFile; fileRef = 3784C34A0E11AA34007D8D48 /* FontTraitsMask.h */; settings = {ATTRIBUTES = (Private, ); }; };
    11841182                37919C230B7D188600A56998 /* PositionIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37919C210B7D188600A56998 /* PositionIterator.cpp */; };
     
    78907888                3774ABA30FA21EB400AD7DE9 /* OverlapTestRequestClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OverlapTestRequestClient.h; sourceTree = "<group>"; };
    78917889                377A3A8F15EFCE9A0059F5C7 /* BitmapImageCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BitmapImageCG.cpp; sourceTree = "<group>"; };
    7892                 377C4CDD1014E9F600B9AE42 /* PlaceholderDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlaceholderDocument.h; sourceTree = "<group>"; };
    7893                 377C4CDE1014E9F600B9AE42 /* PlaceholderDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlaceholderDocument.cpp; sourceTree = "<group>"; };
    78947890                3784C34A0E11AA34007D8D48 /* FontTraitsMask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontTraitsMask.h; sourceTree = "<group>"; };
    78957891                37919C210B7D188600A56998 /* PositionIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PositionIterator.cpp; sourceTree = "<group>"; };
     
    2019220188                                D0FF2A5B11F8C45A007E74E0 /* PingLoader.cpp */,
    2019320189                                D0FF2A5C11F8C45A007E74E0 /* PingLoader.h */,
    20194                                 377C4CDE1014E9F600B9AE42 /* PlaceholderDocument.cpp */,
    20195                                 377C4CDD1014E9F600B9AE42 /* PlaceholderDocument.h */,
    2019620190                                97059973107D975200A50A7C /* PolicyCallback.cpp */,
    2019720191                                97059974107D975200A50A7C /* PolicyCallback.h */,
     
    2437924373                                49D5DC2E0F423A73008F20FD /* PerspectiveTransformOperation.h in Headers */,
    2438024374                                D0FF2A5E11F8C45A007E74E0 /* PingLoader.h in Headers */,
    24381                                 377C4CDF1014E9F600B9AE42 /* PlaceholderDocument.h in Headers */,
    2438224375                                E4E9B11D1814569C003ACCDF /* SimpleLineLayoutFunctions.h in Headers */,
    2438324376                                499B3EDD128DB50200E726C2 /* PlatformCAAnimation.h in Headers */,
     
    2770527698                                49D5DC2D0F423A73008F20FD /* PerspectiveTransformOperation.cpp in Sources */,
    2770627699                                D0FF2A5D11F8C45A007E74E0 /* PingLoader.cpp in Sources */,
    27707                                 377C4CE01014E9F600B9AE42 /* PlaceholderDocument.cpp in Sources */,
    2770827700                                4958782112A57DDF007238AC /* PlatformCAAnimationMac.mm in Sources */,
    2770927701                                0F13164016ED0CDE0035CC04 /* PlatformCAFiltersMac.mm in Sources */,
  • trunk/Source/WebCore/dom/Document.cpp

    r161205 r161207  
    391391#endif
    392392
    393 Document::Document(Frame* frame, const URL& url, unsigned documentClasses, bool isSynthesized)
     393Document::Document(Frame* frame, const URL& url, unsigned documentClasses, unsigned constructionFlags)
    394394    : ContainerNode(nullptr, CreateDocument)
    395395    , TreeScope(this)
     
    454454    , m_accessKeyMapValid(false)
    455455    , m_documentClasses(documentClasses)
    456     , m_isSynthesized(isSynthesized)
     456    , m_isSynthesized(constructionFlags & Synthesized)
     457    , m_isNonRenderedPlaceholder(constructionFlags & NonRenderedPlaceholder)
    457458    , m_isViewSource(false)
    458459    , m_sawElementsInKnownNamespaces(false)
     
    19501951    ASSERT(!m_inPageCache);
    19511952    ASSERT(!m_axObjectCache || this != topDocument());
     1953
     1954    if (m_isNonRenderedPlaceholder)
     1955        return;
    19521956
    19531957    // FIXME: It would be better if we could pass the resolved document style directly here.
  • trunk/Source/WebCore/dom/Document.h

    r161151 r161207  
    253253        return adoptRef(new Document(frame, url, XHTMLDocumentClass));
    254254    }
     255    static PassRefPtr<Document> createNonRenderedPlaceholder(Frame* frame, const URL& url)
     256    {
     257        return adoptRef(new Document(frame, url, DefaultDocumentClass, NonRenderedPlaceholder));
     258    }
    255259    virtual ~Document();
    256260
     
    12211225
    12221226protected:
    1223     Document(Frame*, const URL&, unsigned = DefaultDocumentClass, bool isSynthesized = false);
     1227    enum ConstructionFlags { Synthesized = 1, NonRenderedPlaceholder = 1 << 1 };
     1228    Document(Frame*, const URL&, unsigned = DefaultDocumentClass, unsigned constructionFlags = 0);
    12241229
    12251230    void clearXMLVersion() { m_xmlVersion = String(); }
     
    12361241    void setRenderer(RenderObject*) WTF_DELETED_FUNCTION;
    12371242
    1238     virtual void createRenderTree();
     1243    void createRenderTree();
     1244    void detachParser();
     1245
    12391246    virtual void dropChildren() OVERRIDE;
    1240 
    1241     void detachParser();
    12421247
    12431248    typedef void (*ArgumentsCallback)(const String& keyString, const String& valueString, Document*, void* data);
     
    14981503
    14991504    bool m_isSynthesized;
     1505    bool m_isNonRenderedPlaceholder;
    15001506
    15011507    bool m_isViewSource;
  • trunk/Source/WebCore/html/HTMLDocument.cpp

    r160908 r161207  
    8282using namespace HTMLNames;
    8383
    84 HTMLDocument::HTMLDocument(Frame* frame, const URL& url, DocumentClassFlags documentClasses, bool isSynthesized)
    85     : Document(frame, url, documentClasses | HTMLDocumentClass, isSynthesized)
     84HTMLDocument::HTMLDocument(Frame* frame, const URL& url, DocumentClassFlags documentClasses, unsigned constructionFlags)
     85    : Document(frame, url, documentClasses | HTMLDocumentClass, constructionFlags)
    8686{
    8787    clearXMLVersion();
  • trunk/Source/WebCore/html/HTMLDocument.h

    r160733 r161207  
    3434    static PassRefPtr<HTMLDocument> create(Frame* frame, const URL& url)
    3535    {
    36         return adoptRef(new HTMLDocument(frame, url));
     36        return adoptRef(new HTMLDocument(frame, url, HTMLDocumentClass));
    3737    }
    3838
    3939    static PassRefPtr<HTMLDocument> createSynthesizedDocument(Frame* frame, const URL& url)
    4040    {
    41         return adoptRef(new HTMLDocument(frame, url, true));
     41        return adoptRef(new HTMLDocument(frame, url, HTMLDocumentClass, Synthesized));
    4242    }
    4343
     
    8787
    8888protected:
    89     HTMLDocument(Frame*, const URL&, DocumentClassFlags = 0, bool isSynthesized = false);
     89    HTMLDocument(Frame*, const URL&, DocumentClassFlags = 0, unsigned constructionFlags = 0);
    9090
    9191private:
  • trunk/Source/WebCore/loader/DocumentWriter.cpp

    r160841 r161207  
    3737#include "FrameLoaderStateMachine.h"
    3838#include "FrameView.h"
    39 #include "PlaceholderDocument.h"
    4039#include "PluginDocument.h"
    4140#include "RawDataDocumentParser.h"
     
    117116#endif
    118117    if (!m_frame->loader().client().hasHTMLView())
    119         return PlaceholderDocument::create(m_frame, url);
     118        return Document::createNonRenderedPlaceholder(m_frame, url);
    120119    return DOMImplementation::createDocument(m_mimeType, m_frame, url, m_frame->inViewSourceMode());
    121120}
  • trunk/Source/WebCore/pdf/ios/PDFDocument.h

    r161066 r161207  
    2828#if PLATFORM(IOS)
    2929
    30 #include "PlaceholderDocument.h"
     30#include "Document.h"
    3131
    3232namespace WebCore {
    3333
    34 class PDFDocument : public PlaceholderDocument {
     34class PDFDocument : public Document {
    3535public:
    3636    static PassRefPtr<PDFDocument> create(Frame* frame, const URL& url)
     
    4040private:
    4141    PDFDocument(Frame* frame, const URL& url)
    42         : PlaceholderDocument(frame, url)
     42        : Document(frame, url, DefaultDocumentClass, NonRenderedPlaceholder)
    4343    {
    4444    }
Note: See TracChangeset for help on using the changeset viewer.