<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[174065] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/174065">174065</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-09-29 09:58:42 -0700 (Mon, 29 Sep 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Make is<>() / downcast<>() work for HTMLDocument and its subclasses
https://bugs.webkit.org/show_bug.cgi?id=137169
Reviewed by Darin Adler.
Source/WebCore:
Make is<>() / downcast<>() work for HTMLDocument and its subclasses by
using the SPECIALIZE_TYPE_TRAITS_*() macro. Drop the DOCUMENT_TYPE_CASTS()
macro as it is no longer needed.
No new tests, no behavior change.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::namedItemGetter):
(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
(WebCore::Document::processHttpEquiv):
(WebCore::eventTargetElementForDocument):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::insertedInto):
(WebCore::Element::removedFrom):
(WebCore::Element::updateName):
(WebCore::Element::updateId):
* html/HTMLDocument.h:
(WebCore::isHTMLDocument):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::matchesReadWritePseudoClass):
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::updateWidget):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseAttribute):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::updateDocNamedItem):
* html/ImageDocument.cpp:
(WebCore::ImageDocumentParser::document):
* html/ImageDocument.h:
(WebCore::isImageDocument):
* html/MediaDocument.h:
(WebCore::isMediaDocument):
* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::createDocumentStructure):
* html/PluginDocument.h:
(WebCore::isPluginDocument):
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::loadPlugin):
* page/DragController.cpp:
(WebCore::DragController::operationForLoad):
* page/FrameView.cpp:
(WebCore::determineLayerFlushThrottleState):
Source/WebKit/win:
Use is<>() / downcast<>() for HTMLDocument and its subclasses.
* DOMHTMLClasses.cpp:
(DOMHTMLDocument::URL):
(DOMHTMLDocument::body):
(DOMHTMLDocument::forms):
Source/WebKit2:
Use is<>() / downcast<>() for HTMLDocument and its subclasses.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::pdfDocumentForPrintingFrame):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMWindowCustomcpp">trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLDocumenth">trunk/Source/WebCore/html/HTMLDocument.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLElementcpp">trunk/Source/WebCore/html/HTMLElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLEmbedElementcpp">trunk/Source/WebCore/html/HTMLEmbedElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLImageElementcpp">trunk/Source/WebCore/html/HTMLImageElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLObjectElementcpp">trunk/Source/WebCore/html/HTMLObjectElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlImageDocumentcpp">trunk/Source/WebCore/html/ImageDocument.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlImageDocumenth">trunk/Source/WebCore/html/ImageDocument.h</a></li>
<li><a href="#trunkSourceWebCorehtmlMediaDocumenth">trunk/Source/WebCore/html/MediaDocument.h</a></li>
<li><a href="#trunkSourceWebCorehtmlPluginDocumentcpp">trunk/Source/WebCore/html/PluginDocument.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlPluginDocumenth">trunk/Source/WebCore/html/PluginDocument.h</a></li>
<li><a href="#trunkSourceWebCoreloaderSubframeLoadercpp">trunk/Source/WebCore/loader/SubframeLoader.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDragControllercpp">trunk/Source/WebCore/page/DragController.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinDOMHTMLClassescpp">trunk/Source/WebKit/win/DOMHTMLClasses.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebCore/ChangeLog        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -1,3 +1,59 @@
</span><ins>+2014-09-29 Christophe Dumez <cdumez@apple.com>
+
+ Make is<>() / downcast<>() work for HTMLDocument and its subclasses
+ https://bugs.webkit.org/show_bug.cgi?id=137169
+
+ Reviewed by Darin Adler.
+
+ Make is<>() / downcast<>() work for HTMLDocument and its subclasses by
+ using the SPECIALIZE_TYPE_TRAITS_*() macro. Drop the DOCUMENT_TYPE_CASTS()
+ macro as it is no longer needed.
+
+ No new tests, no behavior change.
+
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::namedItemGetter):
+ (WebCore::JSDOMWindow::getOwnPropertySlot):
+ (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
+ * dom/Document.cpp:
+ (WebCore::Document::prepareForDestruction):
+ (WebCore::Document::processHttpEquiv):
+ (WebCore::eventTargetElementForDocument):
+ * dom/Document.h:
+ * dom/Element.cpp:
+ (WebCore::Element::insertedInto):
+ (WebCore::Element::removedFrom):
+ (WebCore::Element::updateName):
+ (WebCore::Element::updateId):
+ * html/HTMLDocument.h:
+ (WebCore::isHTMLDocument):
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::matchesReadWritePseudoClass):
+ * html/HTMLEmbedElement.cpp:
+ (WebCore::HTMLEmbedElement::updateWidget):
+ * html/HTMLImageElement.cpp:
+ (WebCore::HTMLImageElement::parseAttribute):
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::parseAttribute):
+ * html/HTMLObjectElement.cpp:
+ (WebCore::HTMLObjectElement::updateDocNamedItem):
+ * html/ImageDocument.cpp:
+ (WebCore::ImageDocumentParser::document):
+ * html/ImageDocument.h:
+ (WebCore::isImageDocument):
+ * html/MediaDocument.h:
+ (WebCore::isMediaDocument):
+ * html/PluginDocument.cpp:
+ (WebCore::PluginDocumentParser::createDocumentStructure):
+ * html/PluginDocument.h:
+ (WebCore::isPluginDocument):
+ * loader/SubframeLoader.cpp:
+ (WebCore::SubframeLoader::loadPlugin):
+ * page/DragController.cpp:
+ (WebCore::DragController::operationForLoad):
+ * page/FrameView.cpp:
+ (WebCore::determineLayerFlushThrottleState):
+
</ins><span class="cx"> 2014-09-29 Bruno de Oliveira Abinader <bruno.d@partner.samsung.com>
</span><span class="cx">
</span><span class="cx"> Revert "Support for :enabled selector on Anchor & Area elements"
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMWindowCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -80,19 +80,19 @@
</span><span class="cx">
</span><span class="cx"> ASSERT(BindingSecurity::shouldAllowAccessToDOMWindow(exec, thisObj->impl()));
</span><span class="cx"> ASSERT(document);
</span><del>- ASSERT(document->isHTMLDocument());
</del><ins>+ ASSERT(is<HTMLDocument>(document));
</ins><span class="cx">
</span><span class="cx"> AtomicStringImpl* atomicPropertyName = propertyName.publicName();
</span><del>- if (!atomicPropertyName || !toHTMLDocument(*document).hasWindowNamedItem(*atomicPropertyName))
</del><ins>+ if (!atomicPropertyName || !downcast<HTMLDocument>(*document).hasWindowNamedItem(*atomicPropertyName))
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx">
</span><del>- if (UNLIKELY(toHTMLDocument(*document).windowNamedItemContainsMultipleElements(*atomicPropertyName))) {
</del><ins>+ if (UNLIKELY(downcast<HTMLDocument>(*document).windowNamedItemContainsMultipleElements(*atomicPropertyName))) {
</ins><span class="cx"> RefPtr<HTMLCollection> collection = document->windowNamedItems(atomicPropertyName);
</span><span class="cx"> ASSERT(collection->length() > 1);
</span><span class="cx"> return JSValue::encode(toJS(exec, thisObj->globalObject(), WTF::getPtr(collection)));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return JSValue::encode(toJS(exec, thisObj->globalObject(), toHTMLDocument(*document).windowNamedItem(*atomicPropertyName)));
</del><ins>+ return JSValue::encode(toJS(exec, thisObj->globalObject(), downcast<HTMLDocument>(*document).windowNamedItem(*atomicPropertyName)));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(USER_MESSAGE_HANDLERS)
</span><span class="lines">@@ -244,9 +244,9 @@
</span><span class="cx">
</span><span class="cx"> // Allow shortcuts like 'Image1' instead of document.images.Image1
</span><span class="cx"> Document* document = thisObject->impl().frame()->document();
</span><del>- if (document->isHTMLDocument()) {
</del><ins>+ if (is<HTMLDocument>(document)) {
</ins><span class="cx"> AtomicStringImpl* atomicPropertyName = propertyName.publicName();
</span><del>- if (atomicPropertyName && toHTMLDocument(*document).hasWindowNamedItem(*atomicPropertyName)) {
</del><ins>+ if (atomicPropertyName && downcast<HTMLDocument>(*document).hasWindowNamedItem(*atomicPropertyName)) {
</ins><span class="cx"> slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, namedItemGetter);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -321,9 +321,9 @@
</span><span class="cx">
</span><span class="cx"> // Allow shortcuts like 'Image1' instead of document.images.Image1
</span><span class="cx"> Document* document = thisObject->impl().frame()->document();
</span><del>- if (document->isHTMLDocument()) {
</del><ins>+ if (is<HTMLDocument>(document)) {
</ins><span class="cx"> AtomicStringImpl* atomicPropertyName = propertyName.publicName();
</span><del>- if (atomicPropertyName && toHTMLDocument(*document).hasWindowNamedItem(*atomicPropertyName)) {
</del><ins>+ if (atomicPropertyName && downcast<HTMLDocument>(*document).hasWindowNamedItem(*atomicPropertyName)) {
</ins><span class="cx"> slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, namedItemGetter);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebCore/dom/Document.cpp        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -2107,8 +2107,8 @@
</span><span class="cx"> if (hasLivingRenderTree())
</span><span class="cx"> destroyRenderTree();
</span><span class="cx">
</span><del>- if (isPluginDocument())
- toPluginDocument(this)->detachFromPluginElement();
</del><ins>+ if (is<PluginDocument>(*this))
+ downcast<PluginDocument>(*this).detachFromPluginElement();
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(POINTER_LOCK)
</span><span class="cx"> if (page())
</span><span class="lines">@@ -2879,9 +2879,9 @@
</span><span class="cx">
</span><span class="cx"> case HTTPHeaderName::SetCookie:
</span><span class="cx"> // FIXME: make setCookie work on XML documents too; e.g. in case of <html:meta .....>
</span><del>- if (isHTMLDocument()) {
</del><ins>+ if (is<HTMLDocument>(*this)) {
</ins><span class="cx"> // Exception (for sandboxed documents) ignored.
</span><del>- toHTMLDocument(*this).setCookie(content, IGNORE_EXCEPTION);
</del><ins>+ downcast<HTMLDocument>(*this).setCookie(content, IGNORE_EXCEPTION);
</ins><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx">
</span><span class="lines">@@ -5900,19 +5900,17 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-Element* eventTargetElementForDocument(Document* doc)
</del><ins>+Element* eventTargetElementForDocument(Document* document)
</ins><span class="cx"> {
</span><del>- if (!doc)
</del><ins>+ if (!document)
</ins><span class="cx"> return nullptr;
</span><del>- Element* element = doc->focusedElement();
- if (!element && doc->isPluginDocument()) {
- PluginDocument* pluginDocument = toPluginDocument(doc);
- element = pluginDocument->pluginElement();
- }
- if (!element && doc->isHTMLDocument())
- element = doc->body();
</del><ins>+ Element* element = document->focusedElement();
+ if (!element && is<PluginDocument>(document))
+ element = downcast<PluginDocument>(*document).pluginElement();
+ if (!element && is<HTMLDocument>(document))
+ element = document->body();
</ins><span class="cx"> if (!element)
</span><del>- element = doc->documentElement();
</del><ins>+ element = document->documentElement();
</ins><span class="cx"> return element;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebCore/dom/Document.h        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -1747,9 +1747,6 @@
</span><span class="cx">
</span><span class="cx"> NODE_TYPE_CASTS(Document)
</span><span class="cx">
</span><del>-#define DOCUMENT_TYPE_CASTS(ToClassName) \
- TYPE_CASTS_BASE(ToClassName, Document, document, WebCore::is##ToClassName(*document), WebCore::is##ToClassName(document))
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> namespace WTF {
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebCore/dom/Element.cpp        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -1338,7 +1338,7 @@
</span><span class="cx"> elementRareData()->clearClassListValueForQuirksMode();
</span><span class="cx">
</span><span class="cx"> TreeScope* newScope = &insertionPoint.treeScope();
</span><del>- HTMLDocument* newDocument = !wasInDocument && inDocument() && newScope->documentScope().isHTMLDocument() ? toHTMLDocument(&newScope->documentScope()) : nullptr;
</del><ins>+ HTMLDocument* newDocument = !wasInDocument && inDocument() && is<HTMLDocument>(newScope->documentScope()) ? &downcast<HTMLDocument>(newScope->documentScope()) : nullptr;
</ins><span class="cx"> if (newScope != &treeScope())
</span><span class="cx"> newScope = nullptr;
</span><span class="cx">
</span><span class="lines">@@ -1381,7 +1381,7 @@
</span><span class="cx">
</span><span class="cx"> if (insertionPoint.isInTreeScope()) {
</span><span class="cx"> TreeScope* oldScope = &insertionPoint.treeScope();
</span><del>- HTMLDocument* oldDocument = inDocument() && oldScope->documentScope().isHTMLDocument() ? toHTMLDocument(&oldScope->documentScope()) : nullptr;
</del><ins>+ HTMLDocument* oldDocument = inDocument() && is<HTMLDocument>(oldScope->documentScope()) ? &downcast<HTMLDocument>(oldScope->documentScope()) : nullptr;
</ins><span class="cx"> if (oldScope != &treeScope() || !isInTreeScope())
</span><span class="cx"> oldScope = nullptr;
</span><span class="cx">
</span><span class="lines">@@ -2588,9 +2588,9 @@
</span><span class="cx">
</span><span class="cx"> if (!inDocument())
</span><span class="cx"> return;
</span><del>- if (!document().isHTMLDocument())
</del><ins>+ if (!is<HTMLDocument>(document()))
</ins><span class="cx"> return;
</span><del>- updateNameForDocument(toHTMLDocument(document()), oldName, newName);
</del><ins>+ updateNameForDocument(downcast<HTMLDocument>(document()), oldName, newName);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Element::updateNameForTreeScope(TreeScope& scope, const AtomicString& oldName, const AtomicString& newName)
</span><span class="lines">@@ -2636,9 +2636,9 @@
</span><span class="cx">
</span><span class="cx"> if (!inDocument())
</span><span class="cx"> return;
</span><del>- if (!document().isHTMLDocument())
</del><ins>+ if (!is<HTMLDocument>(document()))
</ins><span class="cx"> return;
</span><del>- updateIdForDocument(toHTMLDocument(document()), oldId, newId, UpdateHTMLDocumentNamedItemMapsOnlyIfDiffersFromNameAttribute);
</del><ins>+ updateIdForDocument(downcast<HTMLDocument>(document()), oldId, newId, UpdateHTMLDocumentNamedItemMapsOnlyIfDiffersFromNameAttribute);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Element::updateIdForTreeScope(TreeScope& scope, const AtomicString& oldId, const AtomicString& newId)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLDocument.h (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLDocument.h        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebCore/html/HTMLDocument.h        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -97,11 +97,11 @@
</span><span class="cx"> DocumentOrderedMap m_windowNamedItem;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-inline bool isHTMLDocument(const Document& document) { return document.isHTMLDocument(); }
-void isHTMLDocument(const HTMLDocument&); // Catch unnecessary runtime check of type known at compile time.
</del><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(HTMLDocument)
+ static bool isHTMLDocument(const Document& document) { return document.isHTMLDocument(); }
+ static bool isHTMLDocument(const Node& node) { return node.isDocumentNode() && isHTMLDocument(toDocument(node)); }
+SPECIALIZE_TYPE_TRAITS_END()
</ins><span class="cx">
</span><del>-DOCUMENT_TYPE_CASTS(HTMLDocument)
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // HTMLDocument_h
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLElement.cpp (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLElement.cpp        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebCore/html/HTMLElement.cpp        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -379,10 +379,8 @@
</span><span class="cx"> } while (currentElement);
</span><span class="cx">
</span><span class="cx"> const Document& document = this->document();
</span><del>- if (document.isHTMLDocument()) {
- const HTMLDocument& htmlDocument = toHTMLDocument(document);
- return htmlDocument.inDesignMode();
- }
</del><ins>+ if (is<HTMLDocument>(document))
+ return downcast<HTMLDocument>(document).inDesignMode();
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLEmbedElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLEmbedElement.cpp (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLEmbedElement.cpp        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebCore/html/HTMLEmbedElement.cpp        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -166,11 +166,11 @@
</span><span class="cx"> Ref<HTMLEmbedElement> protect(*this); // Loading the plugin might remove us from the document.
</span><span class="cx"> bool beforeLoadAllowedLoad = guardedDispatchBeforeLoadEvent(m_url);
</span><span class="cx"> if (!beforeLoadAllowedLoad) {
</span><del>- if (document().isPluginDocument()) {
</del><ins>+ if (is<PluginDocument>(document())) {
</ins><span class="cx"> // Plugins inside plugin documents load differently than other plugins. By the time
</span><span class="cx"> // we are here in a plugin document, the load of the plugin (which is the plugin document's
</span><span class="cx"> // main resource) has already started. We need to explicitly cancel the main resource load here.
</span><del>- toPluginDocument(&document())->cancelManualPluginLoad();
</del><ins>+ downcast<PluginDocument>(document()).cancelManualPluginLoad();
</ins><span class="cx"> }
</span><span class="cx"> return;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLImageElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLImageElement.cpp (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLImageElement.cpp        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebCore/html/HTMLImageElement.cpp        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -182,8 +182,8 @@
</span><span class="cx"> } else {
</span><span class="cx"> if (name == nameAttr) {
</span><span class="cx"> bool willHaveName = !value.isNull();
</span><del>- if (hasName() != willHaveName && inDocument() && document().isHTMLDocument()) {
- HTMLDocument& document = toHTMLDocument(this->document());
</del><ins>+ if (hasName() != willHaveName && inDocument() && is<HTMLDocument>(document())) {
+ HTMLDocument& document = downcast<HTMLDocument>(this->document());
</ins><span class="cx"> const AtomicString& id = getIdAttribute();
</span><span class="cx"> if (!id.isEmpty() && id != getNameAttribute()) {
</span><span class="cx"> if (willHaveName)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -1795,11 +1795,11 @@
</span><span class="cx"> setShouldDelayLoadEvent(false);
</span><span class="cx">
</span><span class="cx"> // 6 - Abort the overall resource selection algorithm.
</span><del>- m_currentSourceNode = 0;
</del><ins>+ m_currentSourceNode = nullptr;
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>- if (document().isMediaDocument())
- toMediaDocument(document()).mediaElementSawUnsupportedTracks();
</del><ins>+ if (is<MediaDocument>(document()))
+ downcast<MediaDocument>(document()).mediaElementSawUnsupportedTracks();
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -4208,8 +4208,8 @@
</span><span class="cx"> // The MediaPlayer came across content it cannot completely handle.
</span><span class="cx"> // This is normally acceptable except when we are in a standalone
</span><span class="cx"> // MediaDocument. If so, tell the document what has happened.
</span><del>- if (document().isMediaDocument())
- toMediaDocument(document()).mediaElementSawUnsupportedTracks();
</del><ins>+ if (is<MediaDocument>(document()))
+ downcast<MediaDocument>(document()).mediaElementSawUnsupportedTracks();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void HTMLMediaElement::mediaPlayerResourceNotSupported(MediaPlayer*)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLObjectElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLObjectElement.cpp (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLObjectElement.cpp        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebCore/html/HTMLObjectElement.cpp        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -435,8 +435,8 @@
</span><span class="cx"> isNamedItem = false;
</span><span class="cx"> child = child->nextSibling();
</span><span class="cx"> }
</span><del>- if (isNamedItem != wasNamedItem && inDocument() && document().isHTMLDocument()) {
- HTMLDocument& document = toHTMLDocument(this->document());
</del><ins>+ if (isNamedItem != wasNamedItem && inDocument() && is<HTMLDocument>(document())) {
+ HTMLDocument& document = downcast<HTMLDocument>(this->document());
</ins><span class="cx">
</span><span class="cx"> const AtomicString& id = getIdAttribute();
</span><span class="cx"> if (!id.isEmpty()) {
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlImageDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/ImageDocument.cpp (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/ImageDocument.cpp        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebCore/html/ImageDocument.cpp        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx"> {
</span><span class="cx"> // Only used during parsing, so document is guaranteed to be non-null.
</span><span class="cx"> ASSERT(RawDataDocumentParser::document());
</span><del>- return toImageDocument(*RawDataDocumentParser::document());
</del><ins>+ return downcast<ImageDocument>(*RawDataDocumentParser::document());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ImageDocumentParser::appendBytes(DocumentWriter&, const char*, size_t)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlImageDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/ImageDocument.h (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/ImageDocument.h        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebCore/html/ImageDocument.h        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -82,11 +82,11 @@
</span><span class="cx"> bool m_shouldShrinkImage;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-inline bool isImageDocument(const Document& document) { return document.isImageDocument(); }
-void isImageDocument(const ImageDocument&); // Catch unnecessary runtime check of type known at compile time.
</del><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(ImageDocument)
+ static bool isImageDocument(const Document& document) { return document.isImageDocument(); }
+ static bool isImageDocument(const Node& node) { return node.isDocumentNode() && isImageDocument(toDocument(node)); }
+SPECIALIZE_TYPE_TRAITS_END()
</ins><span class="cx">
</span><del>-DOCUMENT_TYPE_CASTS(ImageDocument)
-
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif // ImageDocument_h
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlMediaDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/MediaDocument.h (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/MediaDocument.h        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebCore/html/MediaDocument.h        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -56,11 +56,11 @@
</span><span class="cx"> String m_outgoingReferrer;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-inline bool isMediaDocument(const Document& document) { return document.isMediaDocument(); }
-void isMediaDocument(const MediaDocument&); // Catch unnecessary runtime check of type known at compile time.
</del><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(MediaDocument)
+ static bool isMediaDocument(const Document& document) { return document.isMediaDocument(); }
+ static bool isMediaDocument(const Node& node) { return node.isDocumentNode() && isMediaDocument(toDocument(node)); }
+SPECIALIZE_TYPE_TRAITS_END()
</ins><span class="cx">
</span><del>-DOCUMENT_TYPE_CASTS(MediaDocument)
-
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlPluginDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/PluginDocument.cpp (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/PluginDocument.cpp        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebCore/html/PluginDocument.cpp        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx"> if (loader)
</span><span class="cx"> m_embedElement->setAttribute(typeAttr, loader->writer().mimeType());
</span><span class="cx">
</span><del>- toPluginDocument(document())->setPluginElement(m_embedElement);
</del><ins>+ downcast<PluginDocument>(*document()).setPluginElement(m_embedElement);
</ins><span class="cx">
</span><span class="cx"> body->appendChild(embedElement, IGNORE_EXCEPTION);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlPluginDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/PluginDocument.h (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/PluginDocument.h        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebCore/html/PluginDocument.h        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -61,11 +61,11 @@
</span><span class="cx"> RefPtr<HTMLPlugInElement> m_pluginElement;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-inline bool isPluginDocument(const Document& document) { return document.isPluginDocument(); }
-void isPluginDocument(const PluginDocument&); // Catch unnecessary runtime check of type known at compile time.
</del><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(PluginDocument)
+ static bool isPluginDocument(const Document& document) { return document.isPluginDocument(); }
+ static bool isPluginDocument(const Node& node) { return node.isDocumentNode() && isPluginDocument(toDocument(node)); }
+SPECIALIZE_TYPE_TRAITS_END()
</ins><span class="cx">
</span><del>-DOCUMENT_TYPE_CASTS(PluginDocument)
-
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif // PluginDocument_h
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderSubframeLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/SubframeLoader.cpp (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/SubframeLoader.cpp        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebCore/loader/SubframeLoader.cpp        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -393,7 +393,7 @@
</span><span class="cx"> pluginElement.subframeLoaderWillCreatePlugIn(url);
</span><span class="cx">
</span><span class="cx"> IntSize contentSize = roundedIntSize(LayoutSize(renderer->contentWidth(), renderer->contentHeight()));
</span><del>- bool loadManually = document()->isPluginDocument() && !m_containsPlugins && toPluginDocument(document())->shouldLoadPluginManually();
</del><ins>+ bool loadManually = is<PluginDocument>(document()) && !m_containsPlugins && downcast<PluginDocument>(*document()).shouldLoadPluginManually();
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> // On iOS, we only tell the plugin to be in full page mode if the containing plugin document is the top level document.
</span></span></pre></div>
<a id="trunkSourceWebCorepageDragControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DragController.cpp (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DragController.cpp        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebCore/page/DragController.cpp        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -397,8 +397,8 @@
</span><span class="cx">
</span><span class="cx"> bool pluginDocumentAcceptsDrags = false;
</span><span class="cx">
</span><del>- if (doc && doc->isPluginDocument()) {
- const Widget* widget = toPluginDocument(doc)->pluginWidget();
</del><ins>+ if (doc && is<PluginDocument>(doc)) {
+ const Widget* widget = downcast<PluginDocument>(*doc).pluginWidget();
</ins><span class="cx"> const PluginViewBase* pluginView = (widget && widget->isPluginViewBase()) ? toPluginViewBase(widget) : nullptr;
</span><span class="cx">
</span><span class="cx"> if (pluginView)
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebCore/page/FrameView.cpp        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -2311,7 +2311,7 @@
</span><span class="cx"> return 0;
</span><span class="cx"> // Disable for image documents so large GIF animations don't get throttled during loading.
</span><span class="cx"> auto* document = page.mainFrame().document();
</span><del>- if (!document || isImageDocument(*document))
</del><ins>+ if (!document || is<ImageDocument>(*document))
</ins><span class="cx"> return 0;
</span><span class="cx"> return LayerFlushThrottleState::Enabled;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebKit/win/ChangeLog        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-09-29 Christophe Dumez <cdumez@apple.com>
+
+ Make is<>() / downcast<>() work for HTMLDocument and its subclasses
+ https://bugs.webkit.org/show_bug.cgi?id=137169
+
+ Reviewed by Darin Adler.
+
+ Use is<>() / downcast<>() for HTMLDocument and its subclasses.
+
+ * DOMHTMLClasses.cpp:
+ (DOMHTMLDocument::URL):
+ (DOMHTMLDocument::body):
+ (DOMHTMLDocument::forms):
+
</ins><span class="cx"> 2014-09-28 Gyuyoung Kim <gyuyoung.kim@samsung.com>
</span><span class="cx">
</span><span class="cx"> Use std::unique_ptr for ContextMenuController
</span></span></pre></div>
<a id="trunkSourceWebKitwinDOMHTMLClassescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/DOMHTMLClasses.cpp (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/DOMHTMLClasses.cpp        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebKit/win/DOMHTMLClasses.cpp        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -250,18 +250,18 @@
</span><span class="cx"> if (!result)
</span><span class="cx"> return E_POINTER;
</span><span class="cx">
</span><del>- *result = BString(toHTMLDocument(m_document)->url()).release();
</del><ins>+ *result = BString(downcast<HTMLDocument>(*m_document).url()).release();
</ins><span class="cx"> return S_OK;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> HRESULT STDMETHODCALLTYPE DOMHTMLDocument::body(
</span><span class="cx"> /* [retval][out] */ IDOMHTMLElement** bodyElement)
</span><span class="cx"> {
</span><del>- *bodyElement = 0;
- if (!m_document || !m_document->isHTMLDocument())
</del><ins>+ *bodyElement = nullptr;
+ if (!m_document || !is<HTMLDocument>(m_document))
</ins><span class="cx"> return E_FAIL;
</span><span class="cx">
</span><del>- HTMLDocument& htmlDoc = toHTMLDocument(*m_document);
</del><ins>+ HTMLDocument& htmlDoc = downcast<HTMLDocument>(*m_document);
</ins><span class="cx"> COMPtr<IDOMElement> domElement;
</span><span class="cx"> domElement.adoptRef(DOMHTMLElement::createInstance(htmlDoc.body()));
</span><span class="cx"> if (domElement)
</span><span class="lines">@@ -300,11 +300,11 @@
</span><span class="cx"> HRESULT STDMETHODCALLTYPE DOMHTMLDocument::forms(
</span><span class="cx"> /* [retval][out] */ IDOMHTMLCollection** collection)
</span><span class="cx"> {
</span><del>- *collection = 0;
- if (!m_document || !m_document->isHTMLDocument())
</del><ins>+ *collection = nullptr;
+ if (!m_document || !is<HTMLDocument>(m_document))
</ins><span class="cx"> return E_FAIL;
</span><span class="cx">
</span><del>- HTMLDocument& htmlDoc = toHTMLDocument(*m_document);
</del><ins>+ HTMLDocument& htmlDoc = downcast<HTMLDocument>(*m_document);
</ins><span class="cx"> RefPtr<HTMLCollection> forms = htmlDoc.forms();
</span><span class="cx"> *collection = DOMHTMLCollection::createInstance(forms.get());
</span><span class="cx"> return S_OK;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebKit2/ChangeLog        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-09-29 Christophe Dumez <cdumez@apple.com>
+
+ Make is<>() / downcast<>() work for HTMLDocument and its subclasses
+ https://bugs.webkit.org/show_bug.cgi?id=137169
+
+ Reviewed by Darin Adler.
+
+ Use is<>() / downcast<>() for HTMLDocument and its subclasses.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::pdfDocumentForPrintingFrame):
+
</ins><span class="cx"> 2014-09-29 Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com>
</span><span class="cx">
</span><span class="cx"> Fix !ENABLE(INSPECTOR) build after r173929
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (174064 => 174065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-09-29 16:31:33 UTC (rev 174064)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-09-29 16:58:42 UTC (rev 174065)
</span><span class="lines">@@ -3688,14 +3688,14 @@
</span><span class="cx"> {
</span><span class="cx"> Document* document = coreFrame->document();
</span><span class="cx"> if (!document)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><del>- if (!document->isPluginDocument())
- return 0;
</del><ins>+ if (!is<PluginDocument>(document))
+ return nullptr;
</ins><span class="cx">
</span><del>- PluginView* pluginView = static_cast<PluginView*>(toPluginDocument(document)->pluginWidget());
</del><ins>+ PluginView* pluginView = static_cast<PluginView*>(downcast<PluginDocument>(*document).pluginWidget());
</ins><span class="cx"> if (!pluginView)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><span class="cx"> return pluginView->pdfDocumentForPrinting();
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>