From: Jinwoo Song Date: Sat, 3 Aug 2013 09:01:59 +0000 (+0900) Subject: Do not search text in iframes with "display:none" style X-Git-Tag: 2.2_release~13 X-Git-Url: http://review.tizen.org/git/?p=framework%2Fweb%2Fwebkit-efl.git;a=commitdiff_plain;h=09b03fcb9f9a86b8f86405ba0e2ae220f440b641 Do not search text in iframes with "display:none" style [Title] Do not search text in iframes with "display:none" style [Issue#] N_SE-47308 [Problem] Text search takes too long time in below site. http://m.soundcloud.com/tracks/search?q=webkit [Cause] iframes with "display"none" have many strings but they are not visible. [Solution] Do not search iframes which do not have renderstyle. Change-Id: Ib8a76611e4b2bef3b135b45280448e976255d8b3 --- diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp index 9f1e6c4..243e87e 100644 --- a/Source/WebCore/page/Page.cpp +++ b/Source/WebCore/page/Page.cpp @@ -43,6 +43,9 @@ #include "FrameTree.h" #include "FrameView.h" #include "HTMLElement.h" +#if ENABLE(TIZEN_FIND_STRING) +#include "HTMLFrameOwnerElement.h" +#endif #include "HistogramSupport.h" #include "HistoryItem.h" #include "InspectorController.h" @@ -51,6 +54,9 @@ #include "MediaCanStartListener.h" #include "Navigator.h" #include "NetworkStateNotifier.h" +#if ENABLE(TIZEN_FIND_STRING) +#include "NodeRenderStyle.h" +#endif #include "PageCache.h" #include "PageGroup.h" #include "PluginData.h" @@ -539,6 +545,11 @@ void Page::findStringMatchingRanges(const String& target, FindOptions options, i if (frame->selection()->isRange()) frameWithSelection = frame; frame = incrementFrame(frame, true, false); +#if ENABLE(TIZEN_FIND_STRING) + // iframes with "display:none" style should not be searched. + if (frame && frame->ownerElement() && !frame->ownerElement()->renderStyle()) + break; +#endif } while (frame); if (matchRanges->isEmpty()) @@ -602,6 +613,11 @@ unsigned int Page::markAllMatchesForText(const String& target, FindOptions optio frame->editor()->setMarkedTextMatchesAreHighlighted(shouldHighlight); matches += frame->editor()->countMatchesForText(target, 0, options, limit ? (limit - matches) : 0, true, 0); frame = incrementFrame(frame, true, false); +#if ENABLE(TIZEN_FIND_STRING) + // iframes with "display:none" style should not be searched. + if (frame && frame->ownerElement() && !frame->ownerElement()->renderStyle()) + break; +#endif } while (frame); return matches; @@ -616,6 +632,11 @@ void Page::unmarkAllTextMatches() do { frame->document()->markers()->removeMarkers(DocumentMarker::TextMatch); frame = incrementFrame(frame, true, false); +#if ENABLE(TIZEN_FIND_STRING) + // iframes with "display:none" style should not be searched. + if (frame && frame->ownerElement() && !frame->ownerElement()->renderStyle()) + break; +#endif } while (frame); }