Changeset 65860 in webkit


Ignore:
Timestamp:
Aug 23, 2010 8:43:08 PM (14 years ago)
Author:
jcivelli@chromium.org
Message:

2010-08-23 Jay Civelli <jcivelli@chromium.org>

Reviewed by Darin Fisher.

Made WebFrame not report the text from hidden frames.
(some pages contain hidden frames with garbage text that
should not be indexed or used to detect the page's language).
https://bugs.webkit.org/show_bug.cgi?id=39456

  • WebKit.gyp:
  • public/WebCString.h: (WebKit::operator<):
  • public/WebURL.h: (WebKit::operator<):
  • src/WebCString.cpp: (WebKit::WebCString::compare):
  • src/WebFrameImpl.cpp: (WebKit::frameContentAsPlainText):
  • tests/RunAllTests.cpp: (main):
  • tests/WebFrameTest.cpp: Added.
Location:
trunk/WebKit/chromium
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/chromium/ChangeLog

    r65856 r65860  
     12010-08-23  Jay Civelli  <jcivelli@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Made WebFrame not report the text from hidden frames.
     6        (some pages contain hidden frames with garbage text that
     7        should not be indexed or used to detect the page's language).
     8        https://bugs.webkit.org/show_bug.cgi?id=39456
     9
     10        * WebKit.gyp:
     11        * public/WebCString.h:
     12        (WebKit::operator<):
     13        * public/WebURL.h:
     14        (WebKit::operator<):
     15        * src/WebCString.cpp:
     16        (WebKit::WebCString::compare):
     17        * src/WebFrameImpl.cpp:
     18        (WebKit::frameContentAsPlainText):
     19        * tests/RunAllTests.cpp:
     20        (main):
     21        * tests/WebFrameTest.cpp: Added.
     22
    1232010-08-23  Kent Tamura  <tkent@chromium.org>
    224
  • trunk/WebKit/chromium/WebKit.gyp

    r65821 r65860  
    735735                        '<(chromium_src_dir)/base/base.gyp:test_support_base',
    736736                        '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib',
     737                        '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
    737738                    ],
    738739                    'include_dirs': [
     
    752753                        ['OS=="win"', {
    753754                            'sources': [
    754                                 # FIXME: Port PopupMenuTest to Linux and Mac.
     755                                # FIXME: Port PopupMenuTest and WebFrameTest to Linux and Mac.
    755756                                'tests/PopupMenuTest.cpp',
    756757                                'tests/TransparencyWinTest.cpp',
    757758                                'tests/UniscribeHelperTest.cpp',
     759                                'tests/WebFrameTest.cpp',
    758760                            ],
    759761                        }],
  • trunk/WebKit/chromium/src/WebFrameImpl.cpp

    r65787 r65860  
    235235    FrameTree* frameTree = frame->tree();
    236236    for (Frame* curChild = frameTree->firstChild(); curChild; curChild = curChild->tree()->nextSibling()) {
     237        // Ignore the text of non-visible frames.
     238        RenderView* contentRenderer = curChild->contentRenderer();
     239        RenderPart* ownerRenderer = curChild->ownerRenderer();       
     240        if (!contentRenderer || !contentRenderer->width() || !contentRenderer->height()
     241            || (contentRenderer->x() + contentRenderer->width() <= 0) || (contentRenderer->y() + contentRenderer->height() <= 0)
     242            || (ownerRenderer && ownerRenderer->style() && ownerRenderer->style()->visibility() != VISIBLE)) {
     243            continue;
     244        }
     245
    237246        // Make sure the frame separator won't fill up the buffer, and give up if
    238247        // it will. The danger is if the separator will make the buffer longer than
  • trunk/WebKit/chromium/tests/RunAllTests.cpp

    r65536 r65860  
    3434#include "WebKit.h"
    3535#include "WebKitClient.h"
    36 
    37 // WebKitClient has a protected destructor, so we need to subclass.
    38 class DummyWebKitClient : public WebKit::WebKitClient {
    39 };
     36#include <webkit/support/webkit_support.h>
    4037
    4138int main(int argc, char** argv)
    4239{
    43     DummyWebKitClient dummyClient;
    44     WebKit::initialize(&dummyClient);
    45 
    46     int result = TestSuite(argc, argv).Run();
    47 
    48     WebKit::shutdown();
     40    TestSuite testSuite(argc, argv);
     41    // TestSuite must be created before SetUpTestEnvironment so it performs
     42    // initializations needed by WebKit support.
     43    webkit_support::SetUpTestEnvironmentForUnitTests();
     44    int result = testSuite.Run();
     45    webkit_support::TearDownTestEnvironment();
    4946    return result;
    5047}
Note: See TracChangeset for help on using the changeset viewer.