Changeset 286843 in webkit
- Timestamp:
- Dec 10, 2021, 4:19:40 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 13 edited
-
ChangeLog (modified) (1 diff)
-
accessibility/AccessibilityRenderObject.cpp (modified) (2 diffs)
-
page/FrameView.cpp (modified) (2 diffs)
-
rendering/RenderTreeAsText.cpp (modified) (2 diffs)
-
rendering/svg/RenderSVGResource.cpp (modified) (2 diffs)
-
rendering/svg/SVGRenderSupport.cpp (modified) (2 diffs)
-
rendering/svg/SVGRenderTreeAsText.cpp (modified) (2 diffs)
-
rendering/svg/SVGRenderTreeAsText.h (modified) (2 diffs)
-
rendering/updating/RenderTreeBuilder.cpp (modified) (3 diffs)
-
rendering/updating/RenderTreeBuilderSVG.cpp (modified) (6 diffs)
-
rendering/updating/RenderTreeBuilderSVG.h (modified) (2 diffs)
-
svg/SVGElement.cpp (modified) (1 diff)
-
svg/SVGSVGElement.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r286842 r286843 1 2021-12-10 Nikolas Zimmermann <nzimmermann@igalia.com> 2 3 [LBSE] Handle RenderSVGRoot in all places that handle LegacyRenderSVGRoot 4 https://bugs.webkit.org/show_bug.cgi?id=233872 5 6 Reviewed by Rob Buis. 7 8 Various places that handle LegacyRenderSVGRoot, also need to handle the 9 LBSE RenderSVGRoot renderer -- this patch plumbs in support for 10 RenderSVGRoot where necessary. 11 12 Covered by existing tests, no change in behaviour. 13 14 * accessibility/AccessibilityRenderObject.cpp: 15 (WebCore::AccessibilityRenderObject::elementPath const): 16 * page/FrameView.cpp: 17 (WebCore::FrameView::applyOverflowToViewport): 18 * rendering/RenderTreeAsText.cpp: 19 (WebCore::write): 20 * rendering/svg/RenderSVGResource.cpp: 21 (WebCore::RenderSVGResource::markForLayoutAndParentResourceInvalidation): 22 * rendering/svg/SVGRenderSupport.cpp: 23 (WebCore::layoutSizeOfNearestViewportChanged): 24 * rendering/svg/SVGRenderTreeAsText.cpp: 25 (WebCore::write): 26 * rendering/svg/SVGRenderTreeAsText.h: 27 * rendering/updating/RenderTreeBuilder.cpp: 28 (WebCore::RenderTreeBuilder::attachInternal): 29 (WebCore::RenderTreeBuilder::detach): 30 * rendering/updating/RenderTreeBuilderSVG.cpp: 31 (WebCore::RenderTreeBuilder::SVG::attach): 32 (WebCore::RenderTreeBuilder::SVG::detach): 33 * rendering/updating/RenderTreeBuilderSVG.h: 34 * svg/SVGElement.cpp: 35 (WebCore::SVGElement::childShouldCreateRenderer const): 36 * svg/SVGSVGElement.cpp: 37 (WebCore::SVGSVGElement::svgAttributeChanged): 38 (WebCore::SVGSVGElement::currentViewBoxRect const): 39 (WebCore::SVGSVGElement::currentViewportSize const): 40 1 41 2021-12-10 Nikolas Zimmermann <nzimmermann@igalia.com> 2 42 -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r286542 r286843 95 95 #include "RenderMathMLBlock.h" 96 96 #include "RenderMenuList.h" 97 #include "RenderSVGRoot.h" 97 98 #include "RenderSVGShape.h" 98 99 #include "RenderTableCell.h" … … 955 956 LayoutPoint parentOffset = axObjectCache()->getOrCreate(&*svgRoot)->elementRect().location(); 956 957 path.transform(AffineTransform().translate(parentOffset.x(), parentOffset.y())); 958 #if ENABLE(LAYER_BASED_SVG_ENGINE) 959 } else if (auto svgRoot = ancestorsOfType<RenderSVGRoot>(*m_renderer).first()) { 960 LayoutPoint parentOffset = axObjectCache()->getOrCreate(&*svgRoot)->elementRect().location(); 961 path.transform(AffineTransform().translate(parentOffset.x(), parentOffset.y())); 962 #endif 957 963 } 958 964 -
trunk/Source/WebCore/page/FrameView.cpp
r286772 r286843 88 88 #include "RenderLayerCompositor.h" 89 89 #include "RenderLayerScrollableArea.h" 90 #include "RenderSVGRoot.h" 90 91 #include "RenderScrollbar.h" 91 92 #include "RenderScrollbarPart.h" … … 648 649 Overflow overflowY = renderer.effectiveOverflowY(); 649 650 651 #if ENABLE(LAYER_BASED_SVG_ENGINE) 652 if (is<RenderSVGRoot>(renderer)) { 653 // FIXME: evaluate if we can allow overflow for these cases too. 654 // Overflow is always hidden when stand-alone SVG documents are embedded. 655 if (downcast<RenderSVGRoot>(renderer).isEmbeddedThroughFrameContainingSVGDocument()) { 656 overflowX = Overflow::Hidden; 657 overflowY = Overflow::Hidden; 658 } 659 } 660 #endif 661 650 662 if (is<LegacyRenderSVGRoot>(renderer)) { 651 663 // FIXME: evaluate if we can allow overflow for these cases too. -
trunk/Source/WebCore/rendering/RenderTreeAsText.cpp
r286392 r286843 64 64 #include "RenderSVGPath.h" 65 65 #include "RenderSVGResourceContainer.h" 66 #include "RenderSVGRoot.h" 66 67 #include "RenderSVGText.h" 67 68 #include "RenderTableCell.h" … … 574 575 return; 575 576 } 577 #if ENABLE(LAYER_BASED_SVG_ENGINE) 578 if (is<RenderSVGRoot>(o)) { 579 write(ts, downcast<RenderSVGRoot>(o), behavior); 580 return; 581 } 582 #endif 576 583 if (is<LegacyRenderSVGRoot>(o)) { 577 584 write(ts, downcast<LegacyRenderSVGRoot>(o), behavior); -
trunk/Source/WebCore/rendering/svg/RenderSVGResource.cpp
r286392 r286843 31 31 #include "RenderSVGResourceMasker.h" 32 32 #include "RenderSVGResourceSolidColor.h" 33 #include "RenderSVGRoot.h" 33 34 #include "RenderView.h" 34 35 #include "SVGResourceElementClient.h" … … 203 204 if (is<LegacyRenderSVGRoot>(object) && downcast<LegacyRenderSVGRoot>(object).isInLayout()) 204 205 object.setNeedsLayout(MarkOnlyThis); 206 #if ENABLE(LAYER_BASED_SVG_ENGINE) 207 else if (is<RenderSVGRoot>(object) && downcast<RenderSVGRoot>(object).isInLayout()) 208 object.setNeedsLayout(MarkOnlyThis); 209 #endif 205 210 else 206 211 object.setNeedsLayout(MarkContainingBlockChain); -
trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp
r286795 r286843 41 41 #include "RenderSVGResourceMarker.h" 42 42 #include "RenderSVGResourceMasker.h" 43 #include "RenderSVGRoot.h" 43 44 #include "RenderSVGText.h" 44 45 #include "RenderSVGTransformableContainer.h" … … 212 213 return downcast<RenderSVGViewportContainer>(*start).isLayoutSizeChanged(); 213 214 215 #if ENABLE(LAYER_BASED_SVG_ENGINE) 216 if (is<RenderSVGRoot>(*start)) 217 return downcast<RenderSVGRoot>(*start).isLayoutSizeChanged(); 218 #endif 214 219 return downcast<LegacyRenderSVGRoot>(*start).isLayoutSizeChanged(); 215 220 } -
trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
r286795 r286843 48 48 #include "RenderSVGResourceRadialGradientInlines.h" 49 49 #include "RenderSVGResourceSolidColor.h" 50 #include "RenderSVGRoot.h" 50 51 #include "RenderSVGShapeInlines.h" 51 52 #include "RenderSVGText.h" … … 508 509 } 509 510 511 #if ENABLE(LAYER_BASED_SVG_ENGINE) 512 void write(TextStream& ts, const RenderSVGRoot& root, OptionSet<RenderAsTextFlag> behavior) 513 { 514 writeStandardPrefix(ts, root, behavior); 515 writePositionAndStyle(ts, root, behavior); 516 ts << "\n"; 517 writeChildren(ts, root, behavior); 518 } 519 #endif 520 510 521 void write(TextStream& ts, const LegacyRenderSVGRoot& root, OptionSet<RenderAsTextFlag> behavior) 511 522 { -
trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.h
r286392 r286843 31 31 namespace WebCore { 32 32 33 class AffineTransform; 33 34 class Color; 34 35 class FloatRect; 35 36 class FloatSize; 37 class LegacyRenderSVGRoot; 36 38 class Node; 37 39 class RenderImage; … … 42 44 class RenderSVGInlineText; 43 45 class RenderSVGResourceContainer; 46 class RenderSVGRoot; 44 47 class RenderSVGShape; 45 class LegacyRenderSVGRoot;46 48 class RenderSVGText; 47 class AffineTransform;48 49 class SVGUnitTypes; 49 50 50 51 // functions used by the main RenderTreeAsText code 52 void write(WTF::TextStream&, const LegacyRenderSVGRoot&, OptionSet<RenderAsTextFlag>); 53 #if ENABLE(LAYER_BASED_SVG_ENGINE) 54 void write(WTF::TextStream&, const RenderSVGRoot&, OptionSet<RenderAsTextFlag>); 55 #endif 51 56 void write(WTF::TextStream&, const RenderSVGShape&, OptionSet<RenderAsTextFlag>); 52 void write(WTF::TextStream&, const LegacyRenderSVGRoot&, OptionSet<RenderAsTextFlag>);53 57 void writeSVGGradientStop(WTF::TextStream&, const RenderSVGGradientStop&, OptionSet<RenderAsTextFlag>); 54 58 void writeSVGResourceContainer(WTF::TextStream&, const RenderSVGResourceContainer&, OptionSet<RenderAsTextFlag>); -
trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp
r286542 r286843 51 51 #include "RenderSVGContainer.h" 52 52 #include "RenderSVGInline.h" 53 #include "RenderSVGRoot.h" 53 54 #include "RenderSVGText.h" 54 55 #include "RenderTable.h" … … 291 292 } 292 293 294 #if ENABLE(LAYER_BASED_SVG_ENGINE) 295 if (is<RenderSVGRoot>(parent)) { 296 svgBuilder().attach(downcast<RenderSVGRoot>(parent), WTFMove(child), beforeChild); 297 return; 298 } 299 #endif 300 293 301 if (is<LegacyRenderSVGRoot>(parent)) { 294 302 svgBuilder().attach(downcast<LegacyRenderSVGRoot>(parent), WTFMove(child), beforeChild); … … 374 382 if (is<RenderSVGContainer>(parent)) 375 383 return svgBuilder().detach(downcast<RenderSVGContainer>(parent), child); 384 385 #if ENABLE(LAYER_BASED_SVG_ENGINE) 386 if (is<RenderSVGRoot>(parent)) 387 return svgBuilder().detach(downcast<RenderSVGRoot>(parent), child); 388 #endif 376 389 377 390 if (is<LegacyRenderSVGRoot>(parent)) -
trunk/Source/WebCore/rendering/updating/RenderTreeBuilderSVG.cpp
r286392 r286843 30 30 #include "RenderSVGContainer.h" 31 31 #include "RenderSVGInline.h" 32 #include "RenderSVGRoot.h" 32 33 #include "RenderSVGText.h" 33 34 #include "RenderTreeBuilderBlock.h" … … 41 42 : m_builder(builder) 42 43 { 44 } 45 46 void RenderTreeBuilder::SVG::attach(LegacyRenderSVGRoot& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild) 47 { 48 auto& childToAdd = *child; 49 m_builder.attachToRenderElement(parent, WTFMove(child), beforeChild); 50 SVGResourcesCache::clientWasAddedToTree(childToAdd); 43 51 } 44 52 … … 60 68 } 61 69 62 void RenderTreeBuilder::SVG::attach(LegacyRenderSVGRoot& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild) 70 #if ENABLE(LAYER_BASED_SVG_ENGINE) 71 void RenderTreeBuilder::SVG::attach(RenderSVGRoot& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild) 63 72 { 64 73 auto& childToAdd = *child; … … 66 75 SVGResourcesCache::clientWasAddedToTree(childToAdd); 67 76 } 77 #endif 68 78 69 79 void RenderTreeBuilder::SVG::attach(RenderSVGText& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild) … … 74 84 SVGResourcesCache::clientWasAddedToTree(childToAdd); 75 85 parent.subtreeChildWasAdded(&childToAdd); 86 } 87 88 RenderPtr<RenderObject> RenderTreeBuilder::SVG::detach(LegacyRenderSVGRoot& parent, RenderObject& child) 89 { 90 SVGResourcesCache::clientWillBeRemovedFromTree(child); 91 return m_builder.detachFromRenderElement(parent, child); 76 92 } 77 93 … … 108 124 } 109 125 110 RenderPtr<RenderObject> RenderTreeBuilder::SVG::detach(LegacyRenderSVGRoot& parent, RenderObject& child) 126 #if ENABLE(LAYER_BASED_SVG_ENGINE) 127 RenderPtr<RenderObject> RenderTreeBuilder::SVG::detach(RenderSVGRoot& parent, RenderObject& child) 111 128 { 112 129 SVGResourcesCache::clientWillBeRemovedFromTree(child); 113 130 return m_builder.detachFromRenderElement(parent, child); 114 131 } 132 #endif 115 133 116 134 } -
trunk/Source/WebCore/rendering/updating/RenderTreeBuilderSVG.h
r286392 r286843 30 30 namespace WebCore { 31 31 32 class LegacyRenderSVGRoot; 32 33 class RenderSVGContainer; 33 34 class RenderSVGInline; 34 class LegacyRenderSVGRoot;35 class RenderSVGRoot; 35 36 class RenderSVGText; 36 37 … … 40 41 SVG(RenderTreeBuilder&); 41 42 43 void attach(LegacyRenderSVGRoot& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild); 42 44 void attach(RenderSVGContainer& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild); 43 45 void attach(RenderSVGInline& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild); 44 void attach(LegacyRenderSVGRoot& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild); 46 #if ENABLE(LAYER_BASED_SVG_ENGINE) 47 void attach(RenderSVGRoot& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild); 48 #endif 45 49 void attach(RenderSVGText& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild); 46 50 51 RenderPtr<RenderObject> detach(LegacyRenderSVGRoot& parent, RenderObject& child) WARN_UNUSED_RETURN; 52 RenderPtr<RenderObject> detach(RenderSVGContainer& parent, RenderObject& child) WARN_UNUSED_RETURN; 53 RenderPtr<RenderObject> detach(RenderSVGInline& parent, RenderObject& child) WARN_UNUSED_RETURN; 54 #if ENABLE(LAYER_BASED_SVG_ENGINE) 55 RenderPtr<RenderObject> detach(RenderSVGRoot& parent, RenderObject& child) WARN_UNUSED_RETURN; 56 #endif 47 57 RenderPtr<RenderObject> detach(RenderSVGText& parent, RenderObject& child) WARN_UNUSED_RETURN; 48 RenderPtr<RenderObject> detach(RenderSVGInline& parent, RenderObject& child) WARN_UNUSED_RETURN;49 RenderPtr<RenderObject> detach(RenderSVGContainer& parent, RenderObject& child) WARN_UNUSED_RETURN;50 RenderPtr<RenderObject> detach(LegacyRenderSVGRoot& parent, RenderObject& child) WARN_UNUSED_RETURN;51 58 52 59 private: -
trunk/Source/WebCore/svg/SVGElement.cpp
r285630 r286843 530 530 return false; 531 531 auto& svgChild = downcast<SVGElement>(child); 532 533 #if ENABLE(LAYER_BASED_SVG_ENGINE) 534 // If the layer based SVG engine is enabled, all renderers that do not support the 535 // RenderLayer aware layout / painting / hit-testing mode ('LBSE-mode') have to be skipped. 536 // Currently all renderers are skipped. 537 if (document().settings().layerBasedSVGEngineEnabled()) 538 return false; 539 #endif 532 540 533 541 static const QualifiedName* const invalidTextContent[] { -
trunk/Source/WebCore/svg/SVGSVGElement.cpp
r286392 r286843 33 33 #include "LegacyRenderSVGRoot.h" 34 34 #include "RenderSVGResource.h" 35 #include "RenderSVGRoot.h" 35 36 #include "RenderSVGViewportContainer.h" 36 37 #include "RenderView.h" … … 212 213 213 214 if (auto renderer = this->renderer()) { 215 #if ENABLE(LAYER_BASED_SVG_ENGINE) 216 if (is<RenderSVGRoot>(renderer) && downcast<RenderSVGRoot>(*renderer).isEmbeddedThroughFrameContainingSVGDocument()) 217 RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); 218 #endif 214 219 if (is<LegacyRenderSVGRoot>(renderer) && downcast<LegacyRenderSVGRoot>(*renderer).isEmbeddedThroughFrameContainingSVGDocument()) 215 220 RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); … … 476 481 return viewBox; 477 482 478 if (!is<LegacyRenderSVGRoot>(renderer())) 479 return { }; 480 if (!downcast<LegacyRenderSVGRoot>(*renderer()).isEmbeddedThroughSVGImage()) 483 bool isEmbeddedThroughSVGImage = false; 484 if (is<LegacyRenderSVGRoot>(renderer()) && downcast<LegacyRenderSVGRoot>(*renderer()).isEmbeddedThroughSVGImage()) 485 isEmbeddedThroughSVGImage = true; 486 #if ENABLE(LAYER_BASED_SVG_ENGINE) 487 else if (is<RenderSVGRoot>(renderer()) && downcast<RenderSVGRoot>(*renderer()).isEmbeddedThroughSVGImage()) 488 isEmbeddedThroughSVGImage = true; 489 #endif 490 491 if (!isEmbeddedThroughSVGImage) 481 492 return { }; 482 493 … … 487 498 488 499 // If no viewBox is specified but non-relative width/height values, then we 489 // should always synthesize a viewBox if we're embedded through a SVGImage. 500 // should always synthesize a viewBox if we're embedded through a SVGImage. 490 501 return { 0, 0, floatValueForLength(intrinsicWidth, 0), floatValueForLength(intrinsicHeight, 0) }; 491 502 } … … 499 510 auto& root = downcast<LegacyRenderSVGRoot>(*renderer()); 500 511 viewportSize = root.contentBoxRect().size() / root.style().effectiveZoom(); 512 #if ENABLE(LAYER_BASED_SVG_ENGINE) 513 } else if (is<RenderSVGRoot>(*renderer())) { 514 auto& root = downcast<RenderSVGRoot>(*renderer()); 515 viewportSize = root.contentBoxRect().size() / root.style().effectiveZoom(); 516 #endif 501 517 } else 502 518 viewportSize = downcast<RenderSVGViewportContainer>(*renderer()).viewport().size();
Note:
See TracChangeset
for help on using the changeset viewer.