Changeset 65516 in webkit


Ignore:
Timestamp:
Aug 17, 2010 10:45:48 AM (14 years ago)
Author:
jcivelli@chromium.org
Message:

2010-08-17 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

    r65510 r65516  
     12010-08-17  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-17  Kelly Norton  <knorton@google.com>
    224
  • trunk/WebKit/chromium/WebKit.gyp

    r65501 r65516  
    701701                        '<(chromium_src_dir)/base/base.gyp:test_support_base',
    702702                        '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib',
     703                        '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
    703704                    ],
    704705                    'include_dirs': [
     
    719720                        ['OS=="win"', {
    720721                            'sources': [
    721                                 # FIXME: Port PopupMenuTest to Linux and Mac.
     722                                # FIXME: Port PopupMenuTest and WebFrameTest to Linux and Mac.
    722723                                'tests/PopupMenuTest.cpp',
    723724                                'tests/TransparencyWinTest.cpp',
    724725                                'tests/UniscribeHelperTest.cpp',
     726                                'tests/WebFrameTest.cpp',
    725727                            ],
    726728                        }],
  • trunk/WebKit/chromium/src/WebFrameImpl.cpp

    r63841 r65516  
    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

    r61957 r65516  
    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.