https://bugs.webkit.org/show_bug.cgi?id=80229
Reviewed by Kent Tamura.
The code generator has naked static_cast<> which could be unsafe.
We can turn it into toHTMLUnknownElement() and the like.
No new tests. Just added a sanity check.
* dom/make_names.pl:
(printWrapperFactoryCppFile):
* html/HTMLElement.h:
(HTMLElement):
(WebCore::HTMLElement::isHTMLUnknownElement):
* html/HTMLUnknownElement.h:
(HTMLUnknownElement):
(WebCore::toHTMLUnknownElement):
(WebCore):
* mathml/MathMLElement.h:
(toMathMLElement):
* svg/SVGElement.h:
(WebCore::toSVGElement):
(WebCore):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@109702
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-03-04 MORITA Hajime <morrita@google.com>
+
+ WebKit needs toHTMLUnknownElement() and isUnknown() for sanity check.
+ https://bugs.webkit.org/show_bug.cgi?id=80229
+
+ Reviewed by Kent Tamura.
+
+ The code generator has naked static_cast<> which could be unsafe.
+ We can turn it into toHTMLUnknownElement() and the like.
+
+ No new tests. Just added a sanity check.
+
+ * dom/make_names.pl:
+ (printWrapperFactoryCppFile):
+ * html/HTMLElement.h:
+ (HTMLElement):
+ (WebCore::HTMLElement::isHTMLUnknownElement):
+ * html/HTMLUnknownElement.h:
+ (HTMLUnknownElement):
+ (WebCore::toHTMLUnknownElement):
+ (WebCore):
+ * mathml/MathMLElement.h:
+ (toMathMLElement):
+ * svg/SVGElement.h:
+ (WebCore::toSVGElement):
+ (WebCore):
+
2012-03-04 Luke Macpherson <macpherson@chromium.org>
Handle CSSPropertyWebkitColumnBreakAfter, CSSPropertyWebkitColumnBreakBefore and CSSPropertyWebkitColumnBreakInside in CSSStyleApplyProperty.
} elsif ($wrapperFactoryType eq "V8") {
print F <<END
return createWrapperFunction(element);
- return V8$parameters{fallbackInterfaceName}::wrap(static_cast<$parameters{fallbackInterfaceName}*>(element), forceNewObject);
+ return V8$parameters{fallbackInterfaceName}::wrap(to$parameters{fallbackInterfaceName}(element), forceNewObject);
END
;
}
PassRefPtr<MicroDataItemValue> itemValue() const;
#endif
+#ifndef NDEBUG
+ virtual bool isHTMLUnknownElement() const { return false; }
+#endif
+
protected:
HTMLElement(const QualifiedName& tagName, Document*);
return adoptRef(new HTMLUnknownElement(tagName, document));
}
+#ifndef NDEBUG
+ virtual bool isHTMLUnknownElement() const OVERRIDE { return true; }
+#endif
+
private:
HTMLUnknownElement(const QualifiedName& tagName, Document* document)
: HTMLElement(tagName, document)
}
};
+inline HTMLUnknownElement* toHTMLUnknownElement(HTMLElement* element)
+{
+ ASSERT(!element || element->isHTMLUnknownElement());
+ return static_cast<HTMLUnknownElement*>(element);
+}
+
} // namespace
#endif
}
+inline MathMLElement* toMathMLElement(Element* element)
+{
+ ASSERT(!element || element->isMathMLElement());
+ return static_cast<MathMLElement*>(element);
+}
+
#endif // ENABLE(MATHML)
#endif // MathMLElement_h
static bool equal(QualifiedName a, QualifiedName b) { return a.matches(b); }
};
+inline SVGElement* toSVGElement(Element* element)
+{
+ ASSERT(!element || element->isSVGElement());
+ return static_cast<SVGElement*>(element);
+}
+
}
#endif