Changeset 163082 in webkit
- Timestamp:
- Jan 30, 2014, 7:49:54 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r163081 r163082 1 2014-01-30 Antti Koivisto <antti@apple.com> 2 3 WebPage::determinePrimarySnapshottedPlugIn is slow 4 https://bugs.webkit.org/show_bug.cgi?id=127905 5 6 Reviewed by Anders Carlsson. 7 8 * WebCore.exp.in: New exports 9 * WebCore.xcodeproj/project.pbxproj: 10 * html/HTMLPlugInImageElement.h: 11 (WebCore::HTMLPlugInImageElement>): Add isElementOfType<> 12 1 13 2014-01-30 Csaba Osztrogonác <ossy@webkit.org> 2 14 -
trunk/Source/WebCore/WebCore.exp.in
r163073 r163082 292 292 __ZN7WebCore13NodeTraversal13deepLastChildEPNS_4NodeE 293 293 __ZN7WebCore13NodeTraversal19nextAncestorSiblingEPKNS_4NodeE 294 __ZN7WebCore13NodeTraversal19nextAncestorSiblingEPKNS_4NodeES3_ 294 295 __ZN7WebCore13PageThrottler22reportInterestingEventEv 295 296 __ZN7WebCore13PageThrottlerD1Ev … … 1763 1764 __ZNK7WebCore6Widget25convertToContainingWindowERKNS_8IntPointE 1764 1765 __ZNK7WebCore6Widget9frameRectEv 1766 __ZNK7WebCore7Element10clientRectEv 1765 1767 __ZNK7WebCore7Element10screenRectEv 1766 1768 __ZNK7WebCore7Element10shadowRootEv … … 2544 2546 #if !defined(NDEBUG) 2545 2547 __ZN7WebCore14SQLiteDatabase22disableThreadingChecksEv 2548 __ZN7WebCore24NoEventDispatchAssertion7s_countE 2546 2549 __ZNK7WebCore7Element26fastAttributeLookupAllowedERKNS_13QualifiedNameE 2547 2550 #endif -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r163073 r163082 5887 5887 E1FF8F6C180DB5BE00132674 /* CryptoAlgorithmRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF8F6A180DB5BE00132674 /* CryptoAlgorithmRegistry.cpp */; }; 5888 5888 E1FF8F6D180DB5BE00132674 /* CryptoAlgorithmRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FF8F6B180DB5BE00132674 /* CryptoAlgorithmRegistry.h */; }; 5889 E401C27517CE53EC00C41A35 /* ElementIteratorAssertions.h in Headers */ = {isa = PBXBuildFile; fileRef = E401C27417CE53EC00C41A35 /* ElementIteratorAssertions.h */; };5889 E401C27517CE53EC00C41A35 /* ElementIteratorAssertions.h in Headers */ = {isa = PBXBuildFile; fileRef = E401C27417CE53EC00C41A35 /* ElementIteratorAssertions.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5890 5890 E424A39E1330DF0100CF6DC9 /* TileGridTile.h in Headers */ = {isa = PBXBuildFile; fileRef = E424A39D1330DF0100CF6DC9 /* TileGridTile.h */; }; 5891 5891 E424A3A01330DF1E00CF6DC9 /* TileGridTile.mm in Sources */ = {isa = PBXBuildFile; fileRef = E424A39F1330DF1E00CF6DC9 /* TileGridTile.mm */; }; … … 5945 5945 E45390AE0EAFF4B5003695C8 /* SystemMemoryIOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E45390AD0EAFF4B5003695C8 /* SystemMemoryIOS.cpp */; }; 5946 5946 E462A4A1113E71BE004A4220 /* IntPointHash.h in Headers */ = {isa = PBXBuildFile; fileRef = E462A4A0113E71BE004A4220 /* IntPointHash.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5947 E46A2B1C17CA65B9000DBCD8 /* ElementDescendantIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E46A2B1B17CA65B9000DBCD8 /* ElementDescendantIterator.h */; };5948 E46A2B1E17CA76B1000DBCD8 /* ElementChildIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E46A2B1D17CA76B1000DBCD8 /* ElementChildIterator.h */; };5947 E46A2B1C17CA65B9000DBCD8 /* ElementDescendantIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E46A2B1B17CA65B9000DBCD8 /* ElementDescendantIterator.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5948 E46A2B1E17CA76B1000DBCD8 /* ElementChildIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E46A2B1D17CA76B1000DBCD8 /* ElementChildIterator.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5949 5949 E47127CA163438A100ED6F5A /* StyleInvalidationAnalysis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E47A97CE163059FC005DCD99 /* StyleInvalidationAnalysis.cpp */; }; 5950 5950 E47127CB163438AE00ED6F5A /* StyleInvalidationAnalysis.h in Headers */ = {isa = PBXBuildFile; fileRef = E47A97CF163059FC005DCD99 /* StyleInvalidationAnalysis.h */; }; … … 5961 5961 E49BD9FA131FD2ED003C56F0 /* CSSValuePool.h in Headers */ = {isa = PBXBuildFile; fileRef = E49BD9F9131FD2ED003C56F0 /* CSSValuePool.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5962 5962 E49BDA0B131FD3E5003C56F0 /* CSSValuePool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E49BDA0A131FD3E5003C56F0 /* CSSValuePool.cpp */; }; 5963 E4AE7C1617D1BB950009FB31 /* ElementIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E4AE7C1517D1BB950009FB31 /* ElementIterator.h */; };5964 E4AE7C1A17D232350009FB31 /* ElementAncestorIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E4AE7C1917D232350009FB31 /* ElementAncestorIterator.h */; };5963 E4AE7C1617D1BB950009FB31 /* ElementIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E4AE7C1517D1BB950009FB31 /* ElementIterator.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5964 E4AE7C1A17D232350009FB31 /* ElementAncestorIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E4AE7C1917D232350009FB31 /* ElementAncestorIterator.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5965 5965 E4AFCFA50DAF29A300F5F55C /* UnitBezier.h in Headers */ = {isa = PBXBuildFile; fileRef = E4AFCFA40DAF29A300F5F55C /* UnitBezier.h */; }; 5966 5966 E4AFD00B0DAF335400F5F55C /* SMILTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4AFD0050DAF335400F5F55C /* SMILTime.cpp */; }; … … 5992 5992 E4D58EB817B4ED8900CBDCA8 /* StyleFontSizeFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4D58EB617B4ED8900CBDCA8 /* StyleFontSizeFunctions.cpp */; }; 5993 5993 E4D58EB917B4ED8900CBDCA8 /* StyleFontSizeFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = E4D58EB717B4ED8900CBDCA8 /* StyleFontSizeFunctions.h */; }; 5994 E4D58EBB17B8F12800CBDCA8 /* ElementTraversal.h in Headers */ = {isa = PBXBuildFile; fileRef = E4D58EBA17B8F12800CBDCA8 /* ElementTraversal.h */; };5994 E4D58EBB17B8F12800CBDCA8 /* ElementTraversal.h in Headers */ = {isa = PBXBuildFile; fileRef = E4D58EBA17B8F12800CBDCA8 /* ElementTraversal.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5995 5995 E4D687770ED7AE3D006EA978 /* PurgeableBufferMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4D687760ED7AE3D006EA978 /* PurgeableBufferMac.cpp */; }; 5996 5996 E4D687790ED7AE4F006EA978 /* PurgeableBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = E4D687780ED7AE4F006EA978 /* PurgeableBuffer.h */; }; -
trunk/Source/WebCore/html/HTMLPlugInImageElement.h
r162139 r163082 173 173 inline bool isHTMLPlugInImageElement(const HTMLPlugInElement& element) { return element.isPlugInImageElement(); } 174 174 inline bool isHTMLPlugInImageElement(const Node& node) { return node.isPluginElement() && toHTMLPlugInElement(node).isPlugInImageElement(); } 175 template <> inline bool isElementOfType<const HTMLPlugInImageElement>(const Element& element) { return isHTMLPlugInImageElement(element); } 175 176 NODE_TYPE_CASTS(HTMLPlugInImageElement) 176 177 -
trunk/Source/WebKit2/ChangeLog
r163079 r163082 1 2014-01-30 Antti Koivisto <antti@apple.com> 2 3 WebPage::determinePrimarySnapshottedPlugIn is slow 4 https://bugs.webkit.org/show_bug.cgi?id=127905 5 6 Reviewed by Anders Carlsson. 7 8 PLT before: 9 132.0ms 0.8% 0,0 WebKit::WebPage::determinePrimarySnapshottedPlugIn() 10 130.0ms 0.8% 0,0 WebCore::RenderView::hitTest(WebCore::HitTestRequest const&, WebCore::HitTestResult&) 11 12 After: 13 7.0ms 0.0% 0,0 WebKit::WebPage::determinePrimarySnapshottedPlugIn() 14 3.0ms 0.0% 0,0 WebCore::RenderView::hitTest(WebCore::HitTestRequest const&, WebCore::HitTestResult&) 15 16 * WebProcess/WebPage/WebPage.cpp: 17 (WebKit::WebPage::determinePrimarySnapshottedPlugIn): 18 19 Instead of shotgunning the page with hit tests, do a DOM crawl for plugins 20 and hit test the centers. 21 1 22 2014-01-30 Andrei Bucur <abucur@adobe.com> 2 23 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r163079 r163082 99 99 #include <WebCore/DragData.h> 100 100 #include <WebCore/DragSession.h> 101 #include <WebCore/ElementIterator.h> 101 102 #include <WebCore/EventHandler.h> 102 103 #include <WebCore/FocusController.h> … … 3993 3994 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC) 3994 3995 static int primarySnapshottedPlugInSearchLimit = 3000; 3995 static int primarySnapshottedPlugInSearchGap = 200;3996 3996 static float primarySnapshottedPlugInSearchBucketSize = 1.1; 3997 3997 static int primarySnapshottedPlugInMinimumWidth = 400; … … 4036 4036 ++m_numberOfPrimarySnapshotDetectionAttempts; 4037 4037 4038 RenderView* renderView = corePage()->mainFrame().view()->renderView(); 4038 MainFrame& mainFrame = corePage()->mainFrame(); 4039 if (!mainFrame.view()) 4040 return; 4041 if (!mainFrame.view()->renderView()) 4042 return; 4043 RenderView& mainRenderView = *mainFrame.view()->renderView(); 4039 4044 4040 4045 IntRect searchRect = IntRect(IntPoint(), corePage()->mainFrame().view()->contentsSize()); … … 4043 4048 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowChildFrameContent | HitTestRequest::IgnoreClipping | HitTestRequest::DisallowShadowContent); 4044 4049 4045 HashSet<RenderObject*> seenRenderers; 4046 HTMLPlugInImageElement* candidatePlugIn = 0; 4050 HTMLPlugInImageElement* candidatePlugIn = nullptr; 4047 4051 unsigned candidatePlugInArea = 0; 4048 4052 4049 for (int x = searchRect.x(); x <= searchRect.width(); x += primarySnapshottedPlugInSearchGap) { 4050 for (int y = searchRect.y(); y <= searchRect.height(); y += primarySnapshottedPlugInSearchGap) { 4051 HitTestResult hitTestResult = HitTestResult(LayoutPoint(x, y)); 4052 renderView->hitTest(request, hitTestResult); 4053 for (Frame* frame = &mainFrame; frame; frame = frame->tree().traverseNext()) { 4054 if (!frame->loader().subframeLoader().containsPlugins()) 4055 continue; 4056 if (!frame->document() || !frame->view()) 4057 continue; 4058 for (auto& plugInImageElement : descendantsOfType<HTMLPlugInImageElement>(*frame->document())) { 4059 if (plugInImageElement.displayState() == HTMLPlugInElement::Playing) 4060 continue; 4061 4062 IntRect plugInRectRelativeToView = plugInImageElement.clientRect(); 4063 if (plugInRectRelativeToView.isEmpty()) 4064 continue; 4065 IntSize scrollOffset = mainFrame.view()->scrollOffsetRelativeToDocument(); 4066 IntRect plugInRectRelativeToTopDocument(plugInRectRelativeToView.location() + scrollOffset, plugInRectRelativeToView.size()); 4067 if (!plugInRectRelativeToTopDocument.intersects(searchRect)) 4068 continue; 4069 4070 HitTestResult hitTestResult(plugInRectRelativeToTopDocument.center()); 4071 mainRenderView.hitTest(request, hitTestResult); 4053 4072 4054 4073 Element* element = hitTestResult.innerElement(); 4055 if ( !element)4074 if (element != &plugInImageElement) 4056 4075 continue; 4057 4076 4058 RenderObject* renderer = element->renderer();4077 auto renderer = plugInImageElement.renderer(); 4059 4078 if (!renderer || !renderer->isBox()) 4060 4079 continue; 4061 4062 RenderBox* renderBox = toRenderBox(renderer); 4063 4064 if (!seenRenderers.add(renderer).isNewEntry) 4080 auto& renderBox = toRenderBox(*renderer); 4081 if (renderBox.contentWidth() < primarySnapshottedPlugInMinimumWidth || renderBox.contentHeight() < primarySnapshottedPlugInMinimumHeight) 4065 4082 continue; 4066 4083 4067 if (!element->isPluginElement()) 4068 continue; 4069 4070 HTMLPlugInElement* plugInElement = toHTMLPlugInElement(element); 4071 if (!plugInElement->isPlugInImageElement()) 4072 continue; 4073 4074 HTMLPlugInImageElement* plugInImageElement = toHTMLPlugInImageElement(plugInElement); 4075 4076 if (plugInElement->displayState() == HTMLPlugInElement::Playing) 4077 continue; 4078 4079 if (renderBox->contentWidth() < primarySnapshottedPlugInMinimumWidth || renderBox->contentHeight() < primarySnapshottedPlugInMinimumHeight) 4080 continue; 4081 4082 LayoutUnit contentArea = renderBox->contentWidth() * renderBox->contentHeight(); 4083 4084 LayoutUnit contentArea = renderBox.contentWidth() * renderBox.contentHeight(); 4084 4085 if (contentArea > candidatePlugInArea * primarySnapshottedPlugInSearchBucketSize) { 4085 candidatePlugIn = plugInImageElement;4086 candidatePlugIn = &plugInImageElement; 4086 4087 candidatePlugInArea = contentArea; 4087 4088 } 4088 4089 } 4089 4090 } 4090 4091 4091 if (!candidatePlugIn) { 4092 4092 LOG(Plugins, "Primary Plug-In Detection: fail - did not find a candidate plug-in.");
Note:
See TracChangeset
for help on using the changeset viewer.