Unreviewed, rolling out r159551.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Nov 2013 18:26:34 +0000 (18:26 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Nov 2013 18:26:34 +0000 (18:26 +0000)
http://trac.webkit.org/changeset/159551
https://bugs.webkit.org/show_bug.cgi?id=124669

made many tests asserts (Requested by anttik on #webkit).

* html/HTMLDetailsElement.h:
* html/HTMLMediaElement.cpp:
(HTMLMediaElement::selectNextSourceChild):
* html/HTMLMetaElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::isDisabledFormControl):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::updateWidgetCallback):
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::detailsElement):
* html/HTMLSummaryElement.h:
* html/HTMLTableCaptionElement.h:
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::caption):
(WebCore::HTMLTableElement::tHead):
(WebCore::HTMLTableElement::tFoot):
(WebCore::HTMLTableElement::lastBody):
* html/HTMLTableRowElement.cpp:
(WebCore::HTMLTableRowElement::rowIndex):
* html/HTMLTableSectionElement.h:
* html/HTMLTagNames.in:
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):
* html/shadow/DetailsMarkerControl.cpp:
(WebCore::DetailsMarkerControl::summaryElement):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::handleFallbackContent):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
* page/DragController.cpp:
(WebCore::DragController::canProcessDrag):
* page/Frame.cpp:
(WebCore::Frame::searchForLabelsBeforeElement):
* page/SpatialNavigation.cpp:
(WebCore::frameOwnerElement):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@159570 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 files changed:
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLDetailsElement.h
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMetaElement.h
Source/WebCore/html/HTMLObjectElement.cpp
Source/WebCore/html/HTMLOptionElement.cpp
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/html/HTMLSummaryElement.cpp
Source/WebCore/html/HTMLSummaryElement.h
Source/WebCore/html/HTMLTableCaptionElement.h
Source/WebCore/html/HTMLTableElement.cpp
Source/WebCore/html/HTMLTableRowElement.cpp
Source/WebCore/html/HTMLTableSectionElement.h
Source/WebCore/html/HTMLTagNames.in
Source/WebCore/html/MediaDocument.cpp
Source/WebCore/html/shadow/DetailsMarkerControl.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/ImageLoader.cpp
Source/WebCore/page/DragController.cpp
Source/WebCore/page/Frame.cpp
Source/WebCore/page/SpatialNavigation.cpp

index 078c6d5..3b18a9c 100644 (file)
@@ -1,3 +1,49 @@
+2013-11-20  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r159551.
+        http://trac.webkit.org/changeset/159551
+        https://bugs.webkit.org/show_bug.cgi?id=124669
+
+        made many tests asserts (Requested by anttik on #webkit).
+
+        * html/HTMLDetailsElement.h:
+        * html/HTMLMediaElement.cpp:
+        (HTMLMediaElement::selectNextSourceChild):
+        * html/HTMLMetaElement.h:
+        * html/HTMLObjectElement.cpp:
+        (WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk):
+        * html/HTMLOptionElement.cpp:
+        (WebCore::HTMLOptionElement::isDisabledFormControl):
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::HTMLPlugInImageElement::updateWidgetCallback):
+        * html/HTMLSummaryElement.cpp:
+        (WebCore::HTMLSummaryElement::detailsElement):
+        * html/HTMLSummaryElement.h:
+        * html/HTMLTableCaptionElement.h:
+        * html/HTMLTableElement.cpp:
+        (WebCore::HTMLTableElement::caption):
+        (WebCore::HTMLTableElement::tHead):
+        (WebCore::HTMLTableElement::tFoot):
+        (WebCore::HTMLTableElement::lastBody):
+        * html/HTMLTableRowElement.cpp:
+        (WebCore::HTMLTableRowElement::rowIndex):
+        * html/HTMLTableSectionElement.h:
+        * html/HTMLTagNames.in:
+        * html/MediaDocument.cpp:
+        (WebCore::MediaDocumentParser::createDocumentStructure):
+        * html/shadow/DetailsMarkerControl.cpp:
+        (WebCore::DetailsMarkerControl::summaryElement):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::handleFallbackContent):
+        * loader/ImageLoader.cpp:
+        (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
+        * page/DragController.cpp:
+        (WebCore::DragController::canProcessDrag):
+        * page/Frame.cpp:
+        (WebCore::Frame::searchForLabelsBeforeElement):
+        * page/SpatialNavigation.cpp:
+        (WebCore::frameOwnerElement):
+
 2013-11-20  Zoltan Horvath  <zoltan@webkit.org>
 
         Move LineWidth.{h,cpp} into rendering/line
index c1428e6..61b03d4 100644 (file)
@@ -44,8 +44,6 @@ private:
     bool m_isOpen;
 };
 
