Ignore:
Timestamp:
May 19, 2016, 6:50:51 PM (10 years ago)
Author:
Chris Dumez
Message:

Improve compile-time assertions in is<>() / downcast<>()
https://bugs.webkit.org/show_bug.cgi?id=157817

Reviewed by Darin Adler.

Source/WebCore:

Add missing includes and drop unnecessary is<WebVTTElement>() check
in SharingResolver::canShareStyleWithElement() that was identified
by the new assertions. WebVTTElement inherits Element but the check
was done on a StyledElement.

  • accessibility/AccessibilityRenderObject.cpp:
  • accessibility/AccessibilitySVGElement.cpp:
  • css/CSSDefaultStyleSheets.cpp:
  • css/CSSParser.cpp:
  • css/CSSStyleSheet.cpp:
  • css/StyleResolver.cpp:
  • cssjit/SelectorCompiler.cpp:
  • dom/Document.cpp:
  • dom/Element.cpp:
  • dom/Node.cpp:
  • dom/Position.cpp:
  • editing/ApplyStyleCommand.cpp:
  • editing/FrameSelection.cpp:
  • editing/ReplaceSelectionCommand.cpp:
  • editing/TextIterator.cpp:
  • editing/VisiblePosition.cpp:
  • editing/VisibleUnits.cpp:
  • editing/cocoa/HTMLConverter.mm:
  • editing/htmlediting.cpp:
  • editing/markup.cpp:
  • html/GenericCachedHTMLCollection.cpp:
  • html/HTMLBodyElement.cpp:
  • html/HTMLFormElement.cpp:
  • html/HTMLLIElement.cpp:
  • html/HTMLNameCollection.cpp:
  • html/HTMLSelectElement.cpp:
  • html/parser/HTMLTreeBuilder.cpp:
  • inspector/InspectorDOMAgent.cpp:
  • inspector/InspectorStyleSheet.cpp:
  • loader/SubframeLoader.cpp:
  • loader/archive/cf/LegacyWebArchive.cpp:
  • mathml/MathMLElement.cpp:
  • page/EventHandler.cpp:
  • page/FrameView.cpp:
  • page/PageSerializer.cpp:
  • page/SpatialNavigation.cpp:
  • page/mac/EventHandlerMac.mm:
  • rendering/HitTestResult.cpp:
  • rendering/RenderBlockFlow.cpp:
  • rendering/RenderBox.cpp:
  • rendering/RenderBoxModelObject.cpp:
  • rendering/RenderElement.cpp:
  • rendering/RenderFieldset.cpp:
  • rendering/RenderLayer.cpp:
  • rendering/svg/RenderSVGTransformableContainer.cpp:
  • style/StyleSharingResolver.cpp:

(WebCore::Style::SharingResolver::canShareStyleWithElement):

  • svg/SVGAnimationElement.cpp:
  • svg/SVGFELightElement.cpp:
  • svg/SVGTextPositioningElement.cpp:

Source/WebKit2:

Add missing includes.

  • WebProcess/WebPage/WebFrame.cpp:
  • WebProcess/WebPage/WebPage.cpp:

Source/WTF:

  • wtf/Ref.h:

(WTF::is):
Add is<>() overloads taking a Ref<>() so that is<>() keeps working when
passing a Ref<>(), despite the new static assertions on the input type.
Some call sites were already leveraging this as it was working by
implicitly converting the Ref<T> into a T&.

  • wtf/TypeCasts.h:

(WTF::is):
(WTF::downcast):
Make static assertions stricter in is<>() / downcast<>() to catch more
cases where those are either unnecessary or incorrect.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r201201 r201205  
    3636#include "FrameView.h"
    3737#include "GraphicsContext.h"
     38#include "HTMLAnchorElement.h"
    3839#include "HTMLBodyElement.h"
    3940#include "HTMLButtonElement.h"
     
    4142#include "HTMLHtmlElement.h"
    4243#include "HTMLInputElement.h"
     44#include "HTMLLegendElement.h"
    4345#include "HTMLNames.h"
     46#include "HTMLSelectElement.h"
    4447#include "HTMLTextAreaElement.h"
    4548#include "HitTestResult.h"
Note: See TracChangeset for help on using the changeset viewer.