Devirtualize Document class type checking
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 May 2013 01:41:16 +0000 (01:41 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 May 2013 01:41:16 +0000 (01:41 +0000)
commit173685a62d3b44c7613a1af43b712befc34e63df
tree8052d935587241b054b7c36129b95ad0536c11f8
parent5a26cb6e3a455891c52c94ffc9cb4c55c68ab27c
Devirtualize Document class type checking
https://bugs.webkit.org/show_bug.cgi?id=115755

Reviewed by Benjamin Poulain.

Merge https://chromium.googlesource.com/chromium/blink/+/dae5adc768d5ce6bff301df6515745da8ea24950

Document has a bunch of virtual bool is*Document() methods on it, but it also has
two bools for XHTML and HTML documents which is silly. We can merge them all
together into an enum of values and devirtualize the type checking methods.

* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::createElement):
* dom/Document.h:
(WebCore::Document::create):
(WebCore::Document::createXHTML):
(WebCore::Document::isHTMLDocument):
(WebCore::Document::isXHTMLDocument):
(WebCore::Document::isImageDocument):
(WebCore::Document::isSVGDocument):
(WebCore::Document::isPluginDocument):
(WebCore::Document::isMediaDocument):
(WebCore::Document):
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::HTMLDocument):
* html/HTMLDocument.h:
(WebCore::HTMLDocument):
* html/ImageDocument.cpp:
(WebCore::ImageDocument::ImageDocument):
* html/ImageDocument.h:
(WebCore::ImageDocument):
* html/MediaDocument.cpp:
(WebCore::MediaDocument::MediaDocument):
* html/MediaDocument.h:
(WebCore::MediaDocument):
* html/PluginDocument.cpp:
(WebCore::PluginDocument::PluginDocument):
* html/PluginDocument.h:
(WebCore::PluginDocument):
* loader/PlaceholderDocument.h:
(WebCore::PlaceholderDocument::PlaceholderDocument):
* svg/SVGDocument.cpp:
(WebCore::SVGDocument::SVGDocument):
* svg/SVGDocument.h:
(WebCore::SVGDocument):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@149705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/html/HTMLDocument.cpp
Source/WebCore/html/HTMLDocument.h
Source/WebCore/html/ImageDocument.cpp
Source/WebCore/html/ImageDocument.h
Source/WebCore/html/MediaDocument.cpp
Source/WebCore/html/MediaDocument.h
Source/WebCore/html/PluginDocument.cpp
Source/WebCore/html/PluginDocument.h
Source/WebCore/loader/PlaceholderDocument.h
Source/WebCore/svg/SVGDocument.cpp
Source/WebCore/svg/SVGDocument.h