-NODE_TYPE_CASTS(HTMLDetailsElement)
-
 } // namespace WebCore
 
 #endif // HTMLDetailsElement_h
index a0d9b53..d114310 100644 (file)
@@ -3514,7 +3514,7 @@ URL HTMLMediaElement::selectNextSourceChild(ContentType* contentType, String* ke
         if (node.parentNode() != this)
             continue;
 
-        source = toHTMLSourceElement(&node);
+        source = static_cast<HTMLSourceElement*>(&node);
 
         // If candidate does not have a src attribute, or if its src attribute's value is the empty string ... jump down to the failed step below
         mediaURL = source->getNonEmptyURLAttribute(srcAttr);
index 7e40de9..f97119e 100644 (file)
@@ -44,8 +44,6 @@ private:
     void process();
 };
 
-NODE_TYPE_CASTS(HTMLMetaElement)
-
 } // namespace WebCore
 
 #endif
index 07f59a1..ae5a465 100644 (file)
@@ -243,8 +243,9 @@ bool HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk()
     RefPtr<NodeList> metaElements = document().getElementsByTagName(HTMLNames::metaTag.localName());
     unsigned length = metaElements->length();
     for (unsigned i = 0; i < length; ++i) {
-        HTMLMetaElement& metaElement = toHTMLMetaElement(*metaElements->item(i));
-        if (equalIgnoringCase(metaElement.name(), "generator") && metaElement.content().startsWith("Mac OS X Server Web Services Server", false))
+        ASSERT_WITH_SECURITY_IMPLICATION(metaElements->item(i)->isHTMLElement());
+        HTMLMetaElement* metaElement = static_cast<HTMLMetaElement*>(metaElements->item(i));
+        if (equalIgnoringCase(metaElement->name(), "generator") && metaElement->content().startsWith("Mac OS X Server Web Services Server", false))
             return true;
     }
     
index f2b3624..3e77c6a 100644 (file)
@@ -344,8 +344,8 @@ bool HTMLOptionElement::isDisabledFormControl() const
     if (!parentNode() || !parentNode()->isHTMLElement())
         return false;
 
-    HTMLElement& parentElement = toHTMLElement(*parentNode());
-    return isHTMLOptGroupElement(parentElement) && parentElement.isDisabledFormControl();
+    HTMLElement* parentElement = static_cast<HTMLElement*>(parentNode());
+    return isHTMLOptGroupElement(parentElement) && parentElement->isDisabledFormControl();
 }
 
 Node::InsertionNotificationRequest HTMLOptionElement::insertedInto(ContainerNode& insertionPoint)
index 2438dfe..5476eb5 100644 (file)
@@ -324,7 +324,7 @@ PassRefPtr<RenderStyle> HTMLPlugInImageElement::customStyleForRenderer()
 
 void HTMLPlugInImageElement::updateWidgetCallback(Node* n, unsigned)
 {
-    toHTMLPlugInImageElement(n)->updateWidgetIfNecessary();
+    static_cast<HTMLPlugInImageElement*>(n)->updateWidgetIfNecessary();
 }
 
 void HTMLPlugInImageElement::updateSnapshot(PassRefPtr<Image> image)
index ba19d33..de8598e 100644 (file)
@@ -88,7 +88,7 @@ HTMLDetailsElement* HTMLSummaryElement::detailsElement() const
     Node* mayDetails = NodeRenderingTraversal::parent(this);
     if (!mayDetails || !mayDetails->hasTagName(detailsTag))
         return 0;
-    return toHTMLDetailsElement(mayDetails);
+    return static_cast<HTMLDetailsElement*>(mayDetails);
 }
 
 bool HTMLSummaryElement::isMainSummary() const
index 2ccd9fa..26a11d8 100644 (file)
@@ -46,8 +46,6 @@ private:
     bool supportsFocus() const OVERRIDE;
 };
 
-NODE_TYPE_CASTS(HTMLSummaryElement)
-
 }
 
 #endif // HTMLSummaryElement_h
index 3b2afb5..42013de 100644 (file)
@@ -41,8 +41,6 @@ private:
     virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStylePropertySet&) OVERRIDE;
 };
 
-NODE_TYPE_CASTS(HTMLTableCaptionElement)
-
 } // namespace
 
 #endif
index 05e5fed..65f6122 100644 (file)
@@ -71,7 +71,7 @@ HTMLTableCaptionElement* HTMLTableElement::caption() const
 {
     for (Node* child = firstChild(); child; child = child->nextSibling()) {
         if (child->hasTagName(captionTag))
-            return toHTMLTableCaptionElement(child);
+            return static_cast<HTMLTableCaptionElement*>(child);
     }
     return 0;
 }
@@ -86,7 +86,7 @@ HTMLTableSectionElement* HTMLTableElement::tHead() const
 {
     for (Node* child = firstChild(); child; child = child->nextSibling()) {
         if (child->hasTagName(theadTag))
-            return toHTMLTableSectionElement(child);
+            return static_cast<HTMLTableSectionElement*>(child);
     }
     return 0;
 }
@@ -107,7 +107,7 @@ HTMLTableSectionElement* HTMLTableElement::tFoot() const
 {
     for (Node* child = firstChild(); child; child = child->nextSibling()) {
         if (child->hasTagName(tfootTag))
-            return toHTMLTableSectionElement(child);
+            return static_cast<HTMLTableSectionElement*>(child);
     }
     return 0;
 }
@@ -178,7 +178,7 @@ HTMLTableSectionElement* HTMLTableElement::lastBody() const
 {
     for (Node* child = lastChild(); child; child = child->previousSibling()) {
         if (child->hasTagName(tbodyTag))
-            return toHTMLTableSectionElement(child);
+            return static_cast<HTMLTableSectionElement*>(child);
     }
     return 0;
 }
index 86e5c56..649ec2f 100644 (file)
@@ -81,8 +81,8 @@ int HTMLTableRowElement::rowIndex() const
     
     for (Node *node = table->firstChild(); node; node = node->nextSibling()) {
         if (node->hasTagName(tbodyTag)) {
-            HTMLTableSectionElement& section = toHTMLTableSectionElement(*node);
-            for (Node* row = section.firstChild(); row; row = row->nextSibling()) {
+            HTMLTableSectionElement* section = static_cast<HTMLTableSectionElement*>(node);
+            for (Node* row = section->firstChild(); row; row = row->nextSibling()) {
                 if (row == this)
                     return rIndex;
                 if (row->hasTagName(trTag))
index b7053ed..ed87294 100644 (file)
@@ -59,8 +59,6 @@ private:
     virtual const StylePropertySet* additionalPresentationAttributeStyle() OVERRIDE;
 };
 
-NODE_TYPE_CASTS(HTMLTableSectionElement)
-
 } //namespace
 
 #endif
index 4ce42ad..3894034 100644 (file)
@@ -24,7 +24,7 @@ body generateTypeHelpers
 br interfaceName=HTMLBRElement
 button constructorNeedsFormElement
 canvas generateTypeHelpers
-caption interfaceName=HTMLTableCaptionElement, generateTypeHelpers
+caption interfaceName=HTMLTableCaptionElement
 center interfaceName=HTMLElement
 cite interfaceName=HTMLElement
 code interfaceName=HTMLElement
@@ -35,7 +35,7 @@ webkitShadowContent interfaceName=HTMLElement, noConstructor
 datalist interfaceName=HTMLDataListElement, conditional=DATALIST_ELEMENT, generateTypeHelpers
 dd interfaceName=HTMLElement
 del interfaceName=HTMLModElement
-details conditional=DETAILS_ELEMENT, generateTypeHelpers 
+details conditional=DETAILS_ELEMENT
 dfn interfaceName=HTMLElement
 dir interfaceName=HTMLDirectoryElement
 div
@@ -82,7 +82,7 @@ map generateTypeHelpers
 mark interfaceName=HTMLElement
 marquee
 menu
-meta generateTypeHelpers
+meta
 meter interfaceName=HTMLMeterElement, conditional=METER_ELEMENT, generateTypeHelpers
 nav interfaceName=HTMLElement
 nobr interfaceName=HTMLElement
@@ -115,10 +115,10 @@ strike interfaceName=HTMLElement
 strong interfaceName=HTMLElement
 style constructorNeedsCreatedByParser, generateTypeHelpers
 sub interfaceName=HTMLElement
-summary interfaceName=HTMLSummaryElement, JSInterfaceName=HTMLElement, conditional=DETAILS_ELEMENT, generateTypeHelpers
+summary interfaceName=HTMLSummaryElement, JSInterfaceName=HTMLElement, conditional=DETAILS_ELEMENT
 sup interfaceName=HTMLElement
 table generateTypeHelpers
-tbody interfaceName=HTMLTableSectionElement, generateTypeHelpers
+tbody interfaceName=HTMLTableSectionElement
 td interfaceName=HTMLTableCellElement
 template conditional=TEMPLATE_ELEMENT, generateTypeHelpers
 textarea interfaceName=HTMLTextAreaElement, constructorNeedsFormElement, generateTypeHelpers
index 678cf41..83078cb 100644 (file)
@@ -93,11 +93,11 @@ void MediaDocumentParser::createDocumentStructure()
     m_mediaElement->setAttribute(nameAttr, "media");
 
     RefPtr<Element> sourceElement = document()->createElement(sourceTag, false);
-    HTMLSourceElement& source = toHTMLSourceElement(*sourceElement);
-    source.setSrc(document()->url());
+    HTMLSourceElement* source = static_cast<HTMLSourceElement*>(sourceElement.get());
+    source->setSrc(document()->url());
 
     if (DocumentLoader* loader = document()->loader())
-        source.setType(loader->responseMIMEType());
+        source->setType(loader->responseMIMEType());
 
     m_mediaElement->appendChild(sourceElement, IGNORE_EXCEPTION);
     body->appendChild(mediaElement, IGNORE_EXCEPTION);
index 527a4d6..47be010 100644 (file)
@@ -63,7 +63,9 @@ const AtomicString& DetailsMarkerControl::shadowPseudoId() const
 
 HTMLSummaryElement* DetailsMarkerControl::summaryElement()
 {
-    return toHTMLSummaryElement(shadowHost());
+    Element* element = shadowHost();
+    ASSERT_WITH_SECURITY_IMPLICATION(!element || element->hasTagName(summaryTag));
+    return static_cast<HTMLSummaryElement*>(element);
 }
 
 }
index f3474c3..4eeb1d0 100644 (file)
@@ -986,7 +986,7 @@ void FrameLoader::handleFallbackContent()
     HTMLFrameOwnerElement* owner = m_frame.ownerElement();
     if (!owner || !owner->hasTagName(objectTag))
         return;
-    toHTMLObjectElement(owner)->renderFallbackContent();
+    static_cast<HTMLObjectElement*>(owner)->renderFallbackContent();
 }
 
 void FrameLoader::provisionalLoadStarted()
index b53b88a..011bcda 100644 (file)
@@ -417,7 +417,7 @@ void ImageLoader::dispatchPendingBeforeLoadEvent()
     m_hasPendingLoadEvent = false;
     
     if (isHTMLObjectElement(m_element))
-        toHTMLObjectElement(m_element)->renderFallbackContent();
+        static_cast<HTMLObjectElement*>(m_element)->renderFallbackContent();
 
     // Only consider updating the protection ref-count of the Element immediately before returning
     // from this function as doing so might result in the destruction of this ImageLoader.
index 4c28957..7eb249d 100644 (file)
@@ -552,7 +552,8 @@ bool DragController::canProcessDrag(DragData& dragData)
         return true;
 
     if (result.innerNonSharedNode()->isPluginElement()) {
-        if (!toHTMLPlugInElement(result.innerNonSharedNode())->canProcessDrag() && !result.innerNonSharedNode()->rendererIsEditable())
+        HTMLPlugInElement* plugin = static_cast<HTMLPlugInElement*>(result.innerNonSharedNode());
+        if (!plugin->canProcessDrag() && !result.innerNonSharedNode()->rendererIsEditable())
             return false;
     } else if (!result.innerNonSharedNode()->rendererIsEditable())
         return false;
index d23ba5f..6241ee3 100644 (file)
@@ -386,7 +386,7 @@ String Frame::searchForLabelsBeforeElement(const Vector<String>& labels, Element
             break;
 
         if (n->hasTagName(tdTag) && !startingTableCell) {
-            startingTableCell = toHTMLTableCellElement(n);
+            startingTableCell = static_cast<HTMLTableCellElement*>(n);
         } else if (n->hasTagName(trTag) && startingTableCell) {
             String result = searchForLabelsAboveCell(regExp.get(), startingTableCell, resultDistance);
             if (!result.isEmpty()) {
index da37c4b..53f7c37 100644 (file)
@@ -758,7 +758,7 @@ LayoutRect virtualRectForAreaElementAndDirection(HTMLAreaElement* area, FocusDir
 
 HTMLFrameOwnerElement* frameOwnerElement(FocusCandidate& candidate)
 {
-    return candidate.isFrameOwnerElement() ? toHTMLFrameOwnerElement(candidate.visibleNode) : nullptr;
+    return candidate.isFrameOwnerElement() ? static_cast<HTMLFrameOwnerElement*>(candidate.visibleNode) : 0;
 };
 
 } // namespace WebCore