Changeset 257196 in webkit
- Timestamp:
- Feb 23, 2020 1:41:42 PM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r257194 r257196 1 2020-02-23 Darin Adler <darin@apple.com> 2 3 Follow up element iterator work by reducing includes and using is<> in a few more places 4 https://bugs.webkit.org/show_bug.cgi?id=207816 5 6 Reviewed by Antti Koivisto. 7 8 * accessibility/AccessibilityTableColumn.cpp: Removed unneeded includes. 9 * bindings/js/JSDOMWindowCustom.cpp: Ditto. 10 * dom/CustomElementRegistry.cpp: Ditto. 11 * dom/Node.cpp: Ditto. 12 * editing/markup.cpp: Ditto. 13 * html/GenericCachedHTMLCollection.cpp: Ditto. 14 * html/HTMLCollection.cpp: Ditto. 15 * html/HTMLFrameSetElement.cpp: Ditto. 16 * html/track/TextTrackCue.cpp: Ditto. 17 * page/scrolling/AxisScrollSnapOffsets.cpp: Ditto. 18 19 * platform/DataListSuggestionsClient.h: Reduced includes, use forward declarations. 20 21 * style/StyleResolver.cpp: 22 (WebCore::Style::isAtShadowBoundary): Use the is<ShadowRoot> function. 23 24 * rendering/svg/RenderSVGResourceClipper.cpp: 25 (WebCore::RenderSVGResourceClipper::pathOnlyClipping): Use is<RenderSVGText> and 26 is<SVGGraphicsElement>, tweak coding style a tiny bit, and fix wording of comments. 27 28 * svg/SVGAElement.cpp: 29 (WebCore::SVGAElement::createElementRenderer): Use is<SVGElement>. 30 31 * svg/SVGElement.cpp: Removed unneeded includes. 32 (WebCore::SVGElement::isOutermostSVGSVGElement): Use is<SVGElement> and 33 is<SVGForeignObjectElement>. 34 (WebCore::SVGElement::reportAttributeParsingError): Use is<SVGElement>. 35 (WebCore::SVGElement::updateRelativeLengthsInformation): Use 36 is<SVGGraphicsElement> and is<SVGElement>, and use an if statement instead of 37 a while loop since this doesn't loop. 38 1 39 2020-02-22 Darin Adler <darin@apple.com> 2 40 -
trunk/Source/WebCore/accessibility/AccessibilityTableColumn.cpp
r251798 r257196 32 32 #include "AXObjectCache.h" 33 33 #include "AccessibilityTableCell.h" 34 #include "HTMLCollection.h"35 34 #include "HTMLElement.h" 36 35 #include "HTMLNames.h" -
trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
r253483 r257196 25 25 #include "DOMWindowWebDatabase.h" 26 26 #include "Frame.h" 27 #include "HTMLCollection.h"28 27 #include "HTMLDocument.h" 29 28 #include "HTMLFrameOwnerElement.h" … … 39 38 #include "JSEventListener.h" 40 39 #include "JSHTMLAudioElement.h" 41 #include "JSHTMLCollection.h"42 40 #include "JSHTMLOptionElement.h" 43 41 #include "JSIDBFactory.h" -
trunk/Source/WebCore/dom/CustomElementRegistry.cpp
r250735 r257196 30 30 #include "DOMWindow.h" 31 31 #include "Document.h" 32 #include "Element.h"33 #include "ElementTraversal.h"34 32 #include "JSCustomElementInterface.h" 35 33 #include "JSDOMPromiseDeferred.h" -
trunk/Source/WebCore/dom/Node.cpp
r257036 r257196 48 48 #include "HTMLAreaElement.h" 49 49 #include "HTMLBodyElement.h" 50 #include "HTMLCollection.h"51 50 #include "HTMLElement.h" 52 51 #include "HTMLImageElement.h" -
trunk/Source/WebCore/editing/markup.cpp
r254800 r257196 76 76 #include "StyleProperties.h" 77 77 #include "TextIterator.h" 78 #include "TypedElementDescendantIterator.h"79 78 #include "VisibleSelection.h" 80 79 #include "VisibleUnits.h" -
trunk/Source/WebCore/html/GenericCachedHTMLCollection.cpp
r257194 r257196 28 28 29 29 #include "HTMLAppletElement.h" 30 #include "HTMLDataListElement.h"31 30 #include "HTMLFieldSetElement.h" 32 31 #include "HTMLNames.h" -
trunk/Source/WebCore/html/HTMLCollection.cpp
r248846 r257196 24 24 #include "HTMLCollection.h" 25 25 26 #include "CachedHTMLCollection.h"27 26 #include "HTMLNames.h" 28 27 #include "NodeRareData.h" -
trunk/Source/WebCore/html/HTMLFrameSetElement.cpp
r246490 r257196 34 34 #include "FrameLoaderClient.h" 35 35 #include "HTMLBodyElement.h" 36 #include "HTMLCollection.h"37 36 #include "HTMLFrameElement.h" 38 37 #include "HTMLNames.h" -
trunk/Source/WebCore/html/HTMLImageElement.cpp
- Property svn:executable deleted
-
trunk/Source/WebCore/html/track/TextTrackCue.cpp
r257125 r257196 39 39 #include "DOMRect.h" 40 40 #include "Event.h" 41 #include "HTMLCollection.h"42 41 #include "HTMLDivElement.h" 43 42 #include "HTMLStyleElement.h" -
trunk/Source/WebCore/page/scrolling/AxisScrollSnapOffsets.cpp
r254514 r257196 28 28 29 29 #include "ElementChildIterator.h" 30 #include "HTMLCollection.h"31 30 #include "HTMLElement.h" 32 31 #include "Length.h" -
trunk/Source/WebCore/platform/DataListSuggestionsClient.h
r235490 r257196 28 28 #if ENABLE(DATALIST_ELEMENT) 29 29 30 #include "IntRect.h" 31 #include <wtf/Vector.h> 30 #include <wtf/Forward.h> 32 31 33 32 namespace WebCore { 33 34 class IntRect; 34 35 35 36 class DataListSuggestionsClient { -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp
r254893 r257196 30 30 #include "HitTestResult.h" 31 31 #include "IntRect.h" 32 #include "Render Object.h"32 #include "RenderSVGText.h" 33 33 #include "RenderStyle.h" 34 34 #include "RenderView.h" … … 76 76 bool RenderSVGResourceClipper::pathOnlyClipping(GraphicsContext& context, const AffineTransform& animatedLocalTransform, const FloatRect& objectBoundingBox) 77 77 { 78 // If the current clip-path gets clipped itself, we have to fall back to masking.78 // If the current clip-path gets clipped itself, we have to fall back to masking. 79 79 if (style().clipPath()) 80 80 return false; 81 81 WindRule clipRule = WindRule::NonZero; 82 Path clipPath = Path();82 Path clipPath; 83 83 84 84 // If clip-path only contains one visible shape or path, we can use path-based clipping. Invisible … … 88 88 // See also http://www.w3.org/TR/SVG/painting.html#FillRuleProperty 89 89 for (Node* childNode = clipPathElement().firstChild(); childNode; childNode = childNode->nextSibling()) { 90 RenderObject* renderer = childNode->renderer();90 auto* renderer = childNode->renderer(); 91 91 if (!renderer) 92 92 continue; 93 // Only shapes or paths are supported for direct clipping. We need to fallback to masking for texts. 94 if (renderer->isSVGText()) 95 return false; 96 if (!childNode->isSVGElement() || !downcast<SVGElement>(*childNode).isSVGGraphicsElement()) 97 continue; 98 SVGGraphicsElement& styled = downcast<SVGGraphicsElement>(*childNode); 99 const RenderStyle& style = renderer->style(); 93 // Only shapes or paths are supported for direct clipping. We need to fall back to masking for texts. 94 if (is<RenderSVGText>(renderer)) 95 return false; 96 if (!is<SVGGraphicsElement>(*childNode)) 97 continue; 98 auto& style = renderer->style(); 100 99 if (style.display() == DisplayType::None || style.visibility() != Visibility::Visible) 101 continue; 102 const SVGRenderStyle& svgStyle = style.svgStyle(); 103 // Current shape in clip-path gets clipped too. Fallback to masking. 100 continue; 101 // Current shape in clip-path gets clipped too. Fall back to masking. 104 102 if (style.clipPath()) 105 103 return false; 106 // Fall back to masking,if there is more than one clipping path.107 if ( clipPath.isEmpty()) {108 clipPath = styled.toClipPath();109 clipRule = svgStyle.clipRule();110 } else111 return false;112 } 104 // Fall back to masking if there is more than one clipping path. 105 if (!clipPath.isEmpty()) 106 return false; 107 clipPath = downcast<SVGGraphicsElement>(*childNode).toClipPath(); 108 clipRule = style.svgStyle().clipRule(); 109 } 110 113 111 // Only one visible shape/path was found. Directly continue clipping and transform the content to userspace if necessary. 114 112 if (clipPathElement().clipPathUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) { -
trunk/Source/WebCore/style/StyleResolver.cpp
r256477 r257196 184 184 static inline bool isAtShadowBoundary(const Element& element) 185 185 { 186 auto* parentNode = element.parentNode(); 187 return parentNode && parentNode->isShadowRoot(); 186 return is<ShadowRoot>(element.parentNode()); 188 187 } 189 188 -
trunk/Source/WebCore/svg/SVGAElement.cpp
r251318 r257196 103 103 RenderPtr<RenderElement> SVGAElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) 104 104 { 105 if ( parentNode() && parentNode()->isSVGElement() && downcast<SVGElement>(*parentNode()).isTextContent())105 if (is<SVGElement>(parentNode()) && downcast<SVGElement>(*parentNode()).isTextContent()) 106 106 return createRenderer<RenderSVGInline>(*this, WTFMove(style)); 107 108 107 return createRenderer<RenderSVGTransformableContainer>(*this, WTFMove(style)); 109 108 } -
trunk/Source/WebCore/svg/SVGElement.cpp
r252546 r257196 28 28 29 29 #include "CSSPropertyParser.h" 30 #include "DeprecatedCSSOMValue.h"31 30 #include "Document.h" 32 #include "Element Iterator.h"31 #include "ElementChildIterator.h" 33 32 #include "Event.h" 34 33 #include "EventNames.h" … … 36 35 #include "HTMLNames.h" 37 36 #include "HTMLParserIdioms.h" 38 #include "RenderObject.h"39 #include "RenderSVGResource.h"40 37 #include "RenderSVGResourceFilter.h" 41 38 #include "RenderSVGResourceMasker.h" 42 39 #include "SVGDocumentExtensions.h" 43 40 #include "SVGElementRareData.h" 41 #include "SVGForeignObjectElement.h" 44 42 #include "SVGGraphicsElement.h" 45 43 #include "SVGImageElement.h" … … 54 52 #include "StyleAdjuster.h" 55 53 #include "XMLNames.h" 56 #include <wtf/Assertions.h>57 54 #include <wtf/HashMap.h> 58 55 #include <wtf/IsoMallocInlines.h> 59 56 #include <wtf/NeverDestroyed.h> 60 57 #include <wtf/StdLibExtras.h> 61 #include <wtf/text/WTFString.h>62 63 58 64 59 namespace WebCore { … … 209 204 // for a <symbol> element or a cloned <svg> element in the referenced tree. In that case 210 205 // we're always an inner <svg> element. 211 if (isInShadowTree() && parentOrShadowHostElement() && parentOrShadowHostElement()->isSVGElement())206 if (isInShadowTree() && is<SVGElement>(parentOrShadowHostElement())) 212 207 return false; 213 208 … … 217 212 218 213 // We act like an outermost SVG element, if we're a direct child of a <foreignObject> element. 219 if ( parentNode()->hasTagName(SVGNames::foreignObjectTag))214 if (is<SVGForeignObjectElement>(*parentNode())) 220 215 return true; 221 216 222 217 // This is true whenever this is the outermost SVG, even if there are HTML elements outside it 223 return ! parentNode()->isSVGElement();218 return !is<SVGElement>(*parentNode()); 224 219 } 225 220 … … 780 775 // with the SVG content. In general, the SVG user agent will include the unknown 781 776 // elements in the DOM but will otherwise ignore unknown elements. 782 if (!parentOrShadowHostElement() || parentOrShadowHostElement()->isSVGElement())777 if (!parentOrShadowHostElement() || is<SVGElement>(*parentOrShadowHostElement())) 783 778 return StyledElement::rendererIsNeeded(style); 784 779 … … 917 912 } 918 913 919 if (!element->isSVGGraphicsElement()) 920 return; 921 922 // Find first styled parent node, and notify it that we've changed our relative length state. 923 auto node = makeRefPtr(parentNode()); 924 while (node) { 925 if (!node->isSVGElement()) 926 break; 927 928 // Register us in the parent element map. 929 downcast<SVGElement>(*node).updateRelativeLengthsInformation(hasRelativeLengths, this); 930 break; 914 if (is<SVGGraphicsElement>(*element)) { 915 auto parent = makeRefPtr(parentNode()); 916 if (is<SVGElement>(parent)) 917 downcast<SVGElement>(*parent).updateRelativeLengthsInformation(hasRelativeLengths, this); 931 918 } 932 919 }
Note: See TracChangeset
for help on using the changeset viewer.