Add support for is<SVGDocument>() / downcast<SVGDocument>() by using the SPECIALIZE_TYPE_TRAITS_*() macro, instead of the DOCUMENT_TYPE_CASTS() one.
Created attachment 238671 [details] Patch
Attachment 238671 [details] did not pass style-queue: ERROR: Source/WebCore/svg/SVGDocument.h:57: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 1 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 238671 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=238671&action=review > Source/WebCore/page/EventHandler.cpp:763 > + if (is<SVGDocument>(m_frame.document()) > + && downcast<SVGDocument>(*m_frame.document()).zoomAndPanEnabled()) { We can probably fit this in one line instead. > Source/WebCore/page/Frame.cpp:971 > + if (is<SVGDocument>(document)) { > + if (!downcast<SVGDocument>(*document).zoomAndPanEnabled()) Why don't we check both of these conditions in one if statement instead? > Source/WebCore/page/FrameView.cpp:1964 > + if (is<SVGDocument>(frame().document())) { > + if (SVGSVGElement* svg = downcast<SVGDocument>(*frame().document()).rootElement()) { Ditto. > Source/WebCore/svg/graphics/SVGImage.cpp:71 > - SVGSVGElement* rootElement = toSVGDocument(m_page->mainFrame().document())->rootElement(); > + SVGSVGElement* rootElement = downcast<SVGDocument>(*m_page->mainFrame().document()).rootElement(); Should we add a helper function to get the root element or nullptr? Repeating the code over and over isn't so great...
Created attachment 238682 [details] Patch
Attachment 238682 [details] did not pass style-queue: ERROR: Source/WebCore/svg/SVGDocument.h:57: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 1 in 9 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 238682 [details] Patch Clearing flags on attachment: 238682 Committed r173987: <http://trac.webkit.org/changeset/173987>
All reviewed patches have been landed. Closing bug.