Summary: | Add support for is<SVGDocument>() / downcast<SVGDocument>() | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||
Component: | SVG | Assignee: | Chris Dumez <cdumez> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | aboxhall, apinheiro, benjamin, cfleizach, commit-queue, dmazzoni, d-r, esprehn+autocc, fmalita, gyuyoung.kim, jcraig, jdiggs, kling, mario, pdr, rniwa, samuel_white, schenney, sergio, zimmermann | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | 137056 | ||||||||
Bug Blocks: | |||||||||
Attachments: |
|
Description
Chris Dumez
2014-09-25 14:14:09 PDT
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. |