Changeset 64196 in webkit
- Timestamp:
- Jul 28, 2010 3:55:19 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 7 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/Android.mk
r63735 r64196 639 639 rendering/RenderSVGResource.cpp \ 640 640 rendering/RenderSVGResourceClipper.cpp \ 641 rendering/RenderSVGResourceContainer.cpp \ 641 642 rendering/RenderSVGResourceFilter.cpp \ 642 643 rendering/RenderSVGResourceGradient.cpp \ … … 688 689 rendering/SVGRenderSupport.cpp \ 689 690 rendering/SVGRenderTreeAsText.cpp \ 691 rendering/SVGResources.cpp \ 692 rendering/SVGResourcesCache.cpp \ 693 rendering/SVGResourcesCycleSolver.cpp \ 690 694 rendering/SVGRootInlineBox.cpp \ 691 695 rendering/SVGShadowTreeElements.cpp \ -
trunk/WebCore/CMakeLists.txt
r64124 r64196 1545 1545 rendering/RenderSVGResource.cpp 1546 1546 rendering/RenderSVGResourceClipper.cpp 1547 rendering/RenderSVGResourceContainer.cpp 1547 1548 rendering/RenderSVGResourceFilter.cpp 1548 1549 rendering/RenderSVGResourceGradient.cpp … … 1567 1568 rendering/SVGRenderSupport.cpp 1568 1569 rendering/SVGRenderTreeAsText.cpp 1570 rendering/SVGResources.cpp 1571 rendering/SVGResourcesCache.cpp 1572 rendering/SVGResourcesCycleSolver.cpp 1569 1573 rendering/SVGRootInlineBox.cpp 1570 1574 rendering/SVGShadowTreeElements.cpp -
trunk/WebCore/ChangeLog
r64192 r64196 1 2010-07-28 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Dirk Schulze. 4 5 WebKit shouldn't ignore resource cycles, but break them as Opera does 6 https://bugs.webkit.org/show_bug.cgi?id=43031 7 8 Don't ignore resources containing cyclic references, but break them, as discussed on SVG WG mailing lists - to be compatible with Opera which already does that. 9 10 We used to lookup RenderSVGResourceContainers objects, by extracting the URI reference from the SVGRenderStyle, then utilizing getElementById() to lookup the 11 node, and access its renderer. Opera ignores such references, if they point to resources that contain cyclic references. Ignoring them would mean we have 12 to mutate the render style to empty the resource strings. That obviously doesn't work, as it would break expectations (getComputedStyle, etc.). 13 14 Introduce a SVGResources class that stores pointers to all resources, that can be applied to a RenderObject (clipper/filter/markers/masker). 15 Add a SVGResourcesCache class, which is basically a HashMap<RenderObject*, SVGResources*>. Whenever a RenderObject receives style, we extract the URI references 16 from the SVGRenderStyle, look up the RenderSVGResourceContainer* objects, and store them in a SVGResources* class. Then we execute a cycle detection logic, 17 which detects cyclic references and breaks them. Breaking them means just nulling the pointer to the resource in the SVGResources object. Those SVGResources 18 objects are cached, and used throughout the render tree to access resources. This way it's guaranteed that all cyclic references are resolved until layout/paint 19 phase begins. 20 21 This is the first chunk, which just adds the new SVGResources/SVGResourcesCache/SVGResourcesCycleSolver files, and does minor cleanups. 22 It's not yet glued in and doesn't affect any tests. 23 24 * Android.mk: Add SVGResources.* / SVGResourcesCache.* / SVGResourcesCycleSolver.* to build. 25 * CMakeLists.txt: Ditto. 26 * WebCore.gypi: Ditto. 27 * WebCore.pro: Ditto. 28 * WebCore.vcproj/WebCore.vcproj: Ditto. 29 * WebCore.xcodeproj/project.pbxproj: Ditto. 30 * rendering/RenderInline.h: Make styleDidChange protected, RenderSVGInline wants to override it. 31 * rendering/RenderSVGAllInOne.cpp: Add SVGResources.* / SVGResourcesCache.* / SVGResourcesCycleSolver.* to build. 32 * rendering/RenderSVGHiddenContainer.h: 33 (WebCore::RenderSVGHiddenContainer::isSVGHiddenContainer): Make isSVGHiddenContainer() private and renderName() public. 34 * rendering/RenderSVGResourceContainer.cpp: Added. Moved most methods from the header in the implementation file. 35 (WebCore::RenderSVGResourceContainer::RenderSVGResourceContainer): 36 (WebCore::RenderSVGResourceContainer::~RenderSVGResourceContainer): 37 (WebCore::RenderSVGResourceContainer::idChanged): 38 (WebCore::RenderSVGResourceContainer::transformOnNonScalingStroke): 39 (WebCore::RenderSVGResourceContainer::containsCyclicReference): 40 * rendering/RenderSVGResourceContainer.h: Add stubs, that SVGResourcesCache uses - a follow-up patch will add the logic. 41 (WebCore::RenderSVGResourceContainer::addClient): 42 (WebCore::RenderSVGResourceContainer::removeClient): 43 * rendering/SVGResources.cpp: Added. Holds a list of resources applyable to a RenderObject (fill/stroke, mask/markers/clipper/filter) 44 (WebCore::paintingResourceFromSVGPaint): Helper function looking up a RenderSVGResource for a SVGPaint object. 45 (WebCore::registerPendingResource): Helper function that register a RenderSVGResource as pending in the SVGDocumentExtensions. 46 (WebCore::SVGResources::buildCachedResources): Build a list of resources for a RenderObject/RenderStyle pair, handles pending resources, if needed. 47 (WebCore::SVGResources::invalidateClient): Helper function that calls invalidateClient() on all resources. 48 (WebCore::SVGResources::resourceDestroyed): Helper function that calls invalidateClients() on a certain resource, and nulls it. 49 (WebCore::SVGResources::buildSetOfResources): Helper function that stashes all resources present in the SVGResources members in a HashSet, used in SVGResourcesCycleSolver. 50 (WebCore::SVGResources::resetClipper): Helper methods nulling a resource. 51 (WebCore::SVGResources::resetFilter): Ditto. 52 (WebCore::SVGResources::resetMarkerStart): Ditto. 53 (WebCore::SVGResources::resetMarkerMid): Ditto. 54 (WebCore::SVGResources::resetMarkerEnd): Ditto. 55 (WebCore::SVGResources::resetMasker): Ditto. 56 (WebCore::SVGResources::resetFill): Ditto. 57 (WebCore::SVGResources::resetStroke): Ditto. 58 (WebCore::SVGResources::dump): 59 * rendering/SVGResources.h: Added. 60 (WebCore::SVGResources::clipper): Accesor of the cached m_foo variable. 61 (WebCore::SVGResources::filter): Ditto. 62 (WebCore::SVGResources::markerStart): Ditto. 63 (WebCore::SVGResources::markerMid): Ditto. 64 (WebCore::SVGResources::markerEnd): Ditto. 65 (WebCore::SVGResources::masker): Ditto. 66 (WebCore::SVGResources::fill): Ditto. 67 (WebCore::SVGResources::stroke): Ditto. 68 * rendering/SVGResourcesCache.cpp: Added. Holds a HashMap<RenderObject*, SVGResources*> and utility functions that update/invalidate the cache. 69 (WebCore::SVGResourcesCache::SVGResourcesCache): 70 (WebCore::SVGResourcesCache::~SVGResourcesCache): 71 (WebCore::SVGResourcesCache::addResourcesFromRenderObject): Build a SVGResources object for a RenderObject and adds it to the cache, then detects & breaks cycles using SVGResourcesCycleSolver. 72 (WebCore::SVGResourcesCache::removeResourcesFromRenderObject): Remove a SVGResources object from the cache. 73 (WebCore::resourcesCacheFromRenderObject): Helper function, retrieving a SVGResourcesCache method from a RenderObject. 74 (WebCore::SVGResourcesCache::cachedResourcesForRenderObject): Returns a SVGResources object from the cache. 75 (WebCore::SVGResourcesCache::clientLayoutChanged): (static) Calls invalidateClient() on all resources that are used by the passed RenderObject. 76 (WebCore::SVGResourcesCache::clientStyleChanged): (static) Updates the cache (calling removeResourceFromRenderObject/addResourcesFrom...) and invalidates resources in the ancestor chain. 77 (WebCore::SVGResourcesCache::clientUpdatedFromElement): (static) Does the same, without invalidating the ancestor chain. 78 (WebCore::SVGResourcesCache::clientDestroyed): (static) Calls removeResourcesFromRenderObject() on the SVGResourcesCache, for the given renderer. 79 (WebCore::SVGResourcesCache::resourceDestroyed): (static) Updates all SVGResources objects in the cache, that refer to the given resource. 80 * rendering/SVGResourcesCache.h: Added. 81 * rendering/SVGResourcesCycleSolver.cpp: Added. Detects and breaks cyclic references, just the way Opera handles it. Break cycles as they are detected. 82 (WebCore::SVGResourcesCycleSolver::SVGResourcesCycleSolver): 83 (WebCore::SVGResourcesCycleSolver::~SVGResourcesCycleSolver): 84 (WebCore::SVGResourcesCycleSolver::resourceContainsCycles): Operates only on the render tree 85 (WebCore::targetReferenceFromResource): Helper method for chainableResourceContainsCycles(). 86 (WebCore::setFollowLinkForChainableResource): Ditto. 87 (WebCore::SVGResourcesCycleSolver::chainableResourceContainsCycles): Handles cycles for resources that are chainable through xlink:href (filter/gradient/pattern). 88 (WebCore::SVGResourcesCycleSolver::resolveCycles): Main method executing the cycle breaking logic, utilizing (chainableResource)resourceContainsCycles. 89 (WebCore::SVGResourcesCycleSolver::breakCycle): Nulls a resource in the given SVGResources* object, to avoid using an invalid resource while rendering/layouting. 90 * rendering/SVGResourcesCycleSolver.h: Added. 91 * svg/SVGDocumentExtensions.cpp: 92 (WebCore::SVGDocumentExtensions::SVGDocumentExtensions): Create SVGResourcesCache object once per SVGDocumentExtensions. 93 * svg/SVGDocumentExtensions.h: 94 (WebCore::SVGDocumentExtensions::resourcesCache): Expose accesor method for the SVGResourcesCache. 95 1 96 2010-07-28 Zoltan Herczeg <zherczeg@webkit.org> 2 97 -
trunk/WebCore/WebCore.gypi
r64124 r64196 3313 3313 'rendering/RenderSVGResourceClipper.cpp', 3314 3314 'rendering/RenderSVGResourceClipper.h', 3315 'rendering/RenderSVGResourceContainer.cpp', 3316 'rendering/RenderSVGResourceContainer.h', 3315 3317 'rendering/RenderSVGResourceFilter.cpp', 3316 3318 'rendering/RenderSVGResourceFilter.h', … … 3419 3421 'rendering/SVGRenderTreeAsText.cpp', 3420 3422 'rendering/SVGRenderTreeAsText.h', 3423 'rendering/SVGResources.cpp', 3424 'rendering/SVGResources.h', 3425 'rendering/SVGResourcesCache.cpp', 3426 'rendering/SVGResourcesCache.h', 3427 'rendering/SVGResourcesCycleSolver.cpp', 3428 'rendering/SVGResourcesCycleSolver.h', 3421 3429 'rendering/SVGRootInlineBox.cpp', 3422 3430 'rendering/SVGRootInlineBox.h', -
trunk/WebCore/WebCore.pro
r64111 r64196 1827 1827 rendering/RenderSVGResource.h \ 1828 1828 rendering/RenderSVGResourceClipper.h \ 1829 rendering/RenderSVGResourceContainer.h \ 1829 1830 rendering/RenderSVGResourceFilter.h \ 1830 1831 rendering/RenderSVGResourceGradient.h \ … … 1895 1896 rendering/SVGRenderSupport.h \ 1896 1897 rendering/SVGRenderTreeAsText.h \ 1898 rendering/SVGResources.h \ 1899 rendering/SVGResourcesCache.h \ 1900 rendering/SVGResourcesCycleSolver.h \ 1897 1901 rendering/SVGRootInlineBox.h \ 1898 1902 rendering/SVGShadowTreeElements.h \ … … 2907 2911 rendering/RenderSVGResource.cpp \ 2908 2912 rendering/RenderSVGResourceClipper.cpp \ 2913 rendering/RenderSVGResourceContainer.cpp \ 2909 2914 rendering/RenderSVGResourceFilter.cpp \ 2910 2915 rendering/RenderSVGResourceGradient.cpp \ … … 2928 2933 rendering/SVGMarkerLayoutInfo.cpp \ 2929 2934 rendering/SVGRenderSupport.cpp \ 2935 rendering/SVGResources.cpp \ 2936 rendering/SVGResourcesCache.cpp \ 2937 rendering/SVGResourcesCycleSolver.cpp \ 2930 2938 rendering/SVGRootInlineBox.cpp \ 2931 2939 rendering/SVGShadowTreeElements.cpp \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r64124 r64196 29886 29886 </File> 29887 29887 <File 29888 RelativePath="..\rendering\RenderSVGResourceContainer.cpp" 29889 > 29890 <FileConfiguration 29891 Name="Debug|Win32" 29892 ExcludedFromBuild="true" 29893 > 29894 <Tool 29895 Name="VCCLCompilerTool" 29896 /> 29897 </FileConfiguration> 29898 <FileConfiguration 29899 Name="Release|Win32" 29900 ExcludedFromBuild="true" 29901 > 29902 <Tool 29903 Name="VCCLCompilerTool" 29904 /> 29905 </FileConfiguration> 29906 <FileConfiguration 29907 Name="Debug_Internal|Win32" 29908 ExcludedFromBuild="true" 29909 > 29910 <Tool 29911 Name="VCCLCompilerTool" 29912 /> 29913 </FileConfiguration> 29914 <FileConfiguration 29915 Name="Debug_Cairo|Win32" 29916 ExcludedFromBuild="true" 29917 > 29918 <Tool 29919 Name="VCCLCompilerTool" 29920 /> 29921 </FileConfiguration> 29922 <FileConfiguration 29923 Name="Release_Cairo|Win32" 29924 ExcludedFromBuild="true" 29925 > 29926 <Tool 29927 Name="VCCLCompilerTool" 29928 /> 29929 </FileConfiguration> 29930 <FileConfiguration 29931 Name="Debug_All|Win32" 29932 ExcludedFromBuild="true" 29933 > 29934 <Tool 29935 Name="VCCLCompilerTool" 29936 /> 29937 </FileConfiguration> 29938 </File> 29939 <File 29940 RelativePath="..\rendering\RenderSVGResourceContainer.h" 29941 > 29942 </File> 29943 <File 29888 29944 RelativePath="..\rendering\RenderSVGResourceFilter.cpp" 29889 29945 > … … 31357 31413 <File 31358 31414 RelativePath="..\rendering\SVGRenderTreeAsText.h" 31415 > 31416 </File> 31417 <File 31418 RelativePath="..\rendering\SVGResources.cpp" 31419 > 31420 <FileConfiguration 31421 Name="Debug|Win32" 31422 ExcludedFromBuild="true" 31423 > 31424 <Tool 31425 Name="VCCLCompilerTool" 31426 /> 31427 </FileConfiguration> 31428 <FileConfiguration 31429 Name="Release|Win32" 31430 ExcludedFromBuild="true" 31431 > 31432 <Tool 31433 Name="VCCLCompilerTool" 31434 /> 31435 </FileConfiguration> 31436 <FileConfiguration 31437 Name="Debug_Internal|Win32" 31438 ExcludedFromBuild="true" 31439 > 31440 <Tool 31441 Name="VCCLCompilerTool" 31442 /> 31443 </FileConfiguration> 31444 <FileConfiguration 31445 Name="Debug_Cairo|Win32" 31446 ExcludedFromBuild="true" 31447 > 31448 <Tool 31449 Name="VCCLCompilerTool" 31450 /> 31451 </FileConfiguration> 31452 <FileConfiguration 31453 Name="Release_Cairo|Win32" 31454 ExcludedFromBuild="true" 31455 > 31456 <Tool 31457 Name="VCCLCompilerTool" 31458 /> 31459 </FileConfiguration> 31460 <FileConfiguration 31461 Name="Debug_All|Win32" 31462 ExcludedFromBuild="true" 31463 > 31464 <Tool 31465 Name="VCCLCompilerTool" 31466 /> 31467 </FileConfiguration> 31468 </File> 31469 <File 31470 RelativePath="..\rendering\SVGResources.h" 31471 > 31472 </File> 31473 <File 31474 RelativePath="..\rendering\SVGResourcesCache.cpp" 31475 > 31476 <FileConfiguration 31477 Name="Debug|Win32" 31478 ExcludedFromBuild="true" 31479 > 31480 <Tool 31481 Name="VCCLCompilerTool" 31482 /> 31483 </FileConfiguration> 31484 <FileConfiguration 31485 Name="Release|Win32" 31486 ExcludedFromBuild="true" 31487 > 31488 <Tool 31489 Name="VCCLCompilerTool" 31490 /> 31491 </FileConfiguration> 31492 <FileConfiguration 31493 Name="Debug_Internal|Win32" 31494 ExcludedFromBuild="true" 31495 > 31496 <Tool 31497 Name="VCCLCompilerTool" 31498 /> 31499 </FileConfiguration> 31500 <FileConfiguration 31501 Name="Debug_Cairo|Win32" 31502 ExcludedFromBuild="true" 31503 > 31504 <Tool 31505 Name="VCCLCompilerTool" 31506 /> 31507 </FileConfiguration> 31508 <FileConfiguration 31509 Name="Release_Cairo|Win32" 31510 ExcludedFromBuild="true" 31511 > 31512 <Tool 31513 Name="VCCLCompilerTool" 31514 /> 31515 </FileConfiguration> 31516 <FileConfiguration 31517 Name="Debug_All|Win32" 31518 ExcludedFromBuild="true" 31519 > 31520 <Tool 31521 Name="VCCLCompilerTool" 31522 /> 31523 </FileConfiguration> 31524 </File> 31525 <File 31526 RelativePath="..\rendering\SVGResourcesCache.h" 31527 > 31528 </File> 31529 <File 31530 RelativePath="..\rendering\SVGResourcesCycleSolver.cpp" 31531 > 31532 <FileConfiguration 31533 Name="Debug|Win32" 31534 ExcludedFromBuild="true" 31535 > 31536 <Tool 31537 Name="VCCLCompilerTool" 31538 /> 31539 </FileConfiguration> 31540 <FileConfiguration 31541 Name="Release|Win32" 31542 ExcludedFromBuild="true" 31543 > 31544 <Tool 31545 Name="VCCLCompilerTool" 31546 /> 31547 </FileConfiguration> 31548 <FileConfiguration 31549 Name="Debug_Internal|Win32" 31550 ExcludedFromBuild="true" 31551 > 31552 <Tool 31553 Name="VCCLCompilerTool" 31554 /> 31555 </FileConfiguration> 31556 <FileConfiguration 31557 Name="Debug_Cairo|Win32" 31558 ExcludedFromBuild="true" 31559 > 31560 <Tool 31561 Name="VCCLCompilerTool" 31562 /> 31563 </FileConfiguration> 31564 <FileConfiguration 31565 Name="Release_Cairo|Win32" 31566 ExcludedFromBuild="true" 31567 > 31568 <Tool 31569 Name="VCCLCompilerTool" 31570 /> 31571 </FileConfiguration> 31572 <FileConfiguration 31573 Name="Debug_All|Win32" 31574 ExcludedFromBuild="true" 31575 > 31576 <Tool 31577 Name="VCCLCompilerTool" 31578 /> 31579 </FileConfiguration> 31580 </File> 31581 <File 31582 RelativePath="..\rendering\SVGResourcesCycleSolver.h" 31359 31583 > 31360 31584 </File> -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r64124 r64196 100 100 084CE5CD0F27DADC00E6240E /* WMLOptionElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 084CE5C90F27DADC00E6240E /* WMLOptionElement.cpp */; }; 101 101 084CE5CE0F27DADC00E6240E /* WMLOptionElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 084CE5CA0F27DADC00E6240E /* WMLOptionElement.h */; }; 102 084D0E3C11F5816100081E1A /* SVGResources.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 084D0E3811F5816100081E1A /* SVGResources.cpp */; }; 103 084D0E3D11F5816100081E1A /* SVGResources.h in Headers */ = {isa = PBXBuildFile; fileRef = 084D0E3911F5816100081E1A /* SVGResources.h */; settings = {ATTRIBUTES = (Private, ); }; }; 104 084D0E3E11F5816100081E1A /* SVGResourcesCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 084D0E3A11F5816100081E1A /* SVGResourcesCache.cpp */; }; 105 084D0E3F11F5816100081E1A /* SVGResourcesCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 084D0E3B11F5816100081E1A /* SVGResourcesCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; 102 106 084D2833110A7FCB0038239A /* SVGAnimatedPropertySynchronizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 084D2831110A7FCB0038239A /* SVGAnimatedPropertySynchronizer.h */; settings = {ATTRIBUTES = (Private, ); }; }; 103 107 084D2834110A7FCB0038239A /* SVGAnimatedPropertyTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = 084D2832110A7FCB0038239A /* SVGAnimatedPropertyTraits.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 113 117 085AFDC80F2977350061F2B3 /* WMLFormControlElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 085AFDC60F2977350061F2B3 /* WMLFormControlElement.cpp */; }; 114 118 085AFDC90F2977350061F2B3 /* WMLFormControlElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 085AFDC70F2977350061F2B3 /* WMLFormControlElement.h */; settings = {ATTRIBUTES = (); }; }; 119 085B05C211FAE16C004D65F6 /* SVGResourcesCycleSolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 085B05C011FAE16C004D65F6 /* SVGResourcesCycleSolver.cpp */; }; 120 085B05C311FAE16C004D65F6 /* SVGResourcesCycleSolver.h in Headers */ = {isa = PBXBuildFile; fileRef = 085B05C111FAE16C004D65F6 /* SVGResourcesCycleSolver.h */; }; 115 121 085B92BA0EFDE73D00E6123C /* FormDataBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 085B92B80EFDE73D00E6123C /* FormDataBuilder.cpp */; }; 116 122 085B92BB0EFDE73D00E6123C /* FormDataBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 085B92B90EFDE73D00E6123C /* FormDataBuilder.h */; settings = {ATTRIBUTES = (); }; }; 117 123 0865CCE60EDDF51B00DF9EC3 /* WMLNoopElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0865CCE40EDDF51B00DF9EC3 /* WMLNoopElement.cpp */; }; 118 124 0865CCE70EDDF51B00DF9EC3 /* WMLNoopElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 0865CCE50EDDF51B00DF9EC3 /* WMLNoopElement.h */; }; 125 086A400611F6D6B7002CEC53 /* RenderSVGResourceContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 086A400511F6D6B7002CEC53 /* RenderSVGResourceContainer.cpp */; }; 119 126 08700BE70F086C5300919419 /* InputElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08700BE60F086C5300919419 /* InputElement.cpp */; }; 120 127 087281550F26B9B600AFC596 /* OptionElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 087281510F26B9B600AFC596 /* OptionElement.cpp */; }; … … 5755 5762 084CE5C90F27DADC00E6240E /* WMLOptionElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLOptionElement.cpp; sourceTree = "<group>"; }; 5756 5763 084CE5CA0F27DADC00E6240E /* WMLOptionElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLOptionElement.h; sourceTree = "<group>"; }; 5764 084D0E3811F5816100081E1A /* SVGResources.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResources.cpp; sourceTree = "<group>"; }; 5765 084D0E3911F5816100081E1A /* SVGResources.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGResources.h; sourceTree = "<group>"; }; 5766 084D0E3A11F5816100081E1A /* SVGResourcesCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResourcesCache.cpp; sourceTree = "<group>"; }; 5767 084D0E3B11F5816100081E1A /* SVGResourcesCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGResourcesCache.h; sourceTree = "<group>"; }; 5757 5768 084D2831110A7FCB0038239A /* SVGAnimatedPropertySynchronizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertySynchronizer.h; sourceTree = "<group>"; }; 5758 5769 084D2832110A7FCB0038239A /* SVGAnimatedPropertyTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyTraits.h; sourceTree = "<group>"; }; … … 5768 5779 085AFDC60F2977350061F2B3 /* WMLFormControlElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLFormControlElement.cpp; sourceTree = "<group>"; }; 5769 5780 085AFDC70F2977350061F2B3 /* WMLFormControlElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLFormControlElement.h; sourceTree = "<group>"; }; 5781 085B05C011FAE16C004D65F6 /* SVGResourcesCycleSolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResourcesCycleSolver.cpp; sourceTree = "<group>"; }; 5782 085B05C111FAE16C004D65F6 /* SVGResourcesCycleSolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGResourcesCycleSolver.h; sourceTree = "<group>"; }; 5770 5783 085B92B80EFDE73D00E6123C /* FormDataBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormDataBuilder.cpp; sourceTree = "<group>"; }; 5771 5784 085B92B90EFDE73D00E6123C /* FormDataBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormDataBuilder.h; sourceTree = "<group>"; }; 5772 5785 0865CCE40EDDF51B00DF9EC3 /* WMLNoopElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLNoopElement.cpp; sourceTree = "<group>"; }; 5773 5786 0865CCE50EDDF51B00DF9EC3 /* WMLNoopElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLNoopElement.h; sourceTree = "<group>"; }; 5787 086A400511F6D6B7002CEC53 /* RenderSVGResourceContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResourceContainer.cpp; sourceTree = "<group>"; }; 5774 5788 08700BE60F086C5300919419 /* InputElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InputElement.cpp; sourceTree = "<group>"; }; 5775 5789 087281510F26B9B600AFC596 /* OptionElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OptionElement.cpp; sourceTree = "<group>"; }; … … 16767 16781 84BDA16911358D2A00DBF64C /* RenderSVGResourceClipper.cpp */, 16768 16782 84BDA16A11358D2A00DBF64C /* RenderSVGResourceClipper.h */, 16783 086A400511F6D6B7002CEC53 /* RenderSVGResourceContainer.cpp */, 16769 16784 08082372117987C100241DE8 /* RenderSVGResourceContainer.h */, 16770 16785 841FDC241178C9BE00F8AC9B /* RenderSVGResourceFilter.cpp */, … … 16853 16868 B2EBDC9A0AF77E3400AE4A68 /* SVGRenderTreeAsText.cpp */, 16854 16869 B2EBDC9B0AF77E3400AE4A68 /* SVGRenderTreeAsText.h */, 16870 084D0E3811F5816100081E1A /* SVGResources.cpp */, 16871 084D0E3911F5816100081E1A /* SVGResources.h */, 16872 084D0E3A11F5816100081E1A /* SVGResourcesCache.cpp */, 16873 084D0E3B11F5816100081E1A /* SVGResourcesCache.h */, 16874 085B05C011FAE16C004D65F6 /* SVGResourcesCycleSolver.cpp */, 16875 085B05C111FAE16C004D65F6 /* SVGResourcesCycleSolver.h */, 16855 16876 853CA9E40AEEC608002372DC /* SVGRootInlineBox.cpp */, 16856 16877 853CA9E50AEEC608002372DC /* SVGRootInlineBox.h */, … … 19848 19869 97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */, 19849 19870 CE172E011136E8CE0062A533 /* ZoomMode.h in Headers */, 19871 084D0E3D11F5816100081E1A /* SVGResources.h in Headers */, 19872 084D0E3F11F5816100081E1A /* SVGResourcesCache.h in Headers */, 19873 085B05C311FAE16C004D65F6 /* SVGResourcesCycleSolver.h in Headers */, 19850 19874 ); 19851 19875 runOnlyForDeploymentPostprocessing = 0; … … 22243 22267 E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */, 22244 22268 97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */, 22269 084D0E3C11F5816100081E1A /* SVGResources.cpp in Sources */, 22270 084D0E3E11F5816100081E1A /* SVGResourcesCache.cpp in Sources */, 22271 086A400611F6D6B7002CEC53 /* RenderSVGResourceContainer.cpp in Sources */, 22272 085B05C211FAE16C004D65F6 /* SVGResourcesCycleSolver.cpp in Sources */, 22245 22273 ); 22246 22274 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/rendering/RenderInline.h
r59988 r64196 75 75 void invalidateVerticalPosition() { m_verticalPosition = PositionUndefined; } 76 76 77 protected: 78 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); 79 77 80 private: 78 81 virtual RenderObjectChildList* virtualChildren() { return children(); } … … 140 143 #endif 141 144 142 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);143 145 virtual void updateBoxModelInfoFromStyle(); 144 146 -
trunk/WebCore/rendering/RenderSVGAllInOne.cpp
r61983 r64196 36 36 #include "RenderSVGResource.cpp" 37 37 #include "RenderSVGResourceClipper.cpp" 38 #include "RenderSVGResourceContainer.cpp" 38 39 #include "RenderSVGResourceFilter.cpp" 39 40 #include "RenderSVGResourceGradient.cpp" … … 58 59 #include "SVGRenderSupport.cpp" 59 60 #include "SVGRenderTreeAsText.cpp" 61 #include "SVGResources.cpp" 62 #include "SVGResourcesCache.cpp" 63 #include "SVGResourcesCycleSolver.cpp" 60 64 #include "SVGRootInlineBox.cpp" 61 65 #include "SVGShadowTreeElements.cpp" -
trunk/WebCore/rendering/RenderSVGHiddenContainer.h
r61759 r64196 38 38 RenderSVGHiddenContainer(SVGStyledElement*); 39 39 40 virtual const char* renderName() const { return "RenderSVGHiddenContainer"; } 41 40 42 private: 41 43 virtual bool isSVGHiddenContainer() const { return true; } 42 43 virtual const char* renderName() const { return "RenderSVGHiddenContainer"; }44 45 44 virtual bool requiresLayer() const { return false; } 46 45 -
trunk/WebCore/rendering/RenderSVGResourceContainer.h
r63421 r64196 34 34 public RenderSVGResource { 35 35 public: 36 RenderSVGResourceContainer(SVGStyledElement* node) 37 : RenderSVGHiddenContainer(node) 38 , RenderSVGResource() 39 , m_id(node->hasID() ? node->getIdAttribute() : nullAtom) 40 { 41 ASSERT(node->document()); 42 node->document()->accessSVGExtensions()->addResource(m_id, this); 43 } 36 RenderSVGResourceContainer(SVGStyledElement*); 37 virtual ~RenderSVGResourceContainer(); 44 38 45 virtual ~RenderSVGResourceContainer() 46 { 47 ASSERT(node()); 48 ASSERT(node()->document()); 49 node()->document()->accessSVGExtensions()->removeResource(m_id); 50 } 51 52 void idChanged() 53 { 54 ASSERT(node()); 55 ASSERT(node()->document()); 56 SVGDocumentExtensions* extensions = node()->document()->accessSVGExtensions(); 57 58 // Remove old id, that is guaranteed to be present in cache 59 extensions->removeResource(m_id); 60 m_id = static_cast<Element*>(node())->getIdAttribute(); 61 62 // It's possible that an element is referencing us with the new id, and has to be notified that we're existing now 63 if (extensions->isPendingResource(m_id)) { 64 OwnPtr<HashSet<SVGStyledElement*> > clients(extensions->removePendingResource(m_id)); 65 if (clients->isEmpty()) 66 return; 67 68 HashSet<SVGStyledElement*>::const_iterator it = clients->begin(); 69 const HashSet<SVGStyledElement*>::const_iterator end = clients->end(); 70 71 for (; it != end; ++it) { 72 if (RenderObject* renderer = (*it)->renderer()) 73 renderer->setNeedsLayout(true); 74 } 75 } 76 77 // Recache us with the new id 78 extensions->addResource(m_id, this); 79 } 39 void idChanged(); 80 40 81 41 virtual bool isSVGResourceContainer() const { return true; } … … 85 45 virtual bool childElementReferencesResource(const SVGRenderStyle*, const String&) const { return false; } 86 46 87 static AffineTransform transformOnNonScalingStroke(RenderObject* object, const AffineTransform resourceTransform) 88 { 89 if (!object->isRenderPath()) 90 return resourceTransform; 47 static AffineTransform transformOnNonScalingStroke(RenderObject*, const AffineTransform& resourceTransform); 91 48 92 SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(object->node()); 93 AffineTransform transform = resourceTransform; 94 transform.multiply(element->getScreenCTM()); 95 return transform; 96 } 49 bool containsCyclicReference(const Node* startNode) const; 97 50 98 bool containsCyclicReference(const Node* startNode) const 99 { 100 ASSERT(startNode->document()); 101 102 for (Node* node = startNode->firstChild(); node; node = node->nextSibling()) { 103 if (!node->isSVGElement()) 104 continue; 105 106 RenderObject* renderer = node->renderer(); 107 if (!renderer) 108 continue; 109 110 RenderStyle* style = renderer->style(); 111 if (!style) 112 continue; 113 114 const SVGRenderStyle* svgStyle = style->svgStyle(); 115 ASSERT(svgStyle); 116 117 // Let the class inheriting from us decide whether the child element references ourselves. 118 if (childElementReferencesResource(svgStyle, m_id)) 119 return true; 51 private: 52 friend class SVGResourcesCache; 120 53 121 // Dive into shadow tree to check for cycles there. 122 if (node->hasTagName(SVGNames::useTag)) { 123 ASSERT(renderer->isSVGShadowTreeRootContainer()); 124 if (Node* shadowRoot = static_cast<RenderSVGShadowTreeRootContainer*>(renderer)->rootElement()) { 125 if (containsCyclicReference(shadowRoot)) 126 return true; 127 } 128 129 } 130 131 if (node->hasChildNodes()) { 132 if (containsCyclicReference(node)) 133 return true; 134 } 135 } 136 137 return false; 138 } 54 // FIXME: No-ops for now, until follow-up patch on bug 43031 lands. 55 void addClient(RenderObject*) { } 56 void removeClient(RenderObject*) { } 139 57 140 58 private: -
trunk/WebCore/svg/SVGDocumentExtensions.cpp
r62767 r64196 35 35 #include "FrameLoader.h" 36 36 #include "Page.h" 37 #include "SMILTimeContainer.h" 37 38 #include "SVGSMILElement.h" 38 39 #include "SVGSVGElement.h" 39 #include "S MILTimeContainer.h"40 #include "ScriptController.h" 40 41 #include "ScriptableDocumentParser.h" 41 #include "ScriptController.h"42 42 43 43 namespace WebCore { … … 45 45 SVGDocumentExtensions::SVGDocumentExtensions(Document* doc) 46 46 : m_doc(doc) 47 , m_resourcesCache(new SVGResourcesCache) 47 48 { 48 49 } -
trunk/WebCore/svg/SVGDocumentExtensions.h
r58212 r64196 26 26 #if ENABLE(SVG) 27 27 #include "AtomicStringHash.h" 28 #include "SVGResourcesCache.h" 28 29 #include "StringImpl.h" 29 30 #include <wtf/HashMap.h> … … 60 61 void reportError(const String&); 61 62 63 SVGResourcesCache* resourcesCache() const { return m_resourcesCache.get(); } 64 62 65 private: 63 66 Document* m_doc; // weak reference … … 65 68 HashMap<AtomicString, RenderSVGResourceContainer*> m_resources; 66 69 HashMap<AtomicString, HashSet<SVGStyledElement*>*> m_pendingResources; 70 OwnPtr<SVGResourcesCache> m_resourcesCache; 67 71 68 72 SVGDocumentExtensions(const SVGDocumentExtensions&);
Note: See TracChangeset
for help on using the changeset viewer